Skip to content

Commit 7d96581

Browse files
authored
Merge pull request #1825 from oesteban/fix/DockerIssues
[FIX] Docker issues and documentation
2 parents 5bd56cb + 02fe28e commit 7d96581

File tree

4 files changed

+41
-20
lines changed

4 files changed

+41
-20
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Upcoming release 0.13
22
=====================
33

4+
* FIX: Issues in Docker image permissions, and docker documentation (https://github.com/nipy/nipype/pull/1825)
45
* ENH: Revised all Dockerfiles and automated deployment to Docker Hub
56
from CircleCI (https://github.com/nipy/nipype/pull/1815)
67
* FIX: Semaphore capture using MultiProc plugin (https://github.com/nipy/nipype/pull/1689)

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ RUN conda config --add channels conda-forge --add channels intel && \
182182
libxslt=1.1.29 \
183183
traits=4.6.0 \
184184
psutil=5.0.1 \
185-
icu=58.1
185+
icu=58.1 && \
186+
find /usr/local/miniconda/ -exec chmod 775 {} +
186187

187188
# matplotlib cleanups: set default backend, precaching fonts
188189
RUN sed -i 's/\(backend *: \).*$/\1Agg/g' /usr/local/miniconda/lib/python3.5/site-packages/matplotlib/mpl-data/matplotlibrc && \

circle.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,17 @@ dependencies:
2828
- if [[ ! -d ~/examples/nipype-tutorial ]]; then wget --retry-connrefused --waitretry=5 --read-timeout=20 --timeout=15 -t 0 -q -O nipype-tutorial.tar.bz2 "${DATA_NIPYPE_TUTORIAL_URL}" && tar xjf nipype-tutorial.tar.bz2 -C ~/examples/; fi
2929
- if [[ ! -d ~/examples/nipype-fsl_course_data ]]; then wget --retry-connrefused --waitretry=5 --read-timeout=20 --timeout=15 -t 0 -q -O nipype-fsl_course_data.tar.gz "${DATA_NIPYPE_FSL_COURSE}" && tar xzf nipype-fsl_course_data.tar.gz -C ~/examples/; fi
3030
- if [[ ! -d ~/examples/feeds ]]; then wget --retry-connrefused --waitretry=5 --read-timeout=20 --timeout=15 -t 0 -q -O fsl-5.0.9-feeds.tar.gz "${DATA_NIPYPE_FSL_FEEDS}" && tar xzf fsl-5.0.9-feeds.tar.gz -C ~/examples/; fi
31-
- if [[ -e $HOME/docker/image.tar ]]; then docker load -i $HOME/docker/image.tar; fi
32-
- if [[ -e $HOME/docker/image27.tar ]]; then docker load -i $HOME/docker/image27.tar; fi
33-
- if [[ -e $HOME/docker/image35.tar ]]; then docker load -i $HOME/docker/image35.tar; fi
31+
- if [[ -e $HOME/docker/image.tar ]]; then docker load --input $HOME/docker/image.tar; else echo 'No docker image found in cache'; fi
32+
- docker images
3433
- sed -i -E "s/(__version__ = )'[A-Za-z0-9.-]+'/\1'$CIRCLE_TAG'/" nipype/info.py
3534
- e=1 && for i in {1..5}; do docker build -t nipype/nipype:latest --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` --build-arg VCS_REF=`git rev-parse --short HEAD` --build-arg VERSION=$CIRCLE_TAG . && e=0 && break || sleep 15; done && [ "$e" -eq "0" ] :
3635
timeout: 21600
37-
- docker build -f docker/Dockerfile_py27 -t nipype/nipype_test:py27 . :
36+
- e=1 && for i in {1..5}; do docker build -f docker/Dockerfile_py27 -t nipype/nipype_test:py27 . && e=0 && break || sleep 15; done && [ "$e" -eq "0" ] :
3837
timeout: 1600
39-
- docker build -f docker/Dockerfile_py35 -t nipype/nipype_test:py35 . :
38+
- e=1 && for i in {1..5}; do docker build -f docker/Dockerfile_py35 -t nipype/nipype_test:py35 . && e=0 && break || sleep 15; done && [ "$e" -eq "0" ] :
39+
timeout: 1600
40+
- docker save -o $HOME/docker/image.tar nipype/nipype:latest nipype/nipype_test:py27 nipype/nipype_test:py35 :
4041
timeout: 1600
41-
- docker save nipype/nipype:latest > $HOME/docker/image.tar
42-
- docker save nipype/nipype_test:py27 > $HOME/docker/image27.tar
43-
- docker save nipype/nipype_test:py35 > $HOME/docker/image35.tar
4442

4543
test:
4644
override:

doc/devel/testing_nipype.rst

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,26 +107,47 @@ This will skip any tests that require matlab.
107107
Testing Nipype using Docker
108108
---------------------------
109109

110-
As of :code:`nipype-0.13`, Nipype is tested inside Docker containers. Once the developer
111-
`has installed the Docker Engine <https://docs.docker.com/engine/installation/>`_, testing
112-
Nipype is as easy as follows::
110+
As of :code:`nipype-0.13`, Nipype is tested inside Docker containers. First, install the
111+
`Docker Engine <https://docs.docker.com/engine/installation/>`_.
112+
Nipype has one base docker image called nipype/nipype, and several additional test images
113+
for various Python versions.
114+
115+
The base nipype/nipype image is built as follows::
113116

114117
cd path/to/nipype/
115-
docker build -f docker/nipype_test/Dockerfile_py27 -t nipype/nipype_test:py27
116-
docker run -it --rm -v /etc/localtime:/etc/localtime:ro \
117-
-e FSL_COURSE_DATA="/root/examples/nipype-fsl_course_data" \
118+
docker build -t nipype/nipype .
119+
120+
This base image contains several useful tools (FreeSurfer, AFNI, FSL, ANTs, etc.) and
121+
a nipype installation, all in Python 3.5.
122+
It is possible to fetch a built image from the latest master branch of nipype
123+
using::
124+
125+
docker run -it --rm nipype/nipype:master
126+
127+
128+
The docker run command will then open the container and offer a bash shell for the
129+
developer.
130+
131+
The additional test images have several test scripts installed. For instance,
132+
to build and run all tests on Python 2.7::
133+
134+
cd path/to/nipype/
135+
docker build -f docker/Dockerfile_py27 -t nipype/nipype_test:py27 .
136+
docker run -it --rm -e FSL_COURSE_DATA="/root/examples/nipype-fsl_course_data" \
118137
-v ~/examples:/root/examples:ro \
119138
-v ~/scratch:/scratch \
120139
-w /root/src/nipype \
121-
nipype/nipype_test:py27 /usr/bin/run_pytest.sh
140+
nipype/nipype_test:py27 /usr/bin/run_pytests.sh
122141

123142
For running nipype in Python 3.5::
124143

125144
cd path/to/nipype/
126-
docker build -f docker/nipype_test/Dockerfile_py35 -t nipype/nipype_test:py35
127-
docker run -it --rm -v /etc/localtime:/etc/localtime:ro \
128-
-e FSL_COURSE_DATA="/root/examples/nipype-fsl_course_data" \
145+
docker build -f docker/Dockerfile_py35 -t nipype/nipype_test:py35 .
146+
docker run -it --rm -e FSL_COURSE_DATA="/root/examples/nipype-fsl_course_data" \
129147
-v ~/examples:/root/examples:ro \
130148
-v ~/scratch:/scratch \
131149
-w /root/src/nipype \
132-
nipype/nipype_test:py35 /usr/bin/run_pytest.sh
150+
nipype/nipype_test:py35 /usr/bin/run_pytests.sh
151+
152+
The last two examples assume that the example data is downladed into ~/examples and
153+
the ~/scratch folder will be created if it does not exist previously.

0 commit comments

Comments
 (0)