Skip to content

Commit d4ab49a

Browse files
josephperrottandrewseguin
authored andcommitted
build: setup RBE caching and remote build event service on CI (#16370)
1 parent 1e53148 commit d4ab49a

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

.circleci/base-rbe-bazelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ build:remote --remote_executor=remotebuildexecution.googleapis.com
1212
build:remote --tls_enabled=true
1313
build:remote --auth_enabled=true
1414

15+
# Setup Build Event Service
16+
build:remote --bes_backend=buildeventservice.googleapis.com
17+
build:remote --bes_timeout=30s
18+
build:remote --bes_results_url="https://source.cloud.google.com/results/invocations/"
19+
1520
# Setup the toolchain and platform for the remote build execution. The platform
1621
# is automatically configured by the "rbe_autoconfig" rule in the project workpsace.
1722
build:remote --crosstool_top=@rbe_default//cc:toolchain

.circleci/bazel.rc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ import %workspace%/.circleci/base-rbe-bazelrc
1515

1616
# Use the Angular team internal GCP instance for remote execution.
1717
build:remote --remote_instance_name=projects/internal-200822/instances/default_instance
18+
build:remote --project_id=internal-200822
1819

19-
# We want to accept remote cached build artifacts to speed up our builds incrementally.
20-
# TODO(devversion): Temporary disabled since we don't have much insight on possible security
21-
# issues. Enable this once we investigated this further and talked to the RBE team.
22-
build:remote --remote_accept_cached=false
20+
# Always read from remote cache on CI.
21+
build:remote --remote_accept_cached=true

scripts/circleci/bazel/setup-remote-execution.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,11 @@ openssl aes-256-cbc -d -in .circleci/gcp_token -md md5 -k ${GCP_DECRYPT_TOKEN} \
1919
echo "export GOOGLE_APPLICATION_CREDENTIALS=$HOME/.gcp_credentials" >> $BASH_ENV
2020

2121
# Update the CircleCI Bazel configuration to always use remote execution.
22-
echo 'build --config=remote' >> .circleci/bazel.rc
22+
echo "build --config=remote" >> .circleci/bazel.rc
23+
24+
# Only upload locally built results to the cache if we are running already commited code.
25+
if [[ -n "${CIRCLE_PR_NUMBER}" ]]; then
26+
echo "build --remote_upload_local_results=false" >> .circleci/bazel.rc
27+
else
28+
echo "build --remote_upload_local_results=true" >> .circleci/bazel.rc
29+
fi

0 commit comments

Comments
 (0)