Dev VMs: point allod at the deployment's own repository registry #119
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/archetypes#119
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Let
allodon a dev VM find the deployment's own repository registry, so that a command which reads a per-repository fact, such asallod site servereading a site'spreview_port, works for a repository that only the deployment's inventory lists.Primary goals:
allod site servein a checkout the deployment's registry lists finds its port with no environment variable typed by hand.Current state
allodreads the registry from$INVENTORY/scripts/repositories.jsonwhenINVENTORYis set, and fromallod/inventory/scripts/repositories.jsonunder the work directory otherwise (allod/toolscmd/allod/registry.go,registryPath). The hypervisor's host module rendersINVENTORYfromnexus.provisioning.inventoryCheckout. Nothing renders it on a dev VM.Observed on a dev VM of a deployment that keeps its own inventory beside the public one:
INVENTORYis unset, soallod site servein a site the deployment's registry lists, with a port, refuses withno preview port for <checkout>: give its entry in <work>/allod/inventory/scripts/repositories.json a preview_port, or pass --port. It names the public registry, which does not list the site and must not. WithINVENTORYset by hand to the deployment's inventory checkout the same command serves.The same holds for every registry lookup
allodmakes on a dev VM:allod patchids, andallod site serve <site>by id.Default and alternative
Default: the dev VM builder takes the inventory checkout as a parameter and renders
INVENTORYinto the session environment, as the hypervisor module does. The checkout is already one of the machine's registered repositories.Alternative, only if the default proves awkward:
allodlooks for a deployment inventory at a second conventional path before falling back to the public one. It adds a second rule for where the registry is.allod/toolsgit-hooks/setup-tracked-hooksreads the public path literally and ignoresINVENTORY; whether it follows is tracked in allod/tools#108.Validation
echo $INVENTORYin a login shell and in a non-interactivessh <vm> <command>, sinceallod site viewstarts the server that way.allod site servewith no variable typed, in a site only the deployment's registry lists.Scope
In: the dev VM's environment. Out: the registry reader in
allod/tools, which already honours the variable.This also blocks
allod site view, which makes it more than a convenience.viewon the hypervisor starts the server by runningallod site serve --port <n> <site>in the VM. There the id is looked up in the VM's registry before anything else (allod/toolscmd/allod/site_serve.go,sitePreviewSite). WithINVENTORYunset that is the public registry, so for a site only the deployment's inventory lists, the commandviewruns ends with:Exit 1, measured on a dev VM by running that command with the variable unset. It fails even when a preview of that site is already running, because the lookup comes before the check for a running unit. So
viewcannot show such a site from the hypervisor until the VM can find the deployment's registry in a non-interactivessh <vm> <command>.