forked from home-assistant/addons
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
110 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" \ | ||
|
@@ -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 / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |