feat: add a runner type without DinD for buildah-based build pipelines #29
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Now that
brooktrails/pr-reviewer'sbuild-push.yamlhas migrated fromdocker buildtobuildah bud(withpodmanfor the smoke test), it no longer needs a Docker-in-Docker sidecar. The currentruns-on: [dind, trusted]selector still routes the job to a runner pool that brings up DinD as an unused dependency — extra pod startup time, extra memory, an extra privileged container that isn't doing anything.Once a couple more workflows make the same migration (notably
brooktrails/brooktrails-web'sbuild-push.yaml), it would be worth defining a new lightweight runner type that:[trusted]already implies for elevated capabilities (cgroup access, etc.).buildahoroci-build) so workflows can opt in deliberately rather than landing on it implicitly.After that's available,
pr-reviewer'sruns-onbecomes[buildah, trusted](or whatever the chosen tag is) and the unused DinD sidecar drops away.Open questions:
dindrunner type entirely once nothing references it, or keep both around for now.[trusted]already grants? (We currently forcevfsstorage andchrootisolation specifically because the runner doesn't have privileges to use overlay or runc-with-namespaces. A more privileged runner could lift those.)Status update — groundwork in place as of v0.4.0.
The operator already exposes the two mechanics this runner type needs:
KubernetesBackendSpec.Privileged=falseomits the DinD sidecar entirely, andspec.Labelssets theruns-ontags a workflow opts into.The key enabler landed in v0.4.0 (PR #31, "don't make non-DinD runners ping a docker daemon"): a non-privileged pool now sets
docker_host: "-"and drops theDOCKER_HOSTenv, so a DinD-less runner actually executes jobs on the runner container instead of crashlooping against a daemon that isn't there. That bug was the prerequisite for a lightweight, no-DinD runner type, and it's now fixed and released.Further groundwork — host-execution labels (
fix/non-dind-host-labels).While debugging a non-DinD pool in production we found that the operator registered a non-privileged pool's labels bare (e.g.
trusted,gllm), which Forgejo treats as Docker-executed — so the runner demanded a daemon at startup and crashlooped. The fix registers non-privileged pools with host-type labels (<name>:host), which run the job on the runner container and never require Docker. Privileged (DinD) pools are unchanged.This is the missing piece for the lightweight runner type this issue asks for: a
[buildah, trusted]-style pool can now run with no DinD sidecar and no daemon. Whenpr-reviewermigrates off DinD, flipping its pool to non-privileged is what triggers this path.