Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker image not updated #3

Open
amrutprabhu opened this issue Dec 19, 2024 · 17 comments
Open

Docker image not updated #3

amrutprabhu opened this issue Dec 19, 2024 · 17 comments
Assignees

Comments

@amrutprabhu
Copy link

Hey Folks,

The docker image on the docker repository has not been updated.
https://hub.docker.com/r/rhasspy/wyoming-rhasspy-speech/tags

It is currently at 1.0.0 and the latest release is 1.4.3

I am not sure how the build can be automated to update it with every release.

@Wlad2288
Copy link

@synesthesiam I am really excited about this, since I saw the live stream yesterday :)
I think this is exactly what I need ... hope the container can be build soon.

@AndreKR
Copy link

AndreKR commented Jan 5, 2025

The 1.0.0 version seems to be broken. I pushed an image for 1.4.3: andrekr/wyoming-rhasspy-speech:1.4.3

@amrutprabhu
Copy link
Author

@AndreKR how were you able to build it?
Do you have the docker file with you? Can you share it, please?

@AndreKR
Copy link

AndreKR commented Jan 6, 2025

@amrutprabhu The way @synesthesiam structures most of his repositories is like this...

@amrutprabhu
Copy link
Author

@AndreKR thank you for this. That's some excellent information.

@amrutprabhu
Copy link
Author

@AndreKR , by any chance were you able to connect the running docker image in Home Assistant via wyoming services?

I used the port 10300 to connect and it says there is no service on this endpoint.
However, I was able to access the UI via the port 8099.

I built the docker image myself by manually updated the environment variables in the DockerFile to 1.4.3.

ENV RHASSPY_SPEECH_VERSION=1.4.3
ENV WYOMING_RHASSPY_SPEECH_VERSION=1.4.3

When I did not provide the environment variables, it built the image with version 1.0.0 and I was able to connect it to Home Assistant via wyoming services.

Any idea if yours worked with 1.4.3?

@amrutprabhu
Copy link
Author

@AndreKR I checked your image, and I guess yours is also built with 1.0.0
Because the 1.0.0 does not have an extra column for the delete button.

This is how it is for 1.0.0
image

while this is for 1.4.3
image

while for 1.0.0 it is

@AndreKR
Copy link

AndreKR commented Jan 6, 2025

Well, with the official image on Docker Hub I got a lot of errors about invalid paths and the training aborted. With the image I built everything works, but I don't have a Delete button either. I will check again.

@AndreKR
Copy link

AndreKR commented Jan 7, 2025

You were totally right, I pushed the wrong image. I have updated it.

I now have the Delete button and also the new version doesn't crash anymore when there was no speech recognized, so that's progress.

@amrutprabhu
Copy link
Author

@AndreKR were you able to connect the service to HA?
I get this message when I try to
image

@amrutprabhu
Copy link
Author

this is my docker compose file

services:
  rhasspy:
      image: andrekr/wyoming-rhasspy-speech:1.4.3
      container_name: rhasspy-speech

      ports:
        - "10300:10300"
        - "8099:8099"
      environment:
        - RHASSPY_SPEECH_VERSION=1.4.3
        - WYOMING_RHASSPY_SPEECH_VERSION=1.4.3
      volumes:
        - ./models:/models
        - ./train:/train
      restart: unless-stopped

@amrutprabhu
Copy link
Author

Ok figured it out.. I had to add a sample sentence and train it . only then it was available.

@amrutprabhu
Copy link
Author

Ok.. I noticed that the docker image for rhasspy speech is completely different from that used in the home assistant addon.

The addon docker image is build in HAOS and it has options to include home assistant intents, auto train based on existing sentences.

With this one, you basically get a clean image and we have to train everything from scratch.

@AndreKR
Copy link

AndreKR commented Jan 7, 2025

This one can also fetch exposed entities and areas from HA. Are you saying the addon can fetch more than that?

To connect it to HA you have to give it the token. To do that I mounted a modified run.sh over the original: -v /opt/ha-rhasspy-speech/run.sh:/run.sh

And inside that file I added two parameters:

 \
--hass-websocket-uri 'ws://192.168.0.21:8123/api/websocket' \
--hass-token '...'

@amrutprabhu
Copy link
Author

amrutprabhu commented Jan 7, 2025

Yes... the addon does more. It can bring in the existing intents from Home Assistant. SO you don't need to train it from scratch.

Also you don't need to modify the run.sh file you can override the entrypoint as I did like this using docker compose.

