Installing
Installing Yoke obtains a release, checks every file against the digest published with it, puts the programs where the host finds them and creates the directories Yoke needs. It starts nothing.
- For your account
- For the whole host
Nothing here needs root. Yoke is installed for the account running the commands, for the application form.
- With the script
- By hand
curl --proto '=https' --tlsv1.2 -sSf https://github.com/yoke-project/yoke/releases/latest/download/yoke-install.sh | sh -s -- --install account
checking against the digests published with 0.12.0
downloading yoke-0.12.0-linux-amd64.tar.gz
downloading yoke-conformance-0.12.0-linux-amd64.tar.gz
kept /home/you/yoke-release/yoke-0.12.0-linux-amd64.tar.gz, checked
kept /home/you/yoke-release/yoke-conformance-0.12.0-linux-amd64.tar.gz, checked
installed yoke yoke-core yoke-guardian yoke-auth yoke-compose in /home/you/.local/bin
made the install root /home/you/yoke/apps, named in /home/you/.config/yoke/manager.conf
installed the guardian's user unit in /home/you/.config/systemd/user
Yoke 0.12.0 for amd64 is in /home/you/yoke-release.
Installed for this account. Check it: yoke app list && yoke instance list && echo installed
The script is yoke-install.sh, published with every release. It checks that this is Linux on
amd64 or arm64 and that the tools it needs are there; downloads the release's files and checks each
against the digest published with it, keeping them in ~/yoke-release only when every one matches;
puts the programs in ~/.local/bin; makes an install root of your own, ~/yoke/apps, and names it in
~/.config/yoke/manager.conf unless that file exists, which it never rewrites; and installs the
guardian's user unit. It stops at the first thing it cannot do, saying what, and ends by saying what
this host lacks that Yoke would use, such as PAM or systemd.
| Add | To |
|---|---|
--at-boot | enable the guardian's unit and let your account's services run without a login, so that your instances come back when the machine boots |
--version <x.y.z> | install a release other than the newest |
--bin <path> | put the programs somewhere other than ~/.local/bin |
What the check protects against is a file damaged or replaced on the way. The script, the files and the manifest all come from the release on GitHub, so they are as trustworthy as that account. To read the script before it runs, save it and run the copy:
mkdir -p ~/yoke-release
curl --proto '=https' --tlsv1.2 -sSfL -o ~/yoke-release/yoke-install.sh \
https://github.com/yoke-project/yoke/releases/latest/download/yoke-install.sh
sh ~/yoke-release/yoke-install.sh --install account
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
The programs go in a directory on your PATH. They are in ~/yoke-stage, with the packaging
inputs beside them under packaging/; the composer goes with them where this machine writes
applications:
mkdir -p ~/.local/bin
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/
export PATH="$HOME/.local/bin:$PATH"
The manager needs an install root it may write into. The host's own, /var/lib/yoke/apps, exists
only where Yoke is installed for the whole host; for your account alone, make one of your own and say
where it is in the manager's configuration. The directory has to be in a group of yours, set-group-id,
writable by the group and not by others — the manager checks exactly these properties and refuses a
root that lacks one, naming it (configuration).
mkdir -p ~/yoke/apps && chmod 2775 ~/yoke/apps
mkdir -p ~/.config/yoke
echo "install_root: $HOME/yoke/apps" > ~/.config/yoke/manager.conf
The guardian's user unit names /usr/bin, so point it at where the program is:
mkdir -p ~/.config/systemd/user
sed "s|/usr/bin/yoke-guardian|$HOME/.local/bin/yoke-guardian|" ~/yoke-stage/packaging/yoke-guardian.service \
> ~/.config/systemd/user/yoke-guardian.service
For your instances to come back when the machine boots, enable the unit and let your account's services run without a login:
systemctl --user daemon-reload
systemctl --user enable yoke-guardian.service
loginctl enable-linger "$USER"
Everything here is done as root. Yoke is installed for every account that is a member of
yoke-apps, and for the service form.
- With the script
- By hand
curl --proto '=https' --tlsv1.2 -sSf https://github.com/yoke-project/yoke/releases/latest/download/yoke-install.sh | sudo sh -s -- --install host
checking against the digests published with 0.12.0
downloading yoke-0.12.0-linux-amd64.tar.gz
downloading yoke-conformance-0.12.0-linux-amd64.tar.gz
kept /root/yoke-release/yoke-0.12.0-linux-amd64.tar.gz, checked
kept /root/yoke-release/yoke-conformance-0.12.0-linux-amd64.tar.gz, checked
installed yoke yoke-core yoke-guardian yoke-auth yoke-compose in /usr/bin, and the packaging inputs
an account installs applications once it is in the group yoke-apps: usermod -aG yoke-apps <account>
Yoke 0.12.0 for amd64 is in /root/yoke-release.
Installed for the whole host. Check the service form with: yoke service check
The script is yoke-install.sh, published with every release. It checks that this is Linux on
amd64 or arm64, that it runs as root and that the host has systemd's sysusers and tmpfiles, all
before downloading anything; downloads the release's files and checks each against the digest published
with it; puts the programs in /usr/bin and the packaging inputs where systemd reads them; creates the
group yoke-apps and the directories; and keeps an /etc/yoke/core.yaml that is already there. It
stops at the first thing it cannot do, saying what.
| Add | To |
|---|---|
--runtime-only | leave the composer out: a host that runs applications and does not write them |
--version <x.y.z> | install a release other than the newest |
What the check protects against is a file damaged or replaced on the way. The script, the files and the manifest all come from the release on GitHub, so they are as trustworthy as that account. To read the script before it runs, save it and run the copy:
mkdir -p ~/yoke-release
curl --proto '=https' --tlsv1.2 -sSfL -o ~/yoke-release/yoke-install.sh \
https://github.com/yoke-project/yoke/releases/latest/download/yoke-install.sh
sudo sh ~/yoke-release/yoke-install.sh --install host
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
Each file goes where the packaging inputs expect it: the programs in /usr/bin, which the two init
units name, and the inputs where systemd reads them. They are in ~/yoke-stage, the inputs under
packaging/, and each command is run as root through sudo:
sudo install -m 0755 ~/yoke-stage/yoke ~/yoke-stage/yoke-core ~/yoke-stage/yoke-guardian ~/yoke-stage/yoke-auth /usr/bin/
sudo install -D -m 0644 ~/yoke-stage/packaging/yoke.sysusers /usr/lib/sysusers.d/yoke.conf
sudo install -D -m 0644 ~/yoke-stage/packaging/yoke.tmpfiles /usr/lib/tmpfiles.d/yoke.conf
sudo install -D -m 0644 ~/yoke-stage/packaging/yoke.service /usr/lib/systemd/system/yoke.service
sudo install -D -m 0644 ~/yoke-stage/packaging/yoke-guardian.service /usr/lib/systemd/user/yoke-guardian.service
sudo install -D -m 0644 ~/yoke-stage/packaging/core.yaml /etc/yoke/core.yaml
sudo systemd-sysusers yoke.conf
sudo systemd-tmpfiles --create yoke.conf
sudo systemctl daemon-reload
| Input | Goes to | Does |
|---|---|---|
yoke.sysusers | /usr/lib/sysusers.d/yoke.conf | creates the group yoke-apps, whose members may install applications |
yoke.tmpfiles | /usr/lib/tmpfiles.d/yoke.conf | creates /etc/yoke/, /usr/lib/yoke/, /var/lib/yoke/ and the install root /var/lib/yoke/apps, with their owners and modes |
yoke.service | /usr/lib/systemd/system/ | the service form: the one deployment the init system runs |
yoke-guardian.service | /usr/lib/systemd/user/ | the application form: the guardian, as a user unit of an account that enables it |
core.yaml | /etc/yoke/core.yaml | the Core's configuration in the service form, every key at its default |
A workstation adds the composer, which a device never carries:
sudo install -m 0755 ~/yoke-stage/yoke-compose /usr/bin/
On a machine that cannot reach GitHub
The release is obtained on a machine that can, and carried. The script obtains it without installing
when --install is left out, for the architecture --arch names, into the directory --dir names; on
the other machine it finds the files there, checks them against the digests it carries, and downloads
nothing. Here, with the other machine's architecture, arm64 or amd64:
mkdir -p ~/yoke-carry
curl --proto '=https' --tlsv1.2 -sSfL -o ~/yoke-carry/yoke-install.sh \
https://github.com/yoke-project/yoke/releases/latest/download/yoke-install.sh
sh ~/yoke-carry/yoke-install.sh --arch arm64 --dir ~/yoke-carry/yoke-release
scp -r ~/yoke-carry/yoke-install.sh ~/yoke-carry/yoke-release <machine>:
There, in an SSH session, install from what you carried, naming the directory:
- For your account
- For the whole host
sh ~/yoke-install.sh --dir ~/yoke-release --install account
sudo sh ~/yoke-install.sh --dir "$HOME/yoke-release" --install host
checking against the digests published with 0.12.0
using /home/you/yoke-release/yoke-0.12.0-linux-arm64.tar.gz, already kept and checked
using /home/you/yoke-release/yoke-conformance-0.12.0-linux-arm64.tar.gz, already kept and checked
The script is the one that obtained the files, so it checks them against its own release's digests and
reads nothing from the network. A machine that only runs applications needs neither the composer nor
the conformance suite: --runtime-only, given both here and there, leaves them out.
After installing
- For your account
- For the whole host
Check it: the manager answers, and has nothing installed and no instance yet.
yoke app list && yoke instance list && echo installed
installed
Nothing else is needed to run an application. The manager starts your account's guardian itself the first time an instance needs one, and the guardian exits when it has nothing left to watch.
An account may install applications once it is in the group yoke-apps, and needs no configuration
of its own: the install root /var/lib/yoke/apps is the default. Add it, and log in again so that the
membership takes effect:
sudo usermod -aG yoke-apps "$USER"
Check it, as that account:
yoke app list && yoke instance list && echo installed
installed
For the account's instances to come back when the host boots, the account enables the guardian's unit and its services run without a login:
systemctl --user enable yoke-guardian.service
loginctl enable-linger "$USER"
The service form is installed and not enabled, and nothing runs until a deployment is in force. The
deployment is a composition document, /etc/yoke/deployment.yaml; until there is one, the check says
so, and that refusal is the installation working:
yoke service check
refusal document.unreadable at : the document /etc/yoke/deployment.yaml is absent: open /etc/yoke/deployment.yaml: no such file or directory
yoke: the composition /etc/yoke/deployment.yaml is refused
Writing the composition, placing each Plugin's Manifest and executable, and starting the deployment are an application's (shipping it). A unit that runs in a container needs Podman or Docker on the host; a deployment with none needs no engine.
What is installed
| Program | Is |
|---|---|
yoke | the manager: installs applications, runs instances, administers a running one |
yoke-core | the Core: supervises the units, routes their traffic, keeps their state |
yoke-guardian | starts each of an account's instances and brings it back when it fails |
yoke-auth | asks the host's authentication service, for a channel that signs its callers in |
yoke-compose | the composer, on a workstation: makes, checks and builds an application's project |
Next, write an application: Building an application.