Skip to content

ci: Increase memory limit and disable concurrent builds for esbuild in docker#9862

Merged
ogabrielluiz merged 1 commit into
mainfrom
update-dockerfiles-node-options
Sep 15, 2025
Merged

ci: Increase memory limit and disable concurrent builds for esbuild in docker#9862
ogabrielluiz merged 1 commit into
mainfrom
update-dockerfiles-node-options

Conversation

@ogabrielluiz
Copy link
Copy Markdown
Contributor

@ogabrielluiz ogabrielluiz commented Sep 15, 2025

Adjust the memory limit to prevent esbuild crashes and disable concurrent builds across multiple Dockerfiles.

Summary by CodeRabbit

  • Bug Fixes

    • Reduced frontend build failures during Docker image creation by increasing memory allocation and limiting build concurrency, improving reliability across platforms (including emulated architectures).
  • Chores

    • Standardized Docker build configuration for the frontend across images to enhance stability and consistency.
    • No changes to runtime behavior or public interfaces.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 15, 2025

Walkthrough

In four Dockerfiles, the frontend build command increases Node.js heap from 4096 MB to 8192 MB and adds JOBS=1 to force single-threaded builds. One file also adds a comment explaining the change. No other build steps are modified.

Changes

Cohort / File(s) Summary
Docker frontend build config update
docker/build_and_push.Dockerfile, docker/build_and_push_base.Dockerfile, docker/build_and_push_ep.Dockerfile, docker/build_and_push_with_extras.Dockerfile
Updated frontend build to NODE_OPTIONS="--max-old-space-size=8192" JOBS=1 npm run build (was 4096 without JOBS=1). In build_and_push_base, added a comment explaining memory increase and reduced concurrency. Other steps unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title concisely and accurately summarizes the primary change: raising Node's memory limit and disabling concurrent esbuild builds in Docker configuration; it directly matches the edits across multiple Dockerfiles and aligns with the PR objectives.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update-dockerfiles-node-options

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (4)
docker/build_and_push_with_extras.Dockerfile (1)

55-58: Cap esbuild threads with GOMAXPROCS=1 for deterministic, low‑memory builds

Same rationale as other Dockerfiles: JOBS=1 won’t affect esbuild; use GOMAXPROCS=1 alongside your heap bump.

Apply:

-    && NODE_OPTIONS="--max-old-space-size=8192" JOBS=1 npm run build \
+    && NODE_OPTIONS="--max-old-space-size=8192" GOMAXPROCS=1 JOBS=1 npm run build \
docker/build_and_push_ep.Dockerfile (1)

55-58: Use GOMAXPROCS=1 to actually disable esbuild concurrency

This ensures the Go runtime inside esbuild runs single‑threaded. Keep JOBS=1 if you also want to serialize node‑gyp.

Apply:

-    && NODE_OPTIONS="--max-old-space-size=8192" JOBS=1 npm run build \
+    && NODE_OPTIONS="--max-old-space-size=8192" GOMAXPROCS=1 JOBS=1 npm run build \
docker/build_and_push_base.Dockerfile (1)

59-61: Make frontend install reproducible and cached; align with other Dockerfiles

Here you use npm install without cache mount; other images use npm ci with an npm cache. This hurts determinism and cacheability.

Apply:

-RUN npm install \
-    && NODE_OPTIONS="--max-old-space-size=8192" JOBS=1 npm run build \
+RUN --mount=type=cache,target=/root/.npm \
+    npm ci --no-audit --fund=false \
+    && NODE_OPTIONS="--max-old-space-size=8192" GOMAXPROCS=1 JOBS=1 npm run build \
docker/build_and_push.Dockerfile (1)

55-58: Set GOMAXPROCS=1 when running the frontend build

src/frontend/package.json shows "build": "vite build" and an "esbuild" dependency — JOBS=1 won't throttle esbuild's Go workers; add GOMAXPROCS=1 to cap Go threads.

Apply:

-    && NODE_OPTIONS="--max-old-space-size=8192" JOBS=1 npm run build \
+    && NODE_OPTIONS="--max-old-space-size=8192" GOMAXPROCS=1 JOBS=1 npm run build \
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bd2bb4c and 369d4af.

📒 Files selected for processing (4)
  • docker/build_and_push.Dockerfile (1 hunks)
  • docker/build_and_push_base.Dockerfile (1 hunks)
  • docker/build_and_push_ep.Dockerfile (1 hunks)
  • docker/build_and_push_with_extras.Dockerfile (1 hunks)
🔇 Additional comments (1)
docker/build_and_push_base.Dockerfile (1)

58-61: Good call adding the explanatory comment

The note about emulated architectures is helpful context.

@ogabrielluiz ogabrielluiz merged commit 974cbe0 into main Sep 15, 2025
18 checks passed
@ogabrielluiz ogabrielluiz deleted the update-dockerfiles-node-options branch September 15, 2025 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant