Disable compiling sourcemaps to reduce build time #3138
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.
This PR just adds image ENV
NO_SOURCEMAPS=true
.As I reported in #2860 (#2860 (comment)), we can set webpack configuration
devtool
tofalse
by setting environment variableNO_SOURCEMAP=true
. This will significantly reduce the time taken by the rake taskgitlab:assets:compile
, which took up a large portion of the image build (total build time have been improved from 30min to 20min on my env).It also reduce image size : v18.1.2, 4.31GB -> 3.86GB.
In webpack documentation, it is recommended to set
devtool
to be disabled on production with maximum performance.Official gitlab image
gitlab/gitlab-ce
andgitlab/gitlab-ee
also does not ship with sourcemaps (see #2860 (comment)).Since I have not yet been able to verify how much each factor, such as CPU, memory, or disk I/O, affects the speed improvement, I would like to check the build time of this pull request to see how much the speed has improved in CI.