[release-4.21] Fix OOM during production webpack build#354
[release-4.21] Fix OOM during production webpack build#354upalatucci wants to merge 1 commit intoopenshift:release-4.21from
Conversation
Use transpileOnly in ts-loader to skip type checking during webpack compilation, significantly reducing memory usage. Also set NODE_OPTIONS=--max-old-space-size=4096 for the build script to match the pattern already used by the dev script. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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. Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: upalatucci The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@upalatucci: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
| loader: 'ts-loader', | ||
| options: { | ||
| configFile: path.resolve(__dirname, 'tsconfig.json'), | ||
| transpileOnly: true, |
There was a problem hiding this comment.
@upalatucci Can we instead use esbuild-loader? @vojtechszocs was doing this change in kubevirt to reduce build time
There was a problem hiding this comment.
Yes we did it in main here and I think we should do the same. Let me see if this is was generate the errore
Summary
imagesjob fails withSIGKILL(OOM kill) during the webpack production build because the process exceeds the container memory limit.transpileOnly: truetots-loaderto skip type checking during webpack compilation, which significantly reduces memory (~40-60% reduction). Type checking is already handled separately by ESLint and can be done viatsc --noEmit.NODE_OPTIONS=--max-old-space-size=4096in thebuildscript, matching the pattern already used by thedevscript (which sets 8192MB).Test plan
yarn build) completes successfully locallyimagesjob should pass without OOMMade with Cursor