From b95b7b713d379f269ca854e32b1371d10ae56c78 Mon Sep 17 00:00:00 2001 From: Richard Brown <33289025+rijobro@users.noreply.github.com> Date: Tue, 16 Mar 2021 16:42:21 +0000 Subject: [PATCH 01/12] cron tutorial notebooks Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> --- .github/workflows/cron.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 90abb5d7e4..c35aad8ed2 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -128,3 +128,26 @@ jobs: with: fail_ci_if_error: false file: ./coverage.xml + + cron-tutorial-notebooks: + if: github.repository == 'Project-MONAI/MONAI' + container: + image: nvcr.io/nvidia/pytorch:21.02-py3 # testing with the latest pytorch base image + options: "--gpus all" + runs-on: [self-hosted, linux, x64, common] + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: | + which python + python -m pip install --upgrade pip wheel + python -m pip install ${{ matrix.pytorch }} + python -m pip install -r requirements-dev.txt + - name: Checkout tutorials and install their requirements + run: | + git clone https://github.com/Project-MONAI/tutorials.git + cd tutorials + python -m pip install -r requirements.txt + - name: Run tutorial notebooks + run: | + sh ./runtests.sh From e327d0a3541893694f85f9295f8720ee9d181ee0 Mon Sep 17 00:00:00 2001 From: Richard Brown <33289025+rijobro@users.noreply.github.com> Date: Tue, 16 Mar 2021 17:30:42 +0000 Subject: [PATCH 02/12] update script name Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> --- .github/workflows/cron.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index c35aad8ed2..9162227606 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -150,4 +150,4 @@ jobs: python -m pip install -r requirements.txt - name: Run tutorial notebooks run: | - sh ./runtests.sh + $(pwd)/runner.sh From 3e26957e14ea05182d267c240c99248358844326 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Tue, 16 Mar 2021 18:51:55 +0000 Subject: [PATCH 03/12] revise cmds Signed-off-by: Wenqi Li --- .github/workflows/cron.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 9162227606..cea33e5601 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -137,17 +137,22 @@ jobs: runs-on: [self-hosted, linux, x64, common] steps: - uses: actions/checkout@v2 - - name: Install dependencies + - name: Install MONAI run: | which python python -m pip install --upgrade pip wheel - python -m pip install ${{ matrix.pytorch }} python -m pip install -r requirements-dev.txt + BUILD_MONAI=0 python setup.py develop # install monai - name: Checkout tutorials and install their requirements run: | - git clone https://github.com/Project-MONAI/tutorials.git + nvidia-smi + export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) + echo $CUDA_VISIBLE_DEVICES + cd /opt + git clone --depth 1 https://github.com/Project-MONAI/tutorials.git # latest commit cd tutorials python -m pip install -r requirements.txt - name: Run tutorial notebooks run: | + cd /opt/tutorials $(pwd)/runner.sh From dcc6656054a141504080fd5e4f70b019f50aa14a Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Tue, 16 Mar 2021 18:54:12 +0000 Subject: [PATCH 04/12] temp tests Signed-off-by: Wenqi Li --- .github/workflows/cron.yml | 253 +++++++++++++++++++------------------ 1 file changed, 128 insertions(+), 125 deletions(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index cea33e5601..58a900ca40 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -1,133 +1,136 @@ name: crons on: - schedule: - - cron: "0 2 * * *" # at 02:00 UTC +# schedule: +# - cron: "0 2 * * *" # at 02:00 UTC + push: + branches: + - cron_tutorials jobs: - cron-gpu: - if: github.repository == 'Project-MONAI/MONAI' - container: - image: nvcr.io/nvidia/pytorch:20.03-py3 # CUDA 10.2 - options: "--gpus all" - runs-on: [self-hosted, linux, x64, common] - strategy: - matrix: - pytorch-version: [1.5.1, 1.6.0, 1.7.1, latest] - steps: - - uses: actions/checkout@v2 - - name: Install the dependencies - run: | - which python - python -m pip install --upgrade pip wheel - 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 - fi - python -m pip install -r requirements-dev.txt - python -m pip list - - name: Run tests report coverage - run: | - export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ] - echo "Sleep $LAUNCH_DELAY" - sleep $LAUNCH_DELAY - nvidia-smi - export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) - echo $CUDA_VISIBLE_DEVICES - stop_time=$((LAUNCH_DELAY + $(date +%s))) - while [ $(date +%s) -lt $stop_time ]; do - python -c 'import torch; torch.rand(5, 3, device=torch.device("cuda:0"))'; - done - 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 - export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) - echo $CUDA_VISIBLE_DEVICES - BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report - coverage xml - - name: Upload coverage - uses: codecov/codecov-action@v1 - with: - fail_ci_if_error: false - file: ./coverage.xml - - cron-pt-image: - if: github.repository == 'Project-MONAI/MONAI' - container: - image: nvcr.io/nvidia/pytorch:21.02-py3 # testing with the latest pytorch base image - options: "--gpus all" - runs-on: [self-hosted, linux, x64, common] - steps: - - uses: actions/checkout@v2 - - name: Install APT dependencies - run: | - apt-get update - DEBIAN_FRONTEND="noninteractive" apt-get install -y libopenslide0 - - name: Install Python dependencies - run: | - which python - python -m pip install --upgrade pip wheel - python -m pip install -r requirements-dev.txt - python -m pip list - - name: Run tests report coverage - run: | - export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ] - echo "Sleep $LAUNCH_DELAY" - sleep $LAUNCH_DELAY - nvidia-smi - export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) - echo $CUDA_VISIBLE_DEVICES - stop_time=$((LAUNCH_DELAY + $(date +%s))) - while [ $(date +%s) -lt $stop_time ]; do - python -c 'import torch; torch.rand(5, 3, device=torch.device("cuda:0"))'; - done - 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 - export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) - echo $CUDA_VISIBLE_DEVICES - BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report - coverage xml - - name: Upload coverage - uses: codecov/codecov-action@v1 - with: - fail_ci_if_error: false - file: ./coverage.xml - - cron-docker: - if: github.repository == 'Project-MONAI/MONAI' - container: - image: localhost:5000/local_monai:dockerhub # use currently latest, locally available dockerhub image - options: "--gpus all" - runs-on: [self-hosted, linux, x64, common] - steps: - - name: Run tests report coverage - # The docker image process has done the compilation. - # BUILD_MONAI=1 is necessary for triggering the USE_COMPILED flag. - run: | - cd /opt/monai - nvidia-smi - export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) - echo $CUDA_VISIBLE_DEVICES - 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 - export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) - echo $CUDA_VISIBLE_DEVICES - BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report - coverage xml - - name: Upload coverage - uses: codecov/codecov-action@v1 - with: - fail_ci_if_error: false - file: ./coverage.xml +# cron-gpu: +# if: github.repository == 'Project-MONAI/MONAI' +# container: +# image: nvcr.io/nvidia/pytorch:20.03-py3 # CUDA 10.2 +# options: "--gpus all" +# runs-on: [self-hosted, linux, x64, common] +# strategy: +# matrix: +# pytorch-version: [1.5.1, 1.6.0, 1.7.1, latest] +# steps: +# - uses: actions/checkout@v2 +# - name: Install the dependencies +# run: | +# which python +# python -m pip install --upgrade pip wheel +# 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 +# fi +# python -m pip install -r requirements-dev.txt +# python -m pip list +# - name: Run tests report coverage +# run: | +# export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ] +# echo "Sleep $LAUNCH_DELAY" +# sleep $LAUNCH_DELAY +# nvidia-smi +# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) +# echo $CUDA_VISIBLE_DEVICES +# stop_time=$((LAUNCH_DELAY + $(date +%s))) +# while [ $(date +%s) -lt $stop_time ]; do +# python -c 'import torch; torch.rand(5, 3, device=torch.device("cuda:0"))'; +# done +# 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 +# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) +# echo $CUDA_VISIBLE_DEVICES +# BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report +# coverage xml +# - name: Upload coverage +# uses: codecov/codecov-action@v1 +# with: +# fail_ci_if_error: false +# file: ./coverage.xml +# +# cron-pt-image: +# if: github.repository == 'Project-MONAI/MONAI' +# container: +# image: nvcr.io/nvidia/pytorch:21.02-py3 # testing with the latest pytorch base image +# options: "--gpus all" +# runs-on: [self-hosted, linux, x64, common] +# steps: +# - uses: actions/checkout@v2 +# - name: Install APT dependencies +# run: | +# apt-get update +# DEBIAN_FRONTEND="noninteractive" apt-get install -y libopenslide0 +# - name: Install Python dependencies +# run: | +# which python +# python -m pip install --upgrade pip wheel +# python -m pip install -r requirements-dev.txt +# python -m pip list +# - name: Run tests report coverage +# run: | +# export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ] +# echo "Sleep $LAUNCH_DELAY" +# sleep $LAUNCH_DELAY +# nvidia-smi +# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) +# echo $CUDA_VISIBLE_DEVICES +# stop_time=$((LAUNCH_DELAY + $(date +%s))) +# while [ $(date +%s) -lt $stop_time ]; do +# python -c 'import torch; torch.rand(5, 3, device=torch.device("cuda:0"))'; +# done +# 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 +# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) +# echo $CUDA_VISIBLE_DEVICES +# BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report +# coverage xml +# - name: Upload coverage +# uses: codecov/codecov-action@v1 +# with: +# fail_ci_if_error: false +# file: ./coverage.xml +# +# cron-docker: +# if: github.repository == 'Project-MONAI/MONAI' +# container: +# image: localhost:5000/local_monai:dockerhub # use currently latest, locally available dockerhub image +# options: "--gpus all" +# runs-on: [self-hosted, linux, x64, common] +# steps: +# - name: Run tests report coverage +# # The docker image process has done the compilation. +# # BUILD_MONAI=1 is necessary for triggering the USE_COMPILED flag. +# run: | +# cd /opt/monai +# nvidia-smi +# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) +# echo $CUDA_VISIBLE_DEVICES +# 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 +# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) +# echo $CUDA_VISIBLE_DEVICES +# BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report +# coverage xml +# - name: Upload coverage +# uses: codecov/codecov-action@v1 +# with: +# fail_ci_if_error: false +# file: ./coverage.xml cron-tutorial-notebooks: if: github.repository == 'Project-MONAI/MONAI' From 7303b610c4e4d7b431685383284bcc33068763a5 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Tue, 16 Mar 2021 21:24:46 +0000 Subject: [PATCH 05/12] Revert "temp tests" This reverts commit dcc6656054a141504080fd5e4f70b019f50aa14a. Signed-off-by: Wenqi Li --- .github/workflows/cron.yml | 253 ++++++++++++++++++------------------- 1 file changed, 125 insertions(+), 128 deletions(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 58a900ca40..cea33e5601 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -1,136 +1,133 @@ name: crons on: -# schedule: -# - cron: "0 2 * * *" # at 02:00 UTC - push: - branches: - - cron_tutorials + schedule: + - cron: "0 2 * * *" # at 02:00 UTC jobs: -# cron-gpu: -# if: github.repository == 'Project-MONAI/MONAI' -# container: -# image: nvcr.io/nvidia/pytorch:20.03-py3 # CUDA 10.2 -# options: "--gpus all" -# runs-on: [self-hosted, linux, x64, common] -# strategy: -# matrix: -# pytorch-version: [1.5.1, 1.6.0, 1.7.1, latest] -# steps: -# - uses: actions/checkout@v2 -# - name: Install the dependencies -# run: | -# which python -# python -m pip install --upgrade pip wheel -# 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 -# fi -# python -m pip install -r requirements-dev.txt -# python -m pip list -# - name: Run tests report coverage -# run: | -# export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ] -# echo "Sleep $LAUNCH_DELAY" -# sleep $LAUNCH_DELAY -# nvidia-smi -# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) -# echo $CUDA_VISIBLE_DEVICES -# stop_time=$((LAUNCH_DELAY + $(date +%s))) -# while [ $(date +%s) -lt $stop_time ]; do -# python -c 'import torch; torch.rand(5, 3, device=torch.device("cuda:0"))'; -# done -# 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 -# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) -# echo $CUDA_VISIBLE_DEVICES -# BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report -# coverage xml -# - name: Upload coverage -# uses: codecov/codecov-action@v1 -# with: -# fail_ci_if_error: false -# file: ./coverage.xml -# -# cron-pt-image: -# if: github.repository == 'Project-MONAI/MONAI' -# container: -# image: nvcr.io/nvidia/pytorch:21.02-py3 # testing with the latest pytorch base image -# options: "--gpus all" -# runs-on: [self-hosted, linux, x64, common] -# steps: -# - uses: actions/checkout@v2 -# - name: Install APT dependencies -# run: | -# apt-get update -# DEBIAN_FRONTEND="noninteractive" apt-get install -y libopenslide0 -# - name: Install Python dependencies -# run: | -# which python -# python -m pip install --upgrade pip wheel -# python -m pip install -r requirements-dev.txt -# python -m pip list -# - name: Run tests report coverage -# run: | -# export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ] -# echo "Sleep $LAUNCH_DELAY" -# sleep $LAUNCH_DELAY -# nvidia-smi -# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) -# echo $CUDA_VISIBLE_DEVICES -# stop_time=$((LAUNCH_DELAY + $(date +%s))) -# while [ $(date +%s) -lt $stop_time ]; do -# python -c 'import torch; torch.rand(5, 3, device=torch.device("cuda:0"))'; -# done -# 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 -# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) -# echo $CUDA_VISIBLE_DEVICES -# BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report -# coverage xml -# - name: Upload coverage -# uses: codecov/codecov-action@v1 -# with: -# fail_ci_if_error: false -# file: ./coverage.xml -# -# cron-docker: -# if: github.repository == 'Project-MONAI/MONAI' -# container: -# image: localhost:5000/local_monai:dockerhub # use currently latest, locally available dockerhub image -# options: "--gpus all" -# runs-on: [self-hosted, linux, x64, common] -# steps: -# - name: Run tests report coverage -# # The docker image process has done the compilation. -# # BUILD_MONAI=1 is necessary for triggering the USE_COMPILED flag. -# run: | -# cd /opt/monai -# nvidia-smi -# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) -# echo $CUDA_VISIBLE_DEVICES -# 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 -# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) -# echo $CUDA_VISIBLE_DEVICES -# BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report -# coverage xml -# - name: Upload coverage -# uses: codecov/codecov-action@v1 -# with: -# fail_ci_if_error: false -# file: ./coverage.xml + cron-gpu: + if: github.repository == 'Project-MONAI/MONAI' + container: + image: nvcr.io/nvidia/pytorch:20.03-py3 # CUDA 10.2 + options: "--gpus all" + runs-on: [self-hosted, linux, x64, common] + strategy: + matrix: + pytorch-version: [1.5.1, 1.6.0, 1.7.1, latest] + steps: + - uses: actions/checkout@v2 + - name: Install the dependencies + run: | + which python + python -m pip install --upgrade pip wheel + 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 + fi + python -m pip install -r requirements-dev.txt + python -m pip list + - name: Run tests report coverage + run: | + export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ] + echo "Sleep $LAUNCH_DELAY" + sleep $LAUNCH_DELAY + nvidia-smi + export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) + echo $CUDA_VISIBLE_DEVICES + stop_time=$((LAUNCH_DELAY + $(date +%s))) + while [ $(date +%s) -lt $stop_time ]; do + python -c 'import torch; torch.rand(5, 3, device=torch.device("cuda:0"))'; + done + 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 + export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) + echo $CUDA_VISIBLE_DEVICES + BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report + coverage xml + - name: Upload coverage + uses: codecov/codecov-action@v1 + with: + fail_ci_if_error: false + file: ./coverage.xml + + cron-pt-image: + if: github.repository == 'Project-MONAI/MONAI' + container: + image: nvcr.io/nvidia/pytorch:21.02-py3 # testing with the latest pytorch base image + options: "--gpus all" + runs-on: [self-hosted, linux, x64, common] + steps: + - uses: actions/checkout@v2 + - name: Install APT dependencies + run: | + apt-get update + DEBIAN_FRONTEND="noninteractive" apt-get install -y libopenslide0 + - name: Install Python dependencies + run: | + which python + python -m pip install --upgrade pip wheel + python -m pip install -r requirements-dev.txt + python -m pip list + - name: Run tests report coverage + run: | + export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ] + echo "Sleep $LAUNCH_DELAY" + sleep $LAUNCH_DELAY + nvidia-smi + export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) + echo $CUDA_VISIBLE_DEVICES + stop_time=$((LAUNCH_DELAY + $(date +%s))) + while [ $(date +%s) -lt $stop_time ]; do + python -c 'import torch; torch.rand(5, 3, device=torch.device("cuda:0"))'; + done + 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 + export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) + echo $CUDA_VISIBLE_DEVICES + BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report + coverage xml + - name: Upload coverage + uses: codecov/codecov-action@v1 + with: + fail_ci_if_error: false + file: ./coverage.xml + + cron-docker: + if: github.repository == 'Project-MONAI/MONAI' + container: + image: localhost:5000/local_monai:dockerhub # use currently latest, locally available dockerhub image + options: "--gpus all" + runs-on: [self-hosted, linux, x64, common] + steps: + - name: Run tests report coverage + # The docker image process has done the compilation. + # BUILD_MONAI=1 is necessary for triggering the USE_COMPILED flag. + run: | + cd /opt/monai + nvidia-smi + export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) + echo $CUDA_VISIBLE_DEVICES + 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 + export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) + echo $CUDA_VISIBLE_DEVICES + BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report + coverage xml + - name: Upload coverage + uses: codecov/codecov-action@v1 + with: + fail_ci_if_error: false + file: ./coverage.xml cron-tutorial-notebooks: if: github.repository == 'Project-MONAI/MONAI' From e47dbdfb7d8dd66642ca2be9731fb31ed3d538ad Mon Sep 17 00:00:00 2001 From: Richard Brown <33289025+rijobro@users.noreply.github.com> Date: Tue, 16 Mar 2021 16:42:21 +0000 Subject: [PATCH 06/12] cron tutorial notebooks Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> --- .github/workflows/cron.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 90abb5d7e4..c35aad8ed2 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -128,3 +128,26 @@ jobs: with: fail_ci_if_error: false file: ./coverage.xml + + cron-tutorial-notebooks: + if: github.repository == 'Project-MONAI/MONAI' + container: + image: nvcr.io/nvidia/pytorch:21.02-py3 # testing with the latest pytorch base image + options: "--gpus all" + runs-on: [self-hosted, linux, x64, common] + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: | + which python + python -m pip install --upgrade pip wheel + python -m pip install ${{ matrix.pytorch }} + python -m pip install -r requirements-dev.txt + - name: Checkout tutorials and install their requirements + run: | + git clone https://github.com/Project-MONAI/tutorials.git + cd tutorials + python -m pip install -r requirements.txt + - name: Run tutorial notebooks + run: | + sh ./runtests.sh From 27104f8c6fdceb1866afedb0b82c4ed0198baa67 Mon Sep 17 00:00:00 2001 From: Richard Brown <33289025+rijobro@users.noreply.github.com> Date: Tue, 16 Mar 2021 17:30:42 +0000 Subject: [PATCH 07/12] update script name Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> --- .github/workflows/cron.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index c35aad8ed2..9162227606 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -150,4 +150,4 @@ jobs: python -m pip install -r requirements.txt - name: Run tutorial notebooks run: | - sh ./runtests.sh + $(pwd)/runner.sh From 44252252b98547fee6efb41bae519bc57227c388 Mon Sep 17 00:00:00 2001 From: Richard Brown <33289025+rijobro@users.noreply.github.com> Date: Wed, 17 Mar 2021 09:51:28 +0000 Subject: [PATCH 08/12] single branch checkout Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> --- .github/workflows/cron.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index cea33e5601..f47263a5c2 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -149,7 +149,7 @@ jobs: export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) echo $CUDA_VISIBLE_DEVICES cd /opt - git clone --depth 1 https://github.com/Project-MONAI/tutorials.git # latest commit + git clone --depth 1 --branch master --single-branch https://github.com/Project-MONAI/tutorials.git # latest commit of master branch cd tutorials python -m pip install -r requirements.txt - name: Run tutorial notebooks From 96176f41f586392cbb9b91f7248e6997462b844d Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Tue, 16 Mar 2021 18:51:55 +0000 Subject: [PATCH 09/12] revise cmds Signed-off-by: Wenqi Li --- .github/workflows/cron.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 9162227606..443b43334c 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -131,23 +131,33 @@ jobs: cron-tutorial-notebooks: if: github.repository == 'Project-MONAI/MONAI' + needs: cron-gpu # so that monai itself is verified first container: image: nvcr.io/nvidia/pytorch:21.02-py3 # testing with the latest pytorch base image - options: "--gpus all" + options: "--gpus all --ipc=host" runs-on: [self-hosted, linux, x64, common] steps: - uses: actions/checkout@v2 - - name: Install dependencies + - name: Install MONAI + id: monai-install run: | which python python -m pip install --upgrade pip wheel - python -m pip install ${{ matrix.pytorch }} python -m pip install -r requirements-dev.txt + BUILD_MONAI=0 python setup.py develop # install monai + nvidia-smi + export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) + echo $CUDA_VISIBLE_DEVICES + echo "::set-output name=devices::$CUDA_VISIBLE_DEVICES" - name: Checkout tutorials and install their requirements run: | - git clone https://github.com/Project-MONAI/tutorials.git + cd /opt + git clone --depth 1 https://github.com/Project-MONAI/tutorials.git # latest commit cd tutorials python -m pip install -r requirements.txt - name: Run tutorial notebooks run: | + export CUDA_VISIBLE_DEVICES=${{ steps.monai-install.outputs.devices }} + echo $CUDA_VISIBLE_DEVICES + cd /opt/tutorials $(pwd)/runner.sh From f8e9d6f0e026c60c62e2f732204d4db2fe6b85d8 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Tue, 16 Mar 2021 18:54:12 +0000 Subject: [PATCH 10/12] temp tests Signed-off-by: Wenqi Li --- .github/workflows/cron.yml | 255 +++++++++++++++++++------------------ 1 file changed, 129 insertions(+), 126 deletions(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 443b43334c..6ad950336d 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -1,137 +1,140 @@ name: crons on: - schedule: - - cron: "0 2 * * *" # at 02:00 UTC +# schedule: +# - cron: "0 2 * * *" # at 02:00 UTC + push: + branches: + - cron_tutorials_test jobs: - cron-gpu: - if: github.repository == 'Project-MONAI/MONAI' - container: - image: nvcr.io/nvidia/pytorch:20.03-py3 # CUDA 10.2 - options: "--gpus all" - runs-on: [self-hosted, linux, x64, common] - strategy: - matrix: - pytorch-version: [1.5.1, 1.6.0, 1.7.1, latest] - steps: - - uses: actions/checkout@v2 - - name: Install the dependencies - run: | - which python - python -m pip install --upgrade pip wheel - 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 - fi - python -m pip install -r requirements-dev.txt - python -m pip list - - name: Run tests report coverage - run: | - export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ] - echo "Sleep $LAUNCH_DELAY" - sleep $LAUNCH_DELAY - nvidia-smi - export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) - echo $CUDA_VISIBLE_DEVICES - stop_time=$((LAUNCH_DELAY + $(date +%s))) - while [ $(date +%s) -lt $stop_time ]; do - python -c 'import torch; torch.rand(5, 3, device=torch.device("cuda:0"))'; - done - 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 - export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) - echo $CUDA_VISIBLE_DEVICES - BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report - coverage xml - - name: Upload coverage - uses: codecov/codecov-action@v1 - with: - fail_ci_if_error: false - file: ./coverage.xml - - cron-pt-image: - if: github.repository == 'Project-MONAI/MONAI' - container: - image: nvcr.io/nvidia/pytorch:21.02-py3 # testing with the latest pytorch base image - options: "--gpus all" - runs-on: [self-hosted, linux, x64, common] - steps: - - uses: actions/checkout@v2 - - name: Install APT dependencies - run: | - apt-get update - DEBIAN_FRONTEND="noninteractive" apt-get install -y libopenslide0 - - name: Install Python dependencies - run: | - which python - python -m pip install --upgrade pip wheel - python -m pip install -r requirements-dev.txt - python -m pip list - - name: Run tests report coverage - run: | - export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ] - echo "Sleep $LAUNCH_DELAY" - sleep $LAUNCH_DELAY - nvidia-smi - export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) - echo $CUDA_VISIBLE_DEVICES - stop_time=$((LAUNCH_DELAY + $(date +%s))) - while [ $(date +%s) -lt $stop_time ]; do - python -c 'import torch; torch.rand(5, 3, device=torch.device("cuda:0"))'; - done - 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 - export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) - echo $CUDA_VISIBLE_DEVICES - BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report - coverage xml - - name: Upload coverage - uses: codecov/codecov-action@v1 - with: - fail_ci_if_error: false - file: ./coverage.xml - - cron-docker: - if: github.repository == 'Project-MONAI/MONAI' - container: - image: localhost:5000/local_monai:dockerhub # use currently latest, locally available dockerhub image - options: "--gpus all" - runs-on: [self-hosted, linux, x64, common] - steps: - - name: Run tests report coverage - # The docker image process has done the compilation. - # BUILD_MONAI=1 is necessary for triggering the USE_COMPILED flag. - run: | - cd /opt/monai - nvidia-smi - export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) - echo $CUDA_VISIBLE_DEVICES - 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 - export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) - echo $CUDA_VISIBLE_DEVICES - BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report - coverage xml - - name: Upload coverage - uses: codecov/codecov-action@v1 - with: - fail_ci_if_error: false - file: ./coverage.xml +# cron-gpu: +# if: github.repository == 'Project-MONAI/MONAI' +# container: +# image: nvcr.io/nvidia/pytorch:20.03-py3 # CUDA 10.2 +# options: "--gpus all" +# runs-on: [self-hosted, linux, x64, common] +# strategy: +# matrix: +# pytorch-version: [1.5.1, 1.6.0, 1.7.1, latest] +# steps: +# - uses: actions/checkout@v2 +# - name: Install the dependencies +# run: | +# which python +# python -m pip install --upgrade pip wheel +# 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 +# fi +# python -m pip install -r requirements-dev.txt +# python -m pip list +# - name: Run tests report coverage +# run: | +# export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ] +# echo "Sleep $LAUNCH_DELAY" +# sleep $LAUNCH_DELAY +# nvidia-smi +# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) +# echo $CUDA_VISIBLE_DEVICES +# stop_time=$((LAUNCH_DELAY + $(date +%s))) +# while [ $(date +%s) -lt $stop_time ]; do +# python -c 'import torch; torch.rand(5, 3, device=torch.device("cuda:0"))'; +# done +# 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 +# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) +# echo $CUDA_VISIBLE_DEVICES +# BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report +# coverage xml +# - name: Upload coverage +# uses: codecov/codecov-action@v1 +# with: +# fail_ci_if_error: false +# file: ./coverage.xml +# +# cron-pt-image: +# if: github.repository == 'Project-MONAI/MONAI' +# container: +# image: nvcr.io/nvidia/pytorch:21.02-py3 # testing with the latest pytorch base image +# options: "--gpus all" +# runs-on: [self-hosted, linux, x64, common] +# steps: +# - uses: actions/checkout@v2 +# - name: Install APT dependencies +# run: | +# apt-get update +# DEBIAN_FRONTEND="noninteractive" apt-get install -y libopenslide0 +# - name: Install Python dependencies +# run: | +# which python +# python -m pip install --upgrade pip wheel +# python -m pip install -r requirements-dev.txt +# python -m pip list +# - name: Run tests report coverage +# run: | +# export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ] +# echo "Sleep $LAUNCH_DELAY" +# sleep $LAUNCH_DELAY +# nvidia-smi +# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) +# echo $CUDA_VISIBLE_DEVICES +# stop_time=$((LAUNCH_DELAY + $(date +%s))) +# while [ $(date +%s) -lt $stop_time ]; do +# python -c 'import torch; torch.rand(5, 3, device=torch.device("cuda:0"))'; +# done +# 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 +# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) +# echo $CUDA_VISIBLE_DEVICES +# BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report +# coverage xml +# - name: Upload coverage +# uses: codecov/codecov-action@v1 +# with: +# fail_ci_if_error: false +# file: ./coverage.xml +# +# cron-docker: +# if: github.repository == 'Project-MONAI/MONAI' +# container: +# image: localhost:5000/local_monai:dockerhub # use currently latest, locally available dockerhub image +# options: "--gpus all" +# runs-on: [self-hosted, linux, x64, common] +# steps: +# - name: Run tests report coverage +# # The docker image process has done the compilation. +# # BUILD_MONAI=1 is necessary for triggering the USE_COMPILED flag. +# run: | +# cd /opt/monai +# nvidia-smi +# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) +# echo $CUDA_VISIBLE_DEVICES +# 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 +# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) +# echo $CUDA_VISIBLE_DEVICES +# BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report +# coverage xml +# - name: Upload coverage +# uses: codecov/codecov-action@v1 +# with: +# fail_ci_if_error: false +# file: ./coverage.xml cron-tutorial-notebooks: if: github.repository == 'Project-MONAI/MONAI' - needs: cron-gpu # so that monai itself is verified first +# needs: cron-gpu # so that monai itself is verified first container: image: nvcr.io/nvidia/pytorch:21.02-py3 # testing with the latest pytorch base image options: "--gpus all --ipc=host" From 1f0df15c5c971c4679f233181a073b5c2d0179c4 Mon Sep 17 00:00:00 2001 From: Richard Brown <33289025+rijobro@users.noreply.github.com> Date: Wed, 17 Mar 2021 09:51:28 +0000 Subject: [PATCH 11/12] single branch checkout Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> --- .github/workflows/cron.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 6ad950336d..890551e378 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -155,7 +155,7 @@ jobs: - name: Checkout tutorials and install their requirements run: | cd /opt - git clone --depth 1 https://github.com/Project-MONAI/tutorials.git # latest commit + git clone --depth 1 --branch master --single-branch https://github.com/Project-MONAI/tutorials.git # latest commit of master branch cd tutorials python -m pip install -r requirements.txt - name: Run tutorial notebooks From b848404116cb165d1cf46193c779dd691ab0d4b5 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Wed, 17 Mar 2021 13:22:35 +0000 Subject: [PATCH 12/12] Revert "temp tests" This reverts commit f8e9d6f0e026c60c62e2f732204d4db2fe6b85d8. Signed-off-by: Wenqi Li --- .github/workflows/cron.yml | 255 ++++++++++++++++++------------------- 1 file changed, 126 insertions(+), 129 deletions(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 890551e378..761b1f7ebc 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -1,140 +1,137 @@ name: crons on: -# schedule: -# - cron: "0 2 * * *" # at 02:00 UTC - push: - branches: - - cron_tutorials_test + schedule: + - cron: "0 2 * * *" # at 02:00 UTC jobs: -# cron-gpu: -# if: github.repository == 'Project-MONAI/MONAI' -# container: -# image: nvcr.io/nvidia/pytorch:20.03-py3 # CUDA 10.2 -# options: "--gpus all" -# runs-on: [self-hosted, linux, x64, common] -# strategy: -# matrix: -# pytorch-version: [1.5.1, 1.6.0, 1.7.1, latest] -# steps: -# - uses: actions/checkout@v2 -# - name: Install the dependencies -# run: | -# which python -# python -m pip install --upgrade pip wheel -# 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 -# fi -# python -m pip install -r requirements-dev.txt -# python -m pip list -# - name: Run tests report coverage -# run: | -# export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ] -# echo "Sleep $LAUNCH_DELAY" -# sleep $LAUNCH_DELAY -# nvidia-smi -# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) -# echo $CUDA_VISIBLE_DEVICES -# stop_time=$((LAUNCH_DELAY + $(date +%s))) -# while [ $(date +%s) -lt $stop_time ]; do -# python -c 'import torch; torch.rand(5, 3, device=torch.device("cuda:0"))'; -# done -# 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 -# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) -# echo $CUDA_VISIBLE_DEVICES -# BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report -# coverage xml -# - name: Upload coverage -# uses: codecov/codecov-action@v1 -# with: -# fail_ci_if_error: false -# file: ./coverage.xml -# -# cron-pt-image: -# if: github.repository == 'Project-MONAI/MONAI' -# container: -# image: nvcr.io/nvidia/pytorch:21.02-py3 # testing with the latest pytorch base image -# options: "--gpus all" -# runs-on: [self-hosted, linux, x64, common] -# steps: -# - uses: actions/checkout@v2 -# - name: Install APT dependencies -# run: | -# apt-get update -# DEBIAN_FRONTEND="noninteractive" apt-get install -y libopenslide0 -# - name: Install Python dependencies -# run: | -# which python -# python -m pip install --upgrade pip wheel -# python -m pip install -r requirements-dev.txt -# python -m pip list -# - name: Run tests report coverage -# run: | -# export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ] -# echo "Sleep $LAUNCH_DELAY" -# sleep $LAUNCH_DELAY -# nvidia-smi -# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) -# echo $CUDA_VISIBLE_DEVICES -# stop_time=$((LAUNCH_DELAY + $(date +%s))) -# while [ $(date +%s) -lt $stop_time ]; do -# python -c 'import torch; torch.rand(5, 3, device=torch.device("cuda:0"))'; -# done -# 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 -# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) -# echo $CUDA_VISIBLE_DEVICES -# BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report -# coverage xml -# - name: Upload coverage -# uses: codecov/codecov-action@v1 -# with: -# fail_ci_if_error: false -# file: ./coverage.xml -# -# cron-docker: -# if: github.repository == 'Project-MONAI/MONAI' -# container: -# image: localhost:5000/local_monai:dockerhub # use currently latest, locally available dockerhub image -# options: "--gpus all" -# runs-on: [self-hosted, linux, x64, common] -# steps: -# - name: Run tests report coverage -# # The docker image process has done the compilation. -# # BUILD_MONAI=1 is necessary for triggering the USE_COMPILED flag. -# run: | -# cd /opt/monai -# nvidia-smi -# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) -# echo $CUDA_VISIBLE_DEVICES -# 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 -# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) -# echo $CUDA_VISIBLE_DEVICES -# BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report -# coverage xml -# - name: Upload coverage -# uses: codecov/codecov-action@v1 -# with: -# fail_ci_if_error: false -# file: ./coverage.xml + cron-gpu: + if: github.repository == 'Project-MONAI/MONAI' + container: + image: nvcr.io/nvidia/pytorch:20.03-py3 # CUDA 10.2 + options: "--gpus all" + runs-on: [self-hosted, linux, x64, common] + strategy: + matrix: + pytorch-version: [1.5.1, 1.6.0, 1.7.1, latest] + steps: + - uses: actions/checkout@v2 + - name: Install the dependencies + run: | + which python + python -m pip install --upgrade pip wheel + 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 + fi + python -m pip install -r requirements-dev.txt + python -m pip list + - name: Run tests report coverage + run: | + export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ] + echo "Sleep $LAUNCH_DELAY" + sleep $LAUNCH_DELAY + nvidia-smi + export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) + echo $CUDA_VISIBLE_DEVICES + stop_time=$((LAUNCH_DELAY + $(date +%s))) + while [ $(date +%s) -lt $stop_time ]; do + python -c 'import torch; torch.rand(5, 3, device=torch.device("cuda:0"))'; + done + 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 + export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) + echo $CUDA_VISIBLE_DEVICES + BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report + coverage xml + - name: Upload coverage + uses: codecov/codecov-action@v1 + with: + fail_ci_if_error: false + file: ./coverage.xml + + cron-pt-image: + if: github.repository == 'Project-MONAI/MONAI' + container: + image: nvcr.io/nvidia/pytorch:21.02-py3 # testing with the latest pytorch base image + options: "--gpus all" + runs-on: [self-hosted, linux, x64, common] + steps: + - uses: actions/checkout@v2 + - name: Install APT dependencies + run: | + apt-get update + DEBIAN_FRONTEND="noninteractive" apt-get install -y libopenslide0 + - name: Install Python dependencies + run: | + which python + python -m pip install --upgrade pip wheel + python -m pip install -r requirements-dev.txt + python -m pip list + - name: Run tests report coverage + run: | + export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ] + echo "Sleep $LAUNCH_DELAY" + sleep $LAUNCH_DELAY + nvidia-smi + export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) + echo $CUDA_VISIBLE_DEVICES + stop_time=$((LAUNCH_DELAY + $(date +%s))) + while [ $(date +%s) -lt $stop_time ]; do + python -c 'import torch; torch.rand(5, 3, device=torch.device("cuda:0"))'; + done + 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 + export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) + echo $CUDA_VISIBLE_DEVICES + BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report + coverage xml + - name: Upload coverage + uses: codecov/codecov-action@v1 + with: + fail_ci_if_error: false + file: ./coverage.xml + + cron-docker: + if: github.repository == 'Project-MONAI/MONAI' + container: + image: localhost:5000/local_monai:dockerhub # use currently latest, locally available dockerhub image + options: "--gpus all" + runs-on: [self-hosted, linux, x64, common] + steps: + - name: Run tests report coverage + # The docker image process has done the compilation. + # BUILD_MONAI=1 is necessary for triggering the USE_COMPILED flag. + run: | + cd /opt/monai + nvidia-smi + export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) + echo $CUDA_VISIBLE_DEVICES + 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 + export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) + echo $CUDA_VISIBLE_DEVICES + BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report + coverage xml + - name: Upload coverage + uses: codecov/codecov-action@v1 + with: + fail_ci_if_error: false + file: ./coverage.xml cron-tutorial-notebooks: if: github.repository == 'Project-MONAI/MONAI' -# needs: cron-gpu # so that monai itself is verified first + needs: cron-gpu # so that monai itself is verified first container: image: nvcr.io/nvidia/pytorch:21.02-py3 # testing with the latest pytorch base image options: "--gpus all --ipc=host"