-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Test using functions instead of aliases for TCL #404
Comments
Hi @vsoch, I ran into this issue before. In my cluster I started defining aliases in my modulefiles to let users run containers without them knowing (much like you're trying to do here). For example, an excerpt of a Tcl v3 (before
One problem with aliases (as you discovered), is that they don't get exported to sub-shells, so we started doing this instead:
After we upgraded to Tcl Modules v4, we then moved to The problem is that Our solution was to ditch aliases or functions altogether. Instead, I rely on Singularity's ability to execute image files directly and configure the runscript to Uh, not exactly. I understand that this will only work with Singularity. Docker and Podman can't use this. Perhaps a common approach would be to create a bunch of executable shims that would then run the appropriate longform command... food for thought. In any case, swapping to |
Interesting idea! The problem here is that there can be 10s, even 100 specific commands for a single container, and a command isn't just an entrypoint, it can have options and more complexity too.
haha, thanks for the ramblings! I think my main concern now is just support - e.g., if someone loads shpc in a really old cluster and they don't have Tcl modules 4.0 it's not going to work. I'm also being conservative and waiting for someone to speak up / report an issue / etc. for the current approach not working. You know what they say, if it's not broken don't fix it! 😆 |
Yes, correct, which is why the
The most I've done is around 25 symlinks, but I know there are things out there with more. In any case, and as you say, this won't work for more complex things that are not simply
You could test for the version of Tcl modules. If it's <4, a trick we used is to add a variable to set-alias, which forced it to be exported as a function. Rough pseudo-code:
|
Hi @vsoch , See the PR I have just opened: #447 As I wrote in the PR, I see the key advantage of enabling aliases for child shells in a deployment with Environment Modules, regardless of its version. What do you think? |
Hey @marcodelapierre I responded in the PR - but it sounds like there is minimal harm to supporting them here! Happy to include this update. |
good! :-) |
Thank you @eburgueno ! This is now released 0.0.34 |
See discussion in cea-hpc/modules#400 (comment)
The text was updated successfully, but these errors were encountered: