From 4016f1348e9be510c66e5c5073fcb2c2339519f4 Mon Sep 17 00:00:00 2001 From: mzr1996 Date: Fri, 17 Feb 2023 15:27:30 +0800 Subject: [PATCH] Fix CI --- .circleci/config.yml | 2 +- .circleci/test.yml | 30 ++++++++++---------- .github/workflows/deploy.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/pr_stage_test.yml | 6 ++-- .github/workflows/publish-to-pypi.yml | 2 +- .github/workflows/test_mim.yml | 2 +- mmpretrain/evaluation/functional/__init__.py | 0 8 files changed, 23 insertions(+), 23 deletions(-) create mode 100644 mmpretrain/evaluation/functional/__init__.py diff --git a/.circleci/config.yml b/.circleci/config.yml index 7d3bb396..7e4aef84 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,7 +22,7 @@ workflows: # line: # mapping: | - mmcls/.* lint_only false + mmpretrain/.* lint_only false requirements/.* lint_only false tests/.* lint_only false .circleci/.* lint_only false diff --git a/.circleci/test.yml b/.circleci/test.yml index 51d533a2..382ad03e 100644 --- a/.circleci/test.yml +++ b/.circleci/test.yml @@ -31,7 +31,7 @@ jobs: name: Check docstring coverage command: | pip install interrogate - interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-magic --ignore-regex "__repr__" --fail-under 60 mmcls + interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-magic --ignore-regex "__repr__" --fail-under 60 mmpretrain build_cpu_with_3rdparty: parameters: # The python version must match available image tags in @@ -63,7 +63,7 @@ jobs: python -V pip install torch==<< parameters.torch >>+cpu torchvision==<< parameters.torchvision >>+cpu -f https://download.pytorch.org/whl/torch_stable.html - run: - name: Install mmcls dependencies + name: Install mmpretrain dependencies command: | pip install git+https://github.com/open-mmlab/mmengine.git@main pip install -U openmim @@ -79,7 +79,7 @@ jobs: - run: name: Run unittests command: | - coverage run --branch --source mmcls -m pytest tests/ + coverage run --branch --source mmpretrain -m pytest tests/ coverage xml coverage report -m @@ -114,7 +114,7 @@ jobs: python -V pip install torch==<< parameters.torch >>+cpu torchvision==<< parameters.torchvision >>+cpu -f https://download.pytorch.org/whl/torch_stable.html - run: - name: Install mmcls dependencies + name: Install mmpretrain dependencies command: | pip install git+https://github.com/open-mmlab/mmengine.git@main pip install -U openmim @@ -128,7 +128,7 @@ jobs: - run: name: Run unittests command: | - coverage run --branch --source mmcls -m pytest tests/ + coverage run --branch --source mmpretrain -m pytest tests/ coverage xml coverage report -m @@ -155,24 +155,24 @@ jobs: - run: name: Build Docker image command: | - docker build .circleci/docker -t mmcls: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:/mmcls -v /home/circleci/mmengine:/mmengine -w /mmcls --name mmcls mmcls:gpu + docker build .circleci/docker -t mmpretrain: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:/mmpretrain -v /home/circleci/mmengine:/mmengine -w /mmpretrain --name mmpretrain mmpretrain:gpu - run: - name: Install mmcls dependencies + name: Install mmpretrain dependencies command: | - docker exec mmcls pip install -e /mmengine - docker exec mmcls pip install -U openmim - docker exec mmcls mim install 'mmcv >= 2.0.0rc1' - docker exec mmcls pip install -r requirements.txt - docker exec mmcls python -c 'import mmcv; print(mmcv.__version__)' + docker exec mmpretrain pip install -e /mmengine + docker exec mmpretrain pip install -U openmim + docker exec mmpretrain mim install 'mmcv >= 2.0.0rc1' + docker exec mmpretrain pip install -r requirements.txt + docker exec mmpretrain python -c 'import mmcv; print(mmcv.__version__)' - run: name: Build and install command: | - docker exec mmcls pip install -e . + docker exec mmpretrain pip install -e . - run: name: Run unittests command: | - docker exec mmcls python -m pytest tests/ + docker exec mmpretrain python -m pytest tests/ # Invoke jobs via workflows # See: https://circleci.com/docs/2.0/configuration-reference/#workflows diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 08936cb2..6d6cc74a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -12,7 +12,7 @@ jobs: uses: actions/setup-python@v2 with: python-version: 3.7 - - name: Build MMClassification + - name: Build MMPretrain run: | pip install wheel python setup.py sdist bdist_wheel diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0c1cd14d..cbefb4a8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -24,4 +24,4 @@ jobs: - name: Check docstring coverage run: | pip install interrogate - interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-magic --ignore-regex "__repr__" --fail-under 60 mmcls + interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-magic --ignore-regex "__repr__" --fail-under 60 mmpretrain diff --git a/.github/workflows/pr_stage_test.yml b/.github/workflows/pr_stage_test.yml index 4f298cc8..be52b572 100644 --- a/.github/workflows/pr_stage_test.yml +++ b/.github/workflows/pr_stage_test.yml @@ -35,7 +35,7 @@ jobs: run: pip install pip --upgrade - name: Install PyTorch run: pip install torch==${{matrix.torch}}+cpu torchvision==${{matrix.torchvision}}+cpu -f https://download.pytorch.org/whl/torch_stable.html - - name: Install mmcls dependencies + - name: Install mmpretrain dependencies run: | pip install git+https://github.com/open-mmlab/mmengine.git@main pip install -U openmim @@ -45,7 +45,7 @@ jobs: run: pip install -e . - name: Run unittests and generate coverage report run: | - coverage run --branch --source mmcls -m pytest tests/ + coverage run --branch --source mmpretrain -m pytest tests/ coverage xml coverage report -m # Upload coverage report for python3.7 && pytorch1.8.1 cpu @@ -74,7 +74,7 @@ jobs: run: python -m pip install pip --upgrade - name: Install PyTorch run: pip install torch==1.8.2+${{matrix.platform}} torchvision==0.9.2+${{matrix.platform}} -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html - - name: Install mmcls dependencies + - name: Install mmpretrain dependencies run: | pip install git+https://github.com/open-mmlab/mmengine.git@main pip install -U openmim diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 08936cb2..6d6cc74a 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -12,7 +12,7 @@ jobs: uses: actions/setup-python@v2 with: python-version: 3.7 - - name: Build MMClassification + - name: Build MMPretrain run: | pip install wheel python setup.py sdist bdist_wheel diff --git a/.github/workflows/test_mim.yml b/.github/workflows/test_mim.yml index f437e4e5..09dfef8c 100644 --- a/.github/workflows/test_mim.yml +++ b/.github/workflows/test_mim.yml @@ -41,4 +41,4 @@ jobs: - name: Build and install run: mim install -e . - name: test commands of mim - run: mim search mmcls + run: mim search mmpretrain diff --git a/mmpretrain/evaluation/functional/__init__.py b/mmpretrain/evaluation/functional/__init__.py new file mode 100644 index 00000000..e69de29b