You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2025/06/29 10:15:24 UTC
[PR] Speed-up constraints generation [airflow]
potiuk opened a new pull request, #52449:
URL: https://github.com/apache/airflow/pull/52449
Constraints generation was slow because we run them in a loop and we tried to run them all on a single machine - trying to utilize the fact that we only have to build airflow and provider packages once. But those are pretty fast, comparing to constraint generation and it's much better to parallelize the constraint jobs and run them on separatae workers. This will speed up constraint generation delays that will allow building PROD images and kubernetes checks faster.
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
Thank you for contributing! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
In case of an existing issue, reference it using one of the following:
closes: #ISSUE
related: #ISSUE
How to write a good git commit message:
http://chris.beams.io/posts/git-commit/
-->
<!-- Please keep an empty line above the dashes. -->
---
**^ Add meaningful description above**
Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information.
In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Speed-up constraints generation [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #52449:
URL: https://github.com/apache/airflow/pull/52449#discussion_r2173749678
##########
.github/workflows/generate-constraints.yml:
##########
@@ -67,72 +78,61 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- - name: "Prepare and cleanup runner"
- run: ./scripts/ci/prepare_and_cleanup_runner.sh
- shell: bash
- - name: "Install Breeze"
- uses: ./.github/actions/breeze
- with:
- use-uv: ${{ inputs.use-uv }}
- id: breeze
- - name: "Prepare all CI images: ${{ inputs.python-versions-list-as-string}}"
- uses: ./.github/actions/prepare_all_ci_images
+ - name: "Prepare breeze & CI image: ${{ matrix.python-version }}"
+ uses: ./.github/actions/prepare_breeze_and_image
with:
platform: ${{ inputs.platform }}
- python-versions-list-as-string: ${{ inputs.python-versions-list-as-string }}
- docker-volume-location: "" # TODO(jscheffl): Understand why it fails here and fix it
- - name: "Verify all CI images ${{ inputs.python-versions-list-as-string }}"
- run: breeze ci-image verify --run-in-parallel
+ python: ${{ matrix.python-version }}
+ use-uv: ${{ inputs.use-uv }}
- name: "Source constraints"
shell: bash
run: >
- breeze release-management generate-constraints --run-in-parallel
+ breeze release-management generate-constraints
--airflow-constraints-mode constraints-source-providers --answer yes
+ --python "${PYTHON_VERSION}"
- name: "No providers constraints"
shell: bash
timeout-minutes: 25
run: >
- breeze release-management generate-constraints --run-in-parallel
- --airflow-constraints-mode constraints-no-providers --answer yes --parallelism 3
- # The no providers constraints are only needed when we want to update constraints (in canary builds)
- # They slow down the start of PROD image builds so we want to only run them when needed.
+ breeze release-management generate-constraints
+ --airflow-constraints-mode constraints-no-providers --answer yes
+ --python "${PYTHON_VERSION}"
if: inputs.generate-no-providers-constraints == 'true'
- name: "Prepare updated provider distributions"
- # In case of provider distributions which are not yet released, we build them from sources
shell: bash
run: >
- breeze release-management prepare-provider-distributions --include-not-ready-providers
- --distribution-format wheel
+ breeze release-management prepare-provider-distributions
+ --include-not-ready-providers --distribution-format wheel
+ if: inputs.generate-pypi-constraints == 'true'
- name: "Prepare airflow distributions"
shell: bash
run: >
breeze release-management prepare-airflow-distributions --distribution-format wheel
+ if: inputs.generate-pypi-constraints == 'true'
- name: "Prepare task-sdk distribution"
shell: bash
run: >
breeze release-management prepare-task-sdk-distributions --distribution-format wheel
+ if: inputs.generate-pypi-constraints == 'true'
- name: "PyPI constraints"
shell: bash
timeout-minutes: 25
run: |
- for PYTHON in $PYTHON_VERSIONS; do
- breeze release-management generate-constraints --airflow-constraints-mode constraints \
- --answer yes --python "${PYTHON}"
- done
- - name: "Dependency upgrade summary"
- shell: bash
- env:
- PYTHON_VERSIONS: ${{ env.PYTHON_VERSIONS }}
- run: |
- for PYTHON_VERSION in $PYTHON_VERSIONS; do
- echo "Summarizing Python $PYTHON_VERSION"
- cat "files/constraints-${PYTHON_VERSION}"/*.md >> $GITHUB_STEP_SUMMARY || true
- df -H
- done
+ breeze release-management generate-constraints --airflow-constraints-mode constraints \
+ --answer yes --python "${PYTHON_VERSION}"
+ if: inputs.generate-pypi-constraints == 'true'
- name: "Upload constraint artifacts"
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
- name: constraints
- path: ./files/constraints-*/constraints-*.txt
+ name: constraints-${{ matrix.python-version }}
+ path: ./files/constraints-${{ matrix.python-version }}/constraints-*.txt
retention-days: 7
if-no-files-found: error
+ - name: "Dependency upgrade summary"
+ shell: bash
+ env:
+ PYTHON_VERSION: ${{ matrix.python-version }}
+ run: |
+ echo "Summarizing Python $PYTHON_VERSION"
+ cat "files/constraints-${PYTHON_VERSION}"/*.md >> $GITHUB_STEP_SUMMARY || true
Review Comment:
Yes. We also generated .md file where `diff` type of output is embedded - this way when we print it to summary it shows up as coloured diff.
##########
.github/workflows/generate-constraints.yml:
##########
@@ -67,72 +78,61 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- - name: "Prepare and cleanup runner"
- run: ./scripts/ci/prepare_and_cleanup_runner.sh
- shell: bash
- - name: "Install Breeze"
- uses: ./.github/actions/breeze
- with:
- use-uv: ${{ inputs.use-uv }}
- id: breeze
- - name: "Prepare all CI images: ${{ inputs.python-versions-list-as-string}}"
- uses: ./.github/actions/prepare_all_ci_images
+ - name: "Prepare breeze & CI image: ${{ matrix.python-version }}"
+ uses: ./.github/actions/prepare_breeze_and_image
with:
platform: ${{ inputs.platform }}
- python-versions-list-as-string: ${{ inputs.python-versions-list-as-string }}
- docker-volume-location: "" # TODO(jscheffl): Understand why it fails here and fix it
- - name: "Verify all CI images ${{ inputs.python-versions-list-as-string }}"
- run: breeze ci-image verify --run-in-parallel
+ python: ${{ matrix.python-version }}
+ use-uv: ${{ inputs.use-uv }}
- name: "Source constraints"
shell: bash
run: >
- breeze release-management generate-constraints --run-in-parallel
+ breeze release-management generate-constraints
--airflow-constraints-mode constraints-source-providers --answer yes
+ --python "${PYTHON_VERSION}"
- name: "No providers constraints"
shell: bash
timeout-minutes: 25
run: >
- breeze release-management generate-constraints --run-in-parallel
- --airflow-constraints-mode constraints-no-providers --answer yes --parallelism 3
- # The no providers constraints are only needed when we want to update constraints (in canary builds)
- # They slow down the start of PROD image builds so we want to only run them when needed.
+ breeze release-management generate-constraints
+ --airflow-constraints-mode constraints-no-providers --answer yes
+ --python "${PYTHON_VERSION}"
if: inputs.generate-no-providers-constraints == 'true'
- name: "Prepare updated provider distributions"
- # In case of provider distributions which are not yet released, we build them from sources
shell: bash
run: >
- breeze release-management prepare-provider-distributions --include-not-ready-providers
- --distribution-format wheel
+ breeze release-management prepare-provider-distributions
+ --include-not-ready-providers --distribution-format wheel
+ if: inputs.generate-pypi-constraints == 'true'
- name: "Prepare airflow distributions"
shell: bash
run: >
breeze release-management prepare-airflow-distributions --distribution-format wheel
+ if: inputs.generate-pypi-constraints == 'true'
- name: "Prepare task-sdk distribution"
shell: bash
run: >
breeze release-management prepare-task-sdk-distributions --distribution-format wheel
+ if: inputs.generate-pypi-constraints == 'true'
- name: "PyPI constraints"
shell: bash
timeout-minutes: 25
run: |
- for PYTHON in $PYTHON_VERSIONS; do
- breeze release-management generate-constraints --airflow-constraints-mode constraints \
- --answer yes --python "${PYTHON}"
- done
- - name: "Dependency upgrade summary"
- shell: bash
- env:
- PYTHON_VERSIONS: ${{ env.PYTHON_VERSIONS }}
- run: |
- for PYTHON_VERSION in $PYTHON_VERSIONS; do
- echo "Summarizing Python $PYTHON_VERSION"
- cat "files/constraints-${PYTHON_VERSION}"/*.md >> $GITHUB_STEP_SUMMARY || true
- df -H
- done
+ breeze release-management generate-constraints --airflow-constraints-mode constraints \
+ --answer yes --python "${PYTHON_VERSION}"
+ if: inputs.generate-pypi-constraints == 'true'
- name: "Upload constraint artifacts"
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
- name: constraints
- path: ./files/constraints-*/constraints-*.txt
+ name: constraints-${{ matrix.python-version }}
+ path: ./files/constraints-${{ matrix.python-version }}/constraints-*.txt
retention-days: 7
if-no-files-found: error
+ - name: "Dependency upgrade summary"
+ shell: bash
+ env:
+ PYTHON_VERSION: ${{ matrix.python-version }}
+ run: |
+ echo "Summarizing Python $PYTHON_VERSION"
+ cat "files/constraints-${PYTHON_VERSION}"/*.md >> $GITHUB_STEP_SUMMARY || true
Review Comment:
Yes. We also generate .md file where `diff` type of output is embedded - this way when we print it to summary it shows up as coloured diff.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Speed-up constraints generation [airflow]
Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #52449:
URL: https://github.com/apache/airflow/pull/52449#discussion_r2173750330
##########
.github/workflows/generate-constraints.yml:
##########
@@ -67,72 +78,61 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- - name: "Prepare and cleanup runner"
- run: ./scripts/ci/prepare_and_cleanup_runner.sh
- shell: bash
- - name: "Install Breeze"
- uses: ./.github/actions/breeze
- with:
- use-uv: ${{ inputs.use-uv }}
- id: breeze
- - name: "Prepare all CI images: ${{ inputs.python-versions-list-as-string}}"
- uses: ./.github/actions/prepare_all_ci_images
+ - name: "Prepare breeze & CI image: ${{ matrix.python-version }}"
+ uses: ./.github/actions/prepare_breeze_and_image
with:
platform: ${{ inputs.platform }}
- python-versions-list-as-string: ${{ inputs.python-versions-list-as-string }}
- docker-volume-location: "" # TODO(jscheffl): Understand why it fails here and fix it
- - name: "Verify all CI images ${{ inputs.python-versions-list-as-string }}"
- run: breeze ci-image verify --run-in-parallel
+ python: ${{ matrix.python-version }}
+ use-uv: ${{ inputs.use-uv }}
- name: "Source constraints"
shell: bash
run: >
- breeze release-management generate-constraints --run-in-parallel
+ breeze release-management generate-constraints
--airflow-constraints-mode constraints-source-providers --answer yes
+ --python "${PYTHON_VERSION}"
- name: "No providers constraints"
shell: bash
timeout-minutes: 25
run: >
- breeze release-management generate-constraints --run-in-parallel
- --airflow-constraints-mode constraints-no-providers --answer yes --parallelism 3
- # The no providers constraints are only needed when we want to update constraints (in canary builds)
- # They slow down the start of PROD image builds so we want to only run them when needed.
+ breeze release-management generate-constraints
+ --airflow-constraints-mode constraints-no-providers --answer yes
+ --python "${PYTHON_VERSION}"
if: inputs.generate-no-providers-constraints == 'true'
- name: "Prepare updated provider distributions"
- # In case of provider distributions which are not yet released, we build them from sources
shell: bash
run: >
- breeze release-management prepare-provider-distributions --include-not-ready-providers
- --distribution-format wheel
+ breeze release-management prepare-provider-distributions
+ --include-not-ready-providers --distribution-format wheel
+ if: inputs.generate-pypi-constraints == 'true'
- name: "Prepare airflow distributions"
shell: bash
run: >
breeze release-management prepare-airflow-distributions --distribution-format wheel
+ if: inputs.generate-pypi-constraints == 'true'
- name: "Prepare task-sdk distribution"
shell: bash
run: >
breeze release-management prepare-task-sdk-distributions --distribution-format wheel
+ if: inputs.generate-pypi-constraints == 'true'
- name: "PyPI constraints"
shell: bash
timeout-minutes: 25
run: |
- for PYTHON in $PYTHON_VERSIONS; do
- breeze release-management generate-constraints --airflow-constraints-mode constraints \
- --answer yes --python "${PYTHON}"
- done
- - name: "Dependency upgrade summary"
- shell: bash
- env:
- PYTHON_VERSIONS: ${{ env.PYTHON_VERSIONS }}
- run: |
- for PYTHON_VERSION in $PYTHON_VERSIONS; do
- echo "Summarizing Python $PYTHON_VERSION"
- cat "files/constraints-${PYTHON_VERSION}"/*.md >> $GITHUB_STEP_SUMMARY || true
- df -H
- done
+ breeze release-management generate-constraints --airflow-constraints-mode constraints \
+ --answer yes --python "${PYTHON_VERSION}"
+ if: inputs.generate-pypi-constraints == 'true'
- name: "Upload constraint artifacts"
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
- name: constraints
- path: ./files/constraints-*/constraints-*.txt
+ name: constraints-${{ matrix.python-version }}
+ path: ./files/constraints-${{ matrix.python-version }}/constraints-*.txt
retention-days: 7
if-no-files-found: error
+ - name: "Dependency upgrade summary"
+ shell: bash
+ env:
+ PYTHON_VERSION: ${{ matrix.python-version }}
+ run: |
+ echo "Summarizing Python $PYTHON_VERSION"
+ cat "files/constraints-${PYTHON_VERSION}"/*.md >> $GITHUB_STEP_SUMMARY || true
Review Comment:
cool :)
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Speed-up constraints generation [airflow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #52449:
URL: https://github.com/apache/airflow/pull/52449#issuecomment-3016784444
### Backport failed to create: v3-0-test. View the failure log <a href='https://github.com/apache/airflow/actions/runs/15956667610'> Run details </a>
<table>
<tr>
<th>Status</th>
<th>Branch</th>
<th>Result</th>
</tr>
<tr>
<td>❌</td>
<td>v3-0-test</td>
<td><a href="https://github.com/apache/airflow/commit/ba6a97105276b28401730d2937c02e8de4569868"><img src='https://img.shields.io/badge/Commit-ba6a971-red' alt='Commit Link'></a></td>
</tr>
</table>
You can attempt to backport this manually by running:
```bash
cherry_picker ba6a971 v3-0-test
```
This should apply the commit to the v3-0-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.
After you have resolved the conflicts, you can continue the backport process by running:
```bash
cherry_picker --continue
```
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Speed-up constraints generation [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #52449:
URL: https://github.com/apache/airflow/pull/52449
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Speed-up constraints generation [airflow]
Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #52449:
URL: https://github.com/apache/airflow/pull/52449#discussion_r2173747722
##########
.github/workflows/generate-constraints.yml:
##########
@@ -67,72 +78,61 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- - name: "Prepare and cleanup runner"
- run: ./scripts/ci/prepare_and_cleanup_runner.sh
- shell: bash
- - name: "Install Breeze"
- uses: ./.github/actions/breeze
- with:
- use-uv: ${{ inputs.use-uv }}
- id: breeze
- - name: "Prepare all CI images: ${{ inputs.python-versions-list-as-string}}"
- uses: ./.github/actions/prepare_all_ci_images
+ - name: "Prepare breeze & CI image: ${{ matrix.python-version }}"
+ uses: ./.github/actions/prepare_breeze_and_image
with:
platform: ${{ inputs.platform }}
- python-versions-list-as-string: ${{ inputs.python-versions-list-as-string }}
- docker-volume-location: "" # TODO(jscheffl): Understand why it fails here and fix it
- - name: "Verify all CI images ${{ inputs.python-versions-list-as-string }}"
- run: breeze ci-image verify --run-in-parallel
+ python: ${{ matrix.python-version }}
+ use-uv: ${{ inputs.use-uv }}
- name: "Source constraints"
shell: bash
run: >
- breeze release-management generate-constraints --run-in-parallel
+ breeze release-management generate-constraints
--airflow-constraints-mode constraints-source-providers --answer yes
+ --python "${PYTHON_VERSION}"
- name: "No providers constraints"
shell: bash
timeout-minutes: 25
run: >
- breeze release-management generate-constraints --run-in-parallel
- --airflow-constraints-mode constraints-no-providers --answer yes --parallelism 3
- # The no providers constraints are only needed when we want to update constraints (in canary builds)
- # They slow down the start of PROD image builds so we want to only run them when needed.
+ breeze release-management generate-constraints
+ --airflow-constraints-mode constraints-no-providers --answer yes
+ --python "${PYTHON_VERSION}"
if: inputs.generate-no-providers-constraints == 'true'
- name: "Prepare updated provider distributions"
- # In case of provider distributions which are not yet released, we build them from sources
shell: bash
run: >
- breeze release-management prepare-provider-distributions --include-not-ready-providers
- --distribution-format wheel
+ breeze release-management prepare-provider-distributions
+ --include-not-ready-providers --distribution-format wheel
+ if: inputs.generate-pypi-constraints == 'true'
- name: "Prepare airflow distributions"
shell: bash
run: >
breeze release-management prepare-airflow-distributions --distribution-format wheel
+ if: inputs.generate-pypi-constraints == 'true'
- name: "Prepare task-sdk distribution"
shell: bash
run: >
breeze release-management prepare-task-sdk-distributions --distribution-format wheel
+ if: inputs.generate-pypi-constraints == 'true'
- name: "PyPI constraints"
shell: bash
timeout-minutes: 25
run: |
- for PYTHON in $PYTHON_VERSIONS; do
- breeze release-management generate-constraints --airflow-constraints-mode constraints \
- --answer yes --python "${PYTHON}"
- done
- - name: "Dependency upgrade summary"
- shell: bash
- env:
- PYTHON_VERSIONS: ${{ env.PYTHON_VERSIONS }}
- run: |
- for PYTHON_VERSION in $PYTHON_VERSIONS; do
- echo "Summarizing Python $PYTHON_VERSION"
- cat "files/constraints-${PYTHON_VERSION}"/*.md >> $GITHUB_STEP_SUMMARY || true
- df -H
- done
+ breeze release-management generate-constraints --airflow-constraints-mode constraints \
+ --answer yes --python "${PYTHON_VERSION}"
+ if: inputs.generate-pypi-constraints == 'true'
- name: "Upload constraint artifacts"
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
- name: constraints
- path: ./files/constraints-*/constraints-*.txt
+ name: constraints-${{ matrix.python-version }}
+ path: ./files/constraints-${{ matrix.python-version }}/constraints-*.txt
retention-days: 7
if-no-files-found: error
+ - name: "Dependency upgrade summary"
+ shell: bash
+ env:
+ PYTHON_VERSION: ${{ matrix.python-version }}
+ run: |
+ echo "Summarizing Python $PYTHON_VERSION"
+ cat "files/constraints-${PYTHON_VERSION}"/*.md >> $GITHUB_STEP_SUMMARY || true
Review Comment:
.md? is it txt ?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org