Repository navigation
fix: fall back from an inherited TMPDIR the container cannot write - #68
Merged
Merged
Conversation
A site prolog can set TMPDIR to job-local scratch that is not bound into the container. Python's tempfile silently skips it, but native tools such as XLA's ptxas write there directly and abort, and every retry inherits the same path. Every container rule now starts with a bash guard that keeps a writable, searchable TMPDIR, otherwise switches to container_tmpdir (default /tmp) with one [container-tmpdir] log line, and stops before any work if the fallback itself is unusable. Closes #65. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
A SLURM prolog can set
TMPDIRto job-local scratch (here/scratch/jobs/<jobid>) that is not bound into the container. Python'stempfilesilently skips an unwritableTMPDIR, but XLA'sptxaswrites itstmpxft_*files there directly and aborts. In the October campaign that failed 151 AF3 inference jobs, and every retry inherited the same path.This implements option 1 from the issue.
Changes
container_tmpdir_guard()inrules/common.smkreturns a bash prologue that runs inside the container:$TMPDIRwhen it is a writable, searchable directory;container_tmpdir(default/tmp) and logs one[container-tmpdir]line;create_mmseqs2_gpu_msa_shard,finalize_mmseqs2_features,create_features,structure_inference,analyze_structure,recursive_report. It is passed as a callable param, because Snakemake applies wildcards to string params and would try to format${TMPDIR:-}.container_tmpdirinconfig/config.yaml, and a README troubleshooting entry forptxas fatal: Could not open output file … tmpxft_*.Testing
structure_inferenceshell with a dry run, then runs its prologue underset -euo pipefailwithTMPDIRbelow an unbound path and writes atmpxft_*file natively.…/job-tmp/tmpxft_regression: Not a directory.TMPDIR;$, backticks and braces stays literal.container:rule and checks that each renders with the guard first, in both feature modes. A new container rule without the guard fails it.Notes
APPTAINERENV_TMPDIR=/tmp) was not used. It always overrides, including a bound and faster job-localTMPDIR; the guard leaves those alone.container_tmpdiradds no bind mount. A fallback outside the container's default mounts has to be bound by the site.Closes #65.
🤖 Generated with Claude Code