From ba6523c8550f6962cbd0b44a0e3dff90c6a7f787 Mon Sep 17 00:00:00 2001 From: k-shir0 Date: Mon, 27 Mar 2023 08:39:24 +0900 Subject: [PATCH 1/4] add: arm64 support --- .github/workflows/build-docker.yml | 39 +++++++++++++++-------------- Dockerfile | 40 ++++++++++++++++++++++++++++-- 2 files changed, 59 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 71eb6e46a..964d41146 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -27,7 +27,7 @@ jobs: strategy: matrix: - os: [ubuntu-latest] + os: [ ubuntu-latest ] tag: - "" - cpu @@ -42,49 +42,52 @@ jobs: 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 + onnxruntime_version: 1.13.1 + platforms: linux/amd64 # 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 + onnxruntime_version: 1.13.1 + platforms: linux/amd64,linux/arm64/v8 - 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 @@ -128,7 +131,6 @@ jobs: format('{0}:{1}-{2}', env.IMAGE_NAME, matrix.tag, env.VOICEVOX_ENGINE_VERSION) ) || format('{0}:{1}', env.IMAGE_NAME, env.VOICEVOX_ENGINE_VERSION) ) }} - VOICEVOX_CORE_ASSET_NAME: ${{ matrix.voicevox_core_asset_prefix }}-${{ env.VOICEVOX_CORE_VERSION }} with: context: . builder: ${{ steps.buildx.outputs.name }} @@ -138,12 +140,13 @@ jobs: 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_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 }} diff --git a/Dockerfile b/Dockerfile index 38a55f5c0..bbc9845af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,11 +21,29 @@ RUN <= 0.11.0 (ONNX) -ARG VOICEVOX_CORE_ASSET_PREFIX=voicevox_core-linux-x64-cpu +ARG TARGETPLATFORM +ARG USE_GPU=false ARG VOICEVOX_CORE_VERSION=0.14.2 + RUN < Date: Mon, 27 Mar 2023 21:00:10 +0900 Subject: [PATCH 2/4] fix: format --- .github/workflows/build-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 964d41146..ab7158a45 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -27,7 +27,7 @@ jobs: strategy: matrix: - os: [ ubuntu-latest ] + os: [ubuntu-latest] tag: - "" - cpu From b41ce0569d8b49c6cfea8da91fdd998229667195 Mon Sep 17 00:00:00 2001 From: k-shir0 Date: Tue, 28 Mar 2023 05:45:57 +0900 Subject: [PATCH 3/4] =?UTF-8?q?add:=20=E3=81=9D=E3=82=8C=E3=81=9E=E3=82=8C?= =?UTF-8?q?=E3=81=AE=E3=82=A2=E3=83=BC=E3=82=AD=E3=83=86=E3=82=AF=E3=83=81?= =?UTF-8?q?=E3=83=A3=E3=81=A7=E3=83=93=E3=83=AB=E3=83=89=E3=81=97=E3=81=9D?= =?UTF-8?q?=E3=82=8C=E3=82=92=E7=B5=B1=E5=90=88=E3=81=99=E3=82=8B=E5=BD=A2?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-docker.yml | 180 ++++++++++++++++++++++++++--- Dockerfile | 40 +------ 2 files changed, 166 insertions(+), 54 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index ab7158a45..a0b59bd5c 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -36,50 +36,106 @@ jobs: - nvidia-ubuntu20.04 - cpu-ubuntu18.04 - nvidia-ubuntu18.04 + tag_platform_prefix: + - amd64 + - arm64 + exclude: + - tag: nvidia + tag_platform_prefix: arm64 + - tag: nvidia-ubuntu20.04 + tag_platform_prefix: arm64 + - tag: nvidia-ubuntu18.04 + tag_platform_prefix: arm64 include: # Ubuntu 20.04 - tag: "" + tag_platform_prefix: amd64 target: runtime-env base_image: ubuntu:20.04 base_runtime_image: ubuntu:20.04 - onnxruntime_version: 1.13.1 - platforms: linux/amd64,linux/arm64/v8 + 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 + platforms: linux/amd64 + - tag: "" + tag_platform_prefix: arm64 + target: runtime-env + base_image: ubuntu:20.04 + base_runtime_image: ubuntu:20.04 + voicevox_core_asset_prefix: voicevox_core-linux-arm64-cpu + onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.14.1/onnxruntime-linux-aarch64-1.14.1.tgz + platforms: linux/arm64/v8 + - tag: cpu + tag_platform_prefix: amd64 + 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 + platforms: linux/amd64 - tag: cpu + tag_platform_prefix: arm64 target: runtime-env base_image: ubuntu:20.04 base_runtime_image: ubuntu:20.04 - onnxruntime_version: 1.13.1 - platforms: linux/amd64,linux/arm64/v8 + voicevox_core_asset_prefix: voicevox_core-linux-arm64-cpu + onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.14.1/onnxruntime-linux-aarch64-1.14.1.tgz + platforms: linux/arm64/v8 - tag: cpu-ubuntu20.04 + tag_platform_prefix: amd64 target: runtime-env base_image: ubuntu:20.04 base_runtime_image: ubuntu:20.04 - onnxruntime_version: 1.13.1 - platforms: linux/amd64,linux/arm64/v8 + 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 + platforms: linux/amd64 + - tag: cpu-ubuntu20.04 + tag_platform_prefix: arm64 + target: runtime-env + base_image: ubuntu:20.04 + base_runtime_image: ubuntu:20.04 + voicevox_core_asset_prefix: voicevox_core-linux-arm64-cpu + onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.14.1/onnxruntime-linux-aarch64-1.14.1.tgz + platforms: linux/arm64/v8 - tag: nvidia + tag_platform_prefix: amd64 target: runtime-nvidia-env base_image: ubuntu:20.04 base_runtime_image: nvidia/cuda:11.6.2-cudnn8-runtime-ubuntu20.04 - onnxruntime_version: 1.13.1 + 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 platforms: linux/amd64 - tag: nvidia-ubuntu20.04 + tag_platform_prefix: amd64 target: runtime-nvidia-env base_image: ubuntu:20.04 base_runtime_image: nvidia/cuda:11.6.2-cudnn8-runtime-ubuntu20.04 - onnxruntime_version: 1.13.1 + 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 platforms: linux/amd64 # Ubuntu 18.04 - tag: cpu-ubuntu18.04 + tag_platform_prefix: amd64 target: runtime-env base_image: ubuntu:18.04 base_runtime_image: ubuntu:18.04 - onnxruntime_version: 1.13.1 - platforms: linux/amd64,linux/arm64/v8 + 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 + platforms: linux/amd64 + - tag: cpu-ubuntu18.04 + tag_platform_prefix: arm64 + 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.14.1/onnxruntime-linux-aarch64-1.14.1.tgz + platforms: linux/arm64/v8 - tag: nvidia-ubuntu18.04 + tag_platform_prefix: amd64 target: runtime-nvidia-env base_image: ubuntu:18.04 base_runtime_image: nvidia/cuda:11.6.2-cudnn8-runtime-ubuntu18.04 - onnxruntime_version: 1.13.1 + 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 platforms: linux/amd64 steps: @@ -131,6 +187,7 @@ jobs: format('{0}:{1}-{2}', env.IMAGE_NAME, matrix.tag, env.VOICEVOX_ENGINE_VERSION) ) || format('{0}:{1}', env.IMAGE_NAME, env.VOICEVOX_ENGINE_VERSION) ) }} + VOICEVOX_CORE_ASSET_NAME: ${{ matrix.voicevox_core_asset_prefix }}-${{ env.VOICEVOX_CORE_VERSION }} with: context: . builder: ${{ steps.buildx.outputs.name }} @@ -140,13 +197,104 @@ jobs: 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_CORE_VERSION=${{ env.VOICEVOX_CORE_VERSION }} VOICEVOX_RESOURCE_VERSION=${{ env.VOICEVOX_RESOURCE_VERSION }} - USE_GPU=${{ matrix.target == 'runtime-nvidia-env' }} - ONNXRUNTIME_VERSION=${{ matrix.onnxruntime_version }} + ONNXRUNTIME_URL=${{ matrix.onnxruntime_url }} 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 + tags: ${{ env.IMAGE_TAG }}-${{ matrix.tag_platform_prefix }} + cache-from: type=registry,ref=${{ env.IMAGE_TAG }}-${{ matrix.tag_platform_prefix }}-buildcache + cache-to: type=registry,ref=${{ env.IMAGE_TAG }}-${{ matrix.tag_platform_prefix }}-buildcache,mode=max platforms: ${{ matrix.platforms }} + + create-manifests: + runs-on: [ ubuntu-latest ] + needs: build-docker + + steps: + - uses: actions/checkout@v3 + + - 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 }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + # Tag "" + - name: Create and push manifest for "" + env: + TAG: ${{ env.IMAGE_NAME }}:${{ env.VOICEVOX_ENGINE_VERSION }} + run: | + docker manifest create \ + ${{ env.TAG }} \ + --amend ${{ env.TAG }}-amd64 \ + --amend ${{ env.TAG }}-arm64 + docker manifest push ${{ env.TAG }} + + # Tag "cpu" + - name: Create and push manifest for "cpu" + env: + TAG: ${{ env.IMAGE_NAME }}:cpu-${{ env.VOICEVOX_ENGINE_VERSION }} + run: | + docker manifest create \ + ${{ env.TAG }} \ + --amend ${{ env.TAG }}-amd64 \ + --amend ${{ env.TAG }}-arm64 + docker manifest push ${{ env.TAG }} + + # Tag "cpu-ubuntu20.04" + - name: Create and push manifest for "cpu-ubuntu20.04" + env: + TAG: ${{ env.IMAGE_NAME }}:cpu-ubuntu20.04-${{ env.VOICEVOX_ENGINE_VERSION }} + run: | + docker manifest create \ + ${{ env.TAG }} \ + --amend ${{ env.TAG }}-amd64 \ + --amend ${{ env.TAG }}-arm64 + docker manifest push ${{ env.TAG }} + + # Tag "nvidia" + - name: Create and push manifest for "nvidia" + env: + TAG: ${{ env.IMAGE_NAME }}:nvidia-${{ env.VOICEVOX_ENGINE_VERSION }} + run: | + docker manifest create \ + ${{ env.TAG }} \ + --amend ${{ env.TAG }}-amd64 + docker manifest push ${{ env.TAG }} + + # Tag "nvidia-ubuntu20.04" + - name: Create and push manifest for "nvidia-ubuntu20.04" + env: + TAG: ${{ env.IMAGE_NAME }}:nvidia-ubuntu20.04-${{ env.VOICEVOX_ENGINE_VERSION }} + run: | + docker manifest create \ + ${{ env.TAG }} \ + --amend ${{ env.TAG }}-amd64 + docker manifest push ${{ env.TAG }} + + # Tag "cpu-ubuntu18.04" + - name: Create and push manifest for "cpu-ubuntu18.04" + env: + TAG: ${{ env.IMAGE_NAME }}:cpu-ubuntu18.04-${{ env.VOICEVOX_ENGINE_VERSION }} + run: | + docker manifest create \ + ${{ env.TAG }} \ + --amend ${{ env.TAG }}-amd64 \ + --amend ${{ env.TAG }}-arm64 + docker manifest push ${{ env.TAG }} + + # Tag "nvidia-ubuntu18.04" + - name: Create and push manifest for "nvidia-ubuntu18.04" + env: + TAG: ${{ env.IMAGE_NAME }}:nvidia-ubuntu18.04-${{ env.VOICEVOX_ENGINE_VERSION }} + run: | + docker manifest create \ + ${{ env.TAG }} \ + --amend ${{ env.TAG }}-amd64 + docker manifest push ${{ env.TAG }} diff --git a/Dockerfile b/Dockerfile index bbc9845af..38a55f5c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,29 +21,11 @@ RUN <= 0.11.0 (ONNX) -ARG TARGETPLATFORM -ARG USE_GPU=false +ARG VOICEVOX_CORE_ASSET_PREFIX=voicevox_core-linux-x64-cpu ARG VOICEVOX_CORE_VERSION=0.14.2 - RUN < Date: Wed, 29 Mar 2023 08:35:14 +0900 Subject: [PATCH 4/4] =?UTF-8?q?Revert=20"add:=20=E3=81=9D=E3=82=8C?= =?UTF-8?q?=E3=81=9E=E3=82=8C=E3=81=AE=E3=82=A2=E3=83=BC=E3=82=AD=E3=83=86?= =?UTF-8?q?=E3=82=AF=E3=83=81=E3=83=A3=E3=81=A7=E3=83=93=E3=83=AB=E3=83=89?= =?UTF-8?q?=E3=81=97=E3=81=9D=E3=82=8C=E3=82=92=E7=B5=B1=E5=90=88=E3=81=99?= =?UTF-8?q?=E3=82=8B=E5=BD=A2=E3=81=AB=E5=A4=89=E6=9B=B4"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b41ce0569d8b49c6cfea8da91fdd998229667195. --- .github/workflows/build-docker.yml | 180 +++-------------------------- Dockerfile | 40 ++++++- 2 files changed, 54 insertions(+), 166 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index a0b59bd5c..ab7158a45 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -36,106 +36,50 @@ jobs: - nvidia-ubuntu20.04 - cpu-ubuntu18.04 - nvidia-ubuntu18.04 - tag_platform_prefix: - - amd64 - - arm64 - exclude: - - tag: nvidia - tag_platform_prefix: arm64 - - tag: nvidia-ubuntu20.04 - tag_platform_prefix: arm64 - - tag: nvidia-ubuntu18.04 - tag_platform_prefix: arm64 include: # Ubuntu 20.04 - tag: "" - tag_platform_prefix: amd64 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 - platforms: linux/amd64 - - tag: "" - tag_platform_prefix: arm64 - target: runtime-env - base_image: ubuntu:20.04 - base_runtime_image: ubuntu:20.04 - voicevox_core_asset_prefix: voicevox_core-linux-arm64-cpu - onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.14.1/onnxruntime-linux-aarch64-1.14.1.tgz - platforms: linux/arm64/v8 - - tag: cpu - tag_platform_prefix: amd64 - 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 - platforms: linux/amd64 + onnxruntime_version: 1.13.1 + platforms: linux/amd64,linux/arm64/v8 - tag: cpu - tag_platform_prefix: arm64 target: runtime-env base_image: ubuntu:20.04 base_runtime_image: ubuntu:20.04 - voicevox_core_asset_prefix: voicevox_core-linux-arm64-cpu - onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.14.1/onnxruntime-linux-aarch64-1.14.1.tgz - platforms: linux/arm64/v8 + onnxruntime_version: 1.13.1 + platforms: linux/amd64,linux/arm64/v8 - tag: cpu-ubuntu20.04 - tag_platform_prefix: amd64 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 - platforms: linux/amd64 - - tag: cpu-ubuntu20.04 - tag_platform_prefix: arm64 - target: runtime-env - base_image: ubuntu:20.04 - base_runtime_image: ubuntu:20.04 - voicevox_core_asset_prefix: voicevox_core-linux-arm64-cpu - onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.14.1/onnxruntime-linux-aarch64-1.14.1.tgz - platforms: linux/arm64/v8 + onnxruntime_version: 1.13.1 + platforms: linux/amd64,linux/arm64/v8 - tag: nvidia - tag_platform_prefix: amd64 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 - tag_platform_prefix: amd64 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 # Ubuntu 18.04 - tag: cpu-ubuntu18.04 - tag_platform_prefix: amd64 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 - platforms: linux/amd64 - - tag: cpu-ubuntu18.04 - tag_platform_prefix: arm64 - 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.14.1/onnxruntime-linux-aarch64-1.14.1.tgz - platforms: linux/arm64/v8 + onnxruntime_version: 1.13.1 + platforms: linux/amd64,linux/arm64/v8 - tag: nvidia-ubuntu18.04 - tag_platform_prefix: amd64 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: @@ -187,7 +131,6 @@ jobs: format('{0}:{1}-{2}', env.IMAGE_NAME, matrix.tag, env.VOICEVOX_ENGINE_VERSION) ) || format('{0}:{1}', env.IMAGE_NAME, env.VOICEVOX_ENGINE_VERSION) ) }} - VOICEVOX_CORE_ASSET_NAME: ${{ matrix.voicevox_core_asset_prefix }}-${{ env.VOICEVOX_CORE_VERSION }} with: context: . builder: ${{ steps.buildx.outputs.name }} @@ -197,104 +140,13 @@ jobs: 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_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 }}-${{ matrix.tag_platform_prefix }} - cache-from: type=registry,ref=${{ env.IMAGE_TAG }}-${{ matrix.tag_platform_prefix }}-buildcache - cache-to: type=registry,ref=${{ env.IMAGE_TAG }}-${{ matrix.tag_platform_prefix }}-buildcache,mode=max + 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 }} - - create-manifests: - runs-on: [ ubuntu-latest ] - needs: build-docker - - steps: - - uses: actions/checkout@v3 - - - 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 }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - # Tag "" - - name: Create and push manifest for "" - env: - TAG: ${{ env.IMAGE_NAME }}:${{ env.VOICEVOX_ENGINE_VERSION }} - run: | - docker manifest create \ - ${{ env.TAG }} \ - --amend ${{ env.TAG }}-amd64 \ - --amend ${{ env.TAG }}-arm64 - docker manifest push ${{ env.TAG }} - - # Tag "cpu" - - name: Create and push manifest for "cpu" - env: - TAG: ${{ env.IMAGE_NAME }}:cpu-${{ env.VOICEVOX_ENGINE_VERSION }} - run: | - docker manifest create \ - ${{ env.TAG }} \ - --amend ${{ env.TAG }}-amd64 \ - --amend ${{ env.TAG }}-arm64 - docker manifest push ${{ env.TAG }} - - # Tag "cpu-ubuntu20.04" - - name: Create and push manifest for "cpu-ubuntu20.04" - env: - TAG: ${{ env.IMAGE_NAME }}:cpu-ubuntu20.04-${{ env.VOICEVOX_ENGINE_VERSION }} - run: | - docker manifest create \ - ${{ env.TAG }} \ - --amend ${{ env.TAG }}-amd64 \ - --amend ${{ env.TAG }}-arm64 - docker manifest push ${{ env.TAG }} - - # Tag "nvidia" - - name: Create and push manifest for "nvidia" - env: - TAG: ${{ env.IMAGE_NAME }}:nvidia-${{ env.VOICEVOX_ENGINE_VERSION }} - run: | - docker manifest create \ - ${{ env.TAG }} \ - --amend ${{ env.TAG }}-amd64 - docker manifest push ${{ env.TAG }} - - # Tag "nvidia-ubuntu20.04" - - name: Create and push manifest for "nvidia-ubuntu20.04" - env: - TAG: ${{ env.IMAGE_NAME }}:nvidia-ubuntu20.04-${{ env.VOICEVOX_ENGINE_VERSION }} - run: | - docker manifest create \ - ${{ env.TAG }} \ - --amend ${{ env.TAG }}-amd64 - docker manifest push ${{ env.TAG }} - - # Tag "cpu-ubuntu18.04" - - name: Create and push manifest for "cpu-ubuntu18.04" - env: - TAG: ${{ env.IMAGE_NAME }}:cpu-ubuntu18.04-${{ env.VOICEVOX_ENGINE_VERSION }} - run: | - docker manifest create \ - ${{ env.TAG }} \ - --amend ${{ env.TAG }}-amd64 \ - --amend ${{ env.TAG }}-arm64 - docker manifest push ${{ env.TAG }} - - # Tag "nvidia-ubuntu18.04" - - name: Create and push manifest for "nvidia-ubuntu18.04" - env: - TAG: ${{ env.IMAGE_NAME }}:nvidia-ubuntu18.04-${{ env.VOICEVOX_ENGINE_VERSION }} - run: | - docker manifest create \ - ${{ env.TAG }} \ - --amend ${{ env.TAG }}-amd64 - docker manifest push ${{ env.TAG }} diff --git a/Dockerfile b/Dockerfile index 38a55f5c0..bbc9845af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,11 +21,29 @@ RUN <= 0.11.0 (ONNX) -ARG VOICEVOX_CORE_ASSET_PREFIX=voicevox_core-linux-x64-cpu +ARG TARGETPLATFORM +ARG USE_GPU=false ARG VOICEVOX_CORE_VERSION=0.14.2 + RUN <