Skip to content

[v3-0-test] Replace chicken-egg providers with automated use of unrel…#50109

Merged
potiuk merged 1 commit intoapache:v3-0-testfrom
potiuk:backport-c6a2b8e-v3-0-test
May 2, 2025
Merged

[v3-0-test] Replace chicken-egg providers with automated use of unrel…#50109
potiuk merged 1 commit intoapache:v3-0-testfrom
potiuk:backport-c6a2b8e-v3-0-test

Conversation

@potiuk
Copy link
Member

@potiuk potiuk commented May 2, 2025

…eased packages (#49799)

  • Replace chicken-egg providers with automated use of unreleased packages

When we got rid of the .dev0 suffix, it is now possible to entirely rely on building the packages locally using exsting mechanisms, that check if packages have been already released - for CI builds, and can rely on the fact that we need at least pre-release version of packages if we are building pre-release version of airflow.

It works as follows:

  • for CI builds (generate constraints and PROD image builds) - we are alwasys attempt to build ALL provider packages, but without --skip-tag-check - which means that if provider has been already released and it's version did not change in main, we are not going to build it locally and we will use it from PyPI. However if provider version is updated and the provider has not yet been released (checked by tag) - it will be build locally from sources and it will be used for constraint generation.

  • for release PROD images build, on the other hand we NEVER build packages locally - we always rely on PyPI released packages, however if we are building pre-release version of airflow, we automatically add --pre flag that looks for pre-release packages in PyPI - this way pre-release version of airflow can be built with pre-release version of providers. We are still attempting to use constraints for that, however first - so unless there are no limits in apache airflow that prevent it from using released versions of providers, the constraint versions will be used - only if it fails, PROD images will fall back to non-constraint installation that will allow to use freely pre-release versions of packages from PyPI. This means for example that if we cherry-pick a change from main that increases minimum version of provider for apache-airflow to one that does not even have a pre-release version, building of rc version image for airflow will fail (which is a good thing). Lack of --pre flag for "release" version of Airlfow also means that if airlfow has a min version of provider that has no "released" version yet (only rc) - it will also fail (which is also a good thing)

  • Update scripts/in_container/run_generate_constraints.py (cherry picked from commit c6a2b8e)


^ 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 airflow-core/newsfragments.

@potiuk
Copy link
Member Author

potiuk commented May 2, 2025

I did not cherry - pick it last week !

@potiuk potiuk force-pushed the backport-c6a2b8e-v3-0-test branch 2 times, most recently from 217aa61 to bb3ec5b Compare May 2, 2025 05:35
…eased packages (apache#49799)

* Replace chicken-egg providers with automated use of unreleased packages

When we got rid of the .dev0 suffix, it is now possible to entirely
rely on building the packages locally using exsting mechanisms, that
check if packages have been already released - for CI builds, and can
rely on the fact that we need at least pre-release version of packages
if we are building pre-release version of airflow.

It works as follows:

* for CI builds (generate constraints and PROD image builds) - we are
  alwasys attempt to build ALL provider packages, but without
  --skip-tag-check - which means that if provider has been already
  released and it's version did not change in main, we are not going
  to build it locally and we will use it from PyPI. However if provider
  version is updated and the provider has not yet been released (checked
  by tag) - it will be build locally from sources and it will be used
  for constraint generation.

* for release PROD images build, on the other hand we NEVER build
  packages locally - we always rely on PyPI released packages, however
  if we are building pre-release version of airflow, we automatically
  add --pre flag that looks for pre-release packages in PyPI - this way
  pre-release version of airflow can be built with pre-release version
  of providers. We are still attempting to use constraints for that,
  however first - so unless there are no limits in apache airflow
  that prevent it from using released versions of providers, the
  constraint versions will be used - only if it fails, PROD images
  will fall back to non-constraint installation that will allow to
  use freely pre-release versions of packages from PyPI. This means
  for example that if we cherry-pick a change from main that increases
  minimum version of provider for apache-airflow to one that does not
  even have a pre-release version, building of rc version image for
  airflow will fail (which is a good thing). Lack of --pre flag
  for "release" version of Airlfow also means that if airlfow has
  a min version of provider that has no "released" version yet (only
  rc) - it will also fail (which is also a good thing)

* Update scripts/in_container/run_generate_constraints.py
(cherry picked from commit c6a2b8e)

Co-authored-by: Jarek Potiuk <[email protected]>
@potiuk potiuk force-pushed the backport-c6a2b8e-v3-0-test branch from bb3ec5b to acc44c3 Compare May 2, 2025 05:56
@potiuk potiuk merged commit ee0d68c into apache:v3-0-test May 2, 2025
73 checks passed
@potiuk potiuk deleted the backport-c6a2b8e-v3-0-test branch May 2, 2025 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants