From 12f7399b36f13dfb25c64eddabd922e92afe75da Mon Sep 17 00:00:00 2001 From: EJClaw Date: Sat, 15 Aug 2026 19:22:49 +0900 Subject: [PATCH] build(docker): GPU-ready test image for .9 (CUDA 12.4 + py3.11 + node22/ffmpeg) Bundles the M1 milestone: mock voice pipeline (wsai) + dave/ selfbot voice joiner. Entrypoint dispatches smoke/voice/mock/gpu/join/shell. .env mounted at runtime (not baked). Built GPU-capable via NVIDIA CDI so later STT/TTS drop in. Co-Authored-By: Claude Opus 4.7 --- .dockerignore | 8 ++++++++ Dockerfile | 46 ++++++++++++++++++++++++++++++++++++++++++++ docker-entrypoint.sh | 24 +++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-entrypoint.sh diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..8d8a79a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +.venv/ +**/__pycache__/ +*.pyc +.pytest_cache/ +dave/node_modules/ +poc/frames/ +.git +.env diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..289f24f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,46 @@ +# watch_sceen_ai — GPU-ready test image for the .9 host (RTX 5050). +# +# Bundles everything the current M1 milestone needs: +# * CUDA runtime (so future faster-whisper / TTS can use the GPU) +# * Python 3.11 (STT/TTS asset compat per README) for the wsai voice pipeline +# * Node 22 + ffmpeg for the dave/ selfbot voice joiner (DAVE/MLS E2EE) +# +# STT/TTS/Brain are still mock at this milestone, so nothing GPU-heavy runs yet; +# the image is built GPU-capable so the next milestones drop straight in. +FROM nvidia/cuda:12.4.1-runtime-ubuntu22.04 + +ENV DEBIAN_FRONTEND=noninteractive \ + PYTHONUNBUFFERED=1 \ + PIP_NO_CACHE_DIR=1 + +# --- system deps: python 3.11, node 22, ffmpeg ----------------------------- +RUN apt-get update && apt-get install -y --no-install-recommends \ + software-properties-common ca-certificates curl gnupg ffmpeg \ + && add-apt-repository -y ppa:deadsnakes/ppa \ + && apt-get update && apt-get install -y --no-install-recommends \ + python3.11 python3.11-venv python3.11-dev \ + && curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \ + && apt-get install -y --no-install-recommends nodejs \ + && ln -sf /usr/bin/python3.11 /usr/local/bin/python \ + && python -m ensurepip --upgrade \ + && python -m pip install --no-cache-dir --upgrade pip pytest \ + && apt-get clean && rm -rf /var/lib/apt/lists/* + +WORKDIR /app + +# --- dave/ node deps (cached layer) ---------------------------------------- +COPY dave/package.json dave/package-lock.json ./dave/ +RUN cd dave && npm ci + +# --- app source ------------------------------------------------------------ +COPY wsai ./wsai +COPY tests ./tests +COPY dave ./dave +COPY requirements.txt PLAN.md README.md ./ +COPY docker-entrypoint.sh /usr/local/bin/entrypoint +RUN chmod +x /usr/local/bin/entrypoint + +# .env (DISCORD_SELFBOT_TOKEN) is NOT baked in — mount it at runtime: +# -v $(pwd)/.env:/app/.env:ro +ENTRYPOINT ["entrypoint"] +CMD ["smoke"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 0000000..2396859 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# Test/run dispatcher for the watch_sceen_ai container. +# +# smoke (default) pytest smoke suite (mock pipeline, no deps, no GPU) +# voice python -m wsai --voice (eyes-free mock voice loop demo) +# mock python -m wsai (full mock flow, few frames) +# gpu nvidia-smi — prove the GPU is visible inside the container +# join node dave/join.mjs — LIVE selfbot voice join (needs .env +# mounted; honors RUN_MS / GUILD_ID / CHANNEL_ID / SELF_ID) +# shell drop to bash +set -euo pipefail +cd /app + +cmd="${1:-smoke}"; shift || true + +case "$cmd" in + smoke) exec python -m pytest -q ;; + voice) exec python -m wsai --voice ;; + mock) exec python -m wsai ;; + gpu) exec nvidia-smi ;; + join) cd dave && exec node join.mjs ;; + shell) exec bash ;; + *) exec "$cmd" "$@" ;; +esac