Forgejo runner valid_volumes silently drops container-job mounts
Problem
Container jobs (DinD) on the Forgejo runner need bind-mounts from the host into the job container
for sccache to work: /cache (sccache binary + slot sockets) and /sccache-credentials (S3
credentials, read-only). Adding them to container.options is necessary but not sufficient:
the runner validates the sources against container.valid_volumes too. With the default
valid_volumes: [], the mounts are silently dropped — the job container starts without them,
sccache-setup fails to find the binary or credentials, and the job silently falls back to disk
mode (or fails). The runner log shows the tell-tale:
[/cache] is not a valid volume, will be ignored
[/sccache-credentials] is not a valid volume, will be ignored
Root Cause
The Forgejo runner applies two independent allow-lists to container-job volumes:
container.options— the--volumeflags passed todocker create.container.valid_volumes— a runner-side allow-list that filtersoptionssources before they reach docker.
Both must permit the mount. An empty valid_volumes (the chart default) rejects everything.
The wildcard ** is documented but too broad for this cluster — it would let any job mount any
host path, defeating the purpose of the allow-list.
How to Diagnose
- Runner pod logs for the job: look for
is not a valid volume, will be ignoredlines. - Inside the job container:
ls /cacheandls /sccache-credentials— both empty or missing. - The sccache stats line (Loki
{namespace="ci-runners"} |= "SCCACHE_STATS") showscompile_requests: nullormode: "disk"with no S3 activity, even though the runner'scontainer.optionsstring is correct. kubectl --context=grigri -n ci-runners get configmap <runner-config> -o yaml— checkvalid_volumes.
Fix / Workaround
Allow-list exactly the two sources the runner needs to pass through:
container:
options: "--volume /cache:/cache --volume /sccache-credentials:/sccache-credentials:ro"
valid_volumes:
- /cache
- /sccache-credentials
Do NOT use valid_volumes: ['**'] — it lets any job mount any host path.
After updating the ConfigMap, restart the runner pods so the new config is loaded. Verify by dispatching a container job and checking that both mounts are present inside the container.
Applied in homelab commit ca27baae0 (2026-11-11, both runners restarted and verified live).
Secondary findings
Three related issues surfaced during the same investigation:
-
cargo-zigbuildimage lacksjq.sccache-pin.shneedsjqon every code path (not just the S3 branch). The image ships without it; the pin step silently fails and sccache falls back to whatever binary is on$PATH(often none). Installjqin the container workflow before sccache-setup. -
cargo-zigbuildimage lackscurl.curlis the S3 health probe in sccache-setup; missing it silently falls back to disk mode. Installcurlalongsidejq. -
Dev-profile
cargo newbuilds are never sccache-cacheable. The throwaway project insccache-container-test.ymluses dev profile, which enables incremental compilation by default. sccache never caches incremental builds — every compile lands inrequests_not_cacheable, socompile_requests(the cacheable count) stays 0 and any assertion on it fails even though delivery worked. Fix: setCARGO_INCREMENTAL=0on the test build step. Calypso commit781931ed8(PR pending).
References
- Homelab runner config:
platform/ci-runners/resources/configmap.yamlandconfigmap-amd64.yaml(container.optionsandcontainer.valid_volumes). - Calypso runbook:
docs/runbooks/sccache-observability.mdin the Calypso repo (Loki delivery, schema, verification workflow). - Planning:
planning/sccache-s3-observability.mdin this repo.