[Stack 7/27] Speed up CI: replace pip with uv pip in Dockerfile (~2x faster installs)#2484
[Stack 7/27] Speed up CI: replace pip with uv pip in Dockerfile (~2x faster installs)#2484jucor wants to merge 1 commit intojc/disable-snapshot-testsfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Delphi Docker build to use uv pip instead of pip to speed up dependency installation during CI builds.
Changes:
- Adds
uvinto the builder stage and configuresUV_SYSTEM_PYTHON=1to install into system Python. - Replaces
pip installwithuv pip installin dependency install steps (including BuildKit cache mount updates). - Copies
uvinto the test stage to install dev dependencies withuv pip.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Install dependencies from lock file (cached layer - reused unless requirements.lock changes) | ||
| # BuildKit cache mount keeps pip cache between builds for faster rebuilds | ||
| # BuildKit cache mount keeps uv cache between builds for faster rebuilds | ||
| # If USE_CPU_TORCH is true, we install CPU-specific wheels and filter them out of the lockfile |
There was a problem hiding this comment.
The comments in this section are not indented like the rest of the instructions in the builder stage (most lines use two-space indentation, e.g., COPY pyproject... above). Please align the indentation of these comment lines for consistency/readability within the stage.
509a831 to
ec4c93e
Compare
Delphi Coverage Report
|
|
Superseded by spr-managed PR stack. See the new stack starting at #2508. |
Summary
Replace
pip installwithuv pip installin the delphi Dockerfile for faster dependency installation.uv pipis a drop-in replacement — samerequirements.lock, samepyproject.toml, same installed packages insite-packages.Changes
delphi/Dockerfile:uvbinary fromghcr.io/astral-sh/uv:0.11.2(pinned version, single static binary)/opt/uv/in builder to avoid leaking into production image viaCOPY --from=builder /usr/local/binUV_SYSTEM_PYTHON=1(install into system Python, not a venv)pip installwithuv pip installin builder and test stages/root/.cache/pipto/root/.cache/uvuvfrom builder (single source of truth)What's NOT changed
make rebuild-delphiworks as beforeuvadded, stays leanCI Benchmark (GitHub Actions,
ubuntu-latest,--no-cache)5 pip runs (Mar 27 stack push) vs 3 uv pip runs (this PR):
~94 seconds saved per CI run on the Docker build step. Pytest runtime is unchanged (same packages, same tests). Low variance in both groups confirms this is a real improvement, not noise.
Local Benchmark (Apple M1 Max, 64GB, Docker Desktop,
--no-cache)Test plan
docker compose -f docker-compose.test.yml build --no-cache delphisucceeds locallypip showdiagnostic passes in build log)make rebuild-delphiworks (Makefile untouched)