Skip to content

Use Ubuntu 24.04 instead of 20.04 for docker container#36

Draft
jafingerhut wants to merge 7 commits intop4lang:mainfrom
jafingerhut:use-ubuntu-24.04-in-docker-container
Draft

Use Ubuntu 24.04 instead of 20.04 for docker container#36
jafingerhut wants to merge 7 commits intop4lang:mainfrom
jafingerhut:use-ubuntu-24.04-in-docker-container

Conversation

@jafingerhut
Copy link
Copy Markdown

No description provided.

Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
@jafingerhut
Copy link
Copy Markdown
Author

jafingerhut commented Mar 11, 2025

This makes quite a few changes:

  • Use Ubuntu 24.04 inside the docker container, instead of Ubuntu 20.04
  • Use Thrift 0.16.0 (formerly 0.13.0)
  • Use grpc 1.62.3 (formerly 1.43.2)
  • Use the default version of protobuf installed by building grpc 1.62.3, which is 4.25.1 (formerly built protobuf 3.18.1 separately)
  • Use git clone commands inside of Dockerfile to get the desired versions of project source code, instead of submodules in the third-party repo.

The last change was motivated by my experience attempting to use the default version of pip installed in Ubuntu 24.04 and seeing that it failed to to pip3 install . from within several Github repo copies, unless it was a full git clone with a .git directory, which the submodules do not have.

Note: I have not yet attempted to use the resulting Docker image to build the p4lang/behavioral-model source code and test it. There might be things that still need to be fixed in order for that to work.

jafingerhut and others added 6 commits March 11, 2025 17:21
Signed-off-by: Andy Fingerhut <andy.fingerhut@gmail.com>
Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
…ingerhut/third-party into use-ubuntu-24.04-in-docker-container
Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
And try removing some package installs that might no longer be needed.

Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
@fruffy
Copy link
Copy Markdown
Contributor

fruffy commented Apr 7, 2025

I would consider using the Ubuntu 24.04 system versions for ccache/Protobuf/gRPC/thrift/sysrepo/libyang. With Ubuntu 24.04 they can/should all be installed via apt now.

iirc the main reason they were built from source was because this was previously not possible.

@jafingerhut
Copy link
Copy Markdown
Author

I would consider using the Ubuntu 24.04 system versions for ccache/Protobuf/gRPC/thrift/sysrepo/libyang. With Ubuntu 24.04 they can/should all be installed via apt now.

iirc the main reason they were built from source was because this was previously not possible.

That seems surprising to me. Ubuntu 20.04 and earlier Ubuntu versions had some version of grpc and protobuf that you could install via apt-get. I had guessed/assumed that the reason for building from source was to get particular desired versions of those packages installed, and the hope of being able to modify/update those versions over time even if the base Ubuntu version did not change.

Even now with Ubuntu 24.04, it is not obvious to me whether one can use apt-get to install grpc, and then also install a matching version of Python grpcio package easily, without that Python install building grpc from source itself. Similar for protobuf (i.e. that it is not clear to me whether you can install matching binary & Python versions without installing from source).

@fruffy
Copy link
Copy Markdown
Contributor

fruffy commented Apr 7, 2025

Even now with Ubuntu 24.04, it is not obvious to me whether one can use apt-get to install grpc, and then also install a matching version of Python grpcio package easily, without that Python install building grpc from source itself. Similar for protobuf (i.e. that it is not clear to me whether you can install matching binary & Python versions without installing from source).

At least I had versions of this working since Ubuntu 20: https://github.com/nyu-systems/gauntlet/blob/master/do_install.sh#L54

This worked for BMv2/P4C. Now with the Tofino studio etc I am not sure but those are not using the third-party images anyway.

Edit: For the purpose of the third-party image it is probably fine to build from source. My concern mostly revolves around the drift between what Ubuntu provides by default and what our ecosystem might depend on.

Copy link
Copy Markdown
Contributor

@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.

@jafingerhut What's the status of this PR? I might depend on it soon, so we could merge it to let the container updates trickle down

@jafingerhut
Copy link
Copy Markdown
Author

@jafingerhut What's the status of this PR? I might depend on it soon, so we could merge it to let the container updates trickle down

I did some fiddling around with it for a while to try to find something that worked, but did not find a solution for all the repos involved that made it all work, unfortunately, set it aside, and haven't gone back to it.

@fruffy
Copy link
Copy Markdown
Contributor

fruffy commented Feb 17, 2026

We can temporarily change the tag here: https://github.com/p4lang/third-party/blob/main/.github/workflows/build.yml#L61 then use this version in downstream repos until we have fixed the issue.

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