A VM-mode member device downloads the guest bundle UNCOMPRESSED — 2.6 GB, measured ~52 min on a real home line, with no resume #1753
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#1753
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What a real member device actually waits for
A VM-mode member device stages the guest bundle from its own community gateway:
GET /get?arch=x86_64&artifact=vm-guest→/var/lib/idss/vm-guest. The doorwayserves
vm-guest.tar, uncompressed — 2,598,615,040 bytes (2.6 GB).Between two droplets that is a couple of minutes, which is why no drive has ever
surfaced it: every device lane until now rented its member box in the same region
as the gateway.
Measured on real hardware (ADR 0264's bring-your-own fixture,
elitebook-03on a home line, pulling from the
rehearsal-mgateway):At 835 KB/s the full bundle needs ~52 minutes. On a slower line it is worse,
and there is no resume: the staging one-liner is a single
curl -sSf … -o, so adropped connection restarts from zero.
This is the experience for a community adding its first real machine: "run this
on the machine", then most of an hour with no progress, on a link that may not
survive it.
Why it is fixable
The payload inside is a NixOS qcow2 (2.2 GB) plus a relocatable QEMU dist. A
NixOS disk image compresses hard — zstd should bring the transfer to a few
hundred MB, cutting the measured wait from ~52 min to a handful of minutes, for
every member device on every line.
Shape (for a ruling, not a decision taken)
vm-guest.tar.zst), and havethe staging command stream-decompress it. The marker stays a sha over the
bundle, so the seed short-circuit and the snapshot bake are unaffected.
curl -C -), so a dropped home link costs theremainder, not the whole.
the whole transfer.
How this was found
ADR 0264's first fire, fire 5: red at
agent-installwith the fetch stillrunning and healthy at the 300 s ceiling. The drive's byo carrier now carries a
measured 75-minute stage ceiling so the journey can be proven end to end; that
budget is the WORKAROUND, and this issue is the thing itself.
Related: #1153 (Task 2, the doorway), #1191 (the snapshot bake — the same
transfer cost, solved for the gateway only), GOTCHAS #310/#312 (the other
first-fire findings).
Ruled by agent under ADR 0174 — veto anytime
Ruling: categorised bug, moved to ready-for-agent adopting the issue's proposed shape as the default — Shape steps 1 (serve compressed) and 2 (resumable fetch) are in scope; step 3 (operator progress display) is split out as a design-gated follow-up (see below).
Why it is a two-way door: compressing the served artifact and adding a resumable client fetch are both revertible with a single commit, and provable by an existing test/drive/probe — the ADR 0264 bring-your-own fixture already measures the stage time on a real home line, and an HTTP probe can assert the doorway now advertises
Accept-Ranges/answers206and that the transfer is a few hundred MB instead of 2.6 GB. It is on none of the one-way-door list items: no personal credentials, no security-posture widening (auth is unchanged), no member-facing trust surface, no data destruction, no non-routine spend.Why not
needs-design: steps 1 and 2 are pure infra (server wire format + client fetch loop) with no flow or wireframe dependency. Only step 3 touches a UI surface (the device-add "run this on the machine" screen), so that part alone isneeds-designand is carved out here rather than blocking the fix.What proves it: the byo device drive's
agent-installleg staging from a home-line gateway; an HTTP-level probe of/get?arch=…&artifact=vm-guestforAccept-Ranges: bytesand a206oncurl -r; the seed-short-circuit + snapshot-bake sha marker staying green (the marker is taken over the on-boxvm-guest.tar, the artifact of record — leave that untouched).Agent Brief
Category: bug
Summary: The VM-guest bundle is served and fetched uncompressed (2.6 GB) with no resume, so a member device adding its first real machine on a home line waits ~52 min and any dropped connection restarts from zero. Serve it compressed and make the fetch resumable.
Current behavior:
GET /get?arch=…&artifact=vm-guesthandler streams the on-diskvm-guest.tarbyte-for-byte withio.Copyand an explicit200. It sets noContent-Encoding, and because it does not use the range-capable serve primitive it advertises noAccept-Rangesand ignores inboundRange:headers — every retry re-downloads the full 2.6 GB.idss-agent install) opens its temp fileO_TRUNCand does a singleio.Copy, sending noRangeheader — a dropped transfer restarts at byte 0. The e2e device-add fixture's one-liner mirrors this:curl -sSf … -o …tar.tmpwith no-C -, no--retry.agent-installat the 300 s drive ceiling. The current workaround is a 75-min byo stage ceiling in the drive carrier — this ticket removes the need for it.-C -+--retryresume precedent in the release-rail pull script).Desired behavior:
vm-guest.tar.zst; zstd preferred for the ratio/speed on a NixOS qcow2, but the codec is the implementer's two-way call — it must be deterministic so the snapshot bake stays reproducible). The compressed artifact is produced wherever the uncompressed tar is produced/staged today (the payload assembler and the slot stager, kept in lockstep), so the doorway can serve it directly.Accept-Ranges: bytesand honoursRange:(i.e. serve the static compressed file through the range-capable serve primitive rather than a bareio.Copy). The production client fetch resumes from a partial temp file (curl -C --style / an HTTPRangerequest) and retries a stalled transfer, then stream-decompresses (zstd -d | tar -x, or download-then-decompress) into/var/lib/idss/vm-guest. The e2e fixture one-liner is updated to match the production stager.vm-guest.tar— keepvm-guest.tarthe artifact of record (the sha stays over the uncompressed bundle); the compressed.tar.zstis a transfer representation derived from it. Verify the seed short-circuit and bake still no-op when the on-box tar already matches.Key interfaces:
artifact=vm-guestand its guest-payload serving helper — switch fromio.Copy(200)to a range-honouring serve over the file source; serve the compressed representation.vm-guest.tar.downloadhelper — add resume (partial-file offset +Rangerequest) + retry, then decompress.vm-guest.tar; confirm no drift.Acceptance criteria:
curl -sfI …&artifact=vm-guest(or the compressed artifact request) withAccept-Ranges: bytes, and tocurl -r 0-N …with206 Partial Content.vm-guestfetch are materially smaller than the uncompressed 2.6 GB (target: a few hundred MB) on the same input./var/lib/idss/vm-guestcontains the same decompressed contents as today (the qcow2 + relocatable QEMU dist), byte-for-byte equivalent to unpacking the uncompressed tar.vm-guest.tar(sha marker unchanged).Out of scope:
needs-designfollow-up.vm-guest.tar./getroute surface.swarm-claim host=bens-mac-04 run=30673
(automated multi-host claim — lowest live claim id works this ticket)
Ruled by agent under ADR 0174 — veto anytime
Building the accepted shape (compress + resumable fetch; operator-progress stays the carved-out
needs-designfollow-up). Two implementer's-choice calls, both two-way doors, recorded here:Codec = gzip, not zstd. The served representation is
vm-guest.tar.gzand the device stages it withtar -xzf. Why a two-way door: revertible in one commit and provable by an offline size/round-trip test. Why gzip over the issue's proposed zstd: the device is a stock-Ubuntu machine and the staging one-liner iscurl … | … | tar, sogzip/tar -zis universally present wherezstd/unzstdis not guaranteed; and this repo already carries a deterministic-gzip precedent (internal/matourelease/pack.go:gzip.BestCompression+gzip.Header{OS:255}, no embedded name/modtime), which gives acceptance's "same input ⇒ same bytes" for free. A NixOS qcow2 still compresses hard under gzip — materially under the 2.6 GB, a handful of hundred MB.The gateway derives the compressed representation from the on-box
vm-guest.tar(lazy, deterministic, cached beside the tar, mtime-keyed), rather than the seed/bake carrying a second artefact. Why a two-way door: revertible in one commit, provable by an httptest over the guest-cache source. Why this shape: it leaves the #1191 sha-marker seed short-circuit and the snapshot bake byte-for-byte untouched — they keep carrying and keying on the uncompressedvm-guest.tar(the out-of-scope contract), and the.tar.gzis a pure transfer representation the doorway range-serves. The materialization is keyed on the tar's mtime so anix/guestbump that replaces the tar re-derives the.tar.gz(no #1215-class staleness), and it is cached so only the first device on a fresh gateway pays the one-time compression.What proves it (all offline): the doorway answers
Accept-Ranges: bytes+206on a range request; the derived.tar.gzis materially smaller than the tar and round-trips to the identical bytes; the device stager sends aRange:from its partial temp file and resumes on a dropped copy; the seed/bake tests stay green unchanged. The live proof is the byo device drive'sagent-installstage.close-report for #1753 — status
success⛔ close-report gates REFUSED this close — the following claims did not verify:
envelope
close-report for #1753 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope
Second finding, same bundle: the DEVICE's stage never short-circuits, so it downloads twice
Found on ADR 0264's fire 6 (the first run to get past the stage at all).
idss-agent installis the only caller ofinstall.GuestPayload.StageGuest(
join/cli.go InstallAgent), andStageGuesthas no short-circuit(
internal/install/guestpayload.go): it fetches the bundle unconditionally, evenwhen
/var/lib/idss/vm-guestalready holds exactly that bundle.So a device that re-runs the published one-liner — which is the ordinary thing to
do after a declined request, a retry, or a re-enrol — pays the full ~2.6 GB again.
On the measured home line that is a second ~52 minutes, and it is silent:
the transcript stops after
idss: fetching this community's pinned agent from <apex>…and prints nothing until the consent prompt, so the operator sees a deadterminal for most of an hour.
The asymmetry is the tell: the GATEWAY's seed already solves this.
fleetwire.Supplywrites
vm-guest.tar.sha256beside the landed tar and skips the copy when itmatches (
PayloadVMGuestMarker, #1191). The device's own stage — the side on theslow link, where it matters far more — has no equivalent.
Shape
StageGuestthe mirror of the seed's short-circuit: compare the stagedslot against the doorway's sha (a sidecar, or a
HEADthe doorway alreadyserves) and skip when they match.
the compression work above cuts what remains.
Drive impact
The byo drive stages twice by construction: once in
agent-install(so thedecline-resume honesty leg has a guest to tear down), then again inside the join
one-liner. Until this lands, both legs carry the measured 75-minute stage budget,
which is why a bring-your-own fire now runs ~2.5 h. Fixing this halves it.
vm-guest.tarrather than being handed 263 MB of it at founding (ADR 0272) #1770