Skip to content

Commit 44cddc0

Browse files
committed
temp tests
Signed-off-by: Wenqi Li <[email protected]>
1 parent d60ae0c commit 44cddc0

File tree

1 file changed

+160
-157
lines changed

1 file changed

+160
-157
lines changed

.github/workflows/cron.yml

Lines changed: 160 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -5,99 +5,102 @@ on:
55
- cron: "0 2 * * *" # at 02:00 UTC
66
# Allows you to run this workflow manually from the Actions tab
77
workflow_dispatch:
8+
push:
9+
branches:
10+
- adds-pypi-tests
811

912
jobs:
10-
cron-gpu:
11-
if: github.repository == 'Project-MONAI/MONAI'
12-
container:
13-
image: nvcr.io/nvidia/pytorch:20.03-py3 # CUDA 10.2
14-
options: "--gpus all"
15-
runs-on: [self-hosted, linux, x64, common]
16-
strategy:
17-
matrix:
18-
pytorch-version: [1.5.1, 1.6.0, 1.7.1, latest]
19-
steps:
20-
- uses: actions/checkout@v2
21-
- name: Install the dependencies
22-
run: |
23-
which python
24-
python -m pip install --upgrade pip wheel
25-
python -m pip uninstall -y torch torchvision
26-
if [ ${{ matrix.pytorch-version }} == "latest" ]; then
27-
python -m pip install torch torchvision
28-
elif [ ${{ matrix.pytorch-version }} == "1.5.1" ]; then
29-
python -m pip install torch==1.5.1 torchvision==0.6.1
30-
elif [ ${{ matrix.pytorch-version }} == "1.6.0" ]; then
31-
python -m pip install torch==1.6.0 torchvision==0.7.0
32-
elif [ ${{ matrix.pytorch-version }} == "1.7.1" ]; then
33-
python -m pip install torch==1.7.1 torchvision==0.8.2
34-
fi
35-
python -m pip install -r requirements-dev.txt
36-
python -m pip list
37-
- name: Run tests report coverage
38-
run: |
39-
export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ]
40-
echo "Sleep $LAUNCH_DELAY"
41-
sleep $LAUNCH_DELAY
42-
nvidia-smi
43-
export CUDA_VISIBLE_DEVICES=$(python -m tests.utils)
44-
echo $CUDA_VISIBLE_DEVICES
45-
trap 'if pgrep python; then pkill python; fi;' ERR
46-
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 &
47-
python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
48-
python -c 'import torch; print(torch.rand(5, 3, device=torch.device("cuda:0")))'
49-
BUILD_MONAI=1 ./runtests.sh --coverage --unittests # unit tests with coverage report
50-
BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report
51-
coverage xml
52-
if pgrep python; then pkill python; fi
53-
- name: Upload coverage
54-
uses: codecov/codecov-action@v1
55-
with:
56-
fail_ci_if_error: false
57-
file: ./coverage.xml
58-
59-
cron-pt-image:
60-
if: github.repository == 'Project-MONAI/MONAI'
61-
strategy:
62-
matrix:
63-
container: ["pytorch:21.02", "pytorch:21.04"] # 21.02 for backward comp.
64-
container:
65-
image: nvcr.io/nvidia/${{ matrix.container }}-py3 # testing with the latest pytorch base image
66-
options: "--gpus all"
67-
runs-on: [self-hosted, linux, x64, common]
68-
steps:
69-
- uses: actions/checkout@v2
70-
- name: Install APT dependencies
71-
run: |
72-
apt-get update
73-
DEBIAN_FRONTEND="noninteractive" apt-get install -y libopenslide0
74-
- name: Install Python dependencies
75-
run: |
76-
which python
77-
python -m pip install --upgrade pip wheel
78-
python -m pip install -r requirements-dev.txt
79-
python -m pip list
80-
- name: Run tests report coverage
81-
run: |
82-
export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ]
83-
echo "Sleep $LAUNCH_DELAY"
84-
sleep $LAUNCH_DELAY
85-
nvidia-smi
86-
export CUDA_VISIBLE_DEVICES=$(python -m tests.utils)
87-
echo $CUDA_VISIBLE_DEVICES
88-
trap 'if pgrep python; then pkill python; fi;' ERR
89-
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 &
90-
python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
91-
python -c 'import torch; print(torch.rand(5, 3, device=torch.device("cuda:0")))'
92-
BUILD_MONAI=1 ./runtests.sh --coverage --unittests # unit tests with coverage report
93-
BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report
94-
coverage xml
95-
if pgrep python; then pkill python; fi
96-
- name: Upload coverage
97-
uses: codecov/codecov-action@v1
98-
with:
99-
fail_ci_if_error: false
100-
file: ./coverage.xml
13+
# cron-gpu:
14+
# if: github.repository == 'Project-MONAI/MONAI'
15+
# container:
16+
# image: nvcr.io/nvidia/pytorch:20.03-py3 # CUDA 10.2
17+
# options: "--gpus all"
18+
# runs-on: [self-hosted, linux, x64, common]
19+
# strategy:
20+
# matrix:
21+
# pytorch-version: [1.5.1, 1.6.0, 1.7.1, latest]
22+
# steps:
23+
# - uses: actions/checkout@v2
24+
# - name: Install the dependencies
25+
# run: |
26+
# which python
27+
# python -m pip install --upgrade pip wheel
28+
# python -m pip uninstall -y torch torchvision
29+
# if [ ${{ matrix.pytorch-version }} == "latest" ]; then
30+
# python -m pip install torch torchvision
31+
# elif [ ${{ matrix.pytorch-version }} == "1.5.1" ]; then
32+
# python -m pip install torch==1.5.1 torchvision==0.6.1
33+
# elif [ ${{ matrix.pytorch-version }} == "1.6.0" ]; then
34+
# python -m pip install torch==1.6.0 torchvision==0.7.0
35+
# elif [ ${{ matrix.pytorch-version }} == "1.7.1" ]; then
36+
# python -m pip install torch==1.7.1 torchvision==0.8.2
37+
# fi
38+
# python -m pip install -r requirements-dev.txt
39+
# python -m pip list
40+
# - name: Run tests report coverage
41+
# run: |
42+
# export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ]
43+
# echo "Sleep $LAUNCH_DELAY"
44+
# sleep $LAUNCH_DELAY
45+
# nvidia-smi
46+
# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils)
47+
# echo $CUDA_VISIBLE_DEVICES
48+
# trap 'if pgrep python; then pkill python; fi;' ERR
49+
# 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 &
50+
# python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
51+
# python -c 'import torch; print(torch.rand(5, 3, device=torch.device("cuda:0")))'
52+
# BUILD_MONAI=1 ./runtests.sh --coverage --unittests # unit tests with coverage report
53+
# BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report
54+
# coverage xml
55+
# if pgrep python; then pkill python; fi
56+
# - name: Upload coverage
57+
# uses: codecov/codecov-action@v1
58+
# with:
59+
# fail_ci_if_error: false
60+
# file: ./coverage.xml
61+
#
62+
# cron-pt-image:
63+
# if: github.repository == 'Project-MONAI/MONAI'
64+
# strategy:
65+
# matrix:
66+
# container: ["pytorch:21.02", "pytorch:21.04"] # 21.02 for backward comp.
67+
# container:
68+
# image: nvcr.io/nvidia/${{ matrix.container }}-py3 # testing with the latest pytorch base image
69+
# options: "--gpus all"
70+
# runs-on: [self-hosted, linux, x64, common]
71+
# steps:
72+
# - uses: actions/checkout@v2
73+
# - name: Install APT dependencies
74+
# run: |
75+
# apt-get update
76+
# DEBIAN_FRONTEND="noninteractive" apt-get install -y libopenslide0
77+
# - name: Install Python dependencies
78+
# run: |
79+
# which python
80+
# python -m pip install --upgrade pip wheel
81+
# python -m pip install -r requirements-dev.txt
82+
# python -m pip list
83+
# - name: Run tests report coverage
84+
# run: |
85+
# export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ]
86+
# echo "Sleep $LAUNCH_DELAY"
87+
# sleep $LAUNCH_DELAY
88+
# nvidia-smi
89+
# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils)
90+
# echo $CUDA_VISIBLE_DEVICES
91+
# trap 'if pgrep python; then pkill python; fi;' ERR
92+
# 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 &
93+
# python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
94+
# python -c 'import torch; print(torch.rand(5, 3, device=torch.device("cuda:0")))'
95+
# BUILD_MONAI=1 ./runtests.sh --coverage --unittests # unit tests with coverage report
96+
# BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report
97+
# coverage xml
98+
# if pgrep python; then pkill python; fi
99+
# - name: Upload coverage
100+
# uses: codecov/codecov-action@v1
101+
# with:
102+
# fail_ci_if_error: false
103+
# file: ./coverage.xml
101104

