Repository navigation
backend: auto picks the engine, once per sandbox (#29) - #51
Merged
Merged
Conversation
New Boxfiles say backend: auto. box picks firecracker when it fits -- the Boxfile is offline, has no host mounts, no warm pool and no forks, and the host can run it -- because its VMM holds no capabilities; podman otherwise. The pick and its reason are recorded with the sandbox and shown by box inspect; box doctor says what auto picks on this host. The pick sticks: firecracker keeps /data as a disk and podman as a directory, so a sandbox that changed engine would lose sight of its data. A Boxfile change the recorded engine cannot serve switches only while /data is empty; otherwise box stops and says how to move the data. An explicit backend always wins, and a Boxfile without the key keeps podman, so existing sandboxes never move. Firecracker's limits live in one place, boxfile.FirecrackerFits, used by both validation and auto. box fork on a firecracker sandbox now refuses up front and says why, rather than failing at the first run. Fixed on the way: box reset did not reset a firecracker sandbox -- it emptied the /data directory, but firecracker's /data is a disk, which survived. It now deletes the disk; the next boot makes an empty one. And box inspect created a missing firecracker disk while reporting on it; it only reads now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #29. Part of the v0.5 milestone.
New Boxfiles say
backend: auto: box picks the engine so users don't have to.How it picks
network: none), has no host mounts, no warm pool and no forks, and the host can run it (x86_64 Linux, KVM, vhost-vsock). Its VMM holds no capabilities at all.box inspectshowsbackend chosen by backend: auto (…reason…);box doctorshows what auto picks on this host.Why the pick sticks
firecracker keeps
/dataas a disk, podman as a directory. A sandbox that silently changed engine would lose sight of its data, so:box data export,box reset,box build,box data import);backend:always wins, and a Boxfile without the key keeps podman, so existing sandboxes never move.Firecracker's limits now live in one function,
boxfile.FirecrackerFits, used by validation and by auto, so the two cannot disagree.Also
box forkon a firecracker sandbox refuses up front with the reason and the way out, instead of failing at the first run.box resetdid not reset a firecracker sandbox. It emptied the/datadirectory, but firecracker's/datais a disk, which survived. It now deletes the disk; the next boot makes an empty one.box inspectcreated a missing firecracker disk while reporting on it (throughfcDataDisk). It only reads now.Tests
box reseton firecracker really empties /data;box doctorreports the auto choice.