Modules compile in the toolchain and ship on the runtime #22

Merged
jschoubben merged 1 commits from feat/build-and-run-are-two-images into main 2026-09-14 00:02:42 +00:00
6 changed files with 39 additions and 18 deletions
+8 -6
View File
@@ -5,14 +5,16 @@
# other artifact. That is what makes this buildable by the mesh from a repository and a path # other artifact. That 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. # (novox/hq ADR 0069) rather than only on a workstation that happens to have the siblings.
# #
# Named, not pinned. The mesh answers this with the copy of the runtime it holds, because a # Two bases, named rather than pinned: the image this is COMPILED in, and the image it RUNS in.
# fingerprint written here would name one particular copy — the one on whichever machine the person # They are different images on purpose — the first carries a compiler and the second must not, or
# typing it was using — and on any other mesh that copy has never existed (novox/hq issue 044). # every running container would carry one it never invokes. The mesh answers both with the copies it
# Declared in module.json's `build.on`; there is deliberately no default, so a build nobody told # holds, because a fingerprint written here would name one particular copy and no other mesh has it
# stops here rather than on a reference that resolves to nothing. # (novox/hq issue 044). Declared in module.json's `build.on`; deliberately no defaults, so a build
# nobody told stops here and says which module to build first.
ARG BUILD_BASE
ARG RUNTIME_BASE ARG RUNTIME_BASE
FROM ${RUNTIME_BASE} AS build FROM ${BUILD_BASE} AS build
# Compiled under /app/modules, so resolving `@novox/mesh-sdk` walks up to the base's own # Compiled under /app/modules, so resolving `@novox/mesh-sdk` walks up to the base's own
# node_modules — the module is compiled against exactly the sdk it will run against. # node_modules — the module is compiled against exactly the sdk it will run against.
WORKDIR /app/modules/amqp-ping WORKDIR /app/modules/amqp-ping
+5
View File
@@ -59,6 +59,11 @@
], ],
"build": { "build": {
"on": [ "on": [
{
"arg": "BUILD_BASE",
"module": "mesh-tools",
"artifact": "build"
},
{ {
"arg": "RUNTIME_BASE", "arg": "RUNTIME_BASE",
"module": "mesh-tools", "module": "mesh-tools",
+8 -6
View File
@@ -5,14 +5,16 @@
# nothing is copied out of a neighbouring checkout — which is what lets the mesh build this from a # nothing is copied out of a neighbouring checkout — which is what lets the mesh build this from a
# repository and a path (novox/hq ADR 0069) rather than only on a workstation with the siblings. # repository and a path (novox/hq ADR 0069) rather than only on a workstation with the siblings.
# #
# Named, not pinned. The mesh answers this with the copy of the runtime it holds, because a # Two bases, named rather than pinned: the image this is COMPILED in, and the image it RUNS in.
# fingerprint written here would name one particular copy — the one on whichever machine the person # They are different images on purpose — the first carries a compiler and the second must not, or
# typing it was using — and on any other mesh that copy has never existed (novox/hq issue 044). # every running container would carry one it never invokes. The mesh answers both with the copies it
# Declared in module.json's `build.on`; there is deliberately no default, so a build nobody told # holds, because a fingerprint written here would name one particular copy and no other mesh has it
# stops here rather than on a reference that resolves to nothing. # (novox/hq issue 044). Declared in module.json's `build.on`; deliberately no defaults, so a build
# nobody told stops here and says which module to build first.
ARG BUILD_BASE
ARG RUNTIME_BASE ARG RUNTIME_BASE
FROM ${RUNTIME_BASE} AS build FROM ${BUILD_BASE} AS build
# Compiled under /app/modules so `@novox/mesh-sdk` resolves upward into the base's own # Compiled under /app/modules so `@novox/mesh-sdk` resolves upward into the base's own
# node_modules — the module is compiled against exactly the sdk it will run against. # node_modules — the module is compiled against exactly the sdk it will run against.
WORKDIR /app/modules/mesh-catalog WORKDIR /app/modules/mesh-catalog
+5
View File
@@ -79,6 +79,11 @@
], ],
"build": { "build": {
"on": [ "on": [
{
"arg": "BUILD_BASE",
"module": "mesh-tools",
"artifact": "build"
},
{ {
"arg": "RUNTIME_BASE", "arg": "RUNTIME_BASE",
"module": "mesh-tools", "module": "mesh-tools",
+8 -6
View File
@@ -6,14 +6,16 @@
# repository and a path (novox/hq ADR 0069) rather than only on a workstation that happens to have # repository and a path (novox/hq ADR 0069) rather than only on a workstation that happens to have
# the siblings. # the siblings.
# #
# Named, not pinned. The mesh answers this with the copy of the runtime it holds, because a # Two bases, named rather than pinned: the image this is COMPILED in, and the image it RUNS in.
# fingerprint written here would name one particular copy — the one on whichever machine the person # They are different images on purpose — the first carries a compiler and the second must not, or
# typing it was using — and on any other mesh that copy has never existed (novox/hq issue 044). # every running container would carry one it never invokes. The mesh answers both with the copies it
# Declared in module.json's `build.on`; there is deliberately no default, so a build nobody told # holds, because a fingerprint written here would name one particular copy and no other mesh has it
# stops here rather than on a reference that resolves to nothing. # (novox/hq issue 044). Declared in module.json's `build.on`; deliberately no defaults, so a build
# nobody told stops here and says which module to build first.
ARG BUILD_BASE
ARG RUNTIME_BASE ARG RUNTIME_BASE
FROM ${RUNTIME_BASE} AS build FROM ${BUILD_BASE} AS build
# Compiled under /app/modules so `@novox/mesh-sdk` resolves upward into the base's own # Compiled under /app/modules so `@novox/mesh-sdk` resolves upward into the base's own
# node_modules — the module is compiled against exactly the sdk it will run against. # node_modules — the module is compiled against exactly the sdk it will run against.
WORKDIR /app/modules/postgres WORKDIR /app/modules/postgres
+5
View File
@@ -123,6 +123,11 @@
], ],
"build": { "build": {
"on": [ "on": [
{
"arg": "BUILD_BASE",
"module": "mesh-tools",
"artifact": "build"
},
{ {
"arg": "RUNTIME_BASE", "arg": "RUNTIME_BASE",
"module": "mesh-tools", "module": "mesh-tools",