-
-
Notifications
You must be signed in to change notification settings - Fork 28
Add/wrapper scripts #499
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 #499
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few small questions - and is there a way to test both of these?
-- we probably do not need this | ||
local MODULEPATH="{{ module_dir }}" | ||
-- directory containing this modulefile (dynamically defined) | ||
local moduleDir = myFileName():match("(.*[/])") or "." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is myFileName is that a function you are writing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries, so this is the very same syntax I had envisaged a couple of weeks ago for the dynamic moduleDir paths, and that we had discussed for use to define the PATH variable by the modulefiles.
The change is that here I am using it to define a Lua/Tcl variable, that can be re-used across the modulefile.
myFileName has the full path of the modulefile, and is documented in the Lmod docs: https://lmod.readthedocs.io/en/latest/050_lua_modulefiles.html
As for the match syntax, it is a generic Lua syntax, which I had found it across the internet (stack overflow or similar is the likely source).
I have tested it both in dummy Lua modulefiles, and by generating and testing production SHPC modulefiles.
Or do you mean tests to be implemented in the SHPC testing framework?
If it can help, I can lookup our old thread, and other links if relevant :)
okay looking good! I think there are two more places that we missed changing module_dir: |
edits now done for |
Edits to use a dynamically defined
moduleDir
variable in all templates, rather than fixed{{ module_dir }}
:module_dir
when rendering modulefile templatesFix in wrapper base script:
set
export
is not needed for bash shell, as the variable is only used directly in the wrapper script, not in any sub processsetenv
(can't recall the exact syntax)