Skip to content

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

@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!

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.

@potiuk potiuk force-pushed the use-uv-for-ci-build branch from 97d06d2 to f132519 Compare February 26, 2024 09:49
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 potiuk force-pushed the use-uv-for-ci-build branch from f132519 to ffd4f31 Compare February 26, 2024 09:58
@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

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