|
1 | 1 | version: 2.1 |
2 | 2 |
|
3 | | -jobs: |
4 | | - lint: |
5 | | - docker: |
6 | | - - image: cimg/python:3.7.4 |
7 | | - steps: |
8 | | - - checkout |
9 | | - - run: |
10 | | - name: Install pre-commit hook |
11 | | - command: | |
12 | | - pip install pre-commit |
13 | | - pre-commit install |
14 | | - - run: |
15 | | - name: Linting |
16 | | - command: pre-commit run --all-files |
17 | | - - run: |
18 | | - name: Check docstring coverage |
19 | | - command: | |
20 | | - pip install interrogate |
21 | | - interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-regex "__repr__" --fail-under 50 mmdet |
| 3 | +# this allows you to use CircleCI's dynamic configuration feature |
| 4 | +setup: true |
22 | 5 |
|
23 | | - build_cpu: |
24 | | - parameters: |
25 | | - # The python version must match available image tags in |
26 | | - # https://circleci.com/developer/images/image/cimg/python |
27 | | - python: |
28 | | - type: string |
29 | | - default: "3.7.4" |
30 | | - torch: |
31 | | - type: string |
32 | | - torchvision: |
33 | | - type: string |
34 | | - docker: |
35 | | - - image: cimg/python:<< parameters.python >> |
36 | | - resource_class: large |
37 | | - steps: |
38 | | - - checkout |
39 | | - - run: |
40 | | - name: Install Libraries |
41 | | - command: | |
42 | | - sudo apt-get update |
43 | | - sudo apt-get install -y ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx libjpeg-dev zlib1g-dev libtinfo-dev libncurses5 |
44 | | - - run: |
45 | | - name: Configure Python & pip |
46 | | - command: | |
47 | | - pip install --upgrade pip |
48 | | - pip install wheel |
49 | | - - run: |
50 | | - name: Install PyTorch |
51 | | - command: | |
52 | | - python -V |
53 | | - pip install torch==<< parameters.torch >>+cpu torchvision==<< parameters.torchvision >>+cpu -f https://download.pytorch.org/whl/torch_stable.html |
54 | | - - when: |
55 | | - condition: |
56 | | - equal: [ "3.9.0", << parameters.python >> ] |
57 | | - steps: |
58 | | - - run: pip install "protobuf <= 3.20.1" && sudo apt-get update && sudo apt-get -y install libprotobuf-dev protobuf-compiler cmake |
59 | | - - run: |
60 | | - name: Install mmdet dependencies |
61 | | - command: | |
62 | | - pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cpu/torch<< parameters.torch >>/index.html |
63 | | - pip install -r requirements/tests.txt -r requirements/optional.txt |
64 | | - pip install albumentations>=0.3.2 --no-binary imgaug,albumentations |
65 | | - pip install git+https://github.com/cocodataset/panopticapi.git |
66 | | - - run: |
67 | | - name: Build and install |
68 | | - command: | |
69 | | - pip install -e . |
70 | | - - run: |
71 | | - name: Run unittests |
72 | | - command: | |
73 | | - coverage run --branch --source mmdet -m pytest tests/ |
74 | | - coverage xml |
75 | | - coverage report -m |
76 | | -
|
77 | | - build_cu101: |
78 | | - machine: |
79 | | - image: ubuntu-1604-cuda-10.1:201909-23 |
80 | | - resource_class: gpu.nvidia.small |
81 | | - steps: |
82 | | - - checkout |
83 | | - - run: |
84 | | - name: Install Libraries |
85 | | - command: | |
86 | | - sudo apt-get update |
87 | | - sudo apt-get install -y git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx |
88 | | - - run: |
89 | | - name: Configure Python & pip |
90 | | - command: | |
91 | | - pyenv global 3.7.0 |
92 | | - pip install --upgrade pip |
93 | | - pip install wheel |
94 | | - - run: |
95 | | - name: Install PyTorch |
96 | | - command: | |
97 | | - python -V |
98 | | - pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html |
99 | | - - run: |
100 | | - name: Install mmdet dependencies |
101 | | - # pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch${{matrix.torch_version}}/index.html |
102 | | - command: | |
103 | | - pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.6.0/index.html |
104 | | - pip install -r requirements/tests.txt -r requirements/optional.txt |
105 | | - pip install pycocotools |
106 | | - pip install albumentations>=0.3.2 --no-binary imgaug,albumentations |
107 | | - pip install git+https://github.com/cocodataset/panopticapi.git |
108 | | - python -c 'import mmcv; print(mmcv.__version__)' |
109 | | - - run: |
110 | | - name: Build and install |
111 | | - command: | |
112 | | - python setup.py check -m -s |
113 | | - TORCH_CUDA_ARCH_LIST=7.0 pip install -e . |
114 | | - - run: |
115 | | - name: Run unittests |
116 | | - command: | |
117 | | - pytest tests/ |
| 6 | +# the path-filtering orb is required to continue a pipeline based on |
| 7 | +# the path of an updated fileset |
| 8 | +orbs: |
| 9 | + path-filtering: circleci/[email protected] |
118 | 10 |
|
119 | 11 | workflows: |
120 | | - unit_tests: |
| 12 | + # the always-run workflow is always triggered, regardless of the pipeline parameters. |
| 13 | + always-run: |
121 | 14 | jobs: |
122 | | - - lint |
123 | | - - build_cpu: |
124 | | - name: build_cpu_th1.6 |
125 | | - torch: 1.6.0 |
126 | | - torchvision: 0.7.0 |
127 | | - requires: |
128 | | - - lint |
129 | | - - build_cpu: |
130 | | - name: build_cpu_th1.7 |
131 | | - torch: 1.7.0 |
132 | | - torchvision: 0.8.1 |
133 | | - requires: |
134 | | - - lint |
135 | | - - build_cpu: |
136 | | - name: build_cpu_th1.8_py3.9 |
137 | | - torch: 1.8.0 |
138 | | - torchvision: 0.9.0 |
139 | | - python: "3.9.0" |
140 | | - requires: |
141 | | - - lint |
142 | | - - build_cpu: |
143 | | - name: build_cpu_th1.9_py3.8 |
144 | | - torch: 1.9.0 |
145 | | - torchvision: 0.10.0 |
146 | | - python: "3.8.12" |
147 | | - requires: |
148 | | - - lint |
149 | | - - build_cpu: |
150 | | - name: build_cpu_th1.9_py3.9 |
151 | | - torch: 1.9.0 |
152 | | - torchvision: 0.10.0 |
153 | | - python: "3.9.0" |
154 | | - requires: |
155 | | - - lint |
156 | | - - build_cu101: |
157 | | - requires: |
158 | | - - build_cpu_th1.6 |
159 | | - - build_cpu_th1.7 |
160 | | - - build_cpu_th1.8_py3.9 |
161 | | - - build_cpu_th1.9_py3.8 |
162 | | - - build_cpu_th1.9_py3.9 |
| 15 | + # the path-filtering/filter job determines which pipeline |
| 16 | + # parameters to update. |
| 17 | + - path-filtering/filter: |
| 18 | + name: check-updated-files |
| 19 | + # 3-column, whitespace-delimited mapping. One mapping per |
| 20 | + # line: |
| 21 | + # <regex path-to-test> <parameter-to-set> <value-of-pipeline-parameter> |
| 22 | + mapping: | |
| 23 | + mmdet/.* lint_only false |
| 24 | + requirements/.* lint_only false |
| 25 | + tests/.* lint_only false |
| 26 | + tools/.* lint_only false |
| 27 | + configs/.* lint_only false |
| 28 | + .circleci/.* lint_only false |
| 29 | + base-revision: master |
| 30 | + # this is the path of the configuration we should trigger once |
| 31 | + # path filtering and pipeline parameter value updates are |
| 32 | + # complete. In this case, we are using the parent dynamic |
| 33 | + # configuration itself. |
| 34 | + config-path: .circleci/test.yml |
0 commit comments