k8s/dev: back registry-service-portal with PVC and protect service-portal caches from DinD eviction #861
<!-- eval-runner:comparison:eval-runner/pr-861 -->
INCONCLUSIVE · P(improvement) = 0.50
INCONCLUSIVE: 6 task(s) inconclusive; more samples recommended; tasks not executed by both runs: terminal-bench/polyglot-c-py, terminal-bench/regex-log
| eval | affinity | base | this PR | Δ (95% CI) | label | samples | tokens | W/L/T | P(imp) |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| docs/readme\_comprehension | matched | 1.00 | 1.00 | +0.00 [+0.00, +0.00] | unchanged | 8 | 370999 (+R 2197) | 0/0/8 | 0.50 |
| docs/readme\_comprehension\_blind | matched | 0.50 | 0.50 | +0.00 [+0.00, +0.00] | unchanged | 8 | 13230 (+R 11262) | 0/0/8 | 0.50 |
| terminal-bench/fix-code-vulnerability | unmatched | 0.00 | 1.00 | +1.00 [+1.00, +1.00] | inconclusive | 1 | 2870338 | 1/0/0 | 0.75 |
| terminal-bench/fix-code-vulnerability/oracle | unmatched | 1.00 | 1.00 | +0.00 [+0.00, +0.00] | inconclusive | 1 | — | 0/0/1 | 0.50 |
| terminal-bench/log-summary-date-ranges | unmatched | 1.00 | 1.00 | +0.00 [+0.00, +0.00] | inconclusive | 1 | 1928273 | 0/0/1 | 0.50 |
| terminal-bench/log-summary-date-ranges/oracle | unmatched | 1.00 | 1.00 | +0.00 [+0.00, +0.00] | inconclusive | 1 | — | 0/0/1 | 0.50 |
| terminal-bench/polyglot-c-py/oracle | unmatched | 1.00 | 1.00 | +0.00 [+0.00, +0.00] | inconclusive | 1 | — | 0/0/1 | 0.50 |
| terminal-bench/regex-log/oracle | unmatched | 1.00 | 1.00 | +0.00 [+0.00, +0.00] | inconclusive | 1 | — | 0/0/1 | 0.50 |
22 of 44 possible samples · paired against base commit 9e12fb4 · 2 matched · trajectories · web view
p50 latency −77%
(Automatic review) Clean design overall (PVC + Recreate with rollingUpdate: null, PriorityClass, kind-node anti-affinity, PSA restricted namespace, and idempotent configure-service-portals helper). Two items to fix before approval:
1. Missing REGISTRY_HTTP_RELATIVEURLS: "true" in k8s/registry-service-portal.yaml: registry:2 behind the TLS-terminating service portal must set REGISTRY_HTTP_RELATIVEURLS: "true" so blob upload Location headers are relative rather than http://registry-service-portal...:5000/... (without it, HTTPS Docker/BuildKit pushes fail; this env var is set on the live cluster). Please add REGISTRY_HTTP_RELATIVEURLS: "true" to the registry container env in k8s/registry-service-portal.yaml and assert it in pkg/controller/service_portal_manifest_test.go.
2. Gate registry-service-portal rollout wait on SKIP_SERVICE_PORTAL != "true" in dev/tasks/deploy-to-kube: Currently lines 471 and 479 unconditionally run kubectl -n eval-runner-service-portals rollout status deployment/registry-service-portal --timeout=300s even when --skip-service-portal is passed. Please gate that rollout wait on [[ "${SKIP_SERVICE_PORTAL}" != "true" ]] (matching the configure-service-portals block right below it).
(Automatic review) LGTM on 71e934ee (all 5/5 ap-* checks green). Both review items addressed (REGISTRY_HTTP_RELATIVEURLS: "true" + manifest test, and SKIP_SERVICE_PORTAL != "true" gate in deploy-to-kube). Ready for merge.
(Automatic review) Please remove dev/tasks/test-configure-service-portals — we do not want unit test scripts under dev/tasks/ testing helper scripts ("test for a test"). Everything else looks good.
(Automatic review) Please also remove pkg/controller/service_portal_manifest_test.go — it only mirrors the static YAML fields in k8s/00-namespaces.yaml and k8s/registry-service-portal.yaml rather than testing controller behavior.
(Automatic review) Thanks for removing the test scripts. Looking at the overall diff, we can simplify this PR dramatically further:
dev/tasks/deploy-to-kube does not deploy ocicache-service-portal, goproxy-service-portal, or httpcache-service-portal (those live in gke-labs/service-portals), so adding a 419-line Python patching script (dev/tasks/configure-service-portals) is way more machinery than needed here.
Please remove:
dev/tasks/configure-service-portalsdev/tasks/deploy-to-kubedev/tasks/README.mdKeep this PR focused and small:
1. k8s/00-namespaces.yaml (eval-runner-service-portals namespace)
2. k8s/registry-service-portal.yaml (PriorityClass, 50Gi PVC, Deployment with Recreate, REGISTRY_HTTP_RELATIVEURLS=true, kind-node anti-affinity, requests/limits, safe-to-evict: false, and Service)
3. The SKIP_SERVICE_PORTAL != "true" rollout status wait in dev/tasks/deploy-to-kube
4. A short note in docs/development.md / docs/architecture.md mentioning that operators running optional gke-labs/service-portals caches can attach the same eval-runner-service-portal PriorityClass and kind-node anti-affinity.
(Automatic review) LGTM on 77202275 (5/5 ap-* checks green). Super clean (~180 lines across 5 files): eval-runner-service-portals namespace, PVC-backed registry-service-portal with REGISTRY_HTTP_RELATIVEURLS=true, PriorityClass, kind-node anti-affinity, gated rollout wait in deploy-to-kube, and concise docs. Ready for merge.
justinsb
codebot-robot
Summary
eval-runner-service-portalsnamespace (PSArestricted) tok8s/00-namespaces.yaml.k8s/registry-service-portal.yamlwith:- Shared
eval-runner-service-portalPriorityClass(value: 1000000) so kubelet evicts default-priority sandbox pods before shared registries/caches.-
50GiReadWriteOncePersistentVolumeClaimbacking/var/lib/registrywithstrategy.type: Recreate(androllingUpdate: null) instead ofemptyDir.- Explicit CPU/memory requests and limits (
100m/256Mirequests,1/1Gilimits — avoidingBestEffortQoS),cluster-autoscaler.kubernetes.io/safe-to-evict: "false", restrictedsecurityContext, and requirednodeAffinityexcludingeval-runner.gke-labs.dev/kind=trueDinD worker nodes.-
registry-service-portalServiceon port5000.dev/tasks/configure-service-portals(with unit/CLI tests indev/tasks/test-configure-service-portals) and invoke it fromdev/tasks/deploy-to-kubeto apply the samePriorityClass,safe-to-evict: "false",nodeAffinityoffeval-runner.gke-labs.dev/kind=true, and non-BestEffortCPU/memory requests & limits to existing caching service-portal Deployments (registry-service-portal,ocicache-service-portal,goproxy-service-portal,httpcache-service-portal).pkg/controller/service_portal_manifest_test.go.k8s/registry-service-portal.yaml, caching service-portal protection, and the durability contract between prebuilddone.jsonmarkers andEVAL_IMAGE_REGISTRYindocs/architecture.md,docs/development.md, anddev/tasks/README.md.Fixes #858
Verification
./dev/ci/presubmits/ap-buildpassed./dev/ci/presubmits/ap-lintpassed./dev/ci/presubmits/ap-verify-generatepassed./dev/ci/presubmits/ap-testpassed (includingtest-configure-service-portals,test-evals, andpkg/controller/service_portal_manifest_test.go)IMAGE_PREFIX=images.local ./dev/tasks/deploy --dry-runpassed