Skip to content

Commit 2ef535b

Browse files
committed
Merge branch 'master' of github.com:nipy/nipype into fix/mnibias
2 parents 8d935fb + 038b143 commit 2ef535b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+636
-552
lines changed

.dockerignore

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,37 @@
1-
.git/
2-
*.pyc
3-
*.egg-info
1+
# python cache
2+
__pycache__/**/*
43
__pycache__
5-
docker/nipype_*
6-
docker/test-*
7-
.coverage
4+
*.pyc
5+
6+
# python distribution
7+
build/**/*
8+
build
9+
dist/**/*
10+
dist
11+
nipype.egg-info/**/*
12+
nipype.egg-info
13+
.eggs/**/*
14+
.eggs
15+
src/**/*
16+
src/
17+
18+
# releasing
19+
Makefile
20+
21+
# git
22+
.gitignore
23+
.git/**/*
24+
.git
25+
26+
# other
27+
docs/**/*
28+
docs/
29+
.coverage
30+
.coveragerc
31+
codecov.yml
32+
rtd_requirements.txt
33+
circle.yml
34+
Vagrantfile
35+
.travis.yml
36+
.noserc
37+

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
### How to replicate the behavior
88

99
### Platform details:
10-
please paste the output of: `python -c "import nipype; print(nipype.get_info())"`
10+
please paste the output of: `python -c "import nipype; print(nipype.get_info()); print(nipype.__version__)"`

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
.project
1414
.settings
1515
.pydevproject
16+
.eggs
1617
.idea/
1718
/documentation.zip
1819
.DS_Store
@@ -24,4 +25,4 @@ htmlcov/
2425
__pycache__/
2526
*~
2627
.ipynb_checkpoints/
27-
.ruby-version
28+
.ruby-version

.travis.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
cache:
2-
- apt
2+
apt: true
3+
34
language: python
45
python:
56
- 2.7
@@ -10,11 +11,7 @@ env:
1011
- INSTALL_DEB_DEPENDECIES=false NIPYPE_EXTRAS="doc,tests,fmri,profiler"
1112
- INSTALL_DEB_DEPENDECIES=true NIPYPE_EXTRAS="doc,tests,fmri,profiler,duecredit"
1213
before_install:
13-
- function bef_inst {
14-
wget http://repo.continuum.io/miniconda/Miniconda${TRAVIS_PYTHON_VERSION:0:1}-latest-Linux-x86_64.sh
15-
-O /home/travis/.cache/miniconda.sh &&
16-
bash /home/travis/.cache/miniconda.sh -b -p /home/travis/miniconda &&
17-
export PATH=/home/travis/miniconda/bin:$PATH &&
14+
- function apt_inst {
1815
if $INSTALL_DEB_DEPENDECIES; then sudo rm -rf /dev/shm; fi &&
1916
if $INSTALL_DEB_DEPENDECIES; then sudo ln -s /run/shm /dev/shm; fi &&
2017
bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh) &&
@@ -26,18 +23,24 @@ before_install:
2623
source /etc/fsl/fsl.sh;
2724
source /etc/afni/afni.sh;
2825
export FSLOUTPUTTYPE=NIFTI_GZ; fi }
29-
- travis_retry bef_inst
30-
install:
31-
# Add install of vtk and mayavi to test mesh (disabled): conda install -y vtk mayavi &&
32-
- function inst {
26+
- function conda_inst {
27+
export CONDA_HOME=$HOME/conda &&
28+
wget https://repo.continuum.io/miniconda/Miniconda${TRAVIS_PYTHON_VERSION:0:1}-latest-Linux-x86_64.sh
29+
-O /home/travis/.cache/conda.sh &&
30+
bash /home/travis/.cache/conda.sh -b -p ${CONDA_HOME} &&
31+
export PATH=${CONDA_HOME}/bin:$PATH &&
32+
hash -r &&
33+
conda config --set always_yes yes --set changeps1 no &&
34+
conda update -q conda &&
35+
conda install python=${TRAVIS_PYTHON_VERSION} &&
3336
conda config --add channels conda-forge &&
34-
conda update --yes conda &&
35-
conda update --all -y python=$TRAVIS_PYTHON_VERSION &&
3637
conda install -y nipype icu &&
37-
rm -r /home/travis/miniconda/lib/python${TRAVIS_PYTHON_VERSION}/site-packages/nipype* &&
38-
pip install -r requirements.txt &&
39-
pip install -e .[$NIPYPE_EXTRAS]; }
40-
- travis_retry inst
38+
rm -r ${CONDA_HOME}/lib/python${TRAVIS_PYTHON_VERSION}/site-packages/nipype*; }
39+
# Add install of vtk and mayavi to test mesh (disabled): conda install -y vtk mayavi
40+
- travis_retry apt_inst
41+
- travis_retry conda_inst
42+
install:
43+
- travis_retry pip install -e .[$NIPYPE_EXTRAS]
4144
script:
4245
- py.test --doctest-modules nipype
4346
deploy:

