Skip to content

Commit

Permalink
Merge branch 'master' into buffer-0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba committed May 29, 2023
2 parents 4981fbc + c341eb8 commit 53f4e5f
Show file tree
Hide file tree
Showing 34 changed files with 1,246 additions and 782 deletions.
83 changes: 45 additions & 38 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,86 +13,84 @@ on:
required: true

env:
IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/voicevox_engine
PYTHON_VERSION: "3.8.10"
IMAGE_NAME: ${{ vars.DOCKERHUB_USERNAME }}/voicevox_engine
PYTHON_VERSION: "3.11.3"
VOICEVOX_RESOURCE_VERSION: "0.14.3"
VOICEVOX_CORE_VERSION: "0.14.4"
VOICEVOX_ENGINE_VERSION:
|- # releaseタグ名か、workflow_dispatchでのバージョン名か、latestが入る
${{ github.event.release.tag_name || github.event.inputs.version || 'latest' }}

jobs:
config: # 全 jobs で利用する定数の定義. `env` が利用できないコンテキストでも利用できる.
runs-on: ubuntu-latest
outputs:
version_or_latest: ${{ steps.vars.outputs.version_or_latest }}
steps:
- name: declare variables
id: vars
shell: bash
run: |
: # releaseタグ名か、workflow_dispatchでのバージョン名か、latestが入る
echo "version_or_latest=${{ github.event.release.tag_name || github.event.inputs.version || 'latest' }}" >> $GITHUB_OUTPUT
build-docker:
needs: [ config ]
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
os: [ ubuntu-latest ]
tag:
- ""
- cpu
- cpu-ubuntu20.04
- nvidia
- nvidia-ubuntu20.04
- cpu-ubuntu18.04
- nvidia-ubuntu18.04
include:
# Ubuntu 20.04
- tag: ""
target: runtime-env
base_image: ubuntu:20.04
base_runtime_image: ubuntu:20.04
voicevox_core_asset_prefix: voicevox_core-linux-x64-cpu
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-linux-x64-1.13.1.tgz
onnxruntime_version: 1.13.1
platforms: linux/amd64,linux/arm64/v8
- tag: cpu
target: runtime-env
base_image: ubuntu:20.04
base_runtime_image: ubuntu:20.04
voicevox_core_asset_prefix: voicevox_core-linux-x64-cpu
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-linux-x64-1.13.1.tgz
onnxruntime_version: 1.13.1
platforms: linux/amd64,linux/arm64/v8
- tag: cpu-ubuntu20.04
target: runtime-env
base_image: ubuntu:20.04
base_runtime_image: ubuntu:20.04
voicevox_core_asset_prefix: voicevox_core-linux-x64-cpu
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-linux-x64-1.13.1.tgz
onnxruntime_version: 1.13.1
platforms: linux/amd64,linux/arm64/v8
- tag: nvidia
target: runtime-nvidia-env
base_image: ubuntu:20.04
base_runtime_image: nvidia/cuda:11.6.2-cudnn8-runtime-ubuntu20.04
voicevox_core_asset_prefix: voicevox_core-linux-x64-gpu
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-linux-x64-gpu-1.13.1.tgz
onnxruntime_version: 1.13.1
platforms: linux/amd64
- tag: nvidia-ubuntu20.04
target: runtime-nvidia-env
base_image: ubuntu:20.04
base_runtime_image: nvidia/cuda:11.6.2-cudnn8-runtime-ubuntu20.04
voicevox_core_asset_prefix: voicevox_core-linux-x64-gpu
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-linux-x64-gpu-1.13.1.tgz
# Ubuntu 18.04
- tag: cpu-ubuntu18.04
target: runtime-env
base_image: ubuntu:18.04
base_runtime_image: ubuntu:18.04
voicevox_core_asset_prefix: voicevox_core-linux-x64-cpu
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-linux-x64-1.13.1.tgz
- tag: nvidia-ubuntu18.04
target: runtime-nvidia-env
base_image: ubuntu:18.04
base_runtime_image: nvidia/cuda:11.6.2-cudnn8-runtime-ubuntu18.04
voicevox_core_asset_prefix: voicevox_core-linux-x64-gpu
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-linux-x64-gpu-1.13.1.tgz
onnxruntime_version: 1.13.1
platforms: linux/amd64

steps:
- uses: actions/checkout@v3

- name: Setup QEMU
uses: docker/setup-qemu-action@v2

- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# Download VOICEVOX RESOURCE
Expand Down Expand Up @@ -125,10 +123,9 @@ jobs:
|- # If it's a release, add the version, otherwise add the `latest`
${{ (
matrix.tag != '' && (
format('{0}:{1}-{2}', env.IMAGE_NAME, matrix.tag, env.VOICEVOX_ENGINE_VERSION)
) || format('{0}:{1}', env.IMAGE_NAME, env.VOICEVOX_ENGINE_VERSION)
format('{0}:{1}-{2}', env.IMAGE_NAME, matrix.tag, needs.config.outputs.version_or_latest)
) || format('{0}:{1}', env.IMAGE_NAME, needs.config.outputs.version_or_latest)
) }}
VOICEVOX_CORE_ASSET_NAME: ${{ matrix.voicevox_core_asset_prefix }}-${{ env.VOICEVOX_CORE_VERSION }}
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
Expand All @@ -137,13 +134,23 @@ jobs:
BASE_IMAGE=${{ matrix.base_image }}
BASE_RUNTIME_IMAGE=${{ matrix.base_runtime_image }}
PYTHON_VERSION=${{ env.PYTHON_VERSION }}
VOICEVOX_ENGINE_VERSION=${{ env.VOICEVOX_ENGINE_VERSION }}
VOICEVOX_CORE_ASSET_NAME=${{ env.VOICEVOX_CORE_ASSET_NAME }}
VOICEVOX_ENGINE_VERSION=${{ needs.config.outputs.version_or_latest }}
VOICEVOX_CORE_VERSION=${{ env.VOICEVOX_CORE_VERSION }}
VOICEVOX_RESOURCE_VERSION=${{ env.VOICEVOX_RESOURCE_VERSION }}
ONNXRUNTIME_URL=${{ matrix.onnxruntime_url }}
USE_GPU=${{ matrix.target == 'runtime-nvidia-env' }}
ONNXRUNTIME_VERSION=${{ matrix.onnxruntime_version }}
target: ${{ matrix.target }}
push: true
tags: ${{ env.IMAGE_TAG }}
cache-from: type=registry,ref=${{ env.IMAGE_TAG }}-buildcache
cache-to: type=registry,ref=${{ env.IMAGE_TAG }}-buildcache,mode=max
platforms: ${{ matrix.platforms }}

run-release-test-workflow:
# version が指定されている場合のみ実行する
if: needs.config.outputs.version_or_latest != 'latest'
needs: [ config, build-docker ]
uses: ./.github/workflows/release-test-docker.yml
with:
version: ${{ needs.config.outputs.version_or_latest }}
repo_url: ${{ format('{0}/{1}', github.server_url, github.repository) }} # このリポジトリのURL
Loading

0 comments on commit 53f4e5f

Please sign in to comment.