matatonic / openedai-speech

An OpenAI API compatible text to speech server using Coqui AI's xtts_v2 and/or piper tts as the backend.
GNU Affero General Public License v3.0
192 stars 32 forks source link

ARM (Apple Silicon) Image? #17

Closed JakeStevenson closed 1 month ago

JakeStevenson commented 1 month ago

On my macOS device:

docker pull ghcr.io/matatonic/openedai-speech:latest
latest: Pulling from matatonic/openedai-speech
no matching manifest for linux/arm64/v8 in the manifest list entries

Looks like the current docker containers are only built for AMD. Is it possible to build for ARM?

JakeStevenson commented 1 month ago

Apologies, I do see a previous closed/related issue: https://github.com/matatonic/openedai-speech/issues/5

I'm guessing tagged ARM builds aren't in your immediate plans. I'll keep this here in case you want to track it, but won't be offended if it's not something you're looking for.

JakeStevenson commented 1 month ago

And just to add further context, docker-compose build failed with the following:

24.54 Building wheels for collected packages: parler_tts, sudachipy
24.54   Building wheel for parler_tts (pyproject.toml): started
24.64   Building wheel for parler_tts (pyproject.toml): finished with status 'done'
24.64   Created wheel for parler_tts: filename=parler_tts-0.1-py3-none-any.whl size=61970 sha256=7f546f8c2f43751d9fc30e241b357615b8dedd2693087fab87e4a859aac2732f
24.64   Stored in directory: /tmp/pip-ephem-wheel-cache-e1ev4k58/wheels/08/a6/4a/82909c56646ab22ea6ddda9bc9ac105225c571897f1cf08cba
24.64   Building wheel for sudachipy (pyproject.toml): started
24.74   Building wheel for sudachipy (pyproject.toml): finished with status 'error'
24.74   error: subprocess-exited-with-error
24.74
24.74   × Building wheel for sudachipy (pyproject.toml) did not run successfully.
24.74   │ exit code: 1
24.74   ╰─> [37 lines of output]
24.74       running bdist_wheel
24.74       running build
24.74       running build_py
24.74       creating build
24.74       creating build/lib.linux-aarch64-cpython-311
24.74       creating build/lib.linux-aarch64-cpython-311/sudachipy
24.74       copying py_src/sudachipy/__init__.py -> build/lib.linux-aarch64-cpython-311/sudachipy
24.74       copying py_src/sudachipy/command_line.py -> build/lib.linux-aarch64-cpython-311/sudachipy
24.74       copying py_src/sudachipy/config.py -> build/lib.linux-aarch64-cpython-311/sudachipy
24.74       copying py_src/sudachipy/errors.py -> build/lib.linux-aarch64-cpython-311/sudachipy
24.74       creating build/lib.linux-aarch64-cpython-311/sudachipy/dictionary
24.74       copying py_src/sudachipy/dictionary/__init__.py -> build/lib.linux-aarch64-cpython-311/sudachipy/dictionary
24.74       creating build/lib.linux-aarch64-cpython-311/sudachipy/tokenizer
24.74       copying py_src/sudachipy/tokenizer/__init__.py -> build/lib.linux-aarch64-cpython-311/sudachipy/tokenizer
24.74       creating build/lib.linux-aarch64-cpython-311/sudachipy/morphemelist
24.74       copying py_src/sudachipy/morphemelist/__init__.py -> build/lib.linux-aarch64-cpython-311/sudachipy/morphemelist
24.74       creating build/lib.linux-aarch64-cpython-311/sudachipy/morpheme
24.74       copying py_src/sudachipy/morpheme/__init__.py -> build/lib.linux-aarch64-cpython-311/sudachipy/morpheme
24.74       copying py_src/sudachipy/sudachipy.pyi -> build/lib.linux-aarch64-cpython-311/sudachipy
24.74       creating build/lib.linux-aarch64-cpython-311/sudachipy/resources
24.74       copying py_src/sudachipy/resources/sudachi.json -> build/lib.linux-aarch64-cpython-311/sudachipy/resources
24.74       copying py_src/sudachipy/resources/char.def -> build/lib.linux-aarch64-cpython-311/sudachipy/resources
24.74       copying py_src/sudachipy/resources/rewrite.def -> build/lib.linux-aarch64-cpython-311/sudachipy/resources
24.74       copying py_src/sudachipy/resources/unk.def -> build/lib.linux-aarch64-cpython-311/sudachipy/resources
24.74       running build_ext
24.74       running build_rust
24.74       error: can't find Rust compiler
24.74
24.74       If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
24.74
24.74       To update pip, run:
24.74
24.74           pip install --upgrade pip
24.74
24.74       and then retry package installation.
24.74
24.74       If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
24.74       [end of output]
24.74
24.74   note: This error originates from a subprocess, and is likely not a problem with pip.
24.74   ERROR: Failed building wheel for sudachipy
24.74 Successfully built parler_tts
24.74 Failed to build sudachipy
24.74 ERROR: Could not build wheels for sudachipy, which is required to install pyproject.toml-based projects
------
failed to solve: process "/bin/sh -c pip install -r requirements.txt" did not complete successfully: exit code: 1
JakeStevenson commented 1 month ago

In case it helps, I had to make some changes to the docker image to build it now: https://github.com/matatonic/openedai-speech/pull/18

Once built, I was able to use docker buildx build --platform linux/arm64 -t openedai-speech . to build a local image for ARM/Apple Silicon.

matatonic commented 1 month ago

I would like a working arm build, definitely, so thanks for your contribution!

I can't test however, but any additions you have for arm and or mac would be welcome.

JakeStevenson commented 1 month ago

I updated the GitHub actions workflow to build for both platforms. I can't necessarily test the workflow itself without setting up my own docker repo, but give it a try and see if it works for you. Then I can pull from the hub and see if it works like my local builds do.

matatonic commented 1 month ago

Was the switch from the -slim image required? what was missing?

JakeStevenson commented 1 month ago

No, it was not. It was leftover from one of my earlier attempts, hoping not to have to install the rust components manually. I've reverted that change now.

ToeiRei commented 1 month ago

I would love to have that on a jetson as well. That way things would be nice and 'contained' if we're building an assistant