diff --git a/.circleci/config.yml b/.circleci/config.yml index e922b37520..569a18fc20 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,3 +1,121 @@ +_machine_kwds: &machine_kwds + image: circleci/classic:201710-02 + +_store_artifacts_kwds: &store_artifacts_kwds + path: /home/circleci/work/tests + +_test_environment: &test_environment + WORKDIR: /home/circleci/work + DOCKER_IMAGE: "nipype/nipype" + +_set_pr_number: &set_pr_number + name: Set PR number + command: | + echo 'export CIRCLE_PR_NUMBER="${CIRCLE_PR_NUMBER:-${CIRCLE_PULL_REQUEST##*/}}"' >> $BASH_ENV + source $BASH_ENV + echo $CIRCLE_PR_NUMBER + +_generate_dockerfiles: &generate_dockerfiles + name: Generate Dockerfiles + command: | + make gen-dockerfiles + +_modify_nipype_version: &modify_nipype_version + name: Modify Nipype version if necessary + command: | + if [ "$CIRCLE_TAG" != "" ]; then + sed -i -E "s/(__version__ = )'[A-Za-z0-9.-]+'/\1'$CIRCLE_TAG'/" nipype/info.py + fi + +_get_base_image: &get_base_image + name: Get base image (pull or build) + no_output_timeout: 60m + command: | + source /tmp/docker/get_base_image.sh + if [ "$GET_BASE" == "PULL" ]; then + echo "Pulling base image ..." + docker pull nipype/nipype:base + elif [ "$GET_BASE" == "BUILD" ]; then + e=1 && for i in {1..5}; do + docker build -t nipype/nipype:base - < docker/Dockerfile.base && e=0 && break || sleep 15 + done && [ "$e" -eq "0" ] + else + echo "Error: method to get base image not understood" + exit 1 + fi + +_build_main_image_py36: &build_main_image_py36 + name: Build main image (py36) + no_output_timeout: 60m + command: | + e=1 && for i in {1..5}; do + docker build \ + --rm=false \ + --tag nipype/nipype:latest \ + --tag nipype/nipype:py36 \ + --build-arg BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \ + --build-arg VCS_REF="$(git rev-parse --short HEAD)" \ + --build-arg VERSION="${CIRCLE_TAG}" /home/circleci/nipype \ + && e=0 && break || sleep 15 + done && [ "$e" -eq "0" ] + +_build_main_image_py27: &build_main_image_py27 + name: Build main image (py27) + no_output_timeout: 60m + command: | + e=1 && for i in {1..5}; do + docker build \ + --rm=false \ + --tag nipype/nipype:py27 \ + --build-arg PYTHON_VERSION_MAJOR=2 \ + --build-arg PYTHON_VERSION_MINOR=7 \ + --build-arg BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \ + --build-arg VCS_REF="$(git rev-parse --short HEAD)" \ + --build-arg VERSION="${CIRCLE_TAG}-py27" /home/circleci/nipype \ + && e=0 && break || sleep 15 + done && [ "$e" -eq "0" ] + +_download_test_data: &_download_test_data + name: Download test data + no_output_timeout: 20m + working_directory: /home/circleci/examples + environment: + OSF_NIPYPE_URL: "https://files.osf.io/v1/resources/nefdp/providers/osfstorage" + command: | + export DATA_NIPYPE_TUTORIAL_URL="${OSF_NIPYPE_URL}/57f4739cb83f6901ed94bf21" + curl -sSL --retry 5 --connect-timeout 15 "$DATA_NIPYPE_TUTORIAL_URL" | tar xj + + export DATA_NIPYPE_FSL_COURSE="${OSF_NIPYPE_URL}/57f472cf9ad5a101f977ecfe" + curl -sSL --retry 5 --connect-timeout 15 "$DATA_NIPYPE_FSL_COURSE" | tar xz + + export DATA_NIPYPE_FSL_FEEDS="${OSF_NIPYPE_URL}/57f473066c613b01f113e7af" + curl -sSL --retry 5 --connect-timeout 15 "$DATA_NIPYPE_FSL_FEEDS" | tar xz + +_prepare_working_directory: &prepare_working_directory + name: Prepare working directory + environment: *test_environment + command: | + mkdir -p "$WORKDIR" + chmod -R 777 "$WORKDIR" + +_get_codecov: &_get_codecov + name: Get codecov + command: | + pip install --no-cache-dir codecov + +_run_codecov_coverage: &_run_codecov_coverage + name: Run codecov (coverage) + environment: *test_environment + command: | + codecov --file $WORKDIR/tests/coverage*.xml --root "$HOME/nipype" --flags unittests -e CIRCLE_JOB + +_run_codecov_smoke: &_run_codecov_smoke + name: Run codecov (smoke tests) + environment: *test_environment + command: | + codecov --file $WORKDIR/tests/smoketest*.xml --root "$HOME/nipype" --flags smoketests -e CIRCLE_JOB + + version: 2 jobs: @@ -35,116 +153,156 @@ jobs: - docker/Dockerfile.base-pruned - docker/get_base_image.sh + test_pytest: + machine: *machine_kwds + working_directory: /home/circleci/nipype + steps: + - checkout: + path: /home/circleci/nipype + - attach_workspace: + at: /tmp + - run: *set_pr_number + - run: *generate_dockerfiles + - run: *modify_nipype_version + - run: *get_base_image + - run: *build_main_image_py36 + - run: *build_main_image_py27 + - run: *_get_codecov + - run: *_download_test_data + - run: *prepare_working_directory + - run: + name: Run pytests (py36) + no_output_timeout: 30m + environment: *test_environment + command: bash -ux /home/circleci/nipype/.circleci/test_py3_pytest.sh + - run: + name: Run pytests (py27) + no_output_timeout: 30m + environment: *test_environment + command: bash -ux /home/circleci/nipype/.circleci/test_py2_pytest.sh + - run: *_run_codecov_coverage + - store_artifacts: *store_artifacts_kwds + - store_test_results: *store_artifacts_kwds - build_and_test: - parallelism: 4 - machine: - # Ubuntu 14.04 with Docker 17.10.0-ce - image: circleci/classic:201710-02 + test_py3_fmri_fsl_spm: + machine: *machine_kwds working_directory: /home/circleci/nipype steps: - checkout: path: /home/circleci/nipype - attach_workspace: at: /tmp + - run: *set_pr_number + - run: *generate_dockerfiles + - run: *modify_nipype_version + - run: *get_base_image + - run: *build_main_image_py36 + - run: *_get_codecov + - run: *_download_test_data + - run: *prepare_working_directory - run: - name: Get test dependencies and generate Dockerfiles - command: | - pip install --no-cache-dir codecov - make gen-dockerfiles + name: Run FSL FEEDS pipeline (py36) + no_output_timeout: 40m + environment: *test_environment + command: bash -ux /home/circleci/nipype/.circleci/test_py3_fmri_fsl_feeds_linear_l1.sh - run: - name: Modify Nipype version if necessary - command: | - if [ "$CIRCLE_TAG" != "" ]; then - sed -i -E "s/(__version__ = )'[A-Za-z0-9.-]+'/\1'$CIRCLE_TAG'/" nipype/info.py - fi + name: Run FSL reuse pipeline (py36) + no_output_timeout: 40m + environment: *test_environment + command: bash -ux /home/circleci/nipype/.circleci/test_py3_fmri_fsl_reuse_linear_l1.sh - run: - name: Get base image (pull or build) - no_output_timeout: 60m - command: | - source /tmp/docker/get_base_image.sh - if [ "$GET_BASE" == "PULL" ]; then - echo "Pulling base image ..." - docker pull nipype/nipype:base - elif [ "$GET_BASE" == "BUILD" ]; then - e=1 && for i in {1..5}; do - docker build -t nipype/nipype:base - < docker/Dockerfile.base && e=0 && break || sleep 15 - done && [ "$e" -eq "0" ] - else - echo "Error: method to get base image not understood" - exit 1 - fi + name: Run SPM test workflow - 3D inputs (py36) + no_output_timeout: 40m + environment: *test_environment + command: bash -ux /home/circleci/nipype/.circleci/test_py3_fmri_spm_linear_3d.sh - run: - name: Build main image (py36) - no_output_timeout: 60m - command: | - e=1 && for i in {1..5}; do - docker build \ - --rm=false \ - --tag nipype/nipype:latest \ - --tag nipype/nipype:py36 \ - --build-arg BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \ - --build-arg VCS_REF="$(git rev-parse --short HEAD)" \ - --build-arg VERSION="${CIRCLE_TAG}" /home/circleci/nipype \ - && e=0 && break || sleep 15 - done && [ "$e" -eq "0" ] - - run: - name: Build main image (py27) - no_output_timeout: 60m - command: | - e=1 && for i in {1..5}; do - docker build \ - --rm=false \ - --tag nipype/nipype:py27 \ - --build-arg PYTHON_VERSION_MAJOR=2 \ - --build-arg PYTHON_VERSION_MINOR=7 \ - --build-arg BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \ - --build-arg VCS_REF="$(git rev-parse --short HEAD)" \ - --build-arg VERSION="${CIRCLE_TAG}-py27" /home/circleci/nipype \ - && e=0 && break || sleep 15 - done && [ "$e" -eq "0" ] - - run: - name: Download test data - no_output_timeout: 20m - working_directory: /home/circleci/examples - environment: - OSF_NIPYPE_URL: "https://files.osf.io/v1/resources/nefdp/providers/osfstorage" - command: | - export DATA_NIPYPE_TUTORIAL_URL="${OSF_NIPYPE_URL}/57f4739cb83f6901ed94bf21" - curl -sSL --retry 5 --connect-timeout 15 "$DATA_NIPYPE_TUTORIAL_URL" | tar xj + name: Run SPM test workflow - 4D inputs (py36) + no_output_timeout: 40m + environment: *test_environment + command: bash -ux /home/circleci/nipype/.circleci/test_py3_fmri_spm_linear_4d.sh + - run: *_run_codecov_smoke + - store_artifacts: *store_artifacts_kwds - export DATA_NIPYPE_FSL_COURSE="${OSF_NIPYPE_URL}/57f472cf9ad5a101f977ecfe" - curl -sSL --retry 5 --connect-timeout 15 "$DATA_NIPYPE_FSL_COURSE" | tar xz + test_py3_fmri_spm_dartel_multiproc: + machine: *machine_kwds + working_directory: /home/circleci/nipype + steps: + - checkout: + path: /home/circleci/nipype + - attach_workspace: + at: /tmp + - run: *set_pr_number + - run: *generate_dockerfiles + - run: *modify_nipype_version + - run: *get_base_image + - run: *build_main_image_py36 + - run: *_get_codecov + - run: *_download_test_data + - run: *prepare_working_directory + - run: + name: Run SPM DARTEL Level 1 pipeline (py36) + no_output_timeout: 1h + environment: *test_environment + command: bash -ux /home/circleci/nipype/.circleci/test_py3_fmri_spm_dartel_multiproc_l1.sh + - run: + name: Run SPM DARTEL Level 2 pipeline (py36) + no_output_timeout: 30m + environment: *test_environment + command: bash -ux /home/circleci/nipype/.circleci/test_py3_fmri_spm_dartel_multiproc_l2.sh + - run: *_run_codecov_smoke + - store_artifacts: *store_artifacts_kwds - export DATA_NIPYPE_FSL_FEEDS="${OSF_NIPYPE_URL}/57f473066c613b01f113e7af" - curl -sSL --retry 5 --connect-timeout 15 "$DATA_NIPYPE_FSL_FEEDS" | tar xz + test_fmri_spm_nested_multiproc: + machine: *machine_kwds + working_directory: /home/circleci/nipype + steps: + - checkout: + path: /home/circleci/nipype + - attach_workspace: + at: /tmp + - run: *set_pr_number + - run: *generate_dockerfiles + - run: *modify_nipype_version + - run: *get_base_image + - run: *build_main_image_py36 + - run: *build_main_image_py27 + - run: *_get_codecov + - run: *_download_test_data + - run: *prepare_working_directory - run: - name: Run tests - no_output_timeout: 4h - environment: - WORKDIR: /home/circleci/work - command: | - mkdir -p "$WORKDIR" - chmod -R 777 "$WORKDIR" - bash /home/circleci/nipype/.circleci/tests.sh + name: Run SPM Nested Level 1 pipeline (py36) + no_output_timeout: 1h + environment: *test_environment + command: bash -ux /home/circleci/nipype/.circleci/test_py3_fmri_spm_nested_multiproc_l1.sh + - run: + name: Run SPM Nested Level 2 pipeline (py27) + no_output_timeout: 30m + environment: *test_environment + command: bash -ux /home/circleci/nipype/.circleci/test_py2_fmri_spm_nested_multiproc_l2.sh + - run: *_run_codecov_smoke + - store_artifacts: *store_artifacts_kwds + - run: + name: Build docs (py36) + no_output_timeout: 30m + environment: *test_environment + command: bash -ux /home/circleci/nipype/.circleci/test_py3_docs.sh - store_artifacts: - path: /home/circleci/work/tests + path: /home/circleci/work/docs - run: - name: Save Docker images to workspace + name: Save Docker images to workspace if on master no_output_timeout: 60m command: | - if [ "$CIRCLE_NODE_INDEX" -eq "0" ] && [ "$CIRCLE_BRANCH" == "master" ]; then + if [ "$CIRCLE_BRANCH" = "master" -a -z "$CIRCLE_PULL_REQUEST" ]; then docker save nipype/nipype:base \ nipype/nipype:latest \ - nipype/nipype:py36 \ - nipype/nipype:py27 | gzip -1 > /tmp/docker/nipype-base-latest-py36-py27.tar.gz - du -h /tmp/docker/nipype-base-latest-py36-py27.tar.gz + nipype/nipype:py27 \ + nipype/nipype:py36 | gzip -1 > /tmp/docker/nipype-base-latest-py36-py27.tar.gz \ + && du -h /tmp/docker/nipype-base-latest-py36-py27.tar.gz fi - persist_to_workspace: root: /tmp paths: - - docker/* - + - docker deploy: docker: @@ -180,10 +338,19 @@ jobs: workflows: version: 2 - build_test_deply: + build_test_deploy: jobs: - compare_base_dockerfiles - - build_and_test: + - test_pytest: + requires: + - compare_base_dockerfiles + - test_py3_fmri_fsl_spm: + requires: + - compare_base_dockerfiles + - test_py3_fmri_spm_dartel_multiproc: + requires: + - compare_base_dockerfiles + - test_fmri_spm_nested_multiproc: requires: - compare_base_dockerfiles - deploy: @@ -191,4 +358,7 @@ workflows: branches: only: master requires: - - build_and_test + - test_pytest + - test_fmri_spm_nested_multiproc + - test_py3_fmri_fsl_spm + - test_py3_fmri_spm_dartel_multiproc diff --git a/.circleci/test_py2_fmri_spm_nested_multiproc_l2.sh b/.circleci/test_py2_fmri_spm_nested_multiproc_l2.sh new file mode 100644 index 0000000000..1aa2a4f8c5 --- /dev/null +++ b/.circleci/test_py2_fmri_spm_nested_multiproc_l2.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +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 diff --git a/.circleci/test_py2_pytest.sh b/.circleci/test_py2_pytest.sh new file mode 100644 index 0000000000..6ea0ddedfc --- /dev/null +++ b/.circleci/test_py2_pytest.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +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 diff --git a/.circleci/test_py3_docs.sh b/.circleci/test_py3_docs.sh new file mode 100644 index 0000000000..a050caf66c --- /dev/null +++ b/.circleci/test_py3_docs.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +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 diff --git a/.circleci/test_py3_fmri_fsl_feeds_linear_l1.sh b/.circleci/test_py3_fmri_fsl_feeds_linear_l1.sh new file mode 100644 index 0000000000..9666829b74 --- /dev/null +++ b/.circleci/test_py3_fmri_fsl_feeds_linear_l1.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +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 diff --git a/.circleci/test_py3_fmri_fsl_reuse_linear_l1.sh b/.circleci/test_py3_fmri_fsl_reuse_linear_l1.sh new file mode 100644 index 0000000000..48be49d80d --- /dev/null +++ b/.circleci/test_py3_fmri_fsl_reuse_linear_l1.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +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 diff --git a/.circleci/test_py3_fmri_spm_dartel_multiproc_l1.sh b/.circleci/test_py3_fmri_spm_dartel_multiproc_l1.sh new file mode 100644 index 0000000000..4208eed506 --- /dev/null +++ b/.circleci/test_py3_fmri_spm_dartel_multiproc_l1.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +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 MultiProc /data/examples/ level1 diff --git a/.circleci/test_py3_fmri_spm_dartel_multiproc_l2.sh b/.circleci/test_py3_fmri_spm_dartel_multiproc_l2.sh new file mode 100644 index 0000000000..86119e7654 --- /dev/null +++ b/.circleci/test_py3_fmri_spm_dartel_multiproc_l2.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +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 MultiProc /data/examples/ l2pipeline diff --git a/.circleci/test_py3_fmri_spm_linear_3d.sh b/.circleci/test_py3_fmri_spm_linear_3d.sh new file mode 100644 index 0000000000..27c2c92a1a --- /dev/null +++ b/.circleci/test_py3_fmri_spm_linear_3d.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +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 diff --git a/.circleci/test_py3_fmri_spm_linear_4d.sh b/.circleci/test_py3_fmri_spm_linear_4d.sh new file mode 100644 index 0000000000..cd255d60ca --- /dev/null +++ b/.circleci/test_py3_fmri_spm_linear_4d.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +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 diff --git a/.circleci/test_py3_fmri_spm_nested_multiproc_l1.sh b/.circleci/test_py3_fmri_spm_nested_multiproc_l1.sh new file mode 100644 index 0000000000..a6d2133a42 --- /dev/null +++ b/.circleci/test_py3_fmri_spm_nested_multiproc_l1.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +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 diff --git a/.circleci/test_py3_pytest.sh b/.circleci/test_py3_pytest.sh new file mode 100644 index 0000000000..545f430308 --- /dev/null +++ b/.circleci/test_py3_pytest.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +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 diff --git a/.circleci/tests.sh b/.circleci/tests.sh deleted file mode 100644 index f55a3249d7..0000000000 --- a/.circleci/tests.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# -# Balance nipype testing workflows across CircleCI build nodes -# - -# Setting # $ help set -set -e # Exit immediately if a command exits with a non-zero status. -set -u # Treat unset variables as an error when substituting. -set -x # Print command traces before executing command. - -if [ "${CIRCLE_NODE_TOTAL:-}" != "4" ]; then - echo "These tests were designed to be run at 4x parallelism." - exit 1 -fi - -DOCKER_IMAGE="nipype/nipype" - -# These tests are manually balanced based on previous build timings. -# They may need to be rebalanced in the future. -case ${CIRCLE_NODE_INDEX} in - 0) - 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 \ - && 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 \ - && 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 \ - && 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 \ - && 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 - exitcode=$? - ;; - 1) - 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 \ - && 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 - exitcode=$? - ;; - 2) - 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 \ - && 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 - exitcode=$? - ;; - 3) - 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 \ - && 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 \ - && 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 - exitcode=$? - ;; -esac - -# Exit with error if any of the tests failed -if [ "$exitcode" != "0" ]; then exit 1; fi - -codecov --file "${WORKDIR}/tests/coverage*.xml" \ - --root "${HOME}/nipype/" --flags unittests -e CIRCLE_NODE_INDEX - -codecov --file "${WORKDIR}/tests/smoketest*.xml" \ - --root "${HOME}/nipype/" --flags smoketests -e CIRCLE_NODE_INDEX diff --git a/docker/files/run_examples.sh b/docker/files/run_examples.sh index 7959bdb597..1914f53be9 100644 --- a/docker/files/run_examples.sh +++ b/docker/files/run_examples.sh @@ -3,7 +3,7 @@ set -e set -x set -u -WORKDIR=${WORK:-/work} +WORKDIR=${WORKDIR:-/work} arr=$@ tmp_var=$( IFS=$' '; echo "${arr[*]}" ) example_id=${tmp_var//[^A-Za-z0-9_-]/_}