Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TMPDIR environment variables to handle non-default temp directories #12

Merged
merged 4 commits into from
May 23, 2024

Conversation

marcelzwiers
Copy link
Contributor

See Github issue #11

@stebo85
Copy link
Contributor

stebo85 commented Apr 26, 2024

thank you for sending that pull request. I am hoping to be able to test this next week. Did you test your changes on your system and did it work? I think it also needs mount points in addition for this to work?

@marcelzwiers
Copy link
Contributor Author

marcelzwiers commented Apr 26, 2024

Yes, you are right. I copied over what I had on our HPC, but indeed for us the non-default tmpdir is automatically mounted on all apptainers. So perhaps it is better to script this and check if any of the TMPDIR variables (as used in this PR) are non-empty and then bindmount them as /tmp?

@marcelzwiers
Copy link
Contributor Author

marcelzwiers commented Apr 26, 2024

So something like:

CUSTOMTMPDIR="/tmp"
for CUSTOMDIR in $TMP $TMPDIR $TEMP $TEMPDIR; do
   CUSTOMTMPDIR=$CUSTOMDIR
done

apptainer run --cleanenv --no-mount tmp --bind ${CUSTOMTMPDIR}:/tmp etc

@stebo85
Copy link
Contributor

stebo85 commented May 23, 2024

cool! Does this work on your system now? Then I test on the HPCs I have access to and we can make it available for all

@marcelzwiers
Copy link
Contributor Author

marcelzwiers commented May 23, 2024

If I manually edit our singularity run-scripts likewise then it works for us :-)

@stebo85 stebo85 merged commit 729bda6 into NeuroDesk:master May 23, 2024
6 of 7 checks passed
@stebo85
Copy link
Contributor

stebo85 commented May 23, 2024

thank you for confirming :)

@marcelzwiers
Copy link
Contributor Author

I didn't look into setting this bind option centrally, perhaps that is also possible as an alternative

@stebo85
Copy link
Contributor

stebo85 commented May 23, 2024

yes, that would also be possible

@marcelzwiers
Copy link
Contributor Author

Indeed, I now see that there exists a variable for this, i.e. APPTAINER_WORKDIR (see here). But that also does something with the HOME directory?

@marcelzwiers marcelzwiers deleted the non-default-tmpdirs branch May 23, 2024 13:34
@marcelzwiers
Copy link
Contributor Author

I just tested the new run_fetch code and it works nicely :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants