forked from ROCm/TheRock
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_manylinux_x86_64.Dockerfile
More file actions
134 lines (118 loc) · 5.35 KB
/
Copy pathbuild_manylinux_x86_64.Dockerfile
File metadata and controls
134 lines (118 loc) · 5.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# 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 <<IMAGE>>
#
# 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
######## Repo ########
RUN curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/local/bin/repo && chmod a+x /usr/local/bin/repo
######## 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 CMAKE_VERSION="1.12.1"
COPY install_ninja.sh ./
RUN ./install_ninja.sh "${CMAKE_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
######## 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 \
patchelf \
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
# Also pinning pathspec because a new version of it breaks the private _DIR_MARK
# API that dvc uses. When upgrading past ~3.64.0, then pin can likely be removed.
#
# Note: dvc[s3] version locking currently limits boto3>=1.41.0,<1.42.0
# in requirements.txt
RUN pip install 'pathspec<0.13.0' 'dvc[s3]==3.62.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
######## 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 '*'