Spaces:
Running
Running
File size: 1,466 Bytes
e5b81b3 bcf61a1 e5b81b3 bcf61a1 e5b81b3 bcf61a1 e5b81b3 bcf61a1 e5b81b3 bcf61a1 e5b81b3 bcf61a1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | #!/bin/bash
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# K1RL QUASAR β Entrypoint
# Cleans up any stale processes/ports before launching supervisord
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
set -e
echo "=== QUASAR entrypoint: cleaning up stale state ==="
# Kill any lingering supervisord from a previous run
pkill -f supervisord 2>/dev/null || true
# Kill any lingering hub/ranker/dashboard Python processes
pkill -f websocket_hub.py 2>/dev/null || true
pkill -f Quasar_axrvi_ranker.py 2>/dev/null || true
pkill -f hub_dashboard_service.py 2>/dev/null || true
# Give OS enough time to fully release sockets (7860, 8051, etc.)
sleep 3
# Remove stale PID and socket files
rm -f /tmp/supervisord.pid
rm -f /tmp/supervisor.sock
# Confirm our app files exist (catches missing-file issues early)
for f in /app/websocket_hub.py /app/Quasar_axrvi_ranker.py /app/hub_dashboard_service.py; do
if [ ! -f "$f" ]; then
echo "ERROR: Required file missing: $f"
echo "Make sure it is committed to your HF Space repository."
exit 1
fi
done
echo "=== Starting supervisord ==="
exec /usr/bin/supervisord -c /etc/supervisord.conf |