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

Make all modules export a variable with their image name #8

Open
lgorenstein opened this issue Mar 26, 2021 · 2 comments
Open

Make all modules export a variable with their image name #8

lgorenstein opened this issue Mar 26, 2021 · 2 comments

Comments

@lgorenstein
Copy link
Contributor

Something it's very convenient to do a quick singularity shell or singularity exec with the container - which requires to know where the image is. Having the module define an environment variable would make this easier. Something along the lines of

pushenv("NGC_IMAGE", image)

would make it a lot easier to say singularity shell --nv $NGC_IMAGE (compared to a "which myprogram-followed-by-copy-pasting-of-the-container-path-from-the-alias").

Granted, this would get a little more complicated when image = uri (name will be different when singularity pulls), but it can be handled too, right?

@samcmill
Copy link
Contributor

How would this handle having multiple modules loaded at the same time? Many will conflict with each other, but not all.

@lgorenstein
Copy link
Contributor Author

lgorenstein commented Mar 29, 2021

Good point. Something like BASH_SOURCE or BASH_FUNC arrays could be handy, but not all shells support arrays.

So we could take two approaches with this: either "the variable always holds image name for last loaded container module", or "the variable is PATH-style with colon-separated image names as they are loaded".

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

No branches or pull requests

2 participants