feat(microvm): cortex-cuda as delivered guest of cortex (fleet participation) - #111
Open
sini wants to merge 1 commit into
Open
feat(microvm): cortex-cuda as delivered guest of cortex (fleet participation)#111sini wants to merge 1 commit into
sini wants to merge 1 commit into
Conversation
sini
force-pushed
the
feat/delivered-child-host
branch
2 times, most recently
from
June 12, 2026 02:38
3cc482c to
c7cff18
Compare
…ipation)
Rewire cortex-cuda from an isolated-resolve guest to a microvm guest of
cortex: cortex declares `guests.cortex-cuda`, the guest authors honest `nixos`
and is routed into `cortex.microvm.vms.cortex-cuda.config` with no standalone
nixosConfigurations output (intoAttr = []). The guest now PARTICIPATES in the
fleet — agenix (host key retargeted to cortex's identity) and core.users fire
inside it — while the GPU passthrough/vfio/arbitration overlay is layered
host-side by virtualization/microvm-guests.nix (facter devices, vfio
ExecCondition gates, gpu-claims producer, CUDA microvm.pkgs, root keys).
The guests policy itself (host.guests option, the isolated `guest` entity
kind, the resolve+route+isolation delivery) lives here in nix-config
(modules/den/aspects/virtualization/guests.nix), composed entirely from public
den primitives — it is a consumer pattern with a single (microvm) use case,
not den-core machinery.
Depends on den @ e8876f3e, which carries only the genuine engine primitives:
- route `reinstantiate` flag: the delivery target re-instantiates the
collected nixos, so it must receive keyed module wrappers verbatim, not
pre-evaluated resolved config;
- projected hasAspect keyed by entity id_hash: the per-scope path-set is
re-keyed by context-free entity identity instead of a scope-string, so the
in-context hasAspect needs no ancestor reconciliation — e.g. agenix's
`hasAspect core.impermanence` resolves true on the axon/cortex hosts and
identityPaths point at /persist/etc/ssh again.
Guest-config reconciliation with the now-participating fleet baseline:
- neutralize the tailscale the fleet users drag in via roles.default — this
headless GPU inference VM is reached via the host on the internal bridge, not
the tailnet, and the user-scope tailscale age-secret isn't collected for a
delivered guest;
- mkForce system.stateVersion and openssh PermitRootLogin (guest pins its own
vs the fleet default/baseline);
- enable programs.zsh so the participating users' login shells resolve.
Verified: agenix age.secrets + core.users fire (no throw); GPU parity is
byte-identical to the pre-refactor baseline (nix-diff: the only delta is the
flake-source store path that any repo edit rehashes; the vfio-gate derivation
is identical); cortex toplevel builds; no cortex-cuda flake output;
axon-01/02/03 + cortex identityPaths = /persist/etc/ssh.
sini
force-pushed
the
feat/delivered-child-host
branch
from
June 12, 2026 15:56
c7cff18 to
9beec57
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rewire cortex-cuda from an isolated-resolve guest to a microvm guest of cortex. cortex declares
guests.cortex-cuda; the guest authors honestnixosand is routed intocortex.microvm.vms.cortex-cuda.configwith no standalonenixosConfigurations.cortex-cudaoutput (intoAttr = []). The guest now participates in the fleet — agenix (host key retargeted to cortex's identity) andcore.usersfire inside it — while the GPU passthrough/vfio/arbitration overlay is layered host-side byvirtualization/microvm-guests.nix(facter devices, vfioExecConditiongates,gpu-claimsproducer, CUDAmicrovm.pkgs, root keys).The guests policy (
host.guestsoption, the isolatedguestentity kind, the resolve + route + isolation delivery) lives here in nix-config (modules/den/aspects/virtualization/guests.nix), composed entirely from public den primitives. It is a consumer pattern with a single (microvm) use case — not den-core machinery — so it lives with its consumer rather than inflating every den user's surface.Guest-config reconciliation with the now-participating fleet baseline:
roles.default(this headless GPU inference VM is reached via the host on the internal bridge, not the tailnet, and the user-scope tailscale age-secret isn't collected for a delivered guest);mkForcesystem.stateVersionand opensshPermitRootLogin(guest pins its own vs the fleet default/baseline);programs.zshso the participating users' login shells resolve.Dependency
Requires den @
e8876f3e(flake.lock bumped here), which carries only the genuine engine primitives:reinstantiateflag — the delivery target (microvm.vms.<n>.config) re-instantiates the collected nixos as its own NixOS system, so the route must deliver the keyed module wrappers verbatim rather than pre-evaluating them into resolved config (which stripped base-module defaults + the dedup keys). Covered by a standalone route test.id_hash— the per-scope path-set that backs in-contexthasAspectis re-keyed by context-free entity identity instead of a scope-string. The set is produced by an entity's standalone resolve (no ancestors) but consumed in the fleet resolve (host nested underenvironment/fleet); keying byid_hash(kind+name, stable across both) removes the ancestor-stripping reconciliation entirely, so e.g. agenix'shasAspect core.impermanenceresolves true on the axon/cortex hosts andidentityPathspoint at/persist/etc/ssh.The delivered-child policy that previously lived in den core has been removed from den — it moved here as the guests policy.
Test plan
age.secrets+core.usersfire inside the guest (no eval throw)nix-diffof the cortex toplevel shows the only delta is the flake-source store path that any repo edit rehashes; the vfio-gate derivation is identicalmicrovm.vms.cortex-cudare-instantiatesnixosConfigurations.cortex-cudaoutputidentityPaths=/persist/etc/sshnix fmtclean