Skip to content

Commit 46a34c9

Browse files
authored
[Enhancement] CircleCI Setup (#1086)
* uploading circle-ci * uploading circle-ci * uploading circle-ci * correct circleci folder * change mmsegmentation to mmseg in config.yml * adding timm package in circleci * adding timm package in circleci * fix original lint error
1 parent 5f8b935 commit 46a34c9

File tree

3 files changed

+170
-4
lines changed

3 files changed

+170
-4
lines changed

.circleci/config.yml

+161
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
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 mmseg
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+
python -m pip install --upgrade pip
54+
python -m pip install wheel
55+
- run:
56+
name: Install PyTorch
57+
command: |
58+
python -V
59+
python -m pip install torch==<< parameters.torch >>+cpu torchvision==<< parameters.torchvision >>+cpu -f https://download.pytorch.org/whl/torch_stable.html
60+
- run:
61+
name: Install mmseg dependencies
62+
command: |
63+
python -m pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cpu/torch<< parameters.torch >>/index.html
64+
python -m pip install mmdet
65+
python -m pip install -r requirements.txt
66+
- run:
67+
name: Build and install
68+
command: |
69+
python -m pip install -e .
70+
- run:
71+
name: Run unittests
72+
command: |
73+
python -m pip install timm
74+
python -m coverage run --branch --source mmseg -m pytest tests/
75+
python -m coverage xml
76+
python -m coverage report -m
77+
78+
build_cu101:
79+
machine:
80+
image: ubuntu-1604-cuda-10.1:201909-23
81+
resource_class: gpu.nvidia.small
82+
steps:
83+
- checkout
84+
- run:
85+
name: Install Libraries
86+
command: |
87+
sudo apt-get update
88+
sudo apt-get install -y git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx
89+
- run:
90+
name: Configure Python & pip
91+
command: |
92+
pyenv global 3.7.0
93+
python -m pip install --upgrade pip
94+
python -m pip install wheel
95+
- run:
96+
name: Install PyTorch
97+
command: |
98+
python -V
99+
python -m pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
100+
- run:
101+
name: Install mmseg dependencies
102+
# python -m pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch${{matrix.torch_version}}/index.html
103+
command: |
104+
python -m pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.6.0/index.html
105+
python -m pip install mmdet
106+
python -m pip install -r requirements.txt
107+
- run:
108+
name: Build and install
109+
command: |
110+
python setup.py check -m -s
111+
TORCH_CUDA_ARCH_LIST=7.0 python -m pip install -e .
112+
- run:
113+
name: Run unittests
114+
command: |
115+
python -m pip install timm
116+
python -m pytest tests/
117+
118+
workflows:
119+
unit_tests:
120+
jobs:
121+
- lint
122+
- build_cpu:
123+
name: build_cpu_th1.6
124+
torch: 1.6.0
125+
torchvision: 0.7.0
126+
requires:
127+
- lint
128+
- build_cpu:
129+
name: build_cpu_th1.7
130+
torch: 1.7.0
131+
torchvision: 0.8.1
132+
requires:
133+
- lint
134+
- build_cpu:
135+
name: build_cpu_th1.8_py3.9
136+
torch: 1.8.0
137+
torchvision: 0.9.0
138+
python: "3.9.0"
139+
requires:
140+
- lint
141+
- build_cpu:
142+
name: build_cpu_th1.9_py3.8
143+
torch: 1.9.0
144+
torchvision: 0.10.0
145+
python: "3.8.0"
146+
requires:
147+
- lint
148+
- build_cpu:
149+
name: build_cpu_th1.9_py3.9
150+
torch: 1.9.0
151+
torchvision: 0.10.0
152+
python: "3.9.0"
153+
requires:
154+
- lint
155+
- build_cu101:
156+
requires:
157+
- build_cpu_th1.6
158+
- build_cpu_th1.7
159+
- build_cpu_th1.8_py3.9
160+
- build_cpu_th1.9_py3.8
161+
- build_cpu_th1.9_py3.9

.github/workflows/lint.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ jobs:
1616
pip install pre-commit
1717
pre-commit install
1818
- name: Linting
19-
run: pre-commit run --all-files
19+
run: |
20+
sudo apt-add-repository ppa:brightbox/ruby-ng -y
21+
sudo apt-get update
22+
sudo apt-get install -y ruby2.7
23+
pre-commit run --all-files
2024
- name: Check docstring coverage
2125
run: |
2226
pip install interrogate

.pre-commit-config.yaml

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

0 commit comments

Comments
 (0)