p4lang / behavioral-model

The reference P4 software switch
Apache License 2.0
536 stars 328 forks source link

Question: How to get the bmv2 docker image? #552

Closed dingrui37 closed 6 years ago

dingrui37 commented 6 years ago

I want to use bmv2 in my CI environment, I think using docker is the best choice. However, I have a few little questions. I searched "p4" on Docker Hub and found a repo. I want to know if this image is the official version? This Dockerfile is different from github. Should I build images with Dockerfile on github manually or download it directly from Docker Hub? Because of the lack of description of the tags, does the stable and latest support gRPC? Thanks. image

antoninbas commented 6 years ago

This dockerhub repo is the official one and the one I use for testing. There are 3 interesting docker images:

dingrui37 commented 6 years ago

I tried the latest version. It can be connected, but the set pipeline config the action is failed. Perhaps the bmv2 version is too old.

2018-02-09 13:35:06,578 | INFO | pool-46-thread-1 | RuntimeStub | 331 - org.opendaylight.p4plugin.runtime-impl - 0.1.0.SNAPSHOT | Set pipeline config exception, Status = Status{code=INVALID_ARGUMENT, description=Invalid SetForwardingPipeline action, cause=null}, Reason = INVALID_ARGUMENT: Invalid SetForwardingPipeline action

The bmv2 version on latest docker image:

root@94b42d119ba0:/behavioral-model# simple_switch_grpc --version
1.10.0-unknown

The bmv2 version on my local machine:

hll@hll:/home/opendaylight/p4lang/behavioral-model/mininet$ simple_switch_grpc --version
1.8.0-41c1f2ed

dr@dr:/home/opendaylight/P4/p4lang/behavioral-model$ simple_switch_grpc --version
1.9.0-0f53201b

As a result, I want to build image by myself with the Dockerfile.grpc file. Unfortunately, it is failed too, because of many network problems(As you know, we cannot access many networks in China and in private company network). Could you please build a image that support P4Runtimeand mininet, then I can pull it from Docker Hub, thank you very much. If you have a chance to China, I will invite you to taste Chinese food, haha. Thanks again.

sudo docker image build --tag p4lang/bmv2_grpc:1.0 -f Dockerfile.grpc .
....
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/universe/source/Sources  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.88.152 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/universe/source/Sources  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.88.152 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/main/binary-amd64/Packages  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.88.152 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
The command '/bin/sh -c apt-get update &&     apt-get install -y --no-install-recommends git ca-certificates' returned a non-zero code: 100
dr@dr:/home/opendaylight/P4/p4lang/behavioral-model$ 
antoninbas commented 6 years ago

I believe you should use Dockerfile, not Dockerfile.grpc (I didn't mention Dockerfile.grpc in my answer for a specific reason).

While I could build a new image, don't you think you would get the same error Invalid SetForwardingPipeline action? Maybe you should try investigating this error first. If my memory serves me right, it is a pretty unambiguous error which means that you didn't set the action field in the SetForwardingPipelineRequest message: https://github.com/p4lang/PI/blob/master/proto/p4/p4runtime.proto#L469

The latest image that you pull from dockergub cannot be too old; it includes the latest version of PI + bmv2.

dingrui37 commented 6 years ago

I did not analyze the problem carefully, the SetForwardingPipelineConfigRequest message has been changed, I will update my code.