forked from CN-Healthborn/el7tf1.12gpu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Singularity
185 lines (155 loc) · 3.67 KB
/
Singularity
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
bootstrap:docker
From:nvidia/cuda:9.0-cudnn7-devel-centos7
%post
yum -y upgrade
yum -y install epel-release yum-plugin-priorities
# osg repo
yum -y install http://repo.opensciencegrid.org/osg/3.4/osg-3.4-el7-release-latest.rpm
# pegasus repo
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
yum -y groups mark convert
yum -y grouplist
yum -y groupinstall "Compatibility Libraries" \
"Development Tools" \
"Scientific Support"
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
# osg
yum -y install osg-ca-certs osg-wn-client
rm -f /etc/grid-security/certificates/*.r0
# htcondor - include so we can chirp
yum -y install condor
# pegasus
yum -y install pegasus
# Cleaning caches to reduce size of image
yum clean all
# required directories
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
mkdir -p /host-libs /etc/OpenCL/vendors
##############################################
# Install TensorFlow, Keras, etc. with Python
#curl -O https://bootstrap.pypa.io/2.6/get-pip.py && \
curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py
rm get-pip.py
#pip --no-cache-dir install \
# h5py \
# ipykernel \
# jupyter \
# matplotlib \
# numpy \
# pandas \
# Pillow \
# scipy \
# sklearn
#$PYTHON -m ipykernel.kernelspec
echo "/usr/local/cuda/lib64/" >/etc/ld.so.conf.d/cuda.conf
echo "/usr/local/cuda/extras/CUPTI/lib64/" >>/etc/ld.so.conf.d/cuda.conf
# Create an empty location for nvidia-smi
touch /usr/bin/nvidia-smi
# Install TensorFlow GPU version
pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.12.0-cp27-none-linux_x86_64.whl
# keras
pip install --upgrade keras
#############################
# now do the same for python3
#curl -O https://bootstrap.pypa.io/get-pip.py && \
# python3 get-pip.py && \
# rm get-pip.py
#
#pip3 --no-cache-dir install \
# h5py \
# ipykernel \
# jupyter \
# matplotlib \
# numpy \
# pandas \
# Pillow \
# scipy \
# sklearn
#
#python3 -m ipykernel.kernelspec
#
# Install TensorFlow GPU version
#pip3 uninstall tensorflow-gpu || true
#pip3 install --upgrade tensorflow-gpu==1.12
#
# keras
#pip3 install --upgrade keras
# build info
echo "Timestamp:" `date --utc` | tee /image-build-info.txt