Skip to content

Commit 74eb968

Browse files
committed
refactor(superset): Use nvm to manage node and npm
1 parent 12b837c commit 74eb968

2 files changed

Lines changed: 21 additions & 7 deletions

File tree

superset/Dockerfile

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ ARG TARGETOS
4343
ARG CYCLONEDX_BOM_VERSION
4444
ARG UV_VERSION
4545
ARG NODEJS_VERSION
46+
ARG NVM_VERSION
4647
ARG STACKABLE_USER_UID
4748

48-
RUN microdnf module enable -y nodejs:${NODEJS_VERSION} && \
49-
microdnf update \
49+
RUN microdnf update \
5050
&& microdnf install \
5151
cyrus-sasl-devel \
5252
# Needed by ./configure to work out SQLite compilation flags, see snippet [1] at the end of file
@@ -66,9 +66,6 @@ RUN microdnf module enable -y nodejs:${NODEJS_VERSION} && \
6666
python${PYTHON_VERSION}-pip \
6767
python${PYTHON_VERSION}-wheel \
6868
libpq-devel \
69-
# Needed to build Superset UI assets
70-
npm \
71-
nodejs \
7269
# Needed to create the source code snapshot
7370
tar \
7471
# Needed by `npm run build`:
@@ -86,12 +83,27 @@ COPY --chown=${STACKABLE_USER_UID}:0 superset/stackable/patches/${PRODUCT_VERSIO
8683

8784
WORKDIR /stackable
8885

86+
RUN <<EOF
87+
# Download nvm to manage Node and npm installation
88+
curl "https://repo.stackable.tech/repository/packages/nvm/nvm-${NVM_VERSION}.sh" -o /stackable/nvm.sh
89+
source /stackable/nvm.sh
90+
91+
# Install the specified version of Node (including the latest compatible version of npm)
92+
nvm install "$NODEJS_VERSION" --latest-npm
93+
94+
node --version
95+
npm --version
96+
EOF
97+
8998
# Upgrade pip to the latest version
9099
# Also install uv to get support for build constraints
91100
# DL3042 false-positive, --no-chache-dir is specified a few lines below.
92101
# See https://github.com/hadolint/hadolint/issues/1042.
93102
# hadolint ignore=DL3042
94103
RUN <<EOF
104+
# This makes node and npm available in the path
105+
source /stackable/nvm.sh
106+
95107
python${PYTHON_VERSION} -m venv --system-site-packages /stackable/app
96108

97109
source /stackable/app/bin/activate

superset/boil-config.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ cyclonedx-bom-version = "6.0.0"
1010
authlib-version = "1.2.1"
1111
python-version = "3.9"
1212
uv-version = "0.7.3"
13-
nodejs-version = "20"
13+
nodejs-version = "20.20.2"
14+
nvm-version = "v0.40.4"
1415

1516
[versions."6.0.0".local-images]
1617
"shared/statsd-exporter" = "0.28.0"
@@ -24,4 +25,5 @@ cyclonedx-bom-version = "6.0.0"
2425
authlib-version = "1.2.1"
2526
python-version = "3.11"
2627
uv-version = "0.7.3"
27-
nodejs-version = "20"
28+
nodejs-version = "20.20.2"
29+
nvm-version = "v0.40.4"

0 commit comments

Comments
 (0)