cli + web recorder ui

This commit is contained in:
MasterPhooey
2026-01-17 01:23:51 -06:00
parent b700bf095c
commit 5bc0f12a7f
24 changed files with 2002 additions and 2033 deletions

View File

@@ -1,59 +1,37 @@
# Standard Ubuntu base image. CUDA base images not needed.
FROM ubuntu:22.04
# Base
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PIP_ROOT_USER_ACTION=ignore \
HF_HUB_DISABLE_SYMLINKS_WARNING=1 \
XLA_FLAGS="--xla_gpu_cuda_data_dir=/usr/local/cuda" \
PATH="/usr/local/cuda/bin:${PATH}" \
LD_LIBRARY_PATH="/usr/local/cuda/lib64:${LD_LIBRARY_PATH}"
ENV DEBIAN_FRONTEND=noninteractive
# System deps (+dev headers for building C/C++ extensions)
# System deps
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.10 python3.10-venv python3.10-distutils python3.10-dev python3-pip \
git wget curl unzip ca-certificates git-lfs \
build-essential g++ cmake \
libsndfile1 libsndfile1-dev libffi-dev \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
python3.12 python3.12-venv python3.12-dev python3-pip python-is-python3 \
git wget curl unzip ca-certificates nano less \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /data
# Use python3.10 everywhere
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1 \
&& update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
# Recorder port
EXPOSE 8789
# ---- No cuDNN repo meddling needed if using TF 2.17.x ----
# Script root
WORKDIR /root/mww-scripts
# Python deps
# Order is important. onnxruntime, tensorflow and torch have
# to be installed in the order below or their cuda dependencies
# will conflict.
COPY requirements.txt /tmp/requirements.txt
RUN pip install --upgrade pip \
&& pip install "numpy==1.26.4" "cython>=0.29.36" \
&& pip install -r /tmp/requirements.txt \
&& pip install "onnxruntime-gpu[cuda]>=1.16.0" \
&& pip install "tensorflow[and-cuda]==2.18.0" \
"tensorboard==2.18.0" \
"tensorboard-data-server==0.7.2" \
"tensorflow-io-gcs-filesystem==0.37.1" \
&& pip install \
torch==2.7.1 \
torchaudio==2.7.1 \
--index-url https://download.pytorch.org/whl/cu128
# Bash environment
COPY --chown=root:root --chmod=0755 .bashrc /root/
# Workspace + notebook fallback
RUN mkdir -p /data
WORKDIR /data
COPY microWakeWord_training_notebook.ipynb /root/
# Root-level entrypoints
COPY --chown=root:root --chmod=0755 \
train_wake_word \
run_recorder.sh \
recorder_server.py \
requirements.txt \
/root/mww-scripts/
# Startup script (copies default notebook if missing)
COPY startup.sh /usr/local/bin/startup.sh
RUN chmod +x /usr/local/bin/startup.sh
# CLI folder (THIS IS THE IMPORTANT CHANGE)
COPY --chown=root:root cli/ /root/mww-scripts/cli/
EXPOSE 8888
# Static UI for recorder
COPY --chown=root:root --chmod=0644 static/index.html /root/mww-scripts/static/index.html
CMD ["/bin/bash", "-lc", "/usr/local/bin/startup.sh && \
exec jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root \
--ServerApp.token='' --ServerApp.password='' --ServerApp.root_dir=/data"]
# recorder server
CMD ["/bin/bash", "-lc", "/root/mww-scripts/run_recorder.sh"]