This repository has been archived by the owner on Nov 16, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSingularity
70 lines (48 loc) · 1.47 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
Bootstrap: docker
From: nvidia/cuda:8.0-cudnn5-devel-ubuntu16.04
%environment
#Environment variables
#Use bash as default shell
SHELL=/bin/bash
#Add CUDA paths
CPATH="/usr/local/cuda/include:$CPATH"
PATH="/usr/local/cuda/bin:$PATH"
LD_LIBRARY_PATH="/usr/local/cuda/lib64:$LD_LIBRARY_PATH"
CUDA_HOME="/usr/local/cuda"
#Add Anaconda path
PATH="/usr/local/anaconda3-4.2.0/bin:$PATH"
export PATH LD_LIBRARY_PATH CPATH CUDA_HOME
%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 "\n #Using bash as default shell \n" >> /environment
echo 'SHELL=/bin/bash' >> /environment
#Make environment file executable
chmod +x /environment
#Default mount paths
mkdir /scratch /data /shared /fastdata
#Updating and getting required packages
apt-get update
apt-get install -y wget git vim
#Creates a build directory
mkdir build
cd build
#Download and install Anaconda
CONDA_INSTALL_PATH="/usr/local/anaconda3-4.2.0"
wget https://repo.continuum.io/archive/Anaconda3-4.2.0-Linux-x86_64.sh
chmod +x Anaconda3-4.2.0-Linux-x86_64.sh
./Anaconda3-4.2.0-Linux-x86_64.sh -b -p $CONDA_INSTALL_PATH
#Install Theano
conda install -y scipy nose pydot-ng theano pygpu
#Install Keras
pip install keras
%runscript
#Executes with the singularity run command
#delete this section to use existing docker ENTRYPOINT command
%test
#Test that script is a success