Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
dkuegler authored Mar 28, 2024
1 parent 8bcccfa commit 31842db
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/QUICKTEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This job sets up the necessary environments for the workflow. It depends on the

### Build Singularity Image

This job builds a Docker image and converts it to a Singularity image. It depends on the successful completion of the `prepare-job`. The Docker image is built using a Python script `Docker/build.py` with the `--device cuda --dry_run --tag fastsurfer_gpu:cuda` flags. The Docker image is then converted to a Singularity image.
This job builds a Docker image and converts it to a Singularity image. It depends on the successful completion of the `prepare-job`. The Docker image is built using a Python script `Docker/build.py` with the `--device cuda --tag fastsurfer_gpu:cuda` flags. The Docker image is then converted to a Singularity image.

### Run FastSurfer

Expand All @@ -41,17 +41,18 @@ This job tests for errors in log files after running FastSurfer. It runs on a se
To use this workflow, you need to have a self-hosted runner labeled `ci-gpu` set up on your machine. You also need to update the environment variables of the runner, by going to `/home/your_runner/.env` file and adding the following environment variables with the actual paths you want to use.


RUNNER_FS_MRI_DATA: Path to MRI Data
### Environment variables
`RUNNER_FS_MRI_DATA`: Path to MRI Data

RUNNER_FS_OUTPUT: Path to Output directory
`RUNNER_FS_OUTPUT`: Path to Output directory

RUNNER_FS_LICENSE: Path to License directory
`RUNNER_FS_LICENSE`: Path to License directory

RUNNER_SINGULARITY_IMGS: Path to where Singularity images should be stored
`RUNNER_SINGULARITY_IMGS`: Path to where Singularity images should be stored

RUNNER_FS_OUTPUT_FILES: Path to output files to be tested
`RUNNER_FS_OUTPUT_FILES`: Path to output files to be tested

RUNNER_FS_OUTPUT_LOGS: Path to output log files to check for errors
`RUNNER_FS_OUTPUT_LOGS`: Path to output log files to check for errors


Once everything is set up, you can trigger the workflow manually from the GitHub Actions tab in your repository, as well as by pushing code to the repository.
2 changes: 1 addition & 1 deletion .github/workflows/quicktest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
echo "SIF File does not exist. Building file."
PYTHONPATH=$PYTHONPATH
cd $PYTHONPATH
python3 Docker/build.py --device cuda --dry_run --tag fastsurfer_gpu:cuda | bash
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
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/BUILD.info
/.idea/**
/rough_work/**
/rough_work/**
2 changes: 1 addition & 1 deletion test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
'test_file_existence',
'test_error_messages',
'test_errors'
]
]
5 changes: 1 addition & 4 deletions test/quick_test/test_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ def test_find_errors_in_logs(self):
if any(error in line.lower() for error in self.errors):
if not any(white in line.lower() for white in self.whitelist):
# Get two lines before and after the current line
context = []
for i in range(-3, 2):
if 0 <= line_number + i < len(lines):
context.append(lines[line_number + i])
context = lines[max(0, line_number-2):min(len(lines), line_number+3)]
lines_with_errors.append((line_number, context))
print(lines_with_errors)
files_with_errors[rel_path] = lines_with_errors
Expand Down

0 comments on commit 31842db

Please sign in to comment.