Skip to main content
Version: 0.6.0

Writing a description

Every field of a description can be written by a verb, so that a project is never half tool-made and half typed by hand. A field has a verb of its own where the act deserves one, and set otherwise.

yoke-compose add unit <name> --kind K [--exec P | --image R | --plugin ID] [--arg A]... [--depends-on U]...
yoke-compose add channel <name> --transport T --clients C [--unit U] [--class C [--host H] [--port N]] [--on-suspend G]
yoke-compose add parameter <group>.<name> --type T [--range R] [--pattern P] [--values A,B] [--required] [--default V] [--label L]
yoke-compose set <path> <value>
yoke-compose arbitrate <channel> over <channel>...
VerbWrites
add unita unit: its kind, its program, image or Plugin, its arguments in order, its dependencies; for a program under components/, its digest beside it
add channela channel: its transport, its cardinality, the unit serving it, its address
add parametera parameter in a group: its type, its domain, whether it is required, its default, its label
setany other field, of either document
arbitrateone precedence relation: the first channel prevails over the others

set takes a field by the path a finding carries — units.acquire.policy.startup_window, parameters.second.line.default — so what a report names is what a verb takes. Its value is read as YAML: true, 5s, [a, b] and { entries: 500 } are a boolean, a duration, a list and a mapping.

What a verb refuses​

A verb never accepts what the gate refuses. After writing, the composer runs the gate over the result; where the gate refuses anything at or beneath the path written, nothing is kept, and the document is byte for byte what it was. What the gate finds elsewhere is the rest of the project's business — a project is written one field at a time, and its first unit is added to a descriptor that declares none.

The descriptor, or a composition document​

By default a verb writes the descriptor of the project in --dir. With --file, it writes the composition document that path names, checked against the Manifests --manifests names: the same verbs, the same paths, the same refusals.

A project, start to finish​

yoke-compose init com.yoke.station --version 1.0.0
yoke-compose add parameter probe.greeting --type string --default hello --label "What the probe writes"
yoke-compose add unit probe --kind oneshot --exec components/probe --arg '${greeting}'
yoke-compose set units.probe.policy.restart.on_failure true
yoke-compose block add ../blocks/writer.yaml --as second
yoke-compose check
yoke-compose waive oneshot.restart.unchecked --at units.probe.policy.restart.on_failure --reason "Writing a file twice is harmless."
yoke-compose build
yoke app install com.yoke.station-1.0.0.yoke

Two loops, and they are not the same loop. A refusal has to be fixed: the loop ends when the description is one that can start. Advice has to be answered: by changing the project, or by saying in a waiver why the combination is meant.