Skip to the content
Forge

"Runners: own, shared and autoscaled"

Runs happen on runners: Linux machines running forge-runner. You can join machines of your own, group machines that come and go, let Forge start and remove a group's machines, and use the platform's shared runners. This guide covers each, and how Forge picks the runner for a run.

Your own runners

Runners added to the organization serve all of its projects. Runners added to a project serve that project only. Both are managed on the Runners page.

  1. Choose Add a runner, pick how long the token is valid (1 hour, 24 hours or 7 days) and Create join token. Copy the command now: the token is shown once and works for one runner.

  2. On the machine, join and start it:

    sudo forge-runner join --server forge.example.com:8091 --token-file token.txt
    sudo forge-runner run --label gpu=true
    

The machine needs containerd and the CNI plugins, and an outgoing connection to Forge. See add a runner for the details.

On the Runners page each runner shows its status, version, labels, resources and active runs. You can Rename it, set its Location, Drain it (it finishes its runs and takes no new ones; Resume undoes that) or Revoke it for good. Unused join tokens are listed and can be revoked too.

Labels

--label key=value (repeatable) offers labels to runs. A run asks for labels in its spec and only goes to runners that have them:

image: golang:1.24
labels: { gpu: "true" }
commands:
  - run: go test ./...

Runners also report labels about themselves: arch, sandbox, egress and vm.

Sandboxes and VM runs

forge-runner run --sandbox sets how runs are isolated:

  • runc (the default): plain containers that share the machine's kernel. Use it for trusted work.
  • kata-fc: each run in its own microVM (Kata on Firecracker). It needs /dev/kvm.

VM runs (type: vm and compose runs) only go to runners that offer them: a kata-fc runner on a host with KVM, on amd64. Such runners report vm=true.

--egress filtered keeps runs to the internet: no private ranges, cloud metadata, the host itself or SMTP. The default, open, lets runs reach whatever the host reaches.

Runner groups

A runner group is for machines that come and go, such as cloud-init VMs or spot instances. They join with the group's reusable key instead of a token each, and each still becomes a runner of its own. Make one under Runner groups on the Runners page with New runner group.

Setting What it does
Name Members get the label group=<name>, which runs can ask for.
Labels Set on every member. Not arch, sandbox, egress, vm or group.
Runners at most Default 10. Joins beyond it are refused. Members also count against the runners quota.
One run per runner Each member takes one run, then leaves, deletes its state and exits, so the machine can be shut down. No run sees what an earlier one left.
Remove offline runners after (minutes) Default 30, or 5 with one run per runner. Their runs count as lost and are retried as usual.
Allowed networks Addresses or CIDRs machines may join from. Empty: anywhere.
Runs may use the cloud metadata service Off by default: runs can't reach 169.254.169.254 and the like, even with open egress.
Limits per run Disk read and write (MB/s and operations per second), network in and out (Mbit/s). Empty is no limit.

The limits per run need runners with a recent forge-runner; older ones take no runs while a limit is set.

Keys and cloud-init

A group has at most two active keys, so you can switch to a new key without stopping running machines. A key is shown once, and works until it is revoked or expires (at most 365 days). Revoking a key stops new joins only. Deleting the group revokes its keys and all its runners.

forge runner-groups --org acme                                  # list groups
forge runner-groups key --org acme --days 90 ci asg-2026-11     # print a new key
forge runner-groups key --org acme --cloud-init ci asg-2026-11 > user-data.yaml

The cloud-init user-data joins the machine at boot and runs forge-runner as a service. Better: put only the key in your cloud's secret store and fetch it into /run/forge-runner/join-key at boot, since anyone who can read a machine's user-data can read a key there. A leaked key lets someone add machines that get the group's runs, so set a size limit, allowed networks and an expiry.

Autoscaling

Forge can start a group's machines itself. When runs wait that the group could take, it asks a machine provider for machines; each joins with a single-use token, never the group's key. Machines that stay idle, never join, or leave after their run are deleted.

Add a provider under Machine providers on the Runners page (name, kind and an API token that may only create and delete machines). Which kinds are on offer depends on your Forge. Then open the group's Autoscaling:

Setting Default What it does
Machines at least 0 Kept running even without runs.
Delete after idle (minutes) 10 A machine without a run this long is drained, then deleted.
Boot time at most (minutes) 10 A machine that hasn't joined by then is deleted.
Settings (JSON) {} The provider's own, such as machine type and image.

Give the group the labels its runs ask for: until a machine has joined, only the group's own labels decide whether a run waits for it. The machines of the last day, and why any were deleted or none started, show under Machines.

forge machine-providers --org acme
forge machine-providers add --org acme NAME KIND < token-file
forge machine-providers token --org acme NAME < token-file
forge runner-groups autoscale --org acme --provider NAME --min 1 --idle 15 GROUP
forge runner-groups autoscale --org acme --off GROUP
forge runner-groups machines --org acme GROUP

The organization's autoscaled machines may run a number of hours a month (the Autoscaled machine hours a month quota). At the limit no new machines start and the owners get an email.

Shared runners

The platform's shared runners serve every organization. They come in runner classes, each with its hardware and rates per core, GiB of memory and GiB of disk per hour, and per GB sent. A run uses the class its spec names (class: highmem, or forge run --class highmem), else the project's Default runner class (on the project's Runners page), else the default class. It waits for a shared runner of that class and never spills over to another one. Your plan decides which classes you may use. See plans, budgets and quotas for what runs cost.

forge classes      # the classes and their rates
forge locations    # the locations with their countries, and the regions

Locations and data residency

Every runner stands in a location, a named place in one country. For your own runners you pick it; Forge can't check it. An organization's owners can set a Data residency policy (regions and countries) on the organization's Overview, and a project can narrow it on its own. Runs then only go to runners in allowed countries, your own included, and their logs and artifacts are stored there or in the nearest allowed store. A run that no runner could ever take is refused when it is created.

Keep a project to its own runners

On a project's Runners page, Runs of this project may use has three settings:

  • All runners: the project's, the organization's and shared runners.
  • No shared runners: never on machines shared with other organizations.
  • Only this project's runners.

Why a run waits

A queued run's page says why it waits. The usual reasons:

  • no runner the project may use is online, or none has the labels it asks for;
  • no runner can run what it needs (VMs, services, compose and the like), or has an architecture its image is built for; some may need an update;
  • it needs more CPU, memory or disk than any runner that could take it has;
  • the runners that could take it are full;
  • no runner stands where the residency policy allows;
  • only shared runners could take it, and the organization's shared-runner limits or usage credit don't allow another run now;
  • a budget is reached, or the plan's usage credit is used up on a plan that then stops new runs (see plans, budgets and quotas).

A run that waits too long ends when its queue timeout runs out.