The controller asks no build of anybody (ADR 0501 §5, ADR 0525 clause 6, ADR 0503 §3). Every module of a walk is taken from the builder's done key; a key not done yet waits, named in the plan, and never fails it. - C2b/C2c: internal/builder and cmd/mesh-controller's asks go (askABuild, onlyTheBuildersOwn, buildOneAsked, takeIn from an outcome, buildAgentsOwn, the builder's say and its fallback, the daemon hearing an outcome). The server follows the retired seats' built subjects only to let go of them, because the installer's carried user list names them. - C2d: replay, queue, cancel, clear, kill, pause, resume, delivery-check, check-here and merge-gate are refused by name. - C3: the check queues (CHECKS_READY, CHECKS_OTHER) and their workers, the checks-running and plans-building buckets and their grants, the build queue and its hold (plans_building.go, queue.go, link/holds.go, builds_nats.go, checks_nats.go). - C4: merge_gate*.go, the pull request's repo-check path, the Checked event and its layers; a pull request asks the controller nothing but to tell mesh-config what its head declares. - C5: the builds bucket is written only by key_takein. - C10 (help and refusals): the terminal's help lists only what is served. Integration tests of the plan's tiers, sends, stops and retries now run on a stand-in builder with a done key for every module (walk_keys_scaffold_integration_test.go); the tests of the asks, the queue, the merge gate and the replays are deleted.
81 lines
3.3 KiB
Go
81 lines
3.3 KiB
Go
package main
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"git.novox.be/novox/mesh-sdk/go/catalogue"
|
|
)
|
|
|
|
// An address is read from the node's settings where it is used, never recorded with a port
|
|
// (novox/hq 04-ISSUES/102). Three readers did not follow the setting; each is held to it here.
|
|
|
|
var aDigest = "sha256:" + strings.Repeat("e", 64)
|
|
|
|
// aStore is a module offering the artifact store on 5000, published the long way as the
|
|
// distribution module does, so a node may be given another number for it.
|
|
func aStore() catalogue.Manifest {
|
|
return catalogue.Manifest{Module: "distribution", Version: "1",
|
|
Provides: []catalogue.Offer{{Name: catalogue.ArtifactStoreProvision, Scope: catalogue.ScopeMesh}},
|
|
Serves: map[string]map[string]any{catalogue.ArtifactStoreProvision: {"port": float64(5000)}},
|
|
Listens: []catalogue.Listening{{Port: 5000, From: catalogue.FromMesh}},
|
|
Resources: []map[string]any{{"id": "store", "type": "container", "name": "mesh-registry",
|
|
"ports": []any{"5000:5000"}, "image": "registry@" + aDigest}}}
|
|
}
|
|
|
|
// **The trust a machine writes for the store, and the address every built image is fetched
|
|
// through, say the port the node gave the store** — not the catalogue's number.
|
|
|
|
// **The control plane's own connections say the port the node gave the store and the broker.**
|
|
//
|
|
// Composed from the control plane's own manifest against a real inventory: the store's module is
|
|
// given 6852 on this node the way genesis or an operator gives it, and the control plane's
|
|
// process is told so beside the sealed connection genesis wrote.
|
|
|
|
// withSeatPorts is the control plane's manifest with the seat placeholders in its environment —
|
|
// added here until module.json carries them (the manifest lands one commit after the code that
|
|
// fills it, so a control plane one build behind never sees a placeholder it cannot fill).
|
|
func withSeatPorts(m catalogue.Manifest) catalogue.Manifest {
|
|
seatPorts := map[string]string{
|
|
"MESH_STORE_INVENTORY_PORT": "${seat:mesh-store:5432}",
|
|
"MESH_STORE_IDENTITY_PORT": "${seat:mesh-store:5432}",
|
|
"MESH_STORE_LICENCES_PORT": "${seat:mesh-store:5432}",
|
|
"MESH_BROKER_AMQP_PORT": "${seat:mesh-broker:5672}",
|
|
"MESH_BROKER_MANAGEMENT_PORT": "${seat:mesh-broker:15672}",
|
|
"MESH_BROKER_ADDRESS_PORT": "${seat:mesh-broker:5671}",
|
|
}
|
|
out := m
|
|
out.Resources = nil
|
|
for _, r := range m.Resources {
|
|
if r["type"] != "container" && r["type"] != "process" {
|
|
out.Resources = append(out.Resources, r)
|
|
continue
|
|
}
|
|
copied := map[string]any{}
|
|
for k, v := range r {
|
|
copied[k] = v
|
|
}
|
|
env := map[string]any{}
|
|
if had, ok := r["env"].(map[string]any); ok {
|
|
for k, v := range had {
|
|
env[k] = v
|
|
}
|
|
}
|
|
for k, v := range seatPorts {
|
|
if _, said := env[k]; !said {
|
|
env[k] = v
|
|
}
|
|
}
|
|
copied["env"] = env
|
|
out.Resources = append(out.Resources, copied)
|
|
}
|
|
return out
|
|
}
|
|
|
|
// aLoneNode is one capable machine with nothing placed on any network — the control-node during
|
|
// genesis, before the "network" step, which is after the store, the broker, the vault and the
|
|
// catalogue have each been built and pushed (finding F2).
|
|
|
|
// **Before the network exists, the store's own node reaches it by loopback** — never refused,
|
|
// never handed the scheme: a genesis pushes the store, the broker, the vault and the catalogue to
|
|
// a node on no network, and builds the catalogue on a base it must be able to pull.
|