diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 71eb6e46a..ab7158a45 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -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 <