diff options
Diffstat (limited to 'docs/design.md')
| -rw-r--r-- | docs/design.md | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/docs/design.md b/docs/design.md index 4854047..b20323e 100644 --- a/docs/design.md +++ b/docs/design.md @@ -97,7 +97,7 @@ type, 5.1), and the file and structured slots (every slot holds a file). | submission | made outside, handed to the host | | snapshot | on the host, kept by the receptor | | receptor | on the host, set up by activation; a small program run on demand, like an activation script, not a service; language secondary, Rust a candidate | -| provider | outside the host (a deploy tool, an operator, `enstate pack`), or an agent on it (a sync) | +| provider | outside the host (a deploy tool, an operator, `enstate --pack`), or an agent on it (a sync) | A host would start with two channels: its own secrets (from the deploying host), and the fleet's public data (from a registry). @@ -295,11 +295,11 @@ directory in the layout of 5.2, with a manifest in place of an invocation: "complete": false, "base": "4f0c…", "items": [ - { "address": "fleet/hosts/ne", "op": "set", "required": true, "group": "ne" }, - { "address": "fleet/users/tv", "op": "set", "required": false }, - { "address": "fleet/hosts/wu", "op": "remove", "required": true } + { "address": "fleet/hosts/ne", "op": "set", "group": "ne" }, + { "address": "fleet/users/tv", "op": "set", "required": false }, + { "address": "fleet/hosts/wu", "op": "remove" } ], - "sha256": { "channels/fleet/hosts": "…" } + "groups": { "ne": { "required": true } } } ``` @@ -307,7 +307,9 @@ An item that sets an entry has its file at `channels/CHANNEL/SLOT`. An item that sets records has them in that file, too, as an object with just the records it sets. How the submission gets to the host is not the receptor's business: over ssh from a deploy tool or an operator, or -fetched by an agent. `base` is for the order (5.9). +fetched by an agent. `base` is for the order (5.9). Items and groups are +required unless they say otherwise, and an item in a group is as required +as its group. A submission is **complete** or **partial**: @@ -319,7 +321,7 @@ A submission is **complete** or **partial**: **Removing** (proposed): an item may remove an entry or a record instead of setting it. A removal that leaves a required slot unfilled is refused -by the plan's check that every required slot is filled (5.5, point 4), like +by the plan's check that every required slot is filled (5.5, point 3), like anything else that leaves one unfilled. Each item says whether it is **required** or **optional**: @@ -353,16 +355,18 @@ run. 1. checks that the channel exists in the running generation's schema, and the order (5.9); 2. applies the items to a copy of the current snapshot; -3. runs the validators on the result. Optional items that an objection - names are taken out, with their groups, and the check runs again; an - objection to a required item, or to something already in place, - refuses the submission; -4. checks that every slot the schema requires is filled; +3. checks that every slot the schema requires is filled (an optional + removal that would leave one unfilled is taken out); +4. runs the validators on the result, which are given filled slots. + Optional items that an objection names are taken out, with their + groups, and the checks run again; an objection to a required item, or + to something already in place, refuses the submission; 5. runs the renderers into a scratch directory, and compares. The plan says, for each item, whether it goes in, and if not, why; for -each view, how it would change (a diff for public views, only "changes" -for secret ones); and which reactions would run. +each view, how it would change (a diff for public views; for secret ones, +and files that aren't text, only which files differ, as diffutils says it +for binary files); and which reactions would run. **Apply.** The same, and then: the new snapshot becomes current, the views are installed atomically, and each reaction runs once (reload or @@ -404,7 +408,7 @@ follows does. Proposed, for the first version: in `base` the snapshot it builds on. If it does, it goes in only if that is the current one, so two providers can't overwrite each other unnoticed. A submission that names none applies to whatever is - current. `enstate status` tells a provider the current id. + current. `enstate --status` tells a provider the current id. Later, for a provider that can't ask the host what is current, like a registry many hosts fetch from: a **counter** or a **timestamp** per @@ -515,7 +519,7 @@ should be one list. ## 10. Providers and sources -enstate brings a provider of its own, `enstate pack`, so that making a +enstate brings a provider of its own, `enstate --pack`, so that making a submission needs no deploy tool. It reads a source list and writes a submission. Deploy tools may call it, or make submissions themselves; krops' populate and enstate's sources are separate, so each can be used @@ -563,10 +567,10 @@ slots, required slots without a source. On the host, a submission goes to the receptor as a directory: ```sh -enstate pack --sources secrets.json --out sub/ +enstate --pack secrets.json --out sub/ rsync -a sub/ root@xu:/var/lib/enstate/incoming/secrets/ -ssh root@xu enstate plan /var/lib/enstate/incoming/secrets -ssh root@xu enstate apply /var/lib/enstate/incoming/secrets +ssh root@xu enstate --plan /var/lib/enstate/incoming/secrets +ssh root@xu enstate --apply /var/lib/enstate/incoming/secrets ``` (Paths and option names are working names.) enstate's own command line @@ -623,9 +627,9 @@ Small enough to try on one host, large enough to replace something real: - submissions complete and partial, items required and optional, groups, the chain as order; - programs by the protocol of 5.2; -- the receptor as a command: `plan`, `apply`, `migrate` (on a generation - change), `materialize` (at boot), `status`; -- `enstate pack` with source lists in JSON and TOML; +- the receptor as a command: `--plan`, `--apply`, `--migrate` (on a generation + change), `--materialize` (at boot), `--status`; +- `enstate --pack` with source lists in JSON and TOML; - migrations: same name carries over, `renamedFrom`, kept and reported; the two rules of section 6; policy: refuse; - a NixOS module: slot, validator and view options, schema file, |
