Skip to main content

Module upgrade

Module upgrade 

Source
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 haverunwhat happens
a node with a shelfchoir node upgrade --from https://<node>its install.sh, into the directory this choir lives in
a checkoutchoir 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 upgrade was 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 --version line names, or None for an unstamped build.
version_of
What a choir binary says it is: the whole line, and its commit.