diff --git a/.github/workflows/deploy-docker.yaml b/.github/workflows/deploy-docker.yaml index 65d0bd4bb6..b62aeba4eb 100644 --- a/.github/workflows/deploy-docker.yaml +++ b/.github/workflows/deploy-docker.yaml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v4 with: lfs: false - submodules: false + submodules: true - name: Do pull to ensure up-to-date run: git pull diff --git a/modules/benchmark b/modules/benchmark index 1a7ac8d0b5..06f84c75be 160000 --- a/modules/benchmark +++ b/modules/benchmark @@ -1 +1 @@ -Subproject commit 1a7ac8d0b59c6b0837253ab60e1de703ab015456 +Subproject commit 06f84c75bee0726f7bb010617e6d8dd8a04190d3 diff --git a/modules/cli b/modules/cli index b1df5ae454..6a4c41e617 160000 --- a/modules/cli +++ b/modules/cli @@ -1 +1 @@ -Subproject commit b1df5ae4543d9dd8d28fed46f0b477a4441fa9e6 +Subproject commit 6a4c41e6171beee1dfdf9ffefa431713be495da7 diff --git a/modules/statistics b/modules/statistics index 355411e920..d19b5c618f 160000 --- a/modules/statistics +++ b/modules/statistics @@ -1 +1 @@ -Subproject commit 355411e920631afdea91ccf47982a35615e7b04b +Subproject commit d19b5c618f844bfcd05e7c26e08f282393fd332a diff --git a/package-lock.json b/package-lock.json index 586fd21c78..e96ee2d9b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,6 @@ "": { "name": "@eagleoutice/flowr", "version": "1.5.0", - "hasInstallScript": true, "license": "ISC", "dependencies": { "@types/semver": "^7.5.6", diff --git a/package.json b/package.json index e5545c2a1a..8d04efe5ab 100644 --- a/package.json +++ b/package.json @@ -74,43 +74,43 @@ { "zones": [ { - "target": "benchmark", + "target": "modules/benchmark", "from": [ - "cli", + "modules/cli", "src", - "statistics" + "modules/statistics" ] }, { - "target": "cli", + "target": "modules/cli", "from": [ - "benchmark", + "modules/benchmark", "src", - "statistics" + "modules/statistics" ] }, { - "target": "statistics", + "target": "modules/statistics", "from": [ - "benchmark", - "cli", + "modules/benchmark", + "modules/cli", "src" ] }, { "target": "src", "from": [ - "benchmark", - "cli", - "statistics" + "modules/benchmark", + "modules/cli", + "modules/statistics" ] }, { "target": "test", "from": [ - "benchmark", - "cli", - "statistics" + "modules/benchmark", + "modules/cli", + "modules/statistics" ] } ] diff --git a/scripts/Dockerfile b/scripts/Dockerfile index b1b6c5fc94..dca66d8b58 100644 --- a/scripts/Dockerfile +++ b/scripts/Dockerfile @@ -4,11 +4,18 @@ FROM node:21.4-alpine3.19 AS builder WORKDIR /app +# copy all modules into the workdir COPY ./src /app/src/ COPY ./package.json ./package-lock.json ./tsconfig.json /app/ +COPY ./modules/benchmark /app/modules/benchmark +COPY ./modules/cli /app/modules/cli +COPY ./modules/statistics /app/modules/statistics -RUN npm install -RUN npm run build +# install and build all modules +RUN npm install && npm run build +RUN cd modules/benchmark && npm install && npm run build +RUN cd modules/cli && npm install && npm run build +RUN cd modules/statistics && npm install && npm run build FROM node:21.4-alpine3.19 AS flowR @@ -19,11 +26,26 @@ WORKDIR /app RUN apk add --no-cache R -# we keep the package.json for module resolution -COPY ./package.json ./scripts/demo.R LICENSE /app/ +COPY ./scripts/demo.R LICENSE /app/ + +# copy all package.jsons so we can install them (see below) +COPY ./package.json /app/ +COPY ./modules/benchmark/package.json /app/modules/benchmark/ +COPY ./modules/cli/package.json /app/modules/cli/ +COPY ./modules/statistics/package.json /app/modules/statistics/ + +# install all modules so that we have dependencies in here too +# (we don't copy them from the builder because builder modules include dev deps too) RUN npm install --omit=dev +RUN cd modules/benchmark && npm install --omit=dev +RUN cd modules/cli && npm install --omit=dev +RUN cd modules/statistics && npm install --omit=dev COPY --from=builder /app/dist/src /app/dist -RUN rm -rf /app/dist/tsconfig.tsbuildinfo +COPY --from=builder /app/modules/benchmark/dist /app/modules/benchmark/dist +COPY --from=builder /app/modules/cli/dist/src /app/modules/cli/dist +COPY --from=builder /app/modules/statistics/dist /app/modules/statistics/dist + +RUN rm -rf /app/**/tsconfig.tsbuildinfo -ENTRYPOINT ["node", "/app/dist/flowr.js"] +ENTRYPOINT ["node", "/app/modules/cli/dist/flowr.js"] diff --git a/tsconfig.json b/tsconfig.json index 84c50230b3..e799db8d72 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,8 +16,6 @@ "exclude": [ "node_modules/**/*", "dist/**/*", - "cli", - "benchmark", - "statistics" + "modules/**/*" ] }