Support OCI bundles containing multiple independently restorable snapshots
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 45/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- rust
- Bereich
- infrastructure
Rechercherichtung
Start with Snapshot::load and Snapshot::save, focusing on resolution through the OCI layout's root index.json. Trace how a tagged descriptor is selected and how manifests and blobs are loaded. Done means a tagged bundle can contain independently restorable loaded-state and runtime-ready-baseline snapshots, selected by role, with standard OCI traversal preserving both.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Problem
hyperlight-js needs two hyperlight snapshots to persist a LoadedJSSandbox:
- Loaded state: the JavaScript runtime with user modules and handlers registered, including mutable JavaScript state produced by
handle_event()calls. - Runtime-ready baseline: the state captured immediately after loading the JavaScript runtime, before registering user modules or handlers.
JSSandbox::get_loaded_sandbox() carries the runtime-ready baseline into the resulting LoadedJSSandbox. Later, LoadedJSSandbox::unload() restores that baseline to discard registered guest code and mutable module state and return a JSSandbox.
A typical lifecycle is:
let mut sandbox = builder.build()?.load_runtime()?;
sandbox.add_module("counter", module)?;
sandbox.add_handler("handler", handler)?;
let mut loaded = sandbox.get_loaded_sandbox()?;
loaded.handle_event("handler", event, None)?;
let snapshot = loaded.snapshot()?;
snapshot.save(path, "application-ready")?;
// In another process:
let snapshot = Snapshot::load(path, "application-ready")?;
let loaded = builder
.build_from_snapshot(snapshot)?
.restore_loaded_sandbox()?;
let sandbox = loaded.unload()?; // Requires the runtime-ready baseline.
hyperlight-js currently saves the loaded state and runtime-ready baseline as independent top-level OCI manifests. The loaded-state config records the baseline manifest digest in application metadata.
That relationship is not visible through OCI descriptors:
- Copying only the application-ready tag may omit the baseline manifest and config.
- OCI garbage collection cannot infer that both manifests form one logical artifact.
- The copied hyperlight-js snapshot cannot be loaded because hyperlight-js eagerly resolves the baseline manifest.
- If baseline loading became lazy,
LoadedJSSandbox::unload()would still fail when the baseline was absent.
Relationship to incremental snapshots
HIP 0003 / #1823 proposes that each incremental snapshot manifest directly reference every memory blob needed to restore that state.
That solves inherited memory-blob reachability for one Hyperlight snapshot. It does not preserve a second independently restorable state.
The loaded-state manifest may reference memory blobs shared with the runtime-ready baseline, but it does not preserve the baseline’s manifest, config, or semantic role. The HIP intentionally does not retain parent snapshot references.
This request concerns bundling multiple independently restorable snapshots, not representing the internal memory layers of one incremental snapshot.
Current limitation
Snapshot::load resolves a tag or digest only among descriptors directly present in the layout’s root index.json.
The selected descriptor must have media type application/vnd.oci.image.manifest.v1+json. A tagged nested image index containing multiple related snapshot manifests is therefore rejected.
Required Capability
Provide a supported way to represent multiple independently restorable Hyperlight snapshots as one strongly linked OCI artifact.
One possible representation is a tagged OCI image index:
index.json
└── application-ready bundle index
├── loaded-state manifest
└── runtime-ready-baseline manifest
Each child descriptor would carry an explicit application-defined role annotation. Standard OCI tooling could then discover and copy every required manifest and blob by traversing the tagged index.
OCI subject is not sufficient because it defines a weak association with a separate DAG rather than containment within one artifact.
Possible API
- Native snapshot-bundle save/load APIs.
- Bundle loading resolves a tagged image index and selects children by role.
let bundle = SnapshotBundle::load(path, "application-ready")?;
let loaded = bundle.snapshot("loaded-state")?;
let baseline = bundle.snapshot("runtime-ready-baseline")?;
- Vorherrschende Sprache
- Rust
- Sterne
- 4.8k
- Forks
- 222
- Ø Merge
- 1 T. 16 Std.
- Gemergte PRs (30 T.)
- 60
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus hyperlight-dev/hyperlight
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 75/100
hyperlight-dev/hyperlight#2089 ·
Maintainer antworten meist innerhalb von 1 Tag
-
S-needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
hyperlight-dev/hyperlight#2073 ·
Maintainer antworten meist innerhalb von 1 Tag
-
C-bug S-needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
hyperlight-dev/hyperlight#2056 ·
Maintainer antworten meist innerhalb von 1 Tag
-
A-docs C-bug S-needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
hyperlight-dev/hyperlight#2027 ·
Maintainer antworten meist innerhalb von 1 Tag
-
S-needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
hyperlight-dev/hyperlight#1970 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in hyperlight-dev/hyperlight
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 86/100
-
tests
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
vfarcic/dot-agent-deck#2512 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
pop-os/cosmic-applets#1641 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
pop-os/cosmic-store#650 ·