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 977f0bda24 Build constraints instead of pulling them for non-main
builds (#38533)
977f0bda24 is described below
commit 977f0bda24a623a3c4d5da47f27ed53a11a785df
Author: Jarek Potiuk <[email protected]>
AuthorDate: Wed Mar 27 15:27:07 2024 +0100
Build constraints instead of pulling them for non-main builds (#38533)
PROD image - when built in non-main branch - needs constraints
generated for PyPI builds. Those constraints are generated in
"generate-constraints" build but we should not add a dependency
for that job, because it will slow-down the regular main builds and
PRs. Instead, we should generate the constraints again - this is now
rather quick thanks to `uv` so it should not introduce much delay in
the non-main builds.
---
.github/workflows/prod-image-build.yml | 38 ++++++++++++++++++++++++++++------
1 file changed, 32 insertions(+), 6 deletions(-)
diff --git a/.github/workflows/prod-image-build.yml
b/.github/workflows/prod-image-build.yml
index 5c5b59c0ea..84769c2943 100644
--- a/.github/workflows/prod-image-build.yml
+++ b/.github/workflows/prod-image-build.yml
@@ -239,16 +239,42 @@ ${{ inputs.do-build == 'true' && inputs.image-tag || ''
}}"
name: source-constraints-${{ matrix.python-version }}
path: ./docker-context-files
if: inputs.do-build == 'true' && inputs.build-provider-packages ==
'true'
- - name: "Download constraints"
- uses: actions/download-artifact@v4
- with:
- name: constraints
- path: ./docker-context-files
- if: inputs.do-build == 'true' && inputs.build-provider-packages !=
'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: Pull CI images ${{ inputs.python-versions-list-as-string }}:${{
inputs.image-tag }}
+ run: >
+ breeze ci-image pull --tag-as-latest --image-tag "${{
inputs.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: >
+ breeze release-management generate-constraints --python "${{
matrix.python-version }}"
+ --airflow-constraints-mode constraints --answer yes
+ --chicken-egg-providers "${{ inputs.chicken-egg-providers }}"
+ if: inputs.do-build == 'true' && inputs.build-provider-packages !=
'true'
+ # This cleanup is needed as we will run out of disk space if we keep
both CI and PROD images
+ # on public runners.
+ - name: Cleanup docker
+ uses: ./.github/actions/cleanup-docker
+ if: inputs.do-build == 'true' && inputs.build-provider-packages !=
'true'
+ - name: "Copy constraints to docker-context-files"
+ run: cp -vr --no-preserve=mode,ownership ./files/constraints-*
./docker-context-files
+ if: inputs.do-build == 'true' && inputs.build-provider-packages !=
'true'
- name: "Build PROD images w/ source providers ${{ matrix.python-version
}}:${{ inputs.image-tag }}"
shell: bash
run: >