From cf033ef2206816bcbefd1361bbdd329f6e109b07 Mon Sep 17 00:00:00 2001 From: Tom Birdsong Date: Mon, 9 May 2022 14:40:18 -0400 Subject: [PATCH 1/4] ENH: Add notebook CI --- .github/workflows/test-notebooks.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/test-notebooks.yml diff --git a/.github/workflows/test-notebooks.yml b/.github/workflows/test-notebooks.yml new file mode 100644 index 0000000..a3282f7 --- /dev/null +++ b/.github/workflows/test-notebooks.yml @@ -0,0 +1,28 @@ +name: Notebook tests + +on: [push, pull_request] + +jobs: + nbmake: + runs-on: ${{ matrix.os }} + name: Test notebooks with nbmake + strategy: + max-parallel: 5 + matrix: + os: [windows-2019, ubuntu-latest] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v3 + with: + python-version: '3.10' + - name: Install test dependencies + run: | + python3 --version + python3 -m pip install --upgrade pip + python3 -m pip install itk-vkfft pytest nbmake + python3 -m pip list + python3 -c "import itk; itk.auto_progress(2); print(itk.VkForwardFFTImageFilter.values())" + - name: Test notebooks + run: | + pytest --nbmake --nbmake-timeout=3000 example/*ipynb From 5be38f34552e445d78b5ef3b0c819655f4343e00 Mon Sep 17 00:00:00 2001 From: Tom Birdsong Date: Mon, 9 May 2022 15:33:15 -0400 Subject: [PATCH 2/4] BUG: Notebook fixups --- .github/workflows/test-notebooks.yml | 2 +- example/FFTConvolutionOverRegionOfInterest.ipynb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-notebooks.yml b/.github/workflows/test-notebooks.yml index a3282f7..dbc4fbb 100644 --- a/.github/workflows/test-notebooks.yml +++ b/.github/workflows/test-notebooks.yml @@ -20,7 +20,7 @@ jobs: run: | python3 --version python3 -m pip install --upgrade pip - python3 -m pip install itk-vkfft pytest nbmake + python3 -m pip install itk-vkfft tqdm pytest nbmake python3 -m pip list python3 -c "import itk; itk.auto_progress(2); print(itk.VkForwardFFTImageFilter.values())" - name: Test notebooks diff --git a/example/FFTConvolutionOverRegionOfInterest.ipynb b/example/FFTConvolutionOverRegionOfInterest.ipynb index b62e21f..2b005d1 100644 --- a/example/FFTConvolutionOverRegionOfInterest.ipynb +++ b/example/FFTConvolutionOverRegionOfInterest.ipynb @@ -651,9 +651,9 @@ ], "metadata": { "kernelspec": { - "display_name": "itk-unstable", + "display_name": "Python 3", "language": "python", - "name": "venv-itk5" + "name": "python3" }, "language_info": { "codemirror_mode": { From be7c1afab94dd1783ebf6e822d1be809a43acd04 Mon Sep 17 00:00:00 2001 From: Tom Birdsong Date: Mon, 9 May 2022 16:51:52 -0400 Subject: [PATCH 3/4] WIP: Run notebooks on ubuntu --- .github/workflows/test-notebooks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-notebooks.yml b/.github/workflows/test-notebooks.yml index dbc4fbb..31cf90f 100644 --- a/.github/workflows/test-notebooks.yml +++ b/.github/workflows/test-notebooks.yml @@ -9,7 +9,7 @@ jobs: strategy: max-parallel: 5 matrix: - os: [windows-2019, ubuntu-latest] + os: [ubuntu-latest] steps: - uses: actions/checkout@v2 From b37fb56d01352bb282b3d86362300c194f4d509c Mon Sep 17 00:00:00 2001 From: Tom Birdsong Date: Mon, 9 May 2022 17:07:06 -0400 Subject: [PATCH 4/4] WIP: Try running notebook tests on AWS GPU instances --- .cirun.yml | 17 +++++++++++++++++ .github/workflows/test-notebooks.yml | 13 +++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.cirun.yml b/.cirun.yml index f2a3e38..f3605fd 100644 --- a/.cirun.yml +++ b/.cirun.yml @@ -17,3 +17,20 @@ runners: # Add a label to match runs-on param in Github Actions yml files labels: - gpu + + - name: notebook-gpu-runner + # Cloud Provider: Amazon Web Services + cloud: aws + # NVIDIA GPU + instance_type: g4dn.xlarge + # Custom-defined Ubuntu AMI with AMD drivers and build tools pre-installed + machine_image: ami-0328487742df7e739 + region: us-east-2 + preemptible: false + # Relevant workflow file + workflow: .github/workflows/test-notebooks.yml + # Provision 1 runner for ubuntu testing for now + count: 1 + # Add a label to match runs-on param in Github Actions yml files + labels: + - notebook-gpu diff --git a/.github/workflows/test-notebooks.yml b/.github/workflows/test-notebooks.yml index 31cf90f..772a7a5 100644 --- a/.github/workflows/test-notebooks.yml +++ b/.github/workflows/test-notebooks.yml @@ -4,18 +4,23 @@ on: [push, pull_request] jobs: nbmake: - runs-on: ${{ matrix.os }} + runs-on: [self-hosted, notebook-gpu] name: Test notebooks with nbmake strategy: - max-parallel: 5 - matrix: - os: [ubuntu-latest] + max-parallel: 3 steps: + - name: Check OpenCL Devices + run: | + clinfo + if [ $(clinfo | grep "Number of devices" | awk '{print $4}') == "0" ]; then echo "Could not find OpenCL devices" && exit 1; fi + shell: bash + - uses: actions/checkout@v2 - uses: actions/setup-python@v3 with: python-version: '3.10' + - name: Install test dependencies run: | python3 --version