diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..e3dd04b --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,585 @@ +version: 2 +jobs: + get_data: + machine: + image: circleci/classic:201711-01 + working_directory: /tmp/data + steps: + - restore_cache: + keys: + - data-v1-{{ .Revision }} + - data-v1- + - run: + name: Get ds114_test1 + command: | + mkdir -p /tmp/data + if [[ ! -d /tmp/data/ds114_test1 ]]; then + wget -c -O ~/ds114_test1.tar \ + "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e54a326c613b01d7d3ed90" && \ + tar xf ~/ds114_test1.tar -C /tmp/data && \ + rm ~/ds114_test1.tar; + else + echo "ds114_test1 was cached" + fi + - run: + name: Get ds114_test2 + command: | + if [[ ! -d /tmp/data/ds114_test2 ]]; then + wget -c -O ~/ds114_test2.tar \ + "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e549f9b83f6901d457d162" && \ + tar xf ~/ds114_test2.tar -C /tmp/data && \ + rm ~/ds114_test2.tar; + else + echo "ds114_test2 was cached" + fi + - run: + name: Create ds114_test2_1ses + command: | + if [[ ! -d /tmp/data/ds114_test2_1ses ]]; then + cp -r /tmp/data/ds114_test2 /tmp/data/ds114_test2_1ses && \ + rm -r /tmp/data/ds114_test2_1ses/sub-*/ses-retest + else + echo "ds114_test2_1ses was cached" + fi + - run: + name: Get ds114_test1_freesurfer + command: | + if [[ ! -d /tmp/data/ds114_test1_freesurfer ]]; then + wget -c -O ~/ds114_test1_freesurfer.tar \ + "https://osf.io/j6zk2/?action=download&version=1" && \ + tar xf ~/ds114_test1_freesurfer.tar -C /tmp/data && \ + mv /tmp/data/ds114_test1_freesurfer_precomp_v6.0.0 /tmp/data/ds114_test1_freesurfer && \ + rm ~/ds114_test1_freesurfer.tar; + else + echo "ds114_test1_freesurfer was cached" + fi + - run: + name: Get ds114_test2_freesurfer + command: | + if [[ ! -d /tmp/data/ds114_test2_freesurfer ]]; then + wget -c -O ~/ds114_test2_freesurfer.tar \ + "https://osf.io/yhzzj/?action=download&version=1" && \ + tar xf ~/ds114_test2_freesurfer.tar -C /tmp/data && \ + mv /tmp/data/ds114_test2_freesurfer_precomp_v6.0.0 /tmp/data/ds114_test2_freesurfer && \ + rm ~/ds114_test2_freesurfer.tar; + else + echo "ds114_test2_freesurfer was cached" + fi + - run: + name: Get ds114_test1_tracula_precomp + command: | + if [[ ! -d /tmp/data/ds114_test1_tracula_precomp ]]; then + wget -c -O ~/ds114_test1_tracula_precomp.tar \ + "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/5882af28594d9001f447f03a" && \ + tar xf ~/ds114_test1_tracula_precomp.tar -C /tmp/data && \ + rm ~/ds114_test1_tracula_precomp.tar; + else + echo "ds114_test1_tracula_precomp was cached" + fi + - run: + name: Get ds114_test2_tracula_precomp + command: | + if [[ ! -d /tmp/data/ds114_test2_tracula_precomp ]]; then + wget -c -O ~/ds114_test2_tracula_precomp.tar \ + "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/5882b3c3594d9001f047f031" && \ + tar xf ~/ds114_test2_tracula_precomp.tar -C /tmp/data && \ + rm ~/ds114_test2_tracula_precomp.tar; + else + echo "ds114_test2_tracula_precomp was cached" + fi + - save_cache: + key: data-v1-{{ .Revision }}-{{ epoch }} + paths: + - /tmp/data + + + build: + docker: + - image: docker:18.01.0-ce-git + steps: + - checkout + - run: + name: Install parallel gzip + command: | + apk add --no-cache pigz + - restore_cache: + keys: + - docker-v1-{{ .Branch }}-{{ .Revision }} + - docker-v1-{{ .Branch }}- + - docker-v1-master- + - docker-v1- + paths: + - /tmp/cache/docker.tar.gz + - setup_remote_docker + - run: + name: Load Docker image layer cache + no_output_timeout: 30m + command: | + docker info + set +o pipefail + if [ -f /tmp/cache/docker.tar.gz ]; then + pigz -d --stdout /tmp/cache/docker.tar.gz | docker load + else + echo "No docker cache found" + fi + docker images + - run: + name: get version + command: | + git describe --tags --always > version + cat version + - run: + name: Build Docker image + no_output_timeout: 60m + command: | + docker images + set +o pipefail + docker build --cache-from=bids/${CIRCLE_PROJECT_REPONAME} \ + -t bids/${CIRCLE_PROJECT_REPONAME}:latest . + docker images + - run: + name: Docker save + no_output_timeout: 40m + command: | + mkdir -p /tmp/cache + set +o pipefail + docker save bids/${CIRCLE_PROJECT_REPONAME}:latest \ + | pigz -2 -p 3 > /tmp/cache/docker.tar.gz + - save_cache: + key: docker-v1-{{ .Branch }}-{{ epoch }} + paths: + - /tmp/cache/docker.tar.gz + # Usage and version + - run: + name: Usage + command: docker run -ti --rm bids/${CIRCLE_PROJECT_REPONAME}:latest -h + - run: + name: Version + command: docker run -ti --rm bids/${CIRCLE_PROJECT_REPONAME}:latest --version + - run: + name: Python info + command: docker run --rm -ti --entrypoint=/bin/bash bids/${CIRCLE_PROJECT_REPONAME}:latest -c "pip3 freeze" + + # TEST 1 participant level tests for 1ses dataset: cross dataset that has session level with one session + test_1ses: + machine: + image: circleci/classic:201711-01 + working_directory: /tmp/data + environment: + - DATADIR: '/tmp/data' + - OUTDIR: '/tmp/outputs' + steps: + - run: + name: Install parallel gzip + command: | + sudo apt-get update && sudo apt-get install -y pigz + - restore_cache: + keys: + - docker-v1-{{ .Branch }}-{{ .Revision }} + - docker-v1-{{ .Branch }}- + - docker-v1-master- + - docker-v1- + paths: + - /tmp/cache/docker.tar.gz + - restore_cache: + keys: + - data-v1-{{ .Revision }} + - data-v1- + # Load Docker + - run: + name: Load Docker + no_output_timeout: 30m + command: | + docker info + set +o pipefail + pigz -d --stdout /tmp/cache/docker.tar.gz | docker load + docker images + - run: + name: make output directory + command: mkdir -p ${OUTDIR} + - run: + name: Test 1ses participant + command: | + docker run -ti --rm -v ${DATADIR}/ds114_test2_1ses:/bids_dataset \ + -v ${OUTDIR}/outputs2_1ses:/outputs \ + -v ${DATADIR}/ds114_test1_freesurfer:/freesurfer \ + bids/${CIRCLE_PROJECT_REPONAME}:latest \ + /bids_dataset /outputs participant --participant_label 01 \ + --license_key="~/test.key" --freesurfer_dir /freesurfer \ + --stages prep && \ + cat ${OUTDIR}/outputs2_1ses/sub-01/scripts/trac-preproc.done + - store_artifacts: + path: /tmp/outputs/ + + + + + # TEST 2 tests for ds114_test1 + test_ds114_test1: + machine: + image: circleci/classic:201711-01 + working_directory: /tmp/data + environment: + - DATADIR: '/tmp/data' + - OUTDIR: '/tmp/outputs' + steps: + - run: + name: Install parallel gzip + command: | + sudo apt-get update && sudo apt-get install -y pigz + - restore_cache: + keys: + - docker-v1-{{ .Branch }}-{{ .Revision }} + - docker-v1-{{ .Branch }}- + - docker-v1-master- + - docker-v1- + paths: + - /tmp/cache/docker.tar.gz + - restore_cache: + keys: + - data-v1-{{ .Revision }} + - data-v1- + # Load Docker + - run: + name: Load Docker + no_output_timeout: 30m + command: | + docker info + set +o pipefail + pigz -d --stdout /tmp/cache/docker.tar.gz | docker load + docker images + - run: + name: make output directory + command: mkdir -p ${OUTDIR} + - run: + name: participant level tests for single session dataset + command: | + docker run -ti --rm \ + -v ${DATADIR}/ds114_test1:/bids_dataset \ + -v ${OUTDIR}/outputs1:/outputs \ + -v ${DATADIR}/ds114_test1_freesurfer:/freesurfer \ + bids/${CIRCLE_PROJECT_REPONAME}:latest \ + /bids_dataset /outputs participant --participant_label 01 \ + --license_key="~/test.key" --freesurfer_dir /freesurfer \ + --stages prep && \ + cat ${OUTDIR}/outputs1/sub-01/scripts/trac-preproc.done + - run: + name: group1 level tests for single session dataset + command: | + docker run -ti --rm \ + -v ${DATADIR}/ds114_test1:/bids_dataset \ + -v ${DATADIR}/ds114_test1_tracula_precomp:/outputs \ + -v ${DATADIR}/ds114_test1_freesurfer:/freesurfer \ + bids/${CIRCLE_PROJECT_REPONAME}:latest \ + /bids_dataset /outputs group1 \ + --license_key="~/test.key" --freesurfer_dir /freesurfer && \ + mkdir -p ${OUTDIR}/outputs1/ && \ + sudo mv ${DATADIR}/ds114_test1_tracula_precomp/00_group* ${OUTDIR}/outputs1/ && \ + cat ${OUTDIR}/outputs1/00_group1_motion_stats/group_motion.tsv + - run: + name: group2 level tests for single session dataset + command: | + docker run -ti --rm \ + -v ${DATADIR}/ds114_test1:/bids_dataset \ + -v ${DATADIR}/ds114_test1_tracula_precomp:/outputs \ + -v ${DATADIR}/ds114_test1_freesurfer:/freesurfer \ + bids/${CIRCLE_PROJECT_REPONAME}:latest \ + /bids_dataset /outputs group2 \ + --license_key="~/test.key" --freesurfer_dir /freesurfer && \ + sudo mv ${DATADIR}/ds114_test1_tracula_precomp/00_group* ${OUTDIR}/outputs1/ && \ + cat ${OUTDIR}/outputs1/00_group2_tract_stats/overall_stats/fminor_stats.tsv && \ + cat ${OUTDIR}/outputs1/00_group2_tract_stats/byvoxel_stats/lh.cab_PP.avg33_mni_bbr.FA.txt + - store_artifacts: + path: /tmp/outputs/ + + # TEST 3 tests for ds114_test2 + test_ds114_test2: + machine: + image: circleci/classic:201711-01 + working_directory: /tmp/data + environment: + - DATADIR: '/tmp/data' + - OUTDIR: '/tmp/outputs' + steps: + - run: + name: Install parallel gzip + command: | + sudo apt-get update && sudo apt-get install -y pigz + - restore_cache: + keys: + - docker-v1-{{ .Branch }}-{{ .Revision }} + - docker-v1-{{ .Branch }}- + - docker-v1-master- + - docker-v1- + paths: + - /tmp/cache/docker.tar.gz + - restore_cache: + keys: + - data-v1-{{ .Revision }} + - data-v1- + # Load Docker + - run: + name: Load Docker + no_output_timeout: 30m + command: | + docker info + set +o pipefail + pigz -d --stdout /tmp/cache/docker.tar.gz | docker load + docker images + - run: + name: make output directory + command: mkdir -p ${OUTDIR} + - run: + name: participant level tests for ds114_test2 + command: | + docker run -ti --rm \ + -v ${DATADIR}/ds114_test2:/bids_dataset \ + -v ${OUTDIR}/outputs2:/outputs \ + -v ${DATADIR}/ds114_test2_freesurfer:/freesurfer \ + bids/${CIRCLE_PROJECT_REPONAME}:latest \ + /bids_dataset /outputs participant --participant_label 01 \ + --license_key="~/test.key" --freesurfer_dir /freesurfer \ + --stages prep && \ + cat ${OUTDIR}/outputs2/sub-01_ses-test.long.sub-01/scripts/trac-preproc.done + - run: + name: group1 level tests for ds114_test2 + command: | + docker run -ti --rm \ + -v ${DATADIR}/ds114_test2:/bids_dataset \ + -v ${DATADIR}/ds114_test2_tracula_precomp:/outputs \ + -v ${DATADIR}/ds114_test2_freesurfer:/freesurfer \ + bids/${CIRCLE_PROJECT_REPONAME}:latest \ + /bids_dataset /outputs group1 \ + --license_key="~/test.key" --freesurfer_dir /freesurfer && \ + mkdir -p ${OUTDIR}/outputs2/ && \ + sudo mv ${DATADIR}/ds114_test2_tracula_precomp/00_group* ${OUTDIR}/outputs2/ && \ + cat ${OUTDIR}/outputs2/00_group1_motion_stats/group_motion.tsv + - run: + name: group2 level tests for ds114_test2 + command: | + docker run -ti --rm \ + -v ${DATADIR}/ds114_test2:/bids_dataset \ + -v ${DATADIR}/ds114_test2_tracula_precomp:/outputs \ + -v ${DATADIR}/ds114_test2_freesurfer:/freesurfer \ + bids/${CIRCLE_PROJECT_REPONAME}:latest \ + /bids_dataset /outputs group2 \ + --license_key="~/test.key" --freesurfer_dir /freesurfer && \ + sudo mv ${DATADIR}/ds114_test2_tracula_precomp/00_group* ${OUTDIR}/outputs2/ && \ + cat ${OUTDIR}/outputs2/00_group2_tract_stats/overall_stats/fminor_stats.tsv && \ + cat ${OUTDIR}/outputs2/00_group2_tract_stats/byvoxel_stats/lh.cab_PP.avg33_mni_bbr.FA.txt + - store_artifacts: + path: /tmp/outputs/ + + + + # TEST 4 tests session flag + test_session: + machine: + image: circleci/classic:201711-01 + working_directory: /tmp/data + environment: + - DATADIR: '/tmp/data' + - OUTDIR: '/tmp/outputs' + steps: + - run: + name: Install parallel gzip + command: | + sudo apt-get update && sudo apt-get install -y pigz + - restore_cache: + keys: + - docker-v1-{{ .Branch }}-{{ .Revision }} + - docker-v1-{{ .Branch }}- + - docker-v1-master- + - docker-v1- + paths: + - /tmp/cache/docker.tar.gz + - restore_cache: + keys: + - data-v1-{{ .Revision }} + - data-v1- + # Load Docker + - run: + name: Load Docker + no_output_timeout: 30m + command: | + docker info + set +o pipefail + pigz -d --stdout /tmp/cache/docker.tar.gz | docker load + docker images + - run: + name: make output directory + command: mkdir -p ${OUTDIR} + - run: + name: participant level tests for sesseion flag in ds114_test2 + command: | + docker run -ti --rm \ + -v ${DATADIR}/ds114_test2:/bids_dataset \ + -v ${OUTDIR}/outputs2_session_label:/outputs \ + -v ${DATADIR}/ds114_test2_freesurfer:/freesurfer \ + bids/${CIRCLE_PROJECT_REPONAME}:latest \ + /bids_dataset /outputs participant \ + --participant_label 01 --session_label retest \ + --license_key="~/test.key" --freesurfer_dir /freesurfer \ + --stages prep && \ + cat ${OUTDIR}/outputs2_session_label/sub-01_ses-retest.long.sub-01/scripts/trac-preproc.done + - store_artifacts: + path: /tmp/outputs/ + + + # TEST 5 freesurfer + test_freesurfer: + machine: + image: circleci/classic:201711-01 + working_directory: /tmp/data + environment: + - DATADIR: '/tmp/data' + - OUTDIR: '/tmp/outputs' + steps: + - run: + name: Install parallel gzip + command: | + sudo apt-get update && sudo apt-get install -y pigz + - restore_cache: + keys: + - docker-v1-{{ .Branch }}-{{ .Revision }} + - docker-v1-{{ .Branch }}- + - docker-v1-master- + - docker-v1- + paths: + - /tmp/cache/docker.tar.gz + - restore_cache: + keys: + - data-v1-{{ .Revision }} + - data-v1- + # Load Docker + - run: + name: Load Docker + no_output_timeout: 30m + command: | + docker info + set +o pipefail + pigz -d --stdout /tmp/cache/docker.tar.gz | docker load + docker images + - run: + name: make output directory + command: mkdir -p ${OUTDIR} + - run: + name: participant level tests for sesseion flag in ds114_test2 + no_output_timeout: 60m + command: | + mkdir -p ${OUTDIR}/outputs1_fs_tests/tracula && \ + mkdir -p ${OUTDIR}/outputs1_fs_tests/freesurfer && \ + docker run -ti --rm \ + -v ${DATADIR}/ds114_test1:/bids_dataset \ + -v ${OUTDIR}/outputs1_fs_tests:/outputs \ + bids/${CIRCLE_PROJECT_REPONAME}:latest \ + /bids_dataset /outputs participant \ + --participant_label 01 \ + --license_key="~/test.key" --freesurfer_dir /outputs/freesurfer \ + --run-freesurfer-tests-only && \ + cat ${OUTDIR}/outputs1_fs_tests/freesurfer/sub-01/scripts/recon-all.done + - store_artifacts: + path: /tmp/outputs/ + + + deploy: + machine: + image: circleci/classic:201711-01 + steps: + - run: + name: Install parallel gzip + command: | + sudo apt-get update && sudo apt-get install -y pigz + - restore_cache: + keys: + - docker-v1-{{ .Branch }}-{{ .Revision }} + - docker-v1-{{ .Branch }}- + - docker-v1-master- + - docker-v1- + paths: + - /tmp/cache/docker.tar.gz + + # Load Docker + - run: + name: Load Docker + no_output_timeout: 30m + command: | + docker info + set +o pipefail + pigz -d --stdout /tmp/cache/docker.tar.gz | docker load + docker images + - run: + name: Deploy to Docker Hub + no_output_timeout: 40m + command: | + if [[ -n "$DOCKER_PASS" ]]; then + docker login -u $DOCKER_USER -p $DOCKER_PASS + docker tag bids/${CIRCLE_PROJECT_REPONAME}:latest bids/${CIRCLE_PROJECT_REPONAME}:unstable + docker push bids/${CIRCLE_PROJECT_REPONAME}:unstable + if [[ -n "$CIRCLE_TAG" ]]; then + docker push bids/${CIRCLE_PROJECT_REPONAME}:latest + docker tag bids/${CIRCLE_PROJECT_REPONAME}:latest bids/${CIRCLE_PROJECT_REPONAME}:$CIRCLE_TAG + docker push bids/${CIRCLE_PROJECT_REPONAME}:$CIRCLE_TAG + fi + fi + + +workflows: + version: 2 + build_test_deploy: + jobs: + - get_data: + filters: + tags: + only: /.*/ + - build: + filters: + tags: + only: /.*/ + - test_1ses: + requires: + - get_data + - build + filters: + tags: + only: /.*/ + - test_ds114_test1: + requires: + - get_data + - build + filters: + tags: + only: /.*/ + - test_ds114_test2: + requires: + - get_data + - build + filters: + tags: + only: /.*/ + - test_session: + requires: + - get_data + - build + filters: + tags: + only: /.*/ + - test_freesurfer: + requires: + - get_data + - build + filters: + tags: + only: /.*/ + - deploy: + requires: + - test_1ses + - test_ds114_test1 + - test_ds114_test2 + - test_session + - test_freesurfer + filters: + branches: + only: master + tags: + only: /.*/ diff --git a/Dockerfile b/Dockerfile index cb6da02..920c954 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,4 @@ -FROM ubuntu:18.04 - -RUN apt-get update && apt-get install -y wget gnupg1 - -#install neurodebian -RUN wget -O- http://neuro.debian.net/lists/bionic.us-tn.full | tee /etc/apt/sources.list.d/neurodebian.sources.list -RUN apt-key adv --recv-keys --keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9 # --refresh-keys - +FROM neurodebian:bionic-non-free ## BIDS Validator RUN apt-get update && \ @@ -19,11 +12,6 @@ RUN npm install -g bids-validator ## FSL RUN apt-get update && \ - apt-get install -y wget gnupg1 && \ - wget -O- http://neuro.debian.net/lists/bionic.us-tn.full | tee /etc/apt/sources.list.d/neurodebian.sources.list && \ - apt-key adv --refresh-keys --keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9 && \ - apt-get update && \ - apt-get remove -y curl && \ apt-get install -y fsl-core=5.0.9-5~nd18.04+1 && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* @@ -43,7 +31,7 @@ ENV FSLOUTPUTTYPE=NIFTI_GZ #### FreeSurfer RUN apt-get update && \ - apt-get install -y tcsh bc tar libgomp1 perl-modules libglu1-mesa + apt-get install -y tcsh bc tar libgomp1 perl-modules libglu1-mesa wget RUN apt-get -y update && \ diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 8648baf..0000000 --- a/circle.yml +++ /dev/null @@ -1,71 +0,0 @@ -general: - artifacts: - - "~/outputs1" - - "~/outputs1_fs_tests" - - "~/outputs2" - - "~/outputs2_1ses" - - "~/outputs2_session_label" - -machine: - services: - - docker #don't use 1.10 - caching is broken - -dependencies: - cache_directories: - - "~/docker" - - "~/data" - - override: - - if [[ ! -d ~/data/ds114_test1 ]]; then wget -c -O ${HOME}/ds114_test1.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e54a326c613b01d7d3ed90" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test1.tar -C ${HOME}/data; fi - - if [[ ! -d ~/data/ds114_test2 ]]; then wget -c -O ${HOME}/ds114_test2.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e549f9b83f6901d457d162" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test2.tar -C ${HOME}/data; fi - - if [[ ! -d ~/data/ds114_test2_1ses ]]; then cp -r ~/data/ds114_test2 ~/data/ds114_test2_1ses && rm -r ~/data/ds114_test2_1ses/sub-*/ses-retest; fi - - if [[ ! -d ~/data/ds114_test1_freesurfer ]]; then wget -c -O ${HOME}/ds114_test1_freesurfer.tar "https://osf.io/j6zk2/?action=download&version=1" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test1_freesurfer.tar -C ${HOME}/data && cd ${HOME}/data && mv ds114_test1_freesurfer_precomp_v6.0.0 ds114_test1_freesurfer; fi - - if [[ ! -d ~/data/ds114_test2_freesurfer ]]; then wget -c -O ${HOME}/ds114_test2_freesurfer.tar "https://osf.io/yhzzj/?action=download&version=1" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test2_freesurfer.tar -C ${HOME}/data&& cd ${HOME}/data && mv ds114_test2_freesurfer_precomp_v6.0.0 ds114_test2_freesurfer; fi - - if [[ ! -d ~/data/ds114_test1_tracula_precomp ]]; then wget -c -O ${HOME}/ds114_test1_tracula_precomp.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/5882af28594d9001f447f03a" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test1_tracula_precomp.tar -C ${HOME}/data; fi - - if [[ ! -d ~/data/ds114_test2_tracula_precomp ]]; then wget -c -O ${HOME}/ds114_test2_tracula_precomp.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/5882b3c3594d9001f047f031" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test2_tracula_precomp.tar -C ${HOME}/data; fi - - if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; fi - - git describe --tags > version - - docker build -t bids/${CIRCLE_PROJECT_REPONAME,,} . : - timeout: 21600 - - mkdir -p ~/docker; docker save "bids/${CIRCLE_PROJECT_REPONAME,,}" > ~/docker/image.tar - -test: - override: - # print version - - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/data/ds114_test1_freesurfer:/freesurfer bids/${CIRCLE_PROJECT_REPONAME,,} --version - # participant level tests for 1ses dataset: cross dataset that has session level with one session - - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test2_1ses:/bids_dataset -v ${HOME}/outputs2_1ses:/outputs -v ${HOME}/data/ds114_test1_freesurfer:/freesurfer bids/${CIRCLE_PROJECT_REPONAME,,} /bids_dataset /outputs participant --participant_label 01 --license_key="~/test.key" --freesurfer_dir /freesurfer --stages prep && cat ${HOME}/outputs2_1ses/sub-01/scripts/trac-preproc.done : - timeout: 21600 - # participant level tests for single session dataset - - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/outputs1:/outputs -v ${HOME}/data/ds114_test1_freesurfer:/freesurfer bids/${CIRCLE_PROJECT_REPONAME,,} /bids_dataset /outputs participant --participant_label 01 --license_key="~/test.key" --freesurfer_dir /freesurfer --stages prep && cat ${HOME}/outputs1/sub-01/scripts/trac-preproc.done : - timeout: 21600 - # group level test for single session dataset: group1 - - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/data/ds114_test1_tracula_precomp:/outputs -v ${HOME}/data/ds114_test1_freesurfer:/freesurfer bids/${CIRCLE_PROJECT_REPONAME,,} /bids_dataset /outputs group1 --license_key="~/test.key" --freesurfer_dir /freesurfer && mkdir -p ${HOME}/outputs1/ && sudo mv ${HOME}/data/ds114_test1_tracula_precomp/00_group* ${HOME}/outputs1/ && cat ${HOME}/outputs1/00_group1_motion_stats/group_motion.tsv : - timeout: 21600 - # group level test for single session dataset: group2 - - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/data/ds114_test1_tracula_precomp:/outputs -v ${HOME}/data/ds114_test1_freesurfer:/freesurfer bids/${CIRCLE_PROJECT_REPONAME,,} /bids_dataset /outputs group2 --license_key="~/test.key" --freesurfer_dir /freesurfer && mkdir -p ${HOME}/outputs1/ && sudo mv ${HOME}/data/ds114_test1_tracula_precomp/00_group* ${HOME}/outputs1/ && cat ${HOME}/outputs1/00_group2_tract_stats/overall_stats/fminor_stats.tsv && cat ${HOME}/outputs1/00_group2_tract_stats/byvoxel_stats/lh.cab_PP.avg33_mni_bbr.FA.txt: - timeout: 21600 - # participant level tests for a longitudinal dataset - - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test2:/bids_dataset -v ${HOME}/outputs2:/outputs -v ${HOME}/data/ds114_test2_freesurfer:/freesurfer bids/${CIRCLE_PROJECT_REPONAME,,} /bids_dataset /outputs participant --participant_label 01 --license_key="~/test.key" --freesurfer_dir /freesurfer --stages prep && cat ${HOME}/outputs2/sub-01_ses-test.long.sub-01/scripts/trac-preproc.done : - timeout: 21600 - # participant level tests for a longitudinal dataset (test session_label flag) - - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test2:/bids_dataset -v ${HOME}/outputs2_session_label:/outputs -v ${HOME}/data/ds114_test2_freesurfer:/freesurfer bids/${CIRCLE_PROJECT_REPONAME,,} /bids_dataset /outputs participant --participant_label 01 --session_label retest --license_key="~/test.key" --freesurfer_dir /freesurfer --stages prep && cat ${HOME}/outputs2_session_label/sub-01_ses-retest.long.sub-01/scripts/trac-preproc.done : - timeout: 21600 - # group level test for a longitudinal dataset: group1 - - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test2:/bids_dataset -v ${HOME}/data/ds114_test2_tracula_precomp:/outputs -v ${HOME}/data/ds114_test2_freesurfer:/freesurfer bids/${CIRCLE_PROJECT_REPONAME,,} /bids_dataset /outputs group1 --license_key="~/test.key" --freesurfer_dir /freesurfer && mkdir -p ${HOME}/outputs2/ && sudo mv ${HOME}/data/ds114_test2_tracula_precomp/00_group* ${HOME}/outputs2/ && cat ${HOME}/outputs2/00_group1_motion_stats/group_motion.tsv : - timeout: 21600 - # group level test for a longitudinal dataset: group2 - - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test2:/bids_dataset -v ${HOME}/data/ds114_test2_tracula_precomp:/outputs -v ${HOME}/data/ds114_test2_freesurfer:/freesurfer bids/${CIRCLE_PROJECT_REPONAME,,} /bids_dataset /outputs group2 --license_key="~/test.key" --freesurfer_dir /freesurfer && mkdir -p ${HOME}/outputs2/ && sudo mv ${HOME}/data/ds114_test2_tracula_precomp/00_group* ${HOME}/outputs2/ && cat ${HOME}/outputs2/00_group2_tract_stats/overall_stats/fminor_stats.tsv && cat ${HOME}/outputs2/00_group2_tract_stats/byvoxel_stats/lh.cab_PP.avg33_mni_bbr.FA.txt : - timeout: 21600 - # starts freesurfer processing only - - mkdir -p ${HOME}/outputs1_fs_tests/tracula && mkdir -p ${HOME}/outputs1_fs_tests/freesurfer && docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/outputs1_fs_tests:/outputs bids/${CIRCLE_PROJECT_REPONAME,,} /bids_dataset /outputs/tracula participant --participant_label 01 --license_key="~/test.key" --freesurfer_dir /outputs/freesurfer --run-freesurfer-tests-only && cat ${HOME}/outputs1_fs_tests/freesurfer/sub-01/scripts/recon-all.done : - timeout: 21600 -deployment: - hub: - owner: BIDS-Apps - tag: /.*/ - commands: - - if [[ -n "$DOCKER_PASS" ]]; then docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS && docker push bids/${CIRCLE_PROJECT_REPONAME,,}:latest; fi : - timeout: 21600 - - if [[ -n "$DOCKER_PASS" ]]; then docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS && docker tag bids/${CIRCLE_PROJECT_REPONAME,,} bids/${CIRCLE_PROJECT_REPONAME,,}:$CIRCLE_TAG && docker push bids/${CIRCLE_PROJECT_REPONAME,,}:$CIRCLE_TAG; fi : - timeout: 21600