Skip to content

Commit 407de2c

Browse files
authored
[CI] Fix CI for deprecation of ubuntu 18.04 (#2397)
* fix ci * fix ci
1 parent 6d9be30 commit 407de2c

File tree

6 files changed

+119
-113
lines changed

6 files changed

+119
-113
lines changed

.circleci/test.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
command: |
2727
pip install interrogate
2828
interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-magic --ignore-regex "__repr__" --fail-under 90 mmdet3d
29+
2930
build_cpu:
3031
parameters:
3132
# The python version must match available image tags in
@@ -49,32 +50,37 @@ jobs:
4950
- run:
5051
name: Configure Python & pip
5152
command: |
52-
python -m pip install --upgrade pip
53-
python -m pip install wheel
54-
python -m pip install typing-extensions --upgrade
53+
pip install --upgrade pip
54+
pip install wheel
5555
- run:
5656
name: Install PyTorch
5757
command: |
5858
python -V
5959
python -m pip install torch==<< parameters.torch >>+cpu torchvision==<< parameters.torchvision >>+cpu -f https://download.pytorch.org/whl/torch_stable.html
60+
- when:
61+
condition:
62+
equal: ["3.9.0", << parameters.python >>]
63+
steps:
64+
- run: pip install "protobuf <= 3.20.1" && sudo apt-get update && sudo apt-get -y install libprotobuf-dev protobuf-compiler cmake
6065
- run:
6166
name: Install mmdet3d dependencies
6267
command: |
6368
python -m pip install git+ssh://[email protected]/open-mmlab/mmengine.git@main
64-
python -m pip install -U openmim
65-
python -m mim install 'mmcv >= 2.0.0rc1'
66-
python -m pip install git+ssh://[email protected]/open-mmlab/[email protected]
67-
python -m pip install -r requirements.txt
69+
pip install -U openmim
70+
mim install 'mmcv >= 2.0.0rc1'
71+
pip install git+ssh://[email protected]/open-mmlab/[email protected]
72+
pip install -r requirements.txt
6873
- run:
6974
name: Build and install
7075
command: |
71-
python -m pip install -e .
76+
pip install -e .
7277
- run:
7378
name: Run unittests
7479
command: |
7580
python -m coverage run --branch --source mmdet3d -m pytest tests/
7681
python -m coverage xml
7782
python -m coverage report -m
83+
7884
build_cuda:
7985
parameters:
8086
torch:
@@ -102,6 +108,7 @@ jobs:
102108
command: |
103109
docker build .circleci/docker -t mmdet3d:gpu --build-arg PYTORCH=<< parameters.torch >> --build-arg CUDA=<< parameters.cuda >> --build-arg CUDNN=<< parameters.cudnn >>
104110
docker run --gpus all -t -d -v /home/circleci/project:/mmdetection3d -v /home/circleci/mmengine:/mmengine -v /home/circleci/mmdetection:/mmdetection -w /mmdetection3d --name mmdet3d mmdet3d:gpu
111+
docker exec mmdet3d apt-get install -y git
105112
- run:
106113
name: Install mmdet3d dependencies
107114
command: |
@@ -118,6 +125,7 @@ jobs:
118125
name: Run unittests
119126
command: |
120127
docker exec mmdet3d python -m pytest tests/
128+
121129
workflows:
122130
pr_stage_lint:
123131
when: << pipeline.parameters.lint_only >>
@@ -142,7 +150,7 @@ workflows:
142150
name: minimum_version_cpu
143151
torch: 1.6.0
144152
torchvision: 0.7.0
145-
python: 3.7.4
153+
python: 3.7.4 # The lowest python 3.7.x version available on CircleCI images
146154
requires:
147155
- lint
148156
- build_cpu:
@@ -171,8 +179,6 @@ workflows:
171179
- build_cuda:
172180
name: minimum_version_gpu
173181
torch: 1.6.0
174-
# Use double quotation mark to explicitly specify its type
175-
# as string instead of number
176182
cuda: "10.1"
177183
filters:
178184
branches:

.github/workflows/publish-to-pypi.yml renamed to .github/workflows/deploy.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
name: deploy
32

43
on: push
@@ -9,7 +8,7 @@ concurrency:
98

109
jobs:
1110
build-n-publish:
12-
runs-on: ubuntu-18.04
11+
runs-on: ubuntu-latest
1312
if: startsWith(github.event.ref, 'refs/tags')
1413
steps:
1514
- uses: actions/checkout@v2
@@ -19,8 +18,10 @@ jobs:
1918
python-version: 3.7
2019
- name: Install torch
2120
run: pip install torch
21+
- name: Install wheel
22+
run: pip install wheel
2223
- name: Build MMDet3D
23-
run: python setup.py sdist
24+
run: python setup.py sdist bdist_wheel
2425
- name: Publish distribution to PyPI
2526
run: |
2627
pip install twine

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ jobs:
2424
- name: Check docstring coverage
2525
run: |
2626
pip install interrogate
27-
interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-regex "__repr__" --fail-under 90 mmdet3d
27+
interrogate -v --ignore-init-method --ignore-magic --ignore-module --ignore-nested-functions --ignore-regex "__repr__" --fail-under 90 mmdet3d

.github/workflows/merge_stage_test.yml

Lines changed: 67 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ concurrency:
1818

1919
jobs:
2020
build_cpu_py:
21-
runs-on: ubuntu-18.04
21+
runs-on: ubuntu-22.04
2222
strategy:
2323
matrix:
2424
python-version: [3.7, 3.8, 3.9]
@@ -27,15 +27,15 @@ jobs:
2727
- torch: 1.8.1
2828
torchvision: 0.9.1
2929
steps:
30-
- uses: actions/checkout@v2
30+
- uses: actions/checkout@v3
3131
- name: Set up Python ${{ matrix.python-version }}
32-
uses: actions/setup-python@v2
32+
uses: actions/setup-python@v4
3333
with:
3434
python-version: ${{ matrix.python-version }}
3535
- name: Upgrade pip
3636
run: pip install pip --upgrade
3737
- name: Install PyTorch
38-
run: pip install torch==${{matrix.torch}}+cpu torchvision==${{matrix.torchvision}}+cpu -f https://download.pytorch.org/whl/torch_stable.html
38+
run: pip install torch==${{matrix.torch}}+cpu torchvision==${{matrix.torchvision}}+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
3939
- name: Install MMEngine
4040
run: pip install git+https://github.com/open-mmlab/mmengine.git@main
4141
- name: Install MMCV
@@ -53,8 +53,9 @@ jobs:
5353
coverage run --branch --source mmdet3d -m pytest tests/
5454
coverage xml
5555
coverage report -m
56+
5657
build_cpu_pt:
57-
runs-on: ubuntu-18.04
58+
runs-on: ubuntu-22.04
5859
strategy:
5960
matrix:
6061
python-version: [3.7]
@@ -72,20 +73,23 @@ jobs:
7273
torchvision: 0.11.2
7374
- torch: 1.11.0
7475
torchvision: 0.12.0
75-
- torch: 1.12.1
76-
torchvision: 0.13.1
76+
- torch: 1.12.0
77+
torchvision: 0.13.0
7778
- torch: 1.13.0
7879
torchvision: 0.14.0
80+
- torch: 2.0.0
81+
torchvision: 0.15.1
82+
python-version: 3.8
7983
steps:
80-
- uses: actions/checkout@v2
84+
- uses: actions/checkout@v3
8185
- name: Set up Python ${{ matrix.python-version }}
82-
uses: actions/setup-python@v2
86+
uses: actions/setup-python@v4
8387
with:
8488
python-version: ${{ matrix.python-version }}
8589
- name: Upgrade pip
8690
run: pip install pip --upgrade
8791
- name: Install PyTorch
88-
run: pip install torch==${{matrix.torch}}+cpu torchvision==${{matrix.torchvision}}+cpu -f https://download.pytorch.org/whl/torch_stable.html
92+
run: pip install torch==${{matrix.torch}}+cpu torchvision==${{matrix.torchvision}}+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
8993
- name: Install MMEngine
9094
run: pip install git+https://github.com/open-mmlab/mmengine.git@main
9195
- name: Install MMCV
@@ -115,7 +119,7 @@ jobs:
115119
fail_ci_if_error: false
116120

117121
build_cu102:
118-
runs-on: ubuntu-18.04
122+
runs-on: ubuntu-22.04
119123
container:
120124
image: pytorch/pytorch:1.8.1-cuda10.2-cudnn7-devel
121125
strategy:
@@ -125,9 +129,9 @@ jobs:
125129
- torch: 1.8.1
126130
cuda: 10.2
127131
steps:
128-
- uses: actions/checkout@v2
132+
- uses: actions/checkout@v3
129133
- name: Set up Python ${{ matrix.python-version }}
130-
uses: actions/setup-python@v2
134+
uses: actions/setup-python@v4
131135
with:
132136
python-version: ${{ matrix.python-version }}
133137
- name: Upgrade pip
@@ -136,14 +140,8 @@ jobs:
136140
run: |
137141
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
138142
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
139-
- name: Install Python-dev
140-
run: apt-get update && apt-get install -y python${{matrix.python-version}}-dev
141-
if: ${{matrix.python-version != 3.9}}
142143
- name: Install system dependencies
143-
run: |
144-
apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6
145-
- name: Install PyTorch
146-
run: python -m pip install torch==1.8.1+cu102 torchvision==0.9.1+cu102 -f https://download.pytorch.org/whl/torch_stable.html
144+
run: apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6
147145
- name: Install mmdet3d dependencies
148146
run: |
149147
pip install git+https://github.com/open-mmlab/mmengine.git@main
@@ -152,28 +150,34 @@ jobs:
152150
pip install git+https://github.com/open-mmlab/[email protected]
153151
pip install -r requirements/tests.txt
154152
- name: Build and install
153+
run: pip install -e .
154+
- name: Run unittests and generate coverage report
155155
run: |
156-
python setup.py check -m -s
157-
TORCH_CUDA_ARCH_LIST=7.0 pip install -e .
158-
build_windows:
159-
runs-on: ${{ matrix.os }}
156+
coverage run --branch --source mmdet3d -m pytest tests/
157+
coverage xml
158+
coverage report -m
159+
160+
build_cu116:
161+
runs-on: ubuntu-22.04
162+
container:
163+
image: pytorch/pytorch:1.13.0-cuda11.6-cudnn8-devel
160164
strategy:
161165
matrix:
162-
os: [windows-2022]
163-
python: [3.7]
164-
platform: [cpu, cu111]
166+
python-version: [3.7]
165167
steps:
166-
- uses: actions/checkout@v2
167-
- name: Set up Python ${{ matrix.python }}
168-
uses: actions/setup-python@v2
168+
- uses: actions/checkout@v3
169+
- name: Set up Python ${{ matrix.python-version }}
170+
uses: actions/setup-python@v4
169171
with:
170-
python-version: ${{ matrix.python }}
172+
python-version: ${{ matrix.python-version }}
171173
- name: Upgrade pip
172174
run: pip install pip --upgrade
173-
- name: Install lmdb
174-
run: pip install lmdb
175-
- name: Install PyTorch
176-
run: pip install torch==1.8.1+${{matrix.platform}} torchvision==0.9.1+${{matrix.platform}} -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
175+
- name: Fetch GPG keys
176+
run: |
177+
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
178+
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
179+
- name: Install system dependencies
180+
run: apt-get update && apt-get install -y git ffmpeg libturbojpeg
177181
- name: Install mmdet3d dependencies
178182
run: |
179183
pip install git+https://github.com/open-mmlab/mmengine.git@main
@@ -182,42 +186,41 @@ jobs:
182186
pip install git+https://github.com/open-mmlab/[email protected]
183187
pip install -r requirements/tests.txt
184188
- name: Build and install
185-
run: |
186-
pip install -e .
189+
run: pip install -e .
187190
- name: Run unittests and generate coverage report
188191
run: |
189-
pytest tests/
190-
build_cu116:
191-
runs-on: ubuntu-18.04
192-
container:
193-
image: pytorch/pytorch:1.13.0-cuda11.6-cudnn8-devel
192+
coverage run --branch --source mmcv -m pytest tests
193+
coverage xml
194+
coverage report -m
195+
196+
build_windows:
197+
runs-on: windows-2022
194198
strategy:
195199
matrix:
196-
python-version: [ 3.7 ]
200+
python-version: [3.7]
201+
platform: [cpu, cu111]
202+
torch: [1.8.1]
203+
torchvision: [0.9.1]
197204
steps:
198-
- uses: actions/checkout@v2
199-
- name: Set up Python ${{ matrix.python-version }}
200-
uses: actions/setup-python@v2
205+
- uses: actions/checkout@v3
206+
- name: Set up Python ${{ matrix.python }}
207+
uses: actions/setup-python@v4
201208
with:
202-
python-version: ${{ matrix.python-version }}
209+
python-version: ${{ matrix.python }}
203210
- name: Upgrade pip
204211
run: pip install pip --upgrade
205-
- name: Fetch GPG keys
212+
- name: Install lmdb
213+
run: pip install lmdb
214+
- name: Install PyTorch
215+
run: pip install torch==${{matrix.torch}}+${{matrix.platform}} torchvision==${{matrix.torchvision}}+${{matrix.platform}} -f https://download.pytorch.org/whl/${{matrix.platform}}/torch_stable.html
216+
- name: Install mmdet3d dependencies
206217
run: |
207-
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
208-
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
209-
- name: Install system dependencies
210-
run: apt-get update && apt-get install -y git ffmpeg libturbojpeg
211-
- name: Install MMEngine from main branch
212-
run: pip install git+https://github.com/open-mmlab/mmengine.git@main
213-
- name: Install ninja to speed the compilation
214-
run: pip install ninja
215-
- name: Build MMCV from source
216-
run: pip install -e . -v
217-
- name: Install unit tests dependencies
218-
run: pip install -r requirements/tests.txt
218+
pip install git+https://github.com/open-mmlab/mmengine.git@main
219+
pip install -U openmim
220+
mim install 'mmcv >= 2.0.0rc1'
221+
pip install git+https://github.com/open-mmlab/[email protected]
222+
pip install -r requirements/tests.txt
223+
- name: Build and install
224+
run: pip install -e .
219225
- name: Run unittests and generate coverage report
220-
run: |
221-
coverage run --branch --source mmcv -m pytest tests
222-
coverage xml
223-
coverage report -m
226+
run: pytest tests/

0 commit comments

Comments
 (0)