# This dockerfile builds automatically upon push to the main branch. It can be built # interactively for testing via: # docker buildx build --file dockerfiles/build_manylinux_x86_64.Dockerfile dockerfiles/ # This will print a SHA image id, which you can run with (or equiv): # sudo docker run --rm -it --entrypoint /bin/bash <> # # To build and push to a test branch, create a pull request on a branch named: # stage/docker/* # We build our portable linux releases on the manylinux (RHEL-based) # images, with custom additional packages installed. We switch to # new upstream versions as needed. FROM quay.io/pypa/manylinux_2_28_x86_64@sha256:d632b5e68ab39e59e128dcf0e59e438b26f122d7f2d45f3eea69ffd2877ab017 ######## Python and CMake setup ####### # These images come with multiple python versions. We pin one for # default use. # Prepend therock-tools to PATH ENV PATH="/usr/local/therock-tools/bin:/opt/python/cp312-cp312/bin:${PATH}" ######## Pip Packages ######## RUN pip install --upgrade pip setuptools==69.1.1 wheel==0.46.2 && \ pip install CppHeaderParser==2.7.4 meson==1.7.0 tomli==2.2.1 PyYAML==6.0.2 ######## CCache ######## WORKDIR /install-ccache COPY install_ccache.sh ./ RUN ./install_ccache.sh "4.11.2" && rm -rf /install-ccache ######## SCCache ######## WORKDIR /install-sccache COPY install_sccache.sh ./ RUN ./install_sccache.sh "0.14.0" && rm -rf /install-sccache ######## CMake ######## WORKDIR /install-cmake ENV CMAKE_VERSION="3.27.9" COPY install_cmake.sh ./ RUN ./install_cmake.sh "${CMAKE_VERSION}" && rm -rf /install-cmake ######## Ninja ######## WORKDIR /install-ninja ENV NINJA_VERSION="1.12.1" COPY install_ninja.sh ./ RUN ./install_ninja.sh "${NINJA_VERSION}" && rm -rf /install-ninja ######## AWS CLI ###### WORKDIR /install-awscli COPY install_awscli.sh ./ RUN ./install_awscli.sh && rm -rf /install-awscli ######## Installing Google test ####### WORKDIR /install-googletest ENV GOOGLE_TEST_VERSION="1.16.0" COPY install_googletest.sh ./ RUN ./install_googletest.sh "${GOOGLE_TEST_VERSION}" && rm -rf /install-googletest ######## Rust (rustup) ######## ENV RUSTUP_HOME="/usr/local/rustup" ENV CARGO_HOME="/usr/local/cargo" WORKDIR /install-rust ENV RUST_VERSION="1.95.0" COPY install_rust.sh ./ RUN ./install_rust.sh "${RUST_VERSION}" && rm -rf /install-rust ######## Yum Packages ####### # We are pinning to gcc-toolset-12 until it is safe to upgrade. The latest # manylinux containers use gcc-toolset-14 or later, which is not yet compatible # with the LLVM that ROCm builds. This can be upgraded when clang-21 is used. # # We allow development tools in this list but not development packages (so that # things can't acceidentally build with system dependencies). # # Development tool dependencies: # texinfo, flag: rocprofiler-systems RUN yum install -y epel-release && \ yum remove -y gcc-toolset* && \ yum install -y \ gcc-toolset-13-binutils \ gcc-toolset-13-gcc \ gcc-toolset-13-gcc-c++ \ gcc-toolset-13-gcc-gfortran \ gcc-toolset-13-libatomic-devel \ gcc-toolset-13-libstdc++-devel \ vim-common \ git-lfs \ && yum install -y \ texinfo \ flex \ && yum clean all && \ rm -rf /var/cache/yum ######## DVC via pip ###### # dvc's rpm package includes .so dependencies built against glib 2.29 # settling for pip install for now, but it installs modules not needed for dvc pull # more dvc features may be used in upcoming sequenced builds # Pin aiobotocore explicitly so rebuilds resolve a deterministic botocore # window. Without this, dvc's loose `aiobotocore` bound lets future pip # resolutions drift botocore out of the boto3 pin in requirements.txt. # # Note: aiobotocore==3.4.0 requires botocore>=1.42.79,<1.42.85; keep the # boto3 pin in requirements.txt aligned with that window. RUN pip install 'dvc[s3]==3.67.1' 'aiobotocore==3.4.0' && \ which dvc && dvc --version || true ######## Enable GCC Toolset and verify ######## # This is a subset of what is typically sourced in the gcc-toolset enable # script. # The base manylinux container has references to its gcc-toolset in its PATHs, # clean up LIBRARY_PATH and LD_LIBRARY_PATH since we yum remove that version. # -- Predefine variables to avoid Dockerfile linting warnings -- # Docker requires environment variables to be defined before reuse. ENV LIBRARY_PATH="" ENV LD_LIBRARY_PATH="" ENV DEVTOOLSET_ROOTPATH="/opt/rh/gcc-toolset-13/root" ENV PATH="/opt/rh/gcc-toolset-13/root/usr/bin:${PATH}" ENV LIBRARY_PATH="/opt/rh/gcc-toolset-13/root/usr/lib64:/opt/rh/gcc-toolset-13/root/usr/lib:${LIBRARY_PATH}" ENV LD_LIBRARY_PATH="/opt/rh/gcc-toolset-13/root/usr/lib64:/opt/rh/gcc-toolset-13/root/usr/lib:${LD_LIBRARY_PATH}" ######## Enable GCC Toolset and verify ######## RUN which gcc && gcc --version && \ which g++ && g++ --version && \ which clang++ || true ######## PatchELF ######## # Note: requires newer gcc toolset so after gcc activation WORKDIR /install-patchelf ENV PATCHELF_GIT_REF="d0f70eea5397606c486857e0a105e53ec123904a" COPY install_patchelf.sh ./ RUN ./install_patchelf.sh "${PATCHELF_GIT_REF}" && rm -rf /install-patchelf ######## Shared Python Interpreters ######## # Build Python with --enable-shared for embedding (e.g., rocgdb). # The manylinux /opt/python builds are statically linked and can't be embedded. WORKDIR /install-shared-pythons COPY install_shared_pythons.sh ./ RUN ./install_shared_pythons.sh /tmp/python-build && rm -rf /install-shared-pythons /tmp/python-build ######## GIT CONFIGURATION ######## # Git started enforcing strict user checking, which thwarts version # configuration scripts in a docker image where the tree was checked # out by the host and mapped in. Disable the check. # See: https://github.com/openxla/iree/issues/12046 # We use the wildcard option to disable the checks. This was added # in git 2.35.3 RUN git config --global --add safe.directory '*'