Every module named its events the way the old bus spelled a routing key — `module.<module>.<verb>`. Design 29 says a module names an event locally and the mesh works out where it lands, so all 37 were stale against a rule already decided. On the new bus that derives into a namespace belonging to a module called "module", so no cross-module subscription in the mesh matched anything: nothing failed, nothing reacted (novox/hq 04-ISSUES/127). 36 manifests converted, and 43 files of module code with them. The code mattered as much as the manifests: the runtime builds the subject from what `emit()` is handed, so a converted manifest with unconverted code would have had the permission and the subject disagree. Three things the new check found on the way: - `photos` emitted an event its manifest never declared, which the new bus refuses outright. Declared. - `showcase` waited for an event nothing emits, so its demo could never be triggered — only `showcase` may publish under its own name. It emits both halves now. - `distribution` declared an event named after a different module. It emits `image.pushed` under its own name. An event about a *role* belongs on the seat, where the name outlives whoever holds it, but the sdk has no way to publish on a seat yet, so that stays recorded rather than declared. The audit logger's "everything" pattern is `**` rather than the old bus's `#`.
149 lines
3.2 KiB
JSON
149 lines
3.2 KiB
JSON
{
|
|
"module": "redis",
|
|
"version": "1",
|
|
"provides": [
|
|
{
|
|
"name": "redis-cache",
|
|
"scope": "mesh"
|
|
}
|
|
],
|
|
"requires": [
|
|
"secret"
|
|
],
|
|
"capabilities": [
|
|
"container-runtime"
|
|
],
|
|
"emits": [
|
|
"cache.provisioned",
|
|
"cache.deprovisioned"
|
|
],
|
|
"consumes": [
|
|
"redis.cache.provisioned",
|
|
"redis.cache.deprovisioned"
|
|
],
|
|
"serves": {
|
|
"redis-cache": {
|
|
"port": 6379
|
|
}
|
|
},
|
|
"receives": {
|
|
"redis-cache": "/var/lib/redis-module/grants/mesh.json"
|
|
},
|
|
"grants": {
|
|
"redis-cache": "/var/lib/redis-module/grants"
|
|
},
|
|
"secrets": {
|
|
"secret": "/var/lib/redis-module/default.secret"
|
|
},
|
|
"own-secrets": {
|
|
"broker": "/var/lib/mesh/redis/broker"
|
|
},
|
|
"listens": [
|
|
{
|
|
"port": 6379,
|
|
"protocol": "tcp",
|
|
"from": "mesh",
|
|
"why": "modules on any machine that were granted a cache"
|
|
}
|
|
],
|
|
"resources": [
|
|
{
|
|
"id": "mesh-state",
|
|
"type": "directory",
|
|
"path": "/var/lib/mesh/redis",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "state",
|
|
"type": "directory",
|
|
"path": "/var/lib/redis-module",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "grants-dir",
|
|
"type": "directory",
|
|
"path": "/var/lib/redis-module/grants",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "data",
|
|
"type": "directory",
|
|
"path": "/services/redis/data",
|
|
"mode": "0700",
|
|
"owner": "999:999"
|
|
},
|
|
{
|
|
"id": "server-conf",
|
|
"type": "file",
|
|
"path": "/var/lib/redis-module/redis.conf",
|
|
"mode": "0600",
|
|
"content": "requirepass ${secret:secret}\nappendonly yes\ndir /data\n",
|
|
"owner": "999:999"
|
|
},
|
|
{
|
|
"id": "net",
|
|
"type": "network",
|
|
"name": "redis"
|
|
},
|
|
{
|
|
"id": "server",
|
|
"type": "container",
|
|
"name": "redis",
|
|
"image": "redis@sha256:ff02b58f971e7d7d156a1267e283fcbbeee91773b6aa36c49dac28ecfe28eadf",
|
|
"network": "redis",
|
|
"ports": [
|
|
"6379"
|
|
],
|
|
"volumes": [
|
|
"/services/redis/data:/data",
|
|
"/var/lib/redis-module/redis.conf:/etc/redis/redis.conf:ro"
|
|
],
|
|
"args": [
|
|
"/etc/redis/redis.conf"
|
|
],
|
|
"restart-on": [
|
|
"server-conf"
|
|
]
|
|
},
|
|
{
|
|
"id": "runtime",
|
|
"type": "container",
|
|
"name": "mesh-redis",
|
|
"network": "redis",
|
|
"volumes": [
|
|
"/var/lib/mesh/redis/broker:/run/secrets/broker:ro",
|
|
"/var/lib/redis-module/grants:/var/lib/redis-module/grants:ro",
|
|
"/var/lib/redis-module/default.secret:/run/secrets/default:ro"
|
|
],
|
|
"env": {
|
|
"MESH_BROKER_FILE": "/run/secrets/broker",
|
|
"MESH_RECEIVES": "/var/lib/redis-module/grants/mesh.json",
|
|
"MESH_PROVISION_REDIS": "redis:6379",
|
|
"MESH_PROVISION_PASSWORD_FILE": "/run/secrets/default"
|
|
},
|
|
"artifact": "runtime"
|
|
}
|
|
],
|
|
"build": {
|
|
"on": [
|
|
{
|
|
"arg": "BUILD_BASE",
|
|
"module": "mesh-tools",
|
|
"artifact": "build"
|
|
},
|
|
{
|
|
"arg": "RUNTIME_BASE",
|
|
"module": "mesh-tools",
|
|
"artifact": "runtime"
|
|
}
|
|
],
|
|
"artifacts": [
|
|
{
|
|
"name": "runtime",
|
|
"kind": "image",
|
|
"from": "Dockerfile"
|
|
}
|
|
]
|
|
}
|
|
}
|