Repository navigation
feat(console): choose a node's backend, and switch an empty one - #386
Merged
Merged
Conversation
Add node offers Auto, gVisor or Firecracker and carries it into the install command. The installer checks the machine first, then runs the node's own checks (`sandstormd preflight`), and refuses before installing anything. An empty node can move backend: POST /v1/nodes/:id/backend has it rewrite its --backend-file and restart. Refused while it holds a sandbox or snapshot. Nodes report the templates their backend can start, the master places a template only on those, and a create can name a backend. The create dialogs show each place's backend. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The unit is an unquoted heredoc, so each backticked word in its comments ran as root during install (`ip netns add`, `runsc start`) and vanished from the unit. Found installing on bare metal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Lets an operator pick a node's backend from the console instead of editing its systemd unit.
Design
Add node. Auto, gVisor or Firecracker, plus optional kernel path and work dir, carried into the install command. The master validates paths before they reach a root shell.
Installer.
SANDSTORM_BACKENDisauto,gvisororfirecracker; unset stays gVisor, so existing scripts keep working. It checks/dev/kvm, the guest kernel and a real reflink probe, then runs the newsandstormd preflight, which makes the same checks a node makes at startup. A refusal says what is missing and installs nothing. Auto prints what it picked and why. Firecracker comes fromSANDSTORM_FIRECRACKER, the PATH, or the release and sha256 pinned insetup-host.sh.Switching. The choice lives in a file (
--backend-file), not the unit's command line, becauseProtectSystem=strictkeeps the node out of/etc.POST /v1/nodes/:id/backendsends aSetBackendcommand; the node preflights, rewrites the file and exits 75 forRestart=on-failure. Refused while the master records any sandbox or snapshot on the node, and again by the node if anything is inbundles/, warm seeds included. Snapshots count too: a tag on a dial-in node is forked on that node, so it would be restored on the wrong engine. The node is out of placement from acceptance until it reports the new engine, or 120 s. The dialog says it will change host group.Templates. Nodes report which templates they can start on their backend. The master places a template only on those; if none can, the create is a 409 naming both forms. Nodes that have not reported are placed on as before.
Create dialogs. "Where" lists each backend with its pools, and each node with its backend. This needed a new optional
backendonPOST /v1/sandboxes: a pool name also matches its#fingerprintgroups, so it cannot pin a backend.Behaviour changes
Also fixes an existing installer bug: backticked words in the unit's comments ran as root during install (
ip netns add,runsc start) and were lost from the unit.Verified
On the bare-metal KVM host, with a real master,
install.sh, systemd unit, runsc and Firecracker v1.17.0, on an XFS loop mount:Tests:
cargo test --allon Linux, 316 passed.cargo clippy -D warningsclean. Console 12 passed, pluspackaging/tests/install_backend.sh; both are added to CI.Not verified
default. Moving groups is covered by the existingrefingerprint_nodetest.🤖 Generated with Claude Code