Skip to content

Commit 257fe52

Browse files
authored
chore: improve build progress (#132)
1 parent 19efba5 commit 257fe52

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

scripts/ci/apollo_build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ function run_bazel_build() {
284284
jobs_args="--jobs=${CUSTOM_JOBS}"
285285
fi
286286
# default set cpus number according to the total cpu cores
287-
local cpu_count=$(($(nproc) / 2))
287+
local nproc_cnt=$(nproc)
288+
local cpu_count=$(( nproc_cnt > 8 ? 8 : nproc_cnt ))
288289
local cpus_args="--local_resources=cpu=${cpu_count}"
289290
if [[ -n "${CUSTOM_CPUS}" ]]; then
290291
cpus_args="--local_resources=cpu=${CUSTOM_CPUS}"

tools/bazel.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ common --enable_bzlmod
1717
# Prefer https://bcr.bazel.build/
1818
build --registry=https://bcr.bazel.build/
1919
build --registry=https://raw.githubusercontent.com/wheelos/bazel-central-registry/main
20+
build --registry=file:///apollo/data/bazel-central-registry
2021

2122
# Set up a shared cache to avoid repeated pulls from remote libraries
2223
build --repository_cache=/var/cache/bazel/repo_cache

0 commit comments

Comments
 (0)