Skip to content

Commit f12fcf4

Browse files
authored
fix(superset): Patch pinned packages and re-generate lock file (#1456)
* fix(superset): Add patch to pin @types/offscreencanvas to 2019.7.0 * refactor(superset): Use nvm to manage node and npm * chore: Add scrupt to upload new nvm version to repo * fix(superset): Add patch with re-generated package-lock.json file * chore(superset): Use dot to source
1 parent c5472af commit f12fcf4

5 files changed

Lines changed: 216 additions & 7 deletions

File tree

.scripts/upload_new_nvm_version.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
VERSION=${1:?"Missing version number argument (arg 1)"}
6+
NEXUS_USER=${2:?"Missing Nexus username argument (arg 2)"}
7+
8+
read -r -s -p "Nexus Password: " NEXUS_PASSWORD
9+
echo ""
10+
11+
# https://stackoverflow.com/questions/4632028/how-to-create-a-temporary-directory
12+
# Find the directory name of the script
13+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
14+
15+
# the temp directory used, within $DIR
16+
WORK_DIR=$(mktemp -d -p "$DIR")
17+
18+
# check if tmp dir was created
19+
if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
20+
echo "Could not create temp dir"
21+
exit 1
22+
fi
23+
24+
# deletes the temp directory
25+
function cleanup {
26+
rm -rf "$WORK_DIR"
27+
}
28+
29+
# register the cleanup function to be called on the EXIT signal
30+
trap cleanup EXIT
31+
32+
cd "$WORK_DIR" || exit
33+
34+
echo "Downloading nvm.sh @ $VERSION from github.com"
35+
curl --fail -L --progress-bar -o "nvm-$VERSION.sh" "https://raw.githubusercontent.com/nvm-sh/nvm/refs/tags/${VERSION}/nvm.sh"
36+
37+
echo "Uploading nvm-$VERSION.sh to Nexus"
38+
curl --fail -o /dev/null --progress-bar -u "$NEXUS_USER:$NEXUS_PASSWORD" \
39+
--upload-file "nvm-$VERSION.sh" \
40+
'https://repo.stackable.tech/repository/packages/nvm/'
41+
42+
echo "Successfully uploaded new version $VERSION to Nexus"
43+
echo "https://repo.stackable.tech/service/rest/repository/browse/packages/nvm/"

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+
. /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+
. /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"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
From de686d44116e76753c45efea2faed4e187032c4f Mon Sep 17 00:00:00 2001
2+
From: Techassi <git@techassi.dev>
3+
Date: Tue, 7 Apr 2026 08:56:30 +0200
4+
Subject: Pin @types/offscreencanvas to 2019.7.0
5+
6+
This is again a similar issue like #1363.
7+
---
8+
superset-frontend/package.json | 1 +
9+
1 file changed, 1 insertion(+)
10+
11+
diff --git a/superset-frontend/package.json b/superset-frontend/package.json
12+
index 0f59fff60..bc2746107 100644
13+
--- a/superset-frontend/package.json
14+
+++ b/superset-frontend/package.json
15+
@@ -365,6 +365,7 @@
16+
"ansi-regex": "^4.1.1"
17+
},
18+
"puppeteer": "^22.4.1",
19+
+ "@types/offscreencanvas": "2019.7.0",
20+
"@types/react": "^16.9.53",
21+
"sax": "1.2.4"
22+
},

superset/stackable/patches/4.1.4/0004-Re-generate-package-lock.json-file.patch

Lines changed: 130 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)