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/06/08 23:56:12 UTC
(superset) 01/01: ci: make Docker-build `npm ci` resilient to transient network blips
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch ci/harden-npm-ci-retries
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 763df3392e10372a9b8f120595c06dc5b5554e46
Author: Claude Code <no...@anthropic.com>
AuthorDate: Mon Jun 8 16:55:56 2026 -0700
ci: make Docker-build `npm ci` resilient to transient network blips
The `docker-build` job fails ~25% of the time on master, almost always because
`npm ci` inside the image build hits a transient `npm error code ECONNRESET`
(errno -104) talking to the npm registry. There is no retry, so a single
dropped connection fails the whole multi-platform build.
Set npm's fetch-retry config via environment variables before `npm ci` in both
the main `Dockerfile` and `superset-websocket/Dockerfile` (build + prod stages):
more retries, longer backoff, and a longer overall fetch timeout. This is a
no-op on the happy path and only kicks in when the registry blips.
Co-Authored-By: Claude Opus 4.8 <no...@anthropic.com>
---
Dockerfile | 7 +++++++
superset-websocket/Dockerfile | 14 +++++++++++++-
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/Dockerfile b/Dockerfile
index 6da35f323b2..f88d71c274d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -55,6 +55,13 @@ WORKDIR /app/superset-frontend
RUN mkdir -p /app/superset/static/assets \
/app/superset/translations
+# Harden `npm ci` against transient npm-registry network blips (e.g. ECONNRESET),
+# which otherwise fail the entire multi-platform image build with no retry.
+ENV npm_config_fetch_retries=5 \
+ npm_config_fetch_retry_mintimeout=20000 \
+ 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
diff --git a/superset-websocket/Dockerfile b/superset-websocket/Dockerfile
index e9aabd124fa..38a8180bf76 100644
--- a/superset-websocket/Dockerfile
+++ b/superset-websocket/Dockerfile
@@ -14,6 +14,13 @@
# limitations under the License.
FROM node:22-alpine AS build
+# Harden `npm ci` against transient npm-registry network blips (e.g. ECONNRESET),
+# which otherwise fail the image build with no retry.
+ENV npm_config_fetch_retries=5 \
+ npm_config_fetch_retry_mintimeout=20000 \
+ npm_config_fetch_retry_maxtimeout=120000 \
+ npm_config_fetch_timeout=600000
+
WORKDIR /home/superset-websocket
COPY . ./
@@ -24,7 +31,12 @@ RUN npm ci && \
FROM node:22-alpine
-ENV NODE_ENV=production
+# Retry npm-registry fetches so a transient blip doesn't fail the build.
+ENV NODE_ENV=production \
+ npm_config_fetch_retries=5 \
+ npm_config_fetch_retry_mintimeout=20000 \
+ npm_config_fetch_retry_maxtimeout=120000 \
+ npm_config_fetch_timeout=600000
WORKDIR /home/superset-websocket
COPY --from=build /home/superset-websocket/dist ./dist