Skip to content

Run participant smoke test #627

Run participant smoke test

Run participant smoke test #627

# Copyright (C) 2022-2023 C-PAC Developers
# This file is part of C-PAC.
# C-PAC is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
# C-PAC is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
# License for more details.
# You should have received a copy of the GNU Lesser General Public
# License along with C-PAC. If not, see <https://www.gnu.org/licenses/>.
name: Run participant smoke test
on:
workflow_call:
workflow_dispatch:
jobs:
smoke_test_human:
name: Human ${{ matrix.preconfig }} participant smoke tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
preconfig:
- default
- abcd-options
- anat-only
- benchmark-ANTS
- benchmark-FNIRT
- blank
- ccs-options
- fmriprep-options
- fx-options
- ndmg
- preproc
- rbc-options
- regtest-1
- regtest-2
- regtest-3
- regtest-4
variant:
- ''
participant:
- 1019436 2014113 3154996 3699991 3884955 NDARAA504CRN NDARAA947ZG5 NDARAB348EWR NDARAB458VK9 NDARAD481FXF NDARAV894XWD NDARCA186WGH 0025428 0025429 0025448 0025452 0025453
include:
- preconfig: default
variant: lite
participant: 1019436 2014113 3154996 3699991 3884955 NDARAA504CRN NDARAA947ZG5 NDARAB348EWR NDARAB458VK9 NDARAD481FXF NDARAV894XWD NDARCA186WGH 0025428 0025429 0025448 0025452 0025453
- preconfig: abcd-options
variant: ABCD-HCP
participant: 1019436 2014113 3154996 3699991 3884955 NDARAA504CRN NDARAA947ZG5 NDARAB348EWR NDARAB458VK9 NDARAD481FXF NDARAV894XWD NDARCA186WGH 0025428 0025429 0025448 0025452 0025453
- preconfig: fmriprep-options
variant: fMRIPrep-LTS
participant: 1019436 2014113 3154996 3699991 3884955 NDARAA504CRN NDARAA947ZG5 NDARAB348EWR NDARAB458VK9 NDARAD481FXF NDARAV894XWD NDARCA186WGH 0025428 0025429 0025448 0025452 0025453
steps:
- name: Get C-PAC
run: |
if [[ "${{ matrix.variant }}" != "" ]]
then
VARIANT=-${{ matrix.variant }}
fi
GITHUB_BRANCH=$(echo ${GITHUB_REF} | cut -d '/' -f 3-)
if [[ ! $GITHUB_BRANCH == 'main' ]] && [[ ! $GITHUB_BRANCH == 'develop' ]]
then
TAG=${GITHUB_BRANCH//\//_}
elif [[ $GITHUB_BRANCH == 'develop' ]]
then
TAG=nightly
elif [[ $GITHUB_BRANCH == 'main' ]]
then
TAG=latest
fi
TAG=$TAG$VARIANT
echo DOCKER_TAG=$(echo "ghcr.io/${{ github.repository }}" | tr '[:upper:]' '[:lower:]'):$TAG >> $GITHUB_ENV
cat $GITHUB_ENV
- name: Run default smoke test
if: ${{ matrix.preconfig == 'default' }}
run: |
mkdir outputs
docker run --rm \
--user $(id -u):$(id -g) -v /etc/passwd:/etc/passwd -v /etc/group:/etc/group \
-v $PWD/outputs:/outputs \
${{ env.DOCKER_TAG }} \
/outputs /outputs test_config \
--data_config_file /code/CPAC/resources/configs/test_configs/data-test_human.yml \
--participant_label ${{ matrix.participant }} \
--n_cpus 2
- name: Run ${{ matrix.preconfig }} smoke test
if: ${{ matrix.preconfig != 'default' }}
run: |
mkdir outputs
docker run --rm \
--user $(id -u):$(id -g) -v /etc/passwd:/etc/passwd -v /etc/group:/etc/group \
-v $PWD/outputs:/outputs \
${{ env.DOCKER_TAG }} \
/outputs /outputs test_config \
--data_config_file /code/CPAC/resources/configs/test_configs/data-test_human.yml \
--participant_label ${{ matrix.participant }} \
--preconfig ${{ matrix.preconfig }} \
--n_cpus 2
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: expectedOutputs human ${{ matrix.preconfig }} ${{ matrix.variant }} ${{ matrix.participant }}
path: outputs/log/pipeline_*/*/*_expectedOutputs.yml
if-no-files-found: ignore
smoke_test_nhp:
name: Non-human primate ${{ matrix.preconfig }} participant smoke tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
preconfig:
- monkey
- nhp-macaque
variant:
- ''
participant:
- 032102 032106 032164 032167 032130 032128 2215 2312 032191 032195
steps:
- name: Get C-PAC
run: |
if [[ "${{ matrix.variant }}" != "" ]]
then
VARIANT=-${{ matrix.variant }}
fi
GITHUB_BRANCH=$(echo ${GITHUB_REF} | cut -d '/' -f 3-)
if [[ ! $GITHUB_BRANCH == 'main' ]] && [[ ! $GITHUB_BRANCH == 'develop' ]]
then
TAG=${GITHUB_BRANCH//\//_}
elif [[ $GITHUB_BRANCH == 'develop' ]]
then
TAG=nightly
elif [[ $GITHUB_BRANCH == 'main' ]]
then
TAG=latest
fi
TAG=$TAG$VARIANT
echo DOCKER_TAG=$(echo "ghcr.io/${{ github.repository }}" | tr '[:upper:]' '[:lower:]'):$TAG >> $GITHUB_ENV
cat $GITHUB_ENV
- name: Set up datalad-OSF
run: |
git config --global user.email "[email protected]"
git config --global user.name "Theodore (Machine User)"
wget -O- http://neuro.debian.net/lists/focal.us-tn.libre | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
sudo apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com 0xA5D32F012649A5A9
sudo apt-get update
sudo apt-get install datalad git-annex-standalone
pip install datalad-osf
- name: Get NHP test data
run: |
datalad clone osf://xt93j test-data
- name: Run ${{ matrix.preconfig }} smoke test
run: |
mkdir outputs
docker run --rm \
--user $(id -u):$(id -g) -v /etc/passwd:/etc/passwd -v /etc/group:/etc/group \
-v $PWD/test-data:/test-data \
-v $PWD/outputs:/outputs \
${{ env.DOCKER_TAG }} \
/test-data /outputs test_config \
--preconfig ${{ matrix.preconfig }} \
--participant_label ${{ matrix.participant }} \
--n_cpus 2
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: expectedOutputs nhp ${{ matrix.preconfig }} ${{ matrix.variant }} ${{ matrix.participant }}
path: outputs/log/pipeline_*/*/*_expectedOutputs.yml
if-no-files-found: ignore
smoke_test_rodent:
name: Rodent participant smoke tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
variant:
- ''
steps:
- name: Get C-PAC
run: |
if [[ "${{ matrix.variant }}" != "" ]]
then
VARIANT=-${{ matrix.variant }}
fi
GITHUB_BRANCH=$(echo ${GITHUB_REF} | cut -d '/' -f 3-)
if [[ ! $GITHUB_BRANCH == 'main' ]] && [[ ! $GITHUB_BRANCH == 'develop' ]]
then
TAG=${GITHUB_BRANCH//\//_}
elif [[ $GITHUB_BRANCH == 'develop' ]]
then
TAG=nightly
elif [[ $GITHUB_BRANCH == 'main' ]]
then
TAG=latest
fi
TAG=$TAG$VARIANT
echo DOCKER_TAG=$(echo "ghcr.io/${{ github.repository }}" | tr '[:upper:]' '[:lower:]'):$TAG >> $GITHUB_ENV
cat $GITHUB_ENV
- name: Set up datalad-OSF
run: |
git config --global user.email "[email protected]"
git config --global user.name "Theodore (Machine User)"
wget -O- http://neuro.debian.net/lists/focal.us-tn.libre | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
sudo apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com 0xA5D32F012649A5A9
sudo apt-get update
sudo apt-get install datalad git-annex-standalone
pip install datalad-osf
- name: Get rodent test data
run: |
datalad clone osf://uya3r test-data
- name: Run rodent smoke test
run: |
mkdir outputs
docker run --rm \
--user $(id -u):$(id -g) -v /etc/passwd:/etc/passwd -v /etc/group:/etc/group \
-v $PWD/test-data:/test-data \
-v $PWD/outputs:/outputs \
${{ env.DOCKER_TAG }} \
/test-data /outputs test_config \
--preconfig rodent \
--n_cpus 2
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: expectedOutputs rodent ${{ matrix.variant }}
path: outputs/log/pipeline_*/*/*_expectedOutputs.yml
if-no-files-found: ignore