-
Notifications
You must be signed in to change notification settings - Fork 3
/
singularity_recipe.def
executable file
·102 lines (82 loc) · 4.09 KB
/
singularity_recipe.def
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
Bootstrap: docker
From: centos:centos7
%setup
rm -rf $SINGULARITY_ROOTFS/freesurfer
mkdir $SINGULARITY_ROOTFS/freesurfer
wget -O freesurfer-linux-centos7_x86_64-dev.tar.gz "https://www.dropbox.com/s/qhhje2ond0ja7px/freesurfer-linux-centos7_x86_64-dev.tar.gz?dl=0?download=1"
tar zxvf freesurfer-linux-centos7_x86_64-dev.tar.gz -C $SINGULARITY_ROOTFS/freesurfer/
wget -O $SINGULARITY_ROOTFS/fs_install_mcr.sh "https://www.dropbox.com/s/v54cc4v6e6im0i9/fs_install_mcr.sh?dl=0d?download=1"
wget -O $SINGULARITY_ROOTFS/license.txt "https://www.dropbox.com/s/zs4k3bcfxderj58/license.txt?dl=0"
wget -O FS_BN_GL_SF_utils.tar "https://www.dropbox.com/s/zzptxby9pf5lpih/FS_BN_GL_SF_utils.tar?dl=0?download=1"
tar -xf FS_BN_GL_SF_utils.tar -C $SINGULARITY_ROOTFS/
mkdir $SINGULARITY_ROOTFS/pybin $SINGULARITY_ROOTFS/CODE/
cp ../code/* $SINGULARITY_ROOTFS/CODE/
%environment
export FREESURFER_HOME=/freesurfer/freesurfer/
. /freesurfer/freesurfer/SetUpFreeSurfer.sh
export FS_LICENSE=$SINGULARITY_ROOTFS/license.txt
%post
export FREESURFER_HOME=/freesurfer/freesurfer/
yum update -y
yum groupinstall -y development
yum install -y hostname openssl openssl-devel sqlite-devel sudo tar which
yum install -y libgomp tcsh bc perl wget unzip git
yum install -y gcc openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel
yum install -y tcsh bc mesa-libGLU libgomp perl mesa-dri-drivers
yum install -y xorg-x11-server-Xvfb xorg-x11-xauth which
yum install -y java-1.8.0-openjdk
export LC_CTYPE="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"
export LANGUAGE=en_US.UTF-8
wget http://ftp.gnu.org/gnu/parallel/parallel-latest.tar.bz2
tar xjf parallel-latest.tar.bz2
cd parallel-* && ./configure
make && make install
echo 'will cite' | parallel --citation 1> /dev/null 2> /dev/null &
mv $SINGULARITY_ROOTFS/fs_install_mcr.sh $FREESURFER_HOME/bin/
bash /freesurfer/freesurfer/bin/fs_install_mcr.sh R2012b
yum -y install atlas-devel lapack-devel blas-devel
yum -y install libjpeg-devel ImageMagick
cd /tmp && \
wget 'https://www.openssl.org/source/openssl-1.1.0h.tar.gz' &&\
tar -xf openssl-1.1.0h.tar.gz &&\
cd openssl-1.1.0h &&\
./config shared --prefix=/usr/local/openssl11 --openssldir=/usr/local/openssl11 && make && make install
cd /tmp && \
wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz && \
tar xvfz Python-3.7.3.tgz && \
cd Python-3.7.3 && \
# Fix the SSL headers https://benad.me/blog/2018/07/17/python-3.7-on-centos-6/
sed -i 's/SSL=\/usr\/local\/ssl/SSL=\/usr\/local\/openssl11/g' Modules/Setup.dist &&\
sed -i '211,214 s/^##*//' Modules/Setup.dist &&\
# End of SSL fix
LDFLAGS="-Wl,-rpath=/usr/local/openssl11/lib" \
./configure --prefix=/usr/local --enable-shared --with-openssl=/usr/local/openssl11 --with-system-ffi && \
make && \
make altinstall
cd $SINGULARITY_ROOTFS
echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig
pip3.7 install --upgrade pip
pip install fpdf
pip install scikit-image
git clone https://github.com/frheault/scilpy.git $SINGULARITY_ROOTFS/scilpy/ && cd $SINGULARITY_ROOTFS/scilpy/
git checkout 7f9aebe3
pip3.7 install -r requirements.txt
python3.7 setup.py develop
cd ../
sed -i '41s/.*/backend : Agg/' /usr/local/lib/python3.7/site-packages/matplotlib/mpl-data/matplotlibrc
wget https://github.com/nextflow-io/nextflow/releases/download/v19.04.0/nextflow-19.04.0-all
mv nextflow-19.04.0-all /nextflow
chmod +x /nextflow
git clone https://github.com/frheault/freesurfer-nf.git
cd freesurfer-nf/
git checkout 4441319
sed -i 's/scratch = true/scratch = false/g' $SINGULARITY_ROOTFS/freesurfer-nf/nextflow.config
# Make custom folders
mkdir -p /INPUTS && chmod 755 /INPUTS
mkdir -p /OUTPUTS && chmod 775 /OUTPUTS
mkdir -p /TMP && chmod 775 /TMP
%runscript
xvfb-run -a --server-num=$((65536+$$)) --server-args="-screen 0 1600x1280x24 -ac" bash /CODE/launch_connectivity_atlases_flow_wrapper.sh /INPUTS /OUTPUTS "$@"