nsg-ethz / p4-utils

Extension to Mininet that makes P4 networks easier to build
GNU General Public License v2.0
175 stars 65 forks source link

Installing issue #62

Closed MohamadAlAdraa closed 8 months ago

MohamadAlAdraa commented 9 months ago

Hi,

I am trying to install p4-utils on ubuntu 22.04. I am using the new install script. It is installed successfully. When I try to write a controller, I am importing the following module: from p4utils.utils.sswitch_thrift_API import SimpleSwitchThriftAPI

which is giving me the following error: Traceback (most recent call last): File "/home/mohamad/testbed-P4-emulator/controllers/ciena-controller.py", line 2, in from p4utils.utils.sswitch_thrift_API import SimpleSwitchThriftAPI File "/home/mohamad/p4-tools/p4-utils/p4utils/utils/sswitch_thrift_API.py", line 34, in from sswitch_runtime import SimpleSwitch ModuleNotFoundError: No module named 'sswitch_runtime'

so inside the sswitch_thrift_API.py there is the following imports: from sswitch_runtime import SimpleSwitch from sswitch_runtime.ttypes import *

so sswitch_runtime cannot be found, what can be the problem?

thank you

edgar-costa commented 8 months ago

Does it work if you do import p4utils?

MohamadAlAdraa commented 8 months ago

Hi @edgar-costa,

Yes, see the following image. Capture

the only missing module is sswitch_runtime, as you see here it is not there compiler is not able to find this module. Capture1

Is it something need to be fixed in the installation file?

Thanks.

edgar-costa commented 8 months ago

Hi @MohamadAlAdraa

Did you install bmv2 and p4c with my scripts? Or only p4utils? I think that might be the problem.

Our install process is the following: https://github.com/nsg-ethz/p4-utils/blob/master/install-tools/install-p4-dev.sh

Try to run the function: site_packages_fix that might fix it.

Please tell me if this fixes it so I can add a note in the installing process.

MohamadAlAdraa commented 8 months ago

Hi @edgar-costa,

My last question would be, what is the difference between setQueueMaxSize and set_queu_depth and set_queue_rate?

edgar-costa commented 8 months ago

Hi @MohamadAlAdraa ,

Did what I told you to do in the last message fix the issue? I would like to know it.

Answering your questions:

MohamadAlAdraa commented 8 months ago

Hi @edgar-costa,

Yes, I was pulling the main from bmv2 and p4c and changing on them. However, when I pulled the exact commit you are specifying in the installation script and I changed on it, it worked fine.

Thank you for your help.