-
Notifications
You must be signed in to change notification settings - Fork 217
add support for environment variables in set_environment of module generators
#4855
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
Conversation
…ModuleGeneratorLua
… ModuleGeneratorLua
…in ModuleGeneratorLua
…n ModuleGeneratorLua
|
after a quick discussion with @lexming he will add an option to opt out of resolving the variables |
|
@smoors as discussed, resolution of shell variables is enabled by default and can be disabled with an extra option in Updated unit tests accordingly. |
smoors
left a comment
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.
lgtm
… in values of modextravars
…rename DEFAULT_MODEXTRAVARS* constants in ModuleGenerator class)
rename `shell_vars` options in `modextravars` to `resolve_env_vars` (+ rename `DEFAULT_MODEXTRAVARS*` constants in `ModuleGenerator` class)
boegel
left a comment
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.
lgtm
This PR enhances the
set_environmentmethods in module generators to handle contents of variables that have references to shell environment variables (i.e.$ENV_VAR).The effects of this PR are better seen in
test_envintest/framework/module_generator.py, which is heavily enhanced to test a lot more cases. See test/framework/module_generator.py#L956In practice, this now allows the following in
modextravars:Additionally, in the case of
ModuleGeneratorLua, the static templatePATH_JOIN_TEMPLATEused to constructpathJoincommands in Lua is replaced with a more powerful_path_join_cmdmethod that properly splits the components of the path:Companion PR in easyconfigs:
setenvcommands with environment variables in module footers withmodextravarsin easyconfigs for HIP, JupyterLab, mujoco-py, Triton easybuild-easyconfigs#22801