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).
- For your account
- For the whole host
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.
Stop the service form, and copy what it keeps — the deployment's stores are at fixed paths:
sudo yoke service stop
mkdir -p ~/yoke-backup
sudo cp -a /var/lib/yoke/registry.db /var/lib/yoke/logs.db ~/yoke-backup/
Every account that runs instances does what For your account says, as itself: an account's
instances execute the host's /usr/bin/yoke-core too.
2. Replace
- For your account
- For the whole host
- With the script
- By hand
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 -sSf https://github.com/yoke-project/yoke/releases/latest/download/yoke-install.sh | sh -s -- --install account --upgrade
checking against the digests published with 0.13.0
downloading yoke-0.13.0-linux-amd64.tar.gz
downloading yoke-conformance-0.13.0-linux-amd64.tar.gz
kept /home/you/yoke-release/yoke-0.13.0-linux-amd64.tar.gz, checked
kept /home/you/yoke-release/yoke-conformance-0.13.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.13.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.
Download the two files of a release for this machine's architecture, and check them against the
release manifest before unpacking anything. uname -m says x86_64 for amd64 and aarch64 for
arm64.
version=0.12.0 arch=amd64
base=https://github.com/yoke-project/yoke/releases/download/v$version
mkdir -p ~/yoke-release && cd ~/yoke-release
curl -fsSLO "$base/yoke-$version-linux-$arch.tar.gz"
curl -fsSLO "$base/yoke-conformance-$version-linux-$arch.tar.gz"
The manifest, releases/manifest.jsonl in the yoke repository, has one JSON line per published
file, naming what was published, its version and its digest. This writes the two lines you need as a
checksum file and checks the downloads against it:
curl -fsSL https://raw.githubusercontent.com/yoke-project/yoke/main/releases/manifest.jsonl \
| python3 -c '
import json, sys
version, arch = sys.argv[1], sys.argv[2]
for line in sys.stdin:
entry = json.loads(line)
if entry.get("version") == "v" + version and entry.get("published") in (f"yoke-linux-{arch}", f"yoke-conformance-linux-{arch}"):
name = entry["published"].replace("-linux", f"-{version}-linux") + ".tar.gz"
print(entry["digests"][0].removeprefix("sha256:") + " " + name)
' "$version" "$arch" > SHA256SUMS
sha256sum -c SHA256SUMS
yoke-0.12.0-linux-amd64.tar.gz: OK
yoke-conformance-0.12.0-linux-amd64.tar.gz: OK
A line that does not say OK means the file is not the one released: delete it and download it
again.
Unpack the programs and the packaging inputs into one directory, ~/yoke-stage, which the next
steps install from:
mkdir -p ~/yoke-stage
tar -xzf yoke-$version-linux-$arch.tar.gz -C ~/yoke-stage
tar -xzf yoke-conformance-$version-linux-$arch.tar.gz -C ~/yoke-stage yoke-compose
Replace the programs and the guardian's unit with the new ones, from ~/yoke-stage. Your
configuration and your install root stay as they are:
install -m 0755 ~/yoke-stage/yoke ~/yoke-stage/yoke-core ~/yoke-stage/yoke-guardian ~/yoke-stage/yoke-auth ~/.local/bin/
install -m 0755 ~/yoke-stage/yoke-compose ~/.local/bin/
sed "s|/usr/bin/yoke-guardian|$HOME/.local/bin/yoke-guardian|" ~/yoke-stage/packaging/yoke-guardian.service \
> ~/.config/systemd/user/yoke-guardian.service
systemctl --user daemon-reload
- With the script
- By hand
The command that installed Yoke, with --upgrade, obtains the newest release, checks it and replaces
the programs, the units and the packaging inputs, and applies them. It refuses while Yoke is running on
the host, and leaves /etc/yoke/core.yaml as it is:
curl --proto '=https' --tlsv1.2 -sSf https://github.com/yoke-project/yoke/releases/latest/download/yoke-install.sh | sudo sh -s -- --install host --upgrade
checking against the digests published with 0.13.0
downloading yoke-0.13.0-linux-amd64.tar.gz
downloading yoke-conformance-0.13.0-linux-amd64.tar.gz
kept /root/yoke-release/yoke-0.13.0-linux-amd64.tar.gz, checked
kept /root/yoke-release/yoke-conformance-0.13.0-linux-amd64.tar.gz, checked
kept /etc/yoke/core.yaml as it is
installed yoke yoke-core yoke-guardian yoke-auth yoke-compose in /usr/bin, and the packaging inputs
Yoke 0.13.0 for amd64 is in /root/yoke-release.
Upgraded for the whole host. Start the service form again with: yoke service start
Without --upgrade, the script refuses to replace a program that differs, naming it. A device adds
--runtime-only, as it did when installing.
Download the two files of a release for this machine's architecture, and check them against the
release manifest before unpacking anything. uname -m says x86_64 for amd64 and aarch64 for
arm64.
version=0.12.0 arch=amd64
base=https://github.com/yoke-project/yoke/releases/download/v$version
mkdir -p ~/yoke-release && cd ~/yoke-release
curl -fsSLO "$base/yoke-$version-linux-$arch.tar.gz"
curl -fsSLO "$base/yoke-conformance-$version-linux-$arch.tar.gz"
The manifest, releases/manifest.jsonl in the yoke repository, has one JSON line per published
file, naming what was published, its version and its digest. This writes the two lines you need as a
checksum file and checks the downloads against it:
curl -fsSL https://raw.githubusercontent.com/yoke-project/yoke/main/releases/manifest.jsonl \
| python3 -c '
import json, sys
version, arch = sys.argv[1], sys.argv[2]
for line in sys.stdin:
entry = json.loads(line)
if entry.get("version") == "v" + version and entry.get("published") in (f"yoke-linux-{arch}", f"yoke-conformance-linux-{arch}"):
name = entry["published"].replace("-linux", f"-{version}-linux") + ".tar.gz"
print(entry["digests"][0].removeprefix("sha256:") + " " + name)
' "$version" "$arch" > SHA256SUMS
sha256sum -c SHA256SUMS
yoke-0.12.0-linux-amd64.tar.gz: OK
yoke-conformance-0.12.0-linux-amd64.tar.gz: OK
A line that does not say OK means the file is not the one released: delete it and download it
again.
Unpack the programs and the packaging inputs into one directory, ~/yoke-stage, which the next
steps install from:
mkdir -p ~/yoke-stage
tar -xzf yoke-$version-linux-$arch.tar.gz -C ~/yoke-stage
tar -xzf yoke-conformance-$version-linux-$arch.tar.gz -C ~/yoke-stage yoke-compose
Replace the programs and the packaging inputs with the new ones, from ~/yoke-stage, and apply
them. /etc/yoke/core.yaml is the site's and stays as it is:
sudo install -m 0755 ~/yoke-stage/yoke ~/yoke-stage/yoke-core ~/yoke-stage/yoke-guardian ~/yoke-stage/yoke-auth /usr/bin/
sudo install -m 0644 ~/yoke-stage/packaging/yoke.sysusers /usr/lib/sysusers.d/yoke.conf
sudo install -m 0644 ~/yoke-stage/packaging/yoke.tmpfiles /usr/lib/tmpfiles.d/yoke.conf
sudo install -m 0644 ~/yoke-stage/packaging/yoke.service /usr/lib/systemd/system/yoke.service
sudo install -m 0644 ~/yoke-stage/packaging/yoke-guardian.service /usr/lib/systemd/user/yoke-guardian.service
sudo systemd-sysusers yoke.conf
sudo systemd-tmpfiles --create yoke.conf
sudo systemctl daemon-reload
A workstation replaces the composer too:
sudo install -m 0755 ~/yoke-stage/yoke-compose /usr/bin/
3. Start again
- For your account
- For the whole host
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
Start the service form again, and check what the init system and the instance each say:
sudo yoke service start
yoke service status
init system: yoke.service is active
instance: answers, and is ready
Each account starts again the instances it stopped, as For your account says.
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.