|
| 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 |
0 commit comments