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:
@@ -31,9 +31,9 @@
|
||||
* MESH_LAB_INCUS='sudo -n incus'
|
||||
* MESH_LAB_HOST_BINARY=.../mesh-host/mesh-host
|
||||
* MESH_LAB_BOOTSTRAP_BINARY=.../mesh-host/mesh-bootstrap
|
||||
* MESH_LAB_BUNDLE=.../mesh-host/examples/substrate-first-node.lock
|
||||
* MESH_LAB_BUNDLE=.../mesh-host/examples/foundation-first-node.lock
|
||||
* MESH_LAB_CATALOG=.../mesh-catalog/modules
|
||||
* MESH_LAB_SOURCE=<forge>/mesh-control.git MESH_LAB_SOURCE_REF=<commit>
|
||||
* MESH_LAB_SOURCE=<forge>/mesh-controller.git MESH_LAB_SOURCE_REF=<commit>
|
||||
* MESH_LAB_KEEP=1 to leave it standing afterwards
|
||||
*/
|
||||
import { test, before, after } from "node:test";
|
||||
@@ -44,7 +44,7 @@ import { loadScenario } from "../../src/declaration/parse.ts";
|
||||
import { raise } from "../../src/lifecycle/raise.ts";
|
||||
import { destroy, exec, push } from "../../src/lifecycle/operate.ts";
|
||||
import { bootstrapBinaryPath, hostBinaryPath, HOST_PATH } from "../../src/lifecycle/place.ts";
|
||||
import { labIsUsable, destroyAll, substrateBundle } from "./harness.ts";
|
||||
import { labIsUsable, destroyAll, foundationBundle } from "./harness.ts";
|
||||
import { genesis, type GenesisResult } from "./genesis.ts";
|
||||
|
||||
const SCENARIO = "fresh-mesh";
|
||||
@@ -68,7 +68,7 @@ const REGISTRY = `${ANCHOR}:5000`;
|
||||
*/
|
||||
const BASE = { module: "mesh-tools", repo: "mesh-tools", path: "" };
|
||||
/**
|
||||
* What `amqp-ping` requires, and what the substrate does not supply.
|
||||
* What `amqp-ping` requires, and what the foundation does not supply.
|
||||
*
|
||||
* The installer raises a broker, but as a bundle resource — plumbing, not a module the mesh has a
|
||||
* record of, so it provides nothing to anything. A module asking for `amqp` is asking for a
|
||||
@@ -86,7 +86,7 @@ const PROVIDER = { module: "lavinmq", repo: "mesh-catalog", path: "modules/lavin
|
||||
const STORE = { module: "postgres", repo: "mesh-catalog", path: "modules/postgres", container: "mesh-postgres" };
|
||||
const CATALOGUE = { module: "mesh-catalog", repo: "mesh-catalog", path: "modules/mesh-catalog", container: "mesh-catalog" };
|
||||
/** The control plane, rebuilt from its own repository — the step that ends the installer's tenure. */
|
||||
const CONTROL_PLANE = { module: "mesh-control", repo: "mesh-control", path: "", container: "mesh-control" };
|
||||
const CONTROL_PLANE = { module: "mesh-controller", repo: "mesh-controller", path: "", container: "mesh-controller" };
|
||||
/** Named once, because the step title is also how later steps say what they waited on. */
|
||||
const NEEDS = "the mesh runs a broker for that module to talk to";
|
||||
const GENESIS = "a bare machine becomes a mesh of one, raised by the installer";
|
||||
@@ -154,7 +154,7 @@ const skip =
|
||||
!installer ? "MESH_LAB_BOOTSTRAP_BINARY is not set to a built mesh-bootstrap" :
|
||||
!source ? "MESH_LAB_SOURCE is not set to the repository the control plane is built from" :
|
||||
!sourceRef ? "MESH_LAB_SOURCE_REF is not set to the commit to build" :
|
||||
!bundle || !existsSync(bundle) ? "MESH_LAB_BUNDLE is not set to a substrate template" :
|
||||
!bundle || !existsSync(bundle) ? "MESH_LAB_BUNDLE is not set to a foundation template" :
|
||||
!catalogDir || !existsSync(catalogDir) ? "MESH_LAB_CATALOG is not set to mesh-catalog/modules" :
|
||||
false;
|
||||
|
||||
@@ -180,7 +180,7 @@ async function must(machine: string, command: string, timeoutMs?: number): Promi
|
||||
return out;
|
||||
}
|
||||
async function mesh(command: string, timeoutMs?: number): Promise<string> {
|
||||
return must(CONTROL, `docker exec mesh-control /mesh-control ${command}`, timeoutMs);
|
||||
return must(CONTROL, `docker exec mesh-controller /mesh-controller ${command}`, timeoutMs);
|
||||
}
|
||||
|
||||
/** A module the mesh has to make for itself: where its source is, and what it runs when it works. */
|
||||
@@ -239,7 +239,7 @@ async function waitForContainer(node: string, container: string, seconds = 200):
|
||||
*
|
||||
* **The control plane runs in a container, so a file on the machine is not a file it can open.**
|
||||
* Pushing the manifest to the machine and naming that path got `no such file or directory` from
|
||||
* inside mesh-control, which is correct and was briefly mistaken for a missing manifest. It is
|
||||
* inside mesh-controller, which is correct and was briefly mistaken for a missing manifest. It is
|
||||
* copied the last step of the way with `docker cp`.
|
||||
*
|
||||
* **Into the root, not into /tmp.** The control plane's image is a minimal one and has no `/tmp`
|
||||
@@ -250,7 +250,7 @@ async function registerModule(module: string, manifest: string): Promise<string>
|
||||
const onMachine = `/tmp/${module}.json`;
|
||||
const inContainer = `/${module}.json`;
|
||||
await push(instanceId, CONTROL, manifest, onMachine);
|
||||
await must(CONTROL, `docker cp ${onMachine} mesh-control:${inContainer}`);
|
||||
await must(CONTROL, `docker cp ${onMachine} mesh-controller:${inContainer}`);
|
||||
return mesh(`module add ${inContainer}`);
|
||||
}
|
||||
function tokenFrom(said: string): string {
|
||||
@@ -325,7 +325,7 @@ before(async () => {
|
||||
// whose anchor is somewhere else every node, including this one, would enrol against an
|
||||
// address nothing answers on. The installer refuses to guess it and says so, which is
|
||||
// right: it does not know what this machine is called from outside.
|
||||
bundleTemplate: substrateBundle(bundle, []).replaceAll("192.0.2.10:5671", `${ANCHOR}:5671`),
|
||||
bundleTemplate: foundationBundle(bundle, []).replaceAll("192.0.2.10:5671", `${ANCHOR}:5671`),
|
||||
registry: REGISTRY,
|
||||
source,
|
||||
sourceRef,
|
||||
@@ -371,7 +371,7 @@ before(async () => {
|
||||
return built;
|
||||
});
|
||||
|
||||
// A store of its own. **Not the substrate's.** The installer raises a store for the control
|
||||
// A store of its own. **Not the foundation's.** The installer raises a store for the control
|
||||
// plane to keep its own records in, the way it raises a broker — plumbing, not a module the mesh
|
||||
// has any record of, so it provides nothing to anything. A module that wants a database wants a
|
||||
// provider in the graph, and the catalogue below is the first thing to want one.
|
||||
|
||||
Reference in New Issue
Block a user