Skip to content

Commit

Permalink
Merge pull request #392 from Project-MONAI/dev
Browse files Browse the repository at this point in the history
merge master
  • Loading branch information
Nic-Ma authored Mar 24, 2022
2 parents f398298 + 7d8bb9b commit 25b443b
Show file tree
Hide file tree
Showing 886 changed files with 38,344 additions and 16,347 deletions.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Question
about: Question relating to MONAI
title: ''
name: Question (please use the Discussion tab)
about: https://github.com/Project-MONAI/MONAI/discussions
title: 'Please use MONAI Discussion tab for questions'
labels: ''
assignees: ''
---
Expand Down
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ A few sentences describing the changes proposed in this pull request.
- [ ] Breaking change (fix or new feature that would cause existing functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/` folder.
2 changes: 1 addition & 1 deletion .github/workflows/blossom-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

# This job only runs for pull request comments
if: |
contains( 'madil90,Nic-Ma,wyli,', format('{0},', github.actor)) &&
contains( 'Nic-Ma,wyli,pxLi,', format('{0},', github.actor)) &&
github.event.comment.body == '/build'
steps:
- name: Check if comment is issued by authorized person
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ dev, main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ dev ]
schedule:
- cron: '18 1 * * 0'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'cpp', 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
# - name: Autobuild
# uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

- name: Build
run: |
python -m pip install -r requirements-dev.txt
BUILD_MONAI=1 ./runtests.sh --build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
57 changes: 57 additions & 0 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: conda

on:
schedule:
- cron: "0 3 * * *" # at 03:00 UTC
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

concurrency:
# automatically cancel the previously triggered workflows when there's a newer version
group: conda-tests-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
cron-conda:
if: github.repository == 'Project-MONAI/MONAI'
strategy:
fail-fast: false
matrix:
os: [windows-latest, macOS-latest, ubuntu-latest]
python-version: ["3.7"]
runs-on: ${{ matrix.os }}
env:
QUICKTEST: True
steps:
- if: runner.os == 'windows'
name: Config pagefile (Windows only)
uses: al-cheb/configure-pagefile-action@v1.2
with:
minimum-size: 8
maximum-size: 16
disk-root: "D:"
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Install env (CPU ${{ runner.os }})
shell: bash -l {0}
run: |
conda info
conda list
conda env create --file environment-dev.yml
- if: runner.os == 'windows'
name: Windows only install
shell: bash -l {0}
run: |
conda activate monai
# this `cpuonly` and -c conda-forge is needed to reduce the paging file size on a github instance
conda install pytorch torchvision torchaudio cpuonly -c pytorch -c conda-forge
conda deactivate
- name: Test env(CPU ${{ runner.os }})
shell: bash -l {0}
run: |
conda activate monai
$(pwd)/runtests.sh --build --unittests
conda deactivate
42 changes: 42 additions & 0 deletions .github/workflows/cron-mmar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: cron-mmar

on:
schedule:
- cron: "0 2 * * *" # at 02:00 UTC
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

concurrency:
# automatically cancel the previously triggered workflows when there's a newer version
group: mmar-tests-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
cron-load:
if: github.repository == 'Project-MONAI/MONAI'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: cache weekly timestamp
id: pip-cache
run: echo "::set-output name=datew::$(date '+%Y-%V')"
- name: cache for pip
uses: actions/cache@v2
id: cache
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r requirements-dev.txt
- name: Loading MMARs
run: |
# clean up temporary files
$(pwd)/runtests.sh --build --clean
# run tests
python -m tests.ngc_mmar_loading
32 changes: 17 additions & 15 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
cron-gpu:
if: github.repository == 'Project-MONAI/MONAI'
container:
image: nvcr.io/nvidia/pytorch:20.03-py3 # CUDA 10.2
image: nvcr.io/nvidia/pytorch:21.06-py3 # CUDA 11.3
options: "--gpus all"
runs-on: [self-hosted, linux, x64, common]
strategy:
matrix:
pytorch-version: [1.5.1, 1.6.0, 1.7.1, 1.8.1, latest]
pytorch-version: [1.6.0, 1.7.1, 1.8.1, 1.9.1, latest]
steps:
- uses: actions/checkout@v2
- name: Install the dependencies
Expand All @@ -25,14 +25,14 @@ jobs:
python -m pip uninstall -y torch torchvision
if [ ${{ matrix.pytorch-version }} == "latest" ]; then
python -m pip install torch torchvision
elif [ ${{ matrix.pytorch-version }} == "1.5.1" ]; then
python -m pip install torch==1.5.1 torchvision==0.6.1
elif [ ${{ matrix.pytorch-version }} == "1.6.0" ]; then
python -m pip install torch==1.6.0 torchvision==0.7.0
elif [ ${{ matrix.pytorch-version }} == "1.7.1" ]; then
python -m pip install torch==1.7.1 torchvision==0.8.2
elif [ ${{ matrix.pytorch-version }} == "1.8.1" ]; then
python -m pip install torch==1.8.1 torchvision==0.9.1
elif [ ${{ matrix.pytorch-version }} == "1.9.1" ]; then
python -m pip install torch==1.9.1 torchvision==0.10.1
fi
python -m pip install -r requirements-dev.txt
python -m pip list
Expand All @@ -48,8 +48,8 @@ jobs:
python -c $'import torch\na,b=torch.zeros(1,device="cuda:0"),torch.zeros(1,device="cuda:1");\nwhile True:print(a,b)' > /dev/null &
python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
python -c 'import torch; print(torch.rand(5, 3, device=torch.device("cuda:0")))'
BUILD_MONAI=1 ./runtests.sh --coverage --unittests # unit tests with coverage report
BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report
BUILD_MONAI=1 ./runtests.sh --build --coverage --unittests --disttests # unit tests with coverage report
BUILD_MONAI=1 ./runtests.sh --build --coverage --net # integration tests with coverage report
coverage xml
if pgrep python; then pkill python; fi
- name: Upload coverage
Expand All @@ -62,7 +62,7 @@ jobs:
if: github.repository == 'Project-MONAI/MONAI'
strategy:
matrix:
container: ["pytorch:21.02", "pytorch:21.08"] # 21.02 for backward comp.
container: ["pytorch:21.02", "pytorch:22.02"] # 21.02 for backward comp.
container:
image: nvcr.io/nvidia/${{ matrix.container }}-py3 # testing with the latest pytorch base image
options: "--gpus all"
Expand Down Expand Up @@ -91,8 +91,8 @@ jobs:
python -c $'import torch\na,b=torch.zeros(1,device="cuda:0"),torch.zeros(1,device="cuda:1");\nwhile True:print(a,b)' > /dev/null &
python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
python -c 'import torch; print(torch.rand(5, 3, device=torch.device("cuda:0")))'
BUILD_MONAI=1 ./runtests.sh --coverage --unittests # unit tests with coverage report
BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report
BUILD_MONAI=1 ./runtests.sh --build --coverage --unittests --disttests # unit tests with coverage report
BUILD_MONAI=1 ./runtests.sh --build --coverage --net # integration tests with coverage report
coverage xml
if pgrep python; then pkill python; fi
- name: Upload coverage
Expand All @@ -106,7 +106,7 @@ jobs:
if: github.repository == 'Project-MONAI/MONAI'
strategy:
matrix:
container: ["pytorch:21.02", "pytorch:21.08"] # 21.02 for backward comp.
container: ["pytorch:21.02", "pytorch:22.02"] # 21.02 for backward comp.
container:
image: nvcr.io/nvidia/${{ matrix.container }}-py3 # testing with the latest pytorch base image
options: "--gpus all"
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
cron-docker:
if: github.repository == 'Project-MONAI/MONAI'
container:
image: localhost:5000/local_monai:dockerhub # use currently latest, locally available dockerhub image
image: docker://projectmonai/monai:latest # this might be slow and has the pull count limitations
options: "--gpus all"
runs-on: [self-hosted, linux, x64, common]
steps:
Expand All @@ -190,8 +190,8 @@ jobs:
python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
python -c 'import torch; print(torch.rand(5,3, device=torch.device("cuda:0")))'
ngc --version
BUILD_MONAI=1 ./runtests.sh --coverage --pytype --unittests # unit tests with pytype checks, coverage report
BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report
BUILD_MONAI=1 ./runtests.sh --build --coverage --pytype --unittests --disttests # unit tests with pytype checks, coverage report
BUILD_MONAI=1 ./runtests.sh --build --coverage --net # integration tests with coverage report
coverage xml
if pgrep python; then pkill python; fi
- name: Upload coverage
Expand All @@ -204,7 +204,7 @@ jobs:
if: github.repository == 'Project-MONAI/MONAI'
needs: cron-gpu # so that monai itself is verified first
container:
image: nvcr.io/nvidia/pytorch:21.08-py3 # testing with the latest pytorch base image
image: nvcr.io/nvidia/pytorch:21.09-py3 # testing with the latest pytorch base image
options: "--gpus all --ipc=host"
runs-on: [self-hosted, linux, x64, common]
steps:
Expand All @@ -215,7 +215,7 @@ jobs:
which python
python -m pip install --upgrade pip wheel
python -m pip install -r requirements-dev.txt
BUILD_MONAI=0 python setup.py develop # install monai
BUILD_MONAI=1 python setup.py develop # install monai
nvidia-smi
export CUDA_VISIBLE_DEVICES=$(python -m tests.utils)
echo $CUDA_VISIBLE_DEVICES
Expand All @@ -234,5 +234,7 @@ jobs:
trap 'if pgrep python; then pkill python; fi;' ERR
python -c $'import torch\na,b=torch.zeros(1,device="cuda:0"),torch.zeros(1,device="cuda:1");\nwhile True:print(a,b)' > /dev/null &
cd /opt/tutorials
python -c 'import monai; monai.config.print_debug_info()'
$(pwd)/runner.sh
python -c 'import monai; monai.config.print_debug_info()'
if pgrep python; then pkill python; fi
Loading

0 comments on commit 25b443b

Please sign in to comment.