Repository navigation
Expand file tree
/
Copy pathSingularity_fs7
More file actions
345 lines (332 loc) · 12.4 KB
/
Copy pathSingularity_fs7
File metadata and controls
345 lines (332 loc) · 12.4 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
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
# Generated by Neurodocker and Reproenv.
Bootstrap: docker
From: ubuntu:jammy
%files
run.py /run.py
version /version
%environment
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export ND_ENTRYPOINT="/neurodocker/startup.sh"
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"
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 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 FS_VERSION="7.4.1"
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 FREESURFER="/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 FUNCTIONALS_DIR="/opt/freesurfer/sessions"
export PERL5LIB="/opt/freesurfer/mni/share/perl5"
export MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/"
export PATH="/opt/miniconda-latest/bin:/opt/freesurfer/python/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
export ND_ENTRYPOINT="/neurodocker/startup.sh"
apt-get update -qq
apt-get install -y -q --no-install-recommends \
apt-utils \
bzip2 \
ca-certificates \
curl \
locales \
unzip
rm -rf /var/lib/apt/lists/*
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
dpkg-reconfigure --frontend=noninteractive locales
update-locale LANG="en_US.UTF-8"
chmod 777 /opt && chmod a+s /opt
mkdir -p /neurodocker
if [ ! -f "$ND_ENTRYPOINT" ]; then
echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT"
echo 'set -e' >> "$ND_ENTRYPOINT"
echo 'export USER="${USER:=`whoami`}"' >> "$ND_ENTRYPOINT"
echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT";
fi
chmod -R 777 /neurodocker && chmod a+s /neurodocker
apt-get update -qq
apt-get install -y -q --no-install-recommends \
bc \
curl \
libglu1-mesa \
libgomp1 \
libsm-dev \
libx11-dev \
libxext-dev \
libxt-dev \
perl-modules \
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 https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer-linux-centos7_x86_64-7.4.1.tar.gz \
| tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --transform='s,freesurfer/,,' \
--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'
if [ ! -z `which node` ] ; then \
echo "node is installed, skipping its install." ; \
else \
apt-get update -qq
apt-get install -y -q --no-install-recommends \
apt-utils \
ca-certificates \
curl \
gnupg
rm -rf /var/lib/apt/lists/*
curl -SLO https://deb.nodesource.com/nsolid_setup_deb.sh
chmod 500 nsolid_setup_deb.sh
./nsolid_setup_deb.sh 20
apt-get update -qq
apt-get install -y -q --no-install-recommends \
nodejs
rm -rf /var/lib/apt/lists/* ; \
fi
node --version
npm --version
npm install -g bids-validator@1.12.0
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": "env", \
"kwds": { \
"LANG": "en_US.UTF-8", \
"LC_ALL": "en_US.UTF-8", \
"ND_ENTRYPOINT": "/neurodocker/startup.sh" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "export ND_ENTRYPOINT=\\"/neurodocker/startup.sh\\"\\napt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n apt-utils \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl \\\\\\n locales \\\\\\n unzip\\nrm -rf /var/lib/apt/lists/*\\nsed -i -e '"'"'s/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/'"'"' /etc/locale.gen\\ndpkg-reconfigure --frontend=noninteractive locales\\nupdate-locale LANG=\\"en_US.UTF-8\\"\\nchmod 777 /opt && chmod a+s /opt\\nmkdir -p /neurodocker\\nif [ ! -f \\"$ND_ENTRYPOINT\\" ]; then\\n echo '"'"'#!/usr/bin/env bash'"'"' >> \\"$ND_ENTRYPOINT\\"\\n echo '"'"'set -e'"'"' >> \\"$ND_ENTRYPOINT\\"\\n echo '"'"'export USER=\\"${USER:=`whoami`}\\"'"'"' >> \\"$ND_ENTRYPOINT\\"\\n echo '"'"'if [ -n \\"$1\\" ]; then \\"$@\\"; else /usr/bin/env bash; fi'"'"' >> \\"$ND_ENTRYPOINT\\";\\nfi\\nchmod -R 777 /neurodocker && chmod a+s /neurodocker" \
} \
}, \
{ \
"name": "install", \
"kwds": { \
"pkgs": [ \
"tcsh", \
"bc", \
"tar", \
"libgomp1", \
"wget", \
"curl", \
"perl-modules", \
"libsm-dev", \
"libx11-dev", \
"libxt-dev", \
"libxext-dev", \
"libglu1-mesa" \
], \
"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 libsm-dev \\\\\\n libx11-dev \\\\\\n libxext-dev \\\\\\n libxt-dev \\\\\\n perl-modules \\\\\\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", \
"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 https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer-linux-centos7_x86_64-7.4.1.tar.gz \\\\\\n| tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --transform='"'"'s,freesurfer/,,'"'"' \\\\\\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": "run", \
"kwds": { \
"command": "if [ ! -z `which node` ] ; then \\\\\\n echo \\"node is installed, skipping its install.\\" ; \\\\\\nelse \\\\\\n apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n apt-utils \\\\\\n ca-certificates \\\\\\n curl \\\\\\n gnupg\\nrm -rf /var/lib/apt/lists/*\\n curl -SLO https://deb.nodesource.com/nsolid_setup_deb.sh\\n chmod 500 nsolid_setup_deb.sh\\n ./nsolid_setup_deb.sh 20\\n apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n nodejs\\nrm -rf /var/lib/apt/lists/* ; \\\\\\n fi\\nnode --version\\nnpm --version\\nnpm install -g bids-validator@1.12.0" \
} \
}, \
{ \
"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": { \
"FS_VERSION": "7.4.1" \
} \
}, \
{ \
"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", \
"FREESURFER": "/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", \
"FUNCTIONALS_DIR": "/opt/freesurfer/sessions", \
"PERL5LIB": "/opt/freesurfer/mni/share/perl5", \
"MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/", \
"PATH": "/opt/miniconda-latest/bin:/opt/freesurfer/python/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": [ \
"python3", \
"/run.py" \
] \
} \
} \
] \
}' > /.reproenv.json
# End saving to specification to JSON.
%runscript
python3 /run.py