Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Dockerfile to build p4tools by default. #4049

Merged
merged 2 commits into from
Jun 27, 2023

Conversation

chrispsommers
Copy link
Contributor

Build p4tools into p4c docker image by default. In particular, this will make p4testgen easily available in the prebuilt docker image on dockerhub/p4lang/p4c.

Impact:

  • On my x86 platform, the p4c docker image build time increased from 29 min to 37 min. Since the main intent is to simplify developers' lives by using a prebuilt image, this seems like a good tradeoff. Building is done in the background in a CI pipeline.
  • The docker p4c image size increased from 1.59GB to 1.70GB.

@onf-cla-manager
Copy link

onf-cla-manager bot commented Jun 27, 2023

Hi @chrispsommers, this is the ONF bot 🤖 I'm glad you want to contribute to our projects! However, before accepting your contribution, we need to ask you to sign a Contributor License Agreement (CLA). You can do it online, it will take only a few minutes:

✒️ 👉 https://cla.opennetworking.org

After signing, make sure to add your Github user ID chrispsommers to the agreement.

For more information or help:"
https://wiki.opennetworking.org/x/BgCUI

Copy link
Collaborator

@fruffy fruffy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! The size increase makes sense. The P4Tools framework is rather large and pulls in a dependencies such as Z3.

@fruffy
Copy link
Collaborator

fruffy commented Jun 27, 2023

The nanomsg installation is failing for Ubuntu 18. We may consider disable P4Testgen support for this particular CI run.

@chrispsommers
Copy link
Contributor Author

I noticed that docker build under Ubuntu 18.04 fails after adding p4toolks to the build. It looks like lack of Python support in older distros. https://github.com/p4lang/p4c/actions/runs/5384634043/jobs/9772783270?pr=4049

It would be a shame to suppress routine docker build/publish of p4tools because it fails in an older OS. Any opinions on how to proceed? I could experiment with docker build-args to suppress building p4tools for older images which don't support it.

@fruffy
Copy link
Collaborator

fruffy commented Jun 27, 2023

I noticed that docker build under Ubuntu 18.04 fails after adding p4toolks to the build. It looks like lack of Python support in older distros. https://github.com/p4lang/p4c/actions/runs/5384634043/jobs/9772783270?pr=4049

It would be a shame to suppress routine docker build/publish of p4tools because it fails in an older OS. Any opinions on how to proceed? I could experiment with docker build-args to suppress building p4tools for older images which don't support it.

Yes, this is part of a discussion here #3986. Technically, we do not need nanomsg, which is the installation that is failing. But P4Tools has never been tested on Ubuntu 18.04 and I believe that is not the only problem. What we can do is to disable building P4Tools for Ubuntu 18.04 here:
https://github.com/p4lang/p4c/blob/main/tools/ci-build.sh#L82

@chrispsommers
Copy link
Contributor Author

What we can do is to disable building P4Tools for Ubuntu 18.04 here:
https://github.com/p4lang/p4c/blob/main/tools/ci-build.sh#L82

Thanks! I came to the same conclusion about where to disable p4tools build for 18.04 and am testing a fix now. Fortunately, the Dockerfile already parameterized everything with ARG so it's a simple thing to change.

@fruffy fruffy merged commit a6553f1 into p4lang:main Jun 27, 2023
@chrispsommers
Copy link
Contributor Author

Great! The size increase makes sense. The P4Tools framework is rather large and pulls in a dependencies such as Z3.

@fruffy Thanks for the quick review! Hopefully, this lowers the barrier to experimentation and adoption of p4testgen. Thanks @jafingerhut for encouraging me to submit this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants