You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/10/23 00:45:28 UTC
(superset) branch master updated: ci(docker): give the CI node image the workspace manifests so jobs stop reinstalling (#45606)
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new b1c1d41b55f ci(docker): give the CI node image the workspace manifests so jobs stop reinstalling (#45606)
b1c1d41b55f is described below
commit b1c1d41b55f8511b21b440adb3303516f4752dfa
Author: Evan Rusackas <ev...@preset.io>
AuthorDate: Fri Oct 23 01:45:19 2026 +0100
ci(docker): give the CI node image the workspace manifests so jobs stop reinstalling (#45606)
Co-authored-by: Claude Fable 5.1 <no...@anthropic.com>
---
.github/workflows/chromatic.yml | 2 +-
.github/workflows/frontend-bundle-size-nightly.yml | 2 +-
.github/workflows/superset-frontend.yml | 6 ++---
Dockerfile | 28 +++++++++++++++-------
4 files changed, 25 insertions(+), 13 deletions(-)
diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml
index 0c340d2b3ad..4f74e9307c2 100644
--- a/.github/workflows/chromatic.yml
+++ b/.github/workflows/chromatic.yml
@@ -116,7 +116,7 @@ jobs:
docker run \
-v ${{ github.workspace }}/superset-frontend/storybook-static:/app/superset-frontend/storybook-static \
--rm $TAG \
- bash -c "npm i && npm run build-storybook -- --webpack-stats-json"
+ bash -c "npm run build-storybook -- --webpack-stats-json"
- name: Publish to Chromatic
if: ${{ env.CHROMATIC_PROJECT_TOKEN != '' }}
diff --git a/.github/workflows/frontend-bundle-size-nightly.yml b/.github/workflows/frontend-bundle-size-nightly.yml
index 98a7487cd2d..dca51180051 100644
--- a/.github/workflows/frontend-bundle-size-nightly.yml
+++ b/.github/workflows/frontend-bundle-size-nightly.yml
@@ -92,7 +92,7 @@ jobs:
-v ${{ github.workspace }}/superset/static/assets:/app/superset/static/assets \
--rm $TAG \
bash -c \
- "npm i && BUNDLE_SIZE_STATS=true BUNDLE_ANALYZER=true npm run build -- --json=bundle-stats/stats.json"
+ "BUNDLE_SIZE_STATS=true BUNDLE_ANALYZER=true npm run build -- --json=bundle-stats/stats.json"
- name: Summarize bundle size
run: |
diff --git a/.github/workflows/superset-frontend.yml b/.github/workflows/superset-frontend.yml
index b35d958cd2b..7b960e3bf1b 100644
--- a/.github/workflows/superset-frontend.yml
+++ b/.github/workflows/superset-frontend.yml
@@ -160,12 +160,12 @@ jobs:
- name: lint
run: |
docker run --rm $TAG bash -c \
- "npm i && npm run lint && node --import tsx --test custom-lint-rules/**/*.test.ts"
+ "npm run lint && node --import tsx --test custom-lint-rules/**/*.test.ts"
- name: tsc
run: |
docker run --rm $TAG bash -c \
- "npm i && npm run plugins:build && npm run type"
+ "npm run plugins:build && npm run type"
validate-frontend:
needs: frontend-build
@@ -285,7 +285,7 @@ jobs:
-v ${{ github.workspace }}/superset-frontend/.temp_cache:/app/superset-frontend/.temp_cache \
--rm $TAG \
bash -c \
- "npm i && BUNDLE_SIZE_STATS=true npm run build -- --json=bundle-stats/stats.json"
+ "BUNDLE_SIZE_STATS=true npm run build -- --json=bundle-stats/stats.json"
- name: Summarize bundle size
run: |
diff --git a/Dockerfile b/Dockerfile
index 47c03450899..6d62c0d01fe 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -26,6 +26,20 @@ ARG BUILDPLATFORM=${BUILDPLATFORM:-amd64}
# Include translations in the final build
ARG BUILD_TRANSLATIONS="false"
+######################################################################
+# superset-node-manifests holds only the npm manifests of the frontend
+# tree (the root package.json + lockfile, .npmrc, and every workspace package.json),
+# so the `npm ci` layer in superset-node-ci can see the workspaces and is
+# cached on dependency declarations alone, not on every source change.
+# Docker cannot COPY a glob while keeping the directory structure, hence
+# the copy-then-prune stage.
+######################################################################
+FROM --platform=${BUILDPLATFORM} node:24-trixie-slim AS superset-node-manifests
+WORKDIR /app/superset-frontend
+COPY superset-frontend /app/superset-frontend
+RUN find . -type f ! -name package.json ! -name package-lock.json ! -name .npmrc -delete \
+ && find . -depth -type d -empty -delete
+
######################################################################
# superset-node-ci used as a base for building frontend assets and CI
######################################################################
@@ -62,14 +76,12 @@ ENV npm_config_fetch_retries=5 \
npm_config_fetch_retry_maxtimeout=120000 \
npm_config_fetch_timeout=600000
-# Mount package files and install dependencies if not in dev mode
-# NOTE: we mount packages and plugins as they are referenced in package.json as workspaces
-# ideally we'd COPY only their package.json. Here npm ci will be cached as long
-# as the full content of these folders don't change, yielding a decent cache reuse rate.
-# Note that it's not possible to selectively COPY or mount using blobs.
-RUN --mount=type=bind,source=./superset-frontend/package.json,target=./package.json \
- --mount=type=bind,source=./superset-frontend/package-lock.json,target=./package-lock.json \
- --mount=type=cache,target=/root/.cache \
+# Install dependencies from the manifests alone (root + workspaces) if not in
+# dev mode. With the workspace package.json files present, npm ci links the
+# workspaces and installs their dependencies too, so the CI jobs that run
+# in this image do not need an `npm i` of their own.
+COPY --from=superset-node-manifests /app/superset-frontend /app/superset-frontend
+RUN --mount=type=cache,target=/root/.cache \
--mount=type=cache,target=/root/.npm \
if [ "${DEV_MODE}" = "false" ]; then \
npm ci; \