-
Notifications
You must be signed in to change notification settings - Fork 6
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
Separate focal and jammy carma-base Dockerfiles #191
Conversation
docker/build-image.sh
Outdated
TAGS+=("$USERNAME/$IMAGE:latest") | ||
cd .. | ||
|
||
# If neither --focal nor --jammy is specified, build both |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are currently just starting to update the systems to include jammy, it would make more sense to me for this to default to just building focal. Open to discussion on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. I will turn it off by default.
.github/workflows/docker.yml
Outdated
# Jammy 22.04 (ROS2 Humble) | ||
docker-build-jammy: | ||
uses: usdot-fhwa-stol/actions/.github/workflows/docker.yml@main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the two jobs triggered when changes are pushed ? May be can we use this path filters (https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#onpushpull_requestpaths) to only run specific job that is required when its associated files changed instead of running multiple jobs every time ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes great point I forgot. I tried adding those. I had to separate the yml files to write it cleanly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the change by creating a dummy PR here that points to this branch. The dummy PR only has jammy changes, which successfully only triggered jammy docker: https://github.com/usdot-fhwa-stol/carma-base/actions/runs/11247485262/job/31271050955?pr=192
# TODO, distinguish with suffix when Humble is fully integrated | ||
# until then focal will have no suffix and be the main image | ||
# https://usdot-carma.atlassian.net/browse/ARC-227 | ||
if [ "$BUILD_FOCAL" = true ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add echo "Building Focal Image..." and echo "Building Jammy Image..." some thing like that which is easy to debug during CI for each focal and jammy ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
COMMIT_MSG=$(git log -1 --pretty=%B) | ||
|
||
# Remove newlines and special characters, replace spaces with underscores | ||
VERSION=$(echo "$COMMIT_MSG" | tr -d '\n' | tr -dc '[:alnum:][:space:]' | tr '[:space:]' '_') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so the version is generated from the commit message, which works well for general versioning should we consider appending a suffix like -focal or -jammy to the VERSION variable depending on which image is being built (focal or jammy)?
some thing like VERSION="${VERSION}-focal" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suffix is appended outside this function through variable called $tag_suffix. So it should be good.
PR Details
Description
After Humble migration, carma will be running noetic/humble hybrid system.
However, humble requires ubuntu 22.04, which is different than noetic/foxy, so a separate Dockerfile is needed from here on out.
Please see the docker deployment design here
Therefore, this PR creates separates the two OS by their names "focal" and "jammy", which lets the build-image.sh script to build two different images. New usage:
build-image.sh --jammy
ORbuild-image.sh --focal
ORbuild-image.sh
no option to build both.Resulting images will have an extra trailing name in their tag distinguising their names such as:
usdotfhwastol/carma-base:latest-jammy
Github Action is modifed to also check docker build and dockerhub push wiht distinctive trailing suffix for each OS at the same time.
NOTE: because humble is not officialy merged to develop yet, focal is still the main docker images. So we will not use the trailing tag for focal until everything is regression tested and merged: https://usdot-carma.atlassian.net/browse/ARC-227. So currently
build-image.sh --focal
will still build following:usdotfhwastol/carma-base:latest
same for the dockerhub image tag as well where
focal
is not tagged at the moment.In terms of contents in the respective Dockerfile, focal stayed the same to continue supporting foxy/noetic until humble migration is fully done.
Jammy Dockerfile contains the mirror upgrades of foxy and several universal dependencies generated by Generative AI.
If any dependency is missing, we can add them as we go, but this sould be enough for now.
Related GitHub Issue
NA
Related Jira Key
https://usdot-carma.atlassian.net/browse/ARC-155
Motivation and Context
From Foxy to Humble upgrade
How Has This Been Tested?
https://github.com/usdot-fhwa-stol/carma-base/actions/runs/11190142437/job/31111735787
Types of changes
Checklist: