Skip to content

Docker Hub container doesn't seem to work with --zeroconf option #43

@webash

Description

@webash

When starting the Docker Hub image rhasppy/wyoming-piper with the --zeroconf argument, it seems to crash on trying to load the zeroconf module. Perhaps the Docker container doesn't have the right pre-requisites installed during build:

Full log:

DEBUG:__main__:Namespace(voice='en_GB-alba-medium', uri='tcp://0.0.0.0:10200', zeroconf='core3-wyoming-piper0', data_dir=['/data'], download_dir='/data', speaker=None, noise_scale=None, length_scale=None, noise_w_scale=None, auto_punctuation='.?!', samples_per_chunk=1024, no_streaming=False, update_voices=False, use_cuda=False, debug=True, log_format='%(levelname)s:%(name)s:%(message)s')
DEBUG:wyoming_piper.download:Loading /usr/src/wyoming_piper/voices.json
DEBUG:wyoming_piper.download:Checking /data/en_GB-alba-medium.onnx
DEBUG:wyoming_piper.download:Checking /data/en_GB-alba-medium.onnx.json
CRITICAL:wyoming.zeroconf:pip install zeroconf
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/wyoming_piper/__main__.py", line 254, in <module>
�
)
  File "/usr/src/wyoming_piper/__main__.py", line 249, in run
    asyncio.run(main())
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/usr/src/wyoming_piper/__main__.py", line 213, in main
    from wyoming.zeroconf import HomeAssistantZeroconf
  File "/usr/src/.venv/lib/python3.11/site-packages/wyoming/zeroconf.py", line 11, in <module>
    from zeroconf.asyncio import AsyncServiceInfo, AsyncZeroconf
ModuleNotFoundError: No module named 'zeroconf'

There are 3 related Dockerfile that I can find:

  1. https://github.com/rhasspy/wyoming-piper/blob/main/Dockerfile
  2. https://github.com/rhasspy/wyoming-addons/blob/master/piper/Dockerfile
  3. https://github.com/home-assistant/addons/blob/master/piper/Dockerfile

It seems like:

  1. is just for development (although its pyproject.toml doesn't mention zeroconf either, and the Docker Hub image layers seems to match the Dockerfile in this repo)
  2. seems to be the Docker Hub build as its linked to undernearth the Docker run command in README.md
  3. is the Home Assistant Add-on build

Comparing (2) and (3) I can see one minor difference that (3) the Home Assistant Dockerfile has on line 22 - it specifically references zeroconf for the wyoming library install:

    && pip3 install --no-cache-dir \
        --extra-index-url https://www.piwheels.org/simple \
        "wyoming[zeroconf]>=1.8,<2" \
        "wyoming-piper @ https://github.com/rhasspy/wyoming-piper/archive/refs/tags/v${WYOMING_PIPER_VERSION}.tar.gz" \
    \

whereas (2) standalone addon Dockerfile line 27 does not:

    && pip3 install --no-cache-dir \
        "wyoming[http] @ https://github.com/OHF-voice/wyoming/archive/refs/tags/${WYOMING_VERSION}.tar.gz" \
    \

This line is an edit: Oh yeah - zeroconf is an optional dependency for wyoming...

and (2) seems to be targeting 1.7.2 of Wyoming, when 1.8.0 has a zeroconf fix and 1.6.3 of wyoming-piper when 2.1.2 exists:

ARG WYOMING_PIPER_VERSION='1.6.3'
ARG WYOMING_VERSION='1.7.2'

However finally, as mentioned above: (1)'s Dockerfile seems to match the flow for the Docker Hub image layers... so maybe (1) and (2) need to be fixed, although I'm not clear what (2) is for then.

Anyway; in its current state - the available standalone non-HA docker container doesn't work with --zeroconf.

This is also the same for the wyoming-whisper image too, but I'll log a separate issue for that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions