Repository navigation
tests: stage the runtime adapter's images and plan launches for its guest - #863
Merged
Pedro Henrique Penna (ppenna) merged 3 commits intoOct 25, 2026
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Layered VM boot arguments change, and validation on KVM, MSHV, and WHP remains pending.
No open issues 🎉
What changed in this PR
This PR adds image staging and adapter-specific launch planning to the in-repository runtime adapter, completing the first step of #822. Checked image handoff before VM spawn remains deferred to the next PR.
Changes:
- Adds a
stagecommand to verify distro images, bind optional scratch images, and persist their bindings. - Switches layered launches to
SandboxPlan::adapter, requires image identity, and removes managed-lifecycle arguments while preserving the init-agent handoff token. - Updates launch records to format 2 with staged bindings, with corresponding tests and documentation.
| File | Description |
|---|---|
| tests/runtime-adapter/tests/vm_layered.rs | Updates VM record assertions for adapter plans and format 2. |
| tests/runtime-adapter/tests/layered_launch.rs | Tests staging, bindings, launch arguments, records, and CLI validation. |
| tests/runtime-adapter/src/lib.rs | Updates module documentation for staging and adapter planning. |
| tests/runtime-adapter/src/layered.rs | Implements staged bindings, adapter plans, and revised launch records. |
| tests/runtime-adapter/src/bin/runtime-adapter-host.rs | Adds staging commands and loads staged bindings during launch. |
| tests/runtime-adapter/README.md | Documents staging, launch behavior, record formats, and tests. |
Review effort: Balanced
Enrique Saurez (esaurez)
marked this pull request as ready for review
October 24, 2026 07:32
This was referenced Oct 24, 2026
Merged
Pedro Henrique Penna (ppenna)
approved these changes
Oct 25, 2026
Enrique Saurez (esaurez)
force-pushed
the
esaurez/822-pr01-staging-adapter-plan-20261023
branch
from
October 25, 2026 05:26
3ab87dd to
2d3497a
Compare
…uest The runtime adapter's host program gains `stage`, which verifies an image with DistroBinding::verify, hashing it only when a manifest is beside it, binds a scratch image with ScratchBinding::bind, and records both bindings in the sandbox's store. Staging is where hashing belongs: a launch never hashes. A layered launch now plans its root with SandboxPlan::adapter, which holds none of the sandbox profile's settings, passes nvx_sandbox=1 as its own boot token, and drops --microvm-lifecycle managed, which OpenVMM only checks and labels its report with, and whose token only NVX's init agent reads, which the guest agent replaces. The image's identity is required, since a binding names it, and the launch record moves to format 2, with the bindings that the store stages for the launch's images. Part of #822. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 95934b67-b8c3-419d-ab53-05fe1b79af13
The launch record gains the bindings of its images without a new format. A new format would only let a reader tell older records from newer ones, and nothing reads a record that another build wrote: the host program only writes the record, and tests read it back from the same build. The adapter keeps no backward compatibility. Part of #822. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 95934b67-b8c3-419d-ab53-05fe1b79af13
`Staged` and `StagedFile`, the record of the images that the host program stages, move from the `layered` module to a new `staged` module, with their constants, their docs, and the helpers that only the record uses. Their tests move from tests/layered_launch.rs to tests/staged_images.rs. The `layered` module keeps the launch's plan, bindings, and record, and the helpers that both modules share. Part of #822. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 95934b67-b8c3-419d-ab53-05fe1b79af13
Pedro Henrique Penna (ppenna)
force-pushed
the
esaurez/822-pr01-staging-adapter-plan-20261023
branch
from
October 25, 2026 11:26
2d3497a to
2168525
Compare
Pedro Henrique Penna (ppenna)
deleted the
esaurez/822-pr01-staging-adapter-plan-20261023
branch
October 25, 2026 11:53
This was referenced Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Part of #822: PR 1 of 11, staging and the adapter plan.
What changed
runtime-adapter-host stage STORE --distro FORMAT:PATH --distro-identity UUID [--upper scratch:PATH]verifies the image withDistroBinding::verify, which hashes it only when a manifest is beside it, and checks the binding from metadata as a launch does. It binds the scratch image withScratchBinding::bind, and records both bindings, with the absolute paths at which it staged them, inruntime-adapter-staged.jsonin the sandbox's store. Staging is where hashing belongs: a launch never hashes. Staging also refuses images that no launch could attach, as the plan checks them.StagedandStagedFile, has a module of its own,staged, and its tests are intests/staged_images.rs.SandboxPlan::adapterinstead ofSandboxPlan::new(..., SandboxSettings::default()), so no workload identity, entrypoint, hostname, or limit reaches OpenVMM or the kernel command line. The launch passesnvx_sandbox=1as its own token, so that NVX's/initstill hands the VM to the init agent, which the guest agent replaces.--microvm-lifecycle managed: OpenVMM only checks its arguments and labels the outcome report with it, and only NVX's init agent reads its token. Blockless launches keep it.--distro-identityis required with--distro, since a binding names the identity, andLayeredLaunch::newtakes the image's format and aUuid.bindings: the staged bindings of the launch's image and scratch image, found by path, eachnullwhen the store stages none. The record stays at format 1. Nothing reads a launch record that another build wrote, so the adapter keeps no backward compatibility. The next PR of runtime adapter: run cold sandboxes end to end on KVM, MSHV and WHP #822 checks the bindings before spawn and requires them.Validation
Rebased onto dev at
50577c9, after #830, without conflicts;git range-diffshows the three commits unchanged. At2168525, on Windows (AMD EPYC 7763 VM), as CI's actions run them:scripts/nvx.py verify.-D warningsfor all features, and for the library without default features; tests with all features, with the defaults, and of the library without default features; artifact bundling; rustdoc with-D warnings; and the 1.89 check. The two CLI tests that failed on dev since nvx-rs: retire the egress policy fixture and read policies as strict JSON #828,egress::egress_compile_prints_the_library_loweringandvalidation::validation_errors_exit_1_before_any_side_effect, pass since nvx-rs: retire the golden CLI scenarios #830.-D warningsof its protocol-only, host-only, and guest-only configurations forx86_64-unknown-linux-gnu.scripts/check_markdown_links.py.2d3497a, whose OpenVMM pin and guest inputs this head keeps:vm_layered(22 of 22) andvm_restart(2 of 2).At
2d3497a, the same commits onfcc7199, these also passed: on Linux, nvx-rs's macOS check and guest binaries,aci_edge_sandboxesand its macOS check, and the runtime adapter's guest-onlyx86_64-unknown-linux-muslconfiguration; andvm_layeredandvm_restarton WHP (Core i9-12900K) and on MSHV (Genoa VM,--cpu-profile host, as root), with the guest artifacts and OpenVMM ofv0.1.0-dev.3e80c7c74520. KVM and MSHV at this head, and its Linux-only gates, are left to CI.