Repository navigation
Limit Bazel to available CCI resources of 3072 MB (of 4096 max) & 2 core - #8
gregmagolan wants to merge 1 commit into
Conversation
|
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? |
|
My shorthand for CircleCI :) |
|
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. |
|
There has to be some way Bazel can determine that - otherwise anyone using Bazel on Circle would need this workaround flag? |
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.