2026-05-27 12:05:59 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
# Ad-hoc Meet Kevin video analyzer wrapper.
|
|
|
|
|
#
|
|
|
|
|
# Usage:
|
|
|
|
|
# ./scripts/kevin-analyze.sh <video-id-or-url>
|
|
|
|
|
#
|
|
|
|
|
# Picks the running meet-kevin-watcher container (which already has
|
2026-05-28 22:55:14 +00:00
|
|
|
# yt-dlp + ffmpeg + the Anthropic token + the right Python env), copies
|
|
|
|
|
# the local script in, and runs it. Works regardless of whether the
|
|
|
|
|
# image has scripts/ baked in yet.
|
2026-05-27 12:05:59 +00:00
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
if [[ $# -ne 1 ]]; then
|
|
|
|
|
echo "usage: $0 <youtube-video-id-or-url>" >&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2026-05-28 22:55:14 +00:00
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
|
LOCAL_SCRIPT="$SCRIPT_DIR/analyze_kevin_video.py"
|
|
|
|
|
|
|
|
|
|
if [[ ! -f "$LOCAL_SCRIPT" ]]; then
|
|
|
|
|
echo "missing $LOCAL_SCRIPT" >&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2026-05-27 12:05:59 +00:00
|
|
|
POD=$(kubectl -n trading-bot get pod -l app=trading-bot-workers \
|
|
|
|
|
-o jsonpath='{.items[0].metadata.name}')
|
|
|
|
|
|
|
|
|
|
if [[ -z "$POD" ]]; then
|
|
|
|
|
echo "no trading-bot-workers pod found" >&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2026-05-28 22:55:14 +00:00
|
|
|
# Copy the latest local script into the pod, then exec it. This way the
|
|
|
|
|
# wrapper works even before CI ships an image with scripts/ baked in.
|
|
|
|
|
kubectl -n trading-bot cp "$LOCAL_SCRIPT" \
|
|
|
|
|
"$POD:/tmp/kevin-analyze.py" -c meet-kevin-watcher >/dev/null
|
|
|
|
|
|
2026-05-27 12:05:59 +00:00
|
|
|
exec kubectl -n trading-bot exec "$POD" -c meet-kevin-watcher -- \
|
2026-05-28 22:55:14 +00:00
|
|
|
python /tmp/kevin-analyze.py "$1"
|