From eaf68d7281dbedfda0a4b8430c400e884f0983c6 Mon Sep 17 00:00:00 2001 From: Googler Date: Fri, 26 Jun 2026 11:26:42 -0700 Subject: [PATCH] [TEMP] Inject temporary Docker build into presubmit PiperOrigin-RevId: 938688409 --- Dockerfile | 10 ++++++++++ kokoro/gcp_ubuntu/presubmit.sh | 23 +++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0624fb9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +# Use the official ML Build container as the base +FROM us-docker.pkg.dev/ml-oss-artifacts-published/ml-public-container/ml-build:latest + +# Switch to root to install system packages +USER root + +# Install clang and llvm which are required by XLA/tpu-raiden's bazel configuration +RUN apt-get update && apt-get install -y clang llvm && rm -rf /var/lib/apt/lists/* + +# The container will run as the default user inherited from ml-build diff --git a/kokoro/gcp_ubuntu/presubmit.sh b/kokoro/gcp_ubuntu/presubmit.sh index e94f9ac..1e3a19a 100755 --- a/kokoro/gcp_ubuntu/presubmit.sh +++ b/kokoro/gcp_ubuntu/presubmit.sh @@ -36,6 +36,29 @@ echo "=== 1. Navigating to checked-out repository ===" export REPO_ROOT="${KOKORO_ARTIFACTS_DIR}/github/tpu-raiden" cd "${REPO_ROOT}" +echo "=== 1.5 [TEMP HACK] Building and pushing temporary Docker image ===" +# Ensure Dockerfile is available (Copybara should have placed it here if it's part of the CL) +if [[ ! -f "Dockerfile" ]]; then + echo "Error: Dockerfile not found in repo root!" + exit 1 +fi + +DOCKER_TAG="intern-temp-$(date +%Y%m%d%H%M%S)" +FULL_IMAGE_NAME="us-docker.pkg.dev/cloud-tpu-inference-test/tpu-raiden/ml-build-custom:${DOCKER_TAG}" + +echo "Building ${FULL_IMAGE_NAME}..." +docker build -t "${FULL_IMAGE_NAME}" . + +echo "Authenticating to Artifact Registry..." +gcloud auth configure-docker us-docker.pkg.dev --quiet + +echo "Pushing ${FULL_IMAGE_NAME}..." +docker push "${FULL_IMAGE_NAME}" + +echo "====== [TEMP HACK] Temporary image pushed successfully: ${FULL_IMAGE_NAME} ======" +echo "====== Exiting early to save time ======" +exit 0 + echo "=== 2. Setting up standalone Bazel environment ===" # Read target Bazel version from metadata export BAZEL_VERSION="$(tr -d '\r\n ' < ".bazelversion")"