forked from Deep-MI/FastSurfer
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (92 loc) · 2.98 KB
/
quicktest.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: quicktest
on:
pull_request:
workflow_dispatch:
jobs:
# Checkout repo
checkout:
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
# Prepare job: Set up Python, Go, Singularity
prepare-job:
runs-on: self-hosted
needs: checkout
steps:
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '^1.13.1' # The Go version to download (if necessary) and use.
- name: Set up Singularity
uses: eWaterCycle/setup-singularity@v7
with:
singularity-version: 3.8.3
# Build Docker Image and convert it to Singularity
build-singularity-image:
runs-on: self-hosted
needs: prepare-job
steps:
- name: Build Docker Image and convert to Singularity
run: |
cd $RUNNER_SINGULARITY_IMGS
FILE="fastsurfer-gpu.sif"
if [ ! -f "$FILE" ]; then
# If the file does not exist, build the file
echo "SIF File does not exist. Building file."
PYTHONPATH=$PYTHONPATH
cd $PYTHONPATH
python3 Docker/build.py --device cuda --tag fastsurfer_gpu:cuda
cd $RUNNER_SINGULARITY_IMGS
singularity build --force fastsurfer-gpu.sif docker-daemon://fastsurfer_gpu:cuda
else
echo "File already exists"
cd $PYTHONPATH
fi
# Run FastSurfer on MRI data
run-fastsurfer:
runs-on: self-hosted
needs: build-singularity-image
steps:
- name: Run FastSurfer
run: |
singularity exec --nv \
--no-home \
--bind $GITHUB_WORKSPACE:/fastsurfer-dev \
--env FASTSURFER_HOME=/fastsurfer-dev \
-B $RUNNER_FS_MRI_DATA:/data \
-B $RUNNER_FS_OUTPUT:/output \
-B $RUNNER_FS_LICENSE:/fs_license \
$RUNNER_SINGULARITY_IMGS/fastsurfer-gpu.sif \
/fastsurfer/run_fastsurfer.sh \
--fs_license /fs_license/.license \
--t1 /data/subjectx/orig.mgz \
--sid subjectX --sd /output \
--parallel --3T
# Test file existence
test-file-existence:
runs-on: self-hosted
needs: run-fastsurfer
steps:
- name: Test File Existence
run: |
python3 test/quick_test/test_file_existence.py $RUNNER_FS_OUTPUT_FILES
# Test for errors in log files
test-error-messages:
runs-on: self-hosted
needs: [run-fastsurfer, test-file-existence]
steps:
- name: Test Log Files For Error Messages
run: |
python3 test/quick_test/test_errors.py $RUNNER_FS_OUTPUT_LOGS
# Test seg_stats
test-seg-stats:
runs-on: self-hosted
needs: [run-fastsurfer, test-file-existence, test-error-messages]
steps:
- name: Test seg_stats
run: |
python3 test/quick_test/test_stats.py $RUNNER_FS_REF_STATS $RUNNER_FS_OUTPUT_STATS