From 1e1f0ee3215eacaffd7e0a2d6367efdea7a00521 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Wed, 18 Jun 2025 19:48:50 +0200 Subject: [PATCH] chore(backends): move `bark-cpp` to the backend gallery (#5682) chore(bark-cpp): move outside from binary Signed-off-by: Ettore Di Giacinto --- .../{python_backend.yml => backend.yml} | 101 +++++++++++++- ...on_backend_build.yml => backend_build.yml} | 8 ++ Makefile | 1 - backend/Dockerfile.go | 131 ++++++++++++++++++ backend/go/bark/run.sh | 3 + backend/index.yaml | 115 +++++++++------ 6 files changed, 313 insertions(+), 46 deletions(-) rename .github/workflows/{python_backend.yml => backend.yml} (81%) rename .github/workflows/{python_backend_build.yml => backend_build.yml} (97%) create mode 100644 backend/Dockerfile.go create mode 100755 backend/go/bark/run.sh diff --git a/.github/workflows/python_backend.yml b/.github/workflows/backend.yml similarity index 81% rename from .github/workflows/python_backend.yml rename to .github/workflows/backend.yml index 8cd5e712..6af0748f 100644 --- a/.github/workflows/python_backend.yml +++ b/.github/workflows/backend.yml @@ -1,5 +1,5 @@ --- -name: 'build python backend container images' +name: 'build backend container images' on: push: @@ -15,7 +15,7 @@ concurrency: jobs: backend-jobs: - uses: ./.github/workflows/python_backend_build.yml + uses: ./.github/workflows/backend_build.yml with: tag-latest: ${{ matrix.tag-latest }} tag-suffix: ${{ matrix.tag-suffix }} @@ -27,6 +27,8 @@ jobs: base-image: ${{ matrix.base-image }} backend: ${{ matrix.backend }} latest-image: ${{ matrix.latest-image }} + dockerfile: $${ matrix.dockerfile }} + context: $${ matrix.context }} secrets: dockerUsername: ${{ secrets.DOCKERHUB_USERNAME }} dockerPassword: ${{ secrets.DOCKERHUB_PASSWORD }} @@ -48,6 +50,8 @@ jobs: base-image: "ubuntu:22.04" backend: "rerankers" latest-image: 'latest-gpu-nvidia-cuda-11-rerankers' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'cublas' cuda-major-version: "11" cuda-minor-version: "7" @@ -58,6 +62,8 @@ jobs: base-image: "ubuntu:22.04" backend: "vllm" latest-image: 'latest-gpu-nvidia-cuda-11-vllm' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'cublas' cuda-major-version: "11" cuda-minor-version: "7" @@ -68,6 +74,8 @@ jobs: base-image: "ubuntu:22.04" backend: "transformers" latest-image: 'latest-gpu-nvidia-cuda-11-transformers' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'cublas' cuda-major-version: "11" cuda-minor-version: "7" @@ -78,6 +86,8 @@ jobs: base-image: "ubuntu:22.04" backend: "diffusers" latest-image: 'latest-gpu-nvidia-cuda-11-diffusers' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" # CUDA 11 additional backends - build-type: 'cublas' cuda-major-version: "11" @@ -89,6 +99,8 @@ jobs: base-image: "ubuntu:22.04" backend: "kokoro" latest-image: 'latest-gpu-nvidia-cuda-11-kokoro' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'cublas' cuda-major-version: "11" cuda-minor-version: "7" @@ -99,6 +111,8 @@ jobs: base-image: "ubuntu:22.04" backend: "faster-whisper" latest-image: 'latest-gpu-nvidia-cuda-11-faster-whisper' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'cublas' cuda-major-version: "11" cuda-minor-version: "7" @@ -109,6 +123,8 @@ jobs: base-image: "ubuntu:22.04" backend: "coqui" latest-image: 'latest-gpu-nvidia-cuda-11-coqui' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'cublas' cuda-major-version: "11" cuda-minor-version: "7" @@ -119,6 +135,8 @@ jobs: base-image: "ubuntu:22.04" backend: "bark" latest-image: 'latest-gpu-nvidia-cuda-11-bark' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'cublas' cuda-major-version: "11" cuda-minor-version: "7" @@ -129,6 +147,8 @@ jobs: base-image: "ubuntu:22.04" backend: "chatterbox" latest-image: 'latest-gpu-nvidia-cuda-11-chatterbox' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" # CUDA 12 builds - build-type: 'cublas' cuda-major-version: "12" @@ -140,6 +160,8 @@ jobs: base-image: "ubuntu:22.04" backend: "rerankers" latest-image: 'latest-gpu-nvidia-cuda-12-rerankers' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'cublas' cuda-major-version: "12" cuda-minor-version: "0" @@ -150,6 +172,8 @@ jobs: base-image: "ubuntu:22.04" backend: "vllm" latest-image: 'latest-gpu-nvidia-cuda-12-vllm' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'cublas' cuda-major-version: "12" cuda-minor-version: "0" @@ -160,6 +184,8 @@ jobs: base-image: "ubuntu:22.04" backend: "transformers" latest-image: 'latest-gpu-nvidia-cuda-12-transformers' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'cublas' cuda-major-version: "12" cuda-minor-version: "0" @@ -170,6 +196,8 @@ jobs: base-image: "ubuntu:22.04" backend: "diffusers" latest-image: 'latest-gpu-nvidia-cuda-12-diffusers' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" # CUDA 12 additional backends - build-type: 'cublas' cuda-major-version: "12" @@ -181,6 +209,8 @@ jobs: base-image: "ubuntu:22.04" backend: "kokoro" latest-image: 'latest-gpu-nvidia-cuda-12-kokoro' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'cublas' cuda-major-version: "12" cuda-minor-version: "0" @@ -191,6 +221,8 @@ jobs: base-image: "ubuntu:22.04" backend: "faster-whisper" latest-image: 'latest-gpu-nvidia-cuda-12-faster-whisper' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'cublas' cuda-major-version: "12" cuda-minor-version: "0" @@ -201,6 +233,8 @@ jobs: base-image: "ubuntu:22.04" backend: "coqui" latest-image: 'latest-gpu-nvidia-cuda-12-coqui' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'cublas' cuda-major-version: "12" cuda-minor-version: "0" @@ -211,6 +245,8 @@ jobs: base-image: "ubuntu:22.04" backend: "bark" latest-image: 'latest-gpu-nvidia-cuda-12-bark' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'cublas' cuda-major-version: "12" cuda-minor-version: "0" @@ -221,6 +257,8 @@ jobs: base-image: "ubuntu:22.04" backend: "chatterbox" latest-image: 'latest-gpu-nvidia-cuda-12-chatterbox' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" # hipblas builds - build-type: 'hipblas' cuda-major-version: "" @@ -232,6 +270,8 @@ jobs: base-image: "rocm/dev-ubuntu-22.04:6.1" backend: "rerankers" latest-image: 'latest-gpu-rocm-hipblas-rerankers' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'hipblas' cuda-major-version: "" cuda-minor-version: "" @@ -242,6 +282,8 @@ jobs: base-image: "rocm/dev-ubuntu-22.04:6.1" backend: "vllm" latest-image: 'latest-gpu-rocm-hipblas-vllm' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'hipblas' cuda-major-version: "" cuda-minor-version: "" @@ -252,6 +294,8 @@ jobs: base-image: "rocm/dev-ubuntu-22.04:6.1" backend: "transformers" latest-image: 'latest-gpu-rocm-hipblas-transformers' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'hipblas' cuda-major-version: "" cuda-minor-version: "" @@ -262,6 +306,8 @@ jobs: base-image: "rocm/dev-ubuntu-22.04:6.1" backend: "diffusers" latest-image: 'latest-gpu-rocm-hipblas-diffusers' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" # ROCm additional backends - build-type: 'hipblas' cuda-major-version: "" @@ -273,6 +319,8 @@ jobs: base-image: "rocm/dev-ubuntu-22.04:6.1" backend: "kokoro" latest-image: 'latest-gpu-rocm-hipblas-kokoro' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'hipblas' cuda-major-version: "" cuda-minor-version: "" @@ -283,6 +331,8 @@ jobs: base-image: "rocm/dev-ubuntu-22.04:6.1" backend: "faster-whisper" latest-image: 'latest-gpu-rocm-hipblas-faster-whisper' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'hipblas' cuda-major-version: "" cuda-minor-version: "" @@ -293,6 +343,8 @@ jobs: base-image: "rocm/dev-ubuntu-22.04:6.1" backend: "coqui" latest-image: 'latest-gpu-rocm-hipblas-coqui' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'hipblas' cuda-major-version: "" cuda-minor-version: "" @@ -303,6 +355,8 @@ jobs: base-image: "rocm/dev-ubuntu-22.04:6.1" backend: "bark" latest-image: 'latest-gpu-rocm-hipblas-bark' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" # sycl builds - build-type: 'sycl_f32' cuda-major-version: "" @@ -314,6 +368,8 @@ jobs: base-image: "quay.io/go-skynet/intel-oneapi-base:latest" backend: "rerankers" latest-image: 'latest-gpu-intel-sycl-f32-rerankers' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'sycl_f16' cuda-major-version: "" cuda-minor-version: "" @@ -324,6 +380,8 @@ jobs: base-image: "quay.io/go-skynet/intel-oneapi-base:latest" backend: "rerankers" latest-image: 'latest-gpu-intel-sycl-f16-rerankers' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'sycl_f32' cuda-major-version: "" cuda-minor-version: "" @@ -334,6 +392,8 @@ jobs: base-image: "quay.io/go-skynet/intel-oneapi-base:latest" backend: "vllm" latest-image: 'latest-gpu-intel-sycl-f32-vllm' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'sycl_f16' cuda-major-version: "" cuda-minor-version: "" @@ -344,6 +404,8 @@ jobs: base-image: "quay.io/go-skynet/intel-oneapi-base:latest" backend: "vllm" latest-image: 'latest-gpu-intel-sycl-f16-vllm' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'sycl_f32' cuda-major-version: "" cuda-minor-version: "" @@ -354,6 +416,8 @@ jobs: base-image: "quay.io/go-skynet/intel-oneapi-base:latest" backend: "transformers" latest-image: 'latest-gpu-intel-sycl-f32-transformers' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'sycl_f16' cuda-major-version: "" cuda-minor-version: "" @@ -364,6 +428,8 @@ jobs: base-image: "quay.io/go-skynet/intel-oneapi-base:latest" backend: "transformers" latest-image: 'latest-gpu-intel-sycl-f16-transformers' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'sycl_f32' cuda-major-version: "" cuda-minor-version: "" @@ -374,6 +440,8 @@ jobs: base-image: "quay.io/go-skynet/intel-oneapi-base:latest" backend: "diffusers" latest-image: 'latest-gpu-intel-sycl-f32-diffusers' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" # SYCL additional backends - build-type: 'sycl_f32' cuda-major-version: "" @@ -385,6 +453,8 @@ jobs: base-image: "quay.io/go-skynet/intel-oneapi-base:latest" backend: "kokoro" latest-image: 'latest-gpu-intel-sycl-f32-kokoro' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'sycl_f16' cuda-major-version: "" cuda-minor-version: "" @@ -395,6 +465,8 @@ jobs: base-image: "quay.io/go-skynet/intel-oneapi-base:latest" backend: "kokoro" latest-image: 'latest-gpu-intel-sycl-f16-kokoro' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'sycl_f32' cuda-major-version: "" cuda-minor-version: "" @@ -405,6 +477,8 @@ jobs: base-image: "quay.io/go-skynet/intel-oneapi-base:latest" backend: "faster-whisper" latest-image: 'latest-gpu-intel-sycl-f32-faster-whisper' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'sycl_f16' cuda-major-version: "" cuda-minor-version: "" @@ -415,6 +489,8 @@ jobs: base-image: "quay.io/go-skynet/intel-oneapi-base:latest" backend: "faster-whisper" latest-image: 'latest-gpu-intel-sycl-f16-faster-whisper' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'sycl_f32' cuda-major-version: "" cuda-minor-version: "" @@ -425,6 +501,8 @@ jobs: base-image: "quay.io/go-skynet/intel-oneapi-base:latest" backend: "coqui" latest-image: 'latest-gpu-intel-sycl-f32-coqui' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'sycl_f16' cuda-major-version: "" cuda-minor-version: "" @@ -435,6 +513,8 @@ jobs: base-image: "quay.io/go-skynet/intel-oneapi-base:latest" backend: "coqui" latest-image: 'latest-gpu-intel-sycl-f16-coqui' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'sycl_f32' cuda-major-version: "" cuda-minor-version: "" @@ -445,6 +525,8 @@ jobs: base-image: "quay.io/go-skynet/intel-oneapi-base:latest" backend: "bark" latest-image: 'latest-gpu-intel-sycl-f32-bark' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" - build-type: 'sycl_f16' cuda-major-version: "" cuda-minor-version: "" @@ -455,3 +537,18 @@ jobs: base-image: "quay.io/go-skynet/intel-oneapi-base:latest" backend: "bark" latest-image: 'latest-gpu-intel-sycl-f16-bark' + dockerfile: "./backend/Dockerfile.python" + context: "./backend" + # bark-cpp + - build-type: '' + cuda-major-version: "" + cuda-minor-version: "" + platforms: 'linux/amd64' + tag-latest: 'true' + tag-suffix: '-bark-cpp' + runs-on: 'ubuntu-latest' + base-image: "ubuntu:22.04" + backend: "bark" + latest-image: 'latest-bark-cpp' + dockerfile: "./backend/Dockerfile.go" + context: "./" \ No newline at end of file diff --git a/.github/workflows/python_backend_build.yml b/.github/workflows/backend_build.yml similarity index 97% rename from .github/workflows/python_backend_build.yml rename to .github/workflows/backend_build.yml index 6ef7ea8f..d840a37a 100644 --- a/.github/workflows/python_backend_build.yml +++ b/.github/workflows/backend_build.yml @@ -45,6 +45,14 @@ on: description: 'Backend to build' required: true type: string + context: + description: 'Build context' + required: true + type: string + dockerfile: + description: 'Build Dockerfile' + required: true + type: string secrets: dockerUsername: required: true diff --git a/Makefile b/Makefile index 61831f62..18749193 100644 --- a/Makefile +++ b/Makefile @@ -225,7 +225,6 @@ ALL_GRPC_BACKENDS+=backend-assets/grpc/whisper ifeq ($(ONNX_OS),linux) ifeq ($(ONNX_ARCH),x64) - ALL_GRPC_BACKENDS+=backend-assets/grpc/bark-cpp ALL_GRPC_BACKENDS+=backend-assets/grpc/stablediffusion-ggml endif endif diff --git a/backend/Dockerfile.go b/backend/Dockerfile.go new file mode 100644 index 00000000..7770e09c --- /dev/null +++ b/backend/Dockerfile.go @@ -0,0 +1,131 @@ +ARG BASE_IMAGE=ubuntu:22.04 + +FROM ${BASE_IMAGE} AS builder +ARG BACKEND=rerankers +ARG BUILD_TYPE +ENV BUILD_TYPE=${BUILD_TYPE} +ARG CUDA_MAJOR_VERSION +ARG CUDA_MINOR_VERSION +ARG SKIP_DRIVERS=false +ENV CUDA_MAJOR_VERSION=${CUDA_MAJOR_VERSION} +ENV CUDA_MINOR_VERSION=${CUDA_MINOR_VERSION} +ENV DEBIAN_FRONTEND=noninteractive +ARG TARGETARCH +ARG TARGETVARIANT +ARG GO_VERSION=1.22.6 + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + build-essential \ + ccache \ + ca-certificates \ + make \ + curl unzip \ + libssl-dev && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + + +# Cuda +ENV PATH=/usr/local/cuda/bin:${PATH} + +# HipBLAS requirements +ENV PATH=/opt/rocm/bin:${PATH} + +# Vulkan requirements +RUN <