#!/bin/bash # Dashboard watcher: refresh status.json + train_progress.json # every 60 s while any validation training/eval process is alive. # Exits after 3 consecutive idle checks (one final update included). TV=~/sera_v4_experiments/trace_validation PY=~/lerobot/.venv/bin/python idle=0 while true; do $PY "$TV/scripts/update_dashboard.py" > /dev/null 2>&1 if pgrep -f "train_pilot.py" > /dev/null || \ pgrep -f "phase_b.py" > /dev/null || \ pgrep -f "eval_trace.py" > /dev/null || \ pgrep -f "lerobot.scripts.train" > /dev/null || \ pgrep -f "master_chain" > /dev/null; then idle=0 else idle=$((idle + 1)) if [ "$idle" -ge 3 ]; then $PY "$TV/scripts/update_dashboard.py" > /dev/null 2>&1 echo "dashboard watcher exit $(date +%H:%M:%S)" >> "$TV/STATUS.md" exit 0 fi fi sleep 60 done