Skip to content

Commit 74f736e

Browse files
authored
Merge branch 'master' into dtitk
2 parents 7ad09b8 + 373bddd commit 74f736e

File tree

966 files changed

+5581
-4320
lines changed

Some content is hidden

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

966 files changed

+5581
-4320
lines changed

.circle/tests.sh

-51
This file was deleted.

.circleci/config.yml

+194
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
version: 2
2+
jobs:
3+
4+
compare_base_dockerfiles:
5+
docker:
6+
- image: docker:17.10.0-ce-git
7+
steps:
8+
- checkout:
9+
path: /home/circleci/nipype
10+
- setup_remote_docker
11+
- run:
12+
name: Generate and prune base Dockerfile in preparation for cache check
13+
working_directory: /home/circleci/nipype/docker
14+
command: |
15+
mkdir -p /tmp/docker
16+
ash ./generate_dockerfiles.sh -b
17+
18+
# Use the sha256 sum of the pruned Dockerfile as the cache key.
19+
ash prune_dockerfile.sh Dockerfile.base > /tmp/docker/Dockerfile.base-pruned
20+
- restore_cache:
21+
key: dockerfile-cache-v1-master-{{ checksum "/tmp/docker/Dockerfile.base-pruned" }}
22+
- run:
23+
name: Determine how to get base image
24+
command: |
25+
if [ -f /tmp/docker/cache/Dockerfile.base-pruned ]; then
26+
echo "Cache found. Will pull base image."
27+
echo 'export GET_BASE=PULL' > /tmp/docker/get_base_image.sh
28+
else
29+
echo "Cache not found. Will build base image."
30+
echo 'export GET_BASE=BUILD' > /tmp/docker/get_base_image.sh
31+
fi
32+
- persist_to_workspace:
33+
root: /tmp
34+
paths:
35+
- docker/Dockerfile.base-pruned
36+
- docker/get_base_image.sh
37+
38+
39+
build_and_test:
40+
parallelism: 4
41+
machine:
42+
# Ubuntu 14.04 with Docker 17.10.0-ce
43+
image: circleci/classic:201710-02
44+
working_directory: /home/circleci/nipype
45+
steps:
46+
- checkout:
47+
path: /home/circleci/nipype
48+
- attach_workspace:
49+
at: /tmp
50+
- run:
51+
name: Get test dependencies and generate Dockerfiles
52+
command: |
53+
pip install --no-cache-dir codecov
54+
make gen-dockerfiles
55+
- run:
56+
name: Modify Nipype version if necessary
57+
command: |
58+
if [ "$CIRCLE_TAG" != "" ]; then
59+
sed -i -E "s/(__version__ = )'[A-Za-z0-9.-]+'/\1'$CIRCLE_TAG'/" nipype/info.py
60+
fi
61+
- run:
62+
name: Get base image (pull or build)
63+
no_output_timeout: 60m
64+
command: |
65+
source /tmp/docker/get_base_image.sh
66+
if [ "$GET_BASE" == "PULL" ]; then
67+
echo "Pulling base image ..."
68+
docker pull nipype/nipype:base
69+
elif [ "$GET_BASE" == "BUILD" ]; then
70+
e=1 && for i in {1..5}; do
71+
docker build -t nipype/nipype:base - < docker/Dockerfile.base && e=0 && break || sleep 15
72+
done && [ "$e" -eq "0" ]
73+
else
74+
echo "Error: method to get base image not understood"
75+
exit 1
76+
fi
77+
- run:
78+
name: Build main image (py36)
79+
no_output_timeout: 60m
80+
command: |
81+
e=1 && for i in {1..5}; do
82+
docker build \
83+
--rm=false \
84+
--tag nipype/nipype:latest \
85+
--tag nipype/nipype:py36 \
86+
--build-arg BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
87+
--build-arg VCS_REF="$(git rev-parse --short HEAD)" \
88+
--build-arg VERSION="${CIRCLE_TAG}" /home/circleci/nipype \
89+
&& e=0 && break || sleep 15
90+
done && [ "$e" -eq "0" ]
91+
- run:
92+
name: Build main image (py27)
93+
no_output_timeout: 60m
94+
command: |
95+
e=1 && for i in {1..5}; do
96+
docker build \
97+
--rm=false \
98+
--tag nipype/nipype:py27 \
99+
--build-arg PYTHON_VERSION_MAJOR=2 \
100+
--build-arg PYTHON_VERSION_MINOR=7 \
101+
--build-arg BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
102+
--build-arg VCS_REF="$(git rev-parse --short HEAD)" \
103+
--build-arg VERSION="${CIRCLE_TAG}-py27" /home/circleci/nipype \
104+
&& e=0 && break || sleep 15
105+
done && [ "$e" -eq "0" ]
106+
- run:
107+
name: Download test data
108+
no_output_timeout: 20m
109+
working_directory: /home/circleci/examples
110+
environment:
111+
OSF_NIPYPE_URL: "https://files.osf.io/v1/resources/nefdp/providers/osfstorage"
112+
command: |
113+
export DATA_NIPYPE_TUTORIAL_URL="${OSF_NIPYPE_URL}/57f4739cb83f6901ed94bf21"
114+
curl -sSL --retry 5 --connect-timeout 15 "$DATA_NIPYPE_TUTORIAL_URL" | tar xj
115+
116+
export DATA_NIPYPE_FSL_COURSE="${OSF_NIPYPE_URL}/57f472cf9ad5a101f977ecfe"
117+
curl -sSL --retry 5 --connect-timeout 15 "$DATA_NIPYPE_FSL_COURSE" | tar xz
118+
119+
export DATA_NIPYPE_FSL_FEEDS="${OSF_NIPYPE_URL}/57f473066c613b01f113e7af"
120+
curl -sSL --retry 5 --connect-timeout 15 "$DATA_NIPYPE_FSL_FEEDS" | tar xz
121+
- run:
122+
name: Run tests
123+
no_output_timeout: 4h
124+
environment:
125+
WORKDIR: /home/circleci/work
126+
command: |
127+
mkdir -p "$WORKDIR"
128+
chmod -R 777 "$WORKDIR"
129+
bash /home/circleci/nipype/.circleci/tests.sh
130+
- store_artifacts:
131+
path: /home/circleci/work/tests
132+
- run:
133+
name: Save Docker images to workspace
134+
no_output_timeout: 60m
135+
command: |
136+
if [ "$CIRCLE_NODE_INDEX" -eq "0" ] && [ "$CIRCLE_BRANCH" == "master" ]; then
137+
docker save nipype/nipype:base \
138+
nipype/nipype:latest \
139+
nipype/nipype:py36 \
140+
nipype/nipype:py27 | gzip -1 > /tmp/docker/nipype-base-latest-py36-py27.tar.gz
141+
du -h /tmp/docker/nipype-base-latest-py36-py27.tar.gz
142+
fi
143+
- persist_to_workspace:
144+
root: /tmp
145+
paths:
146+
- docker/*
147+
148+
149+
deploy:
150+
docker:
151+
- image: docker:17.10.0-ce-git
152+
steps:
153+
- setup_remote_docker
154+
- attach_workspace:
155+
at: /tmp
156+
- run:
157+
name: Load saved Docker images.
158+
no_output_timeout: 60m
159+
command: |
160+
docker load < /tmp/docker/nipype-base-latest-py36-py27.tar.gz
161+
- run:
162+
name: Push to DockerHub
163+
no_output_timeout: 120m
164+
command: |
165+
echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin
166+
docker push nipype/nipype:base
167+
docker push nipype/nipype:latest
168+
docker push nipype/nipype:py36
169+
docker push nipype/nipype:py27
170+
- run:
171+
name: Move pruned Dockerfile to /tmp/docker/cache directory
172+
command: |
173+
mkdir -p /tmp/docker/cache/
174+
mv /tmp/docker/Dockerfile.base-pruned /tmp/docker/cache/Dockerfile.base-pruned
175+
- save_cache:
176+
paths:
177+
- /tmp/docker/cache/Dockerfile.base-pruned
178+
key: dockerfile-cache-v1-{{ .Branch }}-{{ checksum "/tmp/docker/cache/Dockerfile.base-pruned" }}
179+
180+
181+
workflows:
182+
version: 2
183+
build_test_deply:
184+
jobs:
185+
- compare_base_dockerfiles
186+
- build_and_test:
187+
requires:
188+
- compare_base_dockerfiles
189+
- deploy:
190+
filters:
191+
branches:
192+
only: master
193+
requires:
194+
- build_and_test

.circleci/tests.sh

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
#
3+
# Balance nipype testing workflows across CircleCI build nodes
4+
#
5+
6+
# Setting # $ help set
7+
set -e # Exit immediately if a command exits with a non-zero status.
8+
set -u # Treat unset variables as an error when substituting.
9+
set -x # Print command traces before executing command.
10+
11+
if [ "${CIRCLE_NODE_TOTAL:-}" != "4" ]; then
12+
echo "These tests were designed to be run at 4x parallelism."
13+
exit 1
14+
fi
15+
16+
DOCKER_IMAGE="nipype/nipype"
17+
18+
# These tests are manually balanced based on previous build timings.
19+
# They may need to be rebalanced in the future.
20+
case ${CIRCLE_NODE_INDEX} in
21+
0)
22+
docker run --rm=false -t -v $WORKDIR:/work -v $HOME/examples:/data/examples:ro -w /work -e CI_SKIP_TEST=1 -e NIPYPE_RESOURCE_MONITOR=1 -e FSL_COURSE_DATA="/data/examples/nipype-fsl_course_data" "${DOCKER_IMAGE}:py36" /usr/bin/run_pytests.sh \
23+
&& docker run --rm=false -t -v $WORKDIR:/work -v $HOME/examples:/data/examples:ro -w /work -e CI_SKIP_TEST=1 -e NIPYPE_RESOURCE_MONITOR=1 -e FSL_COURSE_DATA="/data/examples/nipype-fsl_course_data" "${DOCKER_IMAGE}:py27" /usr/bin/run_pytests.sh \
24+
&& docker run --rm=false -t -v $WORKDIR:/work -v $HOME/examples:/data/examples:ro -w /src/nipype/doc "${DOCKER_IMAGE}:py36" /usr/bin/run_builddocs.sh \
25+
&& docker run --rm=false -t -v $WORKDIR:/work -v $HOME/examples:/data/examples:ro -w /work "${DOCKER_IMAGE}:py36" /usr/bin/run_examples.sh test_spm Linear /data/examples/ workflow3d \
26+
&& docker run --rm=false -t -v $WORKDIR:/work -v $HOME/examples:/data/examples:ro -w /work "${DOCKER_IMAGE}:py36" /usr/bin/run_examples.sh test_spm Linear /data/examples/ workflow4d
27+
exitcode=$?
28+
;;
29+
1)
30+
docker run --rm=false -t -v $WORKDIR:/work -v $HOME/examples:/data/examples:ro -w /work "${DOCKER_IMAGE}:py36" /usr/bin/run_examples.sh fmri_spm_dartel Linear /data/examples/ level1 \
31+
&& docker run --rm=false -t -v $WORKDIR:/work -v $HOME/examples:/data/examples:ro -w /work "${DOCKER_IMAGE}:py36" /usr/bin/run_examples.sh fmri_spm_dartel Linear /data/examples/ l2pipeline
32+
exitcode=$?
33+
;;
34+
2)
35+
docker run --rm=false -t -v $WORKDIR:/work -v $HOME/examples:/data/examples:ro -w /work -e NIPYPE_NUMBER_OF_CPUS=4 "${DOCKER_IMAGE}:py36" /usr/bin/run_examples.sh fmri_spm_nested MultiProc /data/examples/ level1 \
36+
&& docker run --rm=false -t -v $WORKDIR:/work -v $HOME/examples:/data/examples:ro -w /work -e NIPYPE_NUMBER_OF_CPUS=4 -e NIPYPE_RESOURCE_MONITOR=1 "${DOCKER_IMAGE}:py27" /usr/bin/run_examples.sh fmri_spm_nested MultiProc /data/examples/ l2pipeline
37+
exitcode=$?
38+
;;
39+
3)
40+
docker run --rm=false -t -v $WORKDIR:/work -v $HOME/examples:/data/examples:ro -w /work -e NIPYPE_NUMBER_OF_CPUS=4 "${DOCKER_IMAGE}:py36" /usr/bin/run_examples.sh fmri_spm_nested MultiProc /data/examples/ level1 \
41+
&& docker run --rm=false -t -v $WORKDIR:/work -v $HOME/examples:/data/examples:ro -w /work "${DOCKER_IMAGE}:py36" /usr/bin/run_examples.sh fmri_fsl_feeds Linear /data/examples/ l1pipeline \
42+
&& docker run --rm=false -t -v $WORKDIR:/work -v $HOME/examples:/data/examples:ro -w /work "${DOCKER_IMAGE}:py36" /usr/bin/run_examples.sh fmri_fsl_reuse Linear /data/examples/ level1_workflow
43+
exitcode=$?
44+
;;
45+
esac
46+
47+
# Exit with error if any of the tests failed
48+
if [ "$exitcode" != "0" ]; then exit 1; fi
49+
50+
codecov --file "${WORKDIR}/tests/coverage*.xml" \
51+
--root "${HOME}/nipype/" --flags unittests -e CIRCLE_NODE_INDEX
52+
53+
codecov --file "${WORKDIR}/tests/smoketest*.xml" \
54+
--root "${HOME}/nipype/" --flags smoketests -e CIRCLE_NODE_INDEX

.mailmap

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Aimi Watanabe <[email protected]> stymy <[email protected]>
22
Aimi Watanabe <[email protected]> stymy <[email protected]>
3+
Alejandro de la Vega <[email protected]> adelavega <[email protected]>
34
Alexander Schaefer <[email protected]> Alexander Schaefer <[email protected]>
45
Alexander Schaefer <[email protected]> alexschaefer83 <[email protected]>
56
Alexander Schaefer <[email protected]> aschaefer <aschaefer@aschaefer-U36SD.(none)>
@@ -56,11 +57,13 @@ Franz Liem <[email protected]> fliem <franz.liem>
5657
Gael Varoquaux <[email protected]> GaelVaroquaux
5758
Gael Varoquaux <[email protected]> GaelVaroquaux <[email protected]>
5859
Gavin Cooper <[email protected]> gjcooper <[email protected]>
60+
Gilles de Hollander <[email protected]> Gilles86 <[email protected]>
5961
Hans Johnson <[email protected]> Hans Johnson <[email protected]>
6062
Hans Johnson <[email protected]> hjmjohnson <[email protected]>
6163
Horea Christian <[email protected]> Horea Christian <[email protected]>
6264
Isaac Schwabacher <[email protected]> ischwabacher <[email protected]>
6365
66+
Jakub Kaczmarzyk <[email protected]> kaczmarj <[email protected]>
6467
6568
6669
Jason Wong <[email protected]> Jason W <[email protected]>
@@ -72,7 +75,9 @@ Joerg Stadler <[email protected]> Jörg Stadler <Stadler@lin-magdeb
7275
Joke Durnez <[email protected]> jokedurnez <[email protected]>
7376
Josh Warner <[email protected]> Josh Warner (Mac) <[email protected]>
7477
Kai Schlamp <[email protected]> medihack <[email protected]>Jessica Forbes <[email protected]> jessicaforbes <[email protected]>
78+
7579
Leonie Lampe <[email protected]> Leonie Lmape <[email protected]>
80+
Lukas Snoek <[email protected]> Lukas Snoek <[email protected]>
7681
Mathias Goncalves <[email protected]> mathiasg <[email protected]>
7782
Michael Dayan <[email protected]> Michael <[email protected]>
7883
Michael Dayan <[email protected]> Michael <[email protected]>
@@ -102,5 +107,6 @@ Steven Giavasis <[email protected]> sgiavasis <[email protected]>
102107
Tristan Glatard <[email protected]> Tristan Glatard <[email protected]>
103108
Victor Saase <[email protected]> vsaase <[email protected]>
104109
William Triplett <[email protected]> William Triplett <[email protected]>
110+
Wolfgang Pauli <[email protected]> Wolfgang Pauli <[email protected]>
105111
Yaroslav Halchenko <[email protected]> Yaroslav Halchenko <[email protected]>
106112

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ deploy:
5959
tags: true
6060
repo: nipy/nipype
6161
branch: master
62-
distributions: "sdist"
62+
distributions: "sdist bdist_wheel"

0 commit comments

Comments
 (0)