Skip to content

feat(view): add per-container snapshot views for boot artifacts#639

Draft
sidneychang wants to merge 3 commits into
urunc-dev:mainfrom
sidneychang:feat/per-container-view-reliable
Draft

feat(view): add per-container snapshot views for boot artifacts#639
sidneychang wants to merge 3 commits into
urunc-dev:mainfrom
sidneychang:feat/per-container-view-reliable

Conversation

@sidneychang
Copy link
Copy Markdown
Contributor

@sidneychang sidneychang commented May 7, 2026

Description

Add a shim-managed per-container snapshot-view path for block-backed rootfs setups so urunc can reuse a prepared read-only view of the container image when retrieving boot artifacts.

The shim now wraps task Create/Delete to prepare a snapshot view ahead of container startup, persist the view metadata and mounts into the bundle, and clean up the containerd view and lease during deletion. On the runtime side, unikontainers consume that shim-written state to bind the unikernel binary, initrd, and urunc.json from the prepared view into the monitor rootfs, while keeping the legacy extraction path as a fallback when no per-container view is available.

The PR also documents the new com.urunc.unikernel.snapshotView runtime annotation and its interaction with mountRootfs for supported block snapshotters.

Related issues

How was this tested?

LLM usage

Codex

Checklist

  • I have read the contribution guide.
  • The linter passes locally (make lint).
  • The e2e tests of at least one tool pass locally (make test_ctr, make test_nerdctl, make test_docker, make test_crictl).
  • If LLMs were used: I have read the llm policy.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 7, 2026

Deploy Preview for urunc ready!

Name Link
🔨 Latest commit af30554
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/69fc9fba6b574d000846b257
😎 Deploy Preview https://deploy-preview-639--urunc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Wrap the containerd task service so snapshot views are prepared
before Create and cleaned up after Delete.

Persist bundle state with the view key, lease, and mounts so the
runtime can reuse the prepared view without dialing containerd again.

Resolve snapshot parents to committed layers and gate the feature
through runtime annotations and mountRootfs metadata.

Signed-off-by: sidneychang <2190206983@qq.com>
Load shim-written snapshot view state from the bundle and mount the
read-only view when extracting boot artifacts for block-backed guests.

Bind kernel, initrd, and urunc.json from the prepared view into the
monitor rootfs, while keeping the existing block extraction path as the
fallback when no per-container view is available.

Add the snapshotView annotation to unikernel config parsing and log the
selected rootfs configuration for debugging.

Signed-off-by: sidneychang <2190206983@qq.com>
Document the snapshotView annotation in both the package overview and
rootfs guide.

Explain how to enable the feature from config.json or urunc.json and
clarify that it is used together with mountRootfs on supported
block-based snapshotters.

Signed-off-by: sidneychang <2190206983@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use a RO snapshot of container to retrieve unikernel binary

1 participant