Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INFRA] Run DWI non regression tests with GitHub actions #989

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: DWI Preprocessing Using Phase Diff Pipelines Tests

on:
push:
branches: [dev]
pull_request:
branches: [dev]

permissions:
contents: read

concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

env:
POETRY_VERSION: '1.6.1'
PYTHON_VERSION: '3.10'

jobs:
test-pipelines-dwi-preprocessing-using-phase-diff-MacOS:
runs-on:
- self-hosted
- macOS
- aramis
timeout-minutes: 720
steps:
- uses: actions/checkout@v4
- uses: snok/install-poetry@v1
- name: Run tests for dwi preprocessing using phase diff pipeline
run: ./scripts/run_nonregression.sh
env:
TEST: dwi/preprocessing/using_phase_diff
MODALITY: dwi_preprocessing_using_phase_diff
WORKSPACE: ${{ github.workspace }}

test-pipelines-dwi-preprocessing-using-phase-diff-Linux:
runs-on:
- self-hosted
- Linux
timeout-minutes: 720
steps:
- uses: actions/checkout@v4
- uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: false
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: poetry
- name: Run tests for dwi preprocessing using phase diff pipeline
run: ./scripts/run_nonregression.sh
env:
TEST: dwi/preprocessing/using_phase_diff
MODALITY: dwi_preprocessing_using_phase_diff
WORKSPACE: ${{ github.workspace }}
56 changes: 56 additions & 0 deletions .github/workflows/test_pipelines_dwi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: DWI Pipelines Tests

on:
push:
branches: [dev]
pull_request:
branches: [dev]

permissions:
contents: read

concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

env:
POETRY_VERSION: '1.6.1'
PYTHON_VERSION: '3.10'

jobs:
test-pipelines-dwi-MacOS:
runs-on:
- self-hosted
- macOS
timeout-minutes: 720
steps:
- uses: actions/checkout@v4
- uses: snok/install-poetry@v1
- name: Run tests for dwi pipelines
run: ./scripts/run_nonregression.sh
env:
TEST: dwi/test_pipelines.py
MODALITY: dwi_pipelines
WORKSPACE: ${{ github.workspace }}

test-pipelines-dwi-Linux:
runs-on:
- self-hosted
- Linux
timeout-minutes: 720
steps:
- uses: actions/checkout@v4
- uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: false
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: poetry
- name: Run tests for dwi pipelines
run: ./scripts/run_nonregression.sh
env:
TEST: dwi/test_pipelines.py
MODALITY: dwi_pipelines
WORKSPACE: ${{ github.workspace }}
57 changes: 57 additions & 0 deletions .github/workflows/test_pipelines_dwi_preprocessing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: DWI Preprocessing Using T1 Pipelines Tests

on:
push:
branches: [dev]
pull_request:
branches: [dev]

permissions:
contents: read

concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

env:
POETRY_VERSION: '1.6.1'
PYTHON_VERSION: '3.10'

jobs:
test-pipelines-dwi-preprocessing-using-t1-MacOS:
runs-on:
- self-hosted
- macOS
- aramis
timeout-minutes: 720
steps:
- uses: actions/checkout@v4
- uses: snok/install-poetry@v1
- name: Run tests for dwi preprocessing using t1 pipeline
run: ./scripts/run_nonregression.sh
env:
TEST: dwi/preprocessing/using_t1
MODALITY: dwi_preprocessing_using_t1
WORKSPACE: ${{ github.workspace }}

test-pipelines-dwi-preprocessing-using-t1-Linux:
runs-on:
- self-hosted
- Linux
timeout-minutes: 720
steps:
- uses: actions/checkout@v4
- uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: false
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: poetry
- name: Run tests for dwi preprocessing using t1 pipeline
run: ./scripts/run_nonregression.sh
env:
TEST: dwi/preprocessing/using_t1
MODALITY: dwi_preprocessing_using_t1
WORKSPACE: ${{ github.workspace }}
2 changes: 1 addition & 1 deletion .jenkins/nonregression_fast.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ pipeline {
--timeout=0 \
-n 4 \
-m "not slow" \
./nonregression/pipelines/test_run_pipelines_dwi.py
./nonregression/pipelines/dwi
'''
}
post {
Expand Down
4 changes: 2 additions & 2 deletions .jenkins/nonregression_slow.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ pipeline {
--timeout=0 \
-n 4 \
-m "slow" \
./nonregression/pipelines/test_run_pipelines_dwi.py
./nonregression/pipelines/dwi
'''
}
}
Expand Down Expand Up @@ -460,7 +460,7 @@ pipeline {
--timeout=0 \
-n 4 \
-m "slow" \
./nonregression/pipelines/test_run_pipelines_dwi.py
./nonregression/pipelines/dwi
'''
}
post {
Expand Down
3 changes: 3 additions & 0 deletions clinica/pipelines/dwi_dti/dwi_dti_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
@cli_param.option.subjects_sessions_tsv
@cli_param.option.working_directory
@cli_param.option.n_procs
@cli_param.option.random_seed
def cli(
caps_directory: str,
subjects_sessions_tsv: Optional[str] = None,
working_directory: Optional[str] = None,
n_procs: Optional[int] = None,
random_seed: Optional[int] = None,
) -> None:
"""DTI-based processing of DWI datasets.

Expand All @@ -36,6 +38,7 @@ def cli(
tsv_file=subjects_sessions_tsv,
base_dir=working_directory,
name=pipeline_name,
parameters={"random_seed": random_seed},
)

exec_pipeline = (
Expand Down
3 changes: 3 additions & 0 deletions clinica/pipelines/dwi_dti/dwi_dti_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class DwiDti(cpe.Pipeline):

def check_pipeline_parameters(self):
"""Check pipeline parameters."""
self.parameters.setdefault("random_seed", None)

def check_custom_dependencies(self):
pass
Expand Down Expand Up @@ -264,6 +265,8 @@ def build_core_nodes(self):
dti_to_metrics = npe.Node(interface=TensorMetrics(), name="2-DTI-based_Metrics")

register_fa = npe.Node(interface=RegistrationSynQuick(), name="3a-Register_FA")
if self.parameters["random_seed"] is not None:
register_fa.inputs.random_seed = self.parameters["random_seed"]
fsl_dir = check_environment_variable("FSLDIR", "FSL")
fa_map = os.path.join(
fsl_dir, "data", "atlases", "JHU", "JHU-ICBM-FA-1mm.nii.gz"
Expand Down
Loading