Repository navigation
Let install.py resume a failed first install - #716
Merged
Merged
Conversation
A new installation is now assembled in a .staging-* directory inside the installation directory and moved into place after docker compose config accepts it, compose.yaml last. A failure before then removes the stage, and the directory when the run created it, so the same command can be rerun; the next run removes a stage a killed run left. A non-empty directory without compose.yaml is still refused. Failures exit with one line instead of a traceback: distribution and payload errors print their message, a failed command names its step and points at the output above, Ctrl-C asks to rerun, and permission errors name the path with the sudo chown command that returns it. A same-release resume check no longer says "Upgrade stopped". The bundle modules are imported from the script's own directory, so the unused --bundle-dir flag is removed.
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
install.py(the offline bundle's installer,deploy/install-source.py):.staging-*directory inside the installation directory (node payload,.env,oac, both Compose files). Oncedocker compose configaccepts it, the files move into place, withcompose.yamllast. If the run fails before that, the stage is removed, and so is the directory when this run created it. A stage left by a killed run is removed by the next run, the same way upgrade stages already are. A non-empty directory withoutcompose.yamlis still refused (Incomplete installation: preserve … and choose another directory).DistributionErrorandPayloadErrorexit with their message. A failed command prints<step> failed; see the output aboveplus what happened to the installation, not theCalledProcessErrorargument tuple. Ctrl-C printsInterrupted; rerun the same command to continue.OtherOSErrors print<reason>: <path>without[Errno N]. An invalid--hostis now an argparse error.<path> is not writable by this account; if an earlier run used sudo, return it with: sudo chown -R "$(id -un)" <path>. A path inside the installation is widened to the installation directory. A path that could not be created names its parent, e.g. a root-owned~/.oac.Data volume check failed; no service was changed. See the output above.(orConfiguration check failed; …), matchingoac apply's wording in the operations troubleshooting table. Only real upgrades sayUpgrade stopped; the running services are unchanged. <step> failed; see the output above., and that keeps the phraseoperations.mdquotes.--bundle-diris removed. It had no caller. The bundle modules are now imported from the script's own directory, so their error classes can be caught by name, and a separate bundle directory would mix code and data from two bundles.docs/development.md(EN + zh,source_hashrefreshed) drops the "remove that incomplete directory and retry" advice.deploy/README.mddescribes how the bundle installer stages a new installation.Why
Installer polish audit (
audit-core.md):.envandnode-payload/, and the rerun refused the directory as incomplete. Bundle errors printed tracebacks, and failed commands printed the rawCalledProcessError.~/.oac/<dir>.lockfrom an earlier sudo run gave[Errno 13] Permission denied.All of these were reproduced on
mainbefore the change with a real bundle layout (install.pybesidedistribution.py/node_payload.py) against Docker.Verification
python3 deploy/test_install_source.py: 7 tests pass. New or extended tests cover: a config failure leaves no directory and the rerun succeeds, also after a killed run's stage; a same-release resume failure message; the upgrade failure message; a bundle checksum error, Ctrl-C (directory removed) and a denied lock, each exiting with one line.dockerwrapper that refusesup/run, so no container or volume was created. Checked: broken template → one-line message and nothing left; the rerun with a valid template passesconfigin the stage and commits (modes 0600/0700/0755, the bind points at the finalnode-payload,docker compose configOK in the installation); resume →Data volume check failed; no service was changed…; SIGINT → message and nothing left; checksum error → one line; denied lock, unwritable parent and unreadable file in the installation → chown messages naming the lock, the parent and the installation directory.node --test website/tests/translations.test.mjs(website deps installed): 3/3 pass.python3 scripts/check-names.py: passed.Skipped
make checkandmake check-distribution(focused checks only). The rest of the website suite needspnpm buildand was not run; this change adds no links.upwith the bundle images. The start path and its arguments are unchanged.Need help on this PR? Tag
@codesmith-botwith what you need.