1
1
#! /bin/bash
2
+ #
3
+ # Balance nipype testing workflows across CircleCI build nodes
4
+ #
2
5
3
- set -o nounset
4
- set -o xtrace
5
-
6
- export CODECOV_TOKEN=ac172a50-8e66-42e5-8822-5373fcf54686
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.
7
10
8
11
if [ " ${CIRCLE_NODE_TOTAL:- } " != " 4" ]; then
9
12
echo " These tests were designed to be run at 4x parallelism."
14
17
# They may need to be rebalanced in the future.
15
18
case ${CIRCLE_NODE_INDEX} in
16
19
0)
17
- docker run --rm -it -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh fmri_spm_dartel Linear /root/examples/ level1 && \
18
- docker run --rm -it -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh fmri_spm_dartel Linear /root/examples/ l2pipeline
19
- ;;
20
- 1)
21
- docker run --rm -it -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh test_spm Linear /root/examples/ workflow3d && \
22
- docker run --rm -it -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh test_spm Linear /root/examples/ workflow4d && \
23
20
docker run --rm -it -e FSL_COURSE_DATA=" /root/examples/nipype-fsl_course_data" -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /root/src/nipype nipype/nipype_test:py27 /usr/bin/run_pytests.sh py27 && \
24
21
docker run --rm -it -e FSL_COURSE_DATA=" /root/examples/nipype-fsl_course_data" -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /root/src/nipype nipype/nipype_test:py35 /usr/bin/run_pytests.sh py35 && \
25
- docker run --rm -it -v $SCRATCH :/scratch -w /root/src/nipype/doc nipype/nipype_test:py35 /usr/bin/run_builddocs.sh
22
+ docker run --rm -it -v $SCRATCH :/scratch -w /root/src/nipype/doc nipype/nipype_test:py35 /usr/bin/run_builddocs.sh && \
23
+ docker run --rm -it -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh test_spm Linear /root/examples/ workflow3d && \
24
+ docker run --rm -it -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh test_spm Linear /root/examples/ workflow4d
25
+ ;;
26
+ 1)
27
+ docker run --rm -it -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh fmri_spm_dartel Linear /root/examples/ level1 && \
28
+ docker run --rm -it -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh fmri_spm_dartel Linear /root/examples/ l2pipeline
26
29
;;
27
30
2)
28
31
docker run --rm -it -e NIPYPE_NUMBER_OF_CPUS=4 -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /scratch nipype/nipype_test:py27 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /root/examples/ level1 && \
@@ -34,14 +37,3 @@ case ${CIRCLE_NODE_INDEX} in
34
37
docker run --rm -it -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh fmri_fsl_reuse Linear /root/examples/ level1_workflow
35
38
;;
36
39
esac
37
-
38
- # Put the artifacts in place
39
- bash docker/files/teardown.sh
40
-
41
- # Send coverage data to codecov.io
42
- curl -so codecov.io https://codecov.io/bash
43
- chmod 755 codecov.io
44
- find " ${CIRCLE_TEST_REPORTS} /pytest" -name ' coverage*.xml' -print0 | \
45
- xargs -0 -I file ./codecov.io -f file -t " ${CODECOV_TOKEN} " -F unittests
46
- find " ${CIRCLE_TEST_REPORTS} /pytest" -name ' smoketests*.xml' -print0 | \
47
- xargs -0 -I file ./codecov.io -f file -t " ${CODECOV_TOKEN} " -F smoketests
0 commit comments