Skip to content

Conversation

RayBB
Copy link
Collaborator

@RayBB RayBB commented Jul 7, 2025

Testing what it would take to get UV working for our docker setup. It's supposed to be a lot faster.

A nice byproduct is that it actually simplifies the dockerfiles a bit

Before

docker build --no-cache -f docker/Dockerfile.olbase -t openlibrary/olbase:latest .
RUN python -m pip install --upgrade pip wheel && python -m pip install --default-timeout=100 -r requirements.txt 29.3s

docker compose build
RUN python -m pip install -r requirements_test.txt && python -m pip list --outdated 18.1s
RUN pip install $(grep -E 'webpy.git|web.py==|multipart==|Babel==' requirements.txt) 9.9s

Total time: 57.3 seconds

After

docker build --no-cache -f docker/Dockerfile.olbase -t openlibrary/olbase:latest .
RUN uv pip install --upgrade wheel 1.0s
RUN uv pip install -r requirements.txt 10.6s

docker compose build
RUN uv pip install -r requirements_test.txt && uv pip list --outdated 12.3s
RUN uv pip install $(grep -E 'webpy.git|web.py==|multipart==|Babel==' requirements.txt) 0.2s

Total time: 24.1 seconds

Technical

Testing

Screenshot

Stakeholders

@github-project-automation github-project-automation bot moved this to Waiting Review/Merge from Staff in Ray's Project Jul 7, 2025
# Link the ia CLI binary into /usr/local/bin so that it shows up
# on the PATH. Do this instead of trying to modify the PATH, because
# that causes headaches with su, cron, etc.
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
Copy link

Choose a reason for hiding this comment

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

Looks like you're not using uvx, you could skip it.

@RayBB RayBB marked this pull request as ready for review July 16, 2025 18:17
@cdrini
Copy link
Collaborator

cdrini commented Jul 22, 2025

Before:

Pip install on my machine:

docker build --no-cache -f docker/Dockerfile.olbase -t openlibrary/olbase:latest .
 => [11/16] RUN python -m pip install --upgrade pip wheel  && python -m pip install --default-timeout=100 -r requirements.t  89.5s

With uv:

 => [stage-0 13/17] RUN uv pip install -r requirements.txt                                                                   28.2s 

Cut out 70s!

Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

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

This is looking great! Tossed up on testing.openlibrary.org and it appears to be working smoothly. Will monitor for a few days and if it looks ok, good to merge. Thank you @RayBB and @zanieb !

@cdrini cdrini merged commit 4b57a6f into master Jul 30, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from Waiting Review/Merge from Staff to Done in Ray's Project Jul 30, 2025
@cdrini cdrini deleted the uv-testing branch July 30, 2025 16:27
@cdrini
Copy link
Collaborator

cdrini commented Jul 30, 2025

Testing has been working smoothly, so I think we're good to go!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants