forked from PaddlePaddle/Paddle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.ubuntu22
More file actions
164 lines (138 loc) · 7.45 KB
/
Dockerfile.ubuntu22
File metadata and controls
164 lines (138 loc) · 7.45 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# A image for building paddle binaries
# Use cuda devel base image for both cpu and gpu environment
# When you modify it, please be aware of cudnn-runtime version
FROM <baseimg>
MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com>
# ENV variables
ARG WITH_GPU
ARG WITH_AVX
ENV WITH_GPU=${WITH_GPU:-ON}
ENV WITH_AVX=${WITH_AVX:-ON}
ENV DEBIAN_FRONTEND=noninteractive
<setcuda>
ENV HOME /root
# Add bash enhancements
COPY paddle/scripts/docker/root/ /root/
RUN chmod 777 /tmp
RUN mv /etc/apt/sources.list.d/cuda-ubuntu2204-x86_64.list /etc/apt/sources.list.d/cuda-ubuntu2204-x86_64.list.bak
RUN apt-get update && apt-get install -y curl
RUN curl https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub | gpg --dearmor | tee /usr/share/keyrings/cuda-archive-keyring.gpg
RUN mv /etc/apt/sources.list.d/cuda-ubuntu2204-x86_64.list.bak /etc/apt/sources.list.d/cuda-ubuntu2204-x86_64.list
RUN sed -i 's#deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 /#deb [signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 /#' /etc/apt/sources.list.d/cuda-ubuntu2204-x86_64.list
RUN apt-get update --allow-unauthenticated && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install -y build-essential curl wget vim git unzip pigz zstd unrar tar xz-utils libssl-dev bzip2 gzip \
coreutils ntp language-pack-zh-hans libsm6 libxext6 libxrender-dev libgl1 libglx-mesa0 \
bison graphviz libjpeg-dev zlib1g-dev automake locales swig net-tools libtool kmod
<install_cpu_package>
WORKDIR /usr/bin
COPY tools/dockerfile/build_scripts /build_scripts
RUN bash /build_scripts/install_trt.sh
# Older versions of patchelf limited the size of the files being processed and were fixed in this pr.
# # https://github.com/NixOS/patchelf/commit/ba2695a8110abbc8cc6baf0eea819922ee5007fa
# # So install a newer version here.
RUN bash /build_scripts/install_patchelf.sh
RUN apt-get install -y gcc-12 g++-12
RUN cp gcc gcc.bak && cp g++ g++.bak && rm gcc && rm g++
RUN ln -s /usr/bin/gcc-12 /usr/local/bin/gcc
RUN ln -s /usr/bin/g++-12 /usr/local/bin/g++
RUN ln -s /usr/bin/gcc-12 /usr/bin/gcc
RUN ln -s /usr/bin/g++-12 /usr/bin/g++
ENV PATH=/usr/local/gcc-12/bin:$PATH
<install_cudnn>
RUN rm -rf /build_script
# install cmake && ccache
RUN apt-get remove --purge cmake && apt-get install -y cmake
# ccache version 4.9.1
RUN apt-get install -y ccache
RUN apt-get update && \
apt-get install -y python3.9 python3.9-dev python3.9-distutils \
python3.10 python3.10-dev python3.10-distutils \
python3.11 python3.11-dev python3.11-distutils \
python3.12 python3.12-dev \
python3.13 python3.13-dev python3.13-nogil && \
apt-get install python-is-python3
RUN rm /usr/bin/python && ln -s /usr/bin/python3.9 /usr/bin/python && \
rm /usr/bin/python3 && ln -s /usr/bin/python3.9 /usr/bin/python3
WORKDIR /home
RUN wget -q https://bootstrap.pypa.io/get-pip.py
RUN sed -i 's#"install", "--upgrade", "--force-reinstall"#"install", "--upgrade", "--force-reinstall", "--break-system-packages"#' get-pip.py
RUN python3.9 get-pip.py && \
python3.10 get-pip.py && \
python3.11 get-pip.py && \
python3.12 get-pip.py
RUN python3.13t get-pip.py && \
mv /usr/local/bin/pip3.13 /usr/local/bin/pip3.13t && \
python3.13 get-pip.py
RUN python3.9 -m pip install setuptools==50.3.2 && \
python3.10 -m pip install setuptools==68.2.0 && \
python3.11 -m pip install setuptools==68.2.0 && \
python3.12 -m pip install --break-system-packages setuptools==68.2.0 && \
python3.13 -m pip install setuptools==69.5.0 && \
python3.13t -m pip install setuptools==69.5.0
# binutils >= 2.27
RUN apt-get install -y binutils
# Install Go and glide
RUN wget --no-check-certificate -qO- https://paddle-ci.gz.bcebos.com/go1.17.2.linux-amd64.tar.gz | \
tar -xz -C /usr/local && \
mkdir /root/gopath && \
mkdir /root/gopath/bin && \
mkdir /root/gopath/src
ENV GOROOT=/usr/local/go GOPATH=/root/gopath
# should not be in the same line with GOROOT definition, otherwise docker build could not find GOROOT.
ENV PATH=${PATH}:${GOROOT}/bin:${GOPATH}/bin
# install glide
# RUN apt-get install -y golang-glide
# git credential to skip password typing
RUN git config --global credential.helper store
# Fix locales to en_US.UTF-8
RUN localedef -i en_US -f UTF-8 en_US.UTF-8
#For pre-commit
RUN rm -f /usr/local/bin/pip && ln -s /usr/local/bin/pip3.9 /usr/local/bin/pip && \
rm -f /usr/local/bin/pip3 && ln -s /usr/local/bin/pip3.9 /usr/local/bin/pip3
RUN python3.9 -m pip --no-cache-dir install ipython==5.3.0 && \
python3.9 -m pip --no-cache-dir install ipykernel==4.6.0 wheel && \
python3.10 -m pip --no-cache-dir install ipython==5.3.0 && \
python3.10 -m pip --no-cache-dir install ipykernel==4.6.0 wheel && \
python3.11 -m pip --no-cache-dir install ipython==5.3.0 && \
python3.11 -m pip --no-cache-dir install ipykernel==4.6.0 wheel && \
python3.12 -m pip --no-cache-dir install --break-system-packages ipython==5.3.0 && \
python3.12 -m pip --no-cache-dir install --break-system-packages ipykernel==4.6.0 wheel && \
python3.13 -m pip --no-cache-dir install ipython==5.3.0 && \
python3.13 -m pip --no-cache-dir install ipykernel==4.6.0 wheel && \
python3.13t -m pip --no-cache-dir install ipython==5.3.0 && \
python3.13t -m pip --no-cache-dir install ipykernel==4.6.0 wheel
# For PaddleTest CE
RUN python3.9 -m pip --no-cache-dir install pytest && \
python3.10 -m pip --no-cache-dir install pytest && \
python3.11 -m pip --no-cache-dir install pytest && \
python3.12 -m pip --no-cache-dir install --break-system-packages pytest && \
python3.13 -m pip --no-cache-dir install pytest && \
python3.13t -m pip --no-cache-dir install pytest
RUN python3.9 -m pip --no-cache-dir install pre-commit==2.17.0 && \
python3.10 -m pip --no-cache-dir install pre-commit==2.17.0 && \
python3.9 -m pip --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0 && \
python3.10 -m pip --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0 && \
python3.11 -m pip --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0 && \
python3.12 -m pip --no-cache-dir install --break-system-packages cpplint==1.6.0 clang-format==13.0.0 && \
python3.13 -m pip --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0 && \
python3.13t -m pip --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0
COPY ./python/requirements.txt /root/
COPY ./python/unittest_py/requirements.txt /home/
RUN python3.9 -m pip --no-cache-dir install -r /root/requirements.txt && \
python3.9 -m pip --no-cache-dir install -r /home/requirements.txt && \
python3.10 -m pip --no-cache-dir install -r /root/requirements.txt && \
python3.10 -m pip --no-cache-dir install -r /home/requirements.txt && \
python3.11 -m pip --no-cache-dir install -r /root/requirements.txt && \
python3.11 -m pip --no-cache-dir install -r /home/requirements.txt && \
python3.12 -m pip --no-cache-dir install --break-system-packages -r /root/requirements.txt && \
python3.12 -m pip --no-cache-dir install --break-system-packages -r /home/requirements.txt && \
python3.13 -m pip --no-cache-dir install -r /root/requirements.txt && \
python3.13 -m pip --no-cache-dir install -r /home/requirements.txt && \
python3.13t -m pip --no-cache-dir install -r /root/requirements.txt
# clang14
RUN apt-get update &&\
apt install -y clang-14
EXPOSE 22