A taken container keeps a found network, a left-out module is kept, and genesis raises the forge as its module declares (hq ADR 0163)
A container may name networks it also joins once created, for the per-machine setting that keeps a found network while a neighbour still resolves it there: joined after the run, part of the spec, refused when it cannot be joined. A declaration may say which modules the mesh left out because a stored setting cannot compose with its definition. Absence used to read as removal; a left-out module's records are kept and said, and its holds are not released. Genesis raises the bootstrap forge under the gitea module's container name, with its image digest and its data directory mounted at /data, so the module holds it by the found rule instead of raising a second forge beside it (issue 090). The network is the one difference left for a take to say. Before this the forge had no volume: its repositories were the container's, lost with it.
This commit is contained in:
@@ -25,11 +25,24 @@ const (
|
||||
// foundationStore is the foundation's postgres container — the mesh's own memory, raised from the
|
||||
// bundle. gitea's bootstrap database lives here too, so a mesh runs one postgres (issue 051).
|
||||
foundationStore = "mesh-store"
|
||||
// giteaBootstrap is the gitea server raised directly at genesis, before gitea is a module.
|
||||
giteaBootstrap = "mesh-gitea-server"
|
||||
// giteaImage is the same upstream image the gitea module runs, pinned identically so the module
|
||||
// adopts the running server rather than replacing it.
|
||||
giteaImage = "gitea/gitea@sha256:dfc61e347c8b582df918f4556401bf2cecdfbdb56c5282ae9488dd76fca3e41c"
|
||||
// giteaBootstrap is the gitea server raised directly at genesis, before gitea is a module —
|
||||
// under the name the gitea MODULE declares for its container, so the module finds it and holds
|
||||
// it rather than raising a second forge beside it (novox/hq ADR 0163, rule 7; issue 090).
|
||||
giteaBootstrap = "gitea"
|
||||
// giteaImage is the image the gitea module declares for that container, pinned to the same
|
||||
// digest, so taking the module over is not a downgrade and not an upgrade. **Moves with the
|
||||
// module's pin**: the two are compared by a take, and a difference is said there — but a
|
||||
// genesis that raised an older image than the module declares would be taken over as an
|
||||
// upgrade on first push, which a forge holding the mesh's packages must not have done to it
|
||||
// unannounced. Checked in TestGenesisRaisesTheForgeAsTheModuleDeclaresIt against the module's
|
||||
// manifest where the catalogue is beside this checkout.
|
||||
giteaImage = "gitea/gitea@sha256:87a67ee09d3ae0d1df5fda5dcda3e2a1f9236a45b0a59025d6e00e46adc43bef"
|
||||
// giteaDataDir is where the module's `data` directory resolves on a machine with the default
|
||||
// layout (<data root>/<module>/<id>, novox/hq ADR 0112): mounted at /data as the module mounts
|
||||
// it, so the repositories, attachments and indexes the bootstrap forge accumulates are the
|
||||
// module's the day it is taken — before this, the forge had no volume and its data was the
|
||||
// container's, lost with it.
|
||||
giteaDataDir = "/var/lib/gitea/data"
|
||||
// packagesOrg is the npm owner: every module consumes `@novox/*` from this gitea org.
|
||||
packagesOrg = "novox"
|
||||
// packagesTeam is the org team whose members may read and write the org's packages.
|
||||
@@ -262,9 +275,13 @@ func raiseGiteaServer(ctx context.Context, run Runner, timeout time.Duration, db
|
||||
"run", "-d", "--name", giteaBootstrap,
|
||||
// Host network, like the control plane: it reaches the foundation store on the machine's
|
||||
// loopback (where the store publishes 5432) and answers on the machine's own 3000, which is
|
||||
// where mesh-bootstrap and the builder's build containers look for it.
|
||||
// where mesh-bootstrap and the builder's build containers look for it. The module runs
|
||||
// bridged and publishes its ports; that is the one difference a take still has to say
|
||||
// (ADR 0163, rule 7) — the data, the name and the image are the module's already.
|
||||
"--network", "host",
|
||||
"--restart", "unless-stopped",
|
||||
// The module's data directory, so what the forge accumulates is the module's when taken.
|
||||
"--volume", giteaDataDir + ":/data",
|
||||
}, env...)
|
||||
args = append(args, giteaImage)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user