CDCgov / mycosnp-nf

CDCgov/mycosnp-nf
Apache License 2.0
36 stars 33 forks source link

Prefer system TMPDIR over project directory? #79

Open rpetit3 opened 2 years ago

rpetit3 commented 2 years ago

Currently, mycosnp-nf defaults --tmpdir to "$projectDir/tmp", which in cloud settings might be on a space limited partition.

I realize I can just do --tmpdir $TMPDIR , but would you consider setting the default to the system wide environment variable and falling back on the project directory in the event TMPDIR is not set?

Cheers, Robert

mciprianoCDC commented 2 years ago

I can look into how to implement this within nextflow, though this can end up causing more issues and would need testing in multiple environments. This setting came about due to the necessity of always having TMPDIR set else some modules will not work well, and often system tmpdirs are set as noexec (based on best security practices) or are space limited, which causes additional problems within workflows that are not always apparent to users. This can also necessitate additional documentation to point out these issues within the usage guide as well.

rpetit3 commented 2 years ago

Totally understand. I was thinking to reuse TMPDIR if it exists, otherwise use $projectDir. Something like:

tmpdir  = System.getenv("TMPDIR") ? "${TMPDIR}" : "$projectDir/tmp"
jwarnn commented 1 month ago

I've ran into this issue before and I am running into this issue currently where the cloud environment errors because java tools can't access a tmp directory. Previously I have created a tmp directory in the base of the repository, mycosnp-nf/tmp/, which resolves the issue. Would that be a useful PR request? I am currently having the issue when Nextflow tower as it directly pulls from the github repository.