Skip to content

build(docker): install runtime deps from uv.lock - #28

Merged
Trosper3 merged 1 commit into
mainfrom
chore/docker-use-uv-lock
Nov 17, 2026
Merged

Trosper3 merged 1 commit into
mainfrom
chore/docker-use-uv-lock

Conversation

@wrigjl

@wrigjl wrigjl commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #27. This PR targets chore/pip-audit-upgrades so the diff shows only this change. When #27 merges and its branch is deleted, GitHub retargets this PR to main. Built on its own against main, the image would install the vulnerable versions main's lock still has.

Summary

The image installed the wheel with uv pip install, which resolves runtime dependencies fresh from PyPI and ignores uv.lock. The audit gate checks the lock, so the image could ship versions pip-audit never saw. For example, it had scipy 1.18.1 while the lock had 1.18.0.

  • Locked deps: the build stage runs uv export --locked --no-dev --no-emit-project. That writes the locked runtime deps with hashes, and --locked fails the build if uv.lock is out of date with pyproject.toml. (--frozen would silently export the stale lock; I checked.)
  • Install order: the runtime stage installs those deps with --require-hashes, then installs the quantumsolver wheel with --no-deps. The integration suite still tests the wheel.
  • Base image: pinned from the floating uv:python3.13-trixie-slim tag to uv:0.13.9-python3.13-trixie-slim, which is what the floating tag resolves to today.
  • Dependabot: adds the docker ecosystem so it bumps that pin.

Testing

  • The image's installed packages match uv export --locked exactly. The one exception is colorama, which the lock marks sys_platform == 'win32', so Linux correctly skips it.
  • Changing pyproject.toml without re-locking makes docker build fail at the uv export --locked step.
  • In a container from the new image: healthy within 2 s, and the integration suite passes (6 tests).

Dependabot needs repository settings (admin)

.github/dependabot.yml already lists the uv ecosystem, which covers uv.lock. But Dependabot has never opened a PR on this repo, even though several dependencies are behind (gunicorn 24.1.1 → 27.0.1, qiskit 2.4.1 → 2.6.2, qiskit-aer 0.17.2 → 0.18.4, ruff, pytest). The API reports Dependabot alerts are disabled, and the dependency graph appears to be off. Someone with admin access needs to enable these under Settings → Code security (they may be blocked at the org level, under ReduxISU's own Code security settings):

  1. Dependency graph
  2. Dependabot alerts
  3. Dependabot security updates: these open PRs for vulnerable transitive packages in uv.lock (e.g. werkzeug via Flask). Scheduled version updates normally bump only direct dependencies, so without this, transitive fixes depend on the pip-audit gate failing and someone re-locking by hand.
  4. Dependabot version updates should then start running from the existing config. The repo's Insights → Dependency graph → Dependabot tab shows the last check and any errors.

🤖 Generated with Claude Code

The image installed the wheel with `uv pip install`, which resolved its
dependencies fresh from PyPI and ignored uv.lock, so the image could
ship package versions pip-audit never checked. Export the locked
runtime deps with hashes in the build stage (`uv export --locked`,
which fails the build on a stale lock) and install them with
--require-hashes, then install the wheel with --no-deps.

Pin the uv base image to 0.13.9-python3.13-trixie-slim for repeatable
builds, and add the docker ecosystem to Dependabot so it bumps the pin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Redux Build System — CI Report

uv · commit bca201a

Operation Status Summary Time
audit ✅ no known vulnerabilities 7.6s
format-check ✅ all files formatted 0.4s
lint ✅ 0 issues 0.0s
typecheck ⏭️ not implemented —
unit-test · 3.12 ✅ 65 passed · coverage 86% 72.6s
unit-test · 3.13 ✅ 65 passed · coverage 86% 57.0s
build ✅ built local/quantumsolver:ci · 582MB 17.3s
integration-test ✅ /health ready · 6 passed 6.4s
push ⏭️ only on push to main —

Overall: ✅ 7 passed · 0 failed · 2 skipped

@Trosper3
Trosper3 changed the base branch from chore/pip-audit-upgrades to main November 17, 2026 16:55

@Trosper3 Trosper3 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks again for the good catch here. I will be looking at turning on a few settings across the other repos now thanks to you. :)

@Trosper3
Trosper3 merged commit 1e46120 into main Nov 17, 2026
1 check passed
@Trosper3
Trosper3 deleted the chore/docker-use-uv-lock branch November 17, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants