DinD runner Design is not compatible with Kubernetes/Karpenter & Needs root #3600
Labels
bug
Something isn't working
gha-runner-scale-set
Related to the gha-runner-scale-set mode
needs triage
Requires review from the maintainers
Checks
Controller Version
0.9.2
Deployment Method
Helm
Checks
To Reproduce
RUNNER_GRACEFUL_STOP_TIMEOUT
COPY --chown=runner:runner run.sh /home/runner/run.sh
Describe the bug
This is a design bug of Scaled Set DinD runner. This Scaled Set DinD runner is clearly meant to run within the kubernetes, but it's not compatible with terminationGracePeriod & karpenter. Pod Movement is expected and application should respect SIGTERM.
While we can do fix the runner and make default/kuberentes type runners compatible with kubernetes/karpenter easily. DinD runner by it's design makes it harder to implement this. Basically, what happens when kubernetes sends a SIGTERM is:
A wrapper script that captures the SIGTERM can't properly fix it and need to think this through, see the next section ( additional Context) on how it's a design issue.
Describe the expected behavior
DinD container should wait until the Runner container is finished running. Capturing SIGTERM on DinD Container with wrapper script and waiting for completion of docker usage ( with run/build) will not work because there could be more workflow steps in the github action that need the DinD container.
Potential Solutions
Thoughts on this Design Bug:
Because DinD container should wait for Runner Container, following are some of the approaches.
-- Use FileSystem as IPC mechanism, and watch that file in the DinD's SIGTERM trap.
-- Use
shareProcessNamespace
and DinD's lifecycle preStop to watch the Runner process.Combine DinD and runner & run it as rootless:
We can install Rootless Docker or daemonless PodMan into the runner itself and use that. There is also another problem of ScaledSet runs DinD as root user , So It's better to look into rootless Docker or Podman as well . Following are the benefits of this approach.
docker run
, dind container is busy but runner sits idle.Controller Logs
Runner Pod Logs
The text was updated successfully, but these errors were encountered: