Skip to content

Commit

Permalink
Dockerイメージ: ONNX版コアに対応 (#248)
Browse files Browse the repository at this point in the history
* download-core-env: onnx

* Makefile: update VOICEVOX_CORE_LIBRARY_NAME

* download-onnxruntime-env

* download-core-env: rename Hiroshiba/voicevox_core -> VOICEVOX/voicevox_core

* add spacing for set -eux

* add missing set -eux

* runtime-env: copy onnxruntime instead of libtorch

* Makefile: LIBTORCH_URL -> ONNXRUNTIME_URL

* runtime-env: core module example version 0.10.preview.0

* runtime-env: improve pip install section

* runtime-env entrypoint: remove USE_GLIBC_231_WORKAROUND

* Makefile: remove USE_GLIBC_231_WORKAROUND

* runtime-env: copy core.h from core.zip instead of voicevox_core repo

* runtime-env: rename core example repo Hiroshiba/voicevox_core -> VOICEVOX/voicevox_core

* add comment: /home/user/.local/bin

* add spacing for set -eux

* build-docker.yml: onnx

* disable linux binary build temporary

* download LibTorch Dockerfile for linux binary build

* add tree link

* Makefile: onnx runtime env for test

* Makefile: use cuda base image for gpu

* build-docker.yml: use cuda base image for gpu

* use cuda 11.4.2

* fix python core module installation to use root setup.py

* download-core-env: libcore create relative symlink

* runtime-env: copy required shared library to python core package

* runtime-env: remove unneeded voicevox_dir arg

* runtime-env: remove unneeded LIBRARY_PATH on core module installation

* Dockerfile: BASE_RUNTIME_IMAGE inherit BASE_IMAGE

* remove unneeded ldconfig

* skip cuda/cudnn copy in runtime-env

* revert skip cuda/cudnn copy

* add todo comment to remove redundant shared lib copy

* cd on onnxruntime shared lib copy

* build-env: copy shared libraries from core package

* remove unneeded include core on nuitka build

* runtime-env: copy libcudnn_*_infer.so* into package

* runtime-env: remove unneeded full version libraries from python core package

* runtime-env: set rpath $ORIGIN for shared libraries in package

* runtime-env: remove CUDA/cuDNN copy for core package

* add fixme comment

* remove unneeded dependency

* fix comment
  • Loading branch information
aoirint authored Dec 29, 2021
1 parent 9874489 commit 0541056
Show file tree
Hide file tree
Showing 4 changed files with 169 additions and 181 deletions.
46 changes: 21 additions & 25 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:

env:
IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/voicevox_engine
# IMAGE_NAME: voicevox/voicevox_engine

strategy:
matrix:
Expand All @@ -27,55 +26,53 @@ jobs:
- nvidia-ubuntu20.04
- cpu-ubuntu18.04
- nvidia-ubuntu18.04
voicevox_core_version: [0.9.0]
voicevox_core_example_version: [0.9.0]
voicevox_core_version: ['0.10.preview.0']
voicevox_core_source_version: ['0.10.preview.0']
include:
# Ubuntu 20.04
- tag: ''
target: runtime-env
base_image: ubuntu:focal
base_runtime_image: ubuntu:focal
voicevox_core_library_name: core_cpu
libtorch_url: https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.9.0%2Bcpu.zip
voicevox_core_library_name: libcore_cpu_x64.so
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-linux-x64-1.9.0.tgz
- tag: cpu
target: runtime-env
base_image: ubuntu:focal
base_runtime_image: ubuntu:focal
voicevox_core_library_name: core_cpu
libtorch_url: https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.9.0%2Bcpu.zip
voicevox_core_library_name: libcore_cpu_x64.so
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-linux-x64-1.9.0.tgz
- tag: cpu-ubuntu20.04
target: runtime-env
base_image: ubuntu:focal
base_runtime_image: ubuntu:focal
voicevox_core_library_name: core_cpu
libtorch_url: https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.9.0%2Bcpu.zip
voicevox_core_library_name: libcore_cpu_x64.so
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-linux-x64-1.9.0.tgz
- tag: nvidia
target: runtime-nvidia-env
base_image: ubuntu:focal
base_runtime_image: nvidia/driver:460.73.01-ubuntu20.04
voicevox_core_library_name: core
libtorch_url: https://download.pytorch.org/libtorch/cu111/libtorch-cxx11-abi-shared-with-deps-1.9.0%2Bcu111.zip
base_runtime_image: nvidia/cuda:11.4.2-cudnn8-runtime-ubuntu20.04
voicevox_core_library_name: libcore_gpu_x64_nvidia.so
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-linux-x64-gpu-1.9.0.tgz
- tag: nvidia-ubuntu20.04
target: runtime-nvidia-env
base_image: ubuntu:focal
base_runtime_image: nvidia/driver:460.73.01-ubuntu20.04
voicevox_core_library_name: core
libtorch_url: https://download.pytorch.org/libtorch/cu111/libtorch-cxx11-abi-shared-with-deps-1.9.0%2Bcu111.zip
base_runtime_image: nvidia/cuda:11.4.2-cudnn8-runtime-ubuntu20.04
voicevox_core_library_name: libcore_gpu_x64_nvidia.so
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-linux-x64-gpu-1.9.0.tgz
# Ubuntu 18.04
- tag: cpu-ubuntu18.04
target: runtime-env
base_image: ubuntu:bionic
base_runtime_image: ubuntu:bionic
voicevox_core_library_name: core_cpu
libtorch_url: https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.9.0%2Bcpu.zip
use_glibc_231_workaround: 1
voicevox_core_library_name: libcore_cpu_x64.so
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-linux-x64-1.9.0.tgz
- tag: nvidia-ubuntu18.04
target: runtime-nvidia-env
base_image: ubuntu:bionic
base_runtime_image: nvidia/driver:460.73.01-ubuntu18.04
voicevox_core_library_name: core
libtorch_url: https://download.pytorch.org/libtorch/cu111/libtorch-cxx11-abi-shared-with-deps-1.9.0%2Bcu111.zip
use_glibc_231_workaround: 1
base_runtime_image: nvidia/cuda:11.4.2-cudnn8-runtime-ubuntu18.04
voicevox_core_library_name: libcore_gpu_x64_nvidia.so
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-linux-x64-gpu-1.9.0.tgz

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -110,10 +107,9 @@ jobs:
BASE_IMAGE=${{ matrix.base_image }}
BASE_RUNTIME_IMAGE=${{ matrix.base_runtime_image }}
VOICEVOX_CORE_VERSION=${{ matrix.voicevox_core_version }}
VOICEVOX_CORE_EXAMPLE_VERSION=${{ matrix.voicevox_core_example_version }}
VOICEVOX_CORE_SOURCE_VERSION=${{ matrix.voicevox_core_source_version }}
VOICEVOX_CORE_LIBRARY_NAME=${{ matrix.voicevox_core_library_name }}
LIBTORCH_URL=${{ matrix.libtorch_url }}
USE_GLIBC_231_WORKAROUND=${{ matrix.use_glibc_231_workaround || '0' }}
ONNXRUNTIME_URL=${{ matrix.onnxruntime_url }}
target: ${{ matrix.target }}
push: true
tags: |
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,15 @@ jobs:
set -eux
rm -r speaker_info
cp -r download/resource/character_info speaker_info
# Temporary: Download LibTorch Dockerfile
# ref https://github.com/VOICEVOX/voicevox_engine/pull/248
# tree https://github.com/VOICEVOX/voicevox_engine/tree/86e06dc13d634562e92f799c5e75f06da23822cd
- name: Download Dockerfile for LibTorch Core
shell: bash
run: |
set -eux
wget -nv --show-progress -c -O "./Dockerfile.libtorchcore" https://raw.githubusercontent.com/VOICEVOX/voicevox_engine/86e06dc13d634562e92f799c5e75f06da23822cd/Dockerfile
# NOTE: `load: true` may silently fail when the GitHub Actions disk (14GB) is full.
# https://docs.github.com/ja/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
Expand All @@ -352,7 +361,7 @@ jobs:
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
file: ./Dockerfile
file: ./Dockerfile.libtorchcore
build-args: |
BASE_IMAGE=${{ matrix.base_image }}
BASE_RUNTIME_IMAGE=${{ matrix.base_runtime_image }}
Expand Down
Loading

0 comments on commit 0541056

Please sign in to comment.