Vole docs Source

Runners#

A runner leases jobs over SSH and executes repository code in containers on its own host. Keep the runner separate from the forge server: the forge queues and records work, while the runner owns the container runtime, job caches, and trusted checkouts.

Set up a runner#

You need:

Rootless Podman is preferred because Docker-group membership is effectively host root. For the packaged service, start with Set up a runner on Linux, then use this page for verification and operation.

Register and authorize the runner#

Create a bot account and grant the role per repository:

vole admin account create ci-runner-1 --bot --key ci-runner-1.pub
vole admin acl set-role demo ci-runner-1 runner

If the public key is on the runner host, copy it through standard input instead:

ssh root@<runner-address> cat /var/lib/vole-runner/.ssh/id_ed25519.pub \
  | vole admin --remote ssh://git@forge.example.com:2222 \
      account create ci-runner-1 --bot --key -

Repeat acl set-role for every repository the runner should build. Creating the bot alone grants no repository access.

The runner role lets the bot clone the repository, lease jobs, report checks that count, and publish declared sites and artifacts. It cannot push shared branches, triage, or approve requests. Maintainers and admins are runners implicitly. Bots cannot sign in to the browser or become instance admins.

Keep one long-lived key per machine. Remove the key or retire the account to revoke the machine. A job using acts-as: receives a separate per-run credential that cannot lease work; uploads after the steps still use the runner account.

The runner receives declared secrets

Every job can read the repository secrets it declares. Granting the runner role trusts both the machine and the people controlling it, not only its container runtime.

Host key verification#

The runner refuses unknown or changed instance host keys. Run these commands as the runner's service user so ~/.ssh/known_hosts is the file it reads:

ssh-keyscan -p 2222 forge.example.com >> ~/.ssh/known_hosts
ssh-keygen -lf ~/.ssh/known_hosts

Compare the fingerprint with the instance's public host key before starting the runner. With the system sshd on port 22, scan without -p:

ssh-keyscan forge.example.com >> ~/.ssh/known_hosts

The resulting entry is forge.example.com, not [forge.example.com]:2222. Pin the endpoint the runner will actually use.

--known-hosts <path> selects another readable file. --insecure-host-key accepts any key and is only for throwaway tests. VOLE_KNOWN_HOSTS and VOLE_INSECURE_HOST_KEY apply the corresponding policy to other Vole remote commands. The runner applies its policy to both the control channel and Git commands; a caller-provided GIT_SSH_COMMAND cannot disable it.

Start the runner#

Start with one job slot and a machine label:

vole runner --remote ssh://git@forge.example.com:2222 \
  --container-runtime podman \
  --known-hosts ~/.ssh/known_hosts \
  --label linux

With sshd on port 22, use --remote ssh://git@forge.example.com instead.

At startup, the runner executes <runtime> info and refuses to serve if the runtime cannot run containers. The probe does not pull an image and runs again when the runner restarts.

Useful variations:

# Let jobs request bridge networking for downloads and services.
vole runner --remote ssh://git@forge.example.com:2222 --container-network bridge

# Advertise an ARM machine and restrict the repositories it serves.
vole runner --remote ssh://git@forge.example.com:2222 \
  --label linux --label arm64 --repos demo --repos docs

# Run one job and exit.
vole runner --remote ssh://git@forge.example.com:2222 --once

A job with runs-on must find every label it requests. --repos only narrows access the account already has. The default network offering is none; bridge networking lets repository code reach anything the runner can reach. --dir selects checkout and cache storage. The CLI reference lists every runtime and resource option.

Verify the runner#

  1. Open Admin → Runners. The runner's slots should appear as connected.
  2. Push a commit that triggers a workflow. The run page should name this runner and show whether its result counts.
  3. From a clone, inspect the result with vole run list and vole run show <run-id>.
  4. If the job remains queued, check its runs-on labels and network: request, then inspect journalctl -u vole-runner on the packaged host.

The first systemctl stop vole-runner stops new leases and waits for active jobs to report, up to the unit's 60-second stop timeout. See Stopping a runner before changing that limit.

Upgrade a runner#

Upgrade the forge first, then each runner with the same package repository used to install it. For Debian or Ubuntu:

sudo apt update && sudo apt upgrade vole
sudo systemctl restart vole-runner

For other package managers, see Upgrade an installed server. Runners do not share the forge's database, so the instance migration procedure does not apply to them.

Running several jobs at once#

--jobs <n> creates independent job slots:

vole runner --remote ssh://git@host:2222 --container-runtime podman --jobs 4

Each slot has its own SSH session and appears separately on the Admin page. The slots share saved checkouts, images, and applicable cache namespaces, but not job containers or working trees.

Size the host for n times the per-container memory, CPU, PID, and tmpfs limits. Each idle slot also consumes an SSH connection. Losing one connection requeues that slot's job after its lease expires while the other slots reconnect independently.

With --once --jobs 4, the runner starts up to four jobs, waits for them, and exits. Jobs of the same repository, trust namespace, and image share /cache; use toolchains that tolerate concurrent cache access or separate stateful jobs.

Stopping a runner#

The first SIGTERM or Ctrl-C stops new leases and lets active jobs finish and report. A second signal terminates the process immediately. The packaged systemd unit waits 60 seconds by default:

sudo systemctl edit vole-runner

Set a longer [Service] TimeoutStopSec when jobs should outlive that window. Without a clean report, the job becomes eligible for another attempt after its lease expires.

How a job runs#

The runner creates one job container and one container per declared service. It removes them and their private network afterward. The runner process, its SSH key, trusted saved checkout, and result channel remain on the host.

Each job receives a fresh clone of the saved repository, so Git hooks and working tree changes do not leak into another job. The container has:

An image needs /bin/sh and POSIX sleep. Tools that look up a user name, such as OpenSSH, also need a passwd entry for the numeric uid or an explicit --container-user. Running the job as root lets it modify root-owned image files, so the runner warns at startup when its own user is root.

Non-push events mount event.json under /run/vole and set VOLE_EVENT, VOLE_EVENT_ACTION, and VOLE_EVENT_PATH. Jobs with secrets receive a mode-0600 secrets.env beside it. The runner sources that file before each step, keeping values out of container arguments. It removes the directory with the job.

Execution backends#

The container is one implementation of the job's environment, not the definition of it. vole runner asks for an executor, the executor states what it can honour, and the runner refuses a job that asks for more before anything starts. The container backend offers a network (--container-network bridge), services beside the job, and memory and CPU limits.

The interface is ci/execute.Executor, and its contract is the whole of what varies between a container and a guest: preparing an image, starting the environment, running one step, stopping it, reclaiming what a killed runner left behind, and bounding its own storage. A runner reports the backend it used in the attempt record.

This is what a job that needs a macOS or Windows guest is built on: a virtual machine is another executor rather than a second workflow or a second runner. The same seam is what makes a Linux microVM possible, where the safety of the job rests on a guest kernel rather than on the container's mount set.

Nothing guarantees feature parity across backends, and the interface does not hide that. A backend without a network, or without service containers, refuses such a job; it does not run it with less. Run CI on a Mac tracks the first guest backend.

Network#

--container-network states the most networking this runner offers: none by default or bridge. The job's network: field selects what the container gets:

Job request Bridge-capable runner None-only runner
Unset bridge none
none none none
bridge bridge job is not leased

A bridge request waits for a capable runner rather than silently running without its required network. A none request remains isolated on either runner.

Services require bridge networking and join a private user-defined network with the job. Their declared names resolve only inside that attempt. Services receive the job user and resource limits, but no checkout, cache, or secrets.

Networked repository code can reach anything the runner can reach, including the instance and internal services. Review both workflow changes and image builds before allowing contributor CI. A no-network job cannot exfiltrate over the network, but it can still publish declared artifacts or sites.

Images and image builds#

A registry image: is used as named. For image-file:, the runner receives the pinned definition and digest, renders a Dockerfile, builds with the configured runtime, and tags the result by digest. Later jobs reuse that tag.

Concurrent jobs needing the same definition share one build. Waiting jobs keep their leases alive, and all waiting jobs receive the same build error if it fails.

Image storage belongs to the runtime, so the runner bounds it by age rather than by bytes: layers are shared and Vole cannot count what removing one tag would free. --image-max-age (default 168h; 0 keeps every image) runs the runtime's own prune at startup and every five minutes. Images older than the age that no container uses are removed, together with dangling layers; an image a container is running from never is. A prune pass that races a job resolving or starting an image gives way to the job.

With --container-pull never the runner keeps every tagged image and prunes dangling layers only, because it may have no network to fetch an evicted image again. Expiring a vole/image-file:* tag costs a rebuild, and the rebuild needs the runtime's network to fetch the base image. A runtime that cannot prune is reported once at startup and then left alone; the runner keeps serving.

The image build uses the runtime's default network because it may fetch the base image and packages; the job's network: does not constrain the build. To build without network access, preload dependencies and configure the runtime host accordingly.

Image definitions execute code on the runner. Pin base images by digest and review contributor changes to .vole/images/ before allowing CI. See the image reference.

What the package configures in the container runtime#

The package installs two system-level Podman drop-ins for the runner:

File Purpose
/etc/containers/registries.conf.d/50-vole-runner.conf Resolves short image names through docker.io; the image digest still pins the content
/etc/containers/containers.conf.d/50-vole-runner.conf Uses cgroupfs because a system service has no systemd user manager for rootless Podman

A site can override these with a later file such as 99-site.conf. The runner unit permits setuid user-mapping helpers with NoNewPrivileges=false; rootless runtimes need them. Job isolation comes from the container, while the rest of the unit's hardening remains in place.

These settings describe the shipped system unit. A custom user unit needs a systemd user session and a different cgroup and runtime-directory arrangement; do not combine its assumptions with the packaged unit.

What a job may consume#

Channel Bound and behavior
Logs 32 MiB per attempt; the runner keeps the beginning and appends a truncation notice
Artifacts At most 32 workflow patterns, 256 files, and 4 GiB per run, checked before upload
Job cache --cache-size evicts whole least-recently-written namespaces; active namespaces are deferred
Containers Memory, CPU, PID, and tmpfs flags apply per container, so parallel jobs multiply them
Checkout disk --disk-reserve checks free space once per second and stops a job below the reserve
Images --image-max-age prunes unused images older than the age (default 168h; 0 keeps every image); --container-pull never keeps tagged images

PID and tmpfs limits have non-removable defaults because /tmp consumes memory and unbounded process creation can exhaust the host. Set an explicit memory limit; otherwise the runtime may allow the whole machine. The disk reserve is a detected threshold, not a hard filesystem quota. Put --dir on a dedicated filesystem when a hard boundary is required.

The runner revalidates repository, commit, ref, path, artifact, environment, and step fields before acting on a lease. Absolute paths, traversal, malformed commit ids, and values unsafe for container arguments are rejected even if a server-side check was bypassed.

Caching#

The runner mounts a job cache at /cache but sets no tool-specific variables. Opt in through the image or job environment:

jobs:
  test:
    image: golang:1.27-bookworm
    env:
      GOCACHE: /cache/go-build
      GOMODCACHE: /cache/go-mod
    steps:
      - run: go test ./...

Common variables include GOCACHE and GOMODCACHE for Go, CARGO_HOME, npm_config_cache, PIP_CACHE_DIR, GRADLE_USER_HOME, NUGET_PACKAGES, CCACHE_DIR, and XDG_CACHE_HOME.

Cache paths are keyed by repository, trust, and image:

<dir>/cache/<repo>/<direct|contrib>/<image>

Each contributor has a separate namespace inside a repository. Protected branches never share with contributor branches, and a combined result derived from a contributor retains that contributor's namespace. Image identity prevents one toolchain from consuming another's cache.

Eviction removes whole namespaces rather than individual files. Active namespaces are deferred until their jobs finish. --no-cache still mounts /cache but empties that job's namespace afterward.

Saved checkouts#

The runner keeps one saved clone per repository under --dir. A job clones from that copy and fetches only missing commits. The saved clone itself is never mounted into the job.

--git-cache-size caps saved checkouts. Near the cap, Vole repacks copies and removes unreachable objects; when more space is needed, it deletes the least recently used inactive copy. It never deletes a copy in use or the repository about to run. A value of 0 disables the size cap.

Who can run jobs and report results#

Grant the runner role per repository:

vole admin acl set-role demo ci-runner-1 runner
vole admin acl set-role demo ci-runner-2 runner
vole admin acl set-role demo ci-runner-1 reader   # take the trust away

Maintainers and admins always count. Results from other accounts are recorded but do not satisfy required checks unless the account holds the runner role and is active. The runner role also authorizes the site branch and artifact uploads, so a job that publishes either needs it. The run page shows whether a result counts.

The runner streams logs and finishes the attempt over the authenticated channel that leased it. The server checks that the account holds the lease, the record matches the assigned job, and uploaded artifact pointers exist. It then stores the attempt and result in data/instance.db in one transaction. Tagged release pointers are written to the vole branch separately.

Logs#

Each attempt has one log file under data/logs/. The server appends streamed chunks and supports range requests, so readers do not load the whole file into memory. Stored step ranges let the web page and CLI select one step.

/<repo>/runs/<id>/log
/<repo>/runs/<id>/log?attempt=N
/<repo>/runs/<id>/log?attempt=N&step=N
vole run logs <id>
vole run logs <id> --attempt 2 --step 1
vole run show <id>
vole run list --state failed --limit 5

run logs writes log bytes to stdout and errors to stderr, so redirection does not mix the two. An attempt whose runner disappeared may have no complete log.

Delivered secrets are replaced with *** while the log is written, including values split across writes and runner error text. Masking is best effort: it does not detect transformed values, values shorter than four bytes, or secrets copied into artifacts and sites.

Scheduling and the queue#

All runners share one queue. Idle runners wait for work, and the instance favors the repository with the least work in progress. max_jobs_per_repo adds a hard per-repository concurrency cap. The Admin page's Runners tab shows connected slots, active work, and queued jobs.

Deleting data/instance.db loses CI history, queued work, in-flight attempts, contributor CI allow decisions, accounts, access rules, and stored secrets. Current refs can be queued again from Git, but only a backup restores finished history. Back up this database with the rest of the instance.

↑↓ to move Enter to open Esc to close