Skip to content

Commit

Permalink
almond: update to version 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gcampax committed Dec 29, 2021
1 parent 47ee96d commit 73aa3e9
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 65 deletions.
13 changes: 13 additions & 0 deletions almond/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 3.0.0

- Almond was rebranded to Genie and updated to version 3.0.0. This
is a major release that significantly improves the supported skills
and brings in more robust natural language understanding.
- The wake-word is now "Hey Genie".
- Voice support was overhauled and is now handled by a separate
genie-client package. The client is included in the container for use
with audio directly attached to Home Assistant, and can also be run
separately on a different device.
- As with the previous release, all users are encouraged to upgrade
as soon as possible to maintain compatibility with cloud services.

## 2.0.1

- Fix url for API requests
Expand Down
8 changes: 4 additions & 4 deletions almond/DOCS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Home Assistant Add-on: Almond
# Home Assistant Add-on: Genie

## Installation

Follow these steps to get the add-on installed on your system:

1. Navigate in your Home Assistant frontend to **Supervisor** -> **Add-on Store**.
2. Find the "Almond" add-on and click it.
2. Find the "Genie" add-on and click it.
3. Click on the "INSTALL" button.

## How to use
Expand All @@ -30,8 +30,8 @@ You have several options to get them answered:
- The [Home Assistant Discord Chat Server][discord].
- The Home Assistant [Community Forum][forum].
- Join the [Reddit subreddit][reddit] in [/r/homeassistant][reddit].
- The [Almond Discord Chat Server][discordalmond].
- The Almond [Community Forum][forumalmond].
- The [Genie Discord Chat Server][discordalmond].
- The Genie [Community Forum][forumalmond].

In case you've found a bug, please [open an issue on our GitHub][issue].

Expand Down
113 changes: 72 additions & 41 deletions almond/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
ARG BUILD_FROM
FROM ${BUILD_FROM}

ARG BUILD_ARCH

# Base env settings
ENV \
LANG="en_US.utf8" \
PULSE_SERVER=unix:/run/audio/pulse.sock \
THINGENGINE_HOME="/data/almond-server" \
THINGENGINE_HAS_REVERSE_PROXY=true \
THINGENGINE_HOST_BASED_AUTHENTICATION=insecure \
THINGENGINE_IN_HOME_ASSISTANT_ADDON=true

WORKDIR /opt/almond
ARG ALMOND_VERSION
ARG GENIE_CLIENT_VERSION
ARG GENIE_SERVER_VERSION

