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 uv as packaging tool used in CI builds #37692

Merged
merged 1 commit into from
Feb 26, 2024
Merged

Use uv as packaging tool used in CI builds #37692

merged 1 commit into from
Feb 26, 2024

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Feb 25, 2024

The uv tool released in Feb 2024 by ruff creators provides a way faster drop-in replacement to pip and we are using it now in our CI, when it can bring significant speed improvements (and soon possibly more features).

This PR replaces pip install and pip uninstall with equivalent uv pip install and uv pip uninstall commands, controlled by a single AIRFLOW_USE_UV ARG. In CI images it is set to "true" so CI images are prepared using UV, but PROD images (which are also used during CI tests) are built using pip. This way we can get both - stability and compliance for user-facing pip installation and speed and new features coming from uv.


^ 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.

@potiuk potiuk added the canary When set on PR running from apache repo - behave as canary run label Feb 25, 2024
@potiuk potiuk closed this Feb 25, 2024
@potiuk potiuk reopened this Feb 25, 2024
@potiuk potiuk added the upgrade to newer dependencies If set, upgrade to newer dependencies is forced label Feb 25, 2024
@potiuk potiuk closed this Feb 25, 2024
@potiuk potiuk reopened this Feb 25, 2024
@potiuk potiuk force-pushed the use-uv-for-ci-build branch 5 times, most recently from 98b31e0 to 43819fc Compare February 25, 2024 23:35
@potiuk
Copy link
Member Author

potiuk commented Feb 25, 2024

OK. Should be I think ready now. After disabling cache we are still way above 50% in the upgrade scenarios - so definitely worth it.

@potiuk potiuk force-pushed the use-uv-for-ci-build branch 3 times, most recently from 2c9df56 to 1e1aa0b Compare February 25, 2024 23:59
Copy link
Contributor

@amoghrajesh amoghrajesh left a comment

Choose a reason for hiding this comment

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

Generally looks good, one general comment:
For the commands like pip install / uninstall replaced by ${PACKAGING_TOOL} install / uninstall do we not need -y

.github/workflows/ci.yml Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
scripts/docker/entrypoint_ci.sh Outdated Show resolved Hide resolved
@potiuk
Copy link
Member Author

potiuk commented Feb 26, 2024

Should be good to go :).

Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

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

Left one nitpick. Really looking forward to this one!

Dockerfile Outdated Show resolved Hide resolved
Copy link
Collaborator

@aritra24 aritra24 left a comment

Choose a reason for hiding this comment

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

With a brief look it seems good to me.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
The `uv` tool released in Feb 2024 by ruff creators provides a
way faster drop-in replacement to `pip` and we are using it now
in our CI, when it can bring significant speed improvements (and
soon possibly more features).

This PR replaces `pip install` and `pip uninstall` with equivalent
`uv pip install` and `uv pip uninstall` commands, controlled by
a single `AIRFLOW_USE_UV` ARG. In CI images it is set to "true" so
CI images are prepared using UV, but PROD images (which are also
used during CI tests) are built using pip. This way we can get
both - stability and compliance for user-facing `pip` installation
and speed and new features coming from `uv`.
@potiuk
Copy link
Member Author

potiuk commented Feb 26, 2024

All review comments so far addressed. All green.

Copy link
Contributor

@amoghrajesh amoghrajesh left a comment

Choose a reason for hiding this comment

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

Took a second look and things look good from my end. Thanks @potiuk
LGTM +1

@potiuk potiuk merged commit 2d9bb46 into main Feb 26, 2024
106 checks passed
abhishekbhakat pushed a commit to abhishekbhakat/my_airflow that referenced this pull request Mar 5, 2024
The `uv` tool released in Feb 2024 by ruff creators provides a
way faster drop-in replacement to `pip` and we are using it now
in our CI, when it can bring significant speed improvements (and
soon possibly more features).

This PR replaces `pip install` and `pip uninstall` with equivalent
`uv pip install` and `uv pip uninstall` commands, controlled by
a single `AIRFLOW_USE_UV` ARG. In CI images it is set to "true" so
CI images are prepared using UV, but PROD images (which are also
used during CI tests) are built using pip. This way we can get
both - stability and compliance for user-facing `pip` installation
and speed and new features coming from `uv`.
@Taragolis Taragolis deleted the use-uv-for-ci-build branch April 3, 2024 08:51
utkarsharma2 pushed a commit to astronomer/airflow that referenced this pull request Apr 22, 2024
The `uv` tool released in Feb 2024 by ruff creators provides a
way faster drop-in replacement to `pip` and we are using it now
in our CI, when it can bring significant speed improvements (and
soon possibly more features).

This PR replaces `pip install` and `pip uninstall` with equivalent
`uv pip install` and `uv pip uninstall` commands, controlled by
a single `AIRFLOW_USE_UV` ARG. In CI images it is set to "true" so
CI images are prepared using UV, but PROD images (which are also
used during CI tests) are built using pip. This way we can get
both - stability and compliance for user-facing `pip` installation
and speed and new features coming from `uv`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dev-tools area:production-image Production image improvements and fixes area:providers canary When set on PR running from apache repo - behave as canary run kind:documentation provider:weaviate upgrade to newer dependencies If set, upgrade to newer dependencies is forced
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants