Summary
The Snapshot REST response (POST /sandboxes/{id}/snapshots, GET /snapshots/{id}, GET /snapshots) does not include the resulting OCI image reference. The server already computes and stores it internally (SnapshotRecord.restore_config.image) but only uses it to resolve same-server snapshotId restores. We'd like it exposed in the API so a client can restore a snapshot on a different server / runtime via image.
Use case
We're building an internal developer-sandbox platform (~800 engineers) where a sandbox can run on a local Docker-runtime server (laptop) or a cloud Kubernetes server (batchsandbox provider), and we want to move a running sandbox between them in both directions, transporting state as an OCI image through a shared registry:
- local → cloud works: the docker snapshot image ref is deterministic (
opensandbox-snapshots:<id>), so we tag + push it and create the cloud sandbox from that image.
- cloud → local is blocked: the commit Job pushes the snapshot image to the configured registry and records the ref in
SandboxSnapshot.status.containers[].imageUri (→ the server's restore_config.image), but the server API never returns it. And snapshotId restore only works on the same server (per-server snapshot store), so a cross-server restore must use the image ref — which we can't obtain via the API.
Our only current options are (a) read the SandboxSnapshot CR directly via the k8s API (couples the client to provider/CR internals), or (b) derive the ref by naming convention (fragile). Both are workarounds for a value the server already holds.
Proposal
Add the restore image reference to the Snapshot schema (e.g. imageUri / restoreImage), populated once the snapshot is Ready from restore_config.image:
- docker runtime →
opensandbox-snapshots:<id> (or its pushed registry ref),
- kubernetes runtime → the
status.containers[].imageUri pushed by the commit Job.
Optionally per-container refs and/or an explicit "exported to registry" indicator.
References
Happy to send a PR.
Summary
The
SnapshotREST response (POST /sandboxes/{id}/snapshots,GET /snapshots/{id},GET /snapshots) does not include the resulting OCI image reference. The server already computes and stores it internally (SnapshotRecord.restore_config.image) but only uses it to resolve same-serversnapshotIdrestores. We'd like it exposed in the API so a client can restore a snapshot on a different server / runtime viaimage.Use case
We're building an internal developer-sandbox platform (~800 engineers) where a sandbox can run on a local Docker-runtime server (laptop) or a cloud Kubernetes server (
batchsandboxprovider), and we want to move a running sandbox between them in both directions, transporting state as an OCI image through a shared registry:opensandbox-snapshots:<id>), so we tag + push it and create the cloud sandbox from thatimage.SandboxSnapshot.status.containers[].imageUri(→ the server'srestore_config.image), but the server API never returns it. AndsnapshotIdrestore only works on the same server (per-server snapshot store), so a cross-server restore must use the image ref — which we can't obtain via the API.Our only current options are (a) read the
SandboxSnapshotCR directly via the k8s API (couples the client to provider/CR internals), or (b) derive the ref by naming convention (fragile). Both are workarounds for a value the server already holds.Proposal
Add the restore image reference to the
Snapshotschema (e.g.imageUri/restoreImage), populated once the snapshot is Ready fromrestore_config.image:opensandbox-snapshots:<id>(or its pushed registry ref),status.containers[].imageUripushed by the commit Job.Optionally per-container refs and/or an explicit "exported to registry" indicator.
References
server/opensandbox_server/api/schema.py—Snapshotmodel (no image field today)server/opensandbox_server/services/snapshot_models.py—SnapshotRestoreConfig.imageserver/opensandbox_server/services/snapshot_restore.py—resolve_sandbox_image_from_request(internal use of the ref)server/opensandbox_server/services/k8s/snapshot_runtime.py—_select_restore_imageHappy to send a PR.