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
diff --git a/.bazelrc b/.bazelrc
index 501ade1..fb116b9 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -17,10 +17,13 @@
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: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 37688079..417b2e8 100644
--- a/tools/remote-bazelrc
+++ b/tools/remote-bazelrc
@@ -43,17 +43,19 @@
# machine exactly match the host machine.
build:remote_shared --define=EXECUTOR=remote
-# Enable the remote cache so action results can be shared across machines,
-# developers, and workspaces.
-build:remote_shared --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
+# 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:config_gcp --remote_cache=remotebuildexecution.googleapis.com
+
+# Enable remote execution so actions are performed on the remote systems.
+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