jscheffl commented on code in PR #45266:
URL: https://github.com/apache/airflow/pull/45266#discussion_r1899173252


##########
.github/workflows/prod-image-build.yml:
##########
@@ -231,57 +212,45 @@ ${{ inputs.do-build == 'true' && inputs.image-tag || '' 
}}"
       - name: "Cleanup repo"
         shell: bash
         run: docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm 
-rf /workspace/*"
-        if: inputs.do-build == 'true'
       - name: "Checkout target branch"
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-      - name: "Checkout target commit"
-        uses: ./.github/actions/checkout_target_commit
-        with:
-          target-commit-sha: ${{ inputs.target-commit-sha }}
-          pull-request-target: ${{ inputs.pull-request-target }}
-          is-committer-build: ${{ inputs.is-committer-build }}
-        if: inputs.do-build == 'true'
       - name: "Cleanup docker"
         run: ./scripts/ci/cleanup_docker.sh
-        if: inputs.do-build == 'true'
       - name: "Install Breeze"
         uses: ./.github/actions/breeze
-        if: inputs.do-build == 'true'
-      - name: "Regenerate dependencies in case they was modified manually so 
that we can build an image"
-        shell: bash
-        run: |
-          pip install rich>=12.4.4 pyyaml
-          python scripts/ci/pre_commit/update_providers_dependencies.py
-        if: inputs.do-build == 'true' && inputs.upgrade-to-newer-dependencies 
!= 'false'
       - name: "Cleanup dist and context file"
         shell: bash
         run: rm -fv ./dist/* ./docker-context-files/*
-        if: inputs.do-build == 'true'
+      - name: "Restore PROD docker image ${{ inputs.platform }}:${{ 
env.PYTHON_MAJOR_MINOR_VERSION }}"
+        uses: 
apache/infrastructure-actions/stash/restore@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
+        with:
+          key: "prod-image-save-${{ inputs.platform }}-${{ 
env.PYTHON_MAJOR_MINOR_VERSION }}"
+          path: "/tmp/"
+        id: restore-prod-image
+      - name: "Load PROD image ${{ inputs.platform }}:${{ 
env.PYTHON_MAJOR_MINOR_VERSION }}"
+        run: breeze prod-image load --platform ${{ inputs.platform }}
+        shell: bash
+        if: steps.restore-prod-image.stash-hit == 'true'
       - name: "Download packages prepared as artifacts"
         uses: actions/download-artifact@v4
         with:
           name: prod-packages
           path: ./docker-context-files
-        if: inputs.do-build == 'true'
       - name: "Download constraints"
         uses: actions/download-artifact@v4
         with:
           name: constraints
           path: ./docker-context-files
-        if: inputs.do-build == 'true'
-      - name: Login to ghcr.io
-        shell: bash
-        run: echo "${{ env.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ 
github.actor }} --password-stdin
-        if: inputs.do-build == 'true'
-      - name: "Build PROD images w/ source providers ${{ matrix.python-version 
}}:${{ inputs.image-tag }}"
+      - name: "Build PROD images w/ source providers ${{ 
env.PYTHON_MAJOR_MINOR_VERSION }}"
         shell: bash
         run: >
-          breeze prod-image build --tag-as-latest --image-tag "${{ 
inputs.image-tag }}"
+          breeze prod-image build
+          --docker-cache local
           --commit-sha "${{ github.sha }}"
           --install-packages-from-context --airflow-constraints-mode 
constraints-source-providers
-          --use-constraints-for-context-packages --python "${{ 
matrix.python-version }}"
+          --use-constraints-for-context-packages

Review Comment:
   Ah now I understand... you remove the `--python` parameter because you 
source the version from ENV. That makes CLI simpler, but with the ENV it is 
harder to reproduce errors locally, because copying the CLI into a local shell 
then misses the Python version. I'd favor the explicit CLI argument.



-- 
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]

Reply via email to