From f01a7fea8c15bae491546b7e3fe5479944507d51 Mon Sep 17 00:00:00 2001 From: Quoc Truong Date: Thu, 30 Oct 2025 12:48:50 -0700 Subject: [PATCH] Update ML Build Docker container to use hermetic C++ PiperOrigin-RevId: 826147864 --- ci/official/containers/ml_build/Dockerfile | 11 ---------- .../containers/ml_build/builder.packages.txt | 20 +------------------ .../ml_build/builder.requirements.txt | 3 +++ .../containers/ml_build/setup.python.sh | 10 ---------- 4 files changed, 4 insertions(+), 40 deletions(-) diff --git a/ci/official/containers/ml_build/Dockerfile b/ci/official/containers/ml_build/Dockerfile index d12c886cc6d..a4fb0cd9b16 100644 --- a/ci/official/containers/ml_build/Dockerfile +++ b/ci/official/containers/ml_build/Dockerfile @@ -12,14 +12,6 @@ COPY builder.packages.txt /builder.packages.txt RUN /setup.sources.sh && /setup.packages.sh /builder.packages.txt -# Install devtoolset-9 in /dt9 with glibc 2.17 and libstdc++ 4.8, for building -# manylinux2014-compatible packages. -COPY builder.devtoolset/fixlinks.sh /fixlinks.sh -COPY builder.devtoolset/rpm-patch.sh /rpm-patch.sh -COPY builder.devtoolset/build_devtoolset.sh /build_devtoolset.sh -COPY builder.devtoolset/glibc2.17-inline.patch /glibc2.17-inline.patch -RUN /build_devtoolset.sh devtoolset-9 /dt9 - # Setup Python COPY setup.python.sh /setup.python.sh COPY builder.requirements.txt /builder.requirements.txt @@ -56,9 +48,6 @@ RUN ln -sf /usr/bin/python3.12 /usr/bin/python3 RUN ln -sf /usr/bin/python3.12 /usr/bin/python RUN ln -sf /usr/lib/python3.12 /usr/lib/tf_python -# Make sure clang is on the path -RUN ln -s /usr/lib/llvm-18/bin/clang /usr/bin/clang - # Link the compat driver to the location if available. RUN if [ -e "/usr/local/cuda/compat/libcuda.so.1" ]; then ln -s /usr/local/cuda/compat/libcuda.so.1 /usr/lib/x86_64-linux-gnu/libcuda.so.1; fi diff --git a/ci/official/containers/ml_build/builder.packages.txt b/ci/official/containers/ml_build/builder.packages.txt index 8dbbf419644..1dce9764cd3 100644 --- a/ci/official/containers/ml_build/builder.packages.txt +++ b/ci/official/containers/ml_build/builder.packages.txt @@ -1,28 +1,9 @@ -# Packages to be installed for the new Docker image. - -# Packages needed to build devtoolset -file -flex -g++ -make -patch -rpm2cpio -unar -wget -xz-utils -cpio - # Other build-related tools apt-transport-https autoconf automake build-essential ca-certificates -llvm-18 -clang-18 -clang-tidy-18 -lld-18 -clang-format-12 curl git parallel @@ -32,4 +13,5 @@ unzip zip openjdk-21-jdk vim +wget jq diff --git a/ci/official/containers/ml_build/builder.requirements.txt b/ci/official/containers/ml_build/builder.requirements.txt index 114efaf9dc9..ae113c68c2f 100644 --- a/ci/official/containers/ml_build/builder.requirements.txt +++ b/ci/official/containers/ml_build/builder.requirements.txt @@ -5,6 +5,9 @@ id urllib3 requests +# For XLA +pyyaml + # For JAX build ~= 1.2.2 # uv is faster than pip for installing Python packages. diff --git a/ci/official/containers/ml_build/setup.python.sh b/ci/official/containers/ml_build/setup.python.sh index cd56f3ca552..b849457420f 100755 --- a/ci/official/containers/ml_build/setup.python.sh +++ b/ci/official/containers/ml_build/setup.python.sh @@ -45,16 +45,6 @@ fi /setup.packages.sh pythons.txt -# Re-link pyconfig.h from x86_64-linux-gnu into the devtoolset directory -# for any Python version present -pushd /usr/include/x86_64-linux-gnu -for f in $(ls | grep python); do - # set up symlink for devtoolset-9 - rm -f /dt9/usr/include/x86_64-linux-gnu/$f - ln -s /usr/include/x86_64-linux-gnu/$f /dt9/usr/include/x86_64-linux-gnu/$f -done -popd - # Python 3.10 include headers fix: # sysconfig.get_path('include') incorrectly points to /usr/local/include/python # map /usr/include/python3.10 to /usr/local/include/python3.10