-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Enhancement] Use docker to accelerate CI (#973)
* Using docker to skip CUDA installation in CI * use docker image in workflows/build * add cu102 and torch1.9.0 test * remove torch1.3.0 from CI * fix python3.9-dev installation * remove sudo * update turbojpeg installation * remove sudo * fix onnx-runtime dependency installation * remove pip installation from CI * fix mmcv index url * fix non-ascii character in macaque.py to avoid config parsing error
- Loading branch information
Showing
4 changed files
with
80 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,10 +35,8 @@ jobs: | |
strategy: | ||
matrix: | ||
python-version: [3.7] | ||
torch: [1.3.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0] | ||
torch: [1.5.0, 1.6.0, 1.7.0, 1.8.0] | ||
include: | ||
- torch: 1.3.0 | ||
torchvision: 0.4.1 | ||
- torch: 1.5.0 | ||
torchvision: 0.6.0 | ||
- torch: 1.6.0 | ||
|
@@ -74,20 +72,15 @@ jobs: | |
coverage xml | ||
coverage report -m | ||
build_cuda: | ||
build_cuda101: | ||
runs-on: ubuntu-18.04 | ||
|
||
env: | ||
CUDA: 10.1.105-1 | ||
CUDA_SHORT: 10.1 | ||
UBUNTU_VERSION: ubuntu1804 | ||
container: | ||
image: pytorch/pytorch:1.6.0-cuda10.1-cudnn7-devel | ||
strategy: | ||
matrix: | ||
python-version: [3.7] | ||
torch: [1.3.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0] | ||
torch: [1.5.0, 1.6.0, 1.7.0, 1.8.0] | ||
include: | ||
- torch: 1.3.0 | ||
torchvision: 0.4.1 | ||
- torch: 1.5.0 | ||
torchvision: 0.6.0 | ||
- torch: 1.6.0 | ||
|
@@ -96,78 +89,105 @@ jobs: | |
torchvision: 0.8.1 | ||
- torch: 1.8.0 | ||
torchvision: 0.9.0 | ||
- python-version: 3.6 | ||
torch: 1.7.0 | ||
torchvision: 0.8.1 | ||
- python-version: 3.8 | ||
torch: 1.7.0 | ||
torchvision: 0.8.1 | ||
- python-version: 3.8 | ||
torch: 1.8.0 | ||
torchvision: 0.9.0 | ||
- python-version: 3.9 | ||
torch: 1.8.0 | ||
torchvision: 0.9.0 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Upgrade pip | ||
run: pip install pip --upgrade | ||
- name: Install CUDA | ||
- name: Install system dependencies | ||
run: | | ||
export INSTALLER=cuda-repo-${UBUNTU_VERSION}_${CUDA}_amd64.deb | ||
wget http://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/${INSTALLER} | ||
sudo dpkg -i ${INSTALLER} | ||
wget https://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/7fa2af80.pub | ||
sudo apt-key add 7fa2af80.pub | ||
sudo apt update -qq | ||
sudo apt install -y cuda-${CUDA_SHORT/./-} cuda-cufft-dev-${CUDA_SHORT/./-} | ||
sudo apt clean | ||
export CUDA_HOME=/usr/local/cuda-${CUDA_SHORT} | ||
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${CUDA_HOME}/include:${LD_LIBRARY_PATH} | ||
export PATH=${CUDA_HOME}/bin:${PATH} | ||
sudo apt-get install -y ninja-build | ||
apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libturbojpeg python${{matrix.python-version}}-dev | ||
apt-get clean | ||
rm -rf /var/lib/apt/lists/* | ||
- name: Install dependencies for compiling onnx when python=3.9 | ||
run: pip install protobuf && sudo apt-get install libprotobuf-dev protobuf-compiler | ||
run: python -m pip install protobuf && apt-get install -y libprotobuf-dev protobuf-compiler | ||
if: ${{matrix.python-version == '3.9'}} | ||
- name: Install Pillow | ||
run: pip install Pillow==6.2.2 | ||
run: python -m pip install Pillow==6.2.2 | ||
if: ${{matrix.torchvision < 0.5}} | ||
- name: Install TurboJpeg lib | ||
run: sudo apt-get install -y libturbojpeg | ||
- name: Install PyTorch | ||
run: python -m pip install torch==${{matrix.torch}}+cu101 torchvision==${{matrix.torchvision}}+cu101 -f https://download.pytorch.org/whl/torch_stable.html | ||
- name: Install mmpose dependencies | ||
run: | | ||
if [ ${{matrix.torch}} == '1.3.0' ] | ||
then | ||
pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} -f https://download.pytorch.org/whl/torch_stable.html | ||
else | ||
pip install torch==${{matrix.torch}}+cu101 torchvision==${{matrix.torchvision}}+cu101 -f https://download.pytorch.org/whl/torch_stable.html | ||
fi | ||
- name: Install MMCV | ||
python -V | ||
python -m pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/${{matrix.torch}}/index.html | ||
python -m pip install -r requirements.txt | ||
python -c 'import mmcv; print(mmcv.__version__)' | ||
- name: Build and install | ||
run: | | ||
rm -rf .eggs | ||
python setup.py check -m -s | ||
TORCH_CUDA_ARCH_LIST=7.0 python -m pip install . | ||
- name: Run unittests and generate coverage report | ||
run: | | ||
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch${{matrix.torch}}/index.html | ||
coverage run --branch --source mmpose -m pytest tests/ | ||
coverage xml | ||
coverage report -m | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
files: ./coverage.xml | ||
flags: unittests | ||
env_vars: OS,PYTHON | ||
name: codecov-umbrella | ||
fail_ci_if_error: false | ||
|
||
build_cuda102: | ||
runs-on: ubuntu-18.04 | ||
container: | ||
image: pytorch/pytorch:1.9.0-cuda10.2-cudnn7-devel | ||
strategy: | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8, 3.9-dev] | ||
torch: [1.9.0] | ||
include: | ||
- torch: 1.9.0 | ||
torchvision: 0.10.0 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install python-dev | ||
run: apt-get update && apt-get install -y python${{matrix.python-version}}-dev | ||
if: ${{matrix.python-version != '3.9-dev'}} | ||
- name: Install system dependencies | ||
run: | | ||
apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libturbojpeg | ||
apt-get clean | ||
rm -rf /var/lib/apt/lists/* | ||
- name: Install dependencies for compiling onnx when python=3.9 | ||
run: python -m pip install protobuf && apt-get update && apt-get -y install libprotobuf-dev protobuf-compiler cmake | ||
if: ${{matrix.python-version == '3.9-dev'}} | ||
- name: Install Pillow | ||
run: python -m pip install Pillow==6.2.2 | ||
if: ${{matrix.torchvision < 0.5}} | ||
- name: Install PyTorch | ||
run: python -m pip install torch==${{matrix.torch}}+cu102 torchvision==${{matrix.torchvision}}+cu102 -f https://download.pytorch.org/whl/torch_stable.html | ||
- name: Install mmpose dependencies | ||
run: | | ||
python -V | ||
python -m pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu102/${{matrix.torch}}/index.html | ||
python -m pip install -r requirements.txt | ||
python -c 'import mmcv; print(mmcv.__version__)' | ||
- name: Install other dependencies | ||
run: pip install -r requirements.txt | ||
- name: Build and install | ||
run: | | ||
rm -rf .eggs | ||
python setup.py check -m -s | ||
TORCH_CUDA_ARCH_LIST=7.0 pip install . | ||
TORCH_CUDA_ARCH_LIST=7.0 python -m pip install . | ||
- name: Run unittests and generate coverage report | ||
run: | | ||
coverage run --branch --source mmpose -m pytest tests/ | ||
coverage xml | ||
coverage report -m | ||
- name: Upload coverage to Codecov | ||
if: ${{matrix.torch == '1.6.0+cu101' && matrix.python-version == '3.7'}} | ||
uses: codecov/[email protected] | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
file: ./coverage.xml | ||
files: ./coverage.xml | ||
flags: unittests | ||
env_vars: OS,PYTHON | ||
name: codecov-umbrella | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters