Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions kokoro/gcp_ubuntu/presubmit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")"
Expand Down