Updating and removal
An update is four ordinary operations, not a verb, so that nothing decides on anybody's behalf when to become unable to go back.
| Step | Verb | What changes |
|---|---|---|
| 1 | yoke app install <package> | a new version exists beside the old one. Nothing runs it |
| 2 | yoke instance copy <name> <path> | a copy of the state as the old version left it, stamped with that version |
| 3 | yoke instance set-version <name> <version> | one field of the record |
| 4 | yoke instance restart <name> | the desired state, then a reconciliation by the guardian |
| 5 | yoke app prune [<id>] | the superseded version goes, once nothing points at it |
Which version an instance runs is a field of its record. Installing changes nothing about what comes up at the next power cycle, and says so.
Rolling back
A rollback is the same sequence with the versions exchanged, available while the older version is installed.
- The older version's declared data range decides whether it is possible. The instance's state is stamped with the version that last wrote it; a stamp outside the range is refused, naming both versions.
- The refusal comes twice: from
yoke instance set-version, while somebody is at the keyboard, and from the gate before every start, which is the authority. - A refused rollback is answered by the copy taken at step 2: restored into the same instance, it puts the older code in front of state it can read, at the cost of whatever accumulated since.
Removing
| Verb | Removes | Refused when |
|---|---|---|
yoke instance clear <name> | the state; the instance stays declared | the instance is not stopped |
yoke instance remove <name> | the record and the state together | the instance is not stopped |
yoke app remove <id> [--version <v>] | bundles and their install records | any record still points at a version being removed, stopped or running |
- Re-point first. A record naming a version that is gone could not be satisfied at the next boot.
- A removal that proceeds writes
withdrawnfirst, so no instance can be pinned to the version between the check and the deletion. - None of the three touches images.
Reclaiming
yoke app prune [<id>]
There is one reclaiming verb. It names what it removed; an argument narrows it to one application.
| It collects | On what condition |
|---|---|
| superseded versions | a higher version that is not a pre-release is installed, and no record points at this one |
| pre-releases | never — only an explicit yoke app remove takes one |
| the remains of an install that never completed | its record says incomplete |
| images | Yoke obtained them, and no installed bundle references them |
| an ephemeral record a failed run left | the run failed and the record is still there |
| the runtime directory of an instance that is not running | its claim is free |
- Only images tagged
yoke/<id>:<version>are considered. The tag is removed first and the image after, which the engine declines while anything else refers to it. An image whose tag is gone is left alone. - A pass that cannot reach the engine reclaims everything else and leaves every image, saying so. It is not a failure: each image keeps its tag, and the next pass that reaches the engine finds it.