From d40972d0fd50f9373ae7ff9ab8ea054041e56d9a Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 22 May 2023 13:55:18 -0400 Subject: [PATCH 1/5] add ci workflow to test latest --- .github/workflows/test_latest.yml | 68 +++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/test_latest.yml diff --git a/.github/workflows/test_latest.yml b/.github/workflows/test_latest.yml new file mode 100644 index 0000000..745c584 --- /dev/null +++ b/.github/workflows/test_latest.yml @@ -0,0 +1,68 @@ +--- +name: test latest image + +on: + push: + branches: ['*'] + schedule: + - cron: 0 0 1 * * + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + + test_latest_image: + + strategy: + matrix: + dataset: ['1', '2'] + fail-fast: false + + runs-on: ubuntu-latest + + steps: + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y tree + + - name: pull docker image + run: docker pull bids/tracula:latest + + - name: print help and version + run: | + docker run -t --rm --read-only \ + bids/tracula:latest --help + docker run -t --rm --read-only \ + bids/tracula:latest -v + + - name: get data + run: | + wget https://raw.githubusercontent.com/bids-apps/maintenance-tools/main/utils/get_data_from_osf.sh + bash get_data_from_osf.sh ds114_test${{ matrix.dataset }} + bash get_data_from_osf.sh ds114_test${{ matrix.dataset }}_freesurfer + + - name: prepare output dir + run: | + mkdir -p ${HOME}/outputs${{ matrix.dataset }} + + - name: participant level + run: | + docker run -t --rm \ + -v ${HOME}/data/ds114_test${{ matrix.dataset }}:/bids_dataset \ + -v ${HOME}/outputs${{ matrix.dataset }}:/outputs \ + -v ${HOME}/data/ds114_test${{ matrix.dataset }}_freesurfer:/freesurfer \ + bids/tracula:latest \ + /bids_dataset /outputs participant \ + --participant_label 01 \ + --license_key="~/test.key" \ + --freesurfer_dir /freesurfer \ + --stages prep + + cat ${HOME}/outputs${{ matrix.dataset }}/sub-01/scripts/trac-preproc.done + + - name: check output + run: tree ${HOME}/outputs${{ matrix.dataset }} From a9b3e568a05a1e87f93d33703c1a8ef98c121023 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 22 May 2023 13:57:49 -0400 Subject: [PATCH 2/5] use the proper file --- .github/workflows/test_latest.yml | 175 ++++++++++++++++++------------ 1 file changed, 108 insertions(+), 67 deletions(-) diff --git a/.github/workflows/test_latest.yml b/.github/workflows/test_latest.yml index 745c584..72c4f02 100644 --- a/.github/workflows/test_latest.yml +++ b/.github/workflows/test_latest.yml @@ -1,68 +1,109 @@ --- -name: test latest image - -on: - push: - branches: ['*'] - schedule: - - cron: 0 0 1 * * - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - - test_latest_image: - - strategy: - matrix: - dataset: ['1', '2'] - fail-fast: false - - runs-on: ubuntu-latest - - steps: - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y tree - - - name: pull docker image - run: docker pull bids/tracula:latest - - - name: print help and version - run: | - docker run -t --rm --read-only \ - bids/tracula:latest --help - docker run -t --rm --read-only \ - bids/tracula:latest -v - - - name: get data - run: | - wget https://raw.githubusercontent.com/bids-apps/maintenance-tools/main/utils/get_data_from_osf.sh - bash get_data_from_osf.sh ds114_test${{ matrix.dataset }} - bash get_data_from_osf.sh ds114_test${{ matrix.dataset }}_freesurfer - - - name: prepare output dir - run: | - mkdir -p ${HOME}/outputs${{ matrix.dataset }} - - - name: participant level - run: | - docker run -t --rm \ - -v ${HOME}/data/ds114_test${{ matrix.dataset }}:/bids_dataset \ - -v ${HOME}/outputs${{ matrix.dataset }}:/outputs \ - -v ${HOME}/data/ds114_test${{ matrix.dataset }}_freesurfer:/freesurfer \ - bids/tracula:latest \ - /bids_dataset /outputs participant \ - --participant_label 01 \ - --license_key="~/test.key" \ - --freesurfer_dir /freesurfer \ - --stages prep - - cat ${HOME}/outputs${{ matrix.dataset }}/sub-01/scripts/trac-preproc.done - - - name: check output - run: tree ${HOME}/outputs${{ matrix.dataset }} + name: test latest image + + on: + push: + branches: ['*'] + schedule: + - cron: 0 0 1 * * + workflow_dispatch: + + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + + jobs: + + test_version: + + runs-on: ubuntu-latest + + steps: + + - name: pull docker image + run: docker pull bids/mrtrix3_connectome:latest + + - name: print help and version + run: | + docker run -t --rm --read-only \ + -v /tmp:/tmp \ + -v /var/tmp:/var/tmp \ + bids/tracula:latest --help + docker run -t --rm --read-only \ + -v /tmp:/tmp \ + -v /var/tmp:/var/tmp \ + bids/mrtrix3_connectome:latest --version + + test_participant: + + runs-on: ubuntu-latest + + steps: + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y tree + + - name: pull docker image + run: docker pull bids/mrtrix3_connectome:latest + + - name: get data + run: | + mkdir -p ${HOME}/downloads + wget -c -O ${HOME}/downloads/preproc.tar.gz "https://osf.io/d9gx7/download" + mkdir -p ${HOME}/data + tar xf ${HOME}/downloads/preproc.tar.gz -C ${HOME}/data + + - name: prepare output dir + run: | + mkdir -p ${HOME}/outputs + + - name: Run preproc-level analysis for all subjects + run: | + docker run -t --rm --read-only \ + -v /tmp:/tmp -v /var/tmp:/var/tmp \ + -v ${HOME}/data/BIDS:/bids_dataset \ + -v ${HOME}/data/outputs:/outputs \ + -v ${HOME}/scratch:/scratch \ + bids/mrtrix3_connectome \ + /bids_dataset /outputs preproc --scratch /scratch + + - name: check output + run: tree ${HOME}/outputs + + test_group: + + runs-on: ubuntu-latest + + steps: + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y tree + + - name: pull docker image + run: docker pull bids/mrtrix3_connectome:latest + + - name: get data + run: | + mkdir -p ${HOME}/downloads + wget -c -O ${HOME}/downloads/group.tar.gz "https://osf.io/6s8bx/download" + mkdir -p ${HOME}/data + tar xf ${HOME}/downloads/group.tar.gz -C ${HOME}/data + + - name: prepare output dir + run: | + mkdir -p ${HOME}/outputs + + - name: Run preproc-level analysis for all subjects + run: | + docker run -t --rm --read-only \ + -v /tmp:/tmp -v /var/tmp:/var/tmp \ + -v ${HOME}/data/BIDS:/bids_dataset \ + -v ${HOME}/data/outputs:/outputs \ + -v ${HOME}/scratch:/scratch \ + bids/mrtrix3_connectome \ + /bids_dataset /outputs group --scratch /scratch + + - name: check output + run: tree ${HOME}/outputs \ No newline at end of file From a0464d0624e75a3d472655399275508eb22e7e68 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 22 May 2023 14:16:39 -0400 Subject: [PATCH 3/5] add participant level --- .github/workflows/test_latest.yml | 48 +++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_latest.yml b/.github/workflows/test_latest.yml index 72c4f02..ca5c438 100644 --- a/.github/workflows/test_latest.yml +++ b/.github/workflows/test_latest.yml @@ -34,7 +34,7 @@ -v /var/tmp:/var/tmp \ bids/mrtrix3_connectome:latest --version - test_participant: + test_preproc: runs-on: ubuntu-latest @@ -70,7 +70,49 @@ - name: check output run: tree ${HOME}/outputs - + + test_participant: + + runs-on: ubuntu-latest + + steps: + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y tree + + - name: pull docker image + run: docker pull bids/mrtrix3_connectome:latest + + - name: get data + run: | + mkdir -p ${HOME}/downloads + wget -c -O ${HOME}/downloads/participant.tar.gz "https://osf.io/skc5x/download" + mkdir -p ${HOME}/data + tar xf ${HOME}/downloads/participant.tar.gz -C ${HOME}/data + + - name: prepare output dir + run: | + mkdir -p ${HOME}/outputs + + - name: Run preproc-level analysis for all subjects + run: | + docker run -t --rm --read-only \ + -v /tmp:/tmp -v /var/tmp:/var/tmp \ + -v ${HOME}/data/BIDS:/bids_dataset \ + -v ${HOME}/data/outputs:/outputs \ + -v ${HOME}/scratch:/scratch \ + bids/mrtrix3_connectome \ + /bids_dataset /outputs participant \ + --scratch /scratch \ + --parcellation aal \ + --streamlines 100000 \ + --output_verbosity 3 + + + - name: check output + run: tree ${HOME}/outputs + test_group: runs-on: ubuntu-latest @@ -95,7 +137,7 @@ run: | mkdir -p ${HOME}/outputs - - name: Run preproc-level analysis for all subjects + - name: Run group-level analysis run: | docker run -t --rm --read-only \ -v /tmp:/tmp -v /var/tmp:/var/tmp \ From 7dfd1bfc341699d94d6dda0debd9fd4ad1b640bb Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 22 May 2023 14:27:04 -0400 Subject: [PATCH 4/5] pull the proper image --- .github/workflows/test_latest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_latest.yml b/.github/workflows/test_latest.yml index ca5c438..9634007 100644 --- a/.github/workflows/test_latest.yml +++ b/.github/workflows/test_latest.yml @@ -28,7 +28,7 @@ docker run -t --rm --read-only \ -v /tmp:/tmp \ -v /var/tmp:/var/tmp \ - bids/tracula:latest --help + bids/mrtrix3_connectome:latest --help docker run -t --rm --read-only \ -v /tmp:/tmp \ -v /var/tmp:/var/tmp \ From ae3ea40ff06bc4ec7174c6322832fc10d9dc6bd8 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 22 May 2023 14:34:32 -0400 Subject: [PATCH 5/5] do not ask for help --- .github/workflows/test_latest.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/test_latest.yml b/.github/workflows/test_latest.yml index 9634007..31ddc50 100644 --- a/.github/workflows/test_latest.yml +++ b/.github/workflows/test_latest.yml @@ -25,10 +25,6 @@ - name: print help and version run: | - docker run -t --rm --read-only \ - -v /tmp:/tmp \ - -v /var/tmp:/var/tmp \ - bids/mrtrix3_connectome:latest --help docker run -t --rm --read-only \ -v /tmp:/tmp \ -v /var/tmp:/var/tmp \