Sub topic 8
Running a workflow on your scale set
This chapter shows how a workflow selects an ARC runner scale set, what happens between the job being queued and a pod picking it up, and how to diagnose a job that never starts.
It assumes you have completed the controller and scale set installs from the earlier chapters. You should have a working arc-runner-set release in the arc-runners namespace, a listener pod in arc-systems, and kubectl access to the cluster. You should also be comfortable writing basic GitHub Actions workflows.
How a job finds a scale set
A scale set does not use runner labels the way a static self-hosted runner does. A workflow targets it by the scale set's name, which is the Helm release name you chose at install time. In the earlier install the release was arc-runner-set, so the workflow uses that string in runs-on.
name: ARC smoke test
on: workflow_dispatch
jobs:
hello:
runs-on: arc-runner-set
steps:
- run: echo "Running on $(hostname)"Three rules follow from this design:
- The value must match the scale set name exactly, including case and hyphens.
- Use the name as the only
runs-onvalue. A scale set matches on a single name, so list forms such as[self-hosted, linux, arc-runner-set]do not select it. - The name is fixed at install time. To change it you either reinstall under a new release name or set
runnerScaleSetNamein the values file.
githubConfigUrl: "https://github.com/<your-org>/<your-repo>"
githubConfigSecret: pre-defined-secret
runnerScaleSetName: "build-small"
runnerGroup: "default"
minRunners: 0
maxRunners: 10With this file, workflows use runs-on: build-small even though the Helm release is still called arc-runner-set. An explicit runnerScaleSetName is useful when you want the workflow-facing name to be stable while release names vary across clusters.
Where the scale set is registered
The scale set registers at the level of githubConfigUrl. A repository URL makes it available to that repository only. An organization URL makes it available to repositories in that organization, subject to the runner group.
A runner group is GitHub's access-control list for runners. The runnerGroup value names the group the scale set joins, and default is used when you omit it. If the group is restricted to selected repositories, a workflow in any other repository will queue forever, even with the correct name.
You can confirm registration in the GitHub UI under Settings > Actions > Runners, where the scale set appears with its name and the number of current runners. For organization-level sets, check Settings > Actions > Runner groups and verify that the repository is allowed.
What happens when you start the workflow
The workflow run does not talk to your cluster. GitHub queues the job, and the listener pod, which holds a long-poll connection to GitHub, receives a message that work is available for its scale set. The listener then asks Kubernetes for more runners.
Each job gets its own pod. If a workflow has ten jobs, or a matrix that expands to ten jobs, the listener requests up to ten runners, bounded by maxRunners. Jobs beyond that limit stay queued until a pod finishes and frees capacity.
Running the smoke test
Trigger the workflow from the Actions tab with Run workflow, or with the GitHub CLI:
gh workflow run "ARC smoke test"In a second terminal, watch the runner namespace:
kubectl get pods -n arc-runners --watchWith minRunners: 0, you will see no pods before the run. A pod named like arc-runner-set-abcde-runner-xyz12 appears, goes through Pending and ContainerCreating to Running, and then terminates after the job completes. The step output shows the pod name from hostname, which confirms the job ran in your cluster and not on a GitHub-hosted machine.
The delay between clicking the button and the Running state is the cold start. It includes scheduling, pulling the runner image, and registering with GitHub. With minRunners: 0 this is typically a few seconds when the image is cached on the node, and longer on a fresh node. The scaling chapter covers keeping warm runners to reduce it.
Matrix and parallel jobs
Because every job gets its own pod, matrix builds fan out naturally:
name: Matrix on ARC
on: workflow_dispatch
jobs:
test:
runs-on: arc-runner-set
strategy:
matrix:
shard: [1, 2, 3, 4]
steps:
- uses: actions/checkout@v4
- run: echo "Shard ${{ matrix.shard }} on $(hostname)"Four jobs produce four pods with different hostnames. They do not share a filesystem, caches, or running processes. If one job produces files for another, pass them through actions/upload-artifact and actions/download-artifact, or through a cache action. Do not rely on a shared volume.
Container jobs and service containers
The container mode you configured at install time affects what a workflow can do.
| Workflow feature | `dind` mode | `kubernetes` mode |
|---|---|---|
| `docker build` and `docker run` steps | Works, using the Docker daemon in a sidecar | Not available by default, there is no Docker daemon |
| `container:` job container | Works | Works, and the container runs in a separate pod |
| `services:` containers | Works | Works, as extra pods |
| Extra setup | Privileged sidecar | A persistent volume for the shared work directory |
If a step fails with Cannot connect to the Docker daemon, the scale set is probably in kubernetes mode. Either switch the scale set to dind or rewrite the step to avoid Docker commands. The container modes chapter covers the trade-offs in more detail.
Using more than one scale set
Different workloads often need different runner shapes, such as a small default pool, a large build pool, and a GPU pool. Install one scale set per shape, each with its own release name and values file, and select among them in the workflow:
jobs:
lint:
runs-on: build-small
steps:
- uses: actions/checkout@v4
- run: make lint
compile:
runs-on: build-large
needs: lint
steps:
- uses: actions/checkout@v4
- run: make buildEach scale set has its own listener and its own minRunners and maxRunners. Scale sets are independent, so one pool being busy never blocks jobs routed to another.
Troubleshooting a job that never starts
When a job sits at "Waiting for a runner to pick up this job", work through these checks in order:
- Name. Compare
runs-onto the Helm release name orrunnerScaleSetName. Runhelm list -n arc-runnersto see the release name. - GitHub registration. Confirm the scale set appears under Settings > Actions > Runners and shows as online.
- Runner group access. Confirm that the repository is permitted in the scale set's runner group.
- Listener. Confirm the listener pod is running with
kubectl get pods -n arc-systems. If it is missing or restarting, read its logs. - Runner pods. If pods exist but are stuck, run
kubectl describe podon one and read the events for image pull errors, missing resources, or scheduling failures. - Capacity. If
maxRunnerspods are already running, the job is correctly waiting for one to finish.
Useful commands for steps 4 and 5:
kubectl get pods -n arc-systems
kubectl logs -n arc-systems -l app.kubernetes.io/component=runner-scale-set-listener --tail=50
kubectl get ephemeralrunners -n arc-runners
kubectl describe pod -n arc-runners <pod-name>The ephemeralrunners resource shows the controller's view of each runner and often reveals registration failures that a pod listing hides.
Exercises
Exercise
A scale set was installed with the Helm release name arc-runner-set, and its values file sets runnerScaleSetName: build-small. Which runs-on value selects it, and why does a job with runs-on: [self-hosted, build-small] not run?
Show answer
Use runs-on: build-small. An explicit runnerScaleSetName overrides the release name as the workflow-facing name. A scale set matches on a single name, so the list form with self-hosted does not select it, and the job stays queued.
Exercise
A matrix job with 12 entries runs against a scale set with minRunners: 0 and maxRunners: 5. How many runner pods exist at peak, and what happens to the remaining jobs?
Show answer
At most 5 runner pods exist at once. The other 7 jobs stay queued on GitHub. As each pod finishes its job and is deleted, the listener requests another runner, until all 12 jobs complete.
Exercise
A workflow with the correct runs-on value stays queued, the listener pod is running, and the scale set shows as online in GitHub. Name two further causes to check.
Show answer
The repository may not be allowed in the scale set's runner group, so GitHub never offers the job to this scale set. Alternatively, the scale set may already be running maxRunners pods, so the job waits for capacity. Runner pods stuck in Pending or an image pull error are also possible, and kubectl describe pod shows them.