Modes and sizes

Choose between cheaper and faster runs. Let the router size a job, or pin the size yourself.

#Modes

Every job runs in one of three modes. The mode tells CI Router whether to favor cost or speed when it picks a provider and a size.

Routing modes
ModeHow to ask for itWhat it prefers
CHEAPruns-on: [ci-router, cheap]Lower cost: cheaper providers and smaller sizes. The job may run slower.
AUTOruns-on: ci-routerWeighs price and speed, using the job's recent runs. A job without a mode tag runs in auto; do not write auto in runs-on.
FASTruns-on: [ci-router, fast]Shorter runs: faster providers and larger sizes. The job may cost more.

eco, the former name of cheap, still works and means the same thing.

#Sizes

A size tag is a vCPU count: 1cpu, 2cpu, 4cpu, 8cpu and 16cpu. Memory per size differs by provider. The provider catalog lists it.

1cpu suits long, quiet jobs such as monitoring. The router never picks it. Write the tag to use it. When no provider has a 1cpu machine, the job runs and is billed as 2cpu.

#Autosizing

Without a size tag, CI Router sizes the job from its mode and what it runs. It measures every run. It moves the job up a size after an out-of-memory kill or a full disk. It moves the job down when a trial shows a smaller size is not slower.

#Pin a size

A size tag pins the job to that size. The router can still move a pinned job to another provider, never to another size.

.github/workflows/ci.yml
jobs:
  build:
    runs-on: [ci-router, 8cpu]          # always 8cpu
  build-cheap:
    runs-on: [ci-router, cheap, 8cpu]   # always 8cpu, cheaper providers first
  • Pin when you know the size a job needs, for example a build that needs the memory of 8cpu from its first run.
  • A pinned job that runs out of memory stays on its size. Change its tag.
  • Leave the tag out to let the router size the job, down as well as up.
Modes and sizes | CI Router docs