diff --git a/modules/openai-consumer/Dockerfile b/modules/openai-consumer/Dockerfile deleted file mode 100644 index ff58bd2..0000000 --- a/modules/openai-consumer/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -# openai-consumer'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/openai-consumer -COPY . . -RUN node /app/node_modules/typescript/bin/tsc apply/index.ts \ - --module NodeNext --moduleResolution NodeNext --target ES2022 --outDir dist - -FROM ${RUNTIME_BASE} -COPY --from=build /app/modules/openai-consumer/dist /app/modules/openai-consumer/dist -# No serve-time entrypoints: every container of this module names its command (`run` on a -# schedule), so nothing here serves — deliberately no MESH_TOOL_MODULES. diff --git a/modules/openai-consumer/module.json b/modules/openai-consumer/module.json index 6d4a0b0..90457d9 100644 --- a/modules/openai-consumer/module.json +++ b/modules/openai-consumer/module.json @@ -28,44 +28,31 @@ }, { "id": "apply", - "type": "container", - "name": "mesh-openai-consumer-apply", - "network": "host", + "type": "process", + "name": "openai-consumer-apply", + "artifact": "code", + "run": [ + "node", + "apply/index.js" + ], "schedule": "*/5 * * * *", - "args": [ - "run", - "/app/modules/openai-consumer/dist/apply/index.js" - ], - "volumes": [ - "${dir:state}:/run/state" - ], "env": { - "MESH_MODEL_ACCESS_SECRET_FILE": "/run/state/api-key", - "MESH_MODEL_ACCESS_BIND_FILE": "/run/state/model.json", - "MESH_OPENAI_ENV_FILE": "/run/state/config/openai.env", - "MESH_OPENAI_CREDENTIALS_FILE": "/run/state/config/auth.json" - }, - "artifact": "runtime" + "MESH_MODEL_ACCESS_SECRET_FILE": "${dir:state}/api-key", + "MESH_MODEL_ACCESS_BIND_FILE": "${dir:state}/model.json", + "MESH_OPENAI_ENV_FILE": "${dir:state}/config/openai.env", + "MESH_OPENAI_CREDENTIALS_FILE": "${dir:state}/config/auth.json" + } } ], "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": [ + "apply/index.js" + ] } ] }