Repository navigation
Description
Problem or Motivation
#4550 asked for the wheels of uv.lock in the runner image, named by UV_FIND_LINKS, so that uv sync --locked --offline builds the venv of a checkout with no network. The cluster gate (#4691) needs that venv. This does not work. Measured with uv 0.13.6 in python:3.14-slim-trixie on 2026-11-11, with RUN --network=none:
UV_FIND_LINKS=<wheel dir> uv sync --locked --offlinestops: "Failed to downloadast-grep-cli==0.51.0... Network connectivity is disabled, but the requested data wasn't found in the cache: https://files.pythonhosted.org/...". uv installs a locked package from the URL inuv.lockand reads only its cache. It does not search the find-links for that package.uv sync --locked --offline --no-index --find-links <wheel dir>resolves again for every platform and fails: "only pywin32{sys_platform == 'win32'}<304 is available".- A uv cache in the image, read-only, fails: "Could not acquire lock ... Read-only file system (os error 30)". The root filesystem of a runner pod is read-only.
So the first uv child of an implement Job still starts with an empty cache (30 to 101 s, measured in #4550).
Proposed Solution & Architectural Design
- The runner image holds a uv cache that
uv sync --lockedfilled at build time, for example at/opt/uv-cache. Measured: 852 MB for the runtime and dev groups. - Before the first
uvchild, the pod copies that cache into its writable cache (UV_CACHE_DIRon the home volume), for example in an init container. Measured: the copy takes 9 s, and thenuv sync --locked --offlineof a checkout takes 2 s, with no network. - The pull request states the growth of the runner image against the bound of 3000000000 bytes in the CI smoke test.
Acceptance:
- In the runner image,
uv sync --locked --offlineof amaincheckout into an empty venv ends in at most 60 s with no network. - The first
uvchild of an implement Job ends in under 30 s. - The runner image stays under its size bound.
Target Subsystem
Kubernetes: the runner image (Dockerfile) and the runner Job template.
Existing Tool Considered
uv's own cache and --offline (https://docs.astral.sh/uv/concepts/cache/). uv has no read-only cache and no second cache. Rejected with the evidence above: UV_FIND_LINKS, and --no-index --find-links. Cost to build: about 30,000 tokens and 2 hours; about 1,000 tokens a month to keep; about 5,000 tokens to fix.
Dependencies
#4550 puts the dependencies in their own image layers first. #4691 needs this item.
Alternatives check of 2026-11-14: not-applicable.
Class: perf, no search.
Tool: none found.
Proposed design
Problem statement
The first uv child of an implement Job starts with an empty cache and takes 30 to 101 s. The root file system of a runner pod is read-only, and uv needs a writable cache. A read-only cache in the image fails with a lock error. UV_FIND_LINKS does not serve the locked URLs, and --no-index --find-links resolves for every platform. This change builds and publishes a uv-seed OCI image with a filled cache and a seed record for a later runner Job. The runner Job mount is deferred to a new issue.
Acceptance criteria
Requirement: Seed image target
The Dockerfile SHALL define a uv-seed target that fills /cache with the cache of uv sync --locked --group dev and writes /seed.json with the uv, Python and uv.lock values.
Scenario: The seed target builds
- WHEN A person runs
docker buildx build --target uv-seed --output type=local,dest=seed-out .at the repository root. - THEN The command exits 0,
seed-out/seed.jsonholds theuv,pythonanduv_lock_sha256keys, andseed-out/cacheholds the uv cache.
Requirement: Offline sync from the seed
The seed cache SHALL let uv sync --locked --group dev --offline build the venv of a checkout with no network.
Scenario: The offline sync from the seed cache
- WHEN A person copies
cache/from the seed image and runsuv sync --locked --group dev --offlinein the runner image withUV_CACHE_DIRset to that copy and--network none. - THEN The command exits 0 within 60 seconds and creates the
.venvof the checkout.
Requirement: Seed record contract
The seed build SHALL write /seed.json so that _seed_fits accepts it against the runner's uv, Python and uv.lock.
Scenario: The seed record matches the runner
- WHEN A test calls
_seed_fitsinsrc/devops_cli/roadmap/runner_tools.pywith a record whoseuvandpythonmatch the runner and whoseuv_lock_sha256matches the checkout. - THEN The function returns true, and it returns false for a record with a different
uv,pythonoruv_lock_sha256.
Requirement: CI seed build
The Runner Image job of ci.yml SHALL build the uv-seed target with the runner and mcp-server targets in one bake call and push nothing.
Scenario: The image job runs on the pull request
- WHEN The
Runner Imagejob ofci.ymlruns on a pull request that changesDockerfile. - THEN The job exits 0, loads
devops-cli-uv-seed:local, and its seed smoke step exits 0.
Requirement: Release publishes the seed
The release workflow SHALL publish ghcr.io/dan-petty/devops-cli/uv-seed by digest, smoke-test the digest, attest it and tag it with the release tag and latest.
Scenario: The workflow validators run
- WHEN CI runs
uv run devops ci --check --only actionlint,zizmor. - THEN The command exits 0, so
release.ymlandrelease-image.ymlare valid with theuv-seedmatrix entry and the seed smoke step.
Existing Tool Considered
The alternatives check of 2026-11-14 in the issue body gives the verdict not-applicable for class perf and names no tool. The block holds the result. uv is the open tool that covers the need. It fills the cache with uv sync --locked --group dev and reads it with --offline (src/devops_cli/roadmap/runner_tools.py:363). uv lacks a read-only cache and a command that exports its cache as an image. This change adds a uv-seed target to the existing Dockerfile. It builds the target with the docker/bake-action that ci.yml already uses. The change writes no library code; the body records about 30,000 tokens and 2 hours for the rejected --find-links wheelhouse.
Key questions
- Where does the uv cache seed live?: A separate OCI image,
ghcr.io/dan-petty/devops-cli/uv-seed, holds/cacheand/seed.json. This item builds and publishes the image. The runner Job mount is deferred to a new issue. (best practice) [sources: src/devops_cli/roadmap/runner_tools.py]- Chosen: Separate OCI image. It keeps the runner image unchanged and gives the seed its own release tag.
- Rejected: Cache in the runner image. It grows the runner image by 852 MB and ties each seed to a runner image build.
- Rejected: Read-only cache used directly. uv needs a writable cache even with
--offline; the body measured the lock failure on a read-only file system. - Rejected: Shared PVC or NFS cache. The cluster has no RWX storage, and shared writable state causes flock problems.
- Which base image, uv and Python versions must the seed match?:
_seed_fitscompares the uv version, the<major>.<minor>Python and the sha256 ofuv.lock. The runner image builds FROMdevtoolsand setsUV_PYTHON=/usr/bin/python3.14, so the seed builds FROMdevtoolswith the sameUV_PYTHON. It must not use theuvimage ofDockerfile, whose uv can differ from the devtools uv that a Job runs. (best practice) [sources: src/devops_cli/roadmap/runner_tools.py:363]- Chosen: Build FROM
devtools. It gives the seed the uv and Python 3.14 of the runner image, so_seed_fitsmatches and Renovate moves both images together. - Rejected: Build FROM the
uvimage. The runner takes its uv fromdevtools, which can differ, so the seed would not match and the Job would fall back online. - Rejected: Build FROM
python:3.14-slim-trixiewith uv copied in. It adds a second Python and uv pin that must track the devtools image, with no gain.
- Chosen: Build FROM
- How should the seed image be built and validated?: Add a
uv-seedtarget to the existingDockerfilebefore theservicestage, so a build with no--targetstill builds the Service. The build stage isFROM devtools, setsUV_CACHE_DIR=/cache,UV_PYTHON=/usr/bin/python3.14andUV_COMPILE_BYTECODE=0, copiespyproject.toml,uv.lockandsrc/, runsuv sync --locked --group dev, and writes/seed.json. The finalFROM scratchstage copies/cacheand/seed.json. TheRunner Imagejob ofci.ymladds the target to its bake call with push false, and a smoke step copies the seed out and syncs offline.release.ymladdsuv-seedto the image matrix andrelease-image.ymlgets a seed smoke step. (best practice) [sources: .github/workflows/ci.yml, .github/workflows/release.yml, .github/workflows/release-image.yml]- Chosen: One Dockerfile target and the existing bake call. It reuses the devtools pin, the registry build cache and the one hosted image job.
- Rejected: A separate Dockerfile and a new CI job. It duplicates the devtools pin and adds a hosted job.
- Rejected: A Python builder command that writes the seed. It adds code for a build-time file that a shell line writes; the live check proves the record.
- What runner image size bound applies?: The runner image bound is 7000000000 bytes in
.github/workflows/ci.ymland.github/workflows/release-image.yml. The 3000000000-byte bound in the body is stale. This item does not change the runner image, so the bound does not move. [sources: .github/workflows/ci.yml, .github/workflows/release-image.yml]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
perfprefix of the title gives the type.(k8s)scope of the title gives the scope.It unblocks #4691 and cuts 30 to 101 s from every implement Job, but it is a CI optimisation, not a production defect.Each implement Job saves 30 to 101 s of wait time, which compounds across many Jobs per day.It needs a Dockerfile change, an init container or copy step, and an image-size check; the author estimates about 2 hours.Both work on the runner image and uv cache, but #4550 reorders image layers while this candidate adds a pre-built uv cache and a copy step.dan-petty commentedon Nov 11, 2026
One more measured fact for this item (2026-11-11, runner image of the #4550 change, a host under build load, empty uv cache):
uv run --locked ruff --versionin a copy of the checkout took 110 s, and uv printed "Bytecode compiled 19212 files in 1m 11s". The runner image setsUV_COMPILE_BYTECODE=1for its own build, and everyuvchild of a Job inherits it (the image had the same variable before #4550). A plan for the firstuvchild should measure the cost of that compilation against its gain in a Job.perf(k8s): put the dependencies in their own image layers (#4872)
devops-cli-service commentedon Nov 14, 2026
Alternatives check: not-applicable
Class: perf. The check makes no search and no model call for an item of this class.
Tool: none found
Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 15, 2026
Status set to Ready at e5dfddb (see proposed design in issue body).
6 remaining items
devops-cli-service commentedon Nov 25, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 25, 2026
Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.
chore(main): release 0.219.0 (#7177)
devops-cli-service commentedon Nov 25, 2026
Released in v0.219.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.219.0
devops-cli-service commentedon Nov 25, 2026
Live since 2026-11-25 17:09 UTC