Snider Virgil commited on
Commit
66ed84c
·
1 Parent(s): 7e9482c

fix(worker): continuous loop + cron as watchdog, not scheduler

Browse files

The worker is supposed to run back-to-back evals as a continuous daemon,
not wait for a cron trigger. My earlier install had it backwards — the
:07 cron ran one pass then exited, leaving the machine idle between
cron ticks. Inverting:

lem-eval.sh loop now runs 'once' in a tight loop with a 10s
breather between passes (enough to not thrash
logs / cron but short enough to stay busy).
Each 'once' iterates all runnable targets and
commit/pushes per target via run_target.

cron/submit.cron now a watchdog, not a scheduler. Runs at :07
hourly and resurrects the loop if it died.
No-op if the loop is still running.

cron/maintain.cron unchanged — :37 hourly git pull for config.

The 1h watchdog cadence means the worker can be dead for up to 1h
before being restarted. For the current MVP that's acceptable; if we
ever need tighter recovery we can switch to systemd or a shorter cron.

Co-Authored-By: Virgil <virgil@lethean.io>

Files changed (2) hide show
  1. cron/submit.cron +7 -8
  2. lem-eval.sh +7 -2
cron/submit.cron CHANGED
@@ -1,14 +1,13 @@
1
- # LEM-Eval submit cronone pass per hour over all runnable targets.
 
 
2
  #
3
  # Runs at :07 past the hour to match the legacy LEM-benchmarks cadence
4
- # Snider's homelab has been running since the Ollama pipeline days. The
5
- # flock guard prevents overlap if a previous run is still going (the
6
- # 26B/31B model targets can take longer than an hour to complete 8-PAC).
7
  #
8
  # Install with:
9
  # crontab -l | cat - cron/submit.cron | crontab -
10
- #
11
- # Adjust the path to the LEM-Eval clone if you installed it elsewhere
12
- # than $HOME/PycharmProjects/LEM-Eval.
13
 
14
- 7 * * * * cd $HOME/PycharmProjects/LEM-Eval && flock -n .lock ./lem-eval.sh once >> /tmp/lem-eval.log 2>&1
 
1
+ # LEM-Eval submit watchdogensures the continuous `loop` worker is
2
+ # alive. The real work is done by `lem-eval.sh loop` running back-to-back
3
+ # on each target; this cron just restarts the loop if it died.
4
  #
5
  # Runs at :07 past the hour to match the legacy LEM-benchmarks cadence
6
+ # (back when the Ollama pipeline did hourly git push instead of a
7
+ # continuous loop). The 1h cadence is the maximum gap the machine can
8
+ # be idle if the worker crashes after that, this cron resurrects it.
9
  #
10
  # Install with:
11
  # crontab -l | cat - cron/submit.cron | crontab -
 
 
 
12
 
13
+ 7 * * * * cd $HOME/PycharmProjects/LEM-Eval && pgrep -fu "$USER" "lem-eval.sh loop" >/dev/null || nohup ./lem-eval.sh loop >> /tmp/lem-eval.log 2>&1 &
lem-eval.sh CHANGED
@@ -163,10 +163,15 @@ case "$MODE" in
163
  maintain
164
  ;;
165
  loop)
 
 
 
 
 
 
166
  while true; do
167
  once
168
- log "sleeping 1h"
169
- sleep 3600
170
  done
171
  ;;
172
  *)
 
163
  maintain
164
  ;;
165
  loop)
166
+ # Continuous worker: run one pass after another with no long sleep.
167
+ # Each pass iterates every runnable target on this host and commits
168
+ # + pushes after each target's eval, so the canon on HF stays in
169
+ # lockstep with the local state. A brief breather prevents a hot
170
+ # loop if something misconfigures — 10 seconds is enough to not
171
+ # thrash cron/logs but short enough that the machine stays busy.
172
  while true; do
173
  once
174
+ sleep 10
 
175
  done
176
  ;;
177
  *)