Repository navigation
fix(campaign): optional cache_root keeps job temp files and caches off $HOME - #1768
Merged
Merged
Conversation
…f $HOME
A campaign.yaml can name `cache_root:`; the generated Slurm script then fills
unset TMPDIR, XDG_CACHE_HOME and the pip/matplotlib/numba/CUDA/Triton/astropy/
JAX cache variables under it (JAX with ${VAR-...} so an empty value still
disables the cache). Stage env still wins. On RAL, compute nodes keep $HOME
and /tmp on a tiny local disk that these tools filled (admin 2026-11-12).
No change for campaigns without cache_root.
Refs #1767
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 12, 2026
Merged
Merged
fix: send HPC temp files to the shared disk (TMPDIR) in activate.sh
PyAutoLabs/autolens_inference#65
Merged
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Campaign job scripts can now keep temp files and tool caches off
$HOMEand the compute node's/tmp. On RAL, compute nodes don't mount the login node's/home, so~and/tmpthere sit on a tiny local OS disk. pip, matplotlib, numba, CUDA/Triton, astropy, the PyAutoNerves JAX cache and Python'stempfileall default to those places and have been crashing nodes (RAL admin warnings 2026-09-25 and 2026-11-12).A
campaign.yamlcan now name acache_root:. The generated Slurm script then fillsTMPDIR,XDG_CACHE_HOMEand the per-tool cache variables under it, without overriding anything the job already has. Withoutcache_root:the script is exactly what it was before.Closes part of #1767 (phase A, library leg; the workspace
activate.shPRs follow).API Changes
campaign.yamlkeycache_root:(absolute path; validated). Exposed asCampaign.cache_root.SubmitRequestgainscache_root: Optional[str] = None, filled byrequests_for.sbatch_scriptemits fill-if-unset exports afterset -euo pipefailand before the stageenv(so a stage's ownenvstill wins). TheJAX_COMPILATION_CACHE_DIRexport uses${VAR-...}, so an explicitly empty value still disables the JAX cache.cache_root:.See full details below.
Test Plan
pytest test_autofit/campaign: 158 pass, 4 new tests. They check: nocache_root→ no cache variables; the exact export lines and their order; running the generated block under bash with a path containing a space and$(directories created, job env wins, empty JAX value stays empty);cache_rootmust be absolute; a dry-run submit carries it.pytest test_autofit/(the ship gate).Full API Changes (for automation & release notes)
Added
campaign.yamlcache_root: <absolute path>: where a job's temp files and caches goautofit.campaign.spec.Campaign.cache_rootautofit.campaign.scheduler.base.SubmitRequest.cache_rootautofit.campaign.scheduler.slurm.CACHE_DIRS: (variable, path undercache_root) pairs:TMPDIR → tmp,XDG_CACHE_HOME → .cache,PIP_CACHE_DIR,MPLCONFIGDIR,NUMBA_CACHE_DIR,CUDA_CACHE_PATH,TRITON_CACHE_DIR,ASTROPY_CACHE_DIR,JAX_COMPILATION_CACHE_DIR → .cache/...Migration
cache_root: /mnt/ral/<user>to a campaign.Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code