Use $TMPDIR to set temporaryr directories#195
Merged
Conversation
| env { | ||
| MPLCONFIGDIR = '/tmp/.config/matplotlib' | ||
| NUMBA_CACHE_DIR = "/tmp/.numba_cache" | ||
| MPLCONFIGDIR = '${TMPDIR:-/tmp}/.config/matplotlib' |
Collaborator
There was a problem hiding this comment.
I realized something about this. Is this evaluated at the processing node, or head node? I.e. if the tmpdir is set differently on each node we need to be sure this is set there, not at the head node.
Contributor
Author
There was a problem hiding this comment.
Good question! I couldn't find anything convincing enough in the docs, but I run the pipeline with the test profile and checked the .command.run file:
nxf_container_env() {
cat << EOF
export MPLCONFIGDIR="\${TMPDIR:-/tmp}/.config/matplotlib"
export NUMBA_CACHE_DIR="\${TMPDIR:-/tmp}/.numba_cache"
export XDG_CACHE_HOME="\${TMPDIR:-/tmp}/.cache"
export XDG_DATA_HOME="\${TMPDIR:-/tmp}/.data"
export PIXELATOR_DUCKDB_TEMP_DIR="\${TMPDIR:-/tmp}"
export PYTHONNOUSERSITE="1"
export R_PROFILE_USER="/.Rprofile"
export R_ENVIRON_USER="/.Renviron"
export JULIA_DEPOT_PATH="/usr/local/share/julia"
EOF
}
This is fed to the docker container when it is run, so this is run on the processing nodes.
Collaborator
There was a problem hiding this comment.
Ok. Than it should work as we want it to.
Co-authored-by: Johan Dahlberg <johan@uppsala-bioinformatics.se>
johandahlberg
approved these changes
Mar 17, 2026
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.
HPC clusters typically specify the scratch area to be used with the environment variable
TMPDIR. This PR makes sure we use it, and fallback on/tmpif it is not defined.PR checklist
nf-core pipelines lint).nextflow run . -profile test,docker --outdir <OUTDIR>).docs/usage.mdis updated.CHANGELOG.mdis updated.