Skip to main content
Version: 0.6.0

Instances

An instance is a declared object: a record naming an installed application and a version, written by the manager, beside the state that instance accumulates. What the record holds and how the guardian acts on it is the guardian's; this page is what the manager does with one.

Creating one, and naming it​

yoke instance create <id> [--name <n>] [--version <v>] [--params <file>]
ArgumentWhen absent
--namea name is generated, and reported
--versionthe newest installed version that is complete and not a pre-release
--paramsthe declared defaults are recorded; a required parameter with no default is refused, naming it
  • The manager names an instance, never the Core, and the name is unique within the account — so one application can run several times on a host, each copy with its own stores, sockets and log.
  • A name is unique because creating it creates a directory that cannot already exist.
  • It is refused where the application is not installed, the version is absent or incomplete, the installation is not offered to this account, or a value fails its declaration.
  • Creating and re-pointing are the only acts that pin a version, and each records the digest of that version's yoke.yaml with the pin. Nothing refreshes it: a descriptor that no longer matches is refused at the next start.

The values a site supplies​

Parameter values are supplied once, in a TOML file, and recorded — one table per group, a group named after a unit or a channel, or the reserved group shared.

[shared]
site_label = "Bench A — Metrology"

[acquire]
instrument = "/dev/spectro-head-a"
  • Values are checked against their declarations before they are recorded — a pattern, a range, a set of permitted values, the existence of a path. A value that fails is parameter.value; a required parameter with no value is parameter.missing.
  • Nothing reads the file afterwards. yoke instance set-param changes one value, checked the same way.
  • They are checked again before every start, since the record is an ordinary file anyone may edit.
  • A parameter is never a secret: values sit in the record in clear and are printed by ordinary reporting. A secret is supplied otherwise.

Running an application that was never declared​

yoke app run <id> [--version <v>] [--admit-unlaunched]
yoke app run --from <dir> [--admit-unlaunched]

A run with no record creates one that lasts as long as the run. The manager writes an ephemeral record, asks for it to be reconciled, and follows the instance until it is interrupted — then writes the desired state and waits for the instance to come down. The guardian executes the run like every other start.

The ephemeral record
visibly ephemerala field of the record, and yoke instance list says so
autostartnever eligible
an orderly stopthe record goes with it, and the run exits 0
a failurethe record stays, marked failed, until a reclaiming pass clears it; the run exits 2
a start that never happened — refused by the gate, or interrupted before anything was executedthe record goes, the findings are printed, and the run exits 1
  • The run supplies the declared defaults and no other value. An application with a required parameter that has no default is declared before it can run.
  • --from runs a bundle being written, from a working directory, with no integrity verification, and the instance says so of itself: bundle.unverified is among the weaker arrangements it reports. Everything else is the same — the gate, the checks, the Core, the units.
  • --admit-unlaunched lets a process the Core did not launch register — a unit started by hand under a debugger. It relaxes admission's authentication stage and nothing else, and is independent of --from.
  • Both waivers belong to the invocation. A descriptor cannot declare that it need not be verified, and a declared record cannot carry either.

Copying an instance's state​

yoke instance copy <instance> <path>
yoke instance restore <path> <instance>

Both are refused unless the instance is stopped. What is copied is the state directory whole: the two stores, the version stamp, the secrets, and every directory a unit declared a need for.

A copy is a directory holding state/ — the state directory whole — and origin, one line naming the instance it was copied from. Restoring compares that name with the instance it is restored into, which is how the same instance and another are told apart; a copy whose origin is missing or unreadable is restored as into another instance. The path a copy is written to must not exist.

Restored intoRegistrySecretsVersion stamp
the same instancekeptkeptkept
another instancestrippedstrippedkept
  • The manager does the stripping. A Registry holds what was authorised for that instance, and a secret belongs to the instance it was given to.
  • Nothing schedules, rotates or ships a copy: the copy is a directory, which any backup tool takes.

Reading an instance​

yoke instance show answers from the filesystem, so it answers about an instance that is not running: the record as it stands, and what the state occupies per store and per declared storage need, with which secrets are present. There is no limit on a unit's own data; the size is reported.