Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use PyPI constraints for PROD image in non-main branch #33789

Merged
merged 1 commit into from
Aug 27, 2023

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Aug 27, 2023

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

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
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 newsfragments.

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
@@ -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"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those constraints are useful regardless to see and they are very fast to generate, so we can generate them also in non-main branch. It's helpful to see them

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"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are slower (we need check which provders are available in PyPI and reinstall them before gnerating the constraints so we should only run them in "non-main" build).

@potiuk
Copy link
Member Author

potiuk commented Aug 27, 2023

This is the ultimate one needed for the 2-7-tests build to succeed (due to the openlineage limitation I had to bump the version as well to 2.7.1).

@potiuk
Copy link
Member Author

potiuk commented Aug 27, 2023

I already cherry-picked that one to v2-7-test - but will replace the cherry-pick including PR# once this one is merged

@potiuk potiuk added this to the Airflow 2.7.1 milestone Aug 27, 2023
@ephraimbuddy ephraimbuddy added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Aug 27, 2023
@ephraimbuddy ephraimbuddy merged commit f9276f0 into main Aug 27, 2023
42 checks passed
@ephraimbuddy ephraimbuddy deleted the use-pypi-constraints-for-prod-non-main-build branch August 27, 2023 15:12
potiuk added a commit that referenced this pull request Aug 27, 2023
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

(cherry picked from commit f9276f0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dev-tools changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants