Spaces:
Paused
Paused
diag: remove exec, add 10s stdout ping to test HF SSE capture
Browse filesKeep PID 1 as original bash (no exec), add frequent stdout
ping to diagnose whether HF's runtime log SSE captures stdout.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
84 unmodified lines8586878889909184 unmodified lines# Step 3: Run user command (opens port 7860)CMD="${RUN_CMD:-python3 /app/demo_app.py}"log "[entrypoint] ── Step 3: exec user command ──"log "[entrypoint] CMD=${CMD}"log "========================================"exec $CMD84 unmodified lines85868788899091929394959697989910010110284 unmodified lines# Step 3: Run user command (opens port 7860)CMD="${RUN_CMD:-python3 /app/demo_app.py}"log "[entrypoint] ── Step 3: running user command ──"log "[entrypoint] CMD=${CMD}"log "========================================"# Diagnostic: frequent stdout ping to verify HF SSE capture(while true; do echo "[ping] $(date -u) pid=$$ ppid=$PPID"; sleep 10; done) &# Run CMD as child (not exec) so PID 1 stays as this bash$CMD &CMD_PID=$!log "[entrypoint] CMD started as PID=${CMD_PID}, waiting..."# Forward signals to CMDtrap "kill $CMD_PID 2>/dev/null; wait $CMD_PID 2>/dev/null; exit" SIGTERM SIGINT SIGQUITwait $CMD_PID
scripts/entrypoint.sh+13-2