102105
cron-pip:
103106
if: github.repository == 'Project-MONAI/MONAI'
@@ -166,69 +169,69 @@ jobs:
166169
BUILD_MONAI=1 ./tests/runner.py -p test_((?!integration).) # unit tests
167170
if pgrep python; then pkill python; fi
168171
169-
cron-docker:
170-
if: github.repository == 'Project-MONAI/MONAI'
171-
container:
172-
image: localhost:5000/local_monai:dockerhub # use currently latest, locally available dockerhub image
173-
options: "--gpus all"
174-
runs-on: [self-hosted, linux, x64, common]
175-
steps:
176-
- name: Run tests report coverage
177-
# The docker image process has done the compilation.
178-
# BUILD_MONAI=1 is necessary for triggering the USE_COMPILED flag.
179-
run: |
180-
cd /opt/monai
181-
nvidia-smi
182-
export CUDA_VISIBLE_DEVICES=$(python -m tests.utils)
183-
echo $CUDA_VISIBLE_DEVICES
184-
trap 'if pgrep python; then pkill python; fi;' ERR
185-
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 &
186-
python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
187-
python -c 'import torch; print(torch.rand(5,3, device=torch.device("cuda:0")))'
188-
ngc --version
189-
BUILD_MONAI=1 ./runtests.sh --coverage --pytype --unittests # unit tests with pytype checks, coverage report
190-
BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report
191-
coverage xml
192-
if pgrep python; then pkill python; fi
193-
- name: Upload coverage
194-
uses: codecov/codecov-action@v1
195-
with:
196-
fail_ci_if_error: false
197-
file: ./coverage.xml
198-
199-
cron-tutorial-notebooks:
200-
if: github.repository == 'Project-MONAI/MONAI'
201-
needs: cron-gpu # so that monai itself is verified first
202-
container:
203-
image: nvcr.io/nvidia/pytorch:21.04-py3 # testing with the latest pytorch base image
204-
options: "--gpus all --ipc=host"
205-
runs-on: [self-hosted, linux, x64, common]
206-
steps:
207-
- uses: actions/checkout@v2
208-
- name: Install MONAI
209-
id: monai-install
210-
run: |
211-
which python
212-
python -m pip install --upgrade pip wheel
213-
python -m pip install -r requirements-dev.txt
214-
BUILD_MONAI=0 python setup.py develop # install monai
215-
nvidia-smi
216-
export CUDA_VISIBLE_DEVICES=$(python -m tests.utils)
217-
echo $CUDA_VISIBLE_DEVICES
218-
echo "::set-output name=devices::$CUDA_VISIBLE_DEVICES"
219-
- name: Checkout tutorials and install their requirements
220-
run: |
221-
cd /opt
222-
git clone --depth 1 --branch master --single-branch https://github.com/Project-MONAI/tutorials.git # latest commit of master branch
223-
cd tutorials
224-
python -m pip install -r requirements.txt
225-
- name: Run tutorial notebooks
226-
timeout-minutes: 150
227-
run: |
228-
export CUDA_VISIBLE_DEVICES=${{ steps.monai-install.outputs.devices }}
229-
echo $CUDA_VISIBLE_DEVICES
230-
trap 'if pgrep python; then pkill python; fi;' ERR
231-
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 &
232-
cd /opt/tutorials
233-
$(pwd)/runner.sh
234-
if pgrep python; then pkill python; fi
172+
# cron-docker:
173+
# if: github.repository == 'Project-MONAI/MONAI'
174+
# container:
175+
# image: localhost:5000/local_monai:dockerhub # use currently latest, locally available dockerhub image
176+
# options: "--gpus all"
177+
# runs-on: [self-hosted, linux, x64, common]
178+
# steps:
179+
# - name: Run tests report coverage
180+
# # The docker image process has done the compilation.
181+
# # BUILD_MONAI=1 is necessary for triggering the USE_COMPILED flag.
182+
# run: |
183+
# cd /opt/monai
184+
# nvidia-smi
185+
# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils)
186+
# echo $CUDA_VISIBLE_DEVICES
187+
# trap 'if pgrep python; then pkill python; fi;' ERR
188+
# 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 &
189+
# python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
190+
# python -c 'import torch; print(torch.rand(5,3, device=torch.device("cuda:0")))'
191+
# ngc --version
192+
# BUILD_MONAI=1 ./runtests.sh --coverage --pytype --unittests # unit tests with pytype checks, coverage report
193+
# BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report
194+
# coverage xml
195+
# if pgrep python; then pkill python; fi
196+
# - name: Upload coverage
197+
# uses: codecov/codecov-action@v1
198+
# with:
199+
# fail_ci_if_error: false
200+
# file: ./coverage.xml
201+
#
202+
# cron-tutorial-notebooks:
203+
# if: github.repository == 'Project-MONAI/MONAI'
204+
# needs: cron-gpu # so that monai itself is verified first
205+
# container:
206+
# image: nvcr.io/nvidia/pytorch:21.04-py3 # testing with the latest pytorch base image
207+
# options: "--gpus all --ipc=host"
208+
# runs-on: [self-hosted, linux, x64, common]
209+
# steps:
210+
# - uses: actions/checkout@v2
211+
# - name: Install MONAI
212+
# id: monai-install
213+
# run: |
214+
# which python
215+
# python -m pip install --upgrade pip wheel
216+
# python -m pip install -r requirements-dev.txt
217+
# BUILD_MONAI=0 python setup.py develop # install monai
218+
# nvidia-smi
219+
# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils)
220+
# echo $CUDA_VISIBLE_DEVICES
221+
# echo "::set-output name=devices::$CUDA_VISIBLE_DEVICES"
222+
# - name: Checkout tutorials and install their requirements
223+
# run: |
224+
# cd /opt
225+
# git clone --depth 1 --branch master --single-branch https://github.com/Project-MONAI/tutorials.git # latest commit of master branch
226+
# cd tutorials
227+
# python -m pip install -r requirements.txt
228+
# - name: Run tutorial notebooks
229+
# timeout-minutes: 150
230+
# run: |
231+
# export CUDA_VISIBLE_DEVICES=${{ steps.monai-install.outputs.devices }}
232+
# echo $CUDA_VISIBLE_DEVICES
233+
# trap 'if pgrep python; then pkill python; fi;' ERR
234+
# 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 &
235+
# cd /opt/tutorials
236+
# $(pwd)/runner.sh
237+
# if pgrep python; then pkill python; fi

0 commit comments

Comments
 (0)