fix: add built-in cached rootfs export and import workflow#2
Merged
Conversation
Add a first-class rootfs cache workflow so users can prebuild a rootfs once, package it, host it externally, and reuse it for fast first-time startup with cached_rootfs. Introduce new CLI commands: - enclave rootfs export --suite <suite> --output <archive> - enclave rootfs import --suite <suite> <archive> - enclave rootfs fetch --suite <suite> <url> These commands let users export an existing cached rootfs, import a local archive into the Enclave cache, or fetch a hosted archive directly with curl and import it in one step. Make the new rootfs commands respect configured state_dir defaults so project-level config continues to work consistently without extra flags. Document the GitHub-hosted rootfs workflow in the README and command reference so the intended Docker-like fast-path is discoverable: build once, publish archive, fetch into cache, then use bootstrap_method = cached_rootfs. Add parser and helper tests for rootfs command arguments, cache target resolution, gzip archive detection, archive layout detection, and top-level help visibility. Verification: - cargo test --all-targets -- --skip integration:: --skip stress:: - cargo clippy --all-targets -- -D warnings - direct smoke test covering rootfs export, local import, HTTP-hosted fetch, and restored cache contents
Update the README, command reference, and Enclavefile reference to point at the real published bookworm cached rootfs release asset so users can copy a working rootfs fetch URL immediately.
Add an Unreleased changelog entry summarizing the new rootfs export/import/fetch workflow, the networking startup hardening, runtime-path fixes, registry repair behavior, and the daemon/config UX improvements shipped alongside them.
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.
Summary
This PR adds a built-in workflow for distributing and reusing prebuilt cached rootfs archives.
Instead of telling users to manually copy directories around the Enclave state dir, Enclave now provides first-class commands to:
This is aimed at making first-time
enclave upmuch faster when usingbootstrap_method = "cached_rootfs", especially for teams that want to publish a prepared base rootfs through GitHub Releases or another artifact host.What Changed
New
rootfscommand groupAdded a new top-level command family:
rootfs exportPackages an existing cached rootfs into a tar or tar.gz archive suitable for publishing or sharing.
rootfs importImports a local archive into Enclave's cache layout under:
<state_dir>/sandboxes/rootfs-cache/<suite><state_dir>/sandboxes/rootfs-cache/baserootfs fetchDownloads an archive with
curland immediately imports it into the cache.This is the user-facing fast path for a GitHub-hosted rootfs archive workflow:
enclave rootfs fetch ...on developer machinescached_rootfsduringenclave upReal Published Example
A cleaned
bookwormrootfs archive has already been published as a GitHub Release asset:https://github.com/ayomidelog/enclave/releases/tag/rootfs-bookworm-2026-06-07That makes the intended workflow concrete and immediately testable.
UX Impact
Before this change, using a prebuilt cached rootfs still required manual file placement under the Enclave state dir.
After this change, the intended user flow is:
enclave rootfs export ...enclave rootfs fetch ...bootstrap_method = "cached_rootfs"enclave upThat reduces Linux-specific manual setup and makes fast first-time startup much more approachable.
Configuration Behavior
The new rootfs commands also respect configured
state_dirdefaults, so project-level configuration continues to work consistently without forcing users to repeat--state-direverywhere.Documentation
Updated:
README.mddocs/commands.mddocs/enclavefile.mdThe docs now describe the GitHub-hosted rootfs workflow explicitly and include the real published release URL.
Tests Added / Updated
Added coverage for:
rootfs exportandrootfs fetchVerification
Build and static checks
cargo clippy --all-targets -- -D warningsTest suite
cargo test --all-targets -- --skip integration:: --skip stress::Direct smoke test
Verified the full rootfs artifact flow end to end:
bookwormrootfs archiveenclave rootfs fetchWhy This Matters
The motivation here is to make Enclave feel closer to a prebuilt-image workflow for first-time startup.
debootstrapis still useful for building a trusted base when needed, but users who want Docker-like first-run speed should be able to:This PR provides that path directly in the CLI.