feat(setup): appliance mode — baked deps, /run units, GRUB skip (pithead#797 R1) - #330
Open
VijitSingh97 wants to merge 1 commit into
Open
feat(setup): appliance mode — baked deps, /run units, GRUB skip (pithead#797 R1)#330VijitSingh97 wants to merge 1 commit into
VijitSingh97 wants to merge 1 commit into
Conversation
…ead#797 R1) One opt-in env flag, RIGFORGE_APPLIANCE=1, for running setup on the Pithead appliance image: read-only root, volatile /etc overlay, and a boot leg that re-runs setup every boot instead of relying on persisted state. Under the flag: - dependencies are verified (command -v), never installed — a missing tool fails loudly naming the image-build gap; a prebuilt tree needs envsubst only (the R0 bench re-ran from cache with a half-broken compiler) - the GRUB leg takes the skip branch deliberately: the kernel cmdline, incl. any 1GB-hugepage reservation, is image-owned - units render into /run/systemd/system (SYSTEMD_DIR preset) and enable with systemctl enable --runtime - hugetlbfs mounts at runtime; no fstab or limits.conf appends (the unit already sets LimitMEMLOCK=infinity) - runtime tuning unchanged: modprobe msr, grow-only HugePages sysctl (#328), performance governor setup --dry-run previews the same decisions through the shared helpers, never a second copy. Every decision was proven on the pithead#797 R0 bench. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5 tasks
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.
Phase R1 of pithead#797 (master installer image): an opt-in appliance mode so
setupruns correctly on the Pithead appliance image — read-only root, volatile/etcoverlay, and a boot leg that re-runs setup every boot. Every decision below was proven on the R0 bench recon (pithead#797, R0 comment), not predicted.The flag
RIGFORGE_APPLIANCE=1— an env flag, not a config.json key. The caller is the image's boot path (not the operator), and the mode is a preset bundle over the existing env-overridable system-path seams (SYSTEMD_DIR,GRUB_DEFAULT,FSTAB, …) — the same surface R0 drove by hand withGRUB_DEFAULT=/nonexistent. Unset, nothing changes anywhere.What the flag changes
command -vand fails naming missing tools (toolchain is baked at image build). A prebuilt tree needsenvsubstonly: the every-boot re-run keeps mining without a compiler, as the bench showed.update-grub, reboot/etc/systemd/system,enable/run/systemd/system(SYSTEMD_DIR preset),enable --runtime— for the xmrig unit and every optional unit (autotune/watchdog/api/control).modules-load.d/msr.confdrop-inmodprobe msronly — setup re-runs each boot, so a boot-time drop-in is persistence machinery for a layer the box doesn't have (smaller than writing/run/modules-load.d, same effect).mount -amountcalls only (idempotent viamountpoint -q)LimitMEMLOCK=infinitysetup --dry-runpreviews the appliance decisions with the same logic (shared_missing_appliance_tools, same flag checks) — never a second copy; the existing main()-steps drift guard also runs against the appliance plan.Drive-by:
_miner_held_hugepagescollapsed to a single awk statement (behaviorally identical; landed via the format pass).Tests
tests/run.sh: 1563 passed, 0 failed (+61 assertions in a new appliance suite): preset/override semantics, dep check pass/fail/prebuilt arms, GRUB-skip with a present+writable GRUB file, no modules-load drop-in with a present drop-in dir, runtime mounts with fstab/limits untouched,enable --runtime, dry-run parity incl. the main()-steps drift guard, and a full black-box setup run under the flag.make lint(ShellCheck + shfmt) andmake lint-mdclean.What only the bench can verify (next bench session)
systemctl enable --runtimeend-to-end on the real appliance: unit + wants symlink in/run, miner up after a boot-leg re-run.mount -t hugetlbfson the appliance (R0 used the fstab path; the direct-mount calls are new).command -vcheck (R0's rw-remount install leftccresolution broken — the check should catch exactly that).local_miner.enabled); this PR keeps the tune_kernel's runtime HugePages write shrinks another consumer's pool — reserve grow-only #328 grow-only behavior only.🤖 Generated with Claude Code