Skip to content

Command line

allmyram is one binary for the laptop, the runner and the sink. allmyram <command> -h prints each command's own help. The laptop's commands read ~/.config/allmyram/client.json unless --config names another file.

Commands

On the laptop

Command Does
run runs a command on a runner against a snapshot of this working tree
attach RUN follows a run's output from its start until it ends
status RUN prints a run's state as JSON
cancel RUN stops a run
init sets up the laptop from the owner key in an ssh-agent
invite invites a runner, or with --sink the sink, and approves its join
info prints the keys, certificates, runners, sink and revocations; never prompts
renew-day-key gets a new day key now (one Touch ID prompt)
renew NAME sends a runner or the sink a new host certificate after it expired
revoke KEY revokes a client key on every runner and the sink
rotate-client-key replaces this laptop's client key and revokes the old one on every runner and the sink
remove NAME drops a runner or the sink from client.json
sync-sink sends the sink the runner list and revocations, and renews its certificate when under 10 days are left
client-key prints this laptop's tailcat node key, creating it (mode 0600) the first time

run, attach, status and cancel take --runner NAME, the runner's name in client.json. They, invite and join take --verbose, which also prints tailcat's connection log to stderr.

On a runner or the sink

Command Does
runner the runner service; reads --config, default /etc/allmyram/runner.json; a Mac's LaunchAgent points it at the state directory's
join joins a Linux runner from an invite (install.sh --join runs it), or with --sink the sink
sink the sink service
install installs, joins or upgrades a Mac runner, as the Mac's owner; macOS only (see Mac runner)
proxy the egress proxy alone, inside the Mac runner's VM: --listen ADDR (no wildcard) and --pods DIR, a file per pod IP naming its run
install-step steps of install.sh; not for direct use
git-ssh git's ssh during run; not for direct use

allmyram run

allmyram run --runner NAME [flags] -- COMMAND [ARG...]

The job comes from the repo's Compose files when it has them: the job service (job unless --service names another) runs COMMAND, with every service it depends on beside it. Compose files says how the files are found and what each field does.

Flag Default Meaning
--image the Compose job service's container image to run COMMAND in; required without a Compose job service
--runner required unless --dry-run the runner, by its name in client.json
--cpus 4 CPU limit in CPUs; fractions allowed
--memory 4G memory limit: bytes, or a number with K, M, G or T (powers of 1024)
--pids 4096 limit on the job's processes and threads
--time-limit the runner's, normally 2h stop the job after this long
--workdir the job service's working_dir, else the repo's top level directory to run COMMAND in, relative to the top level
--entrypoint EXE the job service's entrypoint, else the image's the executable to run COMMAND through, as nerdctl run --entrypoint; "" runs COMMAND directly
--env K=V set in the job's environment, over the job service's; repeatable
--pad NAME:PATH[:OPTION...] a scratch pad of this repo; repeatable. Naming a Compose pad replaces its path and the options given
--global-pad NAME:PATH[:OPTION...] a scratch pad shared by every repo on the runner; repeatable
--gpu ask for the runner's GPU (beta)
--compose-file FILE found by searching a Compose file to read instead of searching; relative to the current directory; repeatable, merged in order
--no-compose ignore the repo's Compose files; not with --compose-file or --service
--service NAME job the Compose service to run COMMAND in
--dry-run print the job as JSON on stdout and exit, without contacting a runner

COMMAND runs through the job's entrypoint, as nerdctl run does: --entrypoint when given, else the job service's entrypoint when Compose sets one (none when it is [] or ""), and otherwise the image's. --entrypoint EXE runs COMMAND as EXE's arguments, and --entrypoint "" runs COMMAND with no entrypoint at all. --cpus, --memory, --pids, --time-limit and --gpu cover every container of the job together.

A job takes at most 8 pads. Pad options:

Option Meaning
ro mount the pad read-only and never publish it
fresh start the pad empty; not with ro
max=SIZE soft size limit, such as 2G; a pad over it is reported and cleaned up first

Exit codes

run and attach exit with the job's exit status, except:

