Sub topic 8
Running a workflow on your scale set
This chapter assumes you have installed the ARC controller and a runner scale set named arc-runner-set in the arc-runners namespace, as covered in the previous chapters. You should also know the basics of workflow syntax, including on, jobs, and runs-on.
How a workflow finds your scale set
A runner scale set is targeted by its installation name. This is the Helm release name you chose when you ran helm install. In the earlier install, that name was arc-runner-set, so workflows use it as the value of runs-on.
This differs from static self-hosted runners. Those are normally selected with labels such as self-hosted and linux. A scale set does not use that label array. You give runs-on a single string, the installation name.
name: ARC smoke test
on: workflow_dispatch
jobs:
hello:
runs-on: arc-runner-set
steps:
- run: echo "Running on $(hostname)"The workflow_dispatch trigger lets you start the run by hand from the Actions tab. That makes it a good first test.
What happens when the job is queued
The listener pod for your scale set keeps a connection open to GitHub. When a job that targets arc-runner-set is queued, GitHub reports it to the listener. The listener asks the controller to raise the desired runner count. The controller creates an ephemeral runner pod, the runner registers, and it takes the job. When the job ends, the pod is deleted.
Watching it run
Use two terminals. In the first, watch the runner namespace:
kubectl get pods -n arc-systems
kubectl get pods -n arc-runners --watchThe first command shows the controller and listener pods. The second keeps running and prints changes. Then trigger the workflow from the Actions tab. A new pod should appear in arc-runners, move to Running, and disappear once the job finishes.
If minRunners is 0, the first job has to wait for a pod to be scheduled and pulled. Expect some seconds of delay before the job starts. The output of hostname in the job log will be the runner pod name, which confirms the job ran in your cluster.
Common errors
- The job stays queued and no pod appears. The
runs-onvalue does not match the installation name. The match is exact and case sensitive. Check it withhelm list -n arc-runners. - The job queues, but the scale set never sees it. The scale set is registered for a different repository or organization than the one holding the workflow. Check
githubConfigUrlin your values file. - You used
runs-on: [self-hosted, arc-runner-set]. Scale sets do not use label arrays. Use the plain string. - A pod appears but stays
Pending. This is a scheduling or resource problem in the cluster, not a workflow problem. Runkubectl describe podon it.
Exercises
Exercise
A scale set was installed with helm install build-runners .... What should runs-on be in a workflow that targets it, and why is runs-on: [self-hosted, linux] the wrong choice?
Show answer
Use runs-on: build-runners. A scale set is selected by its installation name as a single string. A label array like [self-hosted, linux] matches static self-hosted runners with those labels, not the scale set.
Exercise
You trigger a workflow with runs-on: arc-runner-set. The job stays queued, and kubectl get pods -n arc-runners --watch shows no new pod. Name two things to check.
Show answer
Check that the installation name from helm list -n arc-runners matches runs-on exactly. Check that githubConfigUrl points to the repository or organization that contains the workflow. Checking that the listener pod is running in arc-systems is also valid.