Installing
yoke app install <package> decides everything it can before writing anything, and the first thing it
writes is a record saying the installation is not finished.
| # | Step | Leaves behind |
|---|---|---|
| 1 | read the footer and verify it: the checksum, the signature against the policy, then arch, model and core against this host | nothing |
| 2 | resolve the install root and check its properties | nothing |
| 3 | create <root>/<id>/ if absent, then <root>/<id>/<version>/ exclusively | the version directory |
| 4 | write install.yaml with state: incomplete | a version nothing will run |
| 5 | unseal into a staging file in the version directory, where the package is sealed | the same |
| 6 | recompute the payload's digest and compare it with the footer's | the same |
| 7 | expand the archive into bundle/, and remove the staging file | a bundle, not yet trusted |
| 8 | read the descriptor — the first time the application's own account is read — and run the gate over it | the same |
| 9 | obtain every image the descriptor names, by digest | images in the engine's per-account store |
| 10 | recompute the digest of every component the descriptor names, and compare | the same |
| 11 | write state: complete | an installation |
- The Core this host will execute is the binary
corenames in the manager's configuration, and its version is read from the build information stamped into it, without executing it. A binary that states no version satisfies no range, and is refused at step 1, naming it. A Core built from the release's source archive states none — it is built outside a repository; one built from a checkout of the release's tag, or installed withgo install github.com/yoke-project/yoke/cmd/yoke-core@<tag>, states the tag. - Step 8 is an early report, not the authority. The gate that decides whether an instance may start runs before every start; at install there is no instance, so the checks that read an instance's values or state are not among what it reports.
- Step 10 reads the expected digests from the descriptor, never from a Plugin's own Manifest.
- Nothing the package contains is executed. What has to happen at install happens at first start, in a unit that runs to completion, under supervision.
Obtaining images
Obtaining images is part of installing. Each image the descriptor names is pulled by digest into the engine's per-account store, or loaded from an archive the package carries — so an install with no network is the same operation as one with a network.
- A carried image is an OCI image archive at
components/images/<algorithm>-<hex>.tar, named by the digest the descriptor pins. Where it is there, it is loaded and nothing is pulled. - It is the only part of an install that reports progress: per image, cumulatively — what is being obtained, how much has arrived, what was already present.
- Each image obtained is tagged
yoke/<id>:<version>in the engine's store. A unit is launched from the pinned digest, never the tag; the tag is what the reclaiming pass recognises. - Running the same command again obtains what is missing and nothing else. Nothing is recorded about a partial pull.
- A loaded image must arrive with its digest: where the engine's store keeps none — Docker's classic
store — the install is refused,
image.undigested, naming the image and the store. - An engine that cannot be reached is a refusal where the descriptor names an image, naming the engine. A descriptor with no image needs no engine.
What it reports
| Already present | What happens |
|---|---|
the same version, complete | nothing is done, and the manager says so |
the same version, incomplete | the remains are removed and the installation proceeds |
| another version | the new one is installed beside it, and the manager says what it did not do: no instance runs it until its record is re-pointed |
When it fails
- A refusal before step 3 leaves nothing behind.
- A failure at or after step 3 leaves the version directory with an
incompleterecord. Nothing runs from it,yoke app listshows it, andyoke app pruneremoves it. A new version never overwrites an old one, so nothing that worked is damaged. - A refusal and a fault are reported as themselves. A signature that does not verify will not verify next time, and running again is not offered; a link that dropped while pulling is a fault, and running again is the remedy.