Repository navigation
Upgrade installations with the installer - #710
Merged
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
SaladDay
force-pushed
the
upgrade-installations-with-the-installer
branch
from
October 15, 2026 06:13
a5f2d62 to
e1eacb2
Compare
oac install --upgrade and install.py --upgrade move an existing installation to the installer's release in place. They stage the new files, check them with oac-core check-config and init against the installation's .env and override, and only then replace oac and compose.yaml and start the services. Without --upgrade, another release is refused before any Docker change; the same release resumes through the start oac apply uses. The release checksum is verified in the stage only, and starts recreate changed containers and remove orphans. node_payload is split into publish and activate so a bundle upgrade keeps earlier releases and moves the active pointer after the checks.
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.
What
Lane B of the in-place upgrade plan: the installers upgrade an existing installation to their own release.
oac install(services/core/cmd/oac)--upgradeflag. An existing directory's release is read from theOAC_REVISION:line of itscompose.yaml.--upgrade. Saved settings, missing-image pulls, then the startoac applyuses (check-config, thenup).--upgrade: refused after the read-only Docker checks, with no Compose call:This installation runs release <old12>; this installer is <new12>. Back up the installation (Upgrade in the operations guide), then rerun with --upgrade.--upgrade:compose.yaml(verified againstcompose-sha256sums.txtin memory) andoacin<dir>.staging.OAC_REVISIONto equalbuildRevision.run --rm --no-deps --entrypoint /usr/local/bin/oac-core core check-config, thenrun --rm --no-deps init, with-f <stage>/compose.yaml [-f <dir>/compose.override.yaml] --project-directory <dir>.oac, thencompose.yaml.Upgrade stopped; the running services are unchanged: <docker output>.Upgraded from <old12> to <new12>. Settings → Sandbox and scheduling offers this release's Runtime; sandboxes keep their current Runtime until you apply it.up -d --wait --wait-timeout 180 --pull never --remove-orphans: fresh installs, upgrades, resumes andoac apply.--no-recreateis gone. Resume callsapplyitself, so the two share one start step.applynow keeps thecheck-configoutput in its error.compose-sha256sums.txtis verified in memory and never written. An upgrade deletes the copy left by an earlier release. The persisted-sums check (verifyCompose) and its test are removed.OAC_REVISIONto equalbuildRevision, because it shares the staging code. The port preflight still runs only for new directories.install.py(deploy/install-source.py)--upgrade, underfcntl.flockon<dir>.lock, the same lock asruntimefs.LockDirectory. Fresh installs take it too.node_payload.publishthe release beside the earlier ones.compose.yaml, the override andoac. The override keeps the operator's JSON and replaces only the four services'imageand Web's/node-payloadbind.node_payload.activate.oac, the override, thencompose.yaml.--upgrade:This installation runs release <old12>; this bundle is <new12>. Back up the installation (Upgrade in the operations guide), then rerun with --upgrade.--public-urlis required only for a new directory.deploy/node/node_payload.pyprepare_node_payloadis split intopublish(destination, source), which leaves the pointer alone, andactivate(destination, revision).activatewrites the pointer 0644, because Web reads it as another user.Docs:
deploy/README.md(installation lifecycle) and thenode_payload.pyrow indeploy/node/README.md.Review
Batched blind review over #710 and #711. Fixed in the third commit:
oac applyruninitbeforecheck-config(apply()inmain.go;install.pyreverses the two checks on its own release). A fresh install whose firstupstopped before init finished could not be resumed, becausecheck-configneeds the secrets init creates.Upgrade stopped; the running services are unchanged, which stays true if init fails after its receipt write.install.pyresumes its own release without--upgrade(This installation runs release <old12>; this bundle is <new12>. … rerun with --upgrade.otherwise), writescompose.override.yaml0600 and removes.staging-*left by a killed run.compose-sha256sums.txtis removed on every existing install, not only in the upgrade branch.docs/configuration.md"How oac apply works" and the rerun sentence indocs/getting-started/install-options.md(EN + zh) match the new start.Accepted: during the preflight the pointer moves under the old Web until
uprecreates it (Add node during that window fails its checksum); Windowsoac.exerenaming over itself on a rerun from inside the directory (install.ps1runs from a temp directory).Interface with Lane A
run.compose.yamllast, matching the published flow, so the revision line always names a fully published release.compose-sha256sums.txt.For Lane C
oac applynow runsup -d --wait --wait-timeout 180 --pull never --remove-orphans(operations.md:20, configuration.md "How oac apply works").install.pyneeds an empty directory.Verification
go test ./services/core/cmd/oac/ -run 'TestInstall|TestApply': pass. New and updated cases:--upgradeorder: pull, stagedcheck-config, staged init, thenup … --remove-orphans. The fixture asserts that staged calls run before publication andupafter it;--upgraderesumes throughapply.go vet ./...: pass.GOOS=windowsandGOOS=darwingo vet ./services/core/cmd/oac/: pass.python3 deploy/test_install_source.py: pass. A new upgrade test checks the following:compose.yaml, the override,.env,oacandactive.jsonbyte-identical;/node-payloadbind, the pointer names the new release and both releases are kept.python3 -m unittest test_generation_review_regressions(deploy/node): pass, including a new publish/activate test.python3 scripts/core-distribution-manifest.test.py(Markdown link guard) andpython3 scripts/check-names.py: pass.Skipped
make checkand the CIcomposesmoke: CI runs the smoke. The upgrade smoke is Lane A's.Need help on this PR? Tag
@codesmith-botwith what you need.