Multistage docker containers with RBE swiftshader support (#3065)

Refactors Docker setup to enable multistage builds and fully support
Vulkan.

1. Vulkan is now supported in all our build configurations and
IREE_VULKAN_DISABLE is set to false in all build scripts.
2. Our docker containers use multi-stage builds to reduce duplication
and image size.
3. Directory names match image names rather than having arbitrary
underscore/dash distinction (I kept mistyping this).

New vs old images:
https://gist.github.com/GMNGeoffrey/6ea51a6035f3eb8fac11ff4bdbd6edc0

Fixes https://github.com/google/iree/issues/2651
diff --git a/WORKSPACE b/WORKSPACE
index cf098ce..687bf2f 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -63,7 +63,7 @@
 rbe_autoconfig(
     name = "rbe_default",
     base_container_digest = "sha256:1a8ed713f40267bb51fe17de012fa631a20c52df818ccb317aaed2ee068dfc61",
-    digest = "sha256:bc2d61ad05453928e67b434ae019e7d050dda46c091270f2b81b2f09da2276ce",
+    digest = "sha256:8b7809d630286183a2119a83e03d52c93de552ada79534aa23c5b95283e66134",
     registry = "gcr.io",
     repository = "iree-oss/rbe-toolchain",
     use_checked_in_confs = "Force",
diff --git a/build_tools/bazel/build_bindings.sh b/build_tools/bazel/build_bindings.sh
index 4ca7ddb..d737473 100755
--- a/build_tools/bazel/build_bindings.sh
+++ b/build_tools/bazel/build_bindings.sh
@@ -37,7 +37,7 @@
   IREE_LLVMJIT_DISABLE=0
 fi
 if ! [[ -v IREE_VULKAN_DISABLE ]]; then
-  IREE_VULKAN_DISABLE=1
+  IREE_VULKAN_DISABLE=0
 fi
 
 declare -a test_env_args=(
diff --git a/build_tools/bazel/build_core.sh b/build_tools/bazel/build_core.sh
index bd04942..1371a3c 100755
--- a/build_tools/bazel/build_core.sh
+++ b/build_tools/bazel/build_core.sh
@@ -37,7 +37,7 @@
   IREE_LLVMJIT_DISABLE=0
 fi
 if ! [[ -v IREE_VULKAN_DISABLE ]]; then
-  IREE_VULKAN_DISABLE=1
+  IREE_VULKAN_DISABLE=0
 fi
 declare -a test_env_args=(
   --test_env=IREE_LLVMJIT_DISABLE=$IREE_LLVMJIT_DISABLE
diff --git a/build_tools/bazel/build_tensorflow.sh b/build_tools/bazel/build_tensorflow.sh
index 3634c4d..021738a 100755
--- a/build_tools/bazel/build_tensorflow.sh
+++ b/build_tools/bazel/build_tensorflow.sh
@@ -37,7 +37,7 @@
   IREE_LLVMJIT_DISABLE=0
 fi
 if ! [[ -v IREE_VULKAN_DISABLE ]]; then
-  IREE_VULKAN_DISABLE=1
+  IREE_VULKAN_DISABLE=0
 fi
 declare -a test_env_args=(
   --test_env=IREE_LLVMJIT_DISABLE=$IREE_LLVMJIT_DISABLE
diff --git a/build_tools/cmake/test.sh b/build_tools/cmake/test.sh
index 8cd9f2d..8172f84 100755
--- a/build_tools/cmake/test.sh
+++ b/build_tools/cmake/test.sh
@@ -26,7 +26,7 @@
 
 # Respect the user setting, but default to turning off the vulkan tests
 # and turning on the llvmjit ones.
-export IREE_VULKAN_DISABLE=${IREE_VULKAN_DISABLE:-1}
+export IREE_VULKAN_DISABLE=${IREE_VULKAN_DISABLE:-0}
 export IREE_LLVMJIT_DISABLE=${IREE_LLVMJIT_DISABLE:-0}
 
 # Tests to exclude by label. In addition to any custom labels (which are carried
diff --git a/build_tools/docker/README.md b/build_tools/docker/README.md
new file mode 100644
index 0000000..f6fabef
--- /dev/null
+++ b/build_tools/docker/README.md
@@ -0,0 +1,107 @@
+# IREE Docker Configuration
+
+This directory contains the Dockerfiles that specify the container images used
+for IREE. Images are uploaded to
+[Google Container Registry (GCR)](https://cloud.google.com/container-registry).
+
+To build an image, use `docker build`, e.g.:
+
+```shell
+docker build build_tools/docker/cmake --tag cmake
+```
+
+To explore an image interactively, use `docker run`, e.g.
+
+```shell
+docker run --interactive --tty --rm cmake
+```
+
+You can find more information in the
+[official Docker docs](https://docs.docker.com/get-started/overview/).
+
+
+## Multi-stage Builds
+
+We use
+[multi-stage builds](https://docs.docker.com/develop/develop-images/multistage-build/)
+to limit duplication in our Dockerfiles and reduce the final image size. There
+is still duplication in cases where it's difficult to determine the correct
+files to copy.
+
+
+## Dependencies Between Images
+
+IREE images follow a consistent structure. The image defined by
+`build_tools/docker/foo-bar/Dockerfile` is uploaded to GCR as
+`gcr.io/iree-oss/foo-bar`. It may be tagged as `latest` or `prod`, e.g.
+`gcr.io/iree-oss/foo-bar:latest`. Dockerfile image definitions should list their
+dependencies based on these image names.
+
+We use a helper python script to manage the Docker image deployment. It lists
+all images and their dependencies and manages their canonical registry
+location. When creating a new image, add it to this mapping. To build an image
+and all images it depends on:
+
+```shell
+python3 build_tools/docker/manage_images.py --build --image cmake
+```
+
+To build multiple images
+
+```shell
+python3 build_tools/docker/manage_images.py --build --image cmake --image bazel
+```
+
+There is also the special option `--image all` to build all registered images.
+
+Pushing images to GCR requires the `Storage Admin` role in the `iree-oss` GCP
+project. To push these images to GCR with the `latest` tag:
+
+```shell
+python3 build_tools/docker/manage_images.py --image cmake --push
+```
+
+Kokoro build scripts and RBE configuration refer to images by their repository
+digest. You can update references to the digest:
+
+```shell
+python3 build_tools/docker/manage_images.py --images all --tag latest --update_references
+```
+
+This requires that the tagged image have a repository digest, which means it was
+pushed to or pulled from GCR.
+
+
+## Deploying New Images
+
+1. Modify the Dockerfiles as desired.
+2. Update `manage_images.py` to include the new image and its dependencies.
+3. Build and push the new image to GCR and update references to it:
+
+  ```shell
+  python3 build_tools/docker/manage_images.py --image "${IMAGE?}" --build --push --update_references
+  ```
+
+4. Commit changes and send a PR for review.
+5. Merge your PR after is approved and all builds pass.
+6. Kokoro builds preload images tagged with `prod` on VM creation, so after
+   changing the images used, you should also update the images tagged as `prod`
+   in GCR. Update your local reference to the `prod` tag to point at the new
+   image:
+
+  ```shell
+  python3 build_tools/docker/manage_images.py --image "${IMAGE?}" --tag prod --build --update_references
+  ```
+
+  The build steps here should all be cache hits and no references should
+  actually be changed. If they are, that indicates the images you've just built
+  are different from the ones that are being referenced. Stop and fix this
+  before proceeding. This relies on you keeping your local copy of the Docker
+  images. If you didn't, you'll have to manually pull the missing images by
+  their digest.
+
+7. Push the new images with the `prod` tag to GCR.
+
+   ```shell
+  python3 build_tools/docker/manage_images.py --image "${IMAGE?}" --tag prod --push
+  ```
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/google.cfg b/build_tools/docker/base/Dockerfile
similarity index 63%
copy from build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/google.cfg
copy to build_tools/docker/base/Dockerfile
index e4cc270..ea85143 100644
--- a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/google.cfg
+++ b/build_tools/docker/base/Dockerfile
@@ -1,5 +1,3 @@
-# Format: //devtools/kokoro/config/proto/build.proto
-
 # Copyright 2020 Google LLC
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,6 +12,18 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Deliberately blank as everything necessary is configured in common files, but
-# file must still exist to match corresponding (Google internal) job
-# configurations that trigger the builds.
+FROM ubuntu:18.04 AS final
+
+# Environment variables for IREE.
+ENV CC /usr/bin/clang
+ENV CXX /usr/bin/clang++
+ENV IREE_LLVMAOT_LINKER_PATH /usr/bin/ld
+
+RUN apt-get update \
+  && apt-get install -y \
+    # For updating IREE's submodules.
+    git \
+    # Core IREE dependencies.
+    clang \
+    libsdl2-dev \
+    libssl-dev
diff --git a/build_tools/docker/bazel_bindings/Dockerfile b/build_tools/docker/bazel-python/Dockerfile
similarity index 63%
rename from build_tools/docker/bazel_bindings/Dockerfile
rename to build_tools/docker/bazel-python/Dockerfile
index 8f07958..11c35ab 100644
--- a/build_tools/docker/bazel_bindings/Dockerfile
+++ b/build_tools/docker/bazel-python/Dockerfile
@@ -12,19 +12,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# An image for building IREE with python bindings using bazel.
+# An image for building IREE with Python bindings using Bazel.
 
-# Build using:
-# docker build --tag gcr.io/iree-oss/bazel-bindings \
-#   build_tools/docker/bazel_bindings/
-
-# Run interactively using the following, where IREE_WORKDIR is the path to your
-# local dev environment:
-# docker run -it --rm --entrypoint bash --volume ${IREE_WORKDIR}:/usr/src/iree/ \
-#   gcr.io/iree-oss/bazel-bindings
-
-# Set up the image and working directory.
-FROM gcr.io/iree-oss/bazel
+FROM gcr.io/iree-oss/bazel AS final
 
 # Install python3 and numpy.
 RUN apt-get update \
@@ -35,3 +25,5 @@
     python3-setuptools \
   && python3 -m pip install --upgrade pip \
   && python3 -m pip install numpy
+
+ENV PYTHON_BIN /usr/bin/python3
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/google.cfg b/build_tools/docker/bazel-tensorflow-nvidia/Dockerfile
similarity index 67%
rename from build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/google.cfg
rename to build_tools/docker/bazel-tensorflow-nvidia/Dockerfile
index e4cc270..a9b4cf4 100644
--- a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/google.cfg
+++ b/build_tools/docker/bazel-tensorflow-nvidia/Dockerfile
@@ -1,5 +1,3 @@
-# Format: //devtools/kokoro/config/proto/build.proto
-
 # Copyright 2020 Google LLC
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,6 +12,10 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Deliberately blank as everything necessary is configured in common files, but
-# file must still exist to match corresponding (Google internal) job
-# configurations that trigger the builds.
+# An image for building IREE with TensorFlow integrations using Bazel and
+# running Vulkan tests on an Nvidia GPU.
+
+FROM gcr.io/iree-oss/bazel-tensorflow-vulkan AS final
+
+RUN apt-get update \
+  && DEBIAN_FRONTEND=noninteractive apt-get install -y vulkan-sdk nvidia-driver-440
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/google.cfg b/build_tools/docker/bazel-tensorflow-swiftshader/Dockerfile
similarity index 60%
copy from build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/google.cfg
copy to build_tools/docker/bazel-tensorflow-swiftshader/Dockerfile
index e4cc270..b2c16e3 100644
--- a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/google.cfg
+++ b/build_tools/docker/bazel-tensorflow-swiftshader/Dockerfile
@@ -1,5 +1,3 @@
-# Format: //devtools/kokoro/config/proto/build.proto
-
 # Copyright 2020 Google LLC
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,6 +12,12 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Deliberately blank as everything necessary is configured in common files, but
-# file must still exist to match corresponding (Google internal) job
-# configurations that trigger the builds.
+# An image for building IREE with TensorFlow integrations using Bazel and
+# running Vulkan tests on SwiftShader.
+
+FROM gcr.io/iree-oss/bazel-tensorflow-vulkan AS final
+
+COPY --from=gcr.io/iree-oss/swiftshader swiftshader/ swiftshader/
+
+# Set VK_ICD_FILENAMES so Vulkan loader can find the SwiftShader ICD.
+ENV VK_ICD_FILENAMES /swiftshader/vk_swiftshader_icd.json
diff --git a/build_tools/docker/cmake_vulkan/Dockerfile b/build_tools/docker/bazel-tensorflow-vulkan/Dockerfile
similarity index 67%
copy from build_tools/docker/cmake_vulkan/Dockerfile
copy to build_tools/docker/bazel-tensorflow-vulkan/Dockerfile
index f2cdee6..849a32c 100644
--- a/build_tools/docker/cmake_vulkan/Dockerfile
+++ b/build_tools/docker/bazel-tensorflow-vulkan/Dockerfile
@@ -12,24 +12,12 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# An image with Vulkan SDK for building IREE using CMake.
+# A base image for building IREE with TensorFlow integrations using Bazel and
+# running Vulkan tests. Requires a child image to provide a Vulkan ICD.
 
-# Build using:
-# docker build --tag gcr.io/iree-oss/cmake-vulkan \
-#   build_tools/docker/cmake_vulkan/
+FROM gcr.io/iree-oss/bazel-tensorflow AS final
 
-# Run interactively using the following, where IREE_WORKDIR is the path to your
-# local dev environment:
-# docker run -it --rm --entrypoint bash \
-#   --volume "${IREE_WORKDIR?}:/usr/src/iree/" \
-#   --gpus all \
-#   gcr.io/iree-oss/cmake-vulkan
-
-# Set up the image and working directory by inheriting the base
-# CMake configuration.
-FROM gcr.io/iree-oss/cmake
-
-# Additionally, we need to install the Vulkan SDK.
+RUN apt-get update && apt-get install -y wget
 
 ARG VULKAN_SDK_VERSION=1.2.141
 
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/common.cfg b/build_tools/docker/bazel-tensorflow/Dockerfile
similarity index 73%
rename from build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/common.cfg
rename to build_tools/docker/bazel-tensorflow/Dockerfile
index 49e6865..a9dd7fb 100644
--- a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/common.cfg
+++ b/build_tools/docker/bazel-tensorflow/Dockerfile
@@ -1,5 +1,3 @@
-# Format: //devtools/kokoro/config/proto/build.proto
-
 # Copyright 2020 Google LLC
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,6 +12,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Common configuration for Kokoro builds that run cmake on linux.
+# An image for building IREE with TensorFlow integrations using Bazel.
 
-build_file: "iree/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/build_kokoro.sh"
+FROM gcr.io/iree-oss/bazel-python AS final
+
+# Install tensorflow.
+RUN python3 -m pip install tf-nightly
diff --git a/build_tools/docker/bazel/Dockerfile b/build_tools/docker/bazel/Dockerfile
index c42521a..a012e71 100644
--- a/build_tools/docker/bazel/Dockerfile
+++ b/build_tools/docker/bazel/Dockerfile
@@ -14,36 +14,14 @@
 
 # An image for building IREE using bazel.
 
-# Build using:
-# docker build --tag gcr.io/iree-oss/bazel build_tools/docker/bazel/
+ARG BAZEL_VERSION=3.3.1
+# Change to a new version if upgrading Bazel.
+ARG NEW_BAZEL_VERSION=3.3.1
 
-# Run interactively using the following, where IREE_WORKDIR is the path to your
-# local dev environment:
-# docker run -it --rm --entrypoint bash \
-#   --volume "${IREE_WORKDIR?}:/usr/src/iree/" \
-#   gcr.io/iree-oss/bazel
-
-# Set up the image and working directory.
-FROM ubuntu:18.04
-WORKDIR /usr/src/iree
-
-# Set environment variables.
-ENV CXX clang++
-ENV CC clang
-ENV PYTHON_BIN /usr/bin/python3
-ENV IREE_LLVMAOT_LINKER_PATH /usr/bin/ld
-
-RUN apt-get update \
-  && apt-get install -y \
-    # git for updating IREE's submodules.
-    git \
-    # utilities for later installations
-    unzip \
-    zip \
-    wget \
-    # core IREE dependencies.
-    clang \
-    libsdl2-dev
+FROM gcr.io/iree-oss/util AS install-bazel
+WORKDIR /install-bazel
+ARG BAZEL_VERSION
+ARG NEW_BAZEL_VERSION
 
 # Disable apt-key parse waring. If someone knows how to do whatever the "proper"
 # thing is then feel free. The warning complains about parsing apt-key output,
@@ -52,9 +30,6 @@
 
 # Install Bazel.
 # https://docs.bazel.build/versions/master/install-ubuntu.html
-ARG BAZEL_VERSION=3.3.1
-# Change to a new version if upgrading Bazel.
-ARG NEW_BAZEL_VERSION=3.3.1
 RUN wget -qO - https://bazel.build/bazel-release.pub.gpg | apt-key add - \
   && echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" \
     | tee /etc/apt/sources.list.d/bazel.list \
@@ -65,7 +40,17 @@
   # your .bazelversion file. When upgrading, we therefore need to have both the
   # old and new version. When the versions are the same this second installation
   # is effectively a noop.
-  && apt-get install "bazel=${BAZEL_VERSION?}" "bazel-${NEW_BAZEL_VERSION?}"
+  && apt-get install -y "bazel=${BAZEL_VERSION?}" "bazel-${NEW_BAZEL_VERSION?}"
+
+FROM gcr.io/iree-oss/base AS final
+ARG BAZEL_VERSION
+ARG NEW_BAZEL_VERSION
+COPY --from=install-bazel \
+  /usr/bin/bazel \
+  "/usr/bin/bazel-${BAZEL_VERSION}" \
+  "/usr/bin/bazel-${NEW_BAZEL_VERSION}" \
+  /usr/bin/bazel-real \
+  /usr/bin/
 
 # TF requires python2 numpy at configure time...
 # TODO(#1737): Remove this
diff --git a/build_tools/docker/bazel_nvidia/Dockerfile b/build_tools/docker/bazel_nvidia/Dockerfile
deleted file mode 100644
index 86305c4..0000000
--- a/build_tools/docker/bazel_nvidia/Dockerfile
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 2020 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# An image for building IREE's tensorflow integrations using bazel and vulkan.
-
-# Build using:
-# docker build --tag gcr.io/iree-oss/bazel-nvidia \
-#   build_tools/docker/bazel_nvidia/
-
-# Run interactively using the following, where IREE_WORKDIR is the path to your
-# local dev environment:
-# docker run -it --rm --entrypoint bash --volume ${IREE_WORKDIR}:/usr/src/iree/ \
-#   gcr.io/iree-oss/bazel-nvidia
-
-# Set up the image and working directory.
-# We start from bazel-nvidia so this image can be used to testing TensorFlow
-# integrations.
-FROM gcr.io/iree-oss/bazel-tensorflow
-
-# Additionally, we need to install the Vulkan SDK and the NVIDIA Vulkan driver.
-
-ARG VULKAN_SDK_VERSION=1.2.141
-
-# Disable apt-key parse waring. If someone knows how to do whatever the "proper"
-# thing is then feel free. The warning complains about parsing apt-key output,
-# which we're not even doing.
-ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1
-
-RUN wget -qO - http://packages.lunarg.com/lunarg-signing-key-pub.asc \
-    | apt-key add - \
-  && wget -qO \
-    "/etc/apt/sources.list.d/lunarg-vulkan-${VULKAN_SDK_VERSION?}-bionic.list" \
-    "http://packages.lunarg.com/vulkan/${VULKAN_SDK_VERSION?}/lunarg-vulkan-${VULKAN_SDK_VERSION?}-bionic.list" \
-  && apt-get update \
-  && DEBIAN_FRONTEND=noninteractive apt-get install -y vulkan-sdk nvidia-driver-440
diff --git a/build_tools/docker/bazel_swiftshader/Dockerfile b/build_tools/docker/bazel_swiftshader/Dockerfile
deleted file mode 100644
index 2af027d..0000000
--- a/build_tools/docker/bazel_swiftshader/Dockerfile
+++ /dev/null
@@ -1,92 +0,0 @@
-# Copyright 2020 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# An image for building IREE with tensorflow integrations using bazel and
-# running Vulkan tests on SwiftShader.
-
-# Build using:
-# docker build --tag gcr.io/iree-oss/bazel-swiftshader \
-#   build_tools/docker/bazel_swiftshader/
-
-# Run interactively using the following, where IREE_WORKDIR is the path to your
-# local dev environment:
-# docker run -it --rm --entrypoint bash --volume ${IREE_WORKDIR}:/usr/src/iree/ \
-#   gcr.io/iree-oss/bazel-swiftshader
-
-# Set up the image and working directory.
-FROM gcr.io/iree-oss/bazel-tensorflow
-
-# TODO(#2651): The following steps are copied from cmake, cmake-vulkan, and
-# cmake-swiftshader. We might want to consider using docker multi-stage
-# builds to factor them out.
-
-# Additionally, we need to install the Vulkan SDK.
-
-ARG VULKAN_SDK_VERSION=1.2.141
-
-# Disable apt-key parse waring. If someone knows how to do whatever the "proper"
-# thing is then feel free. The warning complains about parsing apt-key output,
-# which we're not even doing.
-ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1
-
-RUN wget -qO - http://packages.lunarg.com/lunarg-signing-key-pub.asc \
-    | apt-key add - \
-  && wget -qO \
-    "/etc/apt/sources.list.d/lunarg-vulkan-${VULKAN_SDK_VERSION?}-bionic.list" \
-    "http://packages.lunarg.com/vulkan/${VULKAN_SDK_VERSION?}/lunarg-vulkan-${VULKAN_SDK_VERSION?}-bionic.list" \
-  && apt-get update \
-  && apt-get install -y vulkan-sdk
-
-ARG SWIFTSHADER_COMMIT=6a8a74986c357b0c6fa0dfd2b4b9230af8d39d1a
-
-# Then compile and install SwiftShader.
-
-# cmake, ninja, and zlib is needed for compiling SwiftShader.
-RUN apt-get update && apt-get install -y cmake ninja-build zlib1g-dev
-
-# Update cmake to v3.13+, which is ahead of apt-get's version (3.10.2).
-ENV CMAKE_VERSION 3.13.5
-RUN apt-get update \
-  && mkdir ./cmake_install \
-  && cd cmake_install \
-  && wget "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION?}/cmake-${CMAKE_VERSION?}.tar.gz" \
-  && tar -xzvf "cmake-${CMAKE_VERSION?}.tar.gz" \
-  && cd "cmake-${CMAKE_VERSION?}/" \
-  && cmake . \
-  && make \
-  && make install
-
-RUN git clone https://github.com/google/swiftshader \
-  && cd swiftshader && git checkout "${SWIFTSHADER_COMMIT?}" && cd .. \
-  # Only build SwiftShader Vulkan ICD.
-  && cmake -S swiftshader/ -B build-swiftshader/ \
-           -GNinja \
-           -DSWIFTSHADER_BUILD_VULKAN=ON \
-           -DSWIFTSHADER_BUILD_EGL=OFF \
-           -DSWIFTSHADER_BUILD_GLESv2=OFF \
-           -DSWIFTSHADER_BUILD_GLES_CM=OFF \
-           -DSWIFTSHADER_BUILD_PVR=OFF \
-           -DSWIFTSHADER_BUILD_TESTS=OFF \
-  && cmake --build build-swiftshader/ \
-           --config Release \
-           --target vk_swiftshader \
-  # Copy the ICD JSON and .so to a known place.
-  && cp -rf build-swiftshader/Linux /swiftshader \
-  # Keep track of the commit we are using.
-  && echo "${SWIFTSHADER_COMMIT?}" > /swiftshader/git-commit \
-  # Clean up everything.
-  && rm -rf swiftshader build-swiftshader
-
-# Set VK_ICD_FILENAMES so Vulkan loader can find the SwiftShader ICD.
-ENV VK_ICD_FILENAMES /swiftshader/vk_swiftshader_icd.json
diff --git a/build_tools/docker/bazel_tensorflow/Dockerfile b/build_tools/docker/bazel_tensorflow/Dockerfile
deleted file mode 100644
index 0c37354..0000000
--- a/build_tools/docker/bazel_tensorflow/Dockerfile
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2020 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# An image for building IREE with tensorflow integrations using bazel.
-
-# Build using:
-# docker build --tag gcr.io/iree-oss/bazel-tensorflow \
-#   build_tools/docker/bazel_tensorflow/
-
-# Run interactively using the following, where IREE_WORKDIR is the path to your
-# local dev environment:
-# docker run -it --rm --entrypoint bash --volume ${IREE_WORKDIR}:/usr/src/iree/ \
-#   gcr.io/iree-oss/bazel-tensorflow
-
-# Set up the image and working directory.
-FROM gcr.io/iree-oss/bazel-bindings
-
-# Install tensorflow.
-RUN python3 -m pip install tf-nightly
diff --git a/build_tools/docker/cmake-android/Dockerfile b/build_tools/docker/cmake-android/Dockerfile
new file mode 100644
index 0000000..cb7ef82
--- /dev/null
+++ b/build_tools/docker/cmake-android/Dockerfile
@@ -0,0 +1,30 @@
+# Copyright 2020 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# An image for cross-compiling IREE towards Android using CMake.
+
+ARG NDK_VERSION=r21d
+
+FROM gcr.io/iree-oss/util AS install-ndk
+ARG NDK_VERSION
+WORKDIR /install-ndk
+
+RUN wget "https://dl.google.com/android/repository/android-ndk-${NDK_VERSION?}-linux-x86_64.zip"
+
+RUN unzip "android-ndk-${NDK_VERSION?}-linux-x86_64.zip" -d /usr/src/
+
+FROM gcr.io/iree-oss/cmake AS final
+ARG NDK_VERSION
+COPY --from=install-ndk "/usr/src/android-ndk-${NDK_VERSION}" "/usr/src/android-ndk-${NDK_VERSION}"
+ENV ANDROID_NDK "/usr/src/android-ndk-${NDK_VERSION}"
diff --git a/build_tools/docker/cmake-python-nvidia/Dockerfile b/build_tools/docker/cmake-python-nvidia/Dockerfile
new file mode 100644
index 0000000..cce8d2f
--- /dev/null
+++ b/build_tools/docker/cmake-python-nvidia/Dockerfile
@@ -0,0 +1,31 @@
+# Copyright 2020 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# An image for building IREE using CMake and testing IREE with NVIDIA GPUs.
+
+# To use the host GPUs, `docker run` must be called with the `--gpus all` flag.
+
+# Set up the image and working directory by inheriting the vulkan CMake
+# configuration.
+# Note that we don't start from NVIDIA's docker base:
+# - nvidia/cuda (https://hub.docker.com/r/nvidia/cuda):
+#     it's.. for CUDA.
+# - nvidia/vulkan (https://hub.docker.com/r/nvidia/vulkan):
+#      does not support Ubuntu 18.04.
+# This allows to share configuration with base CMake, but it also means we need
+# to MATCH the driver version between the host machine and the docker image.
+FROM gcr.io/iree-oss/cmake-python-vulkan AS final
+
+RUN apt-get update \
+  && apt-get install -y nvidia-driver-440
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/google.cfg b/build_tools/docker/cmake-python-swiftshader/Dockerfile
similarity index 62%
copy from build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/google.cfg
copy to build_tools/docker/cmake-python-swiftshader/Dockerfile
index e4cc270..28af929 100644
--- a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/google.cfg
+++ b/build_tools/docker/cmake-python-swiftshader/Dockerfile
@@ -1,5 +1,3 @@
-# Format: //devtools/kokoro/config/proto/build.proto
-
 # Copyright 2020 Google LLC
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,6 +12,11 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Deliberately blank as everything necessary is configured in common files, but
-# file must still exist to match corresponding (Google internal) job
-# configurations that trigger the builds.
+# An image for building IREE using CMake and testing IREE with SwiftShader
+# Vulkan implementation.
+
+FROM gcr.io/iree-oss/cmake-python-vulkan AS final
+COPY --from=gcr.io/iree-oss/swiftshader /swiftshader /swiftshader
+
+# Set VK_ICD_FILENAMES so Vulkan loader can find the SwiftShader ICD.
+ENV VK_ICD_FILENAMES /swiftshader/vk_swiftshader_icd.json
diff --git a/build_tools/docker/cmake_vulkan/Dockerfile b/build_tools/docker/cmake-python-vulkan/Dockerfile
similarity index 67%
rename from build_tools/docker/cmake_vulkan/Dockerfile
rename to build_tools/docker/cmake-python-vulkan/Dockerfile
index f2cdee6..a20221b 100644
--- a/build_tools/docker/cmake_vulkan/Dockerfile
+++ b/build_tools/docker/cmake-python-vulkan/Dockerfile
@@ -12,27 +12,16 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# An image with Vulkan SDK for building IREE using CMake.
+# A base image for building IREE using CMake and running Vulkan tests. Requires
+# a child image to provide a Vulkan ICD.
 
-# Build using:
-# docker build --tag gcr.io/iree-oss/cmake-vulkan \
-#   build_tools/docker/cmake_vulkan/
+FROM gcr.io/iree-oss/cmake-python AS final
 
-# Run interactively using the following, where IREE_WORKDIR is the path to your
-# local dev environment:
-# docker run -it --rm --entrypoint bash \
-#   --volume "${IREE_WORKDIR?}:/usr/src/iree/" \
-#   --gpus all \
-#   gcr.io/iree-oss/cmake-vulkan
-
-# Set up the image and working directory by inheriting the base
-# CMake configuration.
-FROM gcr.io/iree-oss/cmake
-
-# Additionally, we need to install the Vulkan SDK.
+# It would be nice to have a separate install vulkan image and copy from that,
+# but I don't know all the files that installing the vulkan-sdk adds.
+RUN apt-get update && apt-get install -y wget
 
 ARG VULKAN_SDK_VERSION=1.2.141
-
 # Disable apt-key parse waring. If someone knows how to do whatever the "proper"
 # thing is then feel free. The warning complains about parsing apt-key output,
 # which we're not even doing.
@@ -45,3 +34,5 @@
     "http://packages.lunarg.com/vulkan/${VULKAN_SDK_VERSION?}/lunarg-vulkan-${VULKAN_SDK_VERSION?}-bionic.list" \
   && apt-get update \
   && apt-get install -y vulkan-sdk
+
+RUN rm /usr/bin/wget
diff --git a/build_tools/docker/cmake-python/Dockerfile b/build_tools/docker/cmake-python/Dockerfile
new file mode 100644
index 0000000..d206097
--- /dev/null
+++ b/build_tools/docker/cmake-python/Dockerfile
@@ -0,0 +1,31 @@
+# Copyright 2020 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# An image for building IREE and its Python bindings using CMake.
+
+ARG CMAKE_MAJOR_VERSION=3
+ARG CMAKE_MINOR_VERSION=13
+ARG CMAKE_PATCH_VERSION=5
+
+FROM gcr.io/iree-oss/cmake AS final
+# Dependencies for the python bindings tests.
+RUN apt-get update \
+  && apt-get install -y \
+    python3 \
+    python3-pip \
+    python3-setuptools \
+  && python3 -m pip install --upgrade pip \
+  && python3 -m pip install numpy absl-py
+
+ENV PYTHON_BIN /usr/bin/python3
diff --git a/build_tools/docker/cmake/Dockerfile b/build_tools/docker/cmake/Dockerfile
index bde1f4d..00088ac 100644
--- a/build_tools/docker/cmake/Dockerfile
+++ b/build_tools/docker/cmake/Dockerfile
@@ -14,57 +14,32 @@
 
 # An image for building IREE using CMake.
 
-# Build using:
-# docker build --tag gcr.io/iree-oss/cmake build_tools/docker/cmake/
+# These are separate args because there's no way to strip the patch version off
+# to get the /usr/share path.
+# See https://github.com/moby/moby/issues/41383
+ARG CMAKE_MAJOR_VERSION=3
+ARG CMAKE_MINOR_VERSION=13
+ARG CMAKE_PATCH_VERSION=5
 
-# Run interactively using the following, where IREE_WORKDIR is the path to your
-# local dev environment:
-# docker run -it --rm --entrypoint bash \
-#   --volume "${IREE_WORKDIR?}:/usr/src/iree/" \
-#   gcr.io/iree-oss/cmake
+FROM gcr.io/iree-oss/util AS install-cmake
+ARG CMAKE_MAJOR_VERSION
+ARG CMAKE_MINOR_VERSION
+ARG CMAKE_PATCH_VERSION
+ENV CMAKE_VERSION="${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}"
+WORKDIR /install-cmake
 
-# Set up the image and working directory.
-FROM ubuntu:18.04
-WORKDIR /usr/src/iree/
+# Install CMake v3.13, which is ahead of apt-get's version (3.10.2).
+RUN wget "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION?}/cmake-${CMAKE_VERSION?}-Linux-x86_64.sh"
+RUN chmod +x "./cmake-${CMAKE_VERSION?}-Linux-x86_64.sh"
+RUN "./cmake-${CMAKE_VERSION?}-Linux-x86_64.sh" --skip-license --prefix=/usr/
 
-RUN apt-get update \
-  && apt-get install -y \
-    # git for updating IREE's submodules.
-    git \
-    # For later installations
-    wget \
-    # For building with ninja
-    ninja-build \
-    # For bootstrapping the cmake installation
-    cmake \
-    # core IREE dependencies.
-    clang \
-    libsdl2-dev \
-    libssl-dev
+FROM gcr.io/iree-oss/base AS final
+ARG CMAKE_MAJOR_VERSION
+ARG CMAKE_MINOR_VERSION
 
-# Update cmake to v3.13+, which is ahead of apt-get's version (3.10.2).
-# Install dependencies, including an old version of cmake to bootstrap.
-ENV CMAKE_VERSION 3.13.5
-RUN apt-get update \
-  && mkdir ./cmake_install \
-  && cd cmake_install \
-  && wget "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION?}/cmake-${CMAKE_VERSION?}.tar.gz" \
-  && tar -xzvf "cmake-${CMAKE_VERSION?}.tar.gz" \
-  && cd "cmake-${CMAKE_VERSION?}/" \
-  && cmake . \
-  && make \
-  && make install
+COPY --from=install-cmake /usr/bin/cmake /usr/bin/ctest /usr/bin/
+COPY --from=install-cmake \
+  "/usr/share/cmake-${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" \
+  "/usr/share/cmake-${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}"
 
-# Dependencies for the python bindings tests.
-RUN apt-get update \
-  && apt-get install -y \
-    python3 \
-    python3-pip \
-    python3-setuptools \
-  && python3 -m pip install --upgrade pip \
-  && python3 -m pip install numpy absl-py
-
-# Environment variables for IREE.
-ENV CC /usr/bin/clang
-ENV CXX /usr/bin/clang++
-ENV IREE_LLVMAOT_LINKER_PATH /usr/bin/ld
+RUN apt-get update && apt-get install -y ninja-build
diff --git a/build_tools/docker/cmake_android/Dockerfile b/build_tools/docker/cmake_android/Dockerfile
deleted file mode 100644
index 4349106..0000000
--- a/build_tools/docker/cmake_android/Dockerfile
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 2020 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# An image for cross-compiling IREE towards Android using CMake.
-
-# Build using:
-# docker build --tag gcr.io/iree-oss/cmake-android \
-#              build_tools/docker/cmake_android/
-
-# Run interactively using the following, where IREE_WORKDIR is the path to your
-# local dev environment:
-# docker run -it --rm --entrypoint bash \
-#   --volume "${IREE_WORKDIR?}:/usr/src/iree/" \
-#   gcr.io/iree-oss/cmake-android
-
-# Set up the image and working directory by inheriting the base
-# CMake configuration.
-FROM gcr.io/iree-oss/cmake
-
-# Additionally, we need the Android NDK for cross compiling IREE towards
-# Android. Download Android NDK r21d and set up environment variable.
-
-ADD https://dl.google.com/android/repository/android-ndk-r21d-linux-x86_64.zip /usr/src/
-
-RUN apt-get install -y unzip \
-  && unzip /usr/src/android-ndk-r21d-linux-x86_64.zip -d /usr/src/ \
-  && rm -f /usr/src/android-ndk-r21d-linux-x86_64.zip
-
-ENV ANDROID_NDK /usr/src/android-ndk-r21d
diff --git a/build_tools/docker/cmake_nvidia/Dockerfile b/build_tools/docker/cmake_nvidia/Dockerfile
deleted file mode 100644
index 1fdeaee..0000000
--- a/build_tools/docker/cmake_nvidia/Dockerfile
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright 2020 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# An image for building IREE using CMake and testing IREE with NVIDIA GPUs.
-
-# Build using:
-# docker build --tag gcr.io/iree-oss/cmake-nvidia \
-#              build_tools/docker/cmake_nvidia/
-
-# Run interactively using the following, where IREE_WORKDIR is the path to your
-# local dev environment:
-# docker run -it --rm --entrypoint bash \
-#   --volume "${IREE_WORKDIR?}:/usr/src/iree/" \
-#   --gpus all \
-#   gcr.io/iree-oss/cmake-nvidia
-
-# Set up the image and working directory by inheriting the base
-# CMake configuration.
-# Note that we don't start from NVIDIA's docker base:
-# - nvidia/cuda (https://hub.docker.com/r/nvidia/cuda):
-#     it's.. for CUDA.
-# - nvidia/vulkan (https://hub.docker.com/r/nvidia/vulkan):
-#      does not support Ubuntu 18.04.
-# This allows to share configuration with base CMake, but it also means we need
-# to MATCH the driver version between the host machine and the docker image.
-# TODO: use cmake-vulkan as the base.
-FROM gcr.io/iree-oss/cmake
-
-# Additionally, we need to install the Vulkan SDK and the NVIDIA Vulkan driver.
-
-ARG VULKAN_SDK_VERSION=1.2.141
-
-# Disable apt-key parse waring. If someone knows how to do whatever the "proper"
-# thing is then feel free. The warning complains about parsing apt-key output,
-# which we're not even doing.
-ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1
-
-RUN wget -qO - http://packages.lunarg.com/lunarg-signing-key-pub.asc \
-    | apt-key add - \
-  && wget -qO \
-    "/etc/apt/sources.list.d/lunarg-vulkan-${VULKAN_SDK_VERSION?}-bionic.list" \
-    "http://packages.lunarg.com/vulkan/${VULKAN_SDK_VERSION?}/lunarg-vulkan-${VULKAN_SDK_VERSION?}-bionic.list" \
-  && apt-get update \
-  && apt-get install -y vulkan-sdk nvidia-driver-440
diff --git a/build_tools/docker/cmake_swiftshader/Dockerfile b/build_tools/docker/cmake_swiftshader/Dockerfile
deleted file mode 100644
index b92ce02..0000000
--- a/build_tools/docker/cmake_swiftshader/Dockerfile
+++ /dev/null
@@ -1,60 +0,0 @@
-# Copyright 2020 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# An image for building IREE using CMake and testing IREE with SwiftShader
-# Vulkan implementation.
-
-# Build using:
-# docker build --tag gcr.io/iree-oss/cmake-swiftshader \
-#   build_tools/docker/cmake_swiftshader/
-
-# Run interactively using the following, where IREE_WORKDIR is the path to your
-# local dev environment:
-# docker run -it --rm --entrypoint bash \
-#   --volume "${IREE_WORKDIR?}:/usr/src/iree/" \
-#   --gpus all \
-#   gcr.io/iree-oss/cmake-swiftshader
-
-# Set up the image and working directory by inheriting the base
-# CMake configuration.
-FROM gcr.io/iree-oss/cmake-vulkan
-
-ARG SWIFTSHADER_COMMIT=6a8a74986c357b0c6fa0dfd2b4b9230af8d39d1a
-
-# zlib is needed for compiling SwiftShader.
-RUN apt-get update && apt-get install zlib1g-dev
-
-RUN git clone https://github.com/google/swiftshader \
-  && cd swiftshader && git checkout "${SWIFTSHADER_COMMIT?}" && cd .. \
-  # Only build SwiftShader Vulkan ICD.
-  && cmake -S swiftshader/ -B build-swiftshader/ \
-           -GNinja \
-           -DSWIFTSHADER_BUILD_VULKAN=ON \
-           -DSWIFTSHADER_BUILD_EGL=OFF \
-           -DSWIFTSHADER_BUILD_GLESv2=OFF \
-           -DSWIFTSHADER_BUILD_GLES_CM=OFF \
-           -DSWIFTSHADER_BUILD_PVR=OFF \
-           -DSWIFTSHADER_BUILD_TESTS=OFF \
-  && cmake --build build-swiftshader/ \
-           --config Release \
-           --target vk_swiftshader \
-  # Copy the ICD JSON and .so to a known place.
-  && cp -rf build-swiftshader/Linux /swiftshader \
-  # Keep track of the commit we are using.
-  && echo "${SWIFTSHADER_COMMIT?}" > /swiftshader/git-commit \
-  # Clean up everything.
-  && rm -rf swiftshader build-swiftshader
-
-# Set VK_ICD_FILENAMES so Vulkan loader can find the SwiftShader ICD.
-ENV VK_ICD_FILENAMES /swiftshader/vk_swiftshader_icd.json
diff --git a/build_tools/docker/manage_images.py b/build_tools/docker/manage_images.py
index 9e7b7e3..468313d 100755
--- a/build_tools/docker/manage_images.py
+++ b/build_tools/docker/manage_images.py
@@ -48,17 +48,22 @@
 
 # Map from image names to images that they depend on.
 IMAGES_TO_DEPENDENCIES = {
-    'bazel': [],
-    'bazel-bindings': ['bazel'],
-    'bazel-tensorflow': ['bazel-bindings'],
-    'bazel-nvidia': ['bazel-tensorflow'],
-    'bazel-swiftshader': ['bazel-tensorflow'],
-    'cmake': [],
-    'cmake-android': ['cmake'],
-    'cmake-nvidia': ['cmake'],
-    'cmake-vulkan': ['cmake'],
-    'cmake-swiftshader': ['cmake-vulkan'],
+    'base': [],
+    'bazel': ['base', 'util'],
+    'bazel-python': ['bazel'],
+    'bazel-tensorflow': ['bazel-python'],
+    'bazel-tensorflow-nvidia': ['bazel-tensorflow-vulkan'],
+    'bazel-tensorflow-swiftshader': ['bazel-tensorflow-vulkan', 'swiftshader'],
+    'bazel-tensorflow-vulkan': ['bazel-tensorflow'],
+    'cmake': ['base', 'util'],
+    'cmake-android': ['cmake', 'util'],
+    'cmake-python': ['cmake'],
+    'cmake-python-nvidia': ['cmake-python-vulkan'],
+    'cmake-python-swiftshader': ['cmake-python-vulkan', 'swiftshader'],
+    'cmake-python-vulkan': ['cmake-python'],
     'rbe-toolchain': [],
+    'swiftshader': ['cmake'],
+    'util': [],
 }
 
 IMAGES_TO_DEPENDENT_IMAGES = {k: [] for k in IMAGES_TO_DEPENDENCIES}
@@ -252,7 +257,7 @@
     print(f'Processing image {image}')
     image_name = posixpath.join(IREE_GCR_URL, image)
     image_tag = f'{image_name}:{args.tag}'
-    image_path = os.path.join(DOCKER_DIR, image.replace('-', '_'))
+    image_path = os.path.join(DOCKER_DIR, image)
 
     if args.pull:
       check_stream_command(['docker', 'pull', image_tag], dry_run=args.dry_run)
diff --git a/build_tools/docker/rbe-toolchain/Dockerfile b/build_tools/docker/rbe-toolchain/Dockerfile
new file mode 100755
index 0000000..ffb0f0f
--- /dev/null
+++ b/build_tools/docker/rbe-toolchain/Dockerfile
@@ -0,0 +1,123 @@
+# Copyright 2020 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# An image for building IREE in RBE's remmote execution environments.
+# The parent image requires gcloud authorization to download (run
+# `gcloud auth configure-docker`)
+
+# Note that this doesn't reuse anything from our other docker images because it
+# is based on Ubuntu 16.04, which is the only image that RBE provides toolchains
+# for. There are also Ubuntu 18.04 images, but we'd have to construct all our
+# own toolchains.
+
+######################## Install Swiftshader ###################################
+FROM ubuntu:16.04 AS install-swiftshader
+WORKDIR /install-swiftshader
+
+RUN apt-get update && apt-get install -y wget
+
+ARG CMAKE_VERSION=3.13.5
+# Install CMake v3.13, which is ahead of apt-get's version (3.10.2).
+RUN wget "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION?}/cmake-${CMAKE_VERSION?}-Linux-x86_64.sh" \
+  && chmod +x "./cmake-${CMAKE_VERSION?}-Linux-x86_64.sh" \
+  && "./cmake-${CMAKE_VERSION?}-Linux-x86_64.sh" --skip-license --prefix=/usr/ \
+  && rm "./cmake-${CMAKE_VERSION?}-Linux-x86_64.sh"
+
+RUN apt-get update && apt-get install -y \
+  clang \
+  git \
+  ninja-build \
+  python3 \
+  zlib1g-dev
+
+# This commit fixed support for the max version of libstdc++6 available through
+# Ubuntu 16.04 apt.
+ARG SWIFTSHADER_COMMIT=6287c18b1d249152563f0cb2d5cb0c6d0eb9e3d6
+
+RUN git clone https://github.com/google/swiftshader
+RUN cd swiftshader && git checkout "${SWIFTSHADER_COMMIT?}" && cd ..
+# Only build SwiftShader Vulkan ICD.
+RUN cmake -S swiftshader/ -B build-swiftshader/ \
+  -GNinja \
+  -DSWIFTSHADER_BUILD_VULKAN=ON \
+  -DSWIFTSHADER_BUILD_EGL=OFF \
+  -DSWIFTSHADER_BUILD_GLESv2=OFF \
+  -DSWIFTSHADER_BUILD_GLES_CM=OFF \
+  -DSWIFTSHADER_BUILD_PVR=OFF \
+  -DSWIFTSHADER_BUILD_TESTS=OFF
+RUN cmake --build build-swiftshader/ \
+  --config Release \
+  --target vk_swiftshader
+
+# Copy the ICD JSON and .so to a known place.
+RUN cp -rf build-swiftshader/Linux /swiftshader
+# Keep track of the commit we are using.
+RUN echo "${SWIFTSHADER_COMMIT?}" > /swiftshader/git-commit
+
+
+
+######################## Final Image ###########################################
+FROM gcr.io/cloud-marketplace/google/rbe-ubuntu16-04@sha256:1a8ed713f40267bb51fe17de012fa631a20c52df818ccb317aaed2ee068dfc61 AS final
+
+######################## Python 3 ##############################################
+RUN apt-get update \
+  && apt-get install -y \
+    python3 \
+    python3-pip \
+  && python3 -m pip install --upgrade pip \
+  && python3 -m pip install numpy
+
+######################## Vulkan SDK ############################################
+ARG VULKAN_SDK_VERSION=1.2.141
+
+# Disable apt-key parse waring. If someone knows how to do whatever the "proper"
+# thing is then feel free. The warning complains about parsing apt-key output,
+# which we're not even doing.
+ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1
+
+RUN apt-get update \
+  && apt-get install apt-transport-https
+
+# Note that this image is based on Ubuntu 16.04 (xenial) as opposed to
+# Ubuntu 18.04 (bionic), which we use for our other images.
+RUN wget -qO - http://packages.lunarg.com/lunarg-signing-key-pub.asc \
+    | apt-key add - \
+  && wget -qO \
+    "/etc/apt/sources.list.d/lunarg-vulkan-${VULKAN_SDK_VERSION?}-xenial.list" \
+    "http://packages.lunarg.com/vulkan/${VULKAN_SDK_VERSION?}/lunarg-vulkan-${VULKAN_SDK_VERSION?}-xenial.list" \
+  && apt-get update \
+  && apt-get install -y vulkan-sdk
+
+######################## Swiftshader ###########################################
+COPY --from=install-swiftshader /swiftshader /swiftshader
+# Set VK_ICD_FILENAMES so Vulkan loader can find the SwiftShader ICD.
+ENV VK_ICD_FILENAMES /swiftshader/vk_swiftshader_icd.json
+
+RUN apt-get update && apt-get install -y software-properties-common
+
+# apt-add-repository requires a version of python with the softwareproperties
+# module. To use this command, we:
+#   1. remove the symlink to python3 from python3.6 and symlink it to python3.5
+#   2. run apt-add-repository with python3 = python3.5
+#   3. resymlink python3 to /opt/python3.6/bin/python3.6
+# See https://github.com/google/iree/issues/1966 for more information.
+RUN rm /usr/bin/python3 \
+  && ln -s /usr/bin/python3.5 /usr/bin/python3 \
+  && add-apt-repository ppa:deadsnakes/ppa \
+  && rm /usr/bin/python3 \
+  && ln -s /opt/python3.6/bin/python3.6 /usr/bin/python3
+
+# Install python3.6-dev
+RUN apt-get update \
+  && apt-get install -y python3.6 python3.6-dev
diff --git a/build_tools/docker/rbe_toolchain/Dockerfile b/build_tools/docker/rbe_toolchain/Dockerfile
deleted file mode 100755
index 878aca3..0000000
--- a/build_tools/docker/rbe_toolchain/Dockerfile
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright 2020 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# An image for building IREE in RBE's remmote execution environments.
-# The parent image requires gcloud authorization to download
-
-# Build using:
-# gcloud auth configure-docker
-# docker build --tag gcr.io/iree-oss/rbe-toolchain build_tools/docker/rbe_toolchain/
-
-FROM gcr.io/cloud-marketplace/google/rbe-ubuntu16-04@sha256:1a8ed713f40267bb51fe17de012fa631a20c52df818ccb317aaed2ee068dfc61
-
-RUN apt-get update \
-    && apt-get install -y \
-        python3 \
-        python3-pip \
-    && python3 -m pip install --upgrade pip \
-    && python3 -m pip install numpy
-
-# Dependency for python3.6-dev. Needs to be installed separately from the above
-# for... some reason
-RUN apt-get update && apt-get install -y software-properties-common
-
-# apt-add-repository requires a version of python with the softwareproperties
-# module. To use this command, we:
-#   1. remove the symlink to python3 from python3.6 and symlink it to python3.5
-#   2. run apt-add-repository with python3 = python3.5
-#   3. resymlink python3 to /opt/python3.6/bin/python3.6
-# See https://github.com/google/iree/issues/1966 for more information.
-RUN rm /usr/bin/python3 \
-    && ln -s /usr/bin/python3.5 /usr/bin/python3 \
-    && add-apt-repository ppa:deadsnakes/ppa \
-    && rm /usr/bin/python3 \
-    && ln -s /opt/python3.6/bin/python3.6 /usr/bin/python3
-
-# Install python3.6-dev
-RUN apt-get update \
-  && apt-get install -y python3.6 python3.6-dev
diff --git a/build_tools/docker/swiftshader/Dockerfile b/build_tools/docker/swiftshader/Dockerfile
new file mode 100644
index 0000000..562874b
--- /dev/null
+++ b/build_tools/docker/swiftshader/Dockerfile
@@ -0,0 +1,44 @@
+# Copyright 2020 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+FROM gcr.io/iree-oss/cmake AS install-swiftshader
+WORKDIR /install-swiftshader
+
+RUN apt-get update && apt-get install -y git
+
+ARG SWIFTSHADER_COMMIT=6287c18b1d249152563f0cb2d5cb0c6d0eb9e3d6
+
+# zlib is needed for compiling SwiftShader.
+RUN apt-get update && apt-get install -y zlib1g-dev
+RUN git clone https://github.com/google/swiftshader
+RUN cd swiftshader && git checkout "${SWIFTSHADER_COMMIT?}" && cd ..
+# Only build SwiftShader Vulkan ICD.
+RUN cmake -S swiftshader/ -B build-swiftshader/ \
+           -GNinja \
+           -DSWIFTSHADER_BUILD_VULKAN=ON \
+           -DSWIFTSHADER_BUILD_EGL=OFF \
+           -DSWIFTSHADER_BUILD_GLESv2=OFF \
+           -DSWIFTSHADER_BUILD_GLES_CM=OFF \
+           -DSWIFTSHADER_BUILD_PVR=OFF \
+           -DSWIFTSHADER_BUILD_TESTS=OFF
+RUN cmake --build build-swiftshader/ \
+           --config Release \
+           --target vk_swiftshader
+# Copy the ICD JSON and .so to a known place.
+RUN cp -rf build-swiftshader/Linux /swiftshader
+# Keep track of the commit we are using.
+RUN echo "${SWIFTSHADER_COMMIT?}" > /swiftshader/git-commit
+
+FROM ubuntu:18.04 AS final
+COPY --from=install-swiftshader /swiftshader /swiftshader
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/google.cfg b/build_tools/docker/util/Dockerfile
similarity index 65%
copy from build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/google.cfg
copy to build_tools/docker/util/Dockerfile
index e4cc270..1b34d25 100644
--- a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/google.cfg
+++ b/build_tools/docker/util/Dockerfile
@@ -1,5 +1,3 @@
-# Format: //devtools/kokoro/config/proto/build.proto
-
 # Copyright 2020 Google LLC
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,6 +12,15 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Deliberately blank as everything necessary is configured in common files, but
-# file must still exist to match corresponding (Google internal) job
-# configurations that trigger the builds.
+# An image containing utilities useful for setting up docker images, but not
+# needed in the final images. Intermediate stages can inherit from this image,
+# but final stages should not.
+
+FROM ubuntu:18.04 AS final
+
+RUN apt-get update \
+  && apt-get install -y \
+  git \
+  unzip \
+  wget \
+  gnupg2
diff --git a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/bindings/build.sh b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/bindings/build.sh
similarity index 94%
rename from build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/bindings/build.sh
rename to build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/bindings/build.sh
index e302ea4..430e93c 100755
--- a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/bindings/build.sh
+++ b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/bindings/build.sh
@@ -26,9 +26,9 @@
 
 # Check these exist and print the versions for later debugging
 bazel --version
-"$CXX" --version
-"$CC" --version
-"$PYTHON_BIN" -V
+"${CXX?}" --version
+"${CC?}" --version
+"${PYTHON_BIN?}" -V
 # TODO(#1875): Make PYTHON_BIN also control the runtime version
 python3 -V
 
diff --git a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/bindings/build_kokoro.sh b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/bindings/build_kokoro.sh
similarity index 87%
rename from build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/bindings/build_kokoro.sh
rename to build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/bindings/build_kokoro.sh
index ce85c9c..97d5667 100755
--- a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/bindings/build_kokoro.sh
+++ b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/bindings/build_kokoro.sh
@@ -32,8 +32,8 @@
 docker_setup
 
 docker run "${DOCKER_RUN_ARGS[@]?}" \
-  gcr.io/iree-oss/bazel-bindings@sha256:1f5e59f10c35d0f9211c1a8821a931aca746f47a66fe1bc31b8b3bad4f38a0a7 \
-  build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/bindings/build.sh
+  gcr.io/iree-oss/bazel-python@sha256:1e46da0e373a9e6636c4252d32b12ce068d2fe81a5bce992b4220e91d1f76259 \
+  build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/bindings/build.sh
 
 # Kokoro will rsync this entire directory back to the executor orchestrating the
 # build which takes forever and is totally useless.
diff --git a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/common.cfg b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/bindings/common.cfg
similarity index 76%
copy from build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/common.cfg
copy to build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/bindings/common.cfg
index eb31e55..8146a65 100644
--- a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/common.cfg
+++ b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/bindings/common.cfg
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Common configuration for Kokoro builds that run the integrations build with
-# bazel on linux.
+# Common configuration for Kokoro builds that run the bindings build with bazel
+# on linux.
 
-build_file: "iree/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/build_kokoro.sh"
+build_file: "iree/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/bindings/build_kokoro.sh"
diff --git a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/google.cfg b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/bindings/google.cfg
similarity index 100%
copy from build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/google.cfg
copy to build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/bindings/google.cfg
diff --git a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/main.cfg b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/bindings/main.cfg
similarity index 100%
copy from build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/main.cfg
copy to build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/bindings/main.cfg
diff --git a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/presubmit.cfg b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/bindings/presubmit.cfg
similarity index 100%
copy from build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/presubmit.cfg
copy to build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/bindings/presubmit.cfg
diff --git a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/core/build.sh b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/core/build.sh
similarity index 89%
rename from build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/core/build.sh
rename to build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/core/build.sh
index 7b07c6f..2ccc9b9 100755
--- a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/core/build.sh
+++ b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/core/build.sh
@@ -26,11 +26,8 @@
 
 # Check these exist and print the versions for later debugging
 bazel --version
-"$CXX" --version
-"$CC" --version
-"$PYTHON_BIN" -V
-# TODO(#1875): Make PYTHON_BIN also control the runtime version
-python3 -V
+"${CXX?}" --version
+"${CC?}" --version
 
 echo "Initializing submodules"
 ./scripts/git/submodule_versions.py init
diff --git a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/core/build_kokoro.sh b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/core/build_kokoro.sh
similarity index 88%
rename from build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/core/build_kokoro.sh
rename to build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/core/build_kokoro.sh
index da01f66..b569c42 100755
--- a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/core/build_kokoro.sh
+++ b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/core/build_kokoro.sh
@@ -32,8 +32,8 @@
 docker_setup
 
 docker run "${DOCKER_RUN_ARGS[@]?}" \
-  gcr.io/iree-oss/bazel@sha256:b3ce4db78ccfc175cad0b071075cb4b26845980dacd7afa51f39625876062476 \
-  build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/core/build.sh
+  gcr.io/iree-oss/bazel@sha256:81dc9675efb57204a806b83cd988f6a07a1ca8a778119014ae7057ee53eb68d7 \
+  build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/core/build.sh
 
 # Kokoro will rsync this entire directory back to the executor orchestrating the
 # build which takes forever and is totally useless.
diff --git a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/common.cfg b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/core/common.cfg
old mode 100644
new mode 100755
similarity index 76%
rename from build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/common.cfg
rename to build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/core/common.cfg
index eb31e55..5be5980
--- a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/common.cfg
+++ b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/core/common.cfg
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Common configuration for Kokoro builds that run the integrations build with
-# bazel on linux.
+# Common configuration for Kokoro builds that run the core build with bazel on
+# linux.
 
-build_file: "iree/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/build_kokoro.sh"
+build_file: "iree/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/core/build_kokoro.sh"
diff --git a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/google.cfg b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/core/google.cfg
old mode 100644
new mode 100755
similarity index 100%
rename from build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/google.cfg
rename to build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/core/google.cfg
diff --git a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/main.cfg b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/core/main.cfg
old mode 100644
new mode 100755
similarity index 100%
rename from build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/main.cfg
rename to build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/core/main.cfg
diff --git a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/presubmit.cfg b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/core/presubmit.cfg
old mode 100644
new mode 100755
similarity index 100%
rename from build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/presubmit.cfg
rename to build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/core/presubmit.cfg
diff --git a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/integrations/build.sh b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/integrations/build.sh
index 32c061f..1b747ff 100755
--- a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/integrations/build.sh
+++ b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/integrations/build.sh
@@ -26,9 +26,9 @@
 
 # Check these exist and print the versions for later debugging
 bazel --version
-"$CXX" --version
-"$CC" --version
-"$PYTHON_BIN" -V
+"${CXX?}" --version
+"${CC?}" --version
+"${PYTHON_BIN?}" -V
 # TODO(#1875): Make PYTHON_BIN also control the runtime version
 python3 -V
 
diff --git a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/integrations/build_kokoro.sh b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/integrations/build_kokoro.sh
index b8372a2..c55206d 100755
--- a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/integrations/build_kokoro.sh
+++ b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/integrations/build_kokoro.sh
@@ -32,8 +32,7 @@
 docker_setup
 
 docker run "${DOCKER_RUN_ARGS[@]?}" \
-  --env IREE_VULKAN_DISABLE=0 \
-  gcr.io/iree-oss/bazel-swiftshader@sha256:59ca639199c1548d3fd2c9f6bcc04ccd91c6a32fd514a4ea4e2b8542e7b0eed2 \
+  gcr.io/iree-oss/bazel-tensorflow-swiftshader@sha256:269a3a42ca71fa6b040135056f1f5639c2f2c7d651099a88ddd513a011365144 \
   build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/integrations/build.sh
 
 # Kokoro will rsync this entire directory back to the executor orchestrating the
diff --git a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-turing/integrations/build.sh b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-turing/integrations/build.sh
index 51b491d..6d54f0c 100755
--- a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-turing/integrations/build.sh
+++ b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-turing/integrations/build.sh
@@ -26,9 +26,9 @@
 
 # Check these exist and print the versions for later debugging
 bazel --version
-"$CXX" --version
-"$CC" --version
-"$PYTHON_BIN" -V
+"${CXX?}" --version
+"${CC?}" --version
+"${PYTHON_BIN?}" -V
 # TODO(#1875): Make PYTHON_BIN also control the runtime version
 python3 -V
 
diff --git a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-turing/integrations/build_kokoro.sh b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-turing/integrations/build_kokoro.sh
index 4f6f453..70675bb 100755
--- a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-turing/integrations/build_kokoro.sh
+++ b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-turing/integrations/build_kokoro.sh
@@ -26,15 +26,13 @@
 # Kokoro checks out the repository here.
 WORKDIR="${KOKORO_ARTIFACTS_DIR?}/github/iree"
 
-# Mount the checked out repository, make that the working directory and run the
-# tests in the bazel-tensorflow image.
-docker run \
-  --volume "${WORKDIR?}:${WORKDIR?}" \
-  --workdir="${WORKDIR?}" \
-  --rm \
-  --env IREE_VULKAN_DISABLE=0 \
+source "${KOKORO_ARTIFACTS_DIR?}/github/iree/build_tools/kokoro/gcp_ubuntu/docker_common.sh"
+
+docker_setup
+
+docker run "${DOCKER_RUN_ARGS[@]?}" \
   --gpus all \
-  gcr.io/iree-oss/bazel-nvidia@sha256:77866668ac679de65f5008c3c3df0e5dbf2944a431c88a8c1b6b2e8ab7f8c65d \
+  gcr.io/iree-oss/bazel-tensorflow-nvidia@sha256:754dc09c558157f82e9d53451486951fc096e8d2a2b9a1306a29ebfe9e0772df \
   build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-turing/integrations/build.sh
 
 # Kokoro will rsync this entire directory back to the executor orchestrating the
diff --git a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/DELETE_THIS_DIRECTORY b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/DELETE_THIS_DIRECTORY
new file mode 100644
index 0000000..eb66401
--- /dev/null
+++ b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/DELETE_THIS_DIRECTORY
@@ -0,0 +1 @@
+TODO(b/159223300): This whole directory should be deleted.
\ No newline at end of file
diff --git a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/bindings/common.cfg b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/bindings/common.cfg
index 8a49430..8146a65 100644
--- a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/bindings/common.cfg
+++ b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/bindings/common.cfg
@@ -17,4 +17,4 @@
 # Common configuration for Kokoro builds that run the bindings build with bazel
 # on linux.
 
-build_file: "iree/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/bindings/build_kokoro.sh"
+build_file: "iree/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/bindings/build_kokoro.sh"
diff --git a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/core/common.cfg b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/core/common.cfg
index 3a22d10..5be5980 100755
--- a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/core/common.cfg
+++ b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/core/common.cfg
@@ -17,4 +17,4 @@
 # Common configuration for Kokoro builds that run the core build with bazel on
 # linux.
 
-build_file: "iree/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/core/build_kokoro.sh"
+build_file: "iree/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86-swiftshader/core/build_kokoro.sh"
diff --git a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/build.sh b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/build.sh
deleted file mode 100755
index 4626c28..0000000
--- a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/build.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-
-# Copyright 2019 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# For use within a IREE bazel-tensorflow docker image on a Kokoro VM.
-# Log some information about the environment, initialize the submodules and then
-# run the bazel integrations tests.
-
-set -e
-set -x
-
-# Print the UTC time when set -x is on
-export PS4='[$(date -u "+%T %Z")] '
-
-# Check these exist and print the versions for later debugging
-bazel --version
-"$CXX" --version
-"$CC" --version
-"$PYTHON_BIN" -V
-# TODO(#1875): Make PYTHON_BIN also control the runtime version
-python3 -V
-
-echo "Initializing submodules"
-./scripts/git/submodule_versions.py init
-
-echo "Building and testing with bazel"
-./build_tools/bazel/build_tensorflow.sh
diff --git a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/build_kokoro.sh b/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/build_kokoro.sh
deleted file mode 100755
index ca204ca..0000000
--- a/build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/build_kokoro.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-
-# Copyright 2020 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Build and test IREE's integrations within the gcr.io/iree-oss/bazel-tensorflow
-# image using Kokoro.
-# Requires the environment variables KOKORO_ROOT and KOKORO_ARTIFACTS_DIR, which
-# are set by Kokoro.
-
-set -x
-set -e
-set -o pipefail
-
-# Print the UTC time when set -x is on
-export PS4='[$(date -u "+%T %Z")] '
-
-source "${KOKORO_ARTIFACTS_DIR?}/github/iree/build_tools/kokoro/gcp_ubuntu/docker_common.sh"
-
-# Sets DOCKER_RUN_ARGS
-docker_setup
-
-docker run "${DOCKER_RUN_ARGS[@]?}" \
-  gcr.io/iree-oss/bazel-tensorflow@sha256:97045a41e101c7870112e59e39a94e0e3a6dbe376a5bb189cc85b9474bff75a0 \
-  build_tools/kokoro/gcp_ubuntu/bazel/linux/x86/integrations/build.sh
-
-# Kokoro will rsync this entire directory back to the executor orchestrating the
-# build which takes forever and is totally useless.
-rm -rf "${KOKORO_ARTIFACTS_DIR?}"/*
-
-# Print out artifacts dir contents after deleting them as a coherence check.
-ls -1a "${KOKORO_ARTIFACTS_DIR?}/"
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake/android/arm64-v8a/build_kokoro.sh b/build_tools/kokoro/gcp_ubuntu/cmake/android/arm64-v8a/build_kokoro.sh
index 3f22a1c..18aa00d 100755
--- a/build_tools/kokoro/gcp_ubuntu/cmake/android/arm64-v8a/build_kokoro.sh
+++ b/build_tools/kokoro/gcp_ubuntu/cmake/android/arm64-v8a/build_kokoro.sh
@@ -32,7 +32,7 @@
 docker_setup
 
 docker run "${DOCKER_RUN_ARGS[@]?}" \
-  gcr.io/iree-oss/cmake-android@sha256:5efb3d61e26be5ea8f26313d858c11faff5c1ed1fd83b7051d6e1c3309265e01 \
+  gcr.io/iree-oss/cmake-android@sha256:dbee219f04bff26ea04c41e5e4232ab5486abb04c2abf17ab60ff33f7b279227 \
   build_tools/kokoro/gcp_ubuntu/cmake/android/build.sh arm64-v8a
 
 # Kokoro will rsync this entire directory back to the executor orchestrating the
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake/android/build.sh b/build_tools/kokoro/gcp_ubuntu/cmake/android/build.sh
index 9c44cef..eb9d7f2 100755
--- a/build_tools/kokoro/gcp_ubuntu/cmake/android/build.sh
+++ b/build_tools/kokoro/gcp_ubuntu/cmake/android/build.sh
@@ -24,16 +24,16 @@
   exit 1
 fi
 
-ANDROID_ABI=$1
+ANDROID_ABI="${1?}"
 
 # Print the UTC time when set -x is on
 export PS4='[$(date -u "+%T %Z")] '
 
 # Check these exist and print the versions for later debugging
 export CMAKE_BIN="$(which cmake)"
-"$CMAKE_BIN" --version
-"$CC" --version
-"$CXX" --version
+"${CMAKE_BIN?}" --version
+"${CC?}" --version
+"${CXX?}" --version
 python3 --version
 echo "Android NDK path: $ANDROID_NDK"
 
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-swiftshader/build.sh b/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-swiftshader/build.sh
index ddd5a74..420f250 100755
--- a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-swiftshader/build.sh
+++ b/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-swiftshader/build.sh
@@ -24,19 +24,11 @@
 
 # Check these exist and print the versions for later debugging
 export CMAKE_BIN="$(which cmake)"
-"$CMAKE_BIN" --version
-"$CC" --version
-"$CXX" --version
+"${CMAKE_BIN?}" --version
+"${CC?}" --version
+"${CXX?}" --version
 python3 --version
 
-# For some reason the environment variable set in base `cmake` image cannot
-# reach the child `cmake-swiftshader` image. Given this environment variable
-# is just a temporary solution, duplicate it here instead of spending all
-# the effort trying to figure out why.
-# TODO(#2645): remove this once we have a better solution for AOT linker
-# discovery.
-export IREE_LLVMAOT_LINKER_PATH=/usr/bin/ld
-
 # Print Vulkan related information: SDK version and GPU ICD version
 vulkaninfo 2>/dev/null | grep "Vulkan Instance" || echo "Vulkan Instance not found!"
 vulkaninfo 2>/dev/null | grep -A7 "VkPhysicalDeviceProperties"  || echo "VkPhysicalDeviceProperties not found!"
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-swiftshader/build_kokoro.sh b/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-swiftshader/build_kokoro.sh
index 362eaf9..dea51d5 100755
--- a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-swiftshader/build_kokoro.sh
+++ b/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-swiftshader/build_kokoro.sh
@@ -14,8 +14,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Build and test the project within the gcr.io/iree-oss/cmake-swiftshader image
-# using Kokoro.
+# Build and test the project within the gcr.io/iree-oss/cmake-python-swiftshader
+# image using Kokoro.
 # Requires the environment variables KOKORO_ROOT and KOKORO_ARTIFACTS_DIR, which
 # are set by Kokoro.
 
@@ -32,8 +32,7 @@
 docker_setup
 
 docker run "${DOCKER_RUN_ARGS[@]?}" \
-  --env IREE_VULKAN_DISABLE=0 \
-  gcr.io/iree-oss/cmake-swiftshader@sha256:1912ed3a5f85c8d9abd0729834711905ef4ef03b381eb7f99d9fdb7867932d30 \
+  gcr.io/iree-oss/cmake-python-swiftshader@sha256:e84cac3152543a6f300701bfce98e44b25d4e52dc0ffec715b6998058d91d583 \
   build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-swiftshader/build.sh
 
 # Kokoro will rsync this entire directory back to the executor orchestrating the
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-turing/build.sh b/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-turing/build.sh
index f44aa82..cecb29d 100755
--- a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-turing/build.sh
+++ b/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-turing/build.sh
@@ -24,9 +24,9 @@
 
 # Check these exist and print the versions for later debugging
 export CMAKE_BIN="$(which cmake)"
-"$CMAKE_BIN" --version
-"$CC" --version
-"$CXX" --version
+"${CMAKE_BIN?}" --version
+"${CC?}" --version
+"${CXX?}" --version
 python3 --version
 
 # Print Vulkan related information: SDK version and GPU ICD version
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-turing/build_kokoro.sh b/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-turing/build_kokoro.sh
index 518dcd8..8965dd6 100755
--- a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-turing/build_kokoro.sh
+++ b/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-turing/build_kokoro.sh
@@ -32,9 +32,8 @@
 docker_setup
 
 docker run "${DOCKER_RUN_ARGS[@]?}" \
-  --env IREE_VULKAN_DISABLE=0 \
   --gpus all \
-  gcr.io/iree-oss/cmake-nvidia@sha256:26b6fcc4005b4cbb23988b9a8d5484355dd58f5a4a8df10537df8fceb1d7e26a \
+  gcr.io/iree-oss/cmake-python-nvidia@sha256:fb0babff91402d999a2532816d2ee3a9df29ead152e3af7df0215bab9ce85682 \
   build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-turing/build.sh
 
 # Kokoro will rsync this entire directory back to the executor orchestrating the
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/build.sh b/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/build.sh
deleted file mode 100755
index 0c863de..0000000
--- a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/build.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/bash
-
-# Copyright 2020 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Build the project with cmake using Kokoro.
-
-set -e
-set -x
-
-# Print the UTC time when set -x is on
-export PS4='[$(date -u "+%T %Z")] '
-
-# Check these exist and print the versions for later debugging
-export CMAKE_BIN="$(which cmake)"
-"$CMAKE_BIN" --version
-"$CC" --version
-"$CXX" --version
-python3 --version
-
-echo "Initializing submodules"
-./scripts/git/submodule_versions.py init
-
-# TODO(gcmn): It would be nice to be able to build and test as much as possible,
-# so a build failure only prevents building/testing things that depend on it and
-# we can still run the other tests.
-echo "Building with cmake"
-./build_tools/cmake/clean_build.sh
-
-echo "Testing with ctest"
-./build_tools/cmake/test.sh
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/build_kokoro.sh b/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/build_kokoro.sh
deleted file mode 100755
index b3d684e..0000000
--- a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/build_kokoro.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/bash
-
-# Copyright 2020 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Build and test the project within the gcr.io/iree-oss/cmake using Kokoro.
-# Requires the environment variables KOKORO_ROOT and KOKORO_ARTIFACTS_DIR, which
-# are set by Kokoro.
-
-set -x
-set -e
-set -o pipefail
-
-# Print the UTC time when set -x is on
-export PS4='[$(date -u "+%T %Z")] '
-
-source "${KOKORO_ARTIFACTS_DIR?}/github/iree/build_tools/kokoro/gcp_ubuntu/docker_common.sh"
-
-# Sets DOCKER_RUN_ARGS
-docker_setup
-
-docker run "${DOCKER_RUN_ARGS[@]?}" \
-  gcr.io/iree-oss/cmake@sha256:da2de0066bf5e9607fe35c4e7816b19e779d47cd29a0a5f889a66c9c64aded57 \
-  build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/build.sh
-
-# Kokoro will rsync this entire directory back to the executor orchestrating the
-# build which takes forever and is totally useless.
-rm -rf "${KOKORO_ARTIFACTS_DIR?}"/*
-
-# Print out artifacts dir contents after deleting them as a coherence check.
-ls -1a "${KOKORO_ARTIFACTS_DIR?}/"
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/main.cfg b/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/main.cfg
deleted file mode 100644
index e4cc270..0000000
--- a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/main.cfg
+++ /dev/null
@@ -1,19 +0,0 @@
-# Format: //devtools/kokoro/config/proto/build.proto
-
-# Copyright 2020 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Deliberately blank as everything necessary is configured in common files, but
-# file must still exist to match corresponding (Google internal) job
-# configurations that trigger the builds.
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/presubmit.cfg b/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/presubmit.cfg
deleted file mode 100644
index e4cc270..0000000
--- a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86/presubmit.cfg
+++ /dev/null
@@ -1,19 +0,0 @@
-# Format: //devtools/kokoro/config/proto/build.proto
-
-# Copyright 2020 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Deliberately blank as everything necessary is configured in common files, but
-# file must still exist to match corresponding (Google internal) job
-# configurations that trigger the builds.