From 526216eb353d6fd4116053b67bbb1c0d6e693c8b Mon Sep 17 00:00:00 2001 From: Marcus Messer Date: Wed, 13 Aug 2025 16:43:39 +0100 Subject: [PATCH 1/3] Changed dockerfile to use build flags --- Dockerfile | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index a4aedad..97093ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/lambda-feedback/evaluation-function-base/wolfram:latest +FROM ghcr.io/lambda-feedback/evaluation-function-base/wolfram:latest as base # Command to start the evaluation function with ENV FUNCTION_COMMAND="wolframscript" @@ -11,8 +11,15 @@ ENV FUNCTION_INTERFACE="file" ENV LOG_LEVEL="DEBUG" -# Copy Wolfram licence if present - stored as LICENCE.txt for working with the lambda_build Github Actions workflow -RUN if [ -f dist/LICENSE.txt ]; then cp dist/LICENSE.txt /home/wolframengine/.WolframEngine/Licensing/mathpass; else echo "No license file found."; fi - # Copy the evaluation function to the app directory -COPY ./evaluation_function.wl /app/evaluation_function.wl \ No newline at end of file +COPY ./evaluation_function.wl /app/evaluation_function.wl + +FROM base AS with-license +COPY ./dist/LICENCE.txt /home/wolframengine/.WolframEngine/Licensing/mathpass + +FROM base AS without-license +# no COPY, no error + +# Choose final stage with build arg +ARG WITH_LICENSE=false +FROM ${WITH_LICENSE:+with-license}${WITH_LICENSE:-without-license} \ No newline at end of file From 340f63b341984d796a42f568b70162435629a7a4 Mon Sep 17 00:00:00 2001 From: Marcus Messer Date: Wed, 13 Aug 2025 17:30:15 +0100 Subject: [PATCH 2/3] Passed licence to subworkflows --- .github/workflows/deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d49e531..912a67a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -16,3 +16,4 @@ jobs: aws-key-id: ${{ secrets.LAMBDA_CONTAINER_PIPELINE_AWS_ID }} aws-secret-key: ${{ secrets.LAMBDA_CONTAINER_PIPELINE_AWS_SECRET}} function-admin-api-key: ${{ secrets.FUNCTION_ADMIN_API_KEY}} + license: ${{ secrets.LICENSE }} From 3605a1dab43abca3dc8f60cc8ef868d15d397f88 Mon Sep 17 00:00:00 2001 From: Marcus Messer Date: Wed, 13 Aug 2025 17:34:30 +0100 Subject: [PATCH 3/3] Mathpass tied to MAC address, removed licence part from dockerfile --- Dockerfile | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 97093ed..c073218 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,14 +12,4 @@ ENV FUNCTION_INTERFACE="file" ENV LOG_LEVEL="DEBUG" # Copy the evaluation function to the app directory -COPY ./evaluation_function.wl /app/evaluation_function.wl - -FROM base AS with-license -COPY ./dist/LICENCE.txt /home/wolframengine/.WolframEngine/Licensing/mathpass - -FROM base AS without-license -# no COPY, no error - -# Choose final stage with build arg -ARG WITH_LICENSE=false -FROM ${WITH_LICENSE:+with-license}${WITH_LICENSE:-without-license} \ No newline at end of file +COPY ./evaluation_function.wl /app/evaluation_function.wl \ No newline at end of file