Dev VMs: render INVENTORY from an inventoryCheckout argument #120
No reviewers
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/archetypes!120
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/dev-vm-inventory-pointer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A dev VM can now be told where the deployment's own inventory checkout is, so
allodthere finds repositories that only the deployment's registry lists. Nothing changes on any machine until a deployment sets the new value.inventoryCheckoutgetsINVENTORYin its session environment after its next rebuild, in login shells and inssh <vm> <command>alike.Closes allod/archetypes#119
How a deployment sets it
In the machine's entry in the deployment inventory's
scripts/vm-specs.json, underprofile:machineConfigurationsalready merges an entry'sprofilesettings, andprofiles.lib.profileData.<machine>, into the builder's arguments, so no further plumbing was added andflake.nixis unchanged.What changed
nix/builders/dev.nix:mkDevVmtakesinventoryCheckout, default null. Non-null rendersenvironment.sessionVariables.INVENTORY. Null renders nothing: the attribute is absent, not empty. A value that is not a non-empty absolute path fails evaluation with a message naming the machine and the argument, by the same rule (^/.+) the hypervisor'snexus.provisioning.inventoryCheckoutapplies.checks/dev-inventory-pointer.nix, registered inchecks/default.nix: the check described above, on a fixture machine of its own that reads no data input by name.README.md, Builders: one paragraph on the argument.Only
INVENTORYis rendered.INVENTORY_CHECKOUTis a provisioning pointer with no reader on a dev VM.Risk
R2. The change adds a session variable to a machine's generated configuration, and only where a deployment asks for it.
allodon that VM then reads a registry that is not there, finds no entries, and reports sites and patch ids as unknown. Nothing is written or deleted; correcting the value and rebuilding recovers it.services.openssh.settings.UsePAM,security.pam.services.sshd.setEnvironment). That is a reading of the generated configuration, not a measurement on a running machine.Validation
Run on this branch at
05683bd:allod check:All 32 steps passed (checks: 19 built)., the new check among them.nix eval --raw .#nixosConfigurations.<machine>.config.system.build.toplevel.drvPathprints the same path on this branch and on master.allod/deploycheckout,fleet-diff --override archetypes=05683bd0aed64bafb1d472889d356294f550308d --expect-none:0 of 4 machines change.andExpectation matches.That covers the fleet that checkout composes; a deployment's own composition root has its own.INVENTORY not rendered into the session environment), with the refusal disabled (a relative inventoryCheckout was accepted,an empty inventoryCheckout was accepted), and withUsePAM = falseon the fixture (sshd does not use PAM).config.environment.sessionVariablesheldINVENTORY = "/srv/demo/inventory"; without it, noINVENTORY.The last commit,
edeed80, changes comments only: no line outside a comment differs from05683bd. On it, thedev-inventory-pointercheck was rebuilt and passed, and all four machines still evaluate to the same derivation as on master. The fullallod checkandfleet-diffwere not repeated on it.Not run, because they need a rebuilt VM and a deployment that sets the value:
echo $INVENTORYin a login shell on the dev VM, andssh <vm> 'echo $INVENTORY'from the hypervisor.allod site servewith no variable typed, in a site only the deployment's registry lists../fork-safety.shwas not run: it belongs to the lock-bump path, and the new check reads nothing from the data inputs.Review
One reviewer from another model family (
gpt-5.6-terra) read the diff cold, followed by one fix round.profilesettings reach the builder. That merge is unchanged here and forwards every setting alike.checks/pi-integration.nixalready witnesses it formemoryCheckoutswhen./fork-safety.shruns it against the fork fixture, whose inventory setsprofile.memoryCheckouts; the public template sets noprofileat all.Owner request: cut down the verbose comments in this PR. Follow-up commit to come on this branch; no behaviour change.
Correction to this pull request's description, section "How a deployment sets it". It names the wrong file.
scripts/vm-specs.jsonis generated and is not what the framework reads. The setting belongs in the machine's entry in the inventory'sflake.nix, besiderepos:Then regenerate
scripts/vm-specs.jsonas the inventory README describes, and rebuild the VM. The README paragraph this pull request added is correct as merged; only the description above was wrong.