Skip to content

Commit

Permalink
[Refactor] Update Github Action CI and CircleCI (#512)
Browse files Browse the repository at this point in the history
* [CI] Update Github Action CI and CircleCI

* clear outdated commands in CI

* clear outdated commands in CI

* add '-r' when installing packages from txt

* update

* update circleci

* fix mismatch conflicts

* update

* install system dependencies

* update

* set env

* fix ut

* update cuda version on Windows

* update push action
  • Loading branch information
zhouzaida committed Sep 7, 2022
1 parent ba1c368 commit 19d4eba
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 391 deletions.
19 changes: 0 additions & 19 deletions .circleci/scripts/get_mmcv_var.sh

This file was deleted.

66 changes: 27 additions & 39 deletions .circleci/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,17 @@ jobs:
- run:
name: Upgrade pip
command: |
python -V
python -m pip install pip --upgrade
python -m pip --version
pip install pip --upgrade
pip --version
- run:
name: Install mmengine dependencies
command: python -m pip install -r requirements.txt
name: Build MMEngine from source
command: pip install -e . -v
- run:
name: Build and install
command: python -m pip install -e .
name: Install unit tests dependencies
command: pip install -r requirements/tests.txt
- run:
name: Run unit tests
command: python -m pytest tests/test_config tests/test_registry tests/test_fileio tests/test_logging tests/test_utils --ignore=tests/test_utils/test_dl_utils
command: pytest tests/test_config tests/test_registry tests/test_fileio tests/test_logging tests/test_utils --ignore=tests/test_utils/test_dl_utils

build_cpu:
parameters:
Expand All @@ -70,11 +69,6 @@ jobs:
resource_class: large
steps:
- checkout
- run:
name: Get MMCV_TORCH as environment variables
command: |
. .circleci/scripts/get_mmcv_var.sh << parameters.torch >>
source $BASH_ENV
- run:
name: Install Libraries
command: |
Expand All @@ -83,28 +77,26 @@ jobs:
- run:
name: Configure Python & pip
command: |
python -m pip install --upgrade pip
python -m pip install wheel
pip install --upgrade pip
pip install wheel
- run:
name: Install PyTorch
command: |
python -V
python -m pip install torch==<< parameters.torch >>+cpu torchvision==<< parameters.torchvision >>+cpu -f https://download.pytorch.org/whl/torch_stable.html
command: pip install torch==<< parameters.torch >>+cpu torchvision==<< parameters.torchvision >>+cpu -f https://download.pytorch.org/whl/torch_stable.html
- run:
name: Install MMEngine dependencies
# python -m pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cpu/torch${MMCV_TORCH}/index.html
command: |
python -m pip install -r requirements.txt
name: Build MMEngine from source
command: pip install -e . -v
- run:
name: Build and install
name: Install unit tests dependencies
command: |
python -m pip install -e .
pip install -r requirements/tests.txt
pip install openmim
mim install 'mmcv>=2.0.0rc1'
- run:
name: Run unittests
command: |
python -m coverage run --branch --source mmengine -m pytest tests/
python -m coverage xml
python -m coverage report -m
coverage run --branch --source mmengine -m pytest tests/
coverage xml
coverage report -m
build_cuda:
parameters:
Expand All @@ -122,25 +114,21 @@ jobs:
resource_class: gpu.nvidia.small
steps:
- checkout
- run:
name: Get MMCV_TORCH and MMCV_CUDA as environment variables
command: |
. .circleci/scripts/get_mmcv_var.sh << parameters.torch >> << parameters.cuda >>
source $BASH_ENV
- run:
name: Build Docker image
command: |
docker build .circleci/docker -t mmengine:gpu --build-arg PYTORCH=<< parameters.torch >> --build-arg CUDA=<< parameters.cuda >> --build-arg CUDNN=<< parameters.cudnn >>
docker run --gpus all -t -d -v /home/circleci/project:/mmengine -w /mmengine --name mmengine mmengine:gpu
- run:
name: Install mmengine dependencies
# docker exec mmengine pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/${MMCV_CUDA}/torch${MMCV_TORCH}/index.html
name: Build MMEngine from source
command: |
docker exec mmengine pip install -r requirements.txt
docker exec mmengine pip install -e . -v
- run:
name: Build and install
name: Install unit tests dependencies
command: |
docker exec mmengine pip install -e .
docker exec mmengine pip install -r requirements/tests.txt
docker exec mmengine pip install openmim
docker exec mmengine mim install 'mmcv>=2.0.0rc1'
- run:
name: Run unittests
command: |
Expand Down Expand Up @@ -180,8 +168,8 @@ workflows:
- lint
- build_cpu:
name: maximum_version_cpu
torch: 1.9.0
torchvision: 0.10.0
torch: 1.12.1
torchvision: 0.13.1
python: 3.9.0
requires:
- minimum_version_cpu
Expand Down
221 changes: 0 additions & 221 deletions .github/workflows/build.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
- name: Check docstring coverage
run: |
pip install interrogate
interrogate -v --ignore-init-method --ignore-magic --ignore-module --ignore-nested-functions --ignore-regex "__repr__" --fail-under 95 mmengine
interrogate -v --ignore-init-method --ignore-magic --ignore-module --ignore-nested-functions --ignore-regex "__repr__" --fail-under 80 mmengine

0 comments on commit 19d4eba

Please sign in to comment.