Skip to content

docker: add Ubuntu 24.04 Dockerfile and update dependencies#37

Merged
fruffy merged 4 commits intop4lang:mainfrom
p2peek:ubuntu-24-ci-update
Apr 8, 2026
Merged

docker: add Ubuntu 24.04 Dockerfile and update dependencies#37
fruffy merged 4 commits intop4lang:mainfrom
p2peek:ubuntu-24-ci-update

Conversation

@p2peek
Copy link
Copy Markdown
Contributor

@p2peek p2peek commented Mar 4, 2026

This PR introduces an updated Dockerfile for building the P4 CI stack using Ubuntu 24.04 instead of the current Ubuntu 20.04 base image.

Changes

  • Added Dockerfile.24 based on ubuntu:24.04
  • Updated package dependencies to versions compatible with Ubuntu 24.04
  • Ensured compatibility with the existing Docker image build flow

Local Build Testing

The following Docker build chain was successfully tested locally:

ubuntu:24.04
→ third-party
→ PI
→ behavioral-model

All images built successfully.

The p4c image still requires additional adjustments and will be handled separately.

Motivation

This work is part of the effort to migrate the Docker CI infrastructure from Ubuntu 20.04 → Ubuntu 24.04, as discussed in Issue #38.

Related Issue

Fixes / contributes to #38

Signed-off-by: Prakash Kumar <kumarprakash3909@gmail.com>
ldconfig && \
mkdir -p /output/usr/local

RUN pip3 install "Cython<3"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we need Cython<3? here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was added during local builds because some grpc python build steps
failed with Cython 3 on Ubuntu 24.04. Pinning Cython<3 ensured the grpc
python package could be compiled successfully.

If this constraint is no longer necessary for the current dependency
versions, I am happy to remove it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Well, let's see if we can remove it to keep things simple.

@fruffy
Copy link
Copy Markdown
Contributor

fruffy commented Mar 7, 2026

We also need to publish a version of this image to docker, then we can test it in downstream repos.

Dockerfile Outdated
# installed version of the protobuf python package that we copied from the
# protobuf build image.
# RUN pip3 install --user -rrequirements.txt
# RUN env GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip3 install --user --ignore-installed .
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is commented, remove?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch. I have removed the commented lines in the latest commit.

Signed-off-by: Prakash Kumar <kumarprakash3909@gmail.com>
@p2peek
Copy link
Copy Markdown
Contributor Author

p2peek commented Mar 8, 2026

That makes sense.

Once the Dockerfile changes are finalized, publishing a test image will
allow downstream repositories like PI and behavioral-model to test
against the Ubuntu 24.04 base image.

Signed-off-by: fruffy <fruffy@nyu.edu>
@fruffy fruffy force-pushed the ubuntu-24-ci-update branch from 85dd747 to b2c8c00 Compare March 8, 2026 16:55
@fruffy
Copy link
Copy Markdown
Contributor

fruffy commented Mar 8, 2026

@p2peek Took the liberty to push a commit to trigger CI. Sometimes this stuff gets stuck because of permission issues with first-time contributors.

@p2peek
Copy link
Copy Markdown
Contributor Author

p2peek commented Mar 13, 2026

Thanks for pushing the commit to trigger CI — I appreciate the help!

The Dockerfile changes are now updated and CI checks are passing.
Please let me know if any further adjustments are needed.

Once the image workflow is finalized, I’d also be happy to help test the downstream repositories (PI and behavioral-model) with the Ubuntu 24.04 base image.

@fruffy
Copy link
Copy Markdown
Contributor

fruffy commented Mar 13, 2026

Thanks for pushing the commit to trigger CI — I appreciate the help!

The Dockerfile changes are now updated and CI checks are passing. Please let me know if any further adjustments are needed.

Once the image workflow is finalized, I’d also be happy to help test the downstream repositories (PI and behavioral-model) with the Ubuntu 24.04 base image.

Can you address the request to remove GRPC_PYTHON_BUILD_WITH_CYTHON=1 and all Cython related stuff from both images? I think it should simplify things a little for us. If downstream fails we can reinstate it.

@fruffy
Copy link
Copy Markdown
Contributor

fruffy commented Mar 22, 2026

@p2peek Just following up on this, do you still plan to work on this?

@p2peek
Copy link
Copy Markdown
Contributor Author

p2peek commented Mar 23, 2026

@fruffy Thanks for the follow-up!

I removed all Cython-related dependencies and the GRPC_PYTHON_BUILD_WITH_CYTHON flag as suggested and tested the build locally.

However, the gRPC Python build fails on Ubuntu 24.04 (Python 3.12) with Cython-related compilation errors (noexcept mismatch).

It appears that gRPC still requires Cython (specifically <3) to build successfully in this environment.

Would you prefer reintroducing the Cython<3 constraint for now, or exploring an alternative gRPC version or build configuration?

Happy to proceed either way.

@p2peek
Copy link
Copy Markdown
Contributor Author

p2peek commented Mar 23, 2026

@p2peek Just following up on this, do you still plan to work on this?

yess

@fruffy
Copy link
Copy Markdown
Contributor

fruffy commented Mar 25, 2026

However, the gRPC Python build fails on Ubuntu 24.04 (Python 3.12) with Cython-related compilation errors (noexcept mismatch).

That is a little strange, we should definitely not need any special settings for Ubuntu 24.04 and gRPCs. Those are two very standard configurations.

@p2peek
Copy link
Copy Markdown
Contributor Author

p2peek commented Mar 25, 2026

However, the gRPC Python build fails on Ubuntu 24.04 (Python 3.12) with Cython-related compilation errors (noexcept mismatch).

That is a little strange, we should definitely not need any special settings for Ubuntu 24.04 and gRPCs. Those are two very standard configurations.

I investigated the issue further and confirmed that the failure was caused by grpc being built from source, which required Cython and led to compilation errors.

To resolve this, I updated the Dockerfile to install grpcio from prebuilt wheels instead of building grpc Python bindings from source. This removes the need for Cython entirely and aligns with the expected behavior in a clean environment.

The Docker build now completes successfully on Ubuntu 24.04.

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.

Let's merge this and see what breaks.

@fruffy
Copy link
Copy Markdown
Contributor

fruffy commented Apr 2, 2026

Please fix the failing DCO

Signed-off-by: Prakash Kumar <kumarprakash3909@gmail.com>
@p2peek p2peek force-pushed the ubuntu-24-ci-update branch from 7363a7c to 956eae8 Compare April 2, 2026 04:13
@fruffy fruffy merged commit 1a57f7d into p4lang:main Apr 8, 2026
2 checks passed
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