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

potiuk pushed a commit to branch v2-7-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 1aa694d2f19d4c7ba4382612bec7255b09e83a3a
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sun Aug 27 05:16:16 2023 +0200

    Use PyPI constraints for PROD image in non-main branch
    
    When we are building PROD image in CI for non main branch, we are
    installing providers from PyPI rather than building them locally
    from sources. Therefore we should use `PyPI` constraints for
    such builds not the "source" constraints (they might differ).
    
    This PR adds two steps:
    
    * In the CI build, when we do not build providers we generate
      PyPI constraints additionally to source constraints
    * In the PROD build we use the PyPI constraints in case we
      do not build providers locally
---
 .github/actions/build-ci-images/action.yml   |  8 +++++++-
 .github/actions/build-prod-images/action.yml | 12 +++++++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/.github/actions/build-ci-images/action.yml 
b/.github/actions/build-ci-images/action.yml
index d43a425284..415819008c 100644
--- a/.github/actions/build-ci-images/action.yml
+++ b/.github/actions/build-ci-images/action.yml
@@ -34,12 +34,18 @@ runs:
     - name: "Build & Push AMD64 CI images ${{ env.IMAGE_TAG }} ${{ 
env.PYTHON_VERSIONS }}"
       shell: bash
       run: breeze ci-image build --push --tag-as-latest --run-in-parallel 
--upgrade-on-failure
-    - name: "Show dependencies to be upgraded"
+    - name: "Generate source constraints"
       shell: bash
       run: >
         breeze release-management generate-constraints --run-in-parallel
         --airflow-constraints-mode constraints-source-providers
       if: env.UPGRADE_TO_NEWER_DEPENDENCIES != 'false'
+    - name: "Generate PyPI constraints"
+      shell: bash
+      run: >
+        breeze release-management generate-constraints --run-in-parallel
+        --airflow-constraints-mode constraints
+      if: env.UPGRADE_TO_NEWER_DEPENDENCIES != 'false' and ${{ 
inputs.build-provider-packages != 'true' }}
     - name: "Print dependency upgrade summary"
       shell: bash
       run: |
diff --git a/.github/actions/build-prod-images/action.yml 
b/.github/actions/build-prod-images/action.yml
index feac8c2ef2..1223b5a7f1 100644
--- a/.github/actions/build-prod-images/action.yml
+++ b/.github/actions/build-prod-images/action.yml
@@ -62,7 +62,7 @@ runs:
         name: constraints
         path: ./docker-context-files
       if: env.UPGRADE_TO_NEWER_DEPENDENCIES != 'false'
-    - name: "Build & Push PROD images ${{ env.IMAGE_TAG }}:${{ 
env.PYTHON_VERSIONS }}"
+    - name: "Build & Push PROD images with source providers ${{ env.IMAGE_TAG 
}}:${{ env.PYTHON_VERSIONS }}"
       shell: bash
       run: >
         breeze prod-image build --tag-as-latest --run-in-parallel --push
@@ -70,6 +70,16 @@ runs:
         --use-constraints-for-context-packages
       env:
         COMMIT_SHA: ${{ github.sha }}
+      if: ${{ inputs.build-provider-packages == 'true' }}
+    - name: "Build & Push PROD images with PyPi providers ${{ env.IMAGE_TAG 
}}:${{ env.PYTHON_VERSIONS }}"
+      shell: bash
+      run: >
+        breeze prod-image build --tag-as-latest --run-in-parallel --push
+        --install-packages-from-context --airflow-constraints-mode constraints
+        --use-constraints-for-context-packages
+      env:
+        COMMIT_SHA: ${{ github.sha }}
+      if: ${{ inputs.build-provider-packages != 'true' }}
     - name: "Fix ownership"
       shell: bash
       run: breeze ci fix-ownership

Reply via email to