From 157770c17051c946c20433b76b0258eab10e9a9b Mon Sep 17 00:00:00 2001 From: Marcus Messer Date: Fri, 31 Jul 2026 16:49:40 +0100 Subject: [PATCH 1/2] Added Wolfram evaluation-function toolkit setup to Dockerfile for shared JSON communications layer. --- wolfram/Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wolfram/Dockerfile b/wolfram/Dockerfile index 0eececd..482a171 100644 --- a/wolfram/Dockerfile +++ b/wolfram/Dockerfile @@ -21,6 +21,7 @@ RUN case $(uname -m) in \ FROM --platform=linux/amd64 ${WWE} ARG WOLFRAM_ENGINE_VERSION=15.0 +ARG TOOLKIT_WOLFRAM_VERSION=v1.1.0 ENV LOG_FORMAT="production" @@ -30,6 +31,15 @@ WORKDIR /app # add wstp server to path ENV PATH=$PATH:/usr/local/Wolfram/WolframEngine/${WOLFRAM_ENGINE_VERSION}/SystemFiles/Links/WSTPServer +# add the shared Wolfram evaluation-function toolkit (JSON comms layer), +# used by all Wolfram-based evaluation functions via PacletDirectoryLoad. +RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates \ + && rm -rf /var/lib/apt/lists/* +RUN git clone --branch ${TOOLKIT_WOLFRAM_VERSION} --depth 1 \ + https://github.com/lambda-feedback/toolkit-wolfram.git /opt/lambda-feedback/toolkit-wolfram + +ENV LF_TOOLKIT_PATH="/opt/lambda-feedback/toolkit-wolfram" + # add shimmy COPY --from=shimmy /shimmy /usr/local/bin/shimmy From b070c2985a585c29e924cbc90b5d205df1c0d496 Mon Sep 17 00:00:00 2001 From: Marcus Messer Date: Mon, 3 Aug 2026 17:20:52 +0100 Subject: [PATCH 2/2] Added Bootstrap.wl setup to Dockerfile and updated README with evaluate.m/preview.m convention for Wolfram evaluation functions. --- wolfram/Dockerfile | 9 +++++++++ wolfram/README.md | 19 ++++++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/wolfram/Dockerfile b/wolfram/Dockerfile index 482a171..565ce73 100644 --- a/wolfram/Dockerfile +++ b/wolfram/Dockerfile @@ -40,6 +40,15 @@ RUN git clone --branch ${TOOLKIT_WOLFRAM_VERSION} --depth 1 \ ENV LF_TOOLKIT_PATH="/opt/lambda-feedback/toolkit-wolfram" +# Every Wolfram evaluation function follows the same shape: an evaluate.m +# and preview.m providing evaluate`EvaluationFunction / preview`PreviewFunction. +# Bootstrap.wl (shipped by toolkit-wolfram, cloned above) is the one fixed +# entry point that wires those into the toolkit's ServeEvaluationFunction -- +# evaluation function repos only need to COPY their evaluate.m/preview.m +# into WORKDIR, not their own entry script. +ENV FUNCTION_COMMAND="wolframscript" +ENV FUNCTION_ARGS="-f,/opt/lambda-feedback/toolkit-wolfram/Bootstrap.wl" + # add shimmy COPY --from=shimmy /shimmy /usr/local/bin/shimmy diff --git a/wolfram/README.md b/wolfram/README.md index 4efb46e..d3537f7 100644 --- a/wolfram/README.md +++ b/wolfram/README.md @@ -4,14 +4,23 @@ This is the base image which is intended to be used by evaluation functions writ ## Usage -This image is not meant to be run directly. Instead, it ought to be used as a base image for evaluation functions written in Wolfram Language. The evaluation function should be placed in the `/app` directory. +This image is not meant to be run directly. Instead, it ought to be used as a base image for evaluation functions written in Wolfram Language. -Here is an example of a `Dockerfile` that uses this image as a base: +Every Wolfram evaluation function follows the same shape: an `evaluate.m` and +`preview.m` defining `evaluate\`EvaluationFunction` and +`preview\`PreviewFunction` respectively. This image already wires those into +the shared [`toolkit-wolfram`](https://github.com/lambda-feedback/toolkit-wolfram) +comms layer via `FUNCTION_COMMAND`/`FUNCTION_ARGS` (pointing at +`toolkit-wolfram`'s `Bootstrap.wl`), so a consuming evaluation function repo +only needs to provide those two files: ```Dockerfile FROM ghcr.io/lambda-feedback/evaluation-function-base/wolfram:latest -COPY ./function.wl /app/function.wl - -CMD ["shimmy", "-i", "file", "-c", "wolframscript", "-a", "-f", "-a", "/app/function.wl"] +COPY ./evaluate.m /app/evaluate.m +COPY ./preview.m /app/preview.m ``` + +A repo that needs custom wiring instead of the standard `evaluate.m`/ +`preview.m` convention can still override `FUNCTION_COMMAND`/`FUNCTION_ARGS` +to point at its own entry script.