make rbe work

Closes #8200.

PiperOrigin-RevId: 245946382
diff --git a/.bazelrc b/.bazelrc
index 8ee71cc..f9c0d86 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -1,15 +1,15 @@
 # Configuration to build and test Bazel itself on RBE.
-build:remote --host_javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.2:jdk8
-build:remote --javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.2:jdk8
+build:remote --host_javabase=@bazel_rbe_toolchains//configs/bazel_0.24.1/bazel-ubuntu1804/java:jdk
+build:remote --javabase=@bazel_rbe_toolchains//configs/bazel_0.24.1/bazel-ubuntu1804/java:jdk
 build:remote --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
 build:remote --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
-build:remote --crosstool_top=@bazel_toolchains//configs/ubuntu16_04_clang/1.2/bazel_0.24.0/default:toolchain
+build:remote --crosstool_top=@bazel_rbe_toolchains//configs/bazel_0.24.1/bazel-ubuntu1804/cc:toolchain
 
-build:remote --extra_toolchains=@bazel_toolchains//configs/ubuntu16_04_clang/1.2/bazel_0.24.0/cpp:cc-toolchain-clang-x86_64-default
-build:remote --extra_execution_platforms=//:rbe_ubuntu1604_default
-build:remote --extra_execution_platforms=//:rbe_ubuntu1604_highcpu
-build:remote --host_platform=//:rbe_ubuntu1604_default
-build:remote --platforms=//:rbe_ubuntu1604_default
+build:remote --extra_toolchains=@bazel_rbe_toolchains//configs/bazel_0.24.1/bazel-ubuntu1804/config:cc-toolchain
+build:remote --extra_execution_platforms=@bazel_rbe_toolchains//configs/bazel_0.24.1/bazel-ubuntu1804:default_platform
+build:remote --extra_execution_platforms=//:rbe_highcpu_platform
+build:remote --host_platform=@bazel_rbe_toolchains//configs/bazel_0.24.1/bazel-ubuntu1804:default_platform
+build:remote --platforms=@bazel_rbe_toolchains//configs/bazel_0.24.1/bazel-ubuntu1804:default_platform
 
 build:remote --spawn_strategy=remote
 build:remote --strategy=Javac=remote
@@ -19,7 +19,7 @@
 
 build:remote --remote_instance_name=projects/bazel-untrusted/instances/default_instance
 build:remote --remote_executor=remotebuildexecution.googleapis.com
-build:remote --remote_timeout=1200
+build:remote --remote_timeout=600
 build:remote --tls_enabled
 build:remote --google_default_credentials
 
diff --git a/BUILD b/BUILD
index 681a9a4..98534e0 100644
--- a/BUILD
+++ b/BUILD
@@ -141,34 +141,14 @@
     parents = ["@bazel_tools//platforms:host_platform"],
 )
 
-# The default RBE platform where most actions run on
-platform(
-    name = "rbe_ubuntu1604_default",
-    parents = ["@bazel_toolchains//configs/ubuntu16_04_clang/1.2:rbe_ubuntu1604"],
-    remote_execution_properties = """
-        properties: {
-          name: "container-image"
-          value:"docker://gcr.io/bazel-untrusted/ubuntu1604_bazel_rbe@sha256:b60b641427ca8aa99134cc1f9889e3349e391eed85854b5cfbb462884ec3420b"
-        }
-        properties: {
-          name: "dockerNetwork"
-          value: "standard"
-        }
-        properties: {
-          name: "dockerPrivileged"
-          value: "true"
-        }
-        """,
-)
-
 # The highcpu RBE platform where heavy actions run on. In order to
 # use this platform add the highcpu_machine constraint to your target.
 platform(
-    name = "rbe_ubuntu1604_highcpu",
+    name = "rbe_highcpu_platform",
     constraint_values = [
-        ":highcpu_machine",
+        "//:highcpu_machine",
     ],
-    parents = [":rbe_ubuntu1604_default"],
+    parents = ["@bazel_rbe_toolchains//configs/bazel_0.24.1/bazel-ubuntu1804:default_platform"],
     remote_execution_properties = """
         {PARENT_REMOTE_EXECUTION_PROPERTIES}
         properties: {
diff --git a/WORKSPACE b/WORKSPACE
index c53db29..6142914 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -315,6 +315,16 @@
     ],
 )
 
+http_archive(
+    name = "bazel_rbe_toolchains",
+    sha256 = "6082baeb3b363e285d1b279ce6b2e2ee20bace4d494a9d63b4c17e0a09dc36d3",
+    strip_prefix = "bazel_rbe_toolchains-0b7cd8db39e9b74bcc6612695d59a52401995ae1",
+    urls = [
+        "https://mirror.bazel.build/github.com/buchgr/bazel_rbe_toolchains/archive/0b7cd8db39e9b74bcc6612695d59a52401995ae1.tar.gz",
+        "https://github.com/buchgr/bazel_rbe_toolchains/archive/0b7cd8db39e9b74bcc6612695d59a52401995ae1.tar.gz",
+    ],
+)
+
 # Creates toolchain configuration for remote execution with BuildKite CI
 # for rbe_ubuntu1604.
 # To run the tests with RBE on BuildKite CI uncomment the two lines below
diff --git a/src/test/shell/bazel/BUILD b/src/test/shell/bazel/BUILD
index 968dda7..ac93544 100644
--- a/src/test/shell/bazel/BUILD
+++ b/src/test/shell/bazel/BUILD
@@ -247,7 +247,6 @@
     srcs = ["bazel_coverage_cc_test_gcc.sh"],
     data = [":test-deps"],
     tags = [
-        "local",
         "no_windows",
     ],
 )
@@ -257,7 +256,6 @@
     srcs = ["bazel_coverage_cc_test_llvm.sh"],
     data = [":test-deps"],
     tags = [
-        "local",
         "no_windows",
     ],
 )
@@ -267,7 +265,6 @@
     srcs = ["bazel_coverage_java_test.sh"],
     data = [":test-deps"],
     tags = [
-        "local",
         "no_windows",
     ],
 )
@@ -277,7 +274,6 @@
     srcs = ["bazel_coverage_sh_test.sh"],
     data = [":test-deps"],
     tags = [
-        "local",
         "no_windows",
     ],
 )