Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The snapshot guide omits warnings to keep loaded files unchanged while snapshots or derived sandboxes remain alive and that published snapshots may expose secrets retained in older memory layers.
2 open issues
What changed in this PR
Documents Hyperlight’s snapshot persistence and distribution workflow, with a runnable example that restores saved guest state into a new sandbox.
Changes:
- Adds a how-to for capture, save, load, restore and registry transfer with ORAS.
- Adds an example that verifies restored state and host callbacks.
- Integrates the example into the existing runner and links the guide from the documentation.
| File | Description |
|---|---|
src/hyperlight_host/examples/snapshot/main.rs |
Demonstrates saving, checked loading and restoring a snapshot. |
Justfile |
Includes the snapshot example in run-rust-examples. |
docs/snapshot-oci-format.md |
Links the format reference to the workflow guide. |
docs/README.md |
Adds the guide to the documentation index. |
docs/how-to-save-and-load-snapshots.md |
Covers persistence, restore requirements, registry transfer and portability. |
Review effort: Balanced
| * `checked_load` verifies blob digests. `load` skips digest verification. | ||
| Both check format and platform compatibility. Trust the publisher. | ||
| Digests do not prove authenticity. |
|
|
||
| ### Push | ||
|
|
||
| Upload the saved layout to the registry: |
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
b3e0264 to
70c220d
Compare
Benchmark ResultsMeasured commit: kvm / amd (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
kvm / intel (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
mshv3 / amd (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
mshv3 / intel (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
hyperv-ws2025 / amd (Windows) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
hyperv-ws2025 / intel (Windows) (❌ 1.59x)Top regressions
Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
Reported by |
| * Load by tag or by the manifest digest returned by `save`. | ||
| * `checked_load` verifies blob digests. `load` skips digest verification. | ||
| Both check format and platform compatibility. Trust the publisher. | ||
| Digests do not prove authenticity. |
There was a problem hiding this comment.
these two lines read like AI and just need alittle clean up I think
| signatures. Use `SandboxBuilder::host_function` for capture and restore. | ||
| * Use the builder for runtime settings such as host functions, log level, and | ||
| mapped files. Scratch size and transport settings come from the snapshot. | ||
| * Loading needs the saved layout, not the original guest binary. |
There was a problem hiding this comment.
After reading the rest of the bullet points here I think we want to make this whole block more readable
| oras cp --to-oci-layout ghcr.io/OWNER/snapshot:v1 ./downloaded-snapshot:v1 | ||
| ``` | ||
|
|
||
| Load `./downloaded-snapshot` with `OciTag::new("v1")?`. |
There was a problem hiding this comment.
maybe you can either give an example or remove this line
jsturtevant
left a comment
There was a problem hiding this comment.
suggested some updates to wording and LGTM. Thanks for documenting this!

Closes #1976