summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlvaro Vilaplana Garcia <alvaro.vilaplana@gmail.com>2023-11-25 09:12:44 +0000
committerAlvaro Vilaplana Garcia <alvaro.vilaplana@gmail.com>2024-02-07 10:14:18 +0000
commit711f1d5e039abe7435b0ed5ca91616268b850b47 (patch)
tree5b4b94c1700030f3f63d1cc8c61e0e87529c1afa
parentfcc38acd9f93a625657e970f5b99f9effe8dbbb2 (diff)
Specify GCP suffix explicitly in Bazel remote configuration
This change lays the foundation for future Remote Build Execution (RBE) provider configurations, simplifying the process of extending the configuration. The plan is to support different RBE providers in addition to RBE on Google Cloud Platform (gcp): $ bazel build --config=config_$PROVIDER \ --remote_instance_name=$PROJECT \ release To not break the CIs, that still use default RBE configuration, most notably GerritForge CI and Bazel Buildkite CI, the default remote build configuration --config=remote is still supported and points to the RBE on Google Cloud Platform. However, an alias is defined, that also points to the GCP: --config=remote_gcp. Release-Notes: skip Change-Id: Ia3e9bc2752bca468ad0ceaaa1113f3ddcc4fcb29
-rw-r--r--.bazelrc16
-rw-r--r--tools/remote-bazelrc14
2 files changed, 19 insertions, 11 deletions
diff --git a/.bazelrc b/.bazelrc
index 501ade1d7a..fb116b93ad 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -17,10 +17,13 @@ build --java_runtime_version=remotejdk_11
build --tool_java_language_version=11
build --tool_java_runtime_version=remotejdk_11
-# Builds and executes on RBE using remotejdk_11
-build:remote --config=remote_shared
+# Builds and executes on Google GCP RBE using remotejdk_11
+build:remote --config=config_gcp
build:remote --config=build_shared
+# Define remote configuration alias
+build:remote_gcp --config=remote
+
# Define configuration using remotejdk_17, executes using remotejdk_17 or local_jdk
build:build_java17_shared --java_language_version=17
build:build_java17_shared --java_runtime_version=remotejdk_17
@@ -29,9 +32,12 @@ build:build_java17_shared --tool_java_runtime_version=remotejdk_17
build:java17 --config=build_java17_shared
-# Builds and executes on RBE using remotejdk_17
-build:remote17 --config=remote_shared
-build:remote17 --config=build_java11_shared
+# Builds and executes on Google GCP RBE using remotejdk_17
+build:remote17 --config=config_gcp
+build:remote17 --config=build_java17_shared
+
+# Define remote17 configuration alias
+build:remote17_gcp --config=remote17
# Enable strict_action_env flag to. For more information on this feature see
# https://groups.google.com/forum/#!topic/bazel-discuss/_VmRfMyyHBk.
diff --git a/tools/remote-bazelrc b/tools/remote-bazelrc
index 37688079a5..417b2e8758 100644
--- a/tools/remote-bazelrc
+++ b/tools/remote-bazelrc
@@ -43,17 +43,19 @@ build:remote_shared --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
# machine exactly match the host machine.
build:remote_shared --define=EXECUTOR=remote
+# Set a higher timeout value, just in case.
+build:remote_shared --remote_timeout=3600
+
+# Configuration flags for remote settings in Google GCP RBE
# Enable the remote cache so action results can be shared across machines,
# developers, and workspaces.
-build:remote_shared --remote_cache=remotebuildexecution.googleapis.com
+build:config_gcp --remote_cache=remotebuildexecution.googleapis.com
# Enable remote execution so actions are performed on the remote systems.
-build:remote_shared --remote_executor=remotebuildexecution.googleapis.com
-
-# Set a higher timeout value, just in case.
-build:remote_shared --remote_timeout=3600
+build:config_gcp --remote_executor=remotebuildexecution.googleapis.com
# Enable authentication. This will pick up application default credentials by
# default. You can use --auth_credentials=some_file.json to use a service
# account credential instead.
-build:remote_shared --google_default_credentials
+build:config_gcp --google_default_credentials
+build:config_gcp --config=remote_shared