@@ -3,12 +3,15 @@ name: deploy
33
44on :
55 # full tests for all the important branches
6- push :
7- branches :
8- - main
9- - releasing/*
10- - feature/*
11- - dev
6+ # push:
7+ # branches:
8+ # - main
9+ # - releasing/*
10+ # - feature/*
11+ # - dev
12+
13+ # Allows you to run this workflow manually from the Actions tab
14+ workflow_dispatch :
1215
1316concurrency :
1417 # automatically cancel the previously triggered workflows when there's a newer version
@@ -20,98 +23,112 @@ jobs:
2023 # - docker-py3-pip- (shared)
2124 # - ubuntu 37 38 39 310-pip-
2225 # - os-latest-pip (shared)
23- coverage-py3 :
24- # if: github.repository == 'Project-MONAI/MONAI'
25- if : ${{ false }} # disable self-hosted job project-monai/monai#7039
26- container :
27- image : nvcr.io/nvidia/pytorch:22.04-py3
28- options : --gpus all
29- runs-on : [self-hosted, linux, x64, integration]
30- steps :
31- - uses : actions/checkout@v6
32- - name : cache weekly timestamp
33- id : pip-cache
34- run : |
35- echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT
36- - name : cache for pip
37- if : ${{ startsWith(github.ref, 'refs/heads/dev') }}
38- uses : actions/cache@v5
39- id : cache
40- with :
41- path : |
42- ~/.cache/pip
43- ~/.cache/torch
44- key : docker-py3-pip-${{ steps.pip-cache.outputs.datew }}
45- - name : Install the dependencies
46- run : |
47- which python
48- python -m pip install --upgrade pip wheel
49- python -m pip install --upgrade torch torchvision
50- python -m pip install -r requirements-dev.txt
51- - name : Run unit tests report coverage
52- env :
53- NGC_API_KEY : ${{ secrets.NGC_API_KEY }}
54- NGC_ORG : ${{ secrets.NGC_ORG }}
55- NGC_TEAM : ${{ secrets.NGC_TEAM }}
56- run : |
57- python -m pip list
58- git config --global --add safe.directory /__w/MONAI/MONAI
59- git clean -ffdx
60- df -h
61- # python -m pip cache info
62- nvidia-smi
63- export CUDA_VISIBLE_DEVICES=$(python -m tests.utils | tail -n 1)
64- echo $CUDA_VISIBLE_DEVICES
65- trap 'if pgrep python; then pkill python; fi;' ERR
66- 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 &
67- python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
68- python -c 'import torch; print(torch.rand(5, 3, device=torch.device("cuda:0")))'
69- BUILD_MONAI=1 ./runtests.sh --build --coverage --unittests --disttests # unit tests with coverage report
70- BUILD_MONAI=1 ./runtests.sh --build --coverage --net # integration tests with coverage report
71- coverage xml --ignore-errors
72- if pgrep python; then pkill python; fi
73- shell : bash
74- - name : Upload coverage
75- uses : codecov/codecov-action@v6
76- with :
77- fail_ci_if_error : false
78- files : ./coverage.xml
7926
80- test-py3x :
81- runs-on : ubuntu-latest
82- strategy :
83- matrix :
84- python-version : ['3.10', '3.11', '3.12']
85- steps :
86- - uses : actions/checkout@v6
87- with :
88- fetch-depth : 0
89- - name : Set up Python ${{ matrix.python-version }}
90- uses : actions/setup-python@v6
91- with :
92- python-version : ${{ matrix.python-version }}
93- cache : pip
94- - name : Install the dependencies
95- run : |
96- find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
97- python -m pip install --upgrade pip wheel
98- python -m pip install --no-build-isolation -r requirements-dev.txt
99- - name : Run quick tests CPU ubuntu
100- env :
101- NGC_API_KEY : ${{ secrets.NGC_API_KEY }}
102- NGC_ORG : ${{ secrets.NGC_ORG }}
103- NGC_TEAM : ${{ secrets.NGC_TEAM }}
104- run : |
105- python -m pip list
106- python -c 'import torch; print(torch.__version__); print(torch.rand(5,3))'
107- BUILD_MONAI=0 ./runtests.sh --build --coverage --quick --unittests
108- BUILD_MONAI=1 ./runtests.sh --build --coverage --quick --min
109- coverage xml --ignore-errors
110- - name : Upload coverage
111- uses : codecov/codecov-action@v6
112- with :
113- fail_ci_if_error : false
114- files : ./coverage.xml
27+ # TODO: coverage should be re-enable at a future time in PRs as well as longer running jobs, ideally with GPU support
28+
29+ # coverage-py3:
30+ # # if: github.repository == 'Project-MONAI/MONAI'
31+ # if: ${{ false }} # disable self-hosted job project-monai/monai#7039
32+ # container:
33+ # image: nvcr.io/nvidia/pytorch:22.04-py3
34+ # options: --gpus all
35+ # runs-on: [self-hosted, linux, x64, integration]
36+ # steps:
37+ # - uses: actions/checkout@v6
38+ # - name: cache weekly timestamp
39+ # id: pip-cache
40+ # run: |
41+ # echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT
42+ # - name: cache for pip
43+ # if: ${{ startsWith(github.ref, 'refs/heads/dev') }}
44+ # uses: actions/cache@v5
45+ # id: cache
46+ # with:
47+ # path: |
48+ # ~/.cache/pip
49+ # ~/.cache/torch
50+ # key: docker-py3-pip-${{ steps.pip-cache.outputs.datew }}
51+ # - name: Install the dependencies
52+ # run: |
53+ # which python
54+ # python -m pip install --upgrade pip wheel wheel-stub
55+ # python -m pip install --upgrade torch torchvision
56+ # python -m pip install -r requirements-dev.txt
57+ # - name: Run unit tests report coverage
58+ # env:
59+ # NGC_API_KEY: ${{ secrets.NGC_API_KEY }}
60+ # NGC_ORG: ${{ secrets.NGC_ORG }}
61+ # NGC_TEAM: ${{ secrets.NGC_TEAM }}
62+ # run: |
63+ # python -m pip list
64+ # git config --global --add safe.directory /__w/MONAI/MONAI
65+ # git clean -ffdx
66+ # df -h
67+ # # python -m pip cache info
68+ # nvidia-smi
69+ # export CUDA_VISIBLE_DEVICES=$(python -m tests.utils | tail -n 1)
70+ # echo $CUDA_VISIBLE_DEVICES
71+ # trap 'if pgrep python; then pkill python; fi;' ERR
72+ # 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 &
73+ # python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
74+ # python -c 'import torch; print(torch.rand(5, 3, device=torch.device("cuda:0")))'
75+ # BUILD_MONAI=1 ./runtests.sh --build --coverage --unittests --disttests # unit tests with coverage report
76+ # BUILD_MONAI=1 ./runtests.sh --build --coverage --net # integration tests with coverage report
77+ # coverage xml --ignore-errors
78+ # if pgrep python; then pkill python; fi
79+ # shell: bash
80+ # - name: Upload coverage
81+ # uses: codecov/codecov-action@v6
82+ # with:
83+ # fail_ci_if_error: false
84+ # files: ./coverage.xml
85+
86+
87+ # test-py3x:
88+ # runs-on: ubuntu-latest
89+ # strategy:
90+ # matrix:
91+ # python-version: ['3.10', '3.11', '3.12']
92+ # steps:
93+ # - uses: actions/checkout@v6
94+ # with:
95+ # fetch-depth: 0
96+ # - name: Set up Python ${{ matrix.python-version }}
97+ # uses: actions/setup-python@v6
98+ # with:
99+ # python-version: ${{ matrix.python-version }}
100+ # cache: pip
101+ # - name: Install CPU PyTorch
102+ # run: |
103+ # python -m pip install --upgrade pip wheel wheel-stub
104+ # python -m pip install torch==2.8.0 torchvision --extra-index-url https://download.pytorch.org/whl/cpu
105+ # - name: Install the dependencies
106+ # run: |
107+ # find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
108+ # python -m pip install --no-build-isolation -r requirements-min.txt # necessary only here for some reason?
109+ # python -m pip install --no-build-isolation -r requirements-dev.txt
110+ # - name: Run quick tests CPU ubuntu
111+ # env:
112+ # NGC_API_KEY: ${{ secrets.NGC_API_KEY }}
113+ # NGC_ORG: ${{ secrets.NGC_ORG }}
114+ # NGC_TEAM: ${{ secrets.NGC_TEAM }}
115+ # TRANSFORMERS_VERBOSITY: error # stifle huggingface transformers warnings about aliases
116+ # run: |
117+ # python -m pip list
118+ # python -c 'import torch; print(torch.__version__); print(torch.rand(5,3))'
119+ # BUILD_MONAI=0 python -m pip install --no-build-isolation -e .
120+ # ./runtests.sh --coverage --quick --unittests --disttests
121+
122+ # # TODO: update installation process to allow testing with and without compiled libraries as intended here
123+ # #BUILD_MONAI=0 ./runtests.sh --build --coverage --quick --unittests
124+ # #./runtests.sh --clean
125+ # #BUILD_MONAI=1 ./runtests.sh --build --coverage --quick --min
126+ # coverage xml --ignore-errors
127+ # - name: Upload coverage
128+ # uses: codecov/codecov-action@v6
129+ # with:
130+ # fail_ci_if_error: false
131+ # files: ./coverage.xml
115132
116133 install : # pip install from github url, the default branch is dev
117134 runs-on : ubuntu-latest
@@ -120,18 +137,9 @@ jobs:
120137 uses : actions/setup-python@v6
121138 with :
122139 python-version : ' 3.10'
123- - name : cache weekly timestamp
124- id : pip-cache
140+ - name : Install CPU PyTorch
125141 run : |
126- echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT
127- - name : cache for pip
128- uses : actions/cache@v5
129- id : cache
130- with :
131- path : |
132- ~/.cache/pip
133- ~/.cache/torch
134- key : ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }}
142+ python -m pip install torch==2.8.0 torchvision --extra-index-url https://download.pytorch.org/whl/cpu
135143 - name : Install the default branch no build (dev branch only)
136144 if : github.ref == 'refs/heads/dev'
137145 run : |
0 commit comments