Skip to content

Commit f08548b

Browse files
hhaAndroidZwwWayne
authored andcommitted
Support circleci (#6630)
* add ci * rename * fix mmtrack unittest * update mmcv version
1 parent 346c912 commit f08548b

File tree

5 files changed

+178
-8
lines changed

5 files changed

+178
-8
lines changed

.circleci/config.yml

+168
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
version: 2.1
2+
3+
jobs:
4+
lint:
5+
docker:
6+
- image: cimg/python:3.7.4
7+
steps:
8+
- checkout
9+
- run:
10+
name: Install dependencies
11+
command: |
12+
sudo apt-add-repository ppa:brightbox/ruby-ng -y
13+
sudo apt-get update
14+
sudo apt-get install -y ruby2.7
15+
- run:
16+
name: Install pre-commit hook
17+
command: |
18+
pip install pre-commit
19+
pre-commit install
20+
- run:
21+
name: Linting
22+
command: pre-commit run --all-files
23+
- run:
24+
name: Check docstring coverage
25+
command: |
26+
pip install interrogate
27+
interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-regex "__repr__" --fail-under 50 mmdet
28+
29+
build_cpu:
30+
parameters:
31+
# The python version must match available image tags in
32+
# https://circleci.com/developer/images/image/cimg/python
33+
python:
34+
type: string
35+
default: "3.7.4"
36+
torch:
37+
type: string
38+
torchvision:
39+
type: string
40+
docker:
41+
- image: cimg/python:<< parameters.python >>
42+
resource_class: large
43+
steps:
44+
- checkout
45+
- run:
46+
name: Install Libraries
47+
command: |
48+
sudo apt-get update
49+
sudo apt-get install -y ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx libjpeg-dev zlib1g-dev libtinfo-dev libncurses5
50+
- run:
51+
name: Configure Python & pip
52+
command: |
53+
pip install --upgrade pip
54+
pip install wheel
55+
- run:
56+
name: Install PyTorch
57+
command: |
58+
python -V
59+
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 && sudo apt-get update && sudo apt-get -y install libprotobuf-dev protobuf-compiler cmake
65+
- run:
66+
name: Install mmdet dependencies
67+
command: |
68+
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cpu/torch<< parameters.torch >>/index.html
69+
pip install -r requirements/tests.txt -r requirements/optional.txt
70+
pip install albumentations>=0.3.2 --no-binary imgaug,albumentations
71+
pip install git+https://github.com/cocodataset/panopticapi.git
72+
- run:
73+
name: Build and install
74+
command: |
75+
pip install -e .
76+
- run:
77+
name: Run unittests
78+
command: |
79+
coverage run --branch --source mmdet -m pytest tests/
80+
coverage xml
81+
coverage report -m
82+
83+
build_cu101:
84+
machine:
85+
image: ubuntu-1604-cuda-10.1:201909-23
86+
resource_class: gpu.nvidia.small
87+
steps:
88+
- checkout
89+
- run:
90+
name: Install Libraries
91+
command: |
92+
sudo apt-get update
93+
sudo apt-get install -y git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx
94+
- run:
95+
name: Configure Python & pip
96+
command: |
97+
pyenv global 3.7.0
98+
pip install --upgrade pip
99+
pip install wheel
100+
- run:
101+
name: Install PyTorch
102+
command: |
103+
python -V
104+
pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
105+
- run:
106+
name: Install mmdet dependencies
107+
# pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch${{matrix.torch_version}}/index.html
108+
command: |
109+
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.6.0/index.html
110+
pip install -r requirements/tests.txt -r requirements/optional.txt
111+
pip install pycocotools
112+
pip install albumentations>=0.3.2 --no-binary imgaug,albumentations
113+
pip install git+https://github.com/cocodataset/panopticapi.git
114+
python -c 'import mmcv; print(mmcv.__version__)'
115+
- run:
116+
name: Build and install
117+
command: |
118+
python setup.py check -m -s
119+
TORCH_CUDA_ARCH_LIST=7.0 pip install -e .
120+
- run:
121+
name: Run unittests
122+
command: |
123+
pytest tests/
124+
125+
workflows:
126+
unit_tests:
127+
jobs:
128+
- lint
129+
- build_cpu:
130+
name: build_cpu_th1.6
131+
torch: 1.6.0
132+
torchvision: 0.7.0
133+
requires:
134+
- lint
135+
- build_cpu:
136+
name: build_cpu_th1.7
137+
torch: 1.7.0
138+
torchvision: 0.8.1
139+
requires:
140+
- lint
141+
- build_cpu:
142+
name: build_cpu_th1.8_py3.9
143+
torch: 1.8.0
144+
torchvision: 0.9.0
145+
python: "3.9.0"
146+
requires:
147+
- lint
148+
- build_cpu:
149+
name: build_cpu_th1.9_py3.8
150+
torch: 1.9.0
151+
torchvision: 0.10.0
152+
python: "3.8.12"
153+
requires:
154+
- lint
155+
- build_cpu:
156+
name: build_cpu_th1.9_py3.9
157+
torch: 1.9.0
158+
torchvision: 0.10.0
159+
python: "3.9.0"
160+
requires:
161+
- lint
162+
- build_cu101:
163+
requires:
164+
- build_cpu_th1.6
165+
- build_cpu_th1.7
166+
- build_cpu_th1.8_py3.9
167+
- build_cpu_th1.9_py3.8
168+
- build_cpu_th1.9_py3.9

.pre-commit-config.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ repos:
2828
args: ["--remove"]
2929
- id: mixed-line-ending
3030
args: ["--fix=lf"]
31-
- repo: https://github.com/jumanjihouse/pre-commit-hooks
32-
rev: 2.1.4
31+
- repo: https://github.com/markdownlint/markdownlint
32+
rev: v0.11.0
3333
hooks:
3434
- id: markdownlint
35-
args: ["-r", "~MD002,~MD013,~MD024,~MD029,~MD033,~MD034,~MD036", "-t", "allow_different_nesting"]
35+
args: ["-r", "~MD002,~MD013,~MD029,~MD033,~MD034",
36+
"-t", "allow_different_nesting"]
3637
- repo: https://github.com/codespell-project/codespell
3738
rev: v2.1.0
3839
hooks:

docs/get_started.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ Compatible MMDetection and MMCV versions are shown as below. Please install the
1111

1212
| MMDetection version | MMCV version |
1313
|:-------------------:|:-------------------:|
14-
| master | mmcv-full>=1.3.14, <1.4.0 |
15-
| 2.18.0 | mmcv-full>=1.3.14, <1.4.0 |
14+
| master | mmcv-full>=1.3.17, <1.5.0 |
15+
| 2.19.0 | mmcv-full>=1.3.17, <1.5.0 |
16+
| 2.18.0 | mmcv-full>=1.3.17, <1.4.0 |
1617
| 2.17.0 | mmcv-full>=1.3.14, <1.4.0 |
1718
| 2.16.0 | mmcv-full>=1.3.8, <1.4.0 |
1819
| 2.15.1 | mmcv-full>=1.3.8, <1.4.0 |

docs_zh-CN/get_started.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ MMDetection 和 MMCV 版本兼容性如下所示,需要安装正确的 MMCV
1111

1212
| MMDetection 版本 | MMCV 版本 |
1313
| :--------------: | :----------------------: |
14-
| master | mmcv-full>=1.3.17, <1.4.0 |
15-
| 2.19.0 | mmcv-full>=1.3.17, <1.4.0 |
14+
| master | mmcv-full>=1.3.17, <1.5.0 |
15+
| 2.19.0 | mmcv-full>=1.3.17, <1.5.0 |
1616
| 2.18.1 | mmcv-full>=1.3.17, <1.4.0 |
1717
| 2.18.0 | mmcv-full>=1.3.14, <1.4.0 |
1818
| 2.17.0 | mmcv-full>=1.3.14, <1.4.0 |

requirements/tests.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ interrogate
55
isort==4.3.21
66
# Note: used for kwarray.group_items, this may be ported to mmcv in the future.
77
kwarray
8-
mmtrack
8+
-e git+https://github.com/open-mmlab/mmtracking#egg=mmtrack
99
onnx==1.7.0
1010
onnxruntime>=1.8.0
1111
pytest

0 commit comments

Comments
 (0)