Skip to content

Commit 2328076

Browse files
committed
Merge branch 'maint/run-docker-as-user' into pin/niworkflows-0.8
2 parents 159d8fa + 14042ee commit 2328076

File tree

5 files changed

+35
-33
lines changed

5 files changed

+35
-33
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ jobs:
389389
sudo setfacl -d -m group:$(id -gn):rwx /tmp/ds005/work && \
390390
sudo setfacl -m group:$(id -gn):rwx /tmp/ds005/work
391391
fmriprep-docker -i poldracklab/fmriprep:latest \
392-
-e FMRIPREP_DEV 1 \
392+
-e FMRIPREP_DEV 1 -u $(id -u) \
393393
--config $PWD/nipype.cfg -w /tmp/ds005/work \
394394
/tmp/data/ds005 /tmp/ds005/derivatives participant \
395395
--sloppy --write-graph --mem_mb 4096 \
@@ -408,7 +408,7 @@ jobs:
408408
sudo setfacl -d -m group:$(id -gn):rwx /tmp/ds005/work && \
409409
sudo setfacl -m group:$(id -gn):rwx /tmp/ds005/work
410410
fmriprep-docker -i poldracklab/fmriprep:latest \
411-
-e FMRIPREP_DEV 1 \
411+
-e FMRIPREP_DEV 1 -u $(id -u) \
412412
--config $PWD/nipype.cfg -w /tmp/ds005/work \
413413
/tmp/data/ds005 /tmp/ds005/derivatives participant \
414414
--sloppy --write-graph --use-syn-sdc --mem_mb 4096 \
@@ -437,7 +437,7 @@ jobs:
437437
command: |
438438
rm /tmp/data/ds005/sub-01/func/*_run-01_*
439439
fmriprep-docker -i poldracklab/fmriprep:latest \
440-
-e FMRIPREP_DEV 1 \
440+
-e FMRIPREP_DEV 1 -u $(id -u) \
441441
--config $PWD/nipype.cfg -w /tmp/ds005/work_partial \
442442
/tmp/data/ds005 /tmp/ds005/derivatives_partial participant \
443443
--sloppy --write-graph --use-syn-sdc --mem_mb 4096 \

CHANGES.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
1.3.0.post2 (February 14, 2019)
2+
===============================
3+
4+
Hotfix release intended for Singularity users, amending the previous iteration
5+
that didn't fix the problem (#1510) @effigies.
6+
17
1.3.0.post1 (February 8, 2019)
28
==============================
39

Dockerfile

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
FROM ubuntu:xenial-20161213
33

44
# Pre-cache neurodebian key
5-
COPY docker/files/neurodebian.gpg /root/.neurodebian.gpg
5+
COPY docker/files/neurodebian.gpg /usr/local/etc/neurodebian.gpg
66

77
# Prepare environment
88
RUN apt-get update && \
@@ -67,7 +67,7 @@ ENV PERL5LIB="$MINC_LIB_DIR/perl5/5.8.5" \
6767

6868
# Installing Neurodebian packages (FSL, AFNI, git)
6969
RUN curl -sSL "http://neuro.debian.net/lists/$( lsb_release -c | cut -f2 ).us-ca.full" >> /etc/apt/sources.list.d/neurodebian.sources.list && \
70-
apt-key add /root/.neurodebian.gpg && \
70+
apt-key add /usr/local/etc/neurodebian.gpg && \
7171
(apt-key adv --refresh-keys --keyserver hkp://ha.pool.sks-keyservers.net 0xA5D32F012649A5A9 || true)
7272

7373
RUN apt-get update && \
@@ -98,6 +98,11 @@ RUN mkdir -p $ANTSPATH && \
9898
| tar -xzC $ANTSPATH --strip-components 1
9999
ENV PATH=$ANTSPATH:$PATH
100100

101+
# Create a shared $HOME directory
102+
RUN useradd -m -s /bin/bash -G users fmriprep
103+
WORKDIR /home/fmriprep
104+
ENV HOME="/home/fmriprep"
105+
101106
# Installing SVGO
102107
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
103108
RUN apt-get install -y nodejs
@@ -142,41 +147,30 @@ RUN conda install -y python=3.7.1 \
142147
zlib; sync && \
143148
chmod -R a+rX /usr/local/miniconda; sync && \
144149
chmod +x /usr/local/miniconda/bin/*; sync && \
145-
conda clean --all -y; sync && \
150+
conda build purge-all; sync && \
146151
conda clean -tipsy && sync
147152

148-
# Precaching fonts, set 'Agg' as default backend for matplotlib
149-
RUN python -c "from matplotlib import font_manager" && \
150-
sed -i 's/\(backend *: \).*$/\1Agg/g' $( python -c "import matplotlib; print(matplotlib.matplotlib_fname())" )
151-
RUN pip install "datalad==0.10.0" && \
152-
rm -rf ~/.cache/pip
153-
154153
# Unless otherwise specified each process should only use one thread - nipype
155154
# will handle parallelization
156155
ENV MKL_NUM_THREADS=1 \
157156
OMP_NUM_THREADS=1
158157

158+
# Precaching fonts, set 'Agg' as default backend for matplotlib
159+
RUN python -c "from matplotlib import font_manager" && \
160+
sed -i 's/\(backend *: \).*$/\1Agg/g' $( python -c "import matplotlib; print(matplotlib.matplotlib_fname())" )
161+
159162
# Precaching atlases
160-
RUN git config --global user.name "fMRIPrep User" && \
161-
git config --global user.email "[email protected]"
162-
ENV TEMPLATEFLOW_HOME="/opt/templateflow"
163-
WORKDIR /opt
164-
RUN datalad install -r https://github.com/templateflow/templateflow.git
165-
RUN datalad get $TEMPLATEFLOW_HOME/tpl-MNI152NLin2009cAsym/* \
166-
$TEMPLATEFLOW_HOME/tpl-MNI152Lin/* \
167-
$TEMPLATEFLOW_HOME/tpl-OASIS30ANTs/* \
168-
$TEMPLATEFLOW_HOME/tpl-NKI/*
169-
RUN git -C $TEMPLATEFLOW_HOME config annex.merge-annex-branches false && \
170-
git -C $TEMPLATEFLOW_HOME/tpl-MNI152NLin2009cAsym config annex.merge-annex-branches false && \
171-
git -C $TEMPLATEFLOW_HOME/tpl-MNI152Lin config annex.merge-annex-branches false && \
172-
git -C $TEMPLATEFLOW_HOME/tpl-OASIS30ANTs config annex.merge-annex-branches false && \
173-
git -C $TEMPLATEFLOW_HOME/tpl-NKI config annex.merge-annex-branches false
163+
RUN pip install --no-cache-dir "templateflow>=0.0.5.post1" && \
164+
python -c "from templateflow import api as tfapi; \
165+
tfapi.get('MNI152Lin'); \
166+
tfapi.get('MNI152NLin2009cAsym'); \
167+
tfapi.get('OASIS30ANTs'); \
168+
tfapi.get('NKI');"
174169

175170
# Installing dev requirements (packages that are not in pypi)
176171
WORKDIR /src/
177172
COPY requirements.txt requirements.txt
178-
RUN pip install -r requirements.txt && \
179-
rm -rf ~/.cache/pip
173+
RUN pip install --no-cache-dir -r requirements.txt
180174

181175
# Installing FMRIPREP
182176
COPY . /src/fmriprep
@@ -185,13 +179,15 @@ ARG VERSION
185179
RUN echo "${VERSION}" > /src/fmriprep/fmriprep/VERSION && \
186180
echo "include fmriprep/VERSION" >> /src/fmriprep/MANIFEST.in && \
187181
cd /src/fmriprep && \
188-
pip install .[all] && \
189-
rm -rf ~/.cache/pip
182+
pip install --no-cache-dir .[all]
190183

191184
RUN install -m 0755 \
192185
/src/fmriprep/scripts/generate_reference_mask.py \
193186
/usr/local/bin/generate_reference_mask
194187

188+
RUN find $HOME -type d -exec chmod go=u {} + && \
189+
find $HOME -type f -exec chmod go=u {} +
190+
195191
ENV IS_DOCKER_8395080871=1
196192

197193
RUN ldconfig

fmriprep/__about__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@
104104

105105

106106
LINKS_REQUIRES = [
107-
'git+https://github.com/oesteban/smriprep@'
108-
'1cfa100ab7fc92d07d988f0a99b720739d3812d3#smriprep-0.0.5',
107+
'git+https://github.com/poldracklab/smriprep@'
108+
'8d238200484ef4f4ea957a380758211612b8a265#smriprep-0.0.5',
109109
]
110110

111111
TESTS_REQUIRES = [

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
git+https://github.com/oesteban/smriprep@1cfa100ab7fc92d07d988f0a99b720739d3812d3#smriprep-0.0.5
1+
git+https://github.com/poldracklab/smriprep@8d238200484ef4f4ea957a380758211612b8a265#smriprep-0.0.5

0 commit comments

Comments
 (0)