zozo123 commented on code in PR #74466:
URL: https://github.com/apache/airflow/pull/74466#discussion_r4317822714
##########
Dockerfile.ci:
##########
@@ -1945,13 +1974,23 @@ RUN bash /scripts/docker/install_packaging_tools.sh
COPY --from=scripts install_airflow_when_building_images.sh /scripts/docker/
+COPY --from=dependency-manifests /dependency-manifests/ ${AIRFLOW_SOURCES}/
+ARG UPGRADE_RANDOM_INDICATOR_STRING=""
+# Only preinstall locked third-party dependencies, with the same uv sync as
the full installation.
+# The full sync after COPY still installs workspace packages from the current
checkout and retains
+# its existing resolution fallback, so a stale uv.lock only skips this warm-up
instead of failing the build.
+RUN
--mount=type=cache,id=ci-$TARGETARCH-$DEPENDENCY_CACHE_EPOCH,target=/root/.cache/
\
+ if [[ -z "${UPGRADE_RANDOM_INDICATOR_STRING}" ]]; then \
+ INSTALL_LOCKED_THIRD_PARTY_ONLY="true" bash
/scripts/docker/install_airflow_when_building_images.sh \
+ || echo "Skipping the locked dependency pre-install; the full sync
below installs them"; \
Review Comment:
Done in 9f2b0c826b, along the lines you suggested:
- A frozen dry run of the same `uv sync` now decides whether to skip. Only
when it fails (`Missing workspace member`, `Unable to find lockfile`) is the
pre-install skipped, with a message.
- After a passing dry run, any failure fails the build, since the full sync
would fail the same way. That covers a network error or an `lxml`/`xmlsec`
build error.
- The `|| echo` is gone.
Checked in the CI image against a manifest-only tree: a lock in sync
installs; a missing workspace member and a missing lock both skip with exit 0;
an install that fails after a passing dry run exits 1.
##########
scripts/docker/install_airflow_when_building_images.sh:
##########
@@ -41,6 +45,9 @@ function install_from_sources() {
if [[ ${VIRTUAL_ENV=} != "" ]]; then
extra_sync_flags="--active"
fi
+ if [[ ${INSTALL_LOCKED_THIRD_PARTY_ONLY=} == "true" ]]; then
+ extra_sync_flags="${extra_sync_flags} --no-install-workspace"
Review Comment:
Done in 9f2b0c826b. With `INSTALL_LOCKED_THIRD_PARTY_ONLY=true` and
`UPGRADE_RANDOM_INDICATOR_STRING` both set, the script now returns early with a
message and runs no `uv sync`, so the contract of the mode no longer depends on
the guard in `Dockerfile.ci`. That guard stays, so the RUN step remains a no-op
in upgrade builds.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]