Code Meaning
124 the job hit its time limit
125 allmyram itself failed (a usage error or refused Compose file included), or the job never started (a service that never became healthy included) or lost its sandbox
126 the runner restarted under the job, stayed unreachable for 10 minutes, or could not confirm a cancel
130 the run was cancelled

git-ssh exits with the remote command's status, or 255, as ssh does. The other commands exit 0 on success, 1 when the operation failed, and 2 on a usage error. cancel exits 1 when the run has ended but its sandbox isn't stopped yet.

allmyram status output

A JSON object:

Field Meaning
run_id the run
state Starting, WaitingForServices, Running, Exited or Stopped; WaitingForServices means the job's container waits for services to pass their healthchecks
exit_code the job's exit code
reason why the run ended: Completed, Error, OOMKilled, TimedOut, StartFailed, Cancelled or RunnerRestarted
detail why a run failed to start; for a service, its name, the last check's output and the end of its log
waiting_for while WaitingForServices, the services whose health a container not yet started still waits on
created, finished times
teardown_pending the run ended but its sandbox isn't stopped yet
pads what became of each scratch pad

allmyram init

Flag Meaning
--owner-key required: the owner key's fingerprint, SHA256:...
--agent-socket the ssh-agent holding the owner key, saved in client.json; default $SSH_AUTH_SOCK, read on each use
--new-owner replace this laptop's owner key, dropping its runners, sink, sink record and revocations

allmyram invite

Flag Meaning
--sink invite the sink rather than a runner
--tailnet-peer this laptop's tailnet IP, which the runner's egress self-check proves jobs can't reach; default found from Tailscale; not for a sink

An invite is good for 15 minutes and one connection. invite needs a terminal, since nothing else can approve.

allmyram join

Flag Default Meaning
--name required this runner's or sink's name, a DNS label
--state-dir required the state directory; --sink creates it if missing
--sink join as the sink; it makes its own host and tailcat keys in the state directory and writes trust.json there
--host-key required without --sink the runner's SSH host private key; not for a sink
--trust-file /etc/allmyram/trust.json the trust settings from an earlier join; a rejoin sends the laptop the owner key and revocations this runner holds; not for a sink

join reads the invite on stdin and prints the fingerprint on stderr.

allmyram sink

Flag Default Meaning
--name required the sink's name, as it joined
--state-dir required the directory join --sink wrote
--dir required where the telemetry files go; created if missing
--retention 720h delete telemetry files older than this
--max-bytes 0 (no limit) delete the oldest files once --dir holds more than this many bytes

The unit in deploy/linux/allmyram-sink.service sets --max-bytes to 10 GiB.

Certificates and clocks

Item Lifetime Renewal
day key and client certificate 24 hours from the owner key, one Touch ID prompt; a command at a terminal renews early once under 8 hours are left, others wait for expiry
runner or sink host certificate 30 days whenever the laptop connects with under 10 days left; renew NAME after expiry

A certificate is stamped by the laptop's clock and judged by the runner's; the two must agree to within five minutes. On a refusal the client reports the gap and the runner logs both times. Each side checks its own clock against ntp_server (default pool.ntp.org, run by the NTP Pool project):

  • the runner, when its kernel doesn't keep the clock in sync (as chrony or systemd-timesyncd do), about every six hours, and whenever a refusal looks like clock trouble;
  • the laptop, only when it disagrees with a runner, at most once an hour; info shows the last result.

NTP only explains a refusal; the clocks' gap decides it.

client.json

Paths left empty mean the file of that name beside client.json.

Field Meaning
runners each runner by name: address (its tailcat address, a secret) and host_key
sinks the sink by name: address, host_key and client_node_key
owner_public_key default owner.pub
owner_agent_socket the ssh-agent holding the owner key; default $SSH_AUTH_SOCK
client_key, client_cert, tailcat_key defaults client, client-cert.pub, tailcat.json
ntp_server NTP server for checking the laptop's clock; empty for pool.ntp.org, off to never ask

A name belongs to a runner or a sink, never both. allmyram refuses a config directory, client.json or key file that others can read or write (anything looser than 0700 for the directory, 0600 for files), and a client.json with fields it doesn't know.