actions / actions/actions-runner-controller

occasionally `docker run` will hang for 30s-3min

Open
#3,027 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug community needs triage
Dominant language
Go
Stars
6.5k
Forks
1.5k
Avg merge
2d 2h
Merged PRs (30d)
27

Description

Checks
Controller Version

0.23.5

Deployment Method

Helm

Checks
  • This isn't a question or user support case (For Q&A and community support, go to Discussions).
  • I've read the Changelog before submitting this issue and I'm sure it's not due to any recently-introduced backward-incompatible changes
To Reproduce
- Deploy a self hosted runner to kubernetes. I am using `dockerdWithinRunnerContainer: true` but I believe the same thing will happen without that


apiVersion: actions.summerwind.dev/v1alpha1
kind: RunnerDeployment
spec:
  replicas: 1
  template:
    spec:
      dockerdWithinRunnerContainer: true
      repository: ...
      serviceAccountName: ...
      securityContext:
        # For Ubuntu 20.04 runner
        fsGroup: 1000
      resources:
        limits:
          memory: 20Gi
        requests:
          cpu: "6"
          memory: 20Gi
Describe the bug

Occasionally I see docker run commands take 2-3 minutes to start executing. This is true even if I pull the image first. For example, if a workflow runs:

docker pull hello-world
echo "--- DONE PULLING ---"
time docker run hello-world

Then occasionally, maybe 5% of the time, I see the pull happen, followed by a long delay, and then the run will finally execute. This can take 2-3 minutes to happen.

I can manually recreate this by exec-ing into the k8s pod using 2 shells and running this in each:

while true; do
    time docker run hello-world
done

Initially this will run quite fast, but at some point you'll see that the runtime will start to take upwards of 2-3 minutes occasionally. This seems to be some contention, but I cannot identify where the contention exists.

Describe the expected behavior

Docker run should happen quickly and consistently.

Additional Context
Nothing of note here
Controller Logs
Nothing of note here
Runner Pod Logs
Nothing of note here

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the RunnerDeployment manifest, especially dockerdWithinRunnerContainer, and reproduce the delay in the runner pod using two concurrent docker run hello-world loops. Check the controller logs and runner pod logs while comparing normal and delayed runs. Done means the intermittent 30-second-to-three-minute delay is explained and Docker runs start quickly and consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, github-actions, helm, kubernetes
Domain
ci-cd, devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.