-
Notifications
You must be signed in to change notification settings - Fork 16
/
citestwheel.Dockerfile
152 lines (131 loc) · 3.46 KB
/
citestwheel.Dockerfile
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
ARG CUDA_VER=notset
ARG LINUX_VER=notset
ARG BASE_IMAGE=nvcr.io/nvidia/cuda:${CUDA_VER}-devel-${LINUX_VER}
ARG AWS_CLI_VER=notset
FROM amazon/aws-cli:${AWS_CLI_VER} AS aws-cli
FROM ${BASE_IMAGE}
ARG CUDA_VER=notset
ARG LINUX_VER=notset
ARG PYTHON_VER=notset
# Set RAPIDS versions env variables
ENV RAPIDS_CUDA_VERSION="${CUDA_VER}"
ENV RAPIDS_PY_VERSION="${PYTHON_VER}"
ENV RAPIDS_DEPENDENCIES="latest"
ARG DEBIAN_FRONTEND=noninteractive
ENV PYENV_ROOT="/pyenv"
ENV PATH="/pyenv/bin:/pyenv/shims:$PATH"
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
RUN <<EOF
set -e
case "${LINUX_VER}" in
"ubuntu"*)
echo 'APT::Update::Error-Mode "any";' > /etc/apt/apt.conf.d/warnings-as-errors
apt-get update
apt-get install -y software-properties-common
# update git > 2.17
add-apt-repository ppa:git-core/ppa -y
apt-get update
apt-get upgrade -y
# tzdata is needed by the ORC library used by pyarrow, because it provides /etc/localtime
# On Ubuntu 24.04 and newer, we also need tzdata-legacy
os_version=$(grep 'VERSION_ID' /etc/os-release | cut -d '"' -f 2)
if [[ "${os_version}" > "24.04" ]] || [[ "${os_version}" == "24.04" ]]; then
tzdata_pkgs=(tzdata tzdata-legacy)
else
tzdata_pkgs=(tzdata)
fi
apt-get install -y --no-install-recommends \
"${tzdata_pkgs[@]}" \
build-essential \
ca-certificates \
curl \
git \
jq \
libbz2-dev \
libffi-dev \
liblzma-dev \
libncursesw5-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
libxml2-dev \
libxmlsec1-dev \
llvm \
make \
ssh \
tk-dev \
unzip \
wget \
xz-utils \
zlib1g-dev
update-ca-certificates
rm -rf /var/cache/apt/archives /var/lib/apt/lists/*
;;
"rockylinux"*)
dnf update -y
dnf install -y epel-release
dnf update -y
dnf install -y \
bzip2 \
bzip2-devel \
ca-certificates \
curl \
dnf-plugins-core \
gcc \
git \
jq \
libffi-devel \
ncurses-devel \
readline-devel \
sqlite \
sqlite-devel \
wget \
which \
xz \
xz-devel \
zlib-devel
update-ca-trust extract
dnf clean all
pushd tmp
wget https://www.openssl.org/source/openssl-1.1.1k.tar.gz
tar -xzvf openssl-1.1.1k.tar.gz
cd openssl-1.1.1k
./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib no-shared zlib-dynamic
make
make install
popd
;;
*)
echo "Unsupported LINUX_VER: ${LINUX_VER}"
exit 1
;;
esac
EOF
# Install pyenv
RUN curl https://pyenv.run | bash
# Create pyenvs
RUN pyenv update && pyenv install ${PYTHON_VER}
RUN pyenv global ${PYTHON_VER} && python --version
# add bin to path
ENV PATH="/pyenv/versions/${PYTHON_VER}/bin/:$PATH"
# Install the AWS CLI
# Needed to download wheels for running tests
COPY --from=aws-cli /usr/local/aws-cli/ /usr/local/aws-cli/
COPY --from=aws-cli /usr/local/bin/ /usr/local/bin/
# update pip and install build tools
RUN <<EOF
pyenv global ${PYTHON_VER}
python -m pip install --upgrade pip
python -m pip install \
certifi \
'rapids-dependency-file-generator==1.*'
pyenv rehash
EOF
# Install latest gha-tools
RUN wget https://github.com/rapidsai/gha-tools/releases/latest/download/tools.tar.gz -O - \
| tar -xz -C /usr/local/bin
# git safe directory
RUN git config --system --add safe.directory '*'
# Add pip.conf
COPY pip.conf /etc/xdg/pip/pip.conf
CMD ["/bin/bash"]