Skip to content

Commit db63ceb

Browse files
authored
[CI]: Fix circle ci (#9560)
* fix master circle ci * update * update * update * update * fix * cmake * onnx * fix albu install * fix * fix * fix * fix * update * fix * fix * fix * update * fix * update * fix * fix * finally fix ci
1 parent cf43a1b commit db63ceb

File tree

4 files changed

+247
-156
lines changed

4 files changed

+247
-156
lines changed

.circleci/config.yml

Lines changed: 28 additions & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -1,162 +1,34 @@
11
version: 2.1
22

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
225

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]
11810

11911
workflows:
120-
unit_tests:
12+
# the always-run workflow is always triggered, regardless of the pipeline parameters.
13+
always-run:
12114
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

.circleci/docker/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ARG PYTORCH="1.8.1"
2+
ARG CUDA="10.2"
3+
ARG CUDNN="7"
4+
5+
FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel
6+
7+
# To fix GPG key error when running apt-get update
8+
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
9+
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
10+
11+
RUN apt-get update && apt-get install -y ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx git

.circleci/scripts/get_mmcv_var.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
TORCH=$1
4+
CUDA=$2
5+
6+
# 10.2 -> cu102
7+
MMCV_CUDA="cu`echo ${CUDA} | tr -d '.'`"
8+
9+
# MMCV only provides pre-compiled packages for torch 1.x.0
10+
# which works for any subversions of torch 1.x.
11+
# We force the torch version to be 1.x.0 to ease package searching
12+
# and avoid unnecessary rebuild during MMCV's installation.
13+
TORCH_VER_ARR=(${TORCH//./ })
14+
TORCH_VER_ARR[2]=0
15+
printf -v MMCV_TORCH "%s." "${TORCH_VER_ARR[@]}"
16+
MMCV_TORCH=${MMCV_TORCH%?} # Remove the last dot
17+
18+
echo "export MMCV_CUDA=${MMCV_CUDA}" >> $BASH_ENV
19+
echo "export MMCV_TORCH=${MMCV_TORCH}" >> $BASH_ENV

0 commit comments

Comments
 (0)