Repository navigation
Build CI and release images on pinned OS-dependencies images - #76225
Conversation
shahar1
left a comment
There was a problem hiding this comment.
I read through the Dockerfile stage split, the marker logic in install_os_dependencies.sh, the build-os-deps-images / publish-os-deps-images commands, the mirror workflow jobs and the upgrade-script pinning. The design holds together. The marker inputs cover every environment variable the script reads, with BASE_IMAGE left out on purpose. The client ARGs are declared in both PROD OS-deps stages. The release build passes the pins only on main, where they exist. Moving actions: write off the mirror job and onto the trigger job also tightens permissions.
I left one inline observation about PRs that change the OS-dependency scripts themselves.
This review was drafted by an AI-assisted tool and
confirmed by an Apache Airflow maintainer. The findings
below are observations, not blockers; an Apache Airflow
maintainer — a real person — will take the next look at the
PR. If you think a finding is mis-applied, please reply on
the PR and a maintainer will weigh in.More on how Apache Airflow handles maintainer review:
Contributing guide.
Drafted-by: Claude Code (Opus 5.5); reviewed by shahar1 before posting
23e7500 to
ae9b277
Compare
|
Thanks for the thorough read of the stage split, the marker inputs and the permission move. The one inline point is addressed in 23e7500. A PR that changes Drafted-by: Claude Code (Claude Opus 5); reviewed by @potiuk before posting |
shahar1
left a comment
There was a problem hiding this comment.
LGTM — the follow-up closes the removal blind spot from my first pass: a PR that touches install_os_dependencies.sh, common.sh, the client scripts or scripts/docker/keys/ now builds its OS layer from BASE_IMAGE in CI, with a selective-checks test and 04_selective_checks.md, 02_images.md and the ADR updated together. CI is green on the full image matrix.
The branch currently conflicts with main (the BASE_IMAGE digest line in Dockerfile, which the upgrade moved since) and needs a rebase before this can merge.
What I re-checked on this head: commits 1–9 are byte-identical to the ones I read on 2026-11-01 (git range-diff), so the two new commits got the fresh line-by-line read. I also checked that release-prod-images --slim-images only clears AIRFLOW_EXTRAS and keeps the default database clients, so the pinned runtime image's marker still matches for slim images.
Smaller observations
- nit (inline) —
dev/breeze/doc/09_release_management_tasks.rst:1385still says a PR that changes the script reinstalls on top of the pinned image "so the change is still exercised"; the follow-up made CI build such PRs fromBASE_IMAGEinstead, as the ADR,02_images.mdand04_selective_checks.mdnow say. Only the variables part (Go, Node.js versions) still reinstalls on top. - Not a finding, for the record: the same removal blind spot remains for a package dropped from the
DEV_APT_DEPS/RUNTIME_APT_DEPSdefaults in the Dockerfiles, which are marker inputs but not inOS_DEPENDENCIES_FILES. The next upgrade PR's fresh image catches that, and adding the Dockerfiles to the group would make the upgrade PR itself skip the pins it has to test, so leaving it as is looks like the right trade-off.
This review was drafted by an AI-assisted tool and
confirmed by an Apache Airflow maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.More on how Apache Airflow handles maintainer review:
Contributing guide.
Drafted-by: Claude Code (Fable 5.1); reviewed by shahar1 before posting
Pinning the hardened base image to a digest does not pin the dhi.io apt repository the OS dependencies are installed from. It moves on - and drops the package versions it replaced - whenever Docker rebuilds its images, so the same commit could build today and fail tomorrow, and a dhi.io change broke main instead of an upgrade PR. Installing the OS dependencies once, in images built on the mirrored base images and pinned by the same upgrade check, makes day-to-day builds independent of the live repository: a dhi.io change can only break the scheduled image build or the upgrade PR. Standalone builds of the Dockerfile still install from the repositories. Generated-by: Claude Opus 5
Docker rebuilds the hardened base images several times a day, and rebuilding every OS-dependencies image for each new digest would run a full set of image builds on every mirror run. Building them daily is enough to keep the pinned images close to the apt repository, and the upgrade check no longer triggers builds of its own. As the base image pins now move more often than the OS-dependencies images, the upgrade check pins the latest published image of each Python patch release, whatever base image digest it was built on - the image carries its own Python. Generated-by: Claude Opus 5
The legacy flavor's runtime OS installation links the compiled Python, so the Python copied from the build image has to be in place before it runs - copying it afterwards broke the legacy image. A cache-disabled build is asked to install everything from scratch, and the CI image's DEPENDENCIES_EPOCH_NUMBER forces reinstallation, so neither may be satisfied by a pinned OS-dependencies image. The daily OS-dependencies builds no longer hold up mirror-only runs, which the upgrade check waits for with a short timeout, and they build on the digests their own run mirrored. Dry runs now print the build plan, and the release image log names the image type again. Generated-by: Claude Opus 5
…n main only The upgrade check moves the base image pin to a newer Python patch release as soon as the mirror has it, and without OS-dependencies images for that patch release the upgrade PR and main installed from the live apt repository again - the failure the pinned images are there to avoid. Building them for every patch release the mirror copied publishes them before the pin moves. The images are built from main's install script and Dockerfiles, so a release branch pinning them would never match its own installation and would ship both dependency sets; only main pins them until there are images per branch. A dry run of the publication now prints its plan instead of failing on the registry lookups it skips. Generated-by: Claude Opus 5
… it used Forcing the whole build fresh made the runtime OS-dependencies image repeat the dev installation it copies the Python distribution from, although the dev image had just been built in the same job. Forcing only the target stage fresh reuses it. An image built on a pinned OS-dependencies image recorded the BASE_IMAGE it was given, while its layers come from the OS-dependencies image, which may be built on an older digest - the images now record which image their OS dependencies came from and the base image those were installed on. Generated-by: Claude Opus 5
The CI image builds retry with the image cache disabled after any failed first attempt, so tying the pinned OS-dependencies images to a disabled cache sent every retry to the live apt repository - the failure the pinned images avoid. Using them is now its own setting, which only the 'disable image cache' label turns off, and it can be set for a single build. Generated-by: Claude Opus 5
The MySQL, MSSQL and PostgreSQL clients were installed after the pinned OS-dependencies layer, so every CI and PROD build still ran apt against the live repositories for them - without the alignment with the dhi.io repository, which the skipped OS installation no longer ran first. Installing them with the OS dependencies puts them in the pinned images, and the marker now covers their scripts and selection, so a different choice reinstalls them. The runtime OS-dependencies build also starts from the dev image built before it rather than repeating the dev installation when that build was skipped or ran in an earlier job. Generated-by: Claude Opus 5
…age tag install_os_dependencies.sh now runs the database client scripts, so a change to only one of them, or to a repository key, must produce a new OS-dependencies image. Otherwise the daily build sees the image as already built while every CI and PROD build's marker misses, and each reinstalls from the live repositories until the base image happens to change. Generated-by: Claude Opus 5
… an ADR The CI images doc did not explain where the OS dependencies of CI and release images come from, and the reasons for pinning them - and the alternatives rejected - were only in PR discussions. Generated-by: Claude Opus 5
… scripts Reinstalling on top of a pinned OS-dependencies image only exercises additions: a package or database client the change drops stays installed from the pinned layer, so CI could pass while something still depends on it. Generated-by: Claude Opus 5
… base image Generated-by: Claude Opus 5
… image Generated-by: Claude Opus 5
578a07b to
bc16985
Compare
|
The re-run of the jobs stopped by EC2 Spot interruptions finished: attempt 2 passed. |
FrankYang0529
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the PR.
The marker, the image tag and the CI file group each list the files the OS layer depends on. A file missing from the image tag inputs would make every build reinstall from the live repositories while the daily build sees nothing to rebuild. Generated-by: Claude Opus 5
Backport failed to create: v3-4-test. View the failure log Run detailsNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
You can attempt to backport this manually by running: cherry_picker 0c69d65 v3-4-testThis should apply the commit to the v3-4-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
…76225) * Build CI and release images on pinned OS-dependencies images Pinning the hardened base image to a digest does not pin the dhi.io apt repository the OS dependencies are installed from. It moves on - and drops the package versions it replaced - whenever Docker rebuilds its images, so the same commit could build today and fail tomorrow, and a dhi.io change broke main instead of an upgrade PR. Installing the OS dependencies once, in images built on the mirrored base images and pinned by the same upgrade check, makes day-to-day builds independent of the live repository: a dhi.io change can only break the scheduled image build or the upgrade PR. Standalone builds of the Dockerfile still install from the repositories. Generated-by: Claude Opus 5 * Build the OS-dependencies images daily instead of on every mirror run Docker rebuilds the hardened base images several times a day, and rebuilding every OS-dependencies image for each new digest would run a full set of image builds on every mirror run. Building them daily is enough to keep the pinned images close to the apt repository, and the upgrade check no longer triggers builds of its own. As the base image pins now move more often than the OS-dependencies images, the upgrade check pins the latest published image of each Python patch release, whatever base image digest it was built on - the image carries its own Python. Generated-by: Claude Opus 5 * Fix the legacy PROD image and isolate the OS-dependencies builds The legacy flavor's runtime OS installation links the compiled Python, so the Python copied from the build image has to be in place before it runs - copying it afterwards broke the legacy image. A cache-disabled build is asked to install everything from scratch, and the CI image's DEPENDENCIES_EPOCH_NUMBER forces reinstallation, so neither may be satisfied by a pinned OS-dependencies image. The daily OS-dependencies builds no longer hold up mirror-only runs, which the upgrade check waits for with a short timeout, and they build on the digests their own run mirrored. Dry runs now print the build plan, and the release image log names the image type again. Generated-by: Claude Opus 5 * Publish OS-dependencies images ahead of patch releases and pin them on main only The upgrade check moves the base image pin to a newer Python patch release as soon as the mirror has it, and without OS-dependencies images for that patch release the upgrade PR and main installed from the live apt repository again - the failure the pinned images are there to avoid. Building them for every patch release the mirror copied publishes them before the pin moves. The images are built from main's install script and Dockerfiles, so a release branch pinning them would never match its own installation and would ship both dependency sets; only main pins them until there are images per branch. A dry run of the publication now prints its plan instead of failing on the registry lookups it skips. Generated-by: Claude Opus 5 * Build each OS-dependencies stage fresh once and record the base image it used Forcing the whole build fresh made the runtime OS-dependencies image repeat the dev installation it copies the Python distribution from, although the dev image had just been built in the same job. Forcing only the target stage fresh reuses it. An image built on a pinned OS-dependencies image recorded the BASE_IMAGE it was given, while its layers come from the OS-dependencies image, which may be built on an older digest - the images now record which image their OS dependencies came from and the base image those were installed on. Generated-by: Claude Opus 5 * Keep the pinned OS-dependencies images on cache-disabled build retries The CI image builds retry with the image cache disabled after any failed first attempt, so tying the pinned OS-dependencies images to a disabled cache sent every retry to the live apt repository - the failure the pinned images avoid. Using them is now its own setting, which only the 'disable image cache' label turns off, and it can be set for a single build. Generated-by: Claude Opus 5 * Install the database clients with the pinned OS dependencies The MySQL, MSSQL and PostgreSQL clients were installed after the pinned OS-dependencies layer, so every CI and PROD build still ran apt against the live repositories for them - without the alignment with the dhi.io repository, which the skipped OS installation no longer ran first. Installing them with the OS dependencies puts them in the pinned images, and the marker now covers their scripts and selection, so a different choice reinstalls them. The runtime OS-dependencies build also starts from the dev image built before it rather than repeating the dev installation when that build was skipped or ran in an earlier job. Generated-by: Claude Opus 5 * Hash the database client scripts and keys into the OS-dependencies image tag install_os_dependencies.sh now runs the database client scripts, so a change to only one of them, or to a repository key, must produce a new OS-dependencies image. Otherwise the daily build sees the image as already built while every CI and PROD build's marker misses, and each reinstalls from the live repositories until the base image happens to change. Generated-by: Claude Opus 5 * Document the pinned OS-dependencies images and record the decision in an ADR The CI images doc did not explain where the OS dependencies of CI and release images come from, and the reasons for pinning them - and the alternatives rejected - were only in PR discussions. Generated-by: Claude Opus 5 * Build the OS dependencies from the base image when a PR changes their scripts Reinstalling on top of a pinned OS-dependencies image only exercises additions: a package or database client the change drops stays installed from the pinned layer, so CI could pass while something still depends on it. Generated-by: Claude Opus 5 * Document that a PR changing the OS-dependency scripts builds from the base image Generated-by: Claude Opus 5
…ges (#76225) * Build CI and release images on pinned OS-dependencies images Pinning the hardened base image to a digest does not pin the dhi.io apt repository the OS dependencies are installed from. It moves on - and drops the package versions it replaced - whenever Docker rebuilds its images, so the same commit could build today and fail tomorrow, and a dhi.io change broke main instead of an upgrade PR. Installing the OS dependencies once, in images built on the mirrored base images and pinned by the same upgrade check, makes day-to-day builds independent of the live repository: a dhi.io change can only break the scheduled image build or the upgrade PR. Standalone builds of the Dockerfile still install from the repositories. * Build the OS-dependencies images daily instead of on every mirror run Docker rebuilds the hardened base images several times a day, and rebuilding every OS-dependencies image for each new digest would run a full set of image builds on every mirror run. Building them daily is enough to keep the pinned images close to the apt repository, and the upgrade check no longer triggers builds of its own. As the base image pins now move more often than the OS-dependencies images, the upgrade check pins the latest published image of each Python patch release, whatever base image digest it was built on - the image carries its own Python. * Fix the legacy PROD image and isolate the OS-dependencies builds The legacy flavor's runtime OS installation links the compiled Python, so the Python copied from the build image has to be in place before it runs - copying it afterwards broke the legacy image. A cache-disabled build is asked to install everything from scratch, and the CI image's DEPENDENCIES_EPOCH_NUMBER forces reinstallation, so neither may be satisfied by a pinned OS-dependencies image. The daily OS-dependencies builds no longer hold up mirror-only runs, which the upgrade check waits for with a short timeout, and they build on the digests their own run mirrored. Dry runs now print the build plan, and the release image log names the image type again. * Publish OS-dependencies images ahead of patch releases and pin them on main only The upgrade check moves the base image pin to a newer Python patch release as soon as the mirror has it, and without OS-dependencies images for that patch release the upgrade PR and main installed from the live apt repository again - the failure the pinned images are there to avoid. Building them for every patch release the mirror copied publishes them before the pin moves. The images are built from main's install script and Dockerfiles, so a release branch pinning them would never match its own installation and would ship both dependency sets; only main pins them until there are images per branch. A dry run of the publication now prints its plan instead of failing on the registry lookups it skips. * Build each OS-dependencies stage fresh once and record the base image it used Forcing the whole build fresh made the runtime OS-dependencies image repeat the dev installation it copies the Python distribution from, although the dev image had just been built in the same job. Forcing only the target stage fresh reuses it. An image built on a pinned OS-dependencies image recorded the BASE_IMAGE it was given, while its layers come from the OS-dependencies image, which may be built on an older digest - the images now record which image their OS dependencies came from and the base image those were installed on. * Keep the pinned OS-dependencies images on cache-disabled build retries The CI image builds retry with the image cache disabled after any failed first attempt, so tying the pinned OS-dependencies images to a disabled cache sent every retry to the live apt repository - the failure the pinned images avoid. Using them is now its own setting, which only the 'disable image cache' label turns off, and it can be set for a single build. * Install the database clients with the pinned OS dependencies The MySQL, MSSQL and PostgreSQL clients were installed after the pinned OS-dependencies layer, so every CI and PROD build still ran apt against the live repositories for them - without the alignment with the dhi.io repository, which the skipped OS installation no longer ran first. Installing them with the OS dependencies puts them in the pinned images, and the marker now covers their scripts and selection, so a different choice reinstalls them. The runtime OS-dependencies build also starts from the dev image built before it rather than repeating the dev installation when that build was skipped or ran in an earlier job. * Hash the database client scripts and keys into the OS-dependencies image tag install_os_dependencies.sh now runs the database client scripts, so a change to only one of them, or to a repository key, must produce a new OS-dependencies image. Otherwise the daily build sees the image as already built while every CI and PROD build's marker misses, and each reinstalls from the live repositories until the base image happens to change. * Document the pinned OS-dependencies images and record the decision in an ADR The CI images doc did not explain where the OS dependencies of CI and release images come from, and the reasons for pinning them - and the alternatives rejected - were only in PR discussions. * Build the OS dependencies from the base image when a PR changes their scripts Reinstalling on top of a pinned OS-dependencies image only exercises additions: a package or database client the change drops stays installed from the pinned layer, so CI could pass while something still depends on it. * Document that a PR changing the OS-dependency scripts builds from the base image (cherry picked from commit aa0d650) Conflicts resolved by hand: the v3-4-test BASE_IMAGE digest is kept, and the breeze help hashes were regenerated from this branch. dev/breeze/tests/test_os_deps_images.py combines the file from #76225 with the test #76659 added, in its main form: with the marker hash from #76225 the script needs cat, cut, dirname and sha256sum before it reaches the Python check. Generated-by: Claude Opus 5
…ges (#76225) (#76642) * Build CI and release images on pinned OS-dependencies images Pinning the hardened base image to a digest does not pin the dhi.io apt repository the OS dependencies are installed from. It moves on - and drops the package versions it replaced - whenever Docker rebuilds its images, so the same commit could build today and fail tomorrow, and a dhi.io change broke main instead of an upgrade PR. Installing the OS dependencies once, in images built on the mirrored base images and pinned by the same upgrade check, makes day-to-day builds independent of the live repository: a dhi.io change can only break the scheduled image build or the upgrade PR. Standalone builds of the Dockerfile still install from the repositories. * Build the OS-dependencies images daily instead of on every mirror run Docker rebuilds the hardened base images several times a day, and rebuilding every OS-dependencies image for each new digest would run a full set of image builds on every mirror run. Building them daily is enough to keep the pinned images close to the apt repository, and the upgrade check no longer triggers builds of its own. As the base image pins now move more often than the OS-dependencies images, the upgrade check pins the latest published image of each Python patch release, whatever base image digest it was built on - the image carries its own Python. * Fix the legacy PROD image and isolate the OS-dependencies builds The legacy flavor's runtime OS installation links the compiled Python, so the Python copied from the build image has to be in place before it runs - copying it afterwards broke the legacy image. A cache-disabled build is asked to install everything from scratch, and the CI image's DEPENDENCIES_EPOCH_NUMBER forces reinstallation, so neither may be satisfied by a pinned OS-dependencies image. The daily OS-dependencies builds no longer hold up mirror-only runs, which the upgrade check waits for with a short timeout, and they build on the digests their own run mirrored. Dry runs now print the build plan, and the release image log names the image type again. * Publish OS-dependencies images ahead of patch releases and pin them on main only The upgrade check moves the base image pin to a newer Python patch release as soon as the mirror has it, and without OS-dependencies images for that patch release the upgrade PR and main installed from the live apt repository again - the failure the pinned images are there to avoid. Building them for every patch release the mirror copied publishes them before the pin moves. The images are built from main's install script and Dockerfiles, so a release branch pinning them would never match its own installation and would ship both dependency sets; only main pins them until there are images per branch. A dry run of the publication now prints its plan instead of failing on the registry lookups it skips. * Build each OS-dependencies stage fresh once and record the base image it used Forcing the whole build fresh made the runtime OS-dependencies image repeat the dev installation it copies the Python distribution from, although the dev image had just been built in the same job. Forcing only the target stage fresh reuses it. An image built on a pinned OS-dependencies image recorded the BASE_IMAGE it was given, while its layers come from the OS-dependencies image, which may be built on an older digest - the images now record which image their OS dependencies came from and the base image those were installed on. * Keep the pinned OS-dependencies images on cache-disabled build retries The CI image builds retry with the image cache disabled after any failed first attempt, so tying the pinned OS-dependencies images to a disabled cache sent every retry to the live apt repository - the failure the pinned images avoid. Using them is now its own setting, which only the 'disable image cache' label turns off, and it can be set for a single build. * Install the database clients with the pinned OS dependencies The MySQL, MSSQL and PostgreSQL clients were installed after the pinned OS-dependencies layer, so every CI and PROD build still ran apt against the live repositories for them - without the alignment with the dhi.io repository, which the skipped OS installation no longer ran first. Installing them with the OS dependencies puts them in the pinned images, and the marker now covers their scripts and selection, so a different choice reinstalls them. The runtime OS-dependencies build also starts from the dev image built before it rather than repeating the dev installation when that build was skipped or ran in an earlier job. * Hash the database client scripts and keys into the OS-dependencies image tag install_os_dependencies.sh now runs the database client scripts, so a change to only one of them, or to a repository key, must produce a new OS-dependencies image. Otherwise the daily build sees the image as already built while every CI and PROD build's marker misses, and each reinstalls from the live repositories until the base image happens to change. * Document the pinned OS-dependencies images and record the decision in an ADR The CI images doc did not explain where the OS dependencies of CI and release images come from, and the reasons for pinning them - and the alternatives rejected - were only in PR discussions. * Build the OS dependencies from the base image when a PR changes their scripts Reinstalling on top of a pinned OS-dependencies image only exercises additions: a package or database client the change drops stays installed from the pinned layer, so CI could pass while something still depends on it. * Document that a PR changing the OS-dependency scripts builds from the base image (cherry picked from commit aa0d650) Conflicts resolved by hand: the v3-4-test BASE_IMAGE digest is kept, and the breeze help hashes were regenerated from this branch. Generated-by: Claude Opus 5
…ges (#76225) (#76642) * Build CI and release images on pinned OS-dependencies images Pinning the hardened base image to a digest does not pin the dhi.io apt repository the OS dependencies are installed from. It moves on - and drops the package versions it replaced - whenever Docker rebuilds its images, so the same commit could build today and fail tomorrow, and a dhi.io change broke main instead of an upgrade PR. Installing the OS dependencies once, in images built on the mirrored base images and pinned by the same upgrade check, makes day-to-day builds independent of the live repository: a dhi.io change can only break the scheduled image build or the upgrade PR. Standalone builds of the Dockerfile still install from the repositories. * Build the OS-dependencies images daily instead of on every mirror run Docker rebuilds the hardened base images several times a day, and rebuilding every OS-dependencies image for each new digest would run a full set of image builds on every mirror run. Building them daily is enough to keep the pinned images close to the apt repository, and the upgrade check no longer triggers builds of its own. As the base image pins now move more often than the OS-dependencies images, the upgrade check pins the latest published image of each Python patch release, whatever base image digest it was built on - the image carries its own Python. * Fix the legacy PROD image and isolate the OS-dependencies builds The legacy flavor's runtime OS installation links the compiled Python, so the Python copied from the build image has to be in place before it runs - copying it afterwards broke the legacy image. A cache-disabled build is asked to install everything from scratch, and the CI image's DEPENDENCIES_EPOCH_NUMBER forces reinstallation, so neither may be satisfied by a pinned OS-dependencies image. The daily OS-dependencies builds no longer hold up mirror-only runs, which the upgrade check waits for with a short timeout, and they build on the digests their own run mirrored. Dry runs now print the build plan, and the release image log names the image type again. * Publish OS-dependencies images ahead of patch releases and pin them on main only The upgrade check moves the base image pin to a newer Python patch release as soon as the mirror has it, and without OS-dependencies images for that patch release the upgrade PR and main installed from the live apt repository again - the failure the pinned images are there to avoid. Building them for every patch release the mirror copied publishes them before the pin moves. The images are built from main's install script and Dockerfiles, so a release branch pinning them would never match its own installation and would ship both dependency sets; only main pins them until there are images per branch. A dry run of the publication now prints its plan instead of failing on the registry lookups it skips. * Build each OS-dependencies stage fresh once and record the base image it used Forcing the whole build fresh made the runtime OS-dependencies image repeat the dev installation it copies the Python distribution from, although the dev image had just been built in the same job. Forcing only the target stage fresh reuses it. An image built on a pinned OS-dependencies image recorded the BASE_IMAGE it was given, while its layers come from the OS-dependencies image, which may be built on an older digest - the images now record which image their OS dependencies came from and the base image those were installed on. * Keep the pinned OS-dependencies images on cache-disabled build retries The CI image builds retry with the image cache disabled after any failed first attempt, so tying the pinned OS-dependencies images to a disabled cache sent every retry to the live apt repository - the failure the pinned images avoid. Using them is now its own setting, which only the 'disable image cache' label turns off, and it can be set for a single build. * Install the database clients with the pinned OS dependencies The MySQL, MSSQL and PostgreSQL clients were installed after the pinned OS-dependencies layer, so every CI and PROD build still ran apt against the live repositories for them - without the alignment with the dhi.io repository, which the skipped OS installation no longer ran first. Installing them with the OS dependencies puts them in the pinned images, and the marker now covers their scripts and selection, so a different choice reinstalls them. The runtime OS-dependencies build also starts from the dev image built before it rather than repeating the dev installation when that build was skipped or ran in an earlier job. * Hash the database client scripts and keys into the OS-dependencies image tag install_os_dependencies.sh now runs the database client scripts, so a change to only one of them, or to a repository key, must produce a new OS-dependencies image. Otherwise the daily build sees the image as already built while every CI and PROD build's marker misses, and each reinstalls from the live repositories until the base image happens to change. * Document the pinned OS-dependencies images and record the decision in an ADR The CI images doc did not explain where the OS dependencies of CI and release images come from, and the reasons for pinning them - and the alternatives rejected - were only in PR discussions. * Build the OS dependencies from the base image when a PR changes their scripts Reinstalling on top of a pinned OS-dependencies image only exercises additions: a package or database client the change drops stays installed from the pinned layer, so CI could pass while something still depends on it. * Document that a PR changing the OS-dependency scripts builds from the base image (cherry picked from commit aa0d650) Conflicts resolved by hand: the v3-4-test BASE_IMAGE digest is kept, and the breeze help hashes were regenerated from this branch. Generated-by: Claude Opus 5
#76200 unblocked
mainafter Docker renumbered its packages in the dhi.io apt repository, but it could not make the builds reproducible. The base images are pinned to digests, yet every CI and release build still installs its OS dependencies from dhi.io, a live repository that moves on and drops the versions it replaced whenever Docker rebuilds its images. The same commit could build a different image on a different day, or fail to build at all, and a dhi.io change brokemaindirectly instead of an upgrade PR.This pins the OS-dependency layer itself, the same way the base images are pinned:
install_os_dependencies.shnow also installs the MySQL, MSSQL and Postgres clients, so the whole OS layer - system packages and database clients - comes from one place. It records a hash of everything that decides what it installs (the script, the client scripts and repository keys, the installation type, the apt dependency and client build args, andDEPENDENCIES_EPOCH_NUMBER). On an image that already carries a matching marker it installs nothing; on a mismatch it installs on top, so no build runs on OS dependencies that do not match its inputs.ci-os-depsinDockerfile.ci,dev-os-depsandruntime-os-depsinDockerfile), starting fromCI_OS_DEPS_IMAGE/DEV_OS_DEPS_IMAGE/RUNTIME_OS_DEPS_IMAGE. They default toBASE_IMAGE, so a standalonedocker buildbehaves as before. Images record where their OS dependencies came from inAIRFLOW_OS_DEPS_IMAGEand/usr/share/airflow/os-dependencies.base-image.breeze release-management build-os-deps-images/publish-os-deps-imagesbuild those three images per Python version for amd64 and arm64 on the mirrored base images and publish them toghcr.io/apache/airflow/base/os-deps. They also build ahead for a newer Python patch release the mirror already copied, so the upgrade moving to it has images to pin.hardened_os_deps_image_digests.json, together with the base images, in the PR that has to pass the full CI. Onlymaincarries these pins until there are images per branch.--no-use-pinned-os-deps-images(USE_PINNED_OS_DEPS_IMAGES=false) turns the pins off, and the "disable image cache" label does so in CI; the automatic cache-disabled retry of a failed image build keeps them.dev/breeze/doc/adr/0021-pin-os-dependencies-images.md), and the mechanism is described indev/breeze/doc/ci/02_images.md.The pins file starts empty, so nothing changes in CI until the first daily build has published images and an upgrade PR has pinned them.
Tested locally on linux/arm64 with Python 3.13 by real builds: the CI image and the PROD image starting from OS-dependencies images built from these stages (each OS installation reported "nothing to install"; the images run Airflow and carry the MariaDB, Postgres and MSSQL clients), the standalone PROD OS-dependencies stages, and the legacy-flavor PROD image. Breeze and upgrade-script unit tests pass. The workflow changes can only be exercised on
mainof apache/airflow, and amd64 was not built locally. After the first push,ghcr.io/apache/airflow/base/os-depshas to be made public, likebase/python.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Opus 5 following the guidelines
🤖 Generated with Claude Code