Installing
What was built is installed as a release is, by hand, from ~/yoke-stage, where the build left the
programs and the packaging inputs. The script published with a release installs that release's files
and not a build of your own. Installing 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.
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.
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/
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.