Rename mesh-control -> mesh-controller, substrate -> foundation
One name per thing, per the HQ glossary: the module/container/image/binary/repo becomes mesh-controller, the seat the-controller, and the store+broker pair the foundation (embedded base bundles, default template and example lock renamed with their go:embed directives). No behaviour change — a pure vocabulary rename. Claude-Session: https://claude.ai/code/session_01D6qtiYU3P9jk3pnAXyAFyx
This commit is contained in:
+5
-5
@@ -1,17 +1,17 @@
|
||||
# Examples
|
||||
|
||||
## `substrate-first-node.lock`
|
||||
## `foundation-first-node.lock`
|
||||
|
||||
What a machine must be before a mesh exists — the bootstrap in
|
||||
[novox/hq `07-the-substrate.md`](https://git.novox.be/novox/hq), whole:
|
||||
[novox/hq `07-the-foundation.md`](https://git.novox.be/novox/hq), whole:
|
||||
|
||||
```
|
||||
0 a container runtime
|
||||
1 the store runs
|
||||
2 a database per context `inventory` and `identity`
|
||||
3 those contexts' schemas mesh-control migrate
|
||||
3 those contexts' schemas mesh-controller migrate
|
||||
4 the broker runs with a certificate it generated itself
|
||||
5 the control plane runs mesh-control serve
|
||||
5 the control plane runs mesh-controller serve
|
||||
```
|
||||
|
||||
**A machine that applies this is a mesh** — one node, with nothing joined to it yet, which is
|
||||
@@ -24,7 +24,7 @@ a comment about what something does not do is a comment nobody updates.
|
||||
Build a host carrying it:
|
||||
|
||||
```
|
||||
make host SYSTEM=arch BUNDLE=examples/substrate-first-node.lock
|
||||
make host SYSTEM=arch BUNDLE=examples/foundation-first-node.lock
|
||||
```
|
||||
|
||||
**The registry address and digests have to be replaced before this is useful.** They are written
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Package examples checks the bundles shipped in this directory.
|
||||
//
|
||||
// **Nothing checked them before.** `substrate-first-node.lock` is what a machine becomes when
|
||||
// **Nothing checked them before.** `foundation-first-node.lock` is what a machine becomes when
|
||||
// there is no mesh to ask — the one declaration applied with nothing to verify it against — and
|
||||
// it was edited by hand and read by nobody but a running host.
|
||||
package examples
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
|
||||
func bundle(t *testing.T) *declaration.Declaration {
|
||||
t.Helper()
|
||||
raw, err := os.ReadFile("substrate-first-node.lock")
|
||||
raw, err := os.ReadFile("foundation-first-node.lock")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -27,12 +27,12 @@ func bundle(t *testing.T) *declaration.Declaration {
|
||||
return d
|
||||
}
|
||||
|
||||
// Defends novox/hq ADR 0028: the substrate supplies the control plane and nothing else.
|
||||
// Defends novox/hq ADR 0028: the foundation supplies the control plane and nothing else.
|
||||
//
|
||||
// The object store was substrate for months on the strength of "it cannot grant itself a bucket",
|
||||
// The object store was foundation for months on the strength of "it cannot grant itself a bucket",
|
||||
// which answers half the test. The control plane never needed one, and nothing noticed because
|
||||
// nothing counted what the bundle holds.
|
||||
func TestTheBundleCarriesTheSubstrateAndTheControlPlaneAndNothingElse(t *testing.T) {
|
||||
func TestTheBundleCarriesTheFoundationAndTheControlPlaneAndNothingElse(t *testing.T) {
|
||||
var images []string
|
||||
for _, r := range bundle(t).Resources {
|
||||
c, ok := r.(*declaration.Container)
|
||||
@@ -48,7 +48,7 @@ func TestTheBundleCarriesTheSubstrateAndTheControlPlaneAndNothingElse(t *testing
|
||||
}
|
||||
sort.Strings(images)
|
||||
|
||||
want := []string{"lavinmq", "mesh-control", "postgres"}
|
||||
want := []string{"lavinmq", "mesh-controller", "postgres"}
|
||||
if strings.Join(images, ",") != strings.Join(want, ",") {
|
||||
t.Fatalf("the bundle carries %v; expected exactly %v.\n\n"+
|
||||
"Adding one is a change to what every first node becomes, and to ADR 0006's "+
|
||||
@@ -57,13 +57,13 @@ func TestTheBundleCarriesTheSubstrateAndTheControlPlaneAndNothingElse(t *testing
|
||||
}
|
||||
|
||||
// The control plane is in the bundle, and the design overlooked it once by reasoning about
|
||||
// substrate services rather than counting containers (novox/hq 03-DESIGN/01-to-be/07).
|
||||
// foundation services rather than counting containers (novox/hq 03-DESIGN/01-to-be/07).
|
||||
func TestTheControlPlaneIsCarriedToo(t *testing.T) {
|
||||
for _, r := range bundle(t).Resources {
|
||||
if c, ok := r.(*declaration.Container); ok && strings.Contains(c.Image, "mesh-control") {
|
||||
if c, ok := r.(*declaration.Container); ok && strings.Contains(c.Image, "mesh-controller") {
|
||||
return
|
||||
}
|
||||
}
|
||||
t.Fatal("nothing in the bundle starts the control plane, so the machine would raise a " +
|
||||
"substrate and stop")
|
||||
"foundation and stop")
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// substrate-first-node.lock — what a machine must be before a mesh exists.
|
||||
// foundation-first-node.lock — what a machine must be before a mesh exists.
|
||||
//
|
||||
// The whole bootstrap (novox/hq 03-DESIGN/01-to-be/07-the-substrate.md): a container runtime, a
|
||||
// The whole bootstrap (novox/hq 03-DESIGN/01-to-be/07-the-foundation.md): a container runtime, a
|
||||
// store, a database per context, those contexts' schemas, the broker, and the control plane
|
||||
// running on top of them.
|
||||
//
|
||||
@@ -85,7 +85,7 @@
|
||||
},
|
||||
// Each context owns its own database (novox/hq ADR 0008). A third one is a third database,
|
||||
// created the same way and named the same way — which is the whole of adding a context to the
|
||||
// bootstrap, and is why the count is not something the substrate has an opinion about.
|
||||
// bootstrap, and is why the count is not something the foundation has an opinion about.
|
||||
{
|
||||
"id": "licences-database",
|
||||
"type": "action",
|
||||
@@ -100,7 +100,7 @@
|
||||
"-e", "MESH_STORE_INVENTORY=postgres://postgres:bootstrap@127.0.0.1:5432/inventory?sslmode=disable",
|
||||
"-e", "MESH_STORE_IDENTITY=postgres://postgres:bootstrap@127.0.0.1:5432/identity?sslmode=disable",
|
||||
"-e", "MESH_STORE_LICENCES=postgres://postgres:bootstrap@127.0.0.1:5432/licences?sslmode=disable",
|
||||
"192.0.2.250:5000/mesh-control@sha256:c67db38439ff0aee242b467486765467bb95801f52175fc5727cc4e437338ace",
|
||||
"192.0.2.250:5000/mesh-controller@sha256:c67db38439ff0aee242b467486765467bb95801f52175fc5727cc4e437338ace",
|
||||
"migrate"],
|
||||
"verify": ["sh", "-c", "docker exec mesh-store psql -U postgres -d inventory -tAc \"select to_regclass('public.node')\" | grep -qx node && docker exec mesh-store psql -U postgres -d identity -tAc \"select to_regclass('public.signing_key')\" | grep -qx signing_key && docker exec mesh-store psql -U postgres -d licences -tAc \"select to_regclass('public.licence')\" | grep -qx licence"]
|
||||
},
|
||||
@@ -133,8 +133,8 @@
|
||||
{
|
||||
"id": "control-plane",
|
||||
"type": "container",
|
||||
"name": "mesh-control",
|
||||
"image": "192.0.2.250:5000/mesh-control@sha256:c67db38439ff0aee242b467486765467bb95801f52175fc5727cc4e437338ace",
|
||||
"name": "mesh-controller",
|
||||
"image": "192.0.2.250:5000/mesh-controller@sha256:c67db38439ff0aee242b467486765467bb95801f52175fc5727cc4e437338ace",
|
||||
"network": "host",
|
||||
"args": ["serve"],
|
||||
"volumes": ["mesh-broker-tls:/broker-tls:ro"],
|
||||
Reference in New Issue
Block a user