From 8a19fc370d7ceb975930f7af4837f360f8206de6 Mon Sep 17 00:00:00 2001 From: Brummel Date: Mon, 13 Apr 2026 22:31:52 +0200 Subject: [PATCH] Add deploy script for whisper service Syncs whisper/ to a remote host via rsync, rebuilds the image in place, and polls /health until the model is loaded or a 5 minute timeout hits. --- whisper/deploy.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 whisper/deploy.sh diff --git a/whisper/deploy.sh b/whisper/deploy.sh new file mode 100755 index 0000000..1442f29 --- /dev/null +++ b/whisper/deploy.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +# Deploy the whisper service to a remote host via rsync + ssh. +# Usage: ./deploy.sh [host] (default: minerva.lan) +set -euo pipefail + +HOST="${1:-minerva.lan}" +REMOTE_DIR="/opt/stacks/doctate-whisper" +LOCAL_DIR="$(cd "$(dirname "$0")" && pwd)" + +echo ">>> Syncing $LOCAL_DIR -> $HOST:$REMOTE_DIR" +rsync -av \ + --exclude 'deploy.sh' \ + --exclude 'models/' \ + "$LOCAL_DIR/" "$HOST:$REMOTE_DIR/" + +echo ">>> Rebuilding + restarting on $HOST" +ssh "$HOST" "cd $REMOTE_DIR && \ + docker compose down && \ + docker build -t doctate-whisper . && \ + docker compose up -d" + +echo ">>> Waiting for /health (up to 5 min for first model download)" +for i in $(seq 1 60); do + if ssh "$HOST" "curl -sf http://localhost:9001/health" 2>/dev/null; then + echo + echo ">>> OK" + ssh "$HOST" "curl -s http://localhost:9001/info" + echo + exit 0 + fi + sleep 5 +done + +echo ">>> TIMEOUT — last logs:" +ssh "$HOST" "docker logs doctate-whisper --tail 40" +exit 1