| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
A new snapshot's files and directories are flushed before the link to it
is replaced, and the link before the old snapshot goes: a crash leaves
the old snapshot or the new one, whole.
|
| |
|
|
|
|
| |
The config crate at continuum's 34434f7 takes $(env:…), $(cmd:…) and
$(file:…) as well as ${…}, so a source list may use either. A test
packs a $(cmd: …) source.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
enstate.service reruns on a switch when the schema changes. A unit of
its own, enstate-switch.service, takes what waits otherwise: a
submission in incomingDir, or one staged. switch-to-configuration
restarts sysinit-reactivation.target on every switch, which starts it,
and triggering conditions keep it from running when nothing waits. The
check before a switch uses the new generation's enstate, schema and
configuration, and runs on a host without enstate, too: its first
switch's state can wait in incomingDir. Subtests of the VM test: staged
under an unchanged schema, brought by the switch (without the warning
the activation-restart-list gives); a waiting submission taken by the
switch that needs it; one refused refusing it.
|
| |
|
|
|
|
|
|
|
|
|
| |
--migrate first takes the submissions in STATE/incoming, in the order of
their names: planned against the schema, stored if accepted (their views
follow with the rest), removed, and moved to STATE/refused if refused,
which refuses the migration. A dry run (the check before a switch) does
so on a copy of the snapshots, changing nothing. --stage leaves a
marker, STATE/migrate-due, for the next switch to migrate even if the
schema doesn't change; --migrate removes it. Scratch directories are
cleaned up without following the symbolic links in them.
|
| |
|
|
|
|
|
|
|
|
| |
Plans against --schema, stores the snapshot under it, and puts no views
in place and runs no reactions: the running generation goes on as it
is, keeping what it has no slot for, and the switch (--migrate) brings
the new views. The way to fill a required slot a generation adds before
switching to it, and to bring a host's first state: with the new
system's enstate, schema and configuration. Tests, and a subtest of the
VM test that does so.
|
| |
|
|
|
|
|
|
| |
A submission for a generation not yet switched to waits in an incoming
directory, which the check before the switch plans against the new
schema and the switch takes; or it is staged, with the new generation's
receptor, and stored without views or reactions. Either way the switch
brings the views, and a host's first switch its state.
|
| |
|
|
|
|
|
| |
The sketch of the NixOS side: services point at the views' paths, which
the module names, as they like (LoadCredential=, a configuration file);
whether they are restarted when a view changes is up to reactions, since
a configuration may restart them itself.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The module makes the schema from options (/etc/enstate/schema.json),
every slot its own view unless it says otherwise, and names the views'
paths (read-only `path` options) for the services that read them. It
configures none of them: a service whose LoadCredential= reads a view is
ordered after the unit that puts the views in place, by itself. That
unit runs --migrate at boot and when the schema changes; the check
before a switch is --migrate --dry-run against the new schema. The
test: a consumer with a LoadCredential= of its own; apply from a source
list, rotate, switch across a rename and back, a switch refused, a
reboot.
|
| |
|
|
|
|
| |
/etc/enstate/config.json, if it exists, before --config files and
arguments: the NixOS module writes the state and run directories there,
so an operator's enstate finds them.
|
| |
|
|
|
|
|
|
|
|
| |
After applying, units are restarted or reloaded, and started if they
aren't running: they may have failed for want of their views. That
happens with the store's lock released: a unit restarted may want the
one that runs --migrate, which waits for the lock. After a switch,
--migrate runs from the unit that units using views are ordered after,
so only running units react, without waiting for them (--no-block
try-restart, try-reload-or-restart).
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
What a generation sees of a snapshot accepted under another schema:
same name and type, renamedFrom, a rename in the stored schema read
backwards, and entries kept, with their types, in the snapshot's kept/.
Plans start from what is seen, and store it under the running schema;
a generation change rewrites no snapshot. --migrate (and --dry-run)
says what each channel sees, refuses for required slots nothing fills,
puts the views in place and runs their reactions; --materialize and
--status go by what is seen, too. A view made from an unfilled
required slot isn't there. The rollback cases of migrations.md that
need no converters or steps are tests.
|
| |
|
|
|
|
|
| |
A kept entry fills a slot of its name and type after a rollback, but
once that slot is filled anew it is older than what is there, and goes:
the rule of migrations.md case 3, for every kept entry. --migrate takes
--dry-run, for the check before a switch.
|
| |
|
|
|
|
|
|
|
|
| |
One program on a library: --plan and --apply of submissions (complete and
partial, items required and optional, groups, removal, the chain as
order), validators of types and across slots, views put in place by
replacing a link, their reactions by systemctl; --status, --materialize;
and --pack, a submission from a source list in JSON or TOML, by the
config crate's sources. Programs by the protocol of design.md 5.2;
tests with shell scripts as validators and renderers.
|
| |
|
|
|
|
|
|
|
| |
The plan checks that required slots are filled before it runs the
validators, so they are given filled slots. The receptor's and the
provider's commands are options (--plan, --apply, --pack, ...), as our
tools' are. An item in a group is as required as its group, and the
manifest has no checksums yet. A plan says of secret views, and of
files that aren't text, which files differ, as diffutils does.
|
| |
|
|
|
|
|
|
|
|
| |
A protocol for validators, renderers, converters and steps (a directory
with an invocation and channels/CHANNEL/SLOT, objections as JSON lines);
every slot holds a file, its type a media type, so format and type
versions go; validators across slots; submissions in the same layout,
with removal and the chain as order proposed; and enstate pack, with
source lists in JSON or TOML by continuum's config crate. Case 2 of
migrations.md now has two types and converters between them.
|
| |
|
|
|
|
|
|
| |
Partial submissions with required and optional items and groups, plan
before apply, formats by media type, a protocol for renderers, host
names by a resolver, refuse as the only policy; and the rule that a
generation change never rewrites the snapshot, which the cases in
migrations.md need.
|
| |
|