Skip to main content
Version: 0.14.1

A walk through the example

One application, com.yoke.station, from the file a customer receives to a running instrument and back out again, in both deployment forms. Each step names what happens and points to the page that states it exactly; nothing here is a rule of its own.

UnitKindWhat it is
provision-storeoneshot, in a containerprepares the store the archive writes to, and exits
acquireplugin, on the hostdrives a spectrometer on a serial device, publishes station.spectra
pipelineplugin, in a containeranswers spectrum.identify, publishes station.identified
archiveplugin, in a containerstores datasets, in the layout the store says it has
panelinterface, on the hostthe instrument's own screen, attached to the channel panel

Two channels: panel, a local socket for the managed interface, and remote, http+ws on the loopback for a browser. panel prevails over remote.

1 · The file, and installing it​

yoke app install com.yoke.station-2.1.0.yoke

One file, transport only: the bundle archived, with a footer the host reads first. The head checks run in order and nothing is expanded until the last has passed; then the payload is expanded, the three images are pulled by digest, and the host executables are checked against their digests. Installing runs nothing (the file, installing, the install root).

2 · Creating an instance, and starting it​

yoke instance create com.yoke.station --version 2.1.0 --name bench-a --params bench-a.toml
yoke instance set-secret bench-a push-token
yoke instance enable bench-a

The values a site supplies are validated and read into the record; the secret is held apart from it (instances, secrets). Enabling writes the desired state and asks the guardian, which creates the control group, runs the gate, and executes the Core (reconciling).

The gate produces one finding on this deployment: remote sits on the loopback, a weaker arrangement reported and not refused.

3 · The units come up, and are admitted​

The order is derived from depends_on, against what ready means for each kind: provision-store first, ready when it has exited zero; then acquire, pipeline and archive, ready when their Session is open; panel last, since nothing may depend on an interface.

Each Plugin unit arrives with five environment variables, binds its own socket, and then registers; the gate admits it against its Manifest and the operator's policy, and opens its Session (what a unit arrives with, admission, the Session). A stream the policy does not grant is withheld, not refused.

4 · The panel attaches, and a stream flows​

The panel is handed its channel's socket and attaches, and its opening picture is everything it may address and observe, so a quiet instrument shows the instrument rather than nothing (attaching). Starting a stream and subscribing to it are two acts: starting makes it flow for everyone, subscribing asks for a copy (streams to clients).

5 · A browser arrives, and an operator​

The browser attaches to remote while the panel holds panel: arbitration suspends remote, and the browser keeps receiving and may not command. A second browser on the same address is refused, and the first is untouched (arbitration). An operator on the administrative surface widens a grant, which reaches the unit at its next admission (the operations).

6 · Six months later: 2.2.0​

yoke app install com.yoke.station-2.2.0.yoke
yoke instance stop bench-a
yoke instance copy bench-a /srv/backup/bench-a
yoke instance set-version bench-a 2.2.0
yoke instance restart bench-a

2.2.0 changes the store's layout and carries migrate-store, which runs once — on the first start over state 2.1.0 wrote — and is skipped on every start after. Pointing bench-a back at 2.1.0 is refused by the stamp, naming both versions; the copy taken before the update is what restores it. yoke app prune reclaims 2.1.0 once nothing points at it (updating and removal, migrating state).

7 · The same bench as a service​

A laboratory installs the same Plugins from its own distribution: each Manifest in /etc/yoke/plugins.d/<plugin>/, each executable at /usr/lib/yoke/plugins/<plugin>, and an administrator's composition document naming the deployment — here four copies of acquire, one per instrument.

/etc/yoke/deployments/bench.yaml
units:
acquire-1:
kind: plugin
plugin: com.yoke.station.acquire
bind: { instrument: /dev/spectro-head-a }
args: [ "--device", "${bind.instrument}" ]
# acquire-2 … acquire-4, one per head
  • yoke service start asks the init system, which runs the manager; the manager runs the gate and then executes the Core. A head that is absent refuses the deployment, naming it.
  • The store is prepared here too. The composition carries provision-store as the descriptor does, and archive is handed the store's path, --store ${bind.datasets}, and depends on it.
  • One plugin, four units. Disabling com.yoke.station.acquire is one decision with four consequences, reported per unit; restarting is addressed to one unit.
  • What the application form has and this one does not: no guardian, no control group to create, no instance record and no stamp. Updating is the distribution's business.

Everything from admission onwards is the same in both forms. Above the Core, the description, the party that starts it, the paths and the integrity supplier differ; below it nothing does.