From b4ea4e3aaa9735c4d4342b98e3692cce52a40220 Mon Sep 17 00:00:00 2001 From: Pjotr Date: Sat, 24 Oct 2026 15:03:28 +0000 Subject: cwl: Expand the "rebuild on the nodes instead of sharing a store" section. Spell out why the current design needs the store visible (ravanan submits a store path and Slurm does not substitute, so an absent path is an immediate ENOENT), then list the five ways out as a table -- shared store, realise-then-run wrapper, per-workflow realise job, guix publish plus wrapper, shipping closures -- with what runs, what each needs on the nodes, and what it costs in caching. Also records where the wrapper would live (build-gexp-script already builds the derivation but returns only its output path; submit-job in ravanan/slurm-api.scm assembles the script field), that nothing of it is implemented here, and the four costs that decide the question: channel skew, build time inside the job's time limit, caching on ephemeral node stores, and guix publish as the sane companion. Tables tightened so no line runs past ~170 characters. --- cwl/README.md | 131 +++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 79 insertions(+), 52 deletions(-) diff --git a/cwl/README.md b/cwl/README.md index 1492d12..186a689 100644 --- a/cwl/README.md +++ b/cwl/README.md @@ -72,15 +72,15 @@ Consequently: A node does need: -| requirement | why | -|-------------------------------------------------------|-----| -| `/bin/bash` | ravanan submits `#!/bin/bash` + the store script; Slurm runs it through that shebang | -| the **same `/gnu/store`** mounted (read-only is fine) | the script, `guile`, `gemma-wrapper`, `gemma` and coreutils all come from there — nothing is "installed" on the node | -| read access to ravanan's store (`--store` dir) | inputs are interned there and staged from there into the job's working directory | -| **write access to that store's `data/` and `logs/`** | the job writes its outputs record (`WORKFLOW_OUTPUT_DATA_FILE`) and its stdout/stderr there | -| a writable **scratch** dir | the job's working directory is a temporary directory under `--scratch`; this is the only place jobs write freely ("jobs do not directly write to the shared network filesystem" is ravanan's design goal, so `/scratch` is normally node-local and fast) | -| permission as the **job user** | the identity comes from the JWT (e.g. `testuser`), so the store and scratch paths must be writable by that uid | -| resolvable `NodeAddr` | Slurm's launch path needs the node address, not just a name | +| requirement | why | +|------------------------------------------|-----| +| `/bin/bash` | ravanan submits `#!/bin/bash` + the store script; Slurm runs it via that shebang | +| same `/gnu/store` mounted (read-only ok) | the script, `guile`, `gemma-wrapper`, `gemma`, coreutils are all store paths | +| read access to ravanan's store | input files are interned there and staged from there into the job's cwd | +| write access to its `data/`, `logs/` | the job writes its outputs record and its stdout/stderr there | +| a writable **scratch** dir | the job's cwd is a temporary dir under `--scratch`: keep it node-local | +| permission as the **job user** | identity comes from the JWT (e.g. `testuser`); these paths must be writable by it | +| resolvable `NodeAddr` | Slurm's launch path needs the node address, not just a name | Practical split: `RAVANAN_CACHE_DIR` (ravanan's store + the gemma-wrapper caches) on a **shared** filesystem, `RAVANAN_SCRATCH` @@ -89,10 +89,10 @@ only meant for single-box setups like the test container. ## The two caches -| cache | lives in | scope | -|-------------------------------|-----------------------------------------------------------------------------------------------------------------|-------| -| ravanan work reuse | `/data/.json`, keyed by (script, inputs) | checked on the front end *before* anything is submitted, so a hit never touches Slurm | -| gemma-wrapper's `--cache-dir` | one directory per chromosome, passed as a CWL input (today `/gemma-wrapper-cache/chr-`) | inside the job; on a cluster it must be visible to the nodes (shared, or node-local if you prefer per-node caches) | +| cache | lives in | scope | +|-----------------------------|-------------------------------------------------------------------------|-------| +| ravanan work reuse | `/data/.json`, keyed by (script, inputs) | front end; a hit never touches Slurm | +| gemma-wrapper `--cache-dir` | one dir per chromosome under `/gemma-wrapper-cache/` | inside the job; nodes must see it | Two wrinkles specific to this endpoint: @@ -110,45 +110,72 @@ Two wrinkles specific to this endpoint: ## Can the nodes rebuild the tools instead of sharing a store? -Yes in principle — Guix is deterministic, so a node building the same -derivations with the same channels produces *byte-identical store paths*, -and the script ravanan submitted then simply exists. But nothing in the -current setup triggers such a build, because ravanan submits a **store -path**, and executing a store path that is absent fails immediately — -there is no automatic substitution. - -Concretely, you would need one of: - -1. **Realise-then-run wrapper.** Submit `#!/bin/bash` + `guix build - && exec