app: pinned QEMU payload has no build source (ADR 0110 carriage) #230

Closed
opened 2026-07-31 18:26:28 +00:00 by ben · 2 comments
Owner

Parent

Reported during QA session preparing #183 Phase A.

What's wrong

ADR 0110 commits the operator-app install to carrying the private-path payload: the agent binary, a pinned QEMU, and the per-arch guest base image. The guest base image has a clean build entry point (#216), but the pinned QEMU has no build source anywhere — the flake exposes only the guest image and the dev toolchain. The pinned-QEMU half of the payload cannot be produced.

What I expected

A build target that produces the pinned QEMU payload, versioned alongside the guest base image, ready to be staged into the private-path payload.

Steps to reproduce

  1. From a clean checkout, follow ADR 0110 and try to build the pinned QEMU the payload carries.
  2. No build target, script, or documented procedure exists for it.

Blocked by

None — can start immediately.

Additional context

Not a #183 blocker: Ben ruled Phase A rehearses on the apt-installed QEMU stopgap (#183, 2026-07-30). This gap is what stands between the stopgap and ADR 0110's promise ("no network fetch, no apt install"), and any signed bundle on the Matou channel (#211) needs it.

## Parent Reported during QA session preparing #183 Phase A. ## What's wrong ADR 0110 commits the operator-app install to carrying the private-path payload: the agent binary, a **pinned QEMU**, and the per-arch guest base image. The guest base image has a clean build entry point (#216), but the pinned QEMU has no build source anywhere — the flake exposes only the guest image and the dev toolchain. The pinned-QEMU half of the payload cannot be produced. ## What I expected A build target that produces the pinned QEMU payload, versioned alongside the guest base image, ready to be staged into the private-path payload. ## Steps to reproduce 1. From a clean checkout, follow ADR 0110 and try to build the pinned QEMU the payload carries. 2. No build target, script, or documented procedure exists for it. ## Blocked by None — can start immediately. ## Additional context **Not a #183 blocker**: Ben ruled Phase A rehearses on the apt-installed QEMU stopgap (#183, 2026-07-30). This gap is what stands between the stopgap and ADR 0110's promise ("no network fetch, no apt install"), and any signed bundle on the Matou channel (#211) needs it.
Author
Owner

This was generated by AI during triage.

Triage

Category: enhancement · State: ready-for-agent

Verification: confirmed against the codebase — flake.nix exposes a packages.guest-image build (and per-arch ourcloud-guest-x86_64/ourcloud-guest-aarch64 configs) but no QEMU build target anywhere in the repo. internal/vm/resolve.go already defines the exact contract the private-path payload must satisfy. No existing implementation, no prior .out-of-scope/ rejection.

Agent Brief

Category: enhancement
Summary: Add a build target that produces the pinned QEMU payload (ADR 0110), versioned alongside the guest base image.

Current behavior:
The private-path payload's guest base image has a build entry point (the flake's guest-image package, #216), but the QEMU half of the payload has no build source anywhere in the repo — the flake exposes only the guest image and the dev toolchain. internal/vm/resolve.go's ResolveConfig already documents the exact artifact contract: given OURCLOUD_PAYLOAD_DIR, it expects an arch-agnostic qemu-img binary and a per-arch qemu-system-x86_64/qemu-system-aarch64 binary inside that directory. Nothing produces them.

Desired behavior:
A reproducible build target (a flake output beside the existing guest-image package is the established pattern) that produces the pinned qemu-img and qemu-system-<arch> binaries, versioned/pinned together with the guest base image, ready to be staged into the private-path payload directory by the assembly step (#231).

Key interfaces:

  • Match the artifact names internal/vm/resolve.go already defines: qemu-img and qemu-system-x86_64 / qemu-system-aarch64 (selected via runtime.GOARCH).
  • Follow the flake's existing per-arch precedent: prove x86_64-linux first. aarch64/other platforms may be documented-deferred the same way #216 deferred aarch64 guest-image proving, if a working cross-build isn't practical in this pass — document the deferral rather than silently omitting it.
  • Pin a specific QEMU version/source so the binary is reproducible and versioned alongside the guest base image (ADR 0110: "bundled QEMU/agent/image are pinned together per app release").

Acceptance criteria:

  • A documented, scripted or flake-defined build target produces qemu-img and qemu-system-<arch> binaries for at least x86_64-linux.
  • The produced binaries are pinned to a specific, reproducible QEMU version.
  • The build output is placed/copyable to the location the private-path payload assembly step (#231) expects.
  • Any deferred platform (aarch64, macOS, Windows) is explicitly documented as deferred, not silently missing.

Out of scope:

  • The payload assembly step that stages the binary into the payload directory (#231).
  • macOS/Windows QEMU builds, unless a build source already exists to reuse (document deferral otherwise).
  • KVM/accelerator provisioning (a host capability, out of scope per ADR 0110).
> *This was generated by AI during triage.* ## Triage **Category:** enhancement · **State:** ready-for-agent **Verification:** confirmed against the codebase — `flake.nix` exposes a `packages.guest-image` build (and per-arch `ourcloud-guest-x86_64`/`ourcloud-guest-aarch64` configs) but no QEMU build target anywhere in the repo. `internal/vm/resolve.go` already defines the exact contract the private-path payload must satisfy. No existing implementation, no prior `.out-of-scope/` rejection. ## Agent Brief **Category:** enhancement **Summary:** Add a build target that produces the pinned QEMU payload (ADR 0110), versioned alongside the guest base image. **Current behavior:** The private-path payload's guest base image has a build entry point (the flake's `guest-image` package, #216), but the QEMU half of the payload has no build source anywhere in the repo — the flake exposes only the guest image and the dev toolchain. `internal/vm/resolve.go`'s `ResolveConfig` already documents the exact artifact contract: given `OURCLOUD_PAYLOAD_DIR`, it expects an arch-agnostic `qemu-img` binary and a per-arch `qemu-system-x86_64`/`qemu-system-aarch64` binary inside that directory. Nothing produces them. **Desired behavior:** A reproducible build target (a flake output beside the existing `guest-image` package is the established pattern) that produces the pinned `qemu-img` and `qemu-system-<arch>` binaries, versioned/pinned together with the guest base image, ready to be staged into the private-path payload directory by the assembly step (#231). **Key interfaces:** - Match the artifact names `internal/vm/resolve.go` already defines: `qemu-img` and `qemu-system-x86_64` / `qemu-system-aarch64` (selected via `runtime.GOARCH`). - Follow the flake's existing per-arch precedent: prove x86_64-linux first. aarch64/other platforms may be documented-deferred the same way #216 deferred aarch64 guest-image proving, if a working cross-build isn't practical in this pass — document the deferral rather than silently omitting it. - Pin a specific QEMU version/source so the binary is reproducible and versioned alongside the guest base image (ADR 0110: "bundled QEMU/agent/image are pinned together per app release"). **Acceptance criteria:** - [ ] A documented, scripted or flake-defined build target produces `qemu-img` and `qemu-system-<arch>` binaries for at least x86_64-linux. - [ ] The produced binaries are pinned to a specific, reproducible QEMU version. - [ ] The build output is placed/copyable to the location the private-path payload assembly step (#231) expects. - [ ] Any deferred platform (aarch64, macOS, Windows) is explicitly documented as deferred, not silently missing. **Out of scope:** - The payload assembly step that stages the binary into the payload directory (#231). - macOS/Windows QEMU builds, unless a build source already exists to reuse (document deferral otherwise). - KVM/accelerator provisioning (a host capability, out of scope per ADR 0110).
Author
Owner

Done in d7ab8fe (on main).

The pinned QEMU now has a build source — the QEMU half of ADR 0110's private-path payload.

What shipped:

  • Flake output .#pinned-qemu (flake.nix) builds qemu-img + qemu-system-x86_64 from nixpkgs' qemu_test — the lean, headless, host-CPU-only build NixOS integration tests boot, exactly the vm.Manager's QEMU shape (virtio + KVM + SeaBIOS, ADR 0056). Cache-substitutable (66.8 MiB, no from-source qemu compile).
  • scripts/build-qemu-payload.sh (the build-guest-image.sh precedent) builds it and stages the two binaries — the exact names internal/vm/resolve.go resolves — into a dir the assembly step (#231) consumes via PAYLOAD_QEMU_SRC_DIR.

Acceptance:

  • ✅ A flake-defined + scripted build target produces qemu-img and qemu-system-x86_64 for x86_64-linux.
  • ✅ Pinned to a reproducible version — by the flake.lock nixpkgs rev (qemu 11.0.0, ADR 0040), in lockstep with the guest base image, not a separate version string.
  • ✅ Output feeds the #231 assembly step unchanged (PAYLOAD_QEMU_SRC_DIR); scripts/assemble-payload.sh now produces a COMPLETE payload, no PENDING slot.
  • ✅ aarch64/macOS/Windows explicitly documented-deferred (ADR 0030), the same deferral the guest image carries — not silently omitted.

Verified end-to-end: nix build .#pinned-qemu → build-qemu-payload.sh stages → assemble-payload.sh consumes via PAYLOAD_QEMU_SRC_DIR → the assembled dir's qemu-img/qemu-system-x86_64 run (--version).

Docs updated (docs/operator-app/build-and-run.md, app/PACKAGING.md, scripts/assemble-payload.sh notes, STATUS.md). Remaining gap before "install the app": operator-app packaging/installer carrying the assembled payload into resourcesPath/payload.

Done in d7ab8fe (on `main`). The pinned QEMU now has a build source — the QEMU half of ADR 0110's private-path payload. **What shipped:** - **Flake output `.#pinned-qemu`** (`flake.nix`) builds `qemu-img` + `qemu-system-x86_64` from nixpkgs' `qemu_test` — the lean, headless, host-CPU-only build NixOS integration tests boot, exactly the `vm.Manager`'s QEMU shape (virtio + KVM + SeaBIOS, ADR 0056). Cache-substitutable (66.8 MiB, no from-source qemu compile). - **`scripts/build-qemu-payload.sh`** (the `build-guest-image.sh` precedent) builds it and stages the two binaries — the exact names `internal/vm/resolve.go` resolves — into a dir the assembly step (#231) consumes via `PAYLOAD_QEMU_SRC_DIR`. **Acceptance:** - ✅ A flake-defined + scripted build target produces `qemu-img` and `qemu-system-x86_64` for x86_64-linux. - ✅ Pinned to a reproducible version — by the flake.lock nixpkgs rev (qemu 11.0.0, ADR 0040), in lockstep with the guest base image, not a separate version string. - ✅ Output feeds the #231 assembly step unchanged (`PAYLOAD_QEMU_SRC_DIR`); `scripts/assemble-payload.sh` now produces a COMPLETE payload, no PENDING slot. - ✅ aarch64/macOS/Windows explicitly documented-deferred (ADR 0030), the same deferral the guest image carries — not silently omitted. **Verified end-to-end:** `nix build .#pinned-qemu` → `build-qemu-payload.sh` stages → `assemble-payload.sh` consumes via `PAYLOAD_QEMU_SRC_DIR` → the assembled dir's `qemu-img`/`qemu-system-x86_64` run (`--version`). Docs updated (`docs/operator-app/build-and-run.md`, `app/PACKAGING.md`, `scripts/assemble-payload.sh` notes, `STATUS.md`). Remaining gap before "install the app": operator-app packaging/installer carrying the assembled payload into `resourcesPath/payload`.
ben closed this issue 2026-07-31 22:39:18 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#230
No description provided.