fix(ui): optimize UI Docker build and fix EMFILE on npm ci - #369
Open
atripathy86 wants to merge 1 commit into
Open
fix(ui): optimize UI Docker build and fix EMFILE on npm ci#369atripathy86 wants to merge 1 commit into
atripathy86 wants to merge 1 commit into
Conversation
npm install with ~1500 packages in a rootless container calls fchown() on every extracted file. Each EINVAL failure cascades into additional error-handler fd opens, exhausting the container's default nofile limit (1024 in buildah/runc) with EMFILE / exit 232. - Replace 4 ad-hoc npm install RUN steps with a single npm ci - Add --unsafe-perm to suppress fchown calls that fail in rootless builds - Add --legacy-peer-deps, --no-audit, --no-fund to reduce fd and I/O pressure - Use isolated cache path (--cache /tmp/.npm) to avoid cross-build contention - Add NODE_OPTIONS=--max-old-space-size=4096 for webpack compilation headroom - Move svg.js and d3 from Dockerfile installs into package.json dependencies - Regenerate package-lock.json to include svg.js and d3 for npm ci validity
atripathy86
requested review from
AyeshaSanadi,
annmary-roy,
Copilot and
varkha-d-sharma
and removed request for
AyeshaSanadi,
Copilot and
varkha-d-sharma
August 3, 2026 20:42
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses UI container build failures (EMFILE / exit 232) in rootless Podman by making the UI dependency install more deterministic and less FD-intensive during image builds, and by moving ad-hoc Dockerfile installs into the UI’s normal dependency graph.
Changes:
- Consolidate UI image dependency installation into a single
npm cistep with build-focused flags and a dedicated npm cache path. - Add
d3andsvg.jstoui/package.jsonand regenerateui/package-lock.jsonto keepnpm civalid. - Add
NODE_OPTIONS=--max-old-space-size=4096for webpack build headroom.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| ui/package.json | Adds d3 and svg.js as declared dependencies so Docker builds can rely on npm ci rather than ad-hoc installs. |
| ui/package-lock.json | Regenerated lockfile to include the new dependencies and align installs with npm ci. |
| ui/Dockerfile | Replaces multiple npm install layers with a single npm ci invocation and adds Node memory options for build stability. |
Files not reviewed (1)
- ui/package-lock.json: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+23
to
+25
| "papaparse": "^5.5.2", | ||
| "svg.js": "*", | ||
| "d3": "*" |
Comment on lines
+24
to
+25
| "svg.js": "*", | ||
| "d3": "*" |
Comment on lines
+11
to
+12
| # --unsafe-perm skips fchown calls that fail in rootless Podman and cause EMFILE cascade | ||
| RUN npm ci --legacy-peer-deps --no-audit --no-fund --unsafe-perm --cache /tmp/.npm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
npm install with ~1500 packages in a rootless container calls fchown() on every extracted file. Each EINVAL failure cascades into additional error-handler fd opens, exhausting the container's default nofile limit (1024 in buildah/runc) with EMFILE / exit 232.
Related Issues / Pull Requests
#368
Description
Include a brief summary of the proposed changes.
What changes are proposed in this pull request?
examples in this repository need to be updated too).
Checklist:
uses Google-style formatting and any other formatting that is supported by mkdocs and plugins this project
uses.