1- name : crons
1+ # nightly: Jenkinsfile.monai-pytorch-versions, monai-latest-image, monai-pip, monai-latest-docker, monai-notebooks
2+ name : nightly-crons
23
34on :
45 # schedule:
910jobs :
1011 cron-gpu :
1112 if : github.repository == 'Project-MONAI/MONAI'
13+ strategy :
14+ matrix :
15+ environment :
16+ - " PT182+CUDA102"
17+ - " PT191+CUDA113"
18+ - " PT110+CUDA113"
19+ - " PT112+CUDA113"
20+ - " PTLATEST+CUDA117"
21+ include :
22+ # https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes
23+ - environment : PT182+CUDA102
24+ pytorch : " torch==1.8.2 torchvision==0.9.2 --extra-index-url https://download.pytorch.org/whl/lts/1.8/cu102"
25+ base : " nvcr.io/nvidia/cuda:10.2-devel-ubuntu18.04"
26+ - environment : PT191+CUDA113
27+ pytorch : " torch==1.9.1 torchvision==0.10.1 --extra-index-url https://download.pytorch.org/whl/cu113"
28+ base : " nvcr.io/nvidia/pytorch:21.06-py3" # CUDA 11.3
29+ - environment : PT110+CUDA113
30+ pytorch : " torch==1.10.2 torchvision==0.11.3 --extra-index-url https://download.pytorch.org/whl/cu113"
31+ base : " nvcr.io/nvidia/pytorch:21.06-py3" # CUDA 11.3
32+ - environment : PT112+CUDA113
33+ pytorch : " torch==1.12.1 torchvision==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu113"
34+ base : " nvcr.io/nvidia/pytorch:21.06-py3" # CUDA 11.3
35+ - environment : PTLATEST+CUDA117
36+ pytorch : " -U torch torchvision --extra-index-url https://download.pytorch.org/whl/cu117"
37+ base : " nvcr.io/nvidia/pytorch:22.08-py3" # CUDA 11.7
1238 container :
13- image : nvcr.io/nvidia/pytorch:21.06-py3 # CUDA 11.3
39+ image : ${{ matrix.base }}
1440 options : " --gpus all"
1541 runs-on : [self-hosted, linux, x64, common]
16- strategy :
17- matrix :
18- pytorch-version : [1.7.1, 1.8.1, 1.9.1, 1.10.2, latest]
1942 steps :
2043 - uses : actions/checkout@v3
44+ - name : apt install
45+ run : |
46+ # FIXME: workaround for https://github.com/Project-MONAI/MONAI/issues/4200
47+ apt-key del 7fa2af80 && rm -rf /etc/apt/sources.list.d/nvidia-ml.list /etc/apt/sources.list.d/cuda.list
48+ apt-get update
49+ apt-get install -y wget
50+ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-keyring_1.0-1_all.deb
51+ dpkg -i cuda-keyring_1.0-1_all.deb
52+
53+ if [ ${{ matrix.environment }} = "PT182+CUDA102" ]
54+ then
55+ PYVER=3.7 PYSFX=3 DISTUTILS=python3-distutils && \
56+ apt-get update && apt-get install -y --no-install-recommends \
57+ curl \
58+ pkg-config \
59+ python$PYVER \
60+ python$PYVER-dev \
61+ python$PYSFX-pip \
62+ $DISTUTILS \
63+ rsync \
64+ swig \
65+ unzip \
66+ zip \
67+ zlib1g-dev \
68+ libboost-locale-dev \
69+ libboost-program-options-dev \
70+ libboost-system-dev \
71+ libboost-thread-dev \
72+ libboost-test-dev \
73+ libgoogle-glog-dev \
74+ libjsoncpp-dev \
75+ cmake \
76+ git && \
77+ rm -rf /var/lib/apt/lists/* && \
78+ export PYTHONIOENCODING=utf-8 LC_ALL=C.UTF-8 && \
79+ rm -f /usr/bin/python && \
80+ rm -f /usr/bin/python`echo $PYVER | cut -c1-1` && \
81+ ln -s /usr/bin/python$PYVER /usr/bin/python && \
82+ ln -s /usr/bin/python$PYVER /usr/bin/python`echo $PYVER | cut -c1-1` &&
83+ curl -O https://bootstrap.pypa.io/get-pip.py && \
84+ python get-pip.py && \
85+ rm get-pip.py;
86+ fi
2187 - name : Install the dependencies
2288 run : |
2389 which python
2490 python -m pip install --upgrade pip wheel
2591 python -m pip uninstall -y torch torchvision
26- if [ ${{ matrix.pytorch-version }} == "latest" ]; then
27- python -m pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu113
28- elif [ ${{ matrix.pytorch-version }} == "1.7.1" ]; then
29- python -m pip install torch==1.7.1 torchvision==0.8.2 --extra-index-url https://download.pytorch.org/whl/cu113
30- elif [ ${{ matrix.pytorch-version }} == "1.8.1" ]; then
31- python -m pip install torch==1.8.1 torchvision==0.9.1 --extra-index-url https://download.pytorch.org/whl/cu113
32- elif [ ${{ matrix.pytorch-version }} == "1.9.1" ]; then
33- python -m pip install torch==1.9.1 torchvision==0.10.1 --extra-index-url https://download.pytorch.org/whl/cu113
34- elif [ ${{ matrix.pytorch-version }} == "1.10.2" ]; then
35- python -m pip install torch==1.10.2 torchvision==0.11.3 --extra-index-url https://download.pytorch.org/whl/cu113
36- fi
92+ python -m pip install ${{ matrix.pytorch }}
3793 python -m pip install -r requirements-dev.txt
3894 python -m pip list
3995 - name : Run tests report coverage
@@ -42,31 +98,32 @@ jobs:
4298 echo "Sleep $LAUNCH_DELAY"
4399 sleep $LAUNCH_DELAY
44100 nvidia-smi
45- export CUDA_VISIBLE_DEVICES=$(python -m tests.utils)
101+ export CUDA_VISIBLE_DEVICES=$(python -m tests.utils | tail -n 1 )
46102 echo $CUDA_VISIBLE_DEVICES
47103 trap 'if pgrep python; then pkill python; fi;' ERR
48104 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 &
49105 python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
50106 python -c 'import torch; print(torch.rand(5, 3, device=torch.device("cuda:0")))'
51107 BUILD_MONAI=1 ./runtests.sh --build --coverage --unittests --disttests # unit tests with coverage report
52108 BUILD_MONAI=1 ./runtests.sh --build --coverage --net # integration tests with coverage report
53- coverage xml
109+ coverage xml --ignore-errors
54110 if pgrep python; then pkill python; fi
111+ shell : bash
55112 - name : Upload coverage
56- uses : codecov/codecov-action@v1
113+ uses : codecov/codecov-action@v3
57114 with :
58115 fail_ci_if_error : false
59- file : ./coverage.xml
116+ files : ./coverage.xml
60117
61118 cron-pt-image :
62119 if : github.repository == 'Project-MONAI/MONAI'
63120 strategy :
64121 matrix :
65- container : ["pytorch:21.02", "pytorch:21.10", "pytorch:22.07 "] # 21.02, 21.10 for backward comp.
122+ container : ["pytorch:21.02", "pytorch:21.10", "pytorch:22.10 "] # 21.02, 21.10 for backward comp.
66123 container :
67124 image : nvcr.io/nvidia/${{ matrix.container }}-py3 # testing with the latest pytorch base image
68125 options : " --gpus all"
69- runs-on : [self-hosted, linux, x64, common ]
126+ runs-on : [self-hosted, linux, x64, integration ]
70127 steps :
71128 - uses : actions/checkout@v3
72129 - name : Install APT dependencies
@@ -85,32 +142,33 @@ jobs:
85142 echo "Sleep $LAUNCH_DELAY"
86143 sleep $LAUNCH_DELAY
87144 nvidia-smi
88- export CUDA_VISIBLE_DEVICES=$(python -m tests.utils)
145+ export CUDA_VISIBLE_DEVICES=$(python -m tests.utils | tail -n 1 )
89146 echo $CUDA_VISIBLE_DEVICES
90147 trap 'if pgrep python; then pkill python; fi;' ERR
91148 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 &
92149 python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
93150 python -c 'import torch; print(torch.rand(5, 3, device=torch.device("cuda:0")))'
94151 BUILD_MONAI=1 ./runtests.sh --build --coverage --unittests --disttests # unit tests with coverage report
95152 BUILD_MONAI=1 ./runtests.sh --build --coverage --net # integration tests with coverage report
96- coverage xml
153+ coverage xml --ignore-errors
97154 if pgrep python; then pkill python; fi
155+ shell : bash
98156 - name : Upload coverage
99- uses : codecov/codecov-action@v1
157+ uses : codecov/codecov-action@v3
100158 with :
101159 fail_ci_if_error : false
102- file : ./coverage.xml
160+ files : ./coverage.xml
103161
104162 cron-pip :
105163 # pip install monai[all] and use it to run unit tests
106164 if : github.repository == 'Project-MONAI/MONAI'
107165 strategy :
108166 matrix :
109- container : ["pytorch:21.02", "pytorch:21.10", "pytorch:22.07 "] # 21.02, 21.10 for backward comp.
167+ container : ["pytorch:21.02", "pytorch:21.10", "pytorch:22.10 "] # 21.02, 21.10 for backward comp.
110168 container :
111169 image : nvcr.io/nvidia/${{ matrix.container }}-py3 # testing with the latest pytorch base image
112170 options : " --gpus all"
113- runs-on : [self-hosted, linux, x64, common ]
171+ runs-on : [self-hosted, linux, x64, integration ]
114172 steps :
115173 - uses : actions/checkout@v3
116174 with :
@@ -121,6 +179,7 @@ jobs:
121179 python -m pip install --upgrade pip wheel twine
122180 python -m pip list
123181 - name : Run tests report coverage
182+ shell : bash
124183 run : |
125184 pip uninstall monai
126185 pip list | grep -iv monai
@@ -160,7 +219,7 @@ jobs:
160219 echo "Sleep $LAUNCH_DELAY"
161220 sleep $LAUNCH_DELAY
162221 nvidia-smi
163- export CUDA_VISIBLE_DEVICES=$(python -m tests.utils)
222+ export CUDA_VISIBLE_DEVICES=$(python -m tests.utils | tail -n 1 )
164223 echo $CUDA_VISIBLE_DEVICES
165224 trap 'if pgrep python; then pkill python; fi;' ERR
166225 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 &
@@ -175,15 +234,15 @@ jobs:
175234 container :
176235 image : docker://projectmonai/monai:latest # this might be slow and has the pull count limitations
177236 options : " --gpus all"
178- runs-on : [self-hosted, linux, x64, common ]
237+ runs-on : [self-hosted, linux, x64, integration ]
179238 steps :
180239 - name : Run tests report coverage
181240 # The docker image process has done the compilation.
182241 # BUILD_MONAI=1 is necessary for triggering the USE_COMPILED flag.
183242 run : |
184243 cd /opt/monai
185244 nvidia-smi
186- export CUDA_VISIBLE_DEVICES=$(python -m tests.utils)
245+ export CUDA_VISIBLE_DEVICES=$(python -m tests.utils | tail -n 1 )
187246 echo $CUDA_VISIBLE_DEVICES
188247 trap 'if pgrep python; then pkill python; fi;' ERR
189248 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 &
@@ -192,21 +251,22 @@ jobs:
192251 ngc --version
193252 BUILD_MONAI=1 ./runtests.sh --build --coverage --pytype --unittests --disttests # unit tests with pytype checks, coverage report
194253 BUILD_MONAI=1 ./runtests.sh --build --coverage --net # integration tests with coverage report
195- coverage xml
254+ coverage xml --ignore-errors
196255 if pgrep python; then pkill python; fi
256+ shell : bash
197257 - name : Upload coverage
198- uses : codecov/codecov-action@v1
258+ uses : codecov/codecov-action@v3
199259 with :
200260 fail_ci_if_error : false
201- file : ./coverage.xml
261+ files : ./coverage.xml
202262
203263 cron-tutorial-notebooks :
204264 if : github.repository == 'Project-MONAI/MONAI'
205265 needs : cron-gpu # so that monai itself is verified first
206266 container :
207- image : nvcr.io/nvidia/pytorch:22.07 -py3 # testing with the latest pytorch base image
267+ image : nvcr.io/nvidia/pytorch:22.10 -py3 # testing with the latest pytorch base image
208268 options : " --gpus all --ipc=host"
209- runs-on : [self-hosted, linux, x64, common ]
269+ runs-on : [self-hosted, linux, x64, integration ]
210270 steps :
211271 - uses : actions/checkout@v3
212272 - name : Install MONAI
@@ -217,9 +277,9 @@ jobs:
217277 python -m pip install -r requirements-dev.txt
218278 BUILD_MONAI=1 python setup.py develop # install monai
219279 nvidia-smi
220- export CUDA_VISIBLE_DEVICES=$(python -m tests.utils)
280+ export CUDA_VISIBLE_DEVICES=$(python -m tests.utils | tail -n 1 )
221281 echo $CUDA_VISIBLE_DEVICES
222- echo "::set-output name= devices:: $CUDA_VISIBLE_DEVICES"
282+ echo "devices= $CUDA_VISIBLE_DEVICES" >> $GITHUB_OUTPUT
223283 - name : Checkout tutorials and install their requirements
224284 run : |
225285 cd /opt
@@ -238,3 +298,4 @@ jobs:
238298 $(pwd)/runner.sh
239299 python -c 'import monai; monai.config.print_debug_info()'
240300 if pgrep python; then pkill python; fi
301+ shell : bash
0 commit comments