This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new abb266bc82 Fix failure of additional prod image builds in non-main 
build (#38538)
abb266bc82 is described below

commit abb266bc8201d6c9731fd1f34e2e44fba89650cd
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Wed Mar 27 17:06:23 2024 +0100

    Fix failure of additional prod image builds in non-main build (#38538)
    
    As of #38533 - we are building locally constraints for non-main
    production image builds. This change required CI images to be used
    and pulled before they were used. For "additional" image checks
    image-tag used in this case contained the "extra" prefix and the
    CI image could not be pulled.
    
    This change fixes this, it also displays the right Python version
    when pulling CI image and forces it's use in the pull/constraint
    steps to be explicitly used when provider packages are built.
---
 .github/workflows/build-images.yml            |  1 +
 .github/workflows/ci.yml                      |  1 +
 .github/workflows/prod-image-build.yml        | 20 ++++++--------------
 .github/workflows/prod-image-extra-checks.yml |  3 +++
 4 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/.github/workflows/build-images.yml 
b/.github/workflows/build-images.yml
index 19c3b28b1e..26899fbfd0 100644
--- a/.github/workflows/build-images.yml
+++ b/.github/workflows/build-images.yml
@@ -209,6 +209,7 @@ jobs:
       push-image: "true"
       use-uv: "true"
       image-tag: ${{ needs.build-info.outputs.image-tag }}
+      ci-image-tag: ${{ needs.build-info.outputs.image-tag }}
       platform: "linux/amd64"
       python-versions: ${{ needs.build-info.outputs.python-versions }}
       branch: ${{ needs.build-info.outputs.default-branch }}
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 57fddf61e4..32bb7c1f13 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -490,6 +490,7 @@ jobs:
       build-type: "Regular"
       do-build: ${{ needs.build-info.outputs.in-workflow-build }}
       image-tag: ${{ needs.build-info.outputs.image-tag }}
+      ci-image-tag: ${{ needs.build-info.outputs.image-tag }}
       platform: "linux/amd64"
       python-versions: ${{ needs.build-info.outputs.python-versions }}
       branch: ${{ needs.build-info.outputs.default-branch }}
diff --git a/.github/workflows/prod-image-build.yml 
b/.github/workflows/prod-image-build.yml
index 84769c2943..02a502653b 100644
--- a/.github/workflows/prod-image-build.yml
+++ b/.github/workflows/prod-image-build.yml
@@ -73,6 +73,10 @@ on:  # yamllint disable-line rule:truthy
         description: "Tag to set for the image"
         required: true
         type: string
+      ci-image-tag:
+        description: "Tag to use for the CI image used during the build"
+        required: true
+        type: string
       python-versions:
         description: "JSON-formatted array of Python versions to build images 
from"
         required: true
@@ -243,23 +247,11 @@ ${{ inputs.do-build == 'true' && inputs.image-tag || '' 
}}"
         shell: bash
         run: echo "${{ env.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ 
github.actor }} --password-stdin
         if: inputs.do-build == 'true'
-      - name: Pull CI images ${{ inputs.python-versions-list-as-string }}:${{ 
inputs.image-tag }}
+      - name: Pull CI images ${{ matrix.python-version }}:${{ 
inputs.ci-image-tag }}
         run: >
-          breeze ci-image pull --tag-as-latest --image-tag "${{ 
inputs.image-tag }}"
+          breeze ci-image pull --tag-as-latest --image-tag "${{ 
inputs.ci-image-tag }}"
           --python "${{ matrix.python-version }}"
         if: inputs.do-build == 'true' && inputs.build-provider-packages != 
'true'
-      - name: "Prepare chicken-eggs provider packages"
-        # In case of provider packages which use latest dev0 version of 
providers, we should prepare them
-        # from the source code, not from the PyPI because they have 
apache-airflow>=X.Y.Z dependency
-        # And when we prepare them from sources they will have 
apache-airflow>=X.Y.Z.dev0
-        run: >
-          breeze release-management prepare-provider-packages 
--include-not-ready-providers
-          --package-format wheel --version-suffix-for-pypi dev0
-          ${{ inputs.chicken-egg-providers }}
-        if: >
-          inputs.do-build == 'true' &&
-          inputs.chicken-egg-providers != '' &&
-          inputs.build-provider-packages != 'true'
       - name: "PyPI constraints"
         timeout-minutes: 25
         run: >
diff --git a/.github/workflows/prod-image-extra-checks.yml 
b/.github/workflows/prod-image-extra-checks.yml
index faa904e438..cf7225a036 100644
--- a/.github/workflows/prod-image-extra-checks.yml
+++ b/.github/workflows/prod-image-extra-checks.yml
@@ -57,6 +57,7 @@ jobs:
     with:
       build-type: "Bullseye"
       image-tag: bullseye-${{ inputs.image-tag }}
+      ci-image-tag: ${{ inputs.image-tag }}
       debian-version: "bullseye"
       python-versions: ${{ inputs.python-versions }}
       platform: "linux/amd64"
@@ -75,6 +76,7 @@ jobs:
     with:
       build-type: "MySQL Client"
       image-tag: mysql-${{ inputs.image-tag }}
+      ci-image-tag: ${{ inputs.image-tag }}
       install-mysql-client-type: "mysql"
       python-versions: ${{ inputs.python-versions }}
       platform: "linux/amd64"
@@ -93,6 +95,7 @@ jobs:
     with:
       build-type: "pip"
       image-tag: mysql-${{ inputs.image-tag }}
+      ci-image-tag: ${{ inputs.image-tag }}
       install-mysql-client-type: "mysql"
       python-versions: ${{ inputs.python-versions }}
       platform: "linux/amd64"

Reply via email to