Skip to content

Commit

Permalink
Add support for both GPU and NONGPU Dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
edurenye committed Oct 6, 2023
1 parent 760312c commit 464f4bb
Show file tree
Hide file tree
Showing 11 changed files with 144 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# OpenWakeWord
/openwakeword-data

# Piper
/piper-data

# Porcupine1
/porcupine1-data

# Whisper
/whisper-data

File renamed without changes.
28 changes: 28 additions & 0 deletions openwakeword/NONGPU.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM debian:bullseye-slim
ARG TARGETARCH
ARG TARGETVARIANT

# Install openWakeWord
WORKDIR /usr/src
ARG OPENWAKEWORD_LIB_VERSION='1.5.1'

RUN \
apt-get update \
&& apt-get install -y --no-install-recommends \
python3 \
python3-pip \
\
&& pip3 install --no-cache-dir -U \
setuptools \
wheel \
&& pip3 install --no-cache-dir \
"wyoming-openwakeword==${OPENWAKEWORD_LIB_VERSION}" \
\
&& rm -rf /var/lib/apt/lists/*

WORKDIR /
COPY run.sh ./

EXPOSE 10400

ENTRYPOINT ["bash", "/run.sh"]
2 changes: 1 addition & 1 deletion piper/Dockerfile → piper/GPU.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /
COPY run.sh ./
COPY run-gpu.sh ./

EXPOSE 10200

Expand Down
34 changes: 34 additions & 0 deletions piper/NONGPU.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM debian:bullseye-slim
ARG TARGETARCH
ARG TARGETVARIANT

# Install Piper
WORKDIR /usr/src
ARG PIPER_LIB_VERSION='1.3.2'
ARG PIPER_RELEASE='v1.2.0'

RUN \
apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
python3 \
python3-pip \
\
&& pip3 install --no-cache-dir -U \
setuptools \
wheel \
&& pip3 install --no-cache-dir \
"wyoming-piper==${PIPER_LIB_VERSION}" \
\
&& curl -L -s \
"https://github.com/rhasspy/piper/releases/download/${PIPER_RELEASE}/piper_${TARGETARCH}${TARGETVARIANT}.tar.gz" \
| tar -zxvf - -C /usr/share \
\
&& rm -rf /var/lib/apt/lists/*

WORKDIR /
COPY run-nongpu.sh ./

EXPOSE 10200

ENTRYPOINT ["bash", "/run.sh"]
File renamed without changes.
6 changes: 6 additions & 0 deletions piper/run-nongpu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
python3 -m wyoming_piper \
--piper '/usr/share/piper/piper' \
--uri 'tcp://0.0.0.0:10200' \
--data-dir /data \
--download-dir /data "$@"
32 changes: 32 additions & 0 deletions porcupine1/GPU.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04
ARG TARGETARCH
ARG TARGETVARIANT

# Install porcupine1
WORKDIR /usr/src
ENV PIP_BREAK_SYSTEM_PACKAGES=1

COPY ./src/ ./

RUN \
apt-get update \
&& apt-get install -y --no-install-recommends \
python3 \
python3-pip \
\
&& pip3 install --no-cache-dir -U \
setuptools \
wheel \
&& pip3 install --no-cache-dir \
--extra-index-url https://www.piwheels.org/simple \
'numpy<1.26' \
-r requirements.txt \
\
&& rm -rf /var/lib/apt/lists/*

WORKDIR /
COPY run.sh ./

EXPOSE 10400

ENTRYPOINT ["bash", "/run.sh"]
File renamed without changes.
File renamed without changes.
31 changes: 31 additions & 0 deletions whisper/NONGPU.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM debian:bullseye-slim

# Install Whisper
WORKDIR /usr/src
ARG WHISPER_VERSION='1.0.1'

RUN \
apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
python3 \
python3-dev \
python3-pip \
\
&& pip3 install --no-cache-dir -U \
setuptools \
wheel \
&& pip3 install --no-cache-dir \
"wyoming-faster-whisper==${WHISPER_VERSION}" \
\
&& apt-get purge -y --auto-remove \
build-essential \
python3-dev \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /
COPY run.sh ./

EXPOSE 10300

ENTRYPOINT ["bash", "/run.sh"]

0 comments on commit 464f4bb

Please sign in to comment.