Skip to main content
Version: 0.16.0

Upgrading

Upgrading Yoke replaces its programs and units with a newer release's, and keeps everything else: your configuration, the install root and what it holds, every instance's state. It happens in three moments — stop and copy, replace, start again — and only the middle one depends on how you install.

1. Stop, and copy​

A newer Core brings an instance's state to its own schema the first time it starts it, and the step does not run backwards: a store written by the newer Core is refused by the older one, naming both numbers. So stop what runs, so that nothing is executing the programs being replaced, and copy what you would want to go back to (copying an instance).

Note which instances run, stop each, and copy each — a copy is taken of a stopped instance, into a path that does not exist yet:

yoke instance list
bench-a com.example.station 2.1.0 observable
bench-b com.example.station 2.1.0 stopped
yoke instance stop bench-a
mkdir -p ~/yoke-backup
yoke instance copy bench-a ~/yoke-backup/bench-a

When the last instance stops, the account's guardian exits, so nothing of the old installation is left running.

2. Replace​

The command that installed Yoke, with --upgrade, obtains the newest release, checks it and replaces the programs and the guardian's unit. It refuses while an instance of this account is running, and leaves manager.conf as it is:

curl --proto '=https' --tlsv1.2 -sSfL https://github.com/yoke-project/yoke/releases/latest/download/yoke-install.sh | sh -s -- --install account --upgrade
checking against the digests published with 0.16.0
downloading yoke-0.16.0-linux-amd64.tar.gz
downloading yoke-conformance-0.16.0-linux-amd64.tar.gz
kept /home/you/yoke-release/yoke-0.16.0-linux-amd64.tar.gz, checked
kept /home/you/yoke-release/yoke-conformance-0.16.0-linux-amd64.tar.gz, checked
installed yoke yoke-core yoke-guardian yoke-auth yoke-compose in /home/you/.local/bin
kept /home/you/.config/yoke/manager.conf as it is
installed the guardian's user unit in /home/you/.config/systemd/user

Yoke 0.16.0 for amd64 is in /home/you/yoke-release.
Upgraded for this account. Start again each instance you stopped: yoke instance start <name>

Without --upgrade, the script refuses to replace a program that differs, naming it, so an installation is never replaced by a run that did not mean to. --version names a release other than the newest.

3. Start again​

Start again each instance you stopped, and check that it comes up:

yoke instance start bench-a
yoke instance list
bench-a com.example.station 2.1.0 observable
bench-b com.example.station 2.1.0 stopped

To go back, install the earlier release the same way, with its version, and restore the copy into an instance before starting it: yoke instance restore ~/yoke-backup/bench-a bench-a. A store the newer Core has written cannot be read by the older one; the copy is what makes going back possible.