-
Notifications
You must be signed in to change notification settings - Fork 35
/
Singularity_fs6
357 lines (342 loc) · 13 KB
/
Singularity_fs6
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
# Generated by Neurodocker and Reproenv.
Bootstrap: docker
From: ubuntu:jammy
%files
run.py /run.py
version /version
%environment
export OS="Linux"
export PATH="/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH"
export FREESURFER_HOME="/opt/freesurfer"
export FREESURFER="/opt/freesurfer"
export SUBJECTS_DIR="/opt/freesurfer/subjects"
export LOCAL_DIR="/opt/freesurfer/local"
export FSFAST_HOME="/opt/freesurfer/fsfast"
export FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast"
export FUNCTIONALS_DIR="/opt/freesurfer/sessions"
export FS_OVERRIDE="0"
export FIX_VERTEX_AREA=""
export FSF_OUTPUT_FORMAT="nii.gz# mni env requirements"
export MINC_BIN_DIR="/opt/freesurfer/mni/bin"
export MINC_LIB_DIR="/opt/freesurfer/mni/lib"
export MNI_DIR="/opt/freesurfer/mni"
export MNI_DATAPATH="/opt/freesurfer/mni/data"
export MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5"
export PERL5LIB="/opt/freesurfer/mni/share/perl5"
export CONDA_DIR="/opt/miniconda-latest"
export PATH="/opt/miniconda-latest/bin:$PATH"
export FSLDIR="/usr/share/fsl/5.0"
export FSLOUTPUTTYPE="NIFTI_GZ"
export FSLMULTIFILEQUIT="TRUE"
export POSSUMDIR="/usr/share/fsl/5.0"
export LD_LIBRARY_PATH="/usr/lib/fsl/5.0:"
export FSLTCLSH="/usr/bin/tclsh"
export FSLWISH="/usr/bin/wish"
export OS="Linux"
export FS_OVERRIDE="0"
export FIX_VERTEX_AREA=""
export SUBJECTS_DIR="/opt/freesurfer/subjects"
export FSF_OUTPUT_FORMAT="nii.gz"
export MNI_DIR="/opt/freesurfer/mni"
export LOCAL_DIR="/opt/freesurfer/local"
export FREESURFER_HOME="/opt/freesurfer"
export FSFAST_HOME="/opt/freesurfer/fsfast"
export MINC_BIN_DIR="/opt/freesurfer/mni/bin"
export MINC_LIB_DIR="/opt/freesurfer/mni/lib"
export MNI_DATAPATH="/opt/freesurfer/mni/data"
export FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast"
export PERL5LIB="/opt/freesurfer/mni/share/perl5"
export MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/"
export PATH="/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
export PYTHONPATH=""
%post
apt-get update -qq
apt-get install -y -q --no-install-recommends \
bc \
curl \
libglu1-mesa \
libgomp1 \
libpython2.7-stdlib \
libsm-dev \
libx11-dev \
libxext-dev \
libxt-dev \
perl-modules \
python2 \
tar \
tcsh \
wget
rm -rf /var/lib/apt/lists/*
apt-get update -qq
apt-get install -y -q --no-install-recommends \
bc \
ca-certificates \
curl \
libgomp1 \
libxmu6 \
libxt6 \
perl \
tcsh
rm -rf /var/lib/apt/lists/*
echo "Downloading FreeSurfer ..."
mkdir -p /opt/freesurfer
curl -fL ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz \
| tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --strip-components 1 \
--exclude='average/mult-comp-cor' \
--exclude='lib/cuda' \
--exclude='lib/qt' \
--exclude='subjects/V1_average' \
--exclude='subjects/bert' \
--exclude='subjects/cvs_avg35' \
--exclude='subjects/cvs_avg35_inMNI152' \
--exclude='subjects/fsaverage3' \
--exclude='subjects/fsaverage4' \
--exclude='subjects/fsaverage5' \
--exclude='subjects/fsaverage6' \
--exclude='subjects/fsaverage_sym' \
--exclude='trctrain'
apt-get update -qq
apt-get install -y -q --no-install-recommends \
bzip2 \
ca-certificates \
curl
rm -rf /var/lib/apt/lists/*
# Install dependencies.
export PATH="/opt/miniconda-latest/bin:$PATH"
echo "Downloading Miniconda installer ..."
conda_installer="/tmp/miniconda.sh"
curl -fsSL -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash "$conda_installer" -b -p /opt/miniconda-latest
rm -f "$conda_installer"
conda update -yq -nbase conda
conda install -yq -nbase conda-libmamba-solver
conda config --set solver libmamba
# Prefer packages in conda-forge
conda config --system --prepend channels conda-forge
# Packages in lower-priority channels not considered if a package with the same
# name exists in a higher priority channel. Can dramatically speed up installations.
# Conda recommends this as a default
# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html
conda config --set channel_priority strict
conda config --system --set auto_update_conda false
conda config --system --set show_channel_urls true
# Enable `conda activate`
conda init bash
conda install -y --name base \
"pandas=1.5.3"
bash -c "source activate base
python -m pip install --no-cache-dir \
"nibabel""
# Clean up
sync && conda clean --all --yes && sync
rm -rf ~/.cache/pip/*
bash -c 'curl -sL https://deb.nodesource.com/setup_18.x | bash -'
apt-get update -qq
apt-get install -y -q --no-install-recommends \
nodejs
rm -rf /var/lib/apt/lists/*
bash -c 'npm install -g [email protected]'
mkdir root/matlab && touch root/matlab/startup.m
mkdir /scratch
mkdir /local-scratch
chmod +x /run.py
# Save specification to JSON.
printf '{ \
"pkg_manager": "apt", \
"existing_users": [ \
"root" \
], \
"instructions": [ \
{ \
"name": "from_", \
"kwds": { \
"base_image": "ubuntu:jammy" \
} \
}, \
{ \
"name": "install", \
"kwds": { \
"pkgs": [ \
"tcsh", \
"bc", \
"tar", \
"libgomp1", \
"perl-modules", \
"wget", \
"curl", \
"libsm-dev", \
"libx11-dev", \
"libxt-dev", \
"libxext-dev", \
"libglu1-mesa", \
"libpython2.7-stdlib", \
"python2" \
], \
"opts": null \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n curl \\\\\\n libglu1-mesa \\\\\\n libgomp1 \\\\\\n libpython2.7-stdlib \\\\\\n libsm-dev \\\\\\n libx11-dev \\\\\\n libxext-dev \\\\\\n libxt-dev \\\\\\n perl-modules \\\\\\n python2 \\\\\\n tar \\\\\\n tcsh \\\\\\n wget\\nrm -rf /var/lib/apt/lists/*" \
} \
}, \
{ \
"name": "env", \
"kwds": { \
"OS": "Linux", \
"PATH": "/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH", \
"FREESURFER_HOME": "/opt/freesurfer", \
"FREESURFER": "/opt/freesurfer", \
"SUBJECTS_DIR": "/opt/freesurfer/subjects", \
"LOCAL_DIR": "/opt/freesurfer/local", \
"FSFAST_HOME": "/opt/freesurfer/fsfast", \
"FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \
"FUNCTIONALS_DIR": "/opt/freesurfer/sessions", \
"FS_OVERRIDE": "0", \
"FIX_VERTEX_AREA": "", \
"FSF_OUTPUT_FORMAT": "nii.gz# mni env requirements", \
"MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \
"MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \
"MNI_DIR": "/opt/freesurfer/mni", \
"MNI_DATAPATH": "/opt/freesurfer/mni/data", \
"MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5", \
"PERL5LIB": "/opt/freesurfer/mni/share/perl5" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n ca-certificates \\\\\\n curl \\\\\\n libgomp1 \\\\\\n libxmu6 \\\\\\n libxt6 \\\\\\n perl \\\\\\n tcsh\\nrm -rf /var/lib/apt/lists/*\\necho \\"Downloading FreeSurfer ...\\"\\nmkdir -p /opt/freesurfer\\ncurl -fL ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz \\\\\\n| tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --strip-components 1 \\\\\\n --exclude='"'"'average/mult-comp-cor'"'"' \\\\\\n --exclude='"'"'lib/cuda'"'"' \\\\\\n --exclude='"'"'lib/qt'"'"' \\\\\\n --exclude='"'"'subjects/V1_average'"'"' \\\\\\n --exclude='"'"'subjects/bert'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35_inMNI152'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage3'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage4'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage5'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage6'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage_sym'"'"' \\\\\\n --exclude='"'"'trctrain'"'"'" \
} \
}, \
{ \
"name": "env", \
"kwds": { \
"CONDA_DIR": "/opt/miniconda-latest", \
"PATH": "/opt/miniconda-latest/bin:$PATH" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\n# Install dependencies.\\nexport PATH=\\"/opt/miniconda-latest/bin:$PATH\\"\\necho \\"Downloading Miniconda installer ...\\"\\nconda_installer=\\"/tmp/miniconda.sh\\"\\ncurl -fsSL -o \\"$conda_installer\\" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh\\nbash \\"$conda_installer\\" -b -p /opt/miniconda-latest\\nrm -f \\"$conda_installer\\"\\nconda update -yq -nbase conda\\nconda install -yq -nbase conda-libmamba-solver\\nconda config --set solver libmamba\\n# Prefer packages in conda-forge\\nconda config --system --prepend channels conda-forge\\n# Packages in lower-priority channels not considered if a package with the same\\n# name exists in a higher priority channel. Can dramatically speed up installations.\\n# Conda recommends this as a default\\n# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html\\nconda config --set channel_priority strict\\nconda config --system --set auto_update_conda false\\nconda config --system --set show_channel_urls true\\n# Enable `conda activate`\\nconda init bash\\nconda install -y --name base \\\\\\n \\"pandas=1.5.3\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_18.x | bash -'"'"'" \
} \
}, \
{ \
"name": "install", \
"kwds": { \
"pkgs": [ \
"nodejs" \
], \
"opts": null \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n nodejs\\nrm -rf /var/lib/apt/lists/*" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "bash -c '"'"'npm install -g [email protected]'"'"'" \
} \
}, \
{ \
"name": "env", \
"kwds": { \
"FSLDIR": "/usr/share/fsl/5.0", \
"FSLOUTPUTTYPE": "NIFTI_GZ", \
"FSLMULTIFILEQUIT": "TRUE", \
"POSSUMDIR": "/usr/share/fsl/5.0", \
"LD_LIBRARY_PATH": "/usr/lib/fsl/5.0:", \
"FSLTCLSH": "/usr/bin/tclsh", \
"FSLWISH": "/usr/bin/wish" \
} \
}, \
{ \
"name": "env", \
"kwds": { \
"OS": "Linux", \
"FS_OVERRIDE": "0", \
"FIX_VERTEX_AREA": "", \
"SUBJECTS_DIR": "/opt/freesurfer/subjects", \
"FSF_OUTPUT_FORMAT": "nii.gz", \
"MNI_DIR": "/opt/freesurfer/mni", \
"LOCAL_DIR": "/opt/freesurfer/local", \
"FREESURFER_HOME": "/opt/freesurfer", \
"FSFAST_HOME": "/opt/freesurfer/fsfast", \
"MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \
"MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \
"MNI_DATAPATH": "/opt/freesurfer/mni/data", \
"FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \
"PERL5LIB": "/opt/freesurfer/mni/share/perl5", \
"MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/", \
"PATH": "/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", \
"PYTHONPATH": "" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "mkdir root/matlab && touch root/matlab/startup.m" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "mkdir /scratch" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "mkdir /local-scratch" \
} \
}, \
{ \
"name": "copy", \
"kwds": { \
"source": [ \
"run.py" \
], \
"destination": "/run.py" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "chmod +x /run.py" \
} \
}, \
{ \
"name": "copy", \
"kwds": { \
"source": [ \
"version" \
], \
"destination": "/version" \
} \
}, \
{ \
"name": "entrypoint", \
"kwds": { \
"args": [ \
"python", \
"/run.py" \
] \
} \
} \
] \
}' > /.reproenv.json
# End saving to specification to JSON.
%runscript
python /run.py