This repository was archived by the owner on Apr 4, 2025. It is now read-only.
Limit Bazel to available CCI resources of 3072 MB (of 4096 max) & 2 core#8
Closed
gregmagolan wants to merge 1 commit intoangular:masterfrom
gregmagolan:master
Closed
Limit Bazel to available CCI resources of 3072 MB (of 4096 max) & 2 core#8gregmagolan wants to merge 1 commit intoangular:masterfrom gregmagolan:master
gregmagolan wants to merge 1 commit intoangular:masterfrom
gregmagolan:master
Conversation
Contributor
|
Wow, nice find. What is "CCI"? I don't find anything by googling that. I assume it's related to the kernel-level sandboxing under docker? Maybe you are close to finding the root cause of that bazel issue - it suggests under https://docs.bazel.build/versions/master/bazel-user-manual.html#flag--ram_utilization_factor that Bazel should detect the amount of RAM, it seems that detection doesn't take virtualization into account? |
Contributor
Author
|
My shorthand for CircleCI :) |
Contributor
Author
|
Yea. I checked the free mem in CircleCI during the build and its a huge amount. So no way for Bazel to know then limit is 4096 MB. |
Contributor
|
There has to be some way Bazel can determine that - otherwise anyone using Bazel on Circle would need this workaround flag? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Should fix bazelbuild/bazel#3645.
Issue as far as I can tell is that Bazel was assuming the available resources were much higher than then actually were (the machine the docker container runs on has a ton of resources but CCI limits the container to 4096 MB and 2 cores). During SASS compilation especially there are a lot of gcc calls being launched in parallel which seemed to exceed the 4096 MB max most of the time and kill the build.
Add --local_resources=3072,2.0,1.0 to the bazel build command limits the build to resources to the amounts that CCI allows by default.