-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
terserplugin parallel = 1 #68
base: master
Are you sure you want to change the base?
Conversation
@@ -126,6 +127,15 @@ module.exports = { | |||
maxInitialRequests: 5, | |||
}, | |||
}, | |||
// TODO: This is based on a medium circle CI instance. You can safely allocate up to | |||
// n - 1 cores here where n is the number of cores allocated by your instance size. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm testing whether we can actually allocate n cores, so far seems ok but leaving this here for now.
@@ -7,6 +7,7 @@ const MomentLocalesPlugin = require("moment-locales-webpack-plugin"); | |||
const MomentTimezoneDataPlugin = require("moment-timezone-data-webpack-plugin"); | |||
const path = require("path"); | |||
const TSConfigPathsPlugin = require("tsconfig-paths-webpack-plugin"); | |||
const TerserPlugin = require("terser-webpack-plugin"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want to add this package as a dev dependency to package.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can I just add it manually or do I have to go through the npm install...
process?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can figure out the changes needed by doing an ark init --local-only --template-ref <this branch>
and the other flags ark init
needs, then doing an npm install
, then porting the diffs over here.
Sorry, just wanted to understand: |
@johnhuangclever the root cause of the failed builds seems like it was terser asking for too many resources from Circle CI. Circle CI doesn't proactively communicate its available resources and apparently this can cause the webpack plugin to fail. so this template change should prevent the failures we saw from the flare. |
So a few questions:
|
I think the 2 paths forward are
|
Based on my googling, https://webpack.js.org/plugins/terser-webpack-plugin/ seems like it should not be enabled by default? Unless I have misunderstood the docs And I think any solution we have has the limitation of a theoretical failure point on our CI. Even with the parallelization at 1 there is still a failure point at some point and if we had the choice between slowing down our builds vs speeding them up, I'd rather speed them up provided we have enough headroom if that makes sense. e.g. If the failure point for a new repo is to get to the size of sd2 I think that would be plenty headroom for us imo |
My understanding of the docs is that it runs by default and has some default options baked in, but to configure the options you need to pull in the dependency manually. It seems like in SD2 at least, terser-webpack-plugin existed in package-lock prior to us mucking with it so it was pulled in transitively. Let's just bump it to medium+ and parallelization: 2 |
okay, this is an interesting read: Looks like it links to webpack-contrib/terser-webpack-plugin#143 which potentially talks about the issue we're running into in circleCI (although they mention running into the problem on terser v2 not v2). If what I'm reading is correct, if we use 2 vCPUs in circle by default, then setting the parallel to 2 should be good enough to get things to run properly without running into errors If this is the proper underlying cause of the issues we're seeing it's probably worth to put these links into the webpack config comments |
Overview
Followup to flare-1195, let's set this limiter as the default for frontend repos.