A host is a machine that runs jobs for this one. Nothing is installed on it for fleetjobs: this machine sends a small script with each call, and the host runs it with Node.
What a host needs
Section titled "What a host needs"| Tool | Why |
|---|---|
ssh, with a key and no password prompt | Every call uses BatchMode=yes and a 4-second connect timeout |
node, 22.20 or later | Runs the host script |
rsync | Copies the checkout in and the files the job wrote back |
bwrap (bubblewrap) | Runs the job with the mirror mounted at the checkout's own path |
git, the package manager and the tools your jobs use | The host installs dependencies and runs the command |
Without bwrap, the job still runs, but the mirror sits at a different path than your checkout, so absolute paths in configs and output differ.
This machine needs ssh and rsync too, and Linux with systemd for local scopes.
Add a host
Section titled "Add a host"Add it to ~/.config/fleetjobs/config.json:
{
"hosts": [{ "name": "build-box", "address": "me@build-box", "slots": 2, "speed": 0.5 }]
}address is what you would pass to ssh. slots is how many jobs the host runs at once, and speed is its speed against this machine, where 1 is as fast. fleetjobs reads the file on every tick, so there is nothing to restart. See the config reference.
Check the host from this machine with ssh me@build-box node --version. Then run a test job: HEAVY_REMOTE=1 heavy sh -c 'echo ok > out.txt'. When the host finishes first, heavy prints the line this runs on build-box on stderr, and out.txt appears here.
What a run does
Section titled "What a run does"- Probe. The host reports its free slots and whether it is busy. It is busy under 3 GB of free memory, under 15 GB of free disk, or when CPU pressure is 40% or more while other processes use 25% or more of the CPUs. CPU used by fleetjobs' own jobs is subtracted. A host may change these limits with
HEAVY_HOST_MIN_MEM_GB,HEAVY_HOST_MIN_DISK_GBandHEAVY_HOST_MAX_OTHERSin its environment. - Copy. rsync copies the checkout, with uncommitted changes, to
~/overflow/mirror<checkout path>on the host. It leaves outnode_modules,.git,.envfiles,.pemfiles, and what git ignores, exceptdistand.nuxt. - Install. The host installs dependencies once per hash of the lockfiles and package manifests, with
pnpm install --frozen-lockfileornpm ci. - Run. The job runs under
niceandbwrapin a slot of the host,~/overflow/heavy-slot-<n>, and stops if the connection drops. Output streams back as it comes, andHEAVY_MAXapplies. - Copy back. The host lists each file the job wrote with its SHA-256, and rsync copies them to this machine, where fleetjobs checks each one. A copy that fails or does not match turns exit 0 into exit 74.
Exit codes of a host
Section titled "Exit codes of a host"| Exit | Meaning |
|---|---|
| 200 to 205, 208, 255 | The job did not start: the host is busy or has no free slot, the mirror is missing, the install failed, the copy failed, or ssh could not connect. The host rests for a minute and the job goes back to the queue here |
| 206 | The output shows what the mirror lacks, such as not a git repository. The job runs here, ahead of the queue |
| 124 | The job passed HEAVY_MAX |
| 74 | The job passed, but the files it wrote did not come back intact |
Any other code is the job's own. What happens to a failing job is in Trust.