The mesh refused to place it — two of its three containers named mesh-runtime-lavinmq@sha256:000…0, "a placeholder digest, which is never a real image". That refusal was right, and the belief behind the placeholder was that lavinmq needs no building because its broker is an upstream image. The broker is upstream. The module is not the broker. It carries a run-once bootstrap that writes the broker's configuration before it first starts, a provisioner that grants each consumer its own vhost and user, a set of tools and an event consumer — all of it this module's own TypeScript, and none of it producible by naming somebody else's image. So it gets what every module with code of its own gets: a Dockerfile standing on the shared toolchain and runtime bases, a build block naming them, and containers that name the artifact rather than a digest nothing can produce. Same recipe as postgres, which is the converted module closest in shape — it has a provisioner too. Noted and deliberately not changed: postgres runs its provisioner from its container's args, and lavinmq's equivalent container names none, so on this manifest the provisioner is never started. That may be why, or may be a second fault; it is left alone so the next run says which. Claude-Session: https://claude.ai/code/session_01D6qtiYU3P9jk3pnAXyAFyx
155 lines
3.6 KiB
JSON
155 lines
3.6 KiB
JSON
{
|
|
"module": "lavinmq",
|
|
"version": "1",
|
|
"provides": [
|
|
{
|
|
"name": "amqp",
|
|
"scope": "mesh"
|
|
}
|
|
],
|
|
"capabilities": [
|
|
"container-runtime"
|
|
],
|
|
"emits": [
|
|
"module.lavinmq.amqp.provisioned",
|
|
"module.lavinmq.amqp.deprovisioned"
|
|
],
|
|
"consumes": [
|
|
"module.lavinmq.amqp.provisioned",
|
|
"module.lavinmq.amqp.deprovisioned"
|
|
],
|
|
"serves": {
|
|
"amqp": {
|
|
"port": 5672
|
|
}
|
|
},
|
|
"receives": {
|
|
"amqp": "/var/lib/lavinmq-module/grants/mesh.json"
|
|
},
|
|
"grants": {
|
|
"amqp": "/var/lib/lavinmq-module/grants"
|
|
},
|
|
"own-secrets": {
|
|
"default": "/var/lib/lavinmq-module/default.secret",
|
|
"broker": "/var/lib/mesh/lavinmq/broker"
|
|
},
|
|
"listens": [
|
|
{
|
|
"port": 5672,
|
|
"protocol": "tcp",
|
|
"from": "mesh",
|
|
"why": "modules on any machine that were granted a queue"
|
|
}
|
|
],
|
|
"resources": [
|
|
{
|
|
"id": "mesh-state",
|
|
"type": "directory",
|
|
"path": "/var/lib/mesh/lavinmq",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "state",
|
|
"type": "directory",
|
|
"path": "/var/lib/lavinmq-module",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "grants-dir",
|
|
"type": "directory",
|
|
"path": "/var/lib/lavinmq-module/grants",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "data",
|
|
"type": "directory",
|
|
"path": "/services/lavinmq/data",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "net",
|
|
"type": "network",
|
|
"name": "lavinmq"
|
|
},
|
|
{
|
|
"id": "bootstrap",
|
|
"type": "container",
|
|
"name": "lavinmq-bootstrap",
|
|
"artifact": "runtime",
|
|
"run-once": true,
|
|
"volumes": [
|
|
"/var/lib/lavinmq-module:/var/lib/lavinmq-module",
|
|
"/var/lib/lavinmq-module/default.secret:/run/secrets/default:ro"
|
|
],
|
|
"env": {
|
|
"MESH_PROVISION_ADMIN_USER": "mesh-admin",
|
|
"MESH_PROVISION_PASSWORD_FILE": "/run/secrets/default",
|
|
"MESH_LAVINMQ_CONFIG_OUT": "/var/lib/lavinmq-module/lavinmq.ini",
|
|
"MESH_LAVINMQ_DATA_DIR": "/var/lib/lavinmq"
|
|
},
|
|
"args": [
|
|
"run",
|
|
"/app/modules/lavinmq/dist/bootstrap/index.js"
|
|
]
|
|
},
|
|
{
|
|
"id": "server",
|
|
"type": "container",
|
|
"name": "lavinmq",
|
|
"image": "cloudamqp/lavinmq@sha256:3eb54c12916d700a978c2ea86e6362cd4974b0e3189508718006d4e6d341246b",
|
|
"network": "lavinmq",
|
|
"ports": [
|
|
"5672"
|
|
],
|
|
"volumes": [
|
|
"/services/lavinmq/data:/var/lib/lavinmq",
|
|
"/var/lib/lavinmq-module/lavinmq.ini:/etc/lavinmq/lavinmq.ini:ro"
|
|
],
|
|
"args": [
|
|
"--config",
|
|
"/etc/lavinmq/lavinmq.ini"
|
|
]
|
|
},
|
|
{
|
|
"id": "runtime",
|
|
"type": "container",
|
|
"name": "mesh-lavinmq",
|
|
"artifact": "runtime",
|
|
"network": "lavinmq",
|
|
"volumes": [
|
|
"/var/lib/mesh/lavinmq/broker:/run/secrets/broker:ro",
|
|
"/var/lib/lavinmq-module/grants:/var/lib/lavinmq-module/grants:ro",
|
|
"/var/lib/lavinmq-module/default.secret:/run/secrets/default:ro"
|
|
],
|
|
"env": {
|
|
"MESH_BROKER_FILE": "/run/secrets/broker",
|
|
"MESH_RECEIVES": "/var/lib/lavinmq-module/grants/mesh.json",
|
|
"MESH_PROVISION_LAVINMQ": "http://lavinmq:15672",
|
|
"MESH_PROVISION_ADMIN_USER": "mesh-admin",
|
|
"MESH_PROVISION_PASSWORD_FILE": "/run/secrets/default"
|
|
}
|
|
}
|
|
],
|
|
"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"
|
|
}
|
|
]
|
|
}
|
|
}
|