Update ML Build Docker container to use hermetic C++

PiperOrigin-RevId: 826147864
This commit is contained in:
Quoc Truong 2025-10-30 12:48:50 -07:00 committed by TensorFlower Gardener
parent 7e7b1a3015
commit f01a7fea8c
4 changed files with 4 additions and 40 deletions

View File

@ -12,14 +12,6 @@ COPY builder.packages.txt /builder.packages.txt
RUN /setup.sources.sh && /setup.packages.sh /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 # Setup Python
COPY setup.python.sh /setup.python.sh COPY setup.python.sh /setup.python.sh
COPY builder.requirements.txt /builder.requirements.txt 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/bin/python3.12 /usr/bin/python
RUN ln -sf /usr/lib/python3.12 /usr/lib/tf_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. # 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 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

View File

@ -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 # Other build-related tools
apt-transport-https apt-transport-https
autoconf autoconf
automake automake
build-essential build-essential
ca-certificates ca-certificates
llvm-18
clang-18
clang-tidy-18
lld-18
clang-format-12
curl curl
git git
parallel parallel
@ -32,4 +13,5 @@ unzip
zip zip
openjdk-21-jdk openjdk-21-jdk
vim vim
wget
jq jq

View File

@ -5,6 +5,9 @@ id
urllib3 urllib3
requests requests
# For XLA
pyyaml
# For JAX # For JAX
build ~= 1.2.2 build ~= 1.2.2
# uv is faster than pip for installing Python packages. # uv is faster than pip for installing Python packages.

View File

@ -45,16 +45,6 @@ fi
/setup.packages.sh pythons.txt /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: # Python 3.10 include headers fix:
# sysconfig.get_path('include') incorrectly points to /usr/local/include/python # sysconfig.get_path('include') incorrectly points to /usr/local/include/python
# map /usr/include/python3.10 to /usr/local/include/python3.10 # map /usr/include/python3.10 to /usr/local/include/python3.10