Skip to content

Commit dca66cc

Browse files
committed
ENH: adds singularity file and script
1 parent bc10e79 commit dca66cc

File tree

3 files changed

+397
-35
lines changed

3 files changed

+397
-35
lines changed

Singularity

Lines changed: 318 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,318 @@
1+
# Generated by Neurodocker version 0.4.1-dev
2+
# Timestamp: 2018-09-27 11:07:19 UTC
3+
#
4+
# Thank you for using Neurodocker. If you discover any issues
5+
# or ways to improve this software, please submit an issue or
6+
# pull request on our GitHub repository:
7+
#
8+
# https://github.com/kaczmarj/neurodocker
9+
10+
Bootstrap: docker
11+
From: neurodebian:stretch-non-free
12+
13+
%post
14+
export ND_ENTRYPOINT="/neurodocker/startup.sh"
15+
apt-get update -qq
16+
apt-get install -y -q --no-install-recommends \
17+
apt-utils \
18+
bzip2 \
19+
ca-certificates \
20+
curl \
21+
locales \
22+
unzip
23+
apt-get clean
24+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
25+
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
26+
dpkg-reconfigure --frontend=noninteractive locales
27+
update-locale LANG="en_US.UTF-8"
28+
chmod 777 /opt && chmod a+s /opt
29+
mkdir -p /neurodocker
30+
if [ ! -f "$ND_ENTRYPOINT" ]; then
31+
echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT"
32+
echo 'set -e' >> "$ND_ENTRYPOINT"
33+
echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT";
34+
fi
35+
chmod -R 777 /neurodocker && chmod a+s /neurodocker
36+
37+
apt-get update -qq
38+
apt-get install -y -q --no-install-recommends \
39+
convert3d \
40+
ants \
41+
fsl \
42+
gcc \
43+
g++ \
44+
graphviz \
45+
tree \
46+
git-annex-standalone \
47+
vim \
48+
emacs-nox \
49+
nano \
50+
less \
51+
ncdu \
52+
tig \
53+
git-annex-remote-rclone \
54+
octave \
55+
netbase
56+
apt-get clean
57+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
58+
59+
sed -i '$isource /etc/fsl/fsl.sh' $ND_ENTRYPOINT
60+
61+
apt-get update -qq
62+
apt-get install -y -q --no-install-recommends \
63+
bc \
64+
libxext6 \
65+
libxpm-dev \
66+
libxt6
67+
apt-get clean
68+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
69+
echo "Downloading MATLAB Compiler Runtime ..."
70+
curl -fsSL --retry 5 -o /tmp/mcr.zip https://ssd.mathworks.com/supportfiles/downloads/R2018a/deployment_files/R2018a/installers/glnxa64/MCR_R2018a_glnxa64_installer.zip
71+
unzip -q /tmp/mcr.zip -d /tmp/mcrtmp
72+
/tmp/mcrtmp/install -destinationFolder /opt/matlabmcr-2018a -mode silent -agreeToLicense yes
73+
rm -rf /tmp/*
74+
echo "Downloading standalone SPM ..."
75+
curl -fsSL --retry 5 -o /tmp/spm12.zip http://www.fil.ion.ucl.ac.uk/spm/download/restricted/utopia/dev/spm12_latest_Linux_R2018a.zip
76+
unzip -q /tmp/spm12.zip -d /tmp
77+
mkdir -p /opt/spm12-dev
78+
mv /tmp/spm12/* /opt/spm12-dev/
79+
chmod -R 777 /opt/spm12-dev
80+
rm -rf /tmp/*
81+
/opt/spm12-dev/run_spm12.sh /opt/matlabmcr-2018a/v94 quit
82+
sed -i '$iexport SPMMCRCMD=\"/opt/spm12-dev/run_spm12.sh /opt/matlabmcr-2018a/v94 script\"' $ND_ENTRYPOINT
83+
84+
useradd --no-user-group --create-home --shell /bin/bash neuro
85+
su - neuro
86+
87+
export PATH="/opt/miniconda-latest/bin:$PATH"
88+
echo "Downloading Miniconda installer ..."
89+
conda_installer="/tmp/miniconda.sh"
90+
curl -fsSL --retry 5 -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
91+
bash "$conda_installer" -b -p /opt/miniconda-latest
92+
rm -f "$conda_installer"
93+
conda update -yq -nbase conda
94+
conda config --system --prepend channels conda-forge
95+
conda config --system --set auto_update_conda false
96+
conda config --system --set show_channel_urls true
97+
sync && conda clean -tipsy && sync
98+
conda create -y -q --name neuro
99+
conda install -y -q --name neuro \
100+
python=3.6 \
101+
pytest \
102+
jupyter \
103+
jupyterlab \
104+
jupyter_contrib_nbextensions \
105+
traits \
106+
pandas \
107+
matplotlib \
108+
scikit-learn \
109+
scikit-image \
110+
seaborn \
111+
nbformat \
112+
nb_conda
113+
sync && conda clean -tipsy && sync
114+
bash -c "source activate neuro
115+
pip install --no-cache-dir \
116+
https://github.com/nipy/nipype/tarball/master \
117+
https://github.com/INCF/pybids/tarball/master \
118+
nilearn \
119+
datalad[full] \
120+
nipy \
121+
duecredit \
122+
nbval"
123+
rm -rf ~/.cache/pip/*
124+
sync
125+
sed -i '$isource activate neuro' $ND_ENTRYPOINT
126+
127+
128+
bash -c 'source activate neuro && jupyter nbextension enable exercise2/main && jupyter nbextension enable spellchecker/main'
129+
130+
su - root
131+
132+
mkdir /data && chmod 777 /data && chmod a+s /data
133+
134+
mkdir /output && chmod 777 /output && chmod a+s /output
135+
136+
su - neuro
137+
138+
printf "[user]\n\tname = miykael\n\temail = [email protected]\n" > ~/.gitconfig
139+
140+
bash -c 'source activate neuro && cd /data && datalad install -r ///workshops/nih-2017/ds000114 && cd ds000114 && datalad update -r && datalad get -r sub-01/ses-test/anat sub-01/ses-test/func/*fingerfootlips*'
141+
142+
curl -L https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/580705089ad5a101f17944a9 -o /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz && tar xf /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz -C /data/ds000114/derivatives/fmriprep/. && rm /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz && find /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c -type f -not -name ?mm_T1.nii.gz -not -name ?mm_brainmask.nii.gz -not -name ?mm_tpm*.nii.gz -delete
143+
144+
su - root
145+
146+
chown -R neuro /home/neuro/nipype_tutorial
147+
148+
rm -rf /opt/conda/pkgs/*
149+
150+
su - neuro
151+
152+
mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py
153+
154+
cd /home/neuro/nipype_tutorial
155+
156+
echo '{
157+
\n "pkg_manager": "apt",
158+
\n "instructions": [
159+
\n [
160+
\n "base",
161+
\n "neurodebian:stretch-non-free"
162+
\n ],
163+
\n [
164+
\n "_header",
165+
\n {
166+
\n "version": "generic",
167+
\n "method": "custom"
168+
\n }
169+
\n ],
170+
\n [
171+
\n "install",
172+
\n [
173+
\n "convert3d",
174+
\n "ants",
175+
\n "fsl",
176+
\n "gcc",
177+
\n "g++",
178+
\n "graphviz",
179+
\n "tree",
180+
\n "git-annex-standalone",
181+
\n "vim",
182+
\n "emacs-nox",
183+
\n "nano",
184+
\n "less",
185+
\n "ncdu",
186+
\n "tig",
187+
\n "git-annex-remote-rclone",
188+
\n "octave",
189+
\n "netbase"
190+
\n ]
191+
\n ],
192+
\n [
193+
\n "add_to_entrypoint",
194+
\n "source /etc/fsl/fsl.sh"
195+
\n ],
196+
\n [
197+
\n "spm12",
198+
\n {
199+
\n "version": "dev"
200+
\n }
201+
\n ],
202+
\n [
203+
\n "user",
204+
\n "neuro"
205+
\n ],
206+
\n [
207+
\n "miniconda",
208+
\n {
209+
\n "miniconda_version": "4.3.31",
210+
\n "conda_install": [
211+
\n "python=3.6",
212+
\n "pytest",
213+
\n "jupyter",
214+
\n "jupyterlab",
215+
\n "jupyter_contrib_nbextensions",
216+
\n "traits",
217+
\n "pandas",
218+
\n "matplotlib",
219+
\n "scikit-learn",
220+
\n "scikit-image",
221+
\n "seaborn",
222+
\n "nbformat",
223+
\n "nb_conda"
224+
\n ],
225+
\n "pip_install": [
226+
\n "https://github.com/nipy/nipype/tarball/master",
227+
\n "https://github.com/INCF/pybids/tarball/master",
228+
\n "nilearn",
229+
\n "datalad[full]",
230+
\n "nipy",
231+
\n "duecredit",
232+
\n "nbval"
233+
\n ],
234+
\n "create_env": "neuro",
235+
\n "activate": true
236+
\n }
237+
\n ],
238+
\n [
239+
\n "run_bash",
240+
\n "source activate neuro && jupyter nbextension enable exercise2/main && jupyter nbextension enable spellchecker/main"
241+
\n ],
242+
\n [
243+
\n "user",
244+
\n "root"
245+
\n ],
246+
\n [
247+
\n "run",
248+
\n "mkdir /data && chmod 777 /data && chmod a+s /data"
249+
\n ],
250+
\n [
251+
\n "run",
252+
\n "mkdir /output && chmod 777 /output && chmod a+s /output"
253+
\n ],
254+
\n [
255+
\n "user",
256+
\n "neuro"
257+
\n ],
258+
\n [
259+
\n "run",
260+
\n "printf \"[user]\\\n\\tname = miykael\\\n\\temail = [email protected]\\\n\" > ~/.gitconfig"
261+
\n ],
262+
\n [
263+
\n "run_bash",
264+
\n "source activate neuro && cd /data && datalad install -r ///workshops/nih-2017/ds000114 && cd ds000114 && datalad update -r && datalad get -r sub-01/ses-test/anat sub-01/ses-test/func/*fingerfootlips*"
265+
\n ],
266+
\n [
267+
\n "run",
268+
\n "curl -L https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/580705089ad5a101f17944a9 -o /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz && tar xf /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz -C /data/ds000114/derivatives/fmriprep/. && rm /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz && find /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c -type f -not -name ?mm_T1.nii.gz -not -name ?mm_brainmask.nii.gz -not -name ?mm_tpm*.nii.gz -delete"
269+
\n ],
270+
\n [
271+
\n "copy",
272+
\n [
273+
\n ".",
274+
\n "/home/neuro/nipype_tutorial"
275+
\n ]
276+
\n ],
277+
\n [
278+
\n "user",
279+
\n "root"
280+
\n ],
281+
\n [
282+
\n "run",
283+
\n "chown -R neuro /home/neuro/nipype_tutorial"
284+
\n ],
285+
\n [
286+
\n "run",
287+
\n "rm -rf /opt/conda/pkgs/*"
288+
\n ],
289+
\n [
290+
\n "user",
291+
\n "neuro"
292+
\n ],
293+
\n [
294+
\n "run",
295+
\n "mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \\\"0.0.0.0\\\" > ~/.jupyter/jupyter_notebook_config.py"
296+
\n ],
297+
\n [
298+
\n "workdir",
299+
\n "/home/neuro/nipype_tutorial"
300+
\n ]
301+
\n ]
302+
\n}' > /neurodocker/neurodocker_specs.json
303+
304+
%environment
305+
export LANG="en_US.UTF-8"
306+
export LC_ALL="en_US.UTF-8"
307+
export ND_ENTRYPOINT="/neurodocker/startup.sh"
308+
export FORCE_SPMMCR="1"
309+
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu:/opt/matlabmcr-2018a/v94/runtime/glnxa64:/opt/matlabmcr-2018a/v94/bin/glnxa64:/opt/matlabmcr-2018a/v94/sys/os/glnxa64:/opt/matlabmcr-2018a/v94/extern/bin/glnxa64"
310+
export MATLABCMD="/opt/matlabmcr-2018a/v94/toolbox/matlab"
311+
export CONDA_DIR="/opt/miniconda-latest"
312+
export PATH="/opt/miniconda-latest/bin:$PATH"
313+
314+
%files
315+
. /home/neuro/nipype_tutorial
316+
317+
%runscript
318+
/neurodocker/startup.sh "$@"

create_dockerfile.sh

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)