Repository navigation
Share installed components across self-hosted installations - #805
Merged
SaladDay merged 1 commit intoOct 21, 2026
Merged
Conversation
SaladDay
force-pushed
the
share-installed-components-across-self-hosted-installations
branch
from
October 21, 2026 05:29
ed8b43a to
a626dec
Compare
This comment has been minimized.
This comment has been minimized.
SaladDay
force-pushed
the
share-installed-components-across-self-hosted-installations
branch
4 times, most recently
from
October 21, 2026 07:01
5e78c45 to
87bd549
Compare
SaladDay
deleted the
share-installed-components-across-self-hosted-installations
branch
October 21, 2026 07:08
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.
Problem
Every self-hosted installation (one per self_hosted Session) copied node and its Harness into its own
components/, about 560 MiB each: ten Sessions on the mx test machine left 5.4 GB under~/.oac/environments(#802, remaining item 1). The archive cache added in #804 kept another 180–280 MiB of archives only to skip later downloads.Design
All changes stay in the native installer (
oac-daemon install,start,uninstall); Core is unchanged.<Runtime home>/components/<version>/<name>/, one verified copy per component and daemon version per machine. A component is staged in the version directory, checked againstbundle.json, given its receipt, made read-only (files 0400/0500, directories 0500) and renamed into place. Read-only stops accidental changes (for examplenpm i -gagainst the bundled node); all Sessions run as the same account, sostartverifies the components and refuses changed ones.daemon/installation.jsonrecordscomponent_directory;start, verification, the readiness probe and the Harness environment use it. Installations no longer own acomponents/entry. No links.users/<sha256 of the installation directory>holds that directory. Install registers under the store lock; uninstall removes its entry and collects garbage: entries whose directory is gone are dropped, a version with no users is removed (made writable first), stale staging is cleaned. Anything unreadable counts as a user; collection never follows a link out of the store.runtimefs.LockDirectoryon the store, held only for registration, collection and installing missing components. A second installer waits (one line, retry every second, at most 10 minutes) only on the new typedruntimefs.ErrLocked; other lock errors fail at once.native-download/<version>/*.partstays only for Range resume; a verified archive is extracted straight into the store staging (only files listed inbundle.json) and deleted. The archive cache, its reuse and its lock are deleted.installation.jsonrecords.Measurements
Real linux-amd64 archives of
b50d1712, two installations in one Runtime home (du -sbof the home and both installation directories), daemon from main77927d9fbefore and from this branch after:Each further installation adds about 17 MB (its
oac-daemoncopy).mx e2e
Fresh install on mx of
e2e-805-806(main + this PR + #806) from a release-shaped offline archive (950 MiB); README~/.oac/tests/e2e-acceptance-20261020, logslogs/run-pr806/.~/.oac/components/<version>806 MiB once (node 228, codex 320, claude 259) plus~/.oac/environments399 MiB, of which 163 MiB are installation files (17–26 MiB each) and the rest Harness session data. Download only the selected Harness for self-hosted machines #804 on the same run: 5.4 GB underenvironments.native-downloadleft by the previous version were removed by the first install.~/.oac/componentsempty.Tests run
apps/daemon:go test ./internal/cli/... ./internal/runtimefs;go vet ./...;go vetof./internal/cli/...andinternal/runtimefswithGOOS=darwinandGOOS=windows.go test ./services/core/internal/nativeinstaller/...,node --test scripts/build-native-installer.test.mjs.scripts/native-onboarding-smoke.mjslocally against the real archives with a branch-built daemon (store present, no per-installation copy, no archive left, store removed at uninstall). macOS and Windows run in this PR's native jobs.node_moduleshere); the Chinesesource_hashis refreshed.Need help on this PR? Tag
@codesmith-botwith what you need.