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 to replace pip #5350

Merged
merged 69 commits into from
Feb 27, 2024

Conversation

sanderegg
Copy link
Member

@sanderegg sanderegg commented Feb 20, 2024

What do these changes do?

NOISY PR

  • introduce uv, an extremely fast pip replacement done by the same team as Ruff
  • introduce setup uv github action to install uv in the CI (uses latest).
  • fixes some missing dependencies in a few packages w.r.t. prometheus-fastapi-instrumentator
  • adapted Dockerfiles to use uv instead of pip (@pcrespov please give special thoughts on service-integration), uses latest 0.1.X version for now (this also speeds up devel mode startup time)
  • adapted the ci.txt/prod.txt/dev.txt files as uv does not like entries such as ../models-library it needs one of -e, -c or -r or package-name @ path/to/package
  • replaced all calls to pip install with uv pip install
  • replaced all calls to pip-sync with uv pip sync
  • replaced all calls to pip-compile with uv pip compile
  • uniformized CI calls for unit/integration/system tests
  • migrated deprecated pck_resources to importlib.resources, importlib.metadata

BEFORE
image

AFTER
image
--> 8x faster installation of webserver

Interesting note

  • make build resolves in 225 seconds on my machine, 180s are used to compile the frontend

Installation

curl -LsSf https://astral.sh/uv/install.sh | sh
# or via pip
pip install uv

Related issue/s

How to test

make build
make build-devel
cd services/web/server # to install the webserver
make install-dev

Dev Checklist

DevOps Checklist

@sanderegg sanderegg added the a:infra+ops maintenance of infrastructure or operations (discussed in retro) label Feb 20, 2024
@sanderegg sanderegg added this to the Schoggilebe milestone Feb 20, 2024
@sanderegg sanderegg self-assigned this Feb 20, 2024
Copy link

codecov bot commented Feb 20, 2024

Codecov Report

Attention: Patch coverage is 85.00000% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 87.5%. Comparing base (347ccc6) to head (1223041).

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #5350   +/-   ##
======================================
  Coverage    87.5%   87.5%           
======================================
  Files        1318    1318           
  Lines       54197   54164   -33     
  Branches     1176    1174    -2     
======================================
- Hits        47431   47406   -25     
+ Misses       6516    6509    -7     
+ Partials      250     249    -1     
Flag Coverage Δ
integrationtests 65.1% <62.9%> (+<0.1%) ⬆️
unittests 85.3% <85.0%> (+<0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
packages/aws-library/src/aws_library/__init__.py 100.0% <100.0%> (ø)
...s-library/src/dask_task_models_library/__init__.py 100.0% <100.0%> (ø)
...ages/models-library/src/models_library/__init__.py 100.0% <100.0%> (ø)
...database/src/simcore_postgres_database/__init__.py 100.0% <100.0%> (ø)
...ackages/service-library/src/servicelib/__init__.py 100.0% <100.0%> (ø)
...kages/service-library/src/servicelib/utils_meta.py 100.0% <100.0%> (+13.7%) ⬆️
.../settings-library/src/settings_library/__init__.py 100.0% <100.0%> (ø)
packages/simcore-sdk/src/simcore_sdk/__init__.py 100.0% <100.0%> (ø)
services/agent/src/simcore_service_agent/_meta.py 100.0% <100.0%> (+15.0%) ⬆️
...eeper/src/simcore_service_clusters_keeper/_meta.py 100.0% <100.0%> (+7.6%) ⬆️
... and 12 more

... and 7 files with indirect coverage changes

@sanderegg sanderegg force-pushed the maintenance/use-uv branch 10 times, most recently from 6de5632 to a06e9f5 Compare February 27, 2024 09:47
@sanderegg sanderegg marked this pull request as ready for review February 27, 2024 09:48
@wvangeit
Copy link
Contributor

wvangeit commented Feb 27, 2024

This is just for our compilation/build, right? It won't be exposed to the user?
I'd just be a bit afraid to expose a tool that's only in development since 6 months or so, wrt compatibility issues.

But otherwise, great that we have faster build times now.

Copy link
Member

@mrnicegyu11 mrnicegyu11 left a comment

Choose a reason for hiding this comment

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

dope! looking forward thx

Copy link
Contributor

@matusdrobuliak66 matusdrobuliak66 left a comment

Choose a reason for hiding this comment

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

Wau thanks a lot! looking forward.

Copy link
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

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

great job and greatly appreciated!

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@sanderegg sanderegg merged commit 5156f45 into ITISFoundation:master Feb 27, 2024
55 checks passed
@sanderegg sanderegg deleted the maintenance/use-uv branch February 27, 2024 15:18
jsaq007 pushed a commit to jsaq007/osparc-simcore that referenced this pull request Feb 27, 2024
jsaq007 pushed a commit to jsaq007/osparc-simcore that referenced this pull request Feb 27, 2024
jsaq007 pushed a commit to jsaq007/osparc-simcore that referenced this pull request Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:infra+ops maintenance of infrastructure or operations (discussed in retro)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants