The runs-on line
What to write in a job's runs-on line, what each tag asks for, and which labels are refused.
#The ci-router label
A job runs on CI Router when its runs-on line is ci-router. That label is enough. CI Router picks the provider and the size.
jobs:
test:
runs-on: ci-routerJobs you leave alone keep their runner. Move one job, one workflow or one repository at a time. Steps, secrets, logs and checks stay on GitHub.
Team-wide choices are settings, not tags: Providers, the dependency cache and Volumes.
Add a tag only when a job needs arm64, runs out of memory or is too slow. Add it to that job only, such as runs-on: [ci-router, 8cpu].
#Optional tags
Tags go next to ci-router in a list. A job takes at most one tag from each group below. Capability tags are separate: a job can carry several, each once.
| Group | Tags | Without a tag |
|---|---|---|
| Architecture | x64, arm64 | x64 |
| Routing | cheap prefers cheaper providers. fast prefers faster ones. | auto: the router balances cost and speed |
| Size | 1cpu, 2cpu, 4cpu, 8cpu, 16cpu. The job always runs on that size. | The router picks the size |
jobs:
test:
runs-on: ci-router # the router picks everything
build-arm:
runs-on: [ci-router, arm64] # arm64, on providers that offer it
nightly:
runs-on: [ci-router, cheap] # cheaper providers first
e2e:
runs-on: [ci-router, fast, 8cpu] # faster providers, always 8cpuTags are not case sensitive. Their order does not matter. Modes and sizes explains the routing and size tags.
There is no auto tag. A job without a routing tag runs in auto mode. runs-on: [ci-router, auto] is refused.
#Capability tags
A capability tag asks for something the workflow file cannot show, such as a script that needs nested virtualization. Write each tag the job needs, once. The job runs only on a machine that was checked for every tag, at the size you asked for. Otherwise it is refused, the reason names the missing tag, and nothing is billed.
| Tag | What the machine offers |
|---|---|
kvm | The job can use /dev/kvm: it can create a VM and a vCPU. |
nested-kvm | A VM the job starts with accelerated QEMU can itself create a VM and a vCPU. It includes kvm. |
tun | /dev/net/tun exists as a character device. Creating a TAP device is not checked. |
systemd | systemd runs as process 1, on cgroup v2. |
zfs | The kernel supports ZFS. With the ZFS tools installed, a file-backed pool comes online. |
memory-16gib | The size has at least 16 GiB of memory, as the provider states it. |
free-disk-30gib | At least 30 GiB is free on /var/lib after boot. The size of the disk does not count. |
jobs:
rehearsal:
runs-on: [ci-router, 4cpu, nested-kvm, tun, systemd, memory-16gib, free-disk-30gib]The tags do not imply each other, except that nested-kvm includes kvm. CPU stays a size tag, so write the size next to the tags that need it. A job with a size tag runs on that size or is refused.
Today only one Ubicloud size, 4 vCPU, offers nested-kvm, tun, systemd, zfs and free-disk-30gib, on one prepared image. A job with one of those tags runs on that image or fails, and never falls back to a stock image. kvm follows the Runner machines table, and memory-16gib the size's memory. An unknown or repeated tag is an invalid label combination.
#Labels that are refused
CI Router does not place a job whose runs-on line has another label next to ci-router, two tags from one group, or ci-router twice. It posts a failed check on the commit that points to this page. The GitHub job stays queued. Fix the line and start a new run.
These labels are refused, with the tag to write instead:
| Label | Write instead |
|---|---|
cost | cheap |
speed | fast |
ubuntu-24.04-arm | arm64 |
Platform labels such as macos-latest, windows-latest or gpu next to ci-router are refused too. CI Router runs Linux only.
Docker is never a tag. CI Router reads it, and KVM when the workflow shows it, from the workflow. See Runner machines.
#Matrix jobs
A matrix can pick the runner per leg. Each leg is placed on its own.
jobs:
test:
strategy:
matrix:
include:
- runner: ci-router
- runner: ubuntu-latest
runs-on: ${{ matrix.runner }}