Skip to content

Commit

Permalink
ci: use local_memory_estimate (envoyproxy#7558)
Browse files Browse the repository at this point in the history
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
  • Loading branch information
lizan authored and mattklein123 committed Jul 18, 2019
1 parent 170c89e commit aa24d08
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
7 changes: 1 addition & 6 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# Envoy specific Bazel build/test options.

# Bazel doesn't need more than 200MB of memory based on memory profiling:
# https://docs.bazel.build/versions/master/skylark/performance.html#memory-profiling
# Limiting JVM heapsize here to let it do GC more when approaching the limit to
# leave room for compiler/linker.
startup --host_jvm_args=-Xmx512m
build --workspace_status_command=bazel/get_workspace_status
build --experimental_remap_main_repo
build --experimental_local_memory_estimate
build --host_force_python=PY2
build --action_env=BAZEL_LINKLIBS=-l%:libstdc++.a
build --action_env=BAZEL_LINKOPTS=-lm:-static-libgcc
Expand Down
2 changes: 1 addition & 1 deletion ci/build_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fi
export BAZEL_QUERY_OPTIONS="${BAZEL_OPTIONS}"
export BAZEL_BUILD_OPTIONS="--strategy=Genrule=standalone --spawn_strategy=standalone \
--verbose_failures ${BAZEL_OPTIONS} --action_env=HOME --action_env=PYTHONUSERBASE \
--jobs=${NUM_CPUS} --show_task_finish --experimental_generate_json_trace_profile \
--local_cpu_resources=${NUM_CPUS} --show_task_finish --experimental_generate_json_trace_profile \
--test_env=HOME --test_env=PYTHONUSERBASE --cache_test_results=no --test_output=all \
${BAZEL_BUILD_EXTRA_OPTIONS} ${BAZEL_EXTRA_TEST_OPTIONS}"

Expand Down
6 changes: 4 additions & 2 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,10 @@ elif [[ "$CI_TARGET" == "bazel.coverage" ]]; then
setup_clang_toolchain
echo "bazel coverage build with tests ${TEST_TARGETS}"

# LLVM coverage is a memory hog too.
[ -z "$CIRCLECI" ] || export BAZEL_BUILD_OPTIONS="${BAZEL_BUILD_OPTIONS} --local_cpu_resources=6"
# Reduce the amount of memory Bazel tries to use to prevent it from launching too many subprocesses.
# This should prevent the system from running out of memory and killing tasks. See discussion on
# https://github.com/envoyproxy/envoy/pull/5611.
[ -z "$CIRCLECI" ] || export BAZEL_BUILD_OPTIONS="${BAZEL_BUILD_OPTIONS} --local_ram_resources=12288"

test/run_envoy_bazel_coverage.sh ${TEST_TARGETS}
collect_build_profile coverage
Expand Down

0 comments on commit aa24d08

Please sign in to comment.