Repository navigation
Description
Overview
The RAL admin reported (2026-11-12) worker nodes crashing from full OS disks: tools write caches and temp files to ~ and /tmp, which on compute nodes sit on a tiny local disk (workers don't mount the login node's /home; Slurm TmpFS=/tmp). The RAL login shell now redirects these (~/.bashrc.d/keep_off_home.sh), but jobs submitted with a restricted --export=VAR=... don't inherit it, so the repos must cover it themselves. Eight activate.sh files already move caches (after the 2026-09-25 warning) but none set TMPDIR; autocti_assistant moves nothing; PyAutoFit's generated campaign job scripts set nothing.
Plan
Phase A (now)
- PyAutoFit: an optional top-level
cache_root:incampaign.yaml; when set, the generated Slurm script fills unset TMPDIR and cache variables under it. Absent → script unchanged. activate.shin autofit_assistant, autofit_inference, autogalaxy_assistant, autolens_inference: add a fill-if-unsetTMPDIRbeside the existingPYAUTO_HPC_CACHEblock.autocti_assistant/activate.sh: add the full cache block +TMPDIRto its HPC branch.- Library PR first, then the workspace PRs.
Phase B (blocked: repos claimed by other tasks)
- Same
TMPDIRline in autofit_profiling, autolens_assistant, autolens_profiling, euclid_strong_lens_modeling_pipeline.
Tier: glance — merge mode: auto-merge on green if the Witness passes, post-merge summary
Detailed implementation plan
Affected Repositories
- PyAutoFit (primary)
- autofit_assistant, autofit_inference, autogalaxy_assistant, autolens_inference, autocti_assistant (phase A)
- autofit_profiling, autolens_assistant, autolens_profiling, euclid_strong_lens_modeling_pipeline (phase B)
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| PyAutoFit | main | clean |
| autofit_assistant | main | clean |
| autofit_inference | main | clean |
| autogalaxy_assistant | main | clean |
| autolens_inference | main | 11 files (other work; worktree unaffected) |
| autocti_assistant | main | clean |
| autofit_profiling | claimed: nautilus-spawn-training-pool | — |
| autolens_assistant | claimed: results-library-p5a-assistant | — |
| autolens_profiling | claimed: gradient-correctness-sweep | — |
| euclid_strong_lens_modeling_pipeline | claimed: sky-orientation-p2 | — |
Suggested branch: feature/hpc-keep-off-home
Implementation Steps
autofit/campaign/spec.py: parse optional top-levelcache_rootonCampaign; document it in the module docstring YAML example.autofit/campaign/scheduler/base.py:SubmitRequest.cache_root: Optional[str] = None; set where requests are built from the campaign (autofit/campaign/submit.py).autofit/campaign/scheduler/slurm.pysbatch_script: whencache_rootis set, afterset -euo pipefailemit fill-if-unset exports —TMPDIR=<root>/tmp,XDG_CACHE_HOME=<root>/.cache,PIP_CACHE_DIR,MPLCONFIGDIR,NUMBA_CACHE_DIR,CUDA_CACHE_PATH,TRITON_CACHE_DIR,ASTROPY_CACHE_DIRunder it,JAX_COMPILATION_CACHE_DIRwith${VAR-...}(an empty value still disables) — plusmkdir -p ... || true. Stageenv:still overrides.- Tests in
test_autofit/campaign/test_slurm.py: nocache_root→ script byte-identical to today; with it → exports present, fill-if-unset form,bash -nclean; stage env wins. - Workspace
activate.sh(5 repos): next to thePYAUTO_HPC_CACHEblock,export TMPDIR="${TMPDIR:-$(dirname "$PYAUTO_HPC_CACHE")/tmp}"+mkdir -p ... || true; autocti_assistant gets the whole block copied from autofit_assistant. Keep the text identical across repos. - Phase B: the same edit in the four claimed repos once their claims free.
Key Files
autofit/campaign/scheduler/slurm.py— job-script generatorautofit/campaign/spec.py,autofit/campaign/scheduler/base.py,autofit/campaign/submit.pytest_autofit/campaign/test_slurm.py<repo>/activate.shin each workspace repo
Out of scope
collaborator/development/autolens_profilingsubmits that hard-code worker/tmp(local repo, no remote).- Science euclid_dr1
submit_docs_tar(completed one-off run).
Original Prompt
Click to expand starting prompt
Keep HPC temp files and caches off $HOME and the worker's /tmp
Type: maintenance
Target: PyAutoFit
Repos:
- PyAutoFit
- autofit_assistant
- autofit_inference
- autofit_profiling
- autogalaxy_assistant
- autolens_assistant
- autolens_inference
- autolens_profiling
- euclid_strong_lens_modeling_pipeline
- autocti_assistant
Difficulty: small
Autonomy: supervised
Priority: high
Status: formalised
Consequence: glance
Witness: every RAL-capable activate.sh fills an unset TMPDIR (and autocti_assistant's HPC branch the full cache block) with a directory beside PYAUTO_HPC_CACHE on the shared disk; a job script from PyAutoFit's Slurm scheduler exports fill-if-unset TMPDIR/XDG_CACHE_HOME when a cache root is configured, with tests; nothing writes to ~ or /tmp on a worker by default.
Review-minutes: 5
Filed: 2026-11-12
Request (verbatim, RAL admin 2026-11-12)
I'd like to remind all users that if they use VSCode, Claude, and various Python local
tools that they need do define their ENV vars to preclude use of /home/USERNAME when
running these through Slurm. Point all temp/cache env vars to the shared disk instead.
The worker nodes have tiny OS disks, and I'm finding multiple nodes crashing due to
"out of space" errors caused by the aforementioned utilities dumping data into
~/.cache, ~/.vscode, ~/copilot, ~/.claude, etc.
Human: "make sure true for all places we interact with RAL".
What is already done
- RAL login node:
~/.bashrc.d/keep_off_home.sh(installed 2026-11-12) fills unset
TMPDIR, XDG_*, pip/matplotlib/numba/CUDA/Triton/astropy/HF/JAX caches,
CLAUDE_CONFIG_DIR, VSCODE_AGENT_FOLDER and COPILOT_HOME under /mnt/ral/jnightin. Jobs
inherit it through sbatch's default--export=ALL. Jobs submitted with a restricted
--export=VAR=...do NOT, so the repos must still cover it themselves. - Facts: compute nodes do not mount the login node's /home; Slurm
TmpFS=/tmpis on the
tiny OS disk. - 8 activate.sh files already redirect caches to
$PYAUTO_HPC_CACHE(added after the
2026-09-25 warning) but none set TMPDIR.
Scope
- In the HPC branch of each RAL-capable activate.sh (autofit_assistant, autofit_inference,
autofit_profiling, autogalaxy_assistant, autolens_assistant, autolens_inference,
autolens_profiling, euclid_strong_lens_modeling_pipeline), add a fill-if-unset
TMPDIRnext to the PYAUTO_HPC_CACHE block (atmp/beside.cache/,mkdir -p || true). Keep the blocks identical across repos. - cti/autocti_assistant/activate.sh: its PYAUTO_HPC_BASE branch has no redirection;
add the same full cache + TMPDIR block. - PyAutoFit
autofit/campaign/scheduler/slurm.py: generated job scripts source no
activate.sh and set no cache env. Emit fill-if-unset exports (TMPDIR, XDG_CACHE_HOME,
and the cache vars) when the site/request names a cache root, and cover it in
test_autofit/campaign/test_slurm.py.
Out of scope (not PR-able)
collaborator/development/autolens_profiling(local git repo, no remote): ~10 submits in
hpc/batch_{cpu,gpu}/ hard-code worker /tmp. Fix by local edit if they are ever re-run.- Science euclid_dr1
hpc/run_manifests/eclipse_r2_add_unmodelled_20261030/submit_docs_tar
writes a tar to worker /tmp; a completed one-off run.
Activity
Jammy2211 commentedon Nov 12, 2026
Library PR created: #1768 (PyAutoFit, optional
cache_rootin campaign job scripts). Full test suite passed: 4288 passed, 2 skipped, 1 xfailed. Heart YELLOW (unrelated: PyAutoArray open PR 8d old), acknowledged by the human. Next: workspaceactivate.shPRs (autofit_assistant, autofit_inference, autogalaxy_assistant, autolens_inference, autocti_assistant).Jammy2211 commentedon Nov 12, 2026
Shipped (phase A), merged 2026-11-12 under the approved glance tier:
cache_root:incampaign.yaml; generated Slurm scripts fill unsetTMPDIR,XDG_CACHE_HOMEand the tool cache variables under it (pending release)activate.shHPC branch fills an unsetTMPDIRnext to.cache/activate.shHPC branch gets the full cache block plusTMPDIRWitness: nothing writes to
~or a worker's/tmpby default. Checked by the new PyAutoFit tests (cache block run under bash, job env wins, empty JAX value kept) and a clean-env source of eachactivate.sh. CI green on every run and leg.Phase B (the same
TMPDIRline in autofit_profiling, autolens_assistant, autolens_profiling, euclid_strong_lens_modeling_pipeline) is blocked on other tasks' repo claims. It is re-filed as a Mind draft and will get its own issue when unblocked.