Expand description
choir node upgrade — newer binaries into the place the unit runs
them from, a restart, and the running node’s own word that it took.
Deploying used to be five commands retyped over ssh, and the product
half of them is the half that happens on the node host: get the
binaries, put them where the service manager’s unit points, restart,
and read the build stamp back from the daemon rather than trusting
that the restart did anything. That half is this command. The ssh
hop that types it stays outside choir, because a hostname and an
identity are the operator’s private layout, and nothing in this
binary ever runs ssh.
§Two sources
| you have | run | what happens |
|---|---|---|
| a node with a shelf | choir node upgrade --from https://<node> | its install.sh, into the directory this choir lives in |
| a checkout | choir node upgrade --source <dir> | cargo build --release there, then the four binaries copied over |
Either way the copy is a rename over the old file, so a running daemon keeps the inode it was started from until the restart, and a build that fails leaves the old binaries where they were.
§Examples
use choir_cli::upgrade::stamp_of;
// `choir --version` prints the build line; the stamp is its commit.
assert_eq!(
stamp_of("choir build 0123456789ab (stamp source: git)"),
Some("0123456789ab".to_string())
);
assert_eq!(stamp_of("choir build unknown (stamp source: none)"), None);Structs§
- Options
- What
choir node upgradewas asked to do.
Enums§
- Source
- Where the newer binaries come from.
Constants§
- BINARIES
- The binaries a release ships, and the ones a checkout builds.
Functions§
- build
- Builds the two packages in a checkout with the stamp set from its HEAD, and returns the release directory.
- cargo_
home_ for - The directory the installer will fill, for a shelf source.
- install_
from_ shelf - Runs a node’s installer for both packages, into
cargo_home/bin. - parse
- Parses
choir node upgrade’s arguments. - place
- Copies each binary a build produced over the installed one, by rename, so a running process keeps its inode and a copy cut short leaves the old binary in place.
- stamp_
of - The commit a
choir --versionline names, orNonefor an unstamped build. - version_
of - What a
choirbinary says it is: the whole line, and its commit.