Installation and bootstrap
There are two ways to get fleet onto a machine:
- The static release — a single statically linked musl binary published
as a GitHub release asset. This is what a fresh sandbox seat installs,
through
scripts/muse/bootstrap.sh. It needs no Nix and no shared libraries, which is the point: a glibc-dynamic build names Nix store paths that a non-Nix host does not have. - A Nix build — one of the variant packages from the repo flake, for machines that are part of the Nix fleet (the laptop, NixOS hosts).
The static musl release
The release is produced by scripts/muse/publish-fleet.sh:
- It builds the
fleet-staticpackage (the full capability profile on the muslpkgsStaticRust platform) in a throwaway detached git worktree at the requested revision (defaultorigin/main). - It refuses to publish an artifact that is not statically linked, and it
probes the artifact’s
capabilitiesoutput: a build whosebridgedomain is not available is fatal, because a Muse seat’s bootstrap requires the bridge-capable full profile. - The release tag is
fleet-static-<short>, where<short>is the first 7 characters of the commit SHA. The asset name isfleet-x86_64-linux-musl, published alongsidefleet-x86_64-linux-musl.sha256containing the asset’s SHA-256 sum. - The script prints exactly two lines for the operator to pin in the
bootstrap script:
tag=fleet-static-<short>andsha256=<sum>. Re-publishing an existing tag only re-uploads when the sum differs.
Source: https://github.com/developing-today/code/blob/main/scripts/muse/publish-fleet.sh
Bootstrap: scripts/muse/bootstrap.sh
A Muse sandbox seat is rebuilt from scratch whenever the sandbox is recycled:
no fleet binary, no laptop link. bootstrap.sh rebuilds the seat. Every phase
is idempotent and skips work already done. Exit codes: 0 success, 1 a phase
failed (the message names it), 2 usage. Phases are selectable with
--only <list> / --skip <list>; --all additionally restores ~/git and
~/agents.
The pin. Two lines near the top of the script, both overridable from the environment, pin the release:
FLEET_URL="${FLEET_URL:-https://github.com/developing-today/code/releases/download/fleet-static-b8bbcc0/fleet-x86_64-linux-musl}"
FLEET_SHA256="${FLEET_SHA256:-<the sha256 printed by publish-fleet.sh for that tag>}"
The URL is exactly the publish tag scheme (fleet-static-<7-char short sha>)
plus the asset name. FLEET_AGENT (default muse) and FLEET_AGENT_GROUPS
select the seat identity; groups are never hardcoded for another agent kind.
The phases, in the order PHASES="tools token restore tailnet fleet persist init check":
- tools — downloads the pinned fleet binary, verifying its SHA-256, into
$HOME/.local/share/muse-bootstrap/fleet/fleet. It is kept under the namefleetin its own off-PATH directory because fleet picks its verb set from argv0 (the name it is invoked under). The download is skipped when the existing copy is present and passes the bridge-capability probe. The phase also installsbws,restic, andtailscaleinto the seat’s bin directory; a tailscale failure only skips the tailnet phase. - token — obtains the Bitwarden Secrets Manager access token for the seat.
- restore — restores the seat’s files with restic, and provisions the
three shared broker token files from Bitwarden Secrets Manager, each with
owner-only (0600) permissions:
fleet.secrets-broker-token→~/tools/secrets-broker-token,fleet.queue-broker-token→~/tools/queue-broker-token, andfleet.laptop-agent-token→~/tools/laptop-agent-token. Bitwarden is the source of truth for these three names. A missing name is not fatal: the enrolment continues and the check phase names the gap. See Secrets and the secrets broker for why these files matter. - tailnet — joins the tailnet and points fleet’s laptop link at it. In
kernel mode the seat dials the laptop directly; in userspace mode traffic
goes through tailscaled’s CONNECT proxy, which fleet expects on port 3130,
and the phase writes
fleet-proxy.envwithHTTPS_PROXY=http://127.0.0.1:3130. The phase also writes the[host]config into~/.config/fleet/fleet.toml. - fleet — installs the binary at
~/tools/fleet. If the existing file is not writable it is moved aside to~/tools/fleet.old(with sudo when available). The install is atomic —install -m 755to~/tools/fleet.tmp, thenmv -fover~/tools/fleet— and happens only when the bytes differ. The phase then creates two symlinks:~/tools/bin/fleet→~/tools/fleetand~/tools/bin/repo-queue→~/tools/fleet. Therepo-queuelink is the argv0 alias doing the work; there is no second binary. - persist — writes
~/tools/muse-bootstrap.shplus a boot hook that, after a sandbox recycle, re-runs--only tailnet,fleetunderflock -n $HOME/tools/.muse-boot.lockwith a 300 s timeout. Only/home/hatchsurvives a recycle, so persistence lives there. - init — brings up the seat’s init stack (brokers, the
ghshim, the laptop channel) from the restored tools. This is the same workfleet initdoes; see Proxy, sessions and recovery. - check — verifies the seat:
fleet versionandfleet capabilitiesrun and the bridge capability is present; the laptop link is reachable the way fleet dials it;fleet secrets get tailscale.auth-key(a secret name) resolves;fleet secrets listanswers (the session broker answering is the expected path; thebwsfallback is noted as acceptable); and a bridge hello/inbox probe succeeds as the seat’s agent.
Source: https://github.com/developing-today/code/blob/main/scripts/muse/bootstrap.sh
Nix build variants
From the repo root, the flake exposes the fleet packages:
nix build .#fleet .#fleet-serve .#fleet-connect .#fleet-connect-static
pkgs/fleet/default.nix returns six attributes:
| Attribute | Cargo features | Platform | Installed alias link | Size gate |
|---|---|---|---|---|
fleet | default (= full) | glibc | — | no |
fleet-serve | serve | glibc | fleet-serve | no |
fleet-connect | none (--no-default-features) | glibc | fleet-connect | yes |
fleet-brokers | fleet-queue with client,queue-broker,secrets-broker, --bins | glibc | — | no |
fleet-static | default (= full) | musl (pkgsStatic) | — | no |
fleet-connect-static | none | musl (pkgsStatic) | fleet-connect | yes |
Facts that matter when choosing one:
- The installed binary is always named
fleet. A hyphenated name (fleet-serve,fleet-connect) is installed as a symlink to the same binary; the name narrows the capability surface at invocation time. See The shape of the binary. - The size gate is the connect variant’s budget: the stripped binary must be at most 2 MiB (2,097,152 bytes) or the build fails.
fleet-brokersbuilds the three standalone broker artifactsrepo-queue,queue-broker, andsecrets-brokerfrom thefleet-queuecrate. They are the migration’s rollback inventory and retire only at the close of the multicall epic.- The static builds carry no ONNX Runtime library path: the search-serve role
in a static binary needs
ATLAS_ORT_LIBsupplied at runtime. The glibc non-connect builds bake the path in.
Source: https://github.com/developing-today/code/blob/main/pkgs/fleet/default.nix
Verifying an install
Two built-in commands verify any install. Both take no arguments — a trailing
argument, including --help, is a usage error (exit 2).
fleet version
fleet capabilities
fleet version prints five lines: the version (fleet 0.1.0), the build
name (fleet, fleet-serve, or fleet-connect, derived by matching the
compiled capability set against the variant sets — with an annotation when
the invocation name narrowed the surface), the derived version (of the form
0.1.0-dev+g<rev>), the source revision (the full commit SHA the build was
cut from), and the enabled capabilities — the usable set for this
invocation, in registry order, or none.
fleet capabilities prints the same facts as JSON, plus the full domain
registry with, for each domain, its summary, aliases, required capabilities,
and a state of available, not-in-build, narrowed-by-name, or
disabled-by-config. It prints two distinct lists: capabilities (what this
invocation can use) and compiled_capabilities (what the binary was built
with). Their difference is exactly the narrowing applied by the invocation
name and the host config. On a full build both lists are the same 15
capabilities and every domain is available. The Quickstart chapter,
Quickstart, walks through what to do with this output.