-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathSingularity
More file actions
93 lines (70 loc) · 2.83 KB
/
Singularity
File metadata and controls
93 lines (70 loc) · 2.83 KB
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
Bootstrap: docker
From: redhat/ubi9:9.5-1738643550
%labels
MAINTAINER Tashrif Billah <tbillah@bwh.harvard.edu>
%help
For running container
- https://github.com/pnlbwh/dMRIharmonization
Please report issues on GitHub.
%files
.condarc /opt/
fslinstaller.py.mgb /opt/
%post
# set up user and working directory
mkdir /home/pnlbwh
cd /home/pnlbwh
export HOME=`pwd`
# install required libraries
yum -y install wget file bzip2 vim git make unzip \
libxcrypt-compat libXext libXt fftw
yum clean all
rm -rf /var/cache/yum
REPO=multi-shell-dMRIharmonization
git clone --single-branch --branch master https://github.com/pnlbwh/$REPO.git
# conda environment
mv /opt/.condarc $HOME/
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
bash Miniforge3-Linux-x86_64.sh -b -p miniconda3
source miniconda3/bin/activate
conda create -y -n harmonization -c conda-forge --override-channels python=3.8
conda activate harmonization
pip install -r $REPO/requirements.txt
conda install -y -c pnlbwh --override-channels ants
# MCR 2017a
MCR=MCR_R2017a_glnxa64_installer
wget https://ssd.mathworks.com/supportfiles/downloads/R2017a/deployment_files/R2017a/installers/glnxa64/$MCR.zip
unzip $MCR.zip -d $MCR
cd $MCR
./install -mode silent -agreeToLicense yes -destinationFolder $HOME/MATLAB_Runtime
cd ..
# MCR 2017a security updates
wget https://ssd.mathworks.com/supportfiles/downloads/R2017a/deployment_files/R2017a/installers/glnxa64/MCR_R2017a_Update_3_glnxa64.sh
bash MCR_R2017a_Update_3_glnxa64.sh -d=`pwd`/MATLAB_Runtime/v92
# fsl-6.0.7
wget https://fsl.fmrib.ox.ac.uk/fsldownloads/fslinstaller.py -O fslinstaller.py > /dev/null 2>&1
VERSION=6.0.7
python /opt/fslinstaller.py.mgb -V 6.0.7.18 -d $HOME/fsl-$VERSION --miniconda Miniforge3-Linux-x86_64.sh --cuda none --skip_ssl_verify --no_env > /dev/null 2>&1
FSLDIR=$HOME/fsl-$VERSION
. $FSLDIR/etc/fslconf/fsl.sh
# unring
git clone https://bitbucket.org/reisert/unring.git
# clean up sources
conda deactivate
conda clean -y --all
rm -rf Miniconda3-latest-Linux-x86_64.sh .cache/pip/* $MCR.zip $MCR MCR_R2017a_Update_3_glnxa64.sh fslinstaller.py
# provide write permissions
chmod a+w $HOME
%environment
# set up bashrc i.e shell
export HOME=/home/pnlbwh/
export USER=`whoami`
export LANG=en_US.UTF-8
FSLDIR=$HOME/fsl-6.0.7
. ${FSLDIR}/etc/fslconf/fsl.sh
MCRROOT=$HOME/MATLAB_Runtime/v92
PATH=$HOME/unring/fsl/:${FSLDIR}/share/fsl/bin:$PATH
CONDA_PREFIX=$HOME/miniconda3/envs/harmonization
ANTSPATH=${CONDA_PREFIX}/bin
PATH=${CONDA_PREFIX}/bin:$PATH
MPLCONFIGDIR=/tmp/
export MCRROOT ANTSPATH PATH FSLDIR MPLCONFIGDIR