From 0cb67e856f70a5453369d892c4d3849b90583248 Mon Sep 17 00:00:00 2001 From: jochen Date: Sat, 3 Oct 2026 23:33:51 +0200 Subject: [PATCH] influxdb: its tools and provisioner run in the node's runtime (hq ADR 0198) The mesh-influxdb container goes with its Dockerfile, build bases and bus credential; its env becomes the bundle's words with mount targets folded back to host paths. --- modules/influxdb/Dockerfile | 24 ---------------- modules/influxdb/module.json | 56 +++++++++++------------------------- 2 files changed, 17 insertions(+), 63 deletions(-) delete mode 100644 modules/influxdb/Dockerfile diff --git a/modules/influxdb/Dockerfile b/modules/influxdb/Dockerfile deleted file mode 100644 index fb4b123..0000000 --- a/modules/influxdb/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -# influxdb's runtime: the tool runtime, carrying this module's compiled code. -# -# **Built from this module's own directory and nothing else.** The sdk and the tool runtime are in -# the base images, published like any other artifact — which is what makes this buildable by the -# mesh from a repository and a path (novox/hq ADR 0069) rather than only on a workstation that -# happens to have the siblings. -# -# Two bases, named rather than pinned (novox/hq issue 044): the image this is COMPILED in and the -# image it RUNS in — the second must not carry a compiler. Declared in module.json's `build.on`. -ARG BUILD_BASE -ARG RUNTIME_BASE - -FROM ${BUILD_BASE} AS build -WORKDIR /app/modules/influxdb -COPY . . -RUN node /app/node_modules/typescript/bin/tsc client.ts grants.ts provisioner/index.ts tools/index.ts \ - --module NodeNext --moduleResolution NodeNext --target ES2022 --outDir dist - -FROM ${RUNTIME_BASE} -COPY --from=build /app/modules/influxdb/dist /app/modules/influxdb/dist -# Every serve-time entrypoint, loaded by the runtime in serve mode: tools and events serve, and a -# provider's provisioner runs its reconcile loop in the same process, with the broker connected — -# the convention novox/hq issues 060/061 settled. -ENV MESH_TOOL_MODULES=/app/modules/influxdb/dist/tools/index.js,/app/modules/influxdb/dist/provisioner/index.js diff --git a/modules/influxdb/module.json b/modules/influxdb/module.json index 3b8976c..0232510 100644 --- a/modules/influxdb/module.json +++ b/modules/influxdb/module.json @@ -11,7 +11,6 @@ "container-runtime" ], "own-secrets": { - "broker": "${dir:mesh-state}/broker", "admin": "${dir:state}/admin.secret", "admin-token": "${dir:state}/admin-token.secret" }, @@ -100,29 +99,6 @@ "mode": "0600", "content": "{}\n", "merge": "json" - }, - { - "id": "runtime", - "type": "container", - "name": "mesh-influxdb", - "network": "host", - "volumes": [ - "${dir:mesh-state}/broker:/run/secrets/broker:ro", - "${dir:mesh-state}/config.json:/run/config/config.json:ro", - "${dir:state}/admin-token.secret:/run/secrets/admin-token:ro", - "${dir:grants}:${dir:grants}:ro" - ], - "env": { - "MESH_BROKER_FILE": "/run/secrets/broker", - "MESH_INFLUXDB_URL": "http://127.0.0.1:${port:8086}", - "MESH_INFLUXDB_CONFIG_FILE": "/run/config/config.json", - "MESH_INFLUXDB_TOKEN_FILE": "/run/secrets/admin-token", - "MESH_RECEIVES": "${dir:grants}/mesh.json" - }, - "restart-on": [ - "runtime-config" - ], - "artifact": "runtime" } ], "requires": [ @@ -135,23 +111,25 @@ } }, "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" + "name": "code", + "kind": "bundle", + "language": "typescript", + "entrypoints": [ + "tools/index.js", + "provisioner/index.js" + ], + "loads": [ + "tools/index.js", + "provisioner/index.js" + ], + "env": { + "MESH_INFLUXDB_URL": "http://127.0.0.1:${port:8086}", + "MESH_INFLUXDB_CONFIG_FILE": "${dir:mesh-state}/config.json", + "MESH_INFLUXDB_TOKEN_FILE": "${dir:state}/admin-token.secret", + "MESH_RECEIVES": "${dir:grants}/mesh.json" + } } ] }