OCPBUGS-105510: images: add BUILD_VERSION arg - #10771
patrickdillon wants to merge 1 commit into
Conversation
Add a BUILD_VERSION arg to our CI images, which will be set in the CI environment and then set that as an environment variable to pass to the build scripts. This is similar to the pattern of ART/OSBS. Currently, with BUILD_VERSION unset in CI, we fall back to the git tags. But with 5.0 & 4.23 having identical commits, we need a way to distinguish between the two different builds, in which case we can just adopt the same pattern used by ART/OSBS.
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@patrickdillon: This pull request references Jira Issue OCPBUGS-105510, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan includes up to 12 reviews per rolling hour; 11 remain after this review. 📝 WalkthroughWalkthroughThe Docker builder stages now accept a ChangesBuild version propagation
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: 🔵 Low · up to CI image builds may continue deriving their version from Git when external build definitions do not pass BUILD_VERSION, leaving builds from different release branches indistinguishable. The PR is mergeable with explicit owner awareness and follow-up to update or verify those build definitions. 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/jira refresh |
|
@patrickdillon: This pull request references Jira Issue OCPBUGS-105510, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@patrickdillon: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
Hi, this PR would help unblock the OKD SCOS 5.0 promoted release stream ( The version detection issue this PR fixes is one of two blockers causing Full investigation and context in OKD-424. Would appreciate a review when you get a chance, this has been blocking promoted releases for almost two months now. Thanks! |
| ARG BUILD_VERSION | ||
| ENV BUILD_VERSION=${BUILD_VERSION} |
There was a problem hiding this comment.
I'm a bit worried that it will shadow the ART-injected ENV in ART builds:
ART's build tooling (doozer) modifies the Dockerfile during a "rebase" step before the image is built. In doozer/doozerlib/backend/rebaser.py, it builds a set of environment variables that include BUILD_VERSION:python
build_update_env_vars = {
'OS_GIT_MAJOR': major_version,
'OS_GIT_MINOR': minor_version,
...
'BUILD_VERSION': version,
'BUILD_RELEASE': release if release else '',
}
These get injected as an ENV instruction (flagged with __doozer=update) into each build stage of the Dockerfile — right after the FROM line. A real ART build log shows this in action:
ENV __doozer=update BUILD_RELEASE=202508131058.p2.gc736eb7.assembly.test.el9 \
BUILD_VERSION=v4.20.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=20 ..
Maybe we need a differently named build arg / envvar and have something like this somewhere?
BUILD_VERSION=${BUILD_VERSION:-BUILD_$VERSION_BUILD_ARG}
There was a problem hiding this comment.
@petr-muller I see. I will be on PTO for a few days, so I've let the rest of my team know and given them access so they can update this PR (or of course start a new one in place of this one, which is just as well).
|
/close Superseded by #10781 |
|
@tthvo: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@patrickdillon: This pull request references Jira Issue OCPBUGS-105510. The bug has been updated to no longer refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Add a BUILD_VERSION arg to our CI images, which will be set in the CI environment and then set that as an environment variable to pass to the build scripts. This is similar to the pattern of ART/OSBS.
Currently, with BUILD_VERSION unset in CI, we fall back to the git tags. But with 5.0 & 4.23 having identical commits, we need a way to distinguish between the two different builds, in which case we can just adopt the same pattern used by ART/OSBS.
Summary by CodeRabbit