RUN \
set -x \
RUN set -x \
&& apt-get update \
# Install runtime dependencies
&& apt-get install -y --no-install-recommends \
build-essential \
libcanberra-dev \
libcanberra0 \
libpulse-dev \
libatlas-base-dev \
libatlas3-base \
pkg-config \
ca-certificates \
git \
wget \
curl \
gnupg \
nginx \
python-dev \
software-properties-common \
unzip \
sqlite \
coreutils \
pulseaudio \
pulseaudio-utils \
gettext \
libpulse0 \
libpulse-mainloop-glib0 \
libasound2 \
libjson-glib-1.0-0 \
libevdev2 \
libsoup2.4-1 \
libspeexdsp1 \
libwebrtc-audio-processing1 \
sound-theme-freedesktop \
unzip \
coreutils \
ca-certificates \
zip \
wget \
nginx \
gstreamer1.0-plugins-base-apps \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-pulseaudio \
\
&& curl -sS https://deb.nodesource.com/gpgkey/nodesource.gpg.key \
| apt-key add - \
&& echo "deb https://deb.nodesource.com/node_12.x buster main" \
Expand All @@ -49,40 +50,70 @@ RUN \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
nodejs \
\
# Install genie-client
&& mkdir /src \
&& apt-get install -y --no-install-recommends \
build-essential \
pkg-config \
ninja-build \
git \
meson \
python-dev \
gettext \
libgstreamer1.0-dev \
libasound2-dev \
libglib2.0-dev \
libjson-glib-dev \
libsoup2.4-dev \
libevdev-dev \
libpulse-dev \
libspeex-dev \
libspeexdsp-dev \
libwebrtc-audio-processing-dev \
&& git clone \
"https://github.com/stanford-oval/genie-client" /src \
&& cd /src \
&& git checkout ${GENIE_CLIENT_VERSION} \
&& git submodule init && git submodule update --recursive \
&& ./scripts/get-assets.sh ${BUILD_ARCH} \
&& meson build \
&& ninja -C build \
&& ninja -C build install \
&& rm -rf /src \
# Install genie-server
&& mkdir /opt/genie-server \
&& cd /opt/genie-server \
&& apt-get install -y --no-install-recommends \
&& git clone -b ${GENIE_SERVER_VERSION} --depth 1 https://github.com/stanford-oval/genie-server /opt/genie-server \
&& npm config set unsafe-perm \
\
&& git clone -b "${ALMOND_VERSION}" --depth 1 https://github.com/stanford-oval/almond-server . \
&& npm ci \
&& npm install --no-package-lock --ignore-scripts [email protected] \
&& cd node_modules/snowboy/ \
&& PYTHON=python2 npx node-pre-gyp clean configure \
&& make -C build/ \
&& rm -fr /root/.cache \
&& rm -fr /root/.npm \
&& mkdir /root/.cache \
\
&& apt-get purge -y --auto-remove \
build-essential \
libcanberra-dev \
libpulse-dev \
libatlas-base-dev \
pkg-config \
git \
gnupg \
ninja-build \
meson \
python-dev \
software-properties-common \
\
libpulse-dev \
libgstreamer1.0-dev \
libasound2-dev \
libglib2.0-dev \
libjson-glib-dev \
libsoup2.4-dev \
libevdev-dev \
libspeex-dev \
libspeexdsp-dev \
libwebrtc-audio-processing-dev \
&& rm -rf \
/opt/almond/.[!.]* \
/opt/genie-server/.[!.]* \
/root/.cache \
/root/.config \
/tmp/.[!.]* \
/tmp/* \
/usr/local/share/.cache \
/usr/local/share/.config \
/usr/lib/nginx \
/var/lib/apt/lists/* \
/usr/lib/nginx \
/var/www

COPY rootfs /
17 changes: 10 additions & 7 deletions almond/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
# Home Assistant Add-on: Almond
# Home Assistant Add-on: Genie

The Open-source, Privacy-Preserving Voice Assistant.

![Supports aarch64 Architecture][aarch64-shield] ![Supports amd64 Architecture][amd64-shield] ![Supports armhf Architecture][armhf-shield] ![Supports armv7 Architecture][armv7-shield] ![Supports i386 Architecture][i386-shield]

[Almond] provides a complete solution to turn your Home Assistant
[Genie] provides a complete solution to turn your Home Assistant
into a smart speaker. It supports playing music, controlling your
IoT, checking the weather, and other simple questions.

To use Almond as a voice assistant, you should connect a microphone and speaker to the
device where Home Assistant is installed.
To use Genie as a voice assistant, you should connect a microphone and speaker to the
device where Home Assistant is installed, or you should provision
a Genie client in a separate smart-speaker device that connects to the
add-on. See the [installation-guide](https://wiki.genie.stanford.edu/getting-started/installation-guide)
for further details.

**Note**: since version 2.0.0 of the add-on, the use of the separate
Ada add-on is not required. Almond includes built-in voice capabilities,
using the wake-word "computer". It is recommended to avoid using Ada
with Almond >= 2.0.0.
Ada add-on is not required. Genie includes built-in voice capabilities,
using the wake-word "hey genie". It is recommended to avoid using Ada
with this add-on.

[Almond]: https://almond.stanford.edu/
[aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg
Expand Down
6 changes: 2 additions & 4 deletions almond/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ build_from:
aarch64: ghcr.io/home-assistant/aarch64-base-debian:buster
amd64: ghcr.io/home-assistant/amd64-base-debian:buster
armv7: ghcr.io/home-assistant/armv7-base-debian:buster
codenotary:
signer: [email protected]
base_image: [email protected]
args:
ALMOND_VERSION: v2.0.1
GENIE_SERVER_VERSION: v3.0.1-rc.1
GENIE_CLIENT_VERSION: v0.1.0-rc.1
4 changes: 2 additions & 2 deletions almond/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 2.0.1
version: 3.0.0
slug: almond
name: Almond
name: Genie
description: The open-source, privacy-preserving voice assistant
url: https://github.com/home-assistant/hassio-addons/blob/master/almond
arch:
Expand Down
Binary file modified almond/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified almond/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
14 changes: 7 additions & 7 deletions almond/rootfs/etc/services.d/almond/run
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Start Almond service
# Start Genie service
# ==============================================================================
export THINGENGINE_BASE_URL

# Set the Ingress URL as Almond base URL for correct handling
# Set the Ingress URL as Genie base URL for correct handling
THINGENGINE_BASE_URL=$(bashio::addon.ingress_entry)

mkdir -p /data/almond-server
if [ ! -f /data/almond-server/prefs.db ]; then
cp /etc/almond/default-prefs.db /data/almond-server/prefs.db
cp /etc/genie/default-prefs.db /data/almond-server/prefs.db
fi

# Send out discovery information to Home Assistant
./discovery &

# Register Home Assistant with Almond
# Register Home Assistant with Genie
./register &

# Start Almond
cd /opt/almond || bashio::exit.nok "Failed to change directory to Almond"
exec node main.js
# Start Genie
cd /opt/genie-server || bashio::exit.nok "Failed to change directory to Genie"
exec node dist/main.js

0 comments on commit 73aa3e9

Please sign in to comment.