Repository navigation
Description
Split from #4814.
Problem, the uv-seed image holds a filled uv cache at /cache and a /seed.json record. The runner Job does not mount it, so the first uv child still starts with an empty cache and takes 30 to 101 s. ## Why deferred, the admission policy k8s/devops/roadmap-service/admissionpolicy.yaml limits the volumes and mounts of the runner Job. It admits the tmp and home emptyDirs, the named runner emptyDirs, the config ConfigMap and the planner repo PVC. The homelab cluster runs Kubernetes 1.31 (k8s/README.md), and no test or decision shows that it serves an image volume. A person must also set the uv-seed GHCR package to public, as the service and mcp-server packages are. ## Acceptance criteria, the admission policy admits an image volume for the runner Job and a read-only mount at /opt/uv-seed in the prepare and agent containers. bootstrap_checkout copies /opt/uv-seed/cache into UV_CACHE_DIR when _seed_fits accepts /opt/uv-seed/seed.json, before the first uv child. The first uv child of an implement Job ends in under 30 s on a live cluster run. The uv-seed package is public.
Proposed design
Problem statement
The uv-seed image holds a filled uv cache at /cache and a /seed.json record. The runner Job does not mount it. The first uv child starts with an empty cache and takes 30 to 101 s. This change mounts the seed cache in the runner Job and copies it into UV_CACHE_DIR before the first uv child.
Acceptance criteria
Requirement: Admission policy admits the seed image volume
The runner Job admission policy SHALL admit an image volume named uv-seed and a read-only mount at /opt/uv-seed in the prepare and agent containers.
Scenario: Policy admits the seed volume and mounts
- WHEN
uv run devops ci --check --only k8sruns with the updated admission policy and its policy test - THEN the command exits 0.
Requirement: Admission policy refuses a writable seed mount
The runner Job admission policy MUST refuse a uv-seed mount that is not read-only.
Scenario: Policy refuses a writable seed mount
- WHEN
uv run devops ci --check --only k8sruns with a policy test that sets a writableuv-seedmount - THEN the command exits 0 and its policy test reports
Forbiddenfor the writable mount.
Requirement: bootstrap_checkout copies the accepted seed cache
bootstrap_checkout SHALL copy /opt/uv-seed/cache into UV_CACHE_DIR when _seed_fits accepts /opt/uv-seed/seed.json, before the first uv child.
Scenario: Seed cache is copied before uv runs
- WHEN
uv run pytest tests/roadmap/test_roadmap_runner_tools.py -qruns with a test that sets an accepted seed record and an empty UV cache - THEN the test passes and the copied cache files are present before the first
uvchild starts.
Requirement: bootstrap_checkout skips a rejected seed cache
bootstrap_checkout MUST NOT copy the seed cache when _seed_fits rejects the seed record.
Scenario: Rejected seed cache is not copied
- WHEN
uv run pytest tests/roadmap/test_roadmap_runner_tools.py -qruns with a test that sets a rejected seed record - THEN the test passes and
UV_CACHE_DIRstays empty.
Requirement: Runner Job mounts the seed volume
The runner Job spec SHALL mount the uv-seed image volume at /opt/uv-seed read-only in the prepare and agent containers.
Scenario: Job spec includes the seed volume and mounts
- WHEN
uv run pytest tests/roadmap/implement/test_roadmap_implement_step.py -qruns with the Job builder - THEN the test passes and the built Job has the
uv-seedvolume and the read-only mounts inprepareandagent.
Requirement: Pending a person after the merge
The first uv child of an implement Job MUST end in under 30 s on a live cluster run after the uv-seed package is public and the cluster serves an image volume.
Scenario: Live implement Job starts uv with the seed cache
- WHEN a person runs one implement Job on the homelab cluster with the
uv-seedpackage public and theImageVolumefeature gate enabled - THEN the job log shows the first
uvchild ends in under 30 s.
Existing Tool Considered
No alternatives check has run. Kubernetes image volumes cover the read-only mount of the uv-seed image at /opt/uv-seed, and Python shutil.copytree covers the copy into UV_CACHE_DIR. The image volume lacks support on Kubernetes 1.31 unless the ImageVolume feature gate is enabled, and the uv-seed GHCR package must be public.
Key questions
- Which mechanism mounts the uv-seed cache in the runner Job?: Use a Kubernetes
imagevolume nameduv-seedand mount it read-only at/opt/uv-seedin theprepareandagentcontainers. The cluster does not serve it by default, so the issue waits for theImageVolumefeature gate. (best practice) [sources: k8s/devops/roadmap-service/admissionpolicy.yaml, k8s/README.md]- Chosen: Kubernetes image volume. It gives a read-only mount with no copy and no PVC.
- Rejected: Init container copy to emptyDir. It needs a third init container, a policy change, and a copy tool in the uv-seed image.
- Rejected: PersistentVolumeClaim. It needs a person to populate and manage the claim.
- Rejected: Bake the cache into the runner image. It grows the runner image and duplicates the uv-seed image.
- Which image may the admission policy admit for the uv-seed volume?: Only an image whose reference starts with
ghcr.io/dan-petty/devops-cli/uv-seed:, with a tag, or with@, with a digest. (best practice) [sources: k8s/devops/roadmap-service/admissionpolicy.yaml]- Chosen: Restrict to the uv-seed repository. It matches the runner image rule and blocks arbitrary images.
- Rejected: Admit any image. The policy limits what a Job may run.
- How does
bootstrap_checkoutcopy the seed cache?: Useshutil.copytreewithdirs_exist_ok=Trueto copy/opt/uv-seed/cacheintoUV_CACHE_DIRafter_seed_fitsaccepts/opt/uv-seed/seed.json. (best practice) [sources: src/devops_cli/roadmap/runner_tools.py:355, src/devops_cli/roadmap/implement/implement_shell.py]- Chosen:
shutil.copytreewithdirs_exist_ok=True. It is in the standard library, keeps the tree, and accepts an existing target. - Rejected:
shutil.copy2for each file. It needs more code and is slower. - Rejected: Hardlinks with
os.link. The image volume and the emptyDir are different filesystems, so hardlinks fail.
- Chosen:
- Does the admission policy admit the uv-seed volume for stage and planner Jobs?: No. The policy SHALL admit the
uv-seedvolume only for a runner Job. (best practice) [sources: k8s/devops/roadmap-service/admissionpolicy.yaml]- Chosen: Runner Job only. Only the runner Job runs the
uvchild. - Rejected: All Jobs. It widens the policy for no need.
- Chosen: Runner Job only. Only the runner Job runs the
- Does the homelab cluster serve an
imagevolume?: No by default. The homelab runs Kubernetes 1.31, and theImageVolumefeature gate is alpha and disabled by default. [sources: k8s/README.md]
Fit
Fits in one pull request.
Suspected block
The homelab cluster must serve an image volume (Kubernetes 1.31 alpha ImageVolume gate), and a person must set the uv-seed GHCR package to public.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 25, 2026
Both seed the uv cache for runner pods; the candidate mounts the seed volume in the runner Job, while #4814 covers the broader seeding strategy.devops-cli-service commentedon Nov 25, 2026
Owner question: See Suspected block 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 28, 2026
Owner question: See Suspected block in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence