-
-
Notifications
You must be signed in to change notification settings - Fork 28
Add/wrapper scripts #496
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/wrapper scripts #496
Conversation
this will support two kinds of wrapper scripts - global that live in the settings.yaml, and container.yaml specific that go alongside that file. We basically will then generate aliases for any executable names that were not created as wrappers. we will want to follow this up with a command to list wrappers, and also include descriptions for the interested user, and a flag to install to select on the fly Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
docker OK found one little issue (singularity, but I guess generic): this causes an error (wrappers enabled, but generic singularity set to false - to only use custom wrappers in the recipe dir):
maybe I misunderstood how to setup the case where I want custom wrappers + generic aliases? |
And a very last comment, this is a proposed change for discussion. Currently, in modulefile templates we're using the dynamic module_dir inspection only to define the PATH for wrapper scripts.
I think we should be able resort to a dynamic definition in all these cases, which would make the module tree completely portable, the only (unavoidable probably) hard-coded path remaining the SIF path for Singularity. Thoughts? |
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
@marcodelapierre I think I've fixed the null parsing (and related validation) issues! For the module_dir I agree, and if you want to make suggestions on the PR here or just write in comments how to change, I can work on tomorrow! You can also PR to the branch here and then I'll just merge it in. I'm off to bed now but thank you for the review - back tomorrow! |
Ok, can confirm all of the reported issues above are resolved when using the latest commit. Two minor polishing edits:
I have actioned these two edits in a branch of mine, doing the PR onto your branch now .. |
For
Thoughts? |
Totally agree - and another basic question - is there any need to really allow them to customize bin? Like what else would they change it to? Then we don't have any of those problems about parsing paths / checking for going up in the tree! |
Good point! I think there's no need to expose the choice of the I can see only two occurrences of |
we can literally just hard code bin, it is easier that way! Signed-off-by: vsoch <vsoch@users.noreply.github.com>
okay done! I didn't even keep the variable I just put bin, we can go back to a variable when we know we need it! |
ok, so two outstanding bits:
on point 2., for the wrapper scripts better to keep it as simple as:
|
* fixed typos in module/templates/docs.md * minor polishing in settings.yml, wrappers_subdir * docs: edits to user and developer guides, for wrapper scripts * reverted a couple of shell occurrences (docker/podman) in modules/templates/docs.md * one more edit for shell in modules/templates/docs.md * Update docs/getting_started/user-guide.rst Co-authored-by: Vanessasaurus <814322+vsoch@users.noreply.github.com>
@marcodelapierre before I push any changes - what about:
And then we can have that as a snippet added to the wrappers at the top? |
Hi @vsoch , sure , reads good to me. |
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
@marcodelapierre okay I think I had a cool idea! So I was thinking we will likely want to add snippets/bases for different wrapper scripts, so I refactored the directory to organize as such (see docs in 4c7ac07) and now the scripts can do things like extend or include other templates! This doesn't apply for modules, but I'm thinking if we like the approach and there is huge redundancy in the tcl/lua templates we could do something similar (but for another PR). Also I wasn't sure what you wanted me to do for tcl/lua templates with the bash/shell so I will need your guidance there. |
hi @vsoch , so snippets sound like a great idea! I have just tested the latest commit. I can see only one issue, kind of related to a previously fixed one:
otherwise all good! now I am going to see if I can apply those module_dir edits to the templates |
I’m confused with x11 - you mean someone added quotes around true in the config so it’s not a boolean? |
No, it's only a problem if the quotes are there (in my case it was from an old settings.yml).
|
I would say it’s a non issue if it’s impossible to do again, but if we can be more strict in the schema to not allow it in the first we could try that. I think this PR is getting huge so my thinking is this issue is slightly out of scope especially if we fixed the setting to prevent it! But if someone hits it again we can come back to it. |
agree! I am working on dynamic module_dir in the templates, hopefully not taking too long |
OK done: |
* wrapper/templates/bases: csh always needs "set" for variables * wrappers/templates: using variable moduleDir * modules/templates lua: moduleDir always replaces {{ module_dir }} * modules/templates tcl: moduleDir always replaces {{ module_dir }} * main/container: no more need to pass module_dir to template.render for modulefiles * registry/vanessa/salad: updated wrapper scripts with moduleDir var * registry/vanessa/salad: typo in singularity_fork.sh
If I am not missing something...I think this PR might be ready, wow! :-) |
I agree! 🥳 Will merge and release after dinner. |
this will support two kinds of wrapper scripts - global that live in the settings.yaml, and container.yaml specific that go alongside that file. We basically will then generate aliases for any executable names that were not created as wrappers. we will want to follow this up with a command to list wrappers, and also include descriptions for the interested user, and a flag to install to select on the fly
cc @marcodelapierre ! I hope this is getting closer to what we want - being able to support custom wrappers for aliases (the global ones) and alongside containers. It is HUGELY more complicated than your original implementation (and this might be bad) but on the other hand, adding a new wrapper is fairly trivial.Take a look and let me know what you think - it's dangerous for me to stay up so late, and who knows what monster I coded! On the other hand, it was totally worth it because I had a ton of fun!
I also tried to clean up some of the initial module parsing, e.g., instead of passing self.settings variables a million times I'm just using self.settings, and i tried to do that for wrappers too.
Signed-off-by: vsoch vsoch@users.noreply.github.com