Skip to content

Commit 911c332

Browse files
committed
temp tests
Signed-off-by: Wenqi Li <[email protected]>
1 parent d3a0fb0 commit 911c332

File tree

1 file changed

+5
-83
lines changed

1 file changed

+5
-83
lines changed

.github/workflows/cron.yml

Lines changed: 5 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,20 @@
11
name: crons
22

33
on:
4+
push:
5+
branches:
6+
- testing-2108
47
# schedule:
58
# - cron: "0 2 * * *" # at 02:00 UTC
69
# Allows you to run this workflow manually from the Actions tab
710
workflow_dispatch:
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, 1.8.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-
elif [ ${{ matrix.pytorch-version }} == "1.8.1" ]; then
35-
python -m pip install torch==1.8.1 torchvision==0.9.1
36-
fi
37-
python -m pip install -r requirements-dev.txt
38-
python -m pip list
39-
- name: Run tests report coverage
40-
run: |
41-
export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ]
42-
echo "Sleep $LAUNCH_DELAY"
43-
sleep $LAUNCH_DELAY
44-
nvidia-smi
45-
export CUDA_VISIBLE_DEVICES=$(python -m tests.utils)
46-
echo $CUDA_VISIBLE_DEVICES
47-
trap 'if pgrep python; then pkill python; fi;' ERR
48-
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 &
49-
python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
50-
python -c 'import torch; print(torch.rand(5, 3, device=torch.device("cuda:0")))'
51-
BUILD_MONAI=1 ./runtests.sh --coverage --unittests # unit tests with coverage report
52-
BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report
53-
coverage xml
54-
if pgrep python; then pkill python; fi
55-
- name: Upload coverage
56-
uses: codecov/codecov-action@v1
57-
with:
58-
fail_ci_if_error: false
59-
file: ./coverage.xml
60-
6113
cron-pt-image:
6214
if: github.repository == 'Project-MONAI/MONAI'
6315
strategy:
6416
matrix:
65-
container: ["pytorch:21.02", "pytorch:21.08"] # 21.02 for backward comp.
17+
container: ["pytorch:21.08"] # 21.02 for backward comp.
6618
container:
6719
image: nvcr.io/nvidia/${{ matrix.container }}-py3 # testing with the latest pytorch base image
6820
options: "--gpus all"
@@ -106,7 +58,7 @@ jobs:
10658
if: github.repository == 'Project-MONAI/MONAI'
10759
strategy:
10860
matrix:
109-
container: ["pytorch:21.02", "pytorch:21.08"] # 21.02 for backward comp.
61+
container: ["pytorch:21.08"] # 21.02 for backward comp.
11062
container:
11163
image: nvcr.io/nvidia/${{ matrix.container }}-py3 # testing with the latest pytorch base image
11264
options: "--gpus all"
@@ -170,36 +122,6 @@ jobs:
170122
PYTHONPATH="$tmp_dir":$PYTHONPATH BUILD_MONAI=1 python ./tests/runner.py -p 'test_((?!integration).)' # unit tests
171123
if pgrep python; then pkill python; fi
172124
173-
cron-docker:
174-
if: github.repository == 'Project-MONAI/MONAI'
175-
container:
176-
image: localhost:5000/local_monai:dockerhub # use currently latest, locally available dockerhub image
177-
options: "--gpus all"
178-
runs-on: [self-hosted, linux, x64, common]
179-
steps:
180-
- name: Run tests report coverage
181-
# The docker image process has done the compilation.
182-
# BUILD_MONAI=1 is necessary for triggering the USE_COMPILED flag.
183-
run: |
184-
cd /opt/monai
185-
nvidia-smi
186-
export CUDA_VISIBLE_DEVICES=$(python -m tests.utils)
187-
echo $CUDA_VISIBLE_DEVICES
188-
trap 'if pgrep python; then pkill python; fi;' ERR
189-
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 &
190-
python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
191-
python -c 'import torch; print(torch.rand(5,3, device=torch.device("cuda:0")))'
192-
ngc --version
193-
BUILD_MONAI=1 ./runtests.sh --coverage --pytype --unittests # unit tests with pytype checks, coverage report
194-
BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report
195-
coverage xml
196-
if pgrep python; then pkill python; fi
197-
- name: Upload coverage
198-
uses: codecov/codecov-action@v1
199-
with:
200-
fail_ci_if_error: false
201-
file: ./coverage.xml
202-
203125
cron-tutorial-notebooks:
204126
if: github.repository == 'Project-MONAI/MONAI'
205127
needs: cron-gpu # so that monai itself is verified first

0 commit comments

Comments
 (0)