CHANGES

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

4+
* ENH: Revised all Dockerfiles and automated deployment to Docker Hub
5+
from CircleCI (https://github.com/nipy/nipype/pull/1815)
46
* FIX: Semaphore capture using MultiProc plugin (https://github.com/nipy/nipype/pull/1689)
57
* REF: Refactor AFNI interfaces (https://github.com/nipy/nipype/pull/1678, https://github.com/nipy/nipype/pull/1680)
68
* ENH: Move nipype commands to group command using click (https://github.com/nipy/nipype/pull/1608)

Dockerfile

Lines changed: 181 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -26,49 +26,195 @@
2626
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828

29-
FROM nipype/testnipypedata:latest
30-
MAINTAINER Stanford Center for Reproducible Neuroscience <crn.poldracklab@gmail.com>
3129

32-
# Preparations
33-
RUN ln -snf /bin/bash /bin/sh
30+
#
31+
# Based on https://github.com/poldracklab/fmriprep/blob/9c92a3de9112f8ef1655b876de060a2ad336ffb0/Dockerfile
32+
#
33+
FROM ubuntu:xenial-20161213
34+
35+
# Prepare environment
36+
RUN apt-get update && \
37+
apt-get install -y --no-install-recommends curl bzip2 ca-certificates xvfb && \
38+
curl -sSL http://neuro.debian.net/lists/xenial.us-ca.full >> /etc/apt/sources.list.d/neurodebian.sources.list && \
39+
apt-key adv --recv-keys --keyserver hkp://pgp.mit.edu:80 0xA5D32F012649A5A9 && \
40+
apt-get update
41+
42+
# Installing freesurfer
43+
RUN curl -sSL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.0/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0.tar.gz | tar zxv -C /opt \
44+
--exclude='freesurfer/trctrain' \
45+
--exclude='freesurfer/subjects/fsaverage_sym' \
46+
--exclude='freesurfer/subjects/fsaverage3' \
47+
--exclude='freesurfer/subjects/fsaverage4' \
48+
--exclude='freesurfer/subjects/fsaverage5' \
49+
--exclude='freesurfer/subjects/fsaverage6' \
50+
--exclude='freesurfer/subjects/cvs_avg35' \
51+
--exclude='freesurfer/subjects/cvs_avg35_inMNI152' \
52+
--exclude='freesurfer/subjects/bert' \
53+
--exclude='freesurfer/subjects/V1_average' \
54+
--exclude='freesurfer/average/mult-comp-cor' \
55+
--exclude='freesurfer/lib/cuda' \
56+
--exclude='freesurfer/lib/qt'
57+
58+
ENV FSL_DIR=/usr/share/fsl/5.0 \
59+
OS=Linux \
60+
FS_OVERRIDE=0 \
61+
FIX_VERTEX_AREA= \
62+
FSF_OUTPUT_FORMAT=nii.gz \
63+
FREESURFER_HOME=/opt/freesurfer
64+
ENV SUBJECTS_DIR=$FREESURFER_HOME/subjects \
65+
FUNCTIONALS_DIR=$FREESURFER_HOME/sessions \
66+
MNI_DIR=$FREESURFER_HOME/mni \
67+
LOCAL_DIR=$FREESURFER_HOME/local \
68+
FSFAST_HOME=$FREESURFER_HOME/fsfast \
69+
MINC_BIN_DIR=$FREESURFER_HOME/mni/bin \
70+
MINC_LIB_DIR=$FREESURFER_HOME/mni/lib \
71+
MNI_DATAPATH=$FREESURFER_HOME/mni/data \
72+
FMRI_ANALYSIS_DIR=$FREESURFER_HOME/fsfast
73+
ENV PERL5LIB=$MINC_LIB_DIR/perl5/5.8.5 \
74+
MNI_PERL5LIB=$MINC_LIB_DIR/perl5/5.8.5 \
75+
PATH=$FREESURFER_HOME/bin:$FSFAST_HOME/bin:$FREESURFER_HOME/tktools:$MINC_BIN_DIR:$PATH
76+
RUN echo "cHJpbnRmICJrcnp5c3p0b2YuZ29yZ29sZXdza2lAZ21haWwuY29tXG41MTcyXG4gKkN2dW12RVYzelRmZ1xuRlM1Si8yYzFhZ2c0RVxuIiA+IC9vcHQvZnJlZXN1cmZlci9saWNlbnNlLnR4dAo=" | base64 -d | sh
77+
78+
# Installing Neurodebian packages (FSL, AFNI, git)
79+
RUN apt-get install -y --no-install-recommends \
80+
fsl-core=5.0.9-1~nd+1+nd16.04+1 \
81+
afni=16.2.07~dfsg.1-2~nd16.04+1
82+
83+
ENV FSLDIR=/usr/share/fsl/5.0 \
84+
FSLOUTPUTTYPE=NIFTI_GZ \
85+
FSLMULTIFILEQUIT=TRUE \
86+
POSSUMDIR=/usr/share/fsl/5.0 \
87+
LD_LIBRARY_PATH=/usr/lib/fsl/5.0:$LD_LIBRARY_PATH \
88+
FSLTCLSH=/usr/bin/tclsh \
89+
FSLWISH=/usr/bin/wish \
90+
AFNI_MODELPATH=/usr/lib/afni/models \
91+
AFNI_IMSAVE_WARNINGS=NO \
92+
AFNI_TTATLAS_DATASET=/usr/share/afni/atlases \
93+
AFNI_PLUGINPATH=/usr/lib/afni/plugins \
94+
PATH=/usr/lib/fsl/5.0:/usr/lib/afni/bin:$PATH
95+
96+
# Installing and setting up ANTs
97+
RUN mkdir -p /opt/ants && \
98+
curl -sSL "https://github.com/stnava/ANTs/releases/download/v2.1.0/Linux_Ubuntu14.04.tar.bz2" \
99+
| tar -xjC /opt/ants --strip-components 1
100+
101+
ENV ANTSPATH=/opt/ants \
102+
PATH=$ANTSPATH:$PATH
103+
104+
# Installing and setting up c3d
105+
RUN mkdir -p /opt/c3d && \
106+
curl -sSL "http://downloads.sourceforge.net/project/c3d/c3d/1.0.0/c3d-1.0.0-Linux-x86_64.tar.gz" \
107+
| tar -xzC /opt/c3d --strip-components 1
108+
109+
ENV C3DPATH=/opt/c3d/ \
110+
PATH=$C3DPATH/bin:$PATH
111+
112+
# Install some other required tools
113+
RUN apt-get install -y --no-install-recommends \
114+
git=1:2.7.4-0ubuntu1 \
115+
graphviz=2.38.0-12ubuntu2 \
116+
unzip \
117+
apt-utils \
118+
fusefat \
119+
make \
120+
ruby=1:2.3.0+1 && \
121+
apt-get clean && \
122+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
123+
124+
# Install fake-S3
125+
ENV GEM_HOME /usr/lib/ruby/gems/2.3
126+
ENV BUNDLE_PATH="$GEM_HOME" \
127+
BUNDLE_BIN="$GEM_HOME/bin" \
128+
BUNDLE_SILENCE_ROOT_WARNING=1 \
129+
BUNDLE_APP_CONFIG="$GEM_HOME"
130+
ENV PATH $BUNDLE_BIN:$PATH
131+
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" && \
132+
chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
133+
134+
RUN gem install fakes3
135+
136+
# Install Matlab MCR: from the good old install_spm_mcr.sh of @chrisfilo
137+
WORKDIR /opt
138+
RUN echo "destinationFolder=/opt/mcr" > mcr_options.txt && \
139+
echo "agreeToLicense=yes" >> mcr_options.txt && \
140+
echo "outputFile=/tmp/matlabinstall_log" >> mcr_options.txt && \
141+
echo "mode=silent" >> mcr_options.txt && \
142+
mkdir -p matlab_installer && \
143+
curl -sSL http://www.mathworks.com/supportfiles/downloads/R2015a/deployment_files/R2015a/installers/glnxa64/MCR_R2015a_glnxa64_installer.zip \
144+
-o matlab_installer/installer.zip && \
145+
unzip matlab_installer/installer.zip -d matlab_installer/ && \
146+
matlab_installer/install -inputFile mcr_options.txt && \
147+
rm -rf matlab_installer mcr_options.txt
148+
149+
# Install SPM
150+
RUN curl -sSL http://www.fil.ion.ucl.ac.uk/spm/download/restricted/utopia/dev/spm12_r6472_Linux_R2015a.zip -o spm12.zip && \
151+
unzip spm12.zip && \
152+
rm -rf spm12.zip
153+
154+
ENV MATLABCMD="/opt/mcr/v85/toolbox/matlab" \
155+
SPMMCRCMD="/opt/spm12/run_spm12.sh /opt/mcr/v85/ script" \
156+
FORCE_SPMMCR=1
34157

35-
# Install this branch's code
36-
WORKDIR /root/src
37158

38-
# Install matplotlib, sphinx and coverage to build documentation
39-
# and run tests with coverage
40-
RUN source activate nipypetests-2.7 && \
41-
pip install matplotlib sphinx coverage && \
42-
source activate nipypetests-3.4 && \
43-
pip install matplotlib sphinx coverage && \
44-
source activate nipypetests-3.5 && \
45-
pip install matplotlib sphinx coverage
159+
# Installing and setting up miniconda
160+
RUN curl -sSLO https://repo.continuum.io/miniconda/Miniconda3-4.2.12-Linux-x86_64.sh && \
161+
bash Miniconda3-4.2.12-Linux-x86_64.sh -b -p /usr/local/miniconda && \
162+
rm Miniconda3-4.2.12-Linux-x86_64.sh
46163

47-
ADD . nipype/
164+
ENV PATH=/usr/local/miniconda/bin:$PATH \
165+
LANG=C.UTF-8 \
166+
LC_ALL=C.UTF-8 \
167+
ACCEPT_INTEL_PYTHON_EULA=yes
48168

49-
# Install the checked out version of nipype, check that requirements are
50-
# installed and install it for each of the three environments.
51-
RUN cd nipype/ && \
52-
source activate nipypetests-2.7 && \
53-
pip install -r requirements.txt && \
54-
pip install -e .
169+
# Installing precomputed python packages
170+
RUN conda config --add channels conda-forge --add channels intel && \
171+
chmod +x /usr/local/miniconda/bin/* && \
172+
conda config --set always_yes yes --set changeps1 no && \
173+
conda update -q conda && \
174+
chmod +x /usr/local/miniconda/bin/* && \
175+
conda install -y mkl=2017.0.1 \
176+
numpy=1.11.2 \
177+
scipy=0.18.1 \
178+
scikit-learn=0.17.1 \
179+
matplotlib=1.5.3 \
180+
pandas=0.19.0 \
181+
libxml2=2.9.4 \
182+
libxslt=1.1.29 \
183+
traits=4.6.0 \
184+
psutil=5.0.1 \
185+
icu=58.1
55186

56-
RUN cd nipype/ && \
57-
source activate nipypetests-3.4 && \
58-
pip install -r requirements.txt && \
59-
pip install -e .
187+
# matplotlib cleanups: set default backend, precaching fonts
188+
RUN sed -i 's/\(backend *: \).*$/\1Agg/g' /usr/local/miniconda/lib/python3.5/site-packages/matplotlib/mpl-data/matplotlibrc && \
189+
python -c "from matplotlib import font_manager"
60190

61-
RUN cd nipype/ && \
62-
source activate nipypetests-3.5 && \
63-
pip install -r requirements.txt && \
64-
pip install -e .
191+
# Unless otherwise specified each process should only use one thread - nipype
192+
# will handle parallelization
193+
ENV MKL_NUM_THREADS=1 \
194+
OMP_NUM_THREADS=1
65195

66-
WORKDIR /scratch
196+
# Installing dev requirements (packages that are not in pypi)
197+
WORKDIR /root/
198+
ADD requirements.txt requirements.txt
199+
RUN pip install -r requirements.txt && \
200+
rm -rf ~/.cache/pip
67201

68-
# Install entrypoints
69-
ADD docker/circleci/run_* /usr/bin/
70-
RUN chmod +x /usr/bin/run_*
202+
# Installing nipype
203+
COPY . /root/src/nipype
204+
RUN cd /root/src/nipype && \
205+
pip install -e .[all] && \
206+
rm -rf ~/.cache/pip
71207

72-
# RUN echo 'source /etc/profile.d/nipype_tests.sh' >> /etc/bash.bashrc
73-
ENTRYPOINT ["/usr/bin/run_examples.sh"]
208+
WORKDIR /root/
74209

210+
ARG BUILD_DATE
211+
ARG VCS_REF
212+
ARG VERSION
213+
LABEL org.label-schema.build-date=$BUILD_DATE \
214+
org.label-schema.name="NIPYPE" \
215+
org.label-schema.description="NIPYPE - Neuroimaging in Python: Pipelines and Interfaces" \
216+
org.label-schema.url="http://nipype.readthedocs.io" \
217+
org.label-schema.vcs-ref=$VCS_REF \
218+
org.label-schema.vcs-url="https://github.com/nipy/nipype" \
219+
org.label-schema.version=$VERSION \
220+
org.label-schema.schema-version="1.0"

0 commit comments

Comments
 (0)