Skip to content

Commit 5df2295

Browse files
committed
Starting with #1537 and #1538
1 parent 57bf3cc commit 5df2295

File tree

5 files changed

+108
-78
lines changed

5 files changed

+108
-78
lines changed

Dockerfile

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Copyright (c) 2016, The developers of the Stanford CRN
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/testnipypedata
30+
MAINTAINER Stanford Center for Reproducible Neuroscience <[email protected]>
31+
32+
# Preparations
33+
RUN ln -snf /bin/bash /bin/sh
34+
WORKDIR /root
35+
RUN mkdir -p .nipype && \
36+
echo '[logging]' > .nipype/nipype.cfg && \
37+
echo 'workflow_level = DEBUG' >> .nipype/nipype.cfg && \
38+
echo 'interface_level = DEBUG' >> .nipype/nipype.cfg && \
39+
echo 'filemanip_level = DEBUG' >> .nipype/nipype.cfg
40+
41+
WORKDIR /root/src
42+
ADD . nipype/
43+
44+
# Install the checked out version of nipype, check that requirements are
45+
# installed and install it for each of the three environments.
46+
RUN cd nipype/ && \
47+
source activate nipypetests-2.7 && \
48+
pip install -r requirements.txt && \
49+
pip install -e .
50+
51+
RUN cd nipype/ && \
52+
source activate nipypetests-3.4 && \
53+
pip install -r requirements.txt && \
54+
pip install -e .
55+
56+
RUN cd nipype/ && \
57+
source activate nipypetests-3.5 && \
58+
pip install -r requirements.txt && \
59+
pip install -e .
60+
61+
WORKDIR /root/
62+
ADD docker/circleci/run_* /usr/bin/
63+
RUN chmod +x /usr/bin/run_*
64+
WORKDIR /scratch
65+
66+
# RUN echo 'source /etc/profile.d/nipype_tests.sh' >> /etc/bash.bashrc
67+
ENTRYPOINT ["/usr/bin/run_examples.sh"]
68+
CMD ["--help"]
69+

circle.yml

Lines changed: 13 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,23 @@
1+
machine:
2+
services:
3+
- docker
4+
15
dependencies:
26
cache_directories:
3-
- "~/.apt-cache"
4-
- "~/examples/data"
5-
- "~/examples/fsdata"
6-
- "~/mcr"
7-
- "~/spm12"
8-
- "~/examples/fsl_course_data"
7+
- "~/scratch"
8+
- "~/docker"
99
pre:
10-
# Let CircleCI cache the apt archive
11-
- sudo rm -rf /var/cache/apt/archives && sudo ln -s ~/.apt-cache /var/cache/apt/archives && mkdir -p ~/.apt-cache/partial
12-
- bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh)
10+
- pip install coverage
1311
override:
14-
# Install apt packages
15-
- sudo apt-get install -y fsl-core fsl-atlases fsl-mni152-templates fsl-feeds afni swig python-vtk xvfb fusefat
16-
- echo 'source /etc/fsl/fsl.sh' >> $HOME/.profile
17-
- echo 'source /etc/afni/afni.sh' >> $HOME/.profile
18-
- mkdir -p ~/examples/ && ln -sf /usr/share/fsl-feeds/ ~/examples/feeds
19-
# Enable system-wide vtk
20-
- ln -sf /usr/lib/pymodules/python2.7/vtk ~/virtualenvs/venv-system/lib/python2.7/site-packages/
21-
# Set up python environment
22-
- pip install --upgrade pip
23-
- pip install -e .
24-
- pip install matplotlib sphinx ipython boto coverage dipy
25-
# Add tvtk
26-
- pip install http://effbot.org/downloads/Imaging-1.1.7.tar.gz
27-
- pip install -e git+https://github.com/enthought/etsdevtools.git#egg=etsdevtools
28-
- pip install -e git+https://github.com/enthought/blockcanvas.git#egg=blockcanvas
29-
- pip install -e git+https://github.com/enthought/etsproxy.git#egg=etsproxy
30-
- pip install -e git+https://github.com/enthought/ets.git#egg=ets
31-
- pip install https://github.com/rtfd/readthedocs-sphinx-ext/archive/master.zip
32-
- gem install fakes3
33-
- if [[ ! -d ~/examples/data ]]; then wget "https://dl.dropbox.com/s/jzgq2nupxyz36bp/nipype-tutorial.tar.bz2" && tar jxvf nipype-tutorial.tar.bz2 && mv nipype-tutorial/* ~/examples/; fi
34-
- if [[ ! -d ~/examples/fsl_course_data ]]; then wget -c "http://fsl.fmrib.ox.ac.uk/fslcourse/fdt1.tar.gz" && wget -c "http://fsl.fmrib.ox.ac.uk/fslcourse/fdt2.tar.gz" && wget -c "http://fsl.fmrib.ox.ac.uk/fslcourse/tbss.tar.gz" && mkdir ~/examples/fsl_course_data && tar zxvf fdt1.tar.gz -C ~/examples/fsl_course_data && tar zxvf fdt2.tar.gz -C ~/examples/fsl_course_data && tar zxvf tbss.tar.gz -C ~/examples/fsl_course_data; fi
35-
- bash ~/nipype/tools/install_spm_mcr.sh
36-
- mkdir -p ~/.nipype && echo '[logging]' > ~/.nipype/nipype.cfg && echo 'workflow_level = DEBUG' >> ~/.nipype/nipype.cfg && echo 'interface_level = DEBUG' >> ~/.nipype/nipype.cfg && echo 'filemanip_level = DEBUG' >> ~/.nipype/nipype.cfg
37-
machine:
38-
environment:
39-
FSLOUTPUTTYPE: NIFTI_GZ
12+
- if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; fi
13+
- docker info
14+
- docker pull nipype/testnipypedata
15+
- mkdir -p ~/docker; docker save nipype/testnipypedata > ~/docker/image.tar
16+
- docker build -t nipype/testbench .
17+
4018
test:
4119
override:
4220
- mkdir -p ${CIRCLE_TEST_REPORTS}/nose
43-
- source $HOME/.profile; nosetests --with-doctest --xunit-file="${CIRCLE_TEST_REPORTS}/nose/${CIRCLE_PROJECT_REPONAME}.xml" -c ./.noserc --logging-level=DEBUG --verbosity=3:
44-
environment:
45-
SPMMCRCMD: "$HOME/spm12/run_spm12.sh $HOME/mcr/v85/ script"
46-
FORCE_SPMMCR: 1
47-
FSL_COURSE_DATA: "$HOME/examples/fsl_course_data"
48-
timeout: 2600
49-
- set -o pipefail && cd doc && make html 2>&1 | tee ~/log.txt
50-
- cat ~/log.txt && if grep -q "ERROR" ~/log.txt; then false; else true; fi
51-
- source $HOME/.profile; python ~/nipype/tools/run_examples.py test_spm Linear workflow3d workflow4d:
52-
pwd: ../examples
53-
environment:
54-
SPMMCRCMD: "$HOME/spm12/run_spm12.sh $HOME/mcr/v85/ script"
55-
FORCE_SPMMCR: 1
56-
timeout: 1600
57-
- source $HOME/.profile; python ~/nipype/tools/run_examples.py fmri_fsl_feeds Linear l1pipeline:
58-
pwd: ../examples
59-
- source $HOME/.profile; python ~/nipype/tools/run_examples.py fmri_spm_dartel Linear level1 l2pipeline:
60-
pwd: ../examples
61-
environment:
62-
SPMMCRCMD: "$HOME/spm12/run_spm12.sh $HOME/mcr/v85/ script"
63-
FORCE_SPMMCR: 1
64-
timeout: 1600
65-
- source $HOME/.profile; python ~/nipype/tools/run_examples.py fmri_fsl_reuse Linear level1_workflow:
66-
pwd: ../examples
67-
- source $HOME/.profile; python ~/nipype/tools/run_examples.py fmri_spm_nested Linear level1 l2pipeline:
68-
pwd: ../examples
69-
environment:
70-
SPMMCRCMD: "$HOME/spm12/run_spm12.sh $HOME/mcr/v85/ script"
71-
FORCE_SPMMCR: 1
7221

7322
general:
7423
artifacts:

docker/circleci/run_examples.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
for i in /etc/profile.d/*.sh; do
3+
source $i
4+
done
5+
source activate nipypetests-2.7
6+
cd /root/examples
7+
python /root/src/nipype/tools/run_examples.py $@

docker/test-image-base/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,10 @@ RUN echo "destinationFolder=/root/mcr" > mcr_options.txt && \
9696
unzip matlab_installer/installer.zip -d matlab_installer/ && \
9797
matlab_installer/install -inputFile mcr_options.txt && \
9898
rm -rf matlab_installer mcr_options.txt && \
99-
echo 'export LD_LIBRARY_PATH=/root/mcr/v85/runtime/glnxa64:/root/mcr/v85/bin/glnxa64:/root/mcr/v85/sys/os/glnxa64:$LD_LIBRARY_PATH' >> /etc/profile.d/nipype_deps.sh && \
99+
# echo 'export LD_LIBRARY_PATH=/root/mcr/v85/runtime/glnxa64:/root/mcr/v85/bin/glnxa64:/root/mcr/v85/sys/os/glnxa64:$LD_LIBRARY_PATH' >> /etc/profile.d/nipype_deps.sh && \
100100
echo 'export SPMMCRCMD="/root/spm12/run_spm12.sh /root/mcr/v85/ script"' >> /etc/profile.d/nipype_deps.sh && \
101101
echo 'export FORCE_SPMMCR=1' >> /etc/profile.d/nipype_deps.sh
102102

103-
ENV LD_LIBRARY_PATH "/root/mcr/v85/runtime/glnxa64:/root/mcr/v85/bin/glnxa64:/root/mcr/v85/sys/os/glnxa64:$LD_LIBRARY_PATH"
104103
ENV SPMMCRCMD "/root/spm12/run_spm12.sh /root/mcr/v85/ script"
105104
ENV FORCE_SPMMCR 1
106105

docker/test-image/Dockerfile renamed to docker/test-image-data/Dockerfile

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,24 @@ RUN ln -snf /bin/bash /bin/sh
3434
WORKDIR /root
3535

3636
RUN mkdir -p ~/examples/ && ln -sf /usr/share/fsl-feeds/ ~/examples/feeds
37-
RUN curl -sSL "https://dl.dropbox.com/s/jzgq2nupxyz36bp/nipype-tutorial.tar.bz2" && \
38-
tar jxvf nipype-tutorial.tar.bz2 && \
39-
mv nipype-tutorial/* ~/examples/ && \
40-
curl -sSL "http://fsl.fmrib.ox.ac.uk/fslcourse/fdt1.tar.gz" && \
41-
curl -sSL "http://fsl.fmrib.ox.ac.uk/fslcourse/fdt2.tar.gz" && \
42-
curl -sSL "http://fsl.fmrib.ox.ac.uk/fslcourse/tbss.tar.gz" && \
37+
RUN curl -sSL "https://dl.dropbox.com/s/jzgq2nupxyz36bp/nipype-tutorial.tar.bz2" -o nipype-tutorial.tar.bz2 && \
38+
tar jxf nipype-tutorial.tar.bz2 -C /root/examples && \
39+
curl -sSL "http://fsl.fmrib.ox.ac.uk/fslcourse/fdt1.tar.gz" -o fdt1.tar.gz && \
40+
curl -sSL "http://fsl.fmrib.ox.ac.uk/fslcourse/fdt2.tar.gz" -o fdt2.tar.gz && \
41+
curl -sSL "http://fsl.fmrib.ox.ac.uk/fslcourse/tbss.tar.gz" -o tbss.tar.gz && \
4342
mkdir ~/examples/fsl_course_data && \
44-
tar zxvf fdt1.tar.gz -C ~/examples/fsl_course_data && \
45-
tar zxvf fdt2.tar.gz -C ~/examples/fsl_course_data && \
46-
tar zxvf tbss.tar.gz -C ~/examples/fsl_course_data && \
47-
echo 'export FSL_COURSE_DATA=/root/examples/fsl_course_data' >> /etc/profile.d/crn_neuro.sh && \
48-
echo 'export FSL_COURSE_DATA=/root/examples/fsl_course_data' >> /etc/bash.bashrc
49-
ENV FSL_COURSE_DATA /root/examples/fsl_course_data
43+
echo 'Untarring fsl course data...' && \
44+
tar zxf fdt1.tar.gz -C ~/examples/fsl_course_data && \
45+
tar zxf fdt2.tar.gz -C ~/examples/fsl_course_data && \
46+
tar zxf tbss.tar.gz -C ~/examples/fsl_course_data && \
47+
echo 'export FSL_COURSE_DATA=/root/examples/fsl_course_data' >> /etc/profile.d/nipype_data.sh
48+
49+
ARG DEBIAN_FRONTEND=noninteractive
50+
RUN apt-get update && \
51+
apt-get install -y fsl-feeds && \
52+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
5053

54+
55+
ENV FSL_COURSE_DATA /root/examples/fsl_course_data
56+
RUN echo 'source /etc/profile.d/nipype_data.sh' >> /etc/bash.bashrc
5157
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)