File size: 849 Bytes
ae1ed83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/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