Repository navigation
Upgrade the installation volume in init - #711
Merged
Merged
Conversation
Init now upgrades a volume from an older release in place: it verifies the receipt, refuses a release that is not newer by the node manifest's new source_time, publishes its own release beside the old ones, keeps the secrets and installation ID, and writes the receipt as the single commit point. The receipt lists every retained release and no longer pins active.json; init rewrites the pointer from the receipt on every start, so a crash between the two heals. Receipts from v0.0.10 and v0.0.11 upgrade without special code. Core refuses a database schema newer than its migrations. Web computes the node installer digest per request from the active release. The Compose smoke builds the checkout's node metadata instead of downloading the v0.0.3 archive, and upgrades a published v0.0.11 installation in place to the checkout.
This was referenced Oct 15, 2026
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 A of in-place upgrades: the volume and schema side, plus a CI upgrade smoke.
oac init(services/core/cmd/oac/init.go) upgrades an existing volume in place. On an existing receipt it verifies every listed file, then:active.jsonfrom the receipt, syncs the Core key digest, done (no fetch, no copy);source_timefrom the installed release's receipt-verifiedmanifest.json(absent = 0) and refuses unless its own is newer;node-payload/releases/<own>/, keeps the old releases, keeps existing secrets and the installation ID;active.jsonis no longer in the receipt; init writes it after the receipt and on every start, so a crash between the two heals.active.json: it is verified once and dropped because the new receipt keeps onlynode-payload/releases/*from the old one. No special case.services/core/migrations/migrations.go) refuses a schema version above its embedded maximum afterUp. No goose Down.source_time(the build's existingsource_epoch, Unix seconds).node-install.pyzfrom the bootstraps builder, the repo's seccomp profile) instead of downloading the 384 MB v0.0.3 archive, and adds an upgrade phase: start v0.0.11 from its publishedcompose.yaml(pinned by tag and SHA-256,OAC_IMAGE_*unset), seed a Project, Project key and file, run the installer preflight with the checkout's images (core check-config, theninit),up -d --wait --pull never --remove-orphans, and assert that the installation ID, Core key, Project, Project key and file survive, that Core and/node-install/manifest.jsonreport the checkout's commit, and that the schema is at the latest migration.source_hashrefreshed): smoke description, manifestsource_time, and two release-checklist lines (protocol bumps with operator actions in the release notes; bump the smoke pin after publishing).Messages
This installation runs release <installed12> (<YYYY-MM-DD HH:MM UTC>); this release, <own12> (<YYYY-MM-DD HH:MM UTC>), is not newer. Downgrades are not supported: run that release or a newer one, or restore the backup taken before the upgrade.installation receipt names release <installed12>, whose node metadata is missing; restore the matching data directoryAgents API database schema version N is newer than this Core supports (M). Downgrades are not supported: run the release that upgraded this database or a newer one, or restore the backup taken before the upgrade.(Core prefixes its startup error withAgents API database migration failed:.)Interface for Lane B (installers)
docker compose -f <stage>/compose.yaml [-f <dir>/compose.override.yaml] --project-directory <dir> run --rm --no-deps --entrypoint /usr/local/bin/oac-core core check-config, then... run --rm --no-deps init. The smoke runs exactly these two commands against the v0.0.11 volume.TestInitializeRefusesAnOlderRelease). The message is in init's structured log lineInitialization failed(errorfield) on the container output;oac initdoes not print errors separately, so the installer should show therunoutput when it refuses.upruns init again and it only verifies.node-payload. The bundle's hostnode-payload(Web's bind) stays B'spublish/activate.Verification
go test ./services/core/cmd/oac -count=1: pass (newTestInitializeUpgradesAnOlderInstallationInPlace,TestInitializeRefusesAnOlderRelease; the "another release" case is removed with its refusal).go test ./services/core/migrations -count=1 -vwithOAC_TEST_DATABASE_URLon a local Postgres 16:TestApplyRefusesANewerSchemapass.go test ./services/web -count=1 -run 'Retained|Console|Paired|Offline': pass (the digest followsactive.jsonwithout a restart).python3 scripts/core-distribution-manifest.test.py: 23 tests pass (source_timein the node and bundle manifests).go vet ./...(module-wide): clean.python3 scripts/core-distribution-manifest.test.py BundledDocsTests(repo Markdown link guard),node --test website/tests/translations.test.mjs,python3 scripts/check-names.py: pass.python3 scripts/compose-smoke.pylocally on amd64: pass in 2m56s, both phases. This host's Docker daemon has no registry DNS, so the v0.0.11 images were preloaded by digest through crane and the images were built with a proxy-enabled buildx builder; CI pulls them directly.Review
Batched blind review over #710 and #711. The finding for this PR (raw
open …error for a missing installed release; refusal text claiming "newer" on equalsource_time) is fixed in the second commit.Skipped
make check(focused checks only).Need help on this PR? Tag
@codesmith-botwith what you need.