This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch share-ci-image-docs-registry
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/share-ci-image-docs-registry
by this push:
new 9d7ab8ac657 Retry inside the image build instead of chaining a second
build job
9d7ab8ac657 is described below
commit 9d7ab8ac65727f1e95ba7082bfffad199142c20b
Author: Jarek Potiuk <[email protected]>
AuthorDate: Tue Jul 28 14:18:06 2026 +0200
Retry inside the image build instead of chaining a second build job
Expressing the no-cache retry as its own job put a permanently-skipped job
in every docs publish and forced both consumers to reason about which of
two builds produced the image. The retry belongs where the build is, and
callers that do not want it are unaffected because it is off by default.
---
.github/workflows/ci-image-build.yml | 19 ++++++++++++--
.github/workflows/publish-docs-to-s3.yml | 44 +++++---------------------------
2 files changed, 24 insertions(+), 39 deletions(-)
diff --git a/.github/workflows/ci-image-build.yml
b/.github/workflows/ci-image-build.yml
index e7c644568a6..f9aaa3aa473 100644
--- a/.github/workflows/ci-image-build.yml
+++ b/.github/workflows/ci-image-build.yml
@@ -94,6 +94,11 @@ on: # yamllint disable-line rule:truthy
description: "Docker cache specification to build the image (registry,
local, disabled)."
required: true
type: string
+ retry-without-cache:
+ description: "Retry the build once with the cache disabled if the
cached build fails (true/false)"
+ required: false
+ default: "false"
+ type: string
disable-airflow-repo-cache:
description: "Disable airflow repo cache read from main."
required: true
@@ -169,9 +174,19 @@ jobs:
- name: >
Build ${{ inputs.push-image == 'true' && ' & push ' || '' }}
${{ inputs.platform }}:${{ env.PYTHON_MAJOR_MINOR_VERSION }} image
- run: >
- breeze ci-image build --platform "${PLATFORM}"
+ run: |
+ if breeze ci-image build --platform "${PLATFORM}"; then
+ exit 0
+ fi
+ if [[ "${RETRY_WITHOUT_CACHE}" != "true" ]]; then
+ exit 1
+ fi
+ # Reached when the ref's pyproject.toml has drifted far enough from
the branch the
+ # cache was built for that the cached layers cannot satisfy it.
Slow, but correct.
+ echo "Build with ${DOCKER_CACHE} cache failed - retrying with the
cache disabled."
+ DOCKER_CACHE="disabled" breeze ci-image build --platform
"${PLATFORM}"
env:
+ RETRY_WITHOUT_CACHE: ${{ inputs.retry-without-cache }}
DOCKER_CACHE: ${{ inputs.docker-cache }}
DISABLE_AIRFLOW_REPO_CACHE: ${{ inputs.disable-airflow-repo-cache }}
INSTALL_MYSQL_CLIENT_TYPE: ${{ inputs.install-mysql-client-type }}
diff --git a/.github/workflows/publish-docs-to-s3.yml
b/.github/workflows/publish-docs-to-s3.yml
index 53383f314df..5d8f009e4d3 100644
--- a/.github/workflows/publish-docs-to-s3.yml
+++ b/.github/workflows/publish-docs-to-s3.yml
@@ -254,39 +254,13 @@ jobs:
upgrade-to-newer-dependencies: "false"
docker-cache: "registry"
disable-airflow-repo-cache: "false"
-
- # Building against main's registry cache can fail outright when the ref's
pyproject.toml has
- # diverged from main — the case the docs job's inline `breeze ci-image build
|| docker buildx
- # build` fallback used to cover. Retry once with the cache off, which is
slow but always
- # correct. Skipped whenever the cached build worked, so a fresh cache costs
nothing.
- build-ci-image-no-cache:
- name: "Build CI image (no cache)"
- needs: [build-info, build-ci-image]
- if: always() && needs.build-ci-image.result == 'failure'
- uses: ./.github/workflows/ci-image-build.yml
- permissions:
- contents: read
- packages: write
- with:
- runners: '["ubuntu-22.04"]'
- platform: "linux/amd64"
- checkout-ref: ${{ inputs.ref }}
- push-image: "false"
- upload-image-artifact: "true"
- upload-mount-cache-artifact: "true"
- python-versions: ${{ format('["{0}"]',
needs.build-info.outputs.default-python-version) }}
- branch: "main"
- constraints-branch: "constraints-main"
- use-uv: "true"
- upgrade-to-newer-dependencies: "false"
- docker-cache: "disabled"
- disable-airflow-repo-cache: "false"
+ # Building against main's cache can fail outright when the ref's
pyproject.toml has
+ # diverged from main — the case the docs job's inline `breeze ci-image
build || docker
+ # buildx build` fallback used to cover.
+ retry-without-cache: "true"
build-docs:
- needs: [build-info, build-ci-image, build-ci-image-no-cache]
- if: >
- !cancelled() &&
- (needs.build-ci-image.result == 'success' ||
needs.build-ci-image-no-cache.result == 'success')
+ needs: [build-info, build-ci-image]
timeout-minutes: 150
name: "Build documentation"
runs-on: ubuntu-latest
@@ -658,12 +632,8 @@ jobs:
update-registry:
# Runs alongside the docs build rather than after it: the registry reads
nothing the docs
# publish produces, so waiting only added its whole duration to the
release manager's wait.
- needs: [build-info, build-ci-image, build-ci-image-no-cache]
- if: >
- !cancelled() &&
- (needs.build-ci-image.result == 'success' ||
needs.build-ci-image-no-cache.result == 'success') &&
- (needs.build-info.outputs.registry-providers != '' ||
- needs.build-info.outputs.registry-full-build == 'true')
+ needs: [build-info, build-ci-image]
+ if: needs.build-info.outputs.registry-providers != '' ||
needs.build-info.outputs.registry-full-build == 'true'
name: "Update Provider Registry"
permissions:
contents: read