Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

reduce golangci-lint overhead for jenkins worker #68

Closed
wants to merge 1 commit into from

Conversation

displague
Copy link
Contributor

@displague displague commented Aug 1, 2019

The changes suggested here appear to improve the overhead of the build process with the latest golangci-lint.
golangci/golangci-lint#337 (comment)

With 1.17.1 of golangci-lint we regularly see 10GB of RAM consumed while linting in local
testing.

Prior to the bump to 1.17.1, golangci-lint 1.15 was taking 6-8GB of RAM and
completing in 10s in local testing.

With the reduction in overhead to golangci-lint that this PR introduces,
linting consumes between 8-9GB of ram and completes in 30s using the same
environment.

The Crossplane Jenkins worker node has only 10GB of RAM available.

The intent here is to continue using latest golangci-lint with the
current Jenkins configuration (not increasing node memory), sacrificing some time. Additional
measures can be made, such as using --fast tests only or further increasing the
LINT_GOGC value. Ultimately we may prefer to revert to golangci-lint v1.15.0 and wait for a version that doesn't inflate the RAM used so significantly.

https://github.com/golangci/golangci-lint#configuration
https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint

Relates to: crossplane/crossplane#577

Closes #71

The crossplane jenkins worker node only has 10gb of RAM.  With 1.17.1 of
golangci-lint we regularly see 10gb consumed while linting in local
environments.

The changes suggested here appear to improve the overhead.
golangci/golangci-lint#337 (comment)

Prior to the bump to 1.17.1, golangci-lint was taking 6-8GB of RAM and
completing in 10s.

With the reduction in overhead to golangci-lint that this PR introduces,
linting consumes between 8-9GB of ram and completes in 30s using the same
environment.

The intent here is to continue using latest golangci-lint with the
current Jenkins configuration, sacrificing some time.  Additional
measure can be made, such as using `--fast` tests only or further increasing the
LINT_GOGC value.

https://github.com/golangci/golangci-lint#configuration
https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint

Signed-off-by: Marques Johansson <marques@upbound.io>
@hasheddan hasheddan requested a review from bassam August 13, 2019 21:31
displague added a commit to displague/build that referenced this pull request Aug 13, 2019
This reverts commit a45f237.

golangci-lint 1.17.1 increased the memory footprint of the CI/CD
processes substantially.

This PR is an alternative to:

* Increasing the RAM on the Jenkins Worker Node
* Decreasing the parallelism, increasing the GC rate, increasing the
lint timeout as is handled by upbound#68

Signed-off-by: Marques Johansson <marques@upbound.io>
@jbw976 jbw976 closed this in #71 Aug 13, 2019
@@ -192,7 +194,7 @@ go.test.integration: $(GOJUNIT)
go.lint: $(GOLANGCILINT)
@$(INFO) golangci-lint
@mkdir -p $(GO_LINT_OUTPUT)
@$(GOLANGCILINT) run $(GO_LINT_ARGS) || $(FAIL)
@LINT_GOGC=20 $(GOLANGCILINT) run $(GO_LINT_ARGS) || $(FAIL)
Copy link

Choose a reason for hiding this comment

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

I think you want @GOGC=20

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants