#!/usr/bin/env bash # Minimal post-deploy smoke test. Hits every ASR/TTS worker's own endpoint # directly (bypassing the gateway's OIDC auth) with a synthetic test clip, to # catch startup/dependency/API-compat regressions before a user has to find # them (qwen3's wrong model IDs, pyannote's use_auth_token/token rename, and # the cuDNN LD_LIBRARY_PATH conflict all would have shown up here as an # immediate FAIL instead of a silent break discovered later). # # Run this after every `bash build.sh` + redeploy. set -uo pipefail CONTAINER="${SPEECH_CONTAINER:-speech}" TMP_WAV="/tmp/smoke_test_tone.wav" FAIL=0 pass() { printf ' OK %s\n' "$1"; } fail() { printf 'FAIL %s: %s\n' "$1" "$2"; FAIL=1; } echo "=== generating synthetic test clip ===" podman exec "$CONTAINER" ffmpeg -y -f lavfi -i "sine=frequency=440:duration=3" -ar 16000 -ac 1 "$TMP_WAV" >/dev/null 2>&1 echo "=== faster-whisper (8001) ===" resp=$(podman exec "$CONTAINER" curl -s -o /dev/null -w "%{http_code}" -X POST http://127.0.0.1:8001/transcribe \ -F "file=@${TMP_WAV};type=audio/wav" -F "model=tiny" -F "language=ko") [ "$resp" = "200" ] && pass "faster-whisper" || fail "faster-whisper" "HTTP $resp" echo "=== qwen3 (8004) ===" resp=$(podman exec "$CONTAINER" curl -s -o /dev/null -w "%{http_code}" -X POST http://127.0.0.1:8004/transcribe \ -F "file=@${TMP_WAV};type=audio/wav" -F "model=Qwen/Qwen3-ASR-0.6B-hf" -F "language=ko") [ "$resp" = "200" ] && pass "qwen3" || fail "qwen3" "HTTP $resp" echo "=== vibevoice (8006) ===" resp=$(podman exec "$CONTAINER" curl -s -o /dev/null -w "%{http_code}" -X POST http://127.0.0.1:8006/transcribe \ -F "file=@${TMP_WAV};type=audio/wav" -F "model=microsoft/VibeVoice-ASR") [ "$resp" = "200" ] && pass "vibevoice" || fail "vibevoice" "HTTP $resp" echo "=== xtts (8005) ===" resp=$(podman exec "$CONTAINER" curl -s -o /dev/null -w "%{http_code}" -X POST http://127.0.0.1:8005/synthesize \ -F "text=스모크 테스트입니다." -F "language=ko" -F "speaker_wav=${TMP_WAV}") [ "$resp" = "200" ] && pass "xtts" || fail "xtts" "HTTP $resp" podman exec "$CONTAINER" rm -f "$TMP_WAV" echo if [ "$FAIL" = "0" ]; then echo "all backends OK" else echo "one or more backends FAILED — check: podman logs $CONTAINER" fi exit "$FAIL"