Handbook
Migrate Fleet installations to apt
Move git_user / git_system hosts to apt_user / apt_system so routine upgrades use cooperative lifecycle + apt (or git-user update-user.sh) instead of ad-hoc git pulls.
Updated
Install channels
| Channel | Typical layout | Routine upgrade |
|---|---|---|
git_user |
~/forge-fleet → ~/.local/share/forge-fleet, user systemd :18766 |
POST /v1/admin/upgrade → git pull + restart (no root) |
apt_user |
/usr/lib/forge-fleet, user systemd |
Admin upgrade → signal file → root timer (~60s) |
git_system |
/opt/forge-fleet + FLEET_GIT_ROOT, system unit :18765 |
SSH/sudo git path (legacy) |
apt_system |
/opt/forge-fleet from forge-fleet deb |
Admin upgrade → signal → root timer |
Detect with GET /v1/admin/install-channel or land-fleet migrate-to-apt.
Until a host is migrated
Routine releases must not wait for the migration. update-fleet.sh --remote-upgrade --publish-apt-cdn publishes the debs and then upgrades git-channel hosts through the same POST /v1/admin/upgrade API (cooperative drain → git pull → update-user.sh → restart), printing a WARN … still on a git install channel line and verifying /v1/health. Nothing here needs SSH or an operator. The apt bootstrap itself (install.sh → apt-get) is the single step that needs root on the host and therefore cannot be driven by Fleet; do it once per host when convenient, after which the same command upgrades via apt automatically.
Mercury (laptop) — git_user → apt_user
- Export bearer + remote peer settings from
~/.config/forge-fleet/or env. - One-time sudo:
bash install.sh --user --with-dockerfrom Fleet apt repo (see learn-101/09). land-fleet setup-user— refresh user unit against/usr/lib/forge-fleet.- Verify:
curl -fsS http://127.0.0.1:18766/v1/healthand remote Granite peer if configured. land-fleet migrate-to-apt --user— checklist (apt source, package, unit path, timer).- Disable legacy unit if it still points only at
~/.local/share/forge-fleet. - Optional: keep git clone for contributions; set
FLEET_INSTALL_CHANNEL=apt_userin env after migration.
Granite — git_system → apt_system
POST /v1/admin/snapshotbackup (settings, peers, jobs summary).- Prefer Fleet HTTP paths per granite-operator-boundary. One bounded operator window may be required for first apt bootstrap.
sudo bash install.sh --system --with-dockeron host.land-fleet migrate-to-apt --system.- Routine bumps:
POST /v1/admin/upgrade(replaces routinegit-self-updateon production). - Retire
FLEET_GIT_ROOTself-update on production after verification.
Cooperative upgrade before restart
All channels run the lifecycle coordinator first:
- Fleet sets
draining, pauses new jobs/proxy work. POST …/prepare-stopon loopback dependents.- Poll
GET …/stop-readinessuntilstop_allowed: trueor timeout (409upgrade_blocked). - Git pull, apt signal, or queued root apt apply.
- Optional
POST …/resumeon failure.
See fleet-lifecycle-contract and operate-301/05.
Timer and signal files
| Channel | Signal path |
|---|---|
apt_user |
~/.local/state/forge-fleet/upgrade-request.json |
apt_system |
/var/lib/forge-fleet/upgrade-request.json |
Root forge-fleet-apt-upgrade.timer runs scripts/apt-upgrade-cron.sh every minute. Enable via deb postinst or:
sudo systemctl enable --now forge-fleet-apt-upgrade.timer
land-fleet timer-status
Poll GET /v1/admin/upgrade/status or land-fleet upgrade --wait.
Rollback
- Reinstall previous deb version or restore git checkout +
update-user.sh. - Dependent lifecycle routes are additive; older Fleet ignores them.