Linux runner¶
What deploy/linux/install.sh sets up on a Debian 13 host, the constraints
between the parts, and the sink's files. To install one, see
How to add a Linux runner.
Services¶
| Unit | Runs as | Does |
|---|---|---|
allmyram-runner.service |
allmyram-runner |
allmyram runner: serves clients over tailcat, keeps run records, repos and scratch pads, runs the egress proxy on 10.78.0.1:3128, sends telemetry to the sink that dials it |
allmyram-warden.service |
allmyram-warden |
allmyram-warden: the only process that can reach containerd's socket; accepts requests only from the runner's uid |
allmyram-egress.service |
root, oneshot | creates the jobs' bridge allmyram-e0 (10.78.0.1/24) and loads egress.nft, at boot and on each install, then exits |
allmyram-sink.service |
allmyram-sink |
allmyram sink --name %H, on the machine that holds the sink; installed by hand |
deploy/linux/allmyram-proxy.service is for the
Mac runner's VM, where the proxy runs apart
from the runner; install.sh doesn't install it.
containerd runs as root, as Debian ships it. Every job runs under gVisor
(runsc). Debian's nftables.service is never enabled: it flushes every
ruleset at boot.
Files¶
| Path | Owner | Purpose |
|---|---|---|
/usr/local/bin/allmyram, allmyram-warden |
root, 0755 | from just build-linux |
/usr/local/bin/runsc, containerd-shim-runsc-v1, gvisor-bin/ |
root | gVisor release-20261116.0, checked against a pinned sha512 |
/etc/containerd/config.toml |
root | from containerd-cri-1.7.toml: CRI handlers runc and runsc, socket group allmyram-warden |
/etc/containerd/allmyram-runsc.toml |
root, 0644 | from allmyram-runsc.toml: gVisor's flags for every pod; a container's writes to its own filesystem go to a file on the host's disk beside its root filesystem (experiment 30) |
/etc/cni/net.d/05-allmyram-egress.conflist |
root | network allmyram-egress: pods get 10.78.0.10 and up, no route out, no masquerade |
/etc/allmyram/ |
root, 0755 | configs and keys; nothing in it is writable by allmyram's users |
/etc/allmyram/trust.json |
root:allmyram-runner, 0640 | the owner's public key, the client node keys allowed to connect, and the tailnet peer for the egress self-check; written only by allmyram install-step, from a join the owner approved |
/etc/allmyram/warden.json |
root, 0644 | warden config, including the registry allowlist |
/etc/allmyram/registries |
root | the owner's registry allowlist, when --registries gave one |
/etc/allmyram/runner.json, runner-host-key |
root:allmyram-runner, 0640 | runner config and SSH host key |
/var/lib/allmyram/runner/state |
allmyram-runner, 0700 | run records, markers for egress probes in flight, tailcat identity, what the laptop sends signed (host-cert.pub, revocations, sink-record), and telemetry/: spill files and job-output read positions |
/var/lib/allmyram/runner/repos |
allmyram-runner, 0700 | one bare repo per client repo |
/var/lib/allmyram/runner/pads |
allmyram-runner, 0700 | scratch pads: the versions of each named cache |
/var/lib/allmyram/staging |
allmyram-runner:allmyram-stage, 2770 | the runner prepares each run's workspace here |
/var/lib/allmyram/warden/workspaces |
allmyram-warden, 0711 | a running job's workspace, moved here from staging by rename |
/var/lib/allmyram/warden/logs |
allmyram-warden, 0711; ACL: runner x, default runner and warden rX |
CRI logs, written by containerd as root |
On the sink:
| Path | Owner | Purpose |
|---|---|---|
/var/lib/allmyram-sink/state |
allmyram-sink, 0700 | trust.json, host and tailcat keys, host certificate, revocations, runners.json |
/var/lib/allmyram-sink/data |
allmyram-sink, 0750; files 0640 | hourly logs-*.jsonl and metrics-*.jsonl, readable by the allmyram-sink group |
Constraints¶
stagingandwarden/workspacesmust stay on one mount, on the host and in the warden's mount namespace: the warden moves a workspace between them with rename(2), which fails across mounts. EachReadWritePaths=entry is its own bind mount, so both units name/var/lib/allmyramwhole.runner/padsmust be on the same filesystem asstaging: publishing a pad renames a clone from staging into it.- The warden unit hides
/var/lib/allmyram/runner(InaccessiblePaths=). Elsewhere under/var/lib/allmyram, file modes keep each unit out of what it doesn't own. - Scratch pads are copy-on-write clones only on ZFS, btrfs or XFS with reflinks. Elsewhere, ext4 included, the runner copies each pad in full, each copy taking the pad's full size on disk, and logs a warning.
allmyram-warden, containerd's socket group, is root-equivalent; only the warden's user is in it.install.shfails if it finds the runner's user there.- Staging and the workspaces belong to the group
allmyram-stage, which only the runner and the warden are in. - A job runs as
allmyram-runnerand owns its/workspace. When a job's chmod or chgrp makes a Stop fail, the runner restores the directory's mode and group and asks again; the warden never changes a path a job controls. allmyram-warden.serviceruns inallmyram.slicewithDelegate=yes, so the warden owns/sys/fs/cgroup/allmyram.slice/allmyram-warden.service. It runs in the leafwarden/beneath it, and each job gets a cgroup underjobs/carrying its limits, which containerd uses as the pod'scgroup_parent.- Stopping the runner stops its jobs and records them
RunnerRestarted;TimeoutStopSec=150leaves room for that. A sandbox that couldn't be stopped is retried at the next start, with a reminder in the log every ten minutes while it keeps failing. - The runner and the client refuse to start while
TS_DEBUG_ADDRis set: tailcat then logs connection info, pre-shared key included, outside allmyram's log filter.
install.sh¶
Run from a directory holding deploy/linux/'s files, the two binaries and
gVisor's gvisor.tar.zstd.
| Flag | Kept by a rerun | Meaning |
|---|---|---|
--join |
no | join by invite, read from the terminal or one line of stdin |
--name NAME |
yes | runner name, the host certificate's principal; default the short hostname |
--host-key FILE |
yes | use this host key instead of generating one; a new host key needs a new join |
--tailnet-peer ADDR |
until a rejoin | a tailnet machine that is up, for the egress self-check to prove jobs can't reach; default the laptop's tailnet IP. With --join it goes into the new trust.json; without, into the existing one |
--registries FILE |
yes | registry allowlist, one host[:port] per line |
--bin-dir DIR |
no | where the binaries and gVisor's tarball are; default the script's directory |
Without --registries the warden allows docker.io, ghcr.io, gcr.io,
quay.io and registry.k8s.io. The script exits 0 when the runner's egress
self-check passed; 1 on a failed self-check, one that couldn't run, or none
within 5 minutes; and 2 when it ran without --join on a runner that never
joined.
runner.json¶
install.sh writes it. Durations are Go durations such as "2h"; sizes are
bytes.
| Field | Default | Meaning |
|---|---|---|
name |
required | the runner's name |
state_dir, repo_dir, staging_root, workspace_root |
required | the directories above |
warden_socket |
required | the warden's unix socket |
trust_file |
required | trust.json |
host_key |
required | the SSH host private key |
pads_root |
the scratch pads directory; without it the runner refuses jobs that ask for pads | |
default_time_limit |
2h |
for jobs that set none |
proxy_listen |
10.78.0.1:3128 |
the egress proxy's address |
max_push_bytes |
2 GiB | largest single push |
max_workspace_bytes |
8 GiB | largest snapshot |
max_workspace_entries |
500000 | most files, directories and symlinks in a snapshot |
pads_free_floor_bytes |
smaller of 10% and 40 GiB | free space pads leave on their filesystem |
owner_reserve |
4 GiB | memory never counted as hoardable in heartbeats |
zfs_cache_share |
0.5 | share of the ZFS cache above its floor counted as hoardable in heartbeats |
jobs_cgroup, warden_cgroup |
cgroups read for jobs' and the warden's use | |
heartbeat_interval |
30s |
how often the runner sends a heartbeat |
telemetry_spill_cap |
64 MiB | most telemetry spilled to disk; at least 2 MiB |
ntp_server |
pool.ntp.org |
NTP server for checking the runner's clock; off never asks |
warden.json GPU section¶
Present only on a GPU host, written by hand (see How to give a runner a GPU):
| Field | Meaning |
|---|---|
runtime_handler |
a containerd CRI handler running runsc with nvproxy; the warden refuses GPU jobs unless its runtime type is io.containerd.runsc.v1, which rules out NVIDIA's runc-based nvidia handler |
cdi_device |
the GPU's name in nvidia-container-toolkit's CDI spec |
driver |
the NVIDIA driver the handler was checked against; GPU jobs are refused while another is loaded |
Logs¶
The runner's journal holds every egress proxy decision and each self-check result; those stay in the journal only. Lines from the runner's handling of runs, at Info and above, also go to the sink.