feat: extract soul-demo into standalone Cloud Run service
Dev — Build & local smoke test / build-smoke (pull_request) Successful in 2m19s

This commit is contained in:
2026-05-10 21:08:46 -05:00
parent feee40c34b
commit 93f9ea2be2
4 changed files with 99 additions and 42 deletions
-22
View File
@@ -1,26 +1,4 @@
#!/bin/sh
set -e
if [ "${SKIP_K3S:-0}" = "1" ]; then
echo "[entrypoint] SKIP_K3S=1: starting neuron-web directly (no soul-demo)."
exec /usr/local/bin/neuron-web
fi
# Soul-demo watchdog: start soul-demo and restart it automatically on crash.
# Cloud Run gen2 doesn't reliably provide eth0 with a unicast IP, so k3s flannel
# fails at startup. Running soul-demo directly is simpler, lighter, and fully
# self-healing. Cloud Run handles horizontal scaling — no HPA needed.
echo "[entrypoint] Starting soul-demo watchdog on :${NEURON_PORT:-7772}..."
(
while true; do
echo "[soul-watchdog] starting soul-demo (NEURON_HOME=${NEURON_HOME})"
/usr/local/bin/soul-demo 2>&1 || true
echo "[soul-watchdog] soul-demo exited, restarting in 3s..."
sleep 3
done
) &
# Start neuron-web immediately — do NOT block.
# Cloud Run startup probe requires port 8080 to answer within the timeout.
echo "[entrypoint] Starting neuron-web on port ${PORT:-8080}..."
exec /usr/local/bin/neuron-web