Run integrations build as root (#2654)
For some reason https://github.com/google/iree/pull/2566 made the
integrations build run three times as long. Reverting until we can
figure out the root cause.
See https://github.com/google/iree/issues/2653
Confirmed presubmits now take 20 minutes
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
index c35d897..19af965 100755
--- 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
@@ -26,10 +26,16 @@
# 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"
+WORKDIR="${KOKORO_ARTIFACTS_DIR?}/github/iree"
-# Sets DOCKER_RUN_ARGS
-docker_setup
+# TODO(#2653): Don't run docker as root
+DOCKER_RUN_ARGS=(
+ # Make the source repository available
+ --volume="${WORKDIR?}:${WORKDIR?}"
+ --workdir="${WORKDIR?}"
+ # Delete the container after
+ --rm
+)
docker run "${DOCKER_RUN_ARGS[@]?}" \
gcr.io/iree-oss/bazel-tensorflow:prod \
@@ -37,7 +43,8 @@
# 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?}"/*
+# TODO(#2653): Remove sudo when docker doesn't run as root
+sudo rm -rf "${KOKORO_ARTIFACTS_DIR?}"/*
# Print out artifacts dir contents after deleting them as a coherence check.
ls -1a "${KOKORO_ARTIFACTS_DIR?}/"