Repository navigation
fix(homeboy): keep Homeboy's data root on the workspace volume (#710) - #712
Merged
Merged
Conversation
Resolve HOMEBOY_DATA_DIR=<workspace>/.homeboy when a workspace root is configured (operator value wins) and render it into the homeboy-daemon, Roadie, and datamachine-worker units. Setup and upgrade move an existing ~/.local/share/homeboy before any unit renders the variable: stop the idle daemon, refuse if homeboy.sqlite is still open, rsync, verify integrity_check, replace the legacy path with a symlink. Non-root, dry-run, busy daemon, or an already-populated target defer the move and clear the variable for that run, so no unit points at an empty store. Already-migrated hosts are a no-op. Isolate bridge-render and homeboy-daemon tests from an operator shell that already exports HOMEBOY_DATA_DIR.
The inline ${HOMEBOY_DATA_DIR:+...} expansion left an empty line in the
worker and daemon units when no workspace data root is set, drifting the
datamachine-worker snapshot. Append it to the HOME line through a
common.sh helper that emits nothing when unset.
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 #710.
What
source_policy_resolve_homeboy_data_dir: when a workspace root is configured,HOMEBOY_DATA_DIR=<workspace>/.homeboy. An operator-set value wins, and with no workspace nothing changes.homeboy-daemon, Roadie, anddatamachine-workerunits renderEnvironment=HOMEBOY_DATA_DIR=…when it is set.homeboy_data_dir_migrateruns in setup and upgrade once the service identity is final and before any unit renders:homeboy.sqliteis still open, copies withrsync -aHAX, verifiesPRAGMA integrity_check, deletes the legacy dir and leaves a symlink at~/.local/share/homeboy.bridge-render.shandhomeboy-daemon-service.shnow unset an operator-exportedHOMEBOY_DATA_DIRso snapshots don't drift.Why
On the extrachill host, Homeboy's 24 GB data root was on
/next to WordPress/MySQL while a dedicated 200 GB workspace volume sat beside it. A runtime-tmp leak (Extra-Chill/homeboy#15724) pushed/under Homeboy's capacity reserve and every Cook failed. That host was migrated by hand with exactly this layout (drop-ins + symlink), so the upgrade path is idempotent there.Verification
tests/homeboy-daemon-service.sh,tests/bridge-render.sh,escaping-helpers,dead-mechanism,duplicate-mechanism,privilege-grants,homeboy-service-identity,homeboy-components,plist-rendering: all pass locally.bash -npasses on every touched script.Notes
set -ein setup/upgrade that would have aborted every host without a workspace. Fixed here and covered by a test.Drafted by Homeboy Cook (opencode), then the migration, the
set -efix, and the tests were finished by Extra Chill Bot directly on the controller.