[Fix] Update CI (#1454)

* update ci

* update window ci

* update window ci

* update window ci

* update window ci

* update window ci

* update window ci

* update window ci

* update window ci

* update window ci

* update window ci

* update window ci

* ignore tests/test_tools.py
pull/1447/head
Ezra-Yu 2023-04-06 10:52:08 +08:00 committed by GitHub
parent 568188a6b0
commit 3a25b13eb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 101 additions and 46 deletions

View File

@ -67,7 +67,7 @@ jobs:
command: |
pip install git+https://github.com/open-mmlab/mmengine.git@main
pip install -U openmim
mim install 'mmcv >= 2.0.0rc1'
mim install 'mmcv >= 2.0.0rc4'
pip install timm
pip install transformers
pip install -r requirements.txt
@ -118,7 +118,7 @@ jobs:
command: |
pip install git+https://github.com/open-mmlab/mmengine.git@main
pip install -U openmim
mim install 'mmcv >= 2.0.0rc1'
mim install 'mmcv >= 2.0.0rc4'
pip install -r requirements.txt
python -c 'import mmcv; print(mmcv.__version__)'
- run:
@ -141,7 +141,7 @@ jobs:
type: string
cuda:
type: enum
enum: ["11.1"]
enum: ["11.1", "11.7"]
cudnn:
type: integer
default: 8
@ -162,7 +162,7 @@ jobs:
command: |
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 mim install 'mmcv >= 2.0.0rc4'
docker exec mmpretrain pip install -r requirements.txt
docker exec mmpretrain python -c 'import mmcv; print(mmcv.__version__)'
- run:
@ -208,7 +208,7 @@ workflows:
- build_cpu_with_3rdparty:
name: maximum_version_cpu
torch: 2.0.0
torchvision: 0.15.0
torchvision: 0.15.1
python: 3.10.0
requires:
- minimum_version_cpu
@ -224,6 +224,13 @@ workflows:
cuda: "11.1"
requires:
- hold
- build_cuda:
name: maximum_version_gpu
torch: 2.0.0
cuda: "11.7"
cudnn: 8
requires:
- hold
merge_stage_test:
when:
not:

View File

@ -7,9 +7,9 @@ jobs:
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Build MMPretrain

View File

@ -10,9 +10,9 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install pre-commit hook

View File

@ -18,7 +18,7 @@ concurrency:
jobs:
build:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [3.7]
@ -26,9 +26,9 @@ jobs:
- torch: 1.8.1
torchvision: 0.9.1
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
@ -39,7 +39,7 @@ jobs:
run: |
pip install git+https://github.com/open-mmlab/mmengine.git@main
pip install -U openmim
mim install 'mmcv >= 2.0.0rc1'
mim install 'mmcv >= 2.0.0rc4'
pip install -r requirements.txt
- name: Build and install
run: pip install -e .
@ -58,16 +58,64 @@ jobs:
name: codecov-umbrella
fail_ci_if_error: false
build_cu117:
runs-on: ubuntu-22.04
container:
image: pytorch/pytorch:2.0.0-cuda11.7-cudnn8-devel
strategy:
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: pip install pip --upgrade
- name: Fetch GPG keys
run: |
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
- name: Install Python-dev
run: apt-get update && apt-get install -y python${{matrix.python-version}}-dev
if: ${{matrix.python-version != 3.9}}
- name: Install system dependencies
run: |
apt-get update
apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libxrender-dev libc6 libc6-dev
- name: Install mmpretrain dependencies
run: |
pip install git+https://github.com/open-mmlab/mmengine.git@main
pip install -U openmim
mim install 'mmcv >= 2.0.0rc4'
pip install -r requirements.txt
- name: Build and install
run: pip install -e .
- name: Run unittests and generate coverage report
run: |
coverage run --branch --source mmpretrain -m pytest tests/ --ignore tests/test_tools.py
coverage xml
coverage report -m
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.0.14
with:
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
build_windows:
runs-on: windows-2022
strategy:
matrix:
python: [3.7]
python-version: [3.7]
platform: [cpu]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
@ -78,10 +126,10 @@ jobs:
run: |
pip install -U openmim
mim install mmengine
mim install 'mmcv >= 2.0.0rc1'
mim install 'mmcv >= 2.0.0rc4'
pip install -r requirements.txt
- name: Build and install
run: pip install -e .
run: pip install -e . -v
- name: Run unittests
run: |
pytest tests/ --ignore tests/test_models/test_backbones

View File

@ -7,9 +7,9 @@ jobs:
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Build MMPretrain

View File

@ -17,7 +17,7 @@ concurrency:
jobs:
build_cpu:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [3.7]
@ -27,9 +27,9 @@ jobs:
torch_version: torch1.8
torchvision: 0.9.0
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip

View File

@ -6,8 +6,8 @@ from mmengine.utils import digit_version
from .apis import * # noqa: F401, F403
from .version import __version__
mmcv_minimum_version = '2.0.0rc1'
mmcv_maximum_version = '2.0.0'
mmcv_minimum_version = '2.0.0rc4'
mmcv_maximum_version = '2.1.0'
mmcv_version = digit_version(mmcv.__version__)
mmengine_minimum_version = '0.5.0'

View File

@ -55,7 +55,7 @@ class TestAnalyzeLogs(TestCase):
'python',
'tools/analysis_tools/analyze_logs.py',
'cal_train_time',
self.log_file,
str(self.log_file),
]
p = Popen(command, cwd=MMPRE_ROOT, stdout=PIPE)
out, _ = p.communicate()
@ -65,7 +65,7 @@ class TestAnalyzeLogs(TestCase):
'python',
'tools/analysis_tools/analyze_logs.py',
'plot_curve',
self.log_file,
str(self.log_file),
'--keys',
'accuracy/top1',
'--out',
@ -113,10 +113,10 @@ class TestAnalyzeResults(TestCase):
command = [
'python',
'tools/analysis_tools/analyze_results.py',
self.config_file,
self.result_file,
str(self.config_file),
str(self.result_file),
'--out-dir',
self.tmpdir.name,
str(self.tmpdir.name),
]
p = Popen(command, cwd=MMPRE_ROOT, stdout=PIPE)
p.communicate()
@ -137,7 +137,7 @@ class TestPrintConfig(TestCase):
command = [
'python',
'tools/misc/print_config.py',
self.config_file,
str(self.config_file),
]
p = Popen(command, cwd=MMPRE_ROOT, stdout=PIPE)
out, _ = p.communicate()
@ -170,9 +170,9 @@ class TestVerifyDataset(TestCase):
command = [
'python',
'tools/misc/verify_dataset.py',
self.config_file,
str(self.config_file),
'--out-path',
self.dir / 'log.log',
str(self.dir / 'log.log'),
]
p = Popen(command, cwd=MMPRE_ROOT, stdout=PIPE)
out, _ = p.communicate()
@ -204,7 +204,7 @@ class TestEvalMetric(TestCase):
command = [
'python',
'tools/analysis_tools/eval_metric.py',
self.result_file,
str(self.result_file),
'--metric',
'type=Accuracy',
'topk=1,2',
@ -244,7 +244,7 @@ class TestVisScheduler(TestCase):
command = [
'python',
'tools/visualization/vis_scheduler.py',
self.config_file,
str(self.config_file),
'--dataset-size',
'100',
'--not-show',
@ -280,8 +280,8 @@ class TestPublishModel(TestCase):
command = [
'python',
'tools/model_converters/publish_model.py',
self.ckpt_file,
self.ckpt_file,
str(self.ckpt_file),
str(self.ckpt_file),
'--dataset-type',
'ImageNet',
'--no-ema',
@ -318,11 +318,11 @@ class TestVisCam(TestCase):
command = [
'python',
'tools/visualization/vis_cam.py',
ASSETS_ROOT / 'color.jpg',
self.config_file,
self.ckpt_file,
str(ASSETS_ROOT / 'color.jpg'),
str(self.config_file),
str(self.ckpt_file),
'--save-path',
self.dir / 'cam.jpg',
str(self.dir / 'cam.jpg'),
]
p = Popen(command, cwd=MMPRE_ROOT, stdout=PIPE)
out, _ = p.communicate()
@ -354,10 +354,10 @@ class TestConfusionMatrix(TestCase):
command = [
'python',
'tools/analysis_tools/confusion_matrix.py',
self.config_file,
self.result_file,
str(self.config_file),
str(self.result_file),
'--out',
self.dir / 'result.pkl',
str(self.dir / 'result.pkl'),
]
Popen(command, cwd=MMPRE_ROOT, stdout=PIPE).wait()
result = mmengine.load(self.dir / 'result.pkl')
@ -396,9 +396,9 @@ class TestVisTsne(TestCase):
command = [
'python',
'tools/visualization/vis_tsne.py',
self.config_file,
str(self.config_file),
'--work-dir',
self.dir,
str(self.dir),
'--perplexity',
'2',
]