diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ravanan-slurm.md | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/docs/ravanan-slurm.md b/docs/ravanan-slurm.md index d8b40bf..bddaaf0 100644 --- a/docs/ravanan-slurm.md +++ b/docs/ravanan-slurm.md @@ -67,6 +67,45 @@ export RAVANAN_CACHE_DIR=/srv/gn4-ravanan # shared with the nodes `src/config.rs`'s tests cover the switch, the argument construction and the fail-closed cases (`ravanan_batch_*`). +## What survives a restart + +Ravanan's reuse key is `(script, inputs)`, and both halves live in +`RAVANAN_CACHE_DIR` (its `--store`). So the cache's lifetime is exactly the +lifetime of that directory — not of the container and not of Slurm: + +| state | where | survives a container restart | survives a host reboot | must the nodes see it | +|---|---|---|---|---| +| ravanan store (`--store`: interned inputs, per-step outputs, reuse records) | `RAVANAN_CACHE_DIR` | **yes, if it is under the bind-mounted share** | yes, if it is not under `/tmp` | **yes** | +| ravanan scratch | `RAVANAN_SCRATCH`, or the cache dir when unset | as above | as above | yes | +| short-token registry | `GN4_API_TOKENS_DB` (`tokens.sqlite`) | yes, if not on an ephemeral path | yes, if not under `/tmp` | no | +| gemma-wrapper cache (direct runner only) | `GEMMA_CACHE_DIR` | yes | yes, if not under `/tmp` | no | +| Slurm controller/spool state (`/var/spool/slurmctld`, `/var/spool/slurmd`) | inside the container | **no** — rebuilt at every boot | — | — | + +Measured: with the cache at `<shared mount>/gn4-ravanan-cache`, a full +20-chromosome LOCO mapping cost 13.6 s cold; after **restarting the container** +the identical request returned in 3.6 s with the store unchanged (14 files before +and after). Slurm's lost state is irrelevant to that — the reuse record is in the +store, not in `slurmctld`. + +Two ways to get this wrong, both silent until a run fails or is slow: + +- the default `RAVANAN_CACHE_DIR` is under `/tmp`, which is neither durable nor + visible inside a container that bind-mounts one host path, so jobs cannot read + the interned inputs. The reply says so in a note when the cache dir is under + `/tmp`. +- `GN4_API_TOKENS_DB` defaults to `./tokens.sqlite` in the working directory: a + service whose `WorkingDirectory` is a checkout under `/tmp`, or a directory + that is recreated, loses every short token on reboot. + +Deployment checklist for the paths: + +```sh +RAVANAN_CACHE_DIR=<shared mount>/gn4-ravanan-cache # durable, nodes can see it +RAVANAN_SCRATCH=<shared mount>/gn4-ravanan-cache # or node-local scratch +GN4_API_TOKENS_DB=<durable dir>/tokens.sqlite # mode 0600, never in the repo +GEMMA_CACHE_DIR=<durable dir>/gn4-gemma # direct runner only +``` + ## Variance components (`pve`) on this path `gemma-loco.scm`'s `gwa` step passes `-pve`, as the direct path does, and |
