A node being adopted cannot take a web module: every module reachable by name requires route, the mesh's only provider of it binds the two public ports, and the predecessor's proxy holds them and serves every public name there. Stopping the predecessor to break the circle darkens every name at once, with every certificate to re-obtain in the same window. So this answers the same provision without binding anything. It provides route and receives the same contributions file, and writes each contribution as one route file where the predecessor's file provider reads, naming the predecessor's own certificate resolver so no certificate is asked for. It removes a file it wrote when its contribution goes and never touches a file it did not write — the name and a marker inside both have to say it is the mesh's. A step, not a daemon: run-once, re-run by restart-on over the received file and the settings. The predecessor's dynamic directory is a node setting, because it is a fact about one machine. Migration scaffolding with a stated end: assigned only on an adopted node, deleted when the predecessor's proxy retires.
25 lines
1.3 KiB
Docker
25 lines
1.3 KiB
Docker
# route-adapter'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/route-adapter
|
|
COPY . .
|
|
RUN node /app/node_modules/typescript/bin/tsc adapter.ts index.ts \
|
|
--module NodeNext --moduleResolution NodeNext --target ES2022 --outDir dist
|
|
|
|
FROM ${RUNTIME_BASE}
|
|
COPY --from=build /app/modules/route-adapter/dist /app/modules/route-adapter/dist
|
|
# **No MESH_TOOL_MODULES, deliberately.** This module serves no tool and consumes no event: it is a
|
|
# step the host runs to completion, named by the container's `args` as `mesh-tools run …`. Setting a
|
|
# serve-time entrypoint here would give the image a second way to be started — one that connects to
|
|
# the broker and never exits.
|