services:
#-------------------------------------
  rhasspy_addon:
      image: amrut/wyoming-rhasspy-speech:1.4.3
      container_name: rhasspy-addon

      entrypoint: /usr/src/.venv/bin/python3
      command: >
          -m wyoming_rhasspy_speech
          --uri 'tcp://0.0.0.0:10300'
          --tools-dir /usr/src/tools
          --train-dir /train
          --models-dir /models
          --hass-token "your ha token"
          --hass-websocket-uri 'ws://192.168.0.43:8123/api/websocket'
          --hass-ingress
          --web-server-host '0.0.0.0'
      ports:
        - "10600:10300"
        - "8099:8099"
      environment:
        - RHASSPY_SPEECH_VERSION=1.4.3
        - WYOMING_RHASSPY_SPEECH_VERSION=1.4.3
      volumes:
        - ./models:/models
        - ./train:/train

So I see that the addon has more options and it is built using a different source.

The DockerFile for the addon is here: https://github.com/rhasspy/hassio-addons/blob/master/rhasspy-speech/Dockerfile

Check the run arguments from the addon here https://github.com/rhasspy/hassio-addons/blob/master/rhasspy-speech/rootfs/etc/s6-overlay/s6-rc.d/rhasspy-speech/run

I tried building the addon docker image but I am not able to start it yet.
This is my current progress after building the addon

services:
#-------------------------------------
  rhasspy_addon:
      image: amrut/wyoming-rhasspy-speech-addon:latest
      container_name: rhasspy-addon
      entrypoint: /.venv/bin/python3
      command: >
          -m wyoming_rhasspy_speech
          --uri 'tcp://0.0.0.0:10300'
          --tools-dir /usr/src/tools
          --train-dir /train
          --models-dir /models
          --hass-token "token"
          --hass-websocket-uri 'ws://192.168.0.43:8123/api/websocket'
          --hass-ingress
          --web-server-host '0.0.0.0'
      ports:
        - "10600:10300"
        - "8099:8099"
      environment:
        - RHASSPY_SPEECH_VERSION=1.4.3
        - WYOMING_RHASSPY_SPEECH_VERSION=1.4.3
      volumes:
        - ./models:/models
        - ./train:/train

I haven't pushed the addon image but if you want you can build it with this command

docker build . -t "amrut/wyoming-rhasspy-speech-addon:latest" --build-arg BUILD_ARCH=amd64 --build-arg BUILD_FROM=ghcr.io/home-assistant/amd64-base-debian:bookworm

@amrutprabhu
Copy link
Author

I figured out how to run the addon, but for that I had to hardcode the token and change some configs manually in the docker image.

@synesthesiam , Is there a reason why the addon is made a bit different from other addons like faster whipser?
In the home assistant addon for wyoming-rhasspy-speech , first a docker image is built with the configurations from the UI and then the built image is image is run when we start the addon.

Is there a reason why its not done the way the faster-whisper addon is done? Wherein docker image is pushed to the public repo and then pulled and run with input params.

Is it possible you could tell us?

@synesthesiam synesthesiam self-assigned this Jan 8, 2025
@amrutprabhu
Copy link
Author

I was able to run the addon as an independent docker container by building the image using this docker compose file.

services:
  rhasspy_addon:
      image: amrut/wyoming-rhasspy-speech-addon:1.4.3
      container_name: rhasspy-addon
      build:
        context: .
        dockerfile: Dockerfile
        args:
          BUILD_ARCH: "amd64" 
          BUILD_FROM: "ghcr.io/home-assistant/amd64-base-debian:bookworm"
      ports:
        - "10600:10300"
        - "8099:8099"
      environment:
        - SUPERVISOR_TOKEN=token
      volumes:
        - ./models:/models
        - ./train:/train
      restart: unless-stopped

I also had to modify the run file from here: https://github.com/rhasspy/hassio-addons/blob/master/rhasspy-speech/rootfs/etc/s6-overlay/s6-rc.d/rhasspy-speech/run
with the URL to the HA websocket and set the default language to "en". These are my changes.

exec .venv/bin/python3 -m wyoming_rhasspy_speech \
    --uri 'tcp://0.0.0.0:10300' \
    --tools-dir /usr/src/tools \
    --train-dir /share/rhasspy-speech/train \
    --models-dir /share/rhasspy-speech/models \
    --auto-train "en"  \
    --hass-token "${SUPERVISOR_TOKEN}" \
    --hass-websocket-uri 'ws://192.168.0.43:8123/api/websocket' \
    --hass-ingress \
    --web-server-host '0.0.0.0'  ${flags[@]}

It would be nice to have the docker image already available publiclicly and then using docker we could pass in these parameters like faster whisper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants