forked from CN-Healthborn/el7tf1.12gpu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
221 lines (180 loc) · 4.8 KB
/
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
FROM nvidia/cuda:9.0-cudnn7-devel-centos7
MAINTAINER Alex Himmel "[email protected]"
RUN yum -y upgrade
RUN yum -y install epel-release yum-plugin-priorities
# osg repo
RUN yum -y install http://repo.opensciencegrid.org/osg/3.4/osg-3.4-el7-release-latest.rpm
# pegasus repo
RUN echo -e "# Pegasus\n[Pegasus]\nname=Pegasus\nbaseurl=http://download.pegasus.isi.edu/wms/download/rhel/7/\$basearch/\ngpgcheck=0\nenabled=1\npriority=50" >/etc/yum.repos.d/pegasus.repo
# well rounded basic system to support a wide range of user jobs
RUN yum -y groups mark convert
RUN yum -y grouplist
RUN yum -y groupinstall "Compatibility Libraries" \
"Development Tools" \
"Scientific Support"
RUN yum -y install \
redhat-lsb \
bc \
binutils \
binutils-devel \
coreutils \
curl \
fontconfig \
gcc \
gcc-c++ \
gcc-gfortran \
git \
glew-devel \
glib2-devel \
glib-devel \
graphviz \
gsl-devel \
gtk3 \
java-1.8.0-openjdk \
java-1.8.0-openjdk-devel \
libcurl \
libgfortran \
libGLU \
libgomp \
libicu \
libquadmath \
libtool \
libtool-ltdl \
libtool-ltdl-devel \
libX11-devel \
libXaw-devel \
libXext-devel \
libXft-devel \
libxml2 \
libxml2-devel \
libXmu-devel \
libXpm \
libXpm-devel \
libXt \
mesa-libGL-devel \
openssh \
openssh-server \
openssl \
openssl-devel \
osg-wn-client \
p7zip \
p7zip-plugins \
python-devel \
redhat-lsb-core \
rsync \
stashcache-client \
subversion \
tcl-devel \
tcsh \
time \
tk-devel \
wget \
which
# Add python3 support
RUN yum -y install \
python3 \
python3-dev \
python3-tk
# osg
RUN yum -y install osg-ca-certs osg-wn-client
RUN rm -f /etc/grid-security/certificates/*.r0
# htcondor - include so we can chirp
RUN yum -y install condor
# pegasus
RUN yum -y install pegasus
# Cleaning caches to reduce size of image
RUN yum clean all
# required directories
RUN for MNTPOINT in \
/cvmfs \
/hadoop \
/hdfs \
/lizard \
/mnt/hadoop \
/mnt/hdfs \
/xenon \
/spt \
/stash2 \
/srv \
/scratch \
/data \
/project \
; do \
mkdir -p $MNTPOINT ; \
done
# make sure we have a way to bind host provided libraries
# see https://github.com/singularityware/singularity/issues/611
RUN mkdir -p /host-libs /etc/OpenCL/vendors
# Create an empty location for nvidia executables
RUN for NVBIN in \
nvidia-smi \
nvidia-debugdump \
nvidia-persistenced \
nvidia-cuda-mps-control \
nvidia-cuda-mps-server \
; do \
touch /usr/bin/$NVBIN ; \
done
##############################################
# Install TensorFlow, Keras, etc. with Python
RUN curl -O https://bootstrap.pypa.io/get-pip.py
RUN python get-pip.py
RUN rm get-pip.py
RUN echo "/usr/local/cuda/lib64/" >/etc/ld.so.conf.d/cuda.conf
RUN echo "/usr/local/cuda/extras/CUPTI/lib64/" >>/etc/ld.so.conf.d/cuda.conf
# install Cython
RUN pip install cython
# Install TensorFlow GPU version
RUN pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.12.0-cp27-none-linux_x86_64.whl
# keras
RUN pip install keras==2.2.5
# pytorch
# Future required for python 2.7 support
RUN pip install future
RUN pip install torch==1.4.0 torchvision==0.5.0
# Extra python packages
# ignore-installed pyYAML
# Workaround for issue: https://github.com/pypa/pip/issues/5247
RUN pip --no-cache-dir install --ignore-installed PyYAML \
h5py \
matplotlib \
scikit-learn \
numpy \
pandas \
Pillow \
scipy
### Python 3 support
# Note: The pip symlink will switch from pip2 to pip3 as the default
# But pip3 will be used here, just for clarity.
RUN curl -O https://bootstrap.pypa.io/get-pip.py
RUN python3 get-pip.py
RUN rm get-pip.py
RUN pip3 install cython
# Install TensorFlow GPU version
RUN pip3 install --upgrade tensorflow-gpu==1.12.0
# keras
RUN pip3 install keras==2.2.5
# pytorch
# Future required for python 2.7 support
RUN pip3 install torch==1.4.0 torchvision==0.5.0
RUN pip3 --no-cache-dir install --ignore-installed PyYAML \
h5py \
matplotlib \
scikit-learn \
numpy \
pandas \
Pillow \
scipy
#################################
# Manually add Singularity files
RUN git clone https://github.com/jthiltges/singularity-environment.git /usr/singularity-environment/
RUN cp -r /usr/singularity-environment/{environment,.exec,.run,.shell,singularity,.singularity.d,.test} /
RUN mkdir /.singularity.d/libs
#################################
# According to: https://docs-dev.nersc.gov/cgpu/software/#shifter-with-cuda
RUN echo "export PATH and LD_LIBRARY_PATH"
ENTRYPOINT export PATH=/opt/shifter/bin:${PATH} && export LD_LIBRARY_PATH=/opt/shifter/lib:${LD_LIBRARY_PATH}
############
# Finish up
# build info
RUN echo "Timestamp:" `date --utc` | tee /image-build-info.txt