Show provisioning phase and heartbeat in lab status

What changed

just lab up now records its progress in the instance state, and just lab status shows it with no change to cmd_status.

  • phase and phase_since (UTC) change at each stage boundary: creating, booting, installing, bootstrapping (the omnibus re-run after the SELinux reboot), configuring, then ready. A nonzero exit sets failed and a short failed_step.
  • heartbeat is refreshed every 60 seconds by a ticker that lives as long as up does, so a long silent ssh step still reads as alive. The exit hook stops the ticker on success, failure, Ctrl-C and a TERM, then runs the caller's own EXIT trap.
  • State writes take a lock and go through a temp file and mv, so two writers cannot corrupt the file.
  • gce/operations.md gains one paragraph on waiting with the Monitor tool, and the same file loses 73 words of prose so word-budget holds. The changelog has one entry.

Why

A measured omnibus up took 30.5 minutes and status read the same for 21.4 of them, so agents wrote background sleep loops to see whether the rig was alive.

stateDiagram-v2
  [*] --> creating
  creating --> booting: VM exists
  booting --> installing: startup done, firewall set
  installing --> bootstrapping: SELinux reboot, omnibus re-run
  installing --> configuring: install done
  bootstrapping --> configuring
  configuring --> ready: final HTTP check
  creating --> failed
  booting --> failed
  installing --> failed
  bootstrapping --> failed
  configuring --> failed

Measured on two rigs

Both bases came up from this branch with --skip-activation, sampled once a minute with just lab status. Minutes are from the start of up.

Phase Omnibus start Omnibus length Caproni start Caproni length
creating 0.0 0.4 0.0 0.2
booting 0.4 1.4 0.2 1.5
installing 1.8 14.1 1.8 6.1
bootstrapping 15.9 7.1 none none
configuring 23.0 5.7 7.8 5.2
ready 28.7 13.0
  • The longest unchanged phase was omnibus installing at 14.1 minutes. The 20-minute stall threshold in the skill is that plus about 30%, rounded up to 5.
  • The omnibus heartbeat advanced every minute through the whole 14-minute silent first-pass ssh.
  • A first omnibus run received SIGTERM (exit 143) in the silent stretch and left phase=failed, failed_step=omnibus_first_pass, which exercised the failure path on a real rig. A second run, started in its own session, reached ready with no TERM.
  • Both VMs were deleted by name with just lab down, and gcloud lists neither.

Tests

engine-selftest.sh gains 23 checks: the phase sequence ends ready, a failing step leaves failed with its step, no ticker outlives up, a caller's EXIT trap still runs, and two writers do not corrupt the file. The new checks fail on main's engine.

Edited by Andrew Dunn

Merge request reports

Loading
Loading