-
Notifications
You must be signed in to change notification settings - Fork 1
/
Singularity.tf2_cuda_pip
86 lines (61 loc) · 1.91 KB
/
Singularity.tf2_cuda_pip
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
Bootstrap: docker
From: nvidia/cuda:10.0-cudnn7-runtime-centos6
# adapted from: https://github.com/marcc-hpc/tensorflow
%environment
# use bash as default shell
SHELL=/bin/bash
export SHELL
export HDF5_USE_FILE_LOCKING='FALSE'
%setup
# runs on host
# the path to the image is $SINGULARITY_ROOTFS
%post
# post-setup script
# load environment variables
. /environment
# use bash as default shell
echo 'SHELL=/bin/bash' >> /environment
# make environment file executable
chmod +x /environment
# default mount paths
mkdir /scratch
# fix this issue: https://github.com/singularityware/singularity/issues/1182#issuecomment-381796545
touch /usr/bin/nvidia-smi
apt-get update && apt-get -y install locales
locale-gen en_US.UTF-8
apt-get install -y git wget
apt-get clean
# scikit, scipy
apt-get install -y python3-scipy
# pip3 install scipy scikit-learn scikit-image
#Tensorflow
pip install tensorflow-gpu==2.0.0
# PIL (pillow for python 3)
#python3-dev python3-pip python3-tk cmake
pip install Pillow
pip install matplotlib
# SimpleITK
pip install simpleitk
#comet
pip install comet_ml
#pandas
pip install pandas
# for Xiaoxiao
#pip install tables #pytables
#pip install nilearn
#pip install nibabel
# TODO: SimpleElastix
# git clone https://github.com/SuperElastix/SimpleElastix
# mkdir SimpleElastix.build
# cd SimpleElastix.build
# #cmake ../SimpleElastix/SuperBuild
# cmake -DWRAP_CSHARP:BOOL=OFF -DWRAP_JAVA:BOOL=OFF -DWRAP_LUA:BOOL=OFF -DWRAP_PYTHON:BOOL=ON -DWRAP_R:BOOL=OFF -DWRAP_RUBY:BOOL=OFF -DWRAP_TCL=BOOL=OFF ../SimpleElastix/SuperBuild
# #make
# make >/dev/null --jobs=4
# cd SimpleITK-build/Wrapping/Python/Packaging
# python setup.py --upgrade install
%runscript
# executes with the singularity run command
# delete this section to use existing docker ENTRYPOINT command
%test
# test that script is a success