Skip to content

Commit e0d54f9

Browse files
authored
Merge pull request #1564 from oesteban/fix/DockerTags
[testing] Start using docker tags for circleCI
2 parents e319517 + 4489b76 commit e0d54f9

File tree

13 files changed

+338
-85
lines changed

13 files changed

+338
-85
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.git/
2+
*.pyc
3+
*.egg-info
4+
__pycache__
5+

CHANGES

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Upcoming release 0.13
22
=====================
33

4-
* ENH: Implement missing inputs/outputs in FSL AvScale
5-
(https://github.com/nipy/nipype/pull/1563)
4+
* TST: reduce the size of docker images & use tags for images (https://github.com/nipy/nipype/pull/1564)
5+
* ENH: Implement missing inputs/outputs in FSL AvScale (https://github.com/nipy/nipype/pull/1563)
66

77

88
Release 0.12.1 (August 3, 2016)

circle.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,41 @@ machine:
55
dependencies:
66
cache_directories:
77
- "~/docker"
8+
- "~/examples"
9+
- "~/.apt-cache"
810

911
pre:
1012
- mkdir -p "~/scratch/nose"
13+
- mkdir -p "~/examples"
14+
# Let CircleCI cache the apt archive
15+
- sudo rm -rf /var/cache/apt/archives && sudo ln -s ~/.apt-cache /var/cache/apt/archives && mkdir -p ~/.apt-cache/partial
16+
- sudo apt-get -y update && sudo apt-get install -y wget bzip2
1117

1218
override:
1319
- if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; fi
14-
- docker build -t nipype/testbench:latest . :
20+
- docker build -f docker/nipype_test_py27/Dockerfile -t nipype/nipype_test:py27 . :
1521
timeout: 1600
16-
- mkdir -p ~/docker; docker save nipype/testbench:latest > ~/docker/image.tar :
22+
- mkdir -p ~/docker; docker save nipype/nipype_test:py27 > ~/docker/image.tar :
1723
timeout: 1600
24+
- if [[ ! -d ~/examples/nipype-tutorial ]]; then wget -q -O nipype-tutorial.tar.bz2 https://dl.dropbox.com/s/jzgq2nupxyz36bp/nipype-tutorial.tar.bz2 && tar xjf nipype-tutorial.tar.bz2 -C ~/examples/; fi
25+
- if [[ ! -d ~/examples/feeds ]]; then wget -q -O fsl-feeds.tar.gz https://googledrive.com/host/0BxI12kyv2olZNXBONlJKV0Y1Tm8 && tar xzf fsl-feeds.tar.gz -C ~/examples/; fi
1826

1927
test:
2028
override:
21-
- docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /scratch --entrypoint="/usr/bin/run_builddocs.sh" nipype/testbench
22-
- docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /scratch nipype/testbench test_spm Linear /root/examples/ workflow3d :
29+
- docker run -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /root/src/nipype/doc nipype/nipype_test:py27 /usr/bin/run_builddocs.sh
30+
- docker run -v /etc/localtime:/etc/localtime:ro -v ~/examples:/root/examples:ro -v $(pwd)/scratch:/scratch -w /scratch nipype/nipype_test:py27 /usr/bin/run_examples.sh test_spm Linear /root/examples/ workflow3d :
2331
timeout: 1600
24-
- docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /scratch nipype/testbench test_spm Linear /root/examples/ workflow4d :
32+
- docker run -v /etc/localtime:/etc/localtime:ro -v ~/examples:/root/examples:ro -v $(pwd)/scratch:/scratch -w /scratch nipype/nipype_test:py27 /usr/bin/run_examples.sh test_spm Linear /root/examples/ workflow4d :
2533
timeout: 1600
26-
- docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /scratch nipype/testbench fmri_fsl_feeds Linear /root/examples/ l1pipeline
27-
- docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /scratch nipype/testbench fmri_spm_dartel Linear /root/examples/ level1 :
34+
- docker run -v /etc/localtime:/etc/localtime:ro -v ~/examples:/root/examples:ro -v $(pwd)/scratch:/scratch -w /scratch nipype/nipype_test:py27 /usr/bin/run_examples.sh fmri_fsl_feeds Linear /root/examples/ l1pipeline
35+
- docker run -v /etc/localtime:/etc/localtime:ro -v ~/examples:/root/examples:ro -v $(pwd)/scratch:/scratch -w /scratch nipype/nipype_test:py27 /usr/bin/run_examples.sh fmri_spm_dartel Linear /root/examples/ level1 :
2836
timeout: 1600
29-
- docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /scratch nipype/testbench fmri_spm_dartel Linear /root/examples/ l2pipeline :
37+
- docker run -v /etc/localtime:/etc/localtime:ro -v ~/examples:/root/examples:ro -v $(pwd)/scratch:/scratch -w /scratch nipype/nipype_test:py27 /usr/bin/run_examples.sh fmri_spm_dartel Linear /root/examples/ l2pipeline :
3038
timeout: 1600
31-
- docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /scratch nipype/testbench fmri_fsl_reuse Linear /root/examples/ level1_workflow
32-
- docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /scratch nipype/testbench fmri_spm_nested Linear /root/examples/ level1
33-
- docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /scratch nipype/testbench fmri_spm_nested Linear /root/examples/ l2pipeline
34-
- docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /scratch --entrypoint="/usr/bin/run_nosetests.sh" nipype/testbench :
39+
- docker run -v /etc/localtime:/etc/localtime:ro -v ~/examples:/root/examples:ro -v $(pwd)/scratch:/scratch -w /scratch nipype/nipype_test:py27 /usr/bin/run_examples.sh fmri_fsl_reuse Linear /root/examples/ level1_workflow
40+
- docker run -v /etc/localtime:/etc/localtime:ro -v ~/examples:/root/examples:ro -v $(pwd)/scratch:/scratch -w /scratch nipype/nipype_test:py27 /usr/bin/run_examples.sh fmri_spm_nested Linear /root/examples/ level1
41+
- docker run -v /etc/localtime:/etc/localtime:ro -v ~/examples:/root/examples:ro -v $(pwd)/scratch:/scratch -w /scratch nipype/nipype_test:py27 /usr/bin/run_examples.sh fmri_spm_nested Linear /root/examples/ l2pipeline
42+
- docker run -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /scratch nipype/nipype_test:py27 /usr/bin/run_nosetests.sh :
3543
timeout: 2600
3644
post:
3745
- bash docker/circleci/teardown.sh

doc/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ htmlonly:
3535

3636
api:
3737
rm -rf api/generated
38-
python ../tools/build_modref_templates.py
38+
python -u ../tools/build_modref_templates.py
3939
rm -rf interfaces/generated
40-
python ../tools/build_interface_docs.py
40+
python -u ../tools/build_interface_docs.py
4141
@echo "Build API docs finished."
4242

4343
html: clean examples2rst api htmlonly
@@ -76,7 +76,7 @@ doctest:
7676
"results in _build/doctest/output.txt."
7777

7878
gitwash-update:
79-
python ../tools/gitwash_dumper.py devel nipype \
79+
python -u ../tools/gitwash_dumper.py devel nipype \
8080
--repo-name=nipype \
8181
--github-user=nipy \
8282
--project-url=http://nipy.org/nipype \

docker/circleci/run_builddocs.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
#!/bin/bash
2-
for i in /etc/profile.d/*.sh; do
3-
source $i
4-
done
5-
source activate nipypetests-2.7
2+
set -e
3+
set -x
4+
set -u
65

76
mkdir -p /scratch/docs
8-
set -o pipefail && cd /root/src/nipype/doc && make html 2>&1 | tee /scratch/builddocs.log
7+
make html 2>&1 | tee /scratch/builddocs.log
98
cp -r /root/src/nipype/doc/_build/html/* /scratch/docs/
109
chmod 777 -R /scratch/docs
1110
chmod 777 /scratch/builddocs.log

docker/circleci/run_examples.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#!/bin/bash
2-
for i in /etc/profile.d/*.sh; do
3-
source $i
4-
done
2+
set -e
3+
set -x
4+
set -u
55

66
mkdir -p /root/.nipype
7+
mkdir -p /scratch/logs
78
echo '[logging]' > /root/.nipype/nipype.cfg
89
echo 'workflow_level = DEBUG' >> /root/.nipype/nipype.cfg
910
echo 'interface_level = DEBUG' >> /root/.nipype/nipype.cfg
1011
echo 'filemanip_level = DEBUG' >> /root/.nipype/nipype.cfg
12+
echo 'log_to_file = true' >> /root/.nipype/nipype.cfg
13+
echo 'log_directory = /scratch/logs/' >> /root/.nipype/nipype.cfg
1114

12-
source activate nipypetests-2.7
1315
python /root/src/nipype/tools/run_examples.py $@

docker/circleci/run_nosetests.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
2-
for i in /etc/profile.d/*.sh; do
3-
source $i
4-
done
5-
source activate nipypetests-2.7
2+
set -e
3+
set -x
4+
set -u
5+
66
cd /root/src/nipype
77
mkdir -p /scratch/nose
88
nosetests -c /root/src/nipype/.noserc --xunit-file="/scratch/nosetests.xml" --cover-xml-file="/scratch/coverage.xml"

docker/circleci/teardown.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ sudo mv ~/scratch/coverage.xml ~/coverage.xml
1313
mkdir -p ~/docs
1414
sudo mv ~/scratch/docs/* ~/docs/
1515
mkdir -p ~/logs
16-
sudo mv ~/scratch/logs/* ~/logs/
16+
sudo mv $(pwd)/scratch/logs/* ~/logs/

docker/nipype_test_base/Dockerfile

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Copyright (c) 2016, The developers of nipype
2+
# All rights reserved.
3+
#
4+
# Redistribution and use in source and binary forms, with or without
5+
# modification, are permitted provided that the following conditions are met:
6+
#
7+
# * Redistributions of source code must retain the above copyright notice, this
8+
# list of conditions and the following disclaimer.
9+
#
10+
# * Redistributions in binary form must reproduce the above copyright notice,
11+
# this list of conditions and the following disclaimer in the documentation
12+
# and/or other materials provided with the distribution.
13+
#
14+
# * Neither the name of crn_base nor the names of its
15+
# contributors may be used to endorse or promote products derived from
16+
# this software without specific prior written permission.
17+
#
18+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
29+
FROM neurodebian:latest
30+
MAINTAINER Nipype developers
31+
32+
# Preparations
33+
RUN ln -snf /bin/bash /bin/sh
34+
ARG DEBIAN_FRONTEND=noninteractive
35+
36+
RUN sed -i -e 's,main$,main contrib non-free,g' /etc/apt/sources.list.d/neurodebian.sources.list && \
37+
apt-get -y update && \
38+
apt-get install -y curl \
39+
git \
40+
xvfb \
41+
bzip2 \
42+
unzip \
43+
apt-utils \
44+
fusefat \
45+
graphviz \
46+
make \
47+
fsl-core && \
48+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
49+
echo ". /etc/fsl/fsl.sh" >> /etc/bash.bashrc
50+
51+
ENV FSLDIR=/usr/share/fsl/5.0
52+
ENV FSLOUTPUTTYPE=NIFTI_GZ
53+
ENV PATH=/usr/lib/fsl/5.0:$PATH
54+
ENV FSLMULTIFILEQUIT=TRUE
55+
ENV POSSUMDIR=/usr/share/fsl/5.0
56+
ENV LD_LIBRARY_PATH=/usr/lib/fsl/5.0:$LD_LIBRARY_PATH
57+
ENV FSLTCLSH=/usr/bin/tclsh
58+
ENV FSLWISH=/usr/bin/wish
59+
60+
# Install Matlab: from the good old install_spm_mcr.sh of @chrisfilo
61+
WORKDIR /opt
62+
63+
RUN echo "destinationFolder=/opt/mcr" > mcr_options.txt && \
64+
echo "agreeToLicense=yes" >> mcr_options.txt && \
65+
echo "outputFile=/tmp/matlabinstall_log" >> mcr_options.txt && \
66+
echo "mode=silent" >> mcr_options.txt && \
67+
mkdir -p matlab_installer && \
68+
curl -sSL http://www.mathworks.com/supportfiles/downloads/R2015a/deployment_files/R2015a/installers/glnxa64/MCR_R2015a_glnxa64_installer.zip \
69+
-o matlab_installer/installer.zip && \
70+
unzip matlab_installer/installer.zip -d matlab_installer/ && \
71+
matlab_installer/install -inputFile mcr_options.txt && \
72+
rm -rf matlab_installer mcr_options.txt
73+
74+
ENV SPMMCRCMD "/opt/spm12/run_spm12.sh /opt/mcr/v85/ script"
75+
ENV FORCE_SPMMCR 1
76+
77+
# Install SPM
78+
RUN curl -sSL http://www.fil.ion.ucl.ac.uk/spm/download/restricted/utopia/dev/spm12_r6472_Linux_R2015a.zip -o spm12.zip && \
79+
unzip spm12.zip && \
80+
rm -rf spm12.zip
81+
82+
CMD ["/bin/bash"]
83+

docker/nipype_test_py27/Dockerfile

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Copyright (c) 2016, The developers of nipype
2+
# All rights reserved.
3+
#
4+
# Redistribution and use in source and binary forms, with or without
5+
# modification, are permitted provided that the following conditions are met:
6+
#
7+
# * Redistributions of source code must retain the above copyright notice, this
8+
# list of conditions and the following disclaimer.
9+
#
10+
# * Redistributions in binary form must reproduce the above copyright notice,
11+
# this list of conditions and the following disclaimer in the documentation
12+
# and/or other materials provided with the distribution.
13+
#
14+
# * Neither the name of crn_base nor the names of its
15+
# contributors may be used to endorse or promote products derived from
16+
# this software without specific prior written permission.
17+
#
18+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
29+
FROM nipype/nipype_test:base
30+
MAINTAINER The nipype developers https://github.com/nipy/nipype
31+
# Preparations
32+
RUN ln -snf /bin/bash /bin/sh
33+
WORKDIR /root
34+
35+
# Install miniconda
36+
RUN curl -sSLO https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh && \
37+
/bin/bash Miniconda-latest-Linux-x86_64.sh -b -p /usr/local/miniconda && \
38+
rm Miniconda-latest-Linux-x86_64.sh
39+
40+
ENV PATH /usr/local/miniconda/bin:$PATH
41+
42+
# http://bugs.python.org/issue19846
43+
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
44+
ENV LANG C.UTF-8
45+
46+
# Add conda-forge channel in conda
47+
RUN conda config --add channels conda-forge && \
48+
conda install -y lockfile nipype matplotlib sphinx boto coverage
49+
50+
RUN mkdir -p /root/src/nipype
51+
COPY . /root/src/nipype
52+
53+
RUN cd /root/src/nipype && \
54+
pip install dipy && \
55+
pip install -r requirements.txt && \
56+
pip install -e .
57+
58+
59+
COPY docker/circleci/run_* /usr/bin/
60+
RUN chmod +x /usr/bin/run_*
61+
ENV SHELL /bin/bash
62+
63+
CMD ["/bin/bash"]

docker/nipype_test_py34/Dockerfile

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Copyright (c) 2016, The developers of nipype
2+
# All rights reserved.
3+
#
4+
# Redistribution and use in source and binary forms, with or without
5+
# modification, are permitted provided that the following conditions are met:
6+
#
7+
# * Redistributions of source code must retain the above copyright notice, this
8+
# list of conditions and the following disclaimer.
9+
#
10+
# * Redistributions in binary form must reproduce the above copyright notice,
11+
# this list of conditions and the following disclaimer in the documentation
12+
# and/or other materials provided with the distribution.
13+
#
14+
# * Neither the name of crn_base nor the names of its
15+
# contributors may be used to endorse or promote products derived from
16+
# this software without specific prior written permission.
17+
#
18+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
29+
FROM nipype/nipype_test:base
30+
MAINTAINER The nipype developers https://github.com/nipy/nipype
31+
# Preparations
32+
RUN ln -snf /bin/bash /bin/sh
33+
WORKDIR /root
34+
35+
# Install miniconda
36+
RUN curl -sSLO https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
37+
/bin/bash Miniconda3-latest-Linux-x86_64.sh -b -p /usr/local/miniconda && \
38+
rm Miniconda3-latest-Linux-x86_64.sh
39+
40+
ENV PATH /usr/local/miniconda/bin:$PATH
41+
42+
# http://bugs.python.org/issue19846
43+
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
44+
ENV LANG C.UTF-8
45+
46+
# Add conda-forge channel in conda
47+
RUN conda config --add channels conda-forge && \
48+
conda update -y conda && \
49+
conda update --all -y python=3.4 && \
50+
conda install -y lockfile nipype
51+
52+
RUN mkdir -p /root/src/nipype
53+
COPY . /root/src/nipype
54+
55+
RUN cd /root/src/nipype && \
56+
pip install -r requirements.txt && \
57+
pip install -e .
58+
59+
60+
COPY docker/circleci/run_* /usr/bin/
61+
RUN chmod +x /usr/bin/run_*
62+
ENV SHELL /bin/bash
63+
64+
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)