add support for environment variables in set_environment of module generators#4855
Merged
boegel merged 14 commits intoeasybuilders:developfrom May 21, 2025
Merged
add support for environment variables in set_environment of module generators#4855boegel merged 14 commits intoeasybuilders:developfrom
set_environment of module generators#4855boegel merged 14 commits intoeasybuilders:developfrom
Conversation
…ModuleGeneratorLua
… ModuleGeneratorLua
…in ModuleGeneratorLua
…n ModuleGeneratorLua
1 task
1 task
Contributor
|
after a quick discussion with @lexming he will add an option to opt out of resolving the variables |
Contributor
Author
|
@smoors as discussed, resolution of shell variables is enabled by default and can be disabled with an extra option in Updated unit tests accordingly. |
boegel
reviewed
May 21, 2025
boegel
reviewed
May 21, 2025
boegel
reviewed
May 21, 2025
boegel
requested changes
May 21, 2025
… in values of modextravars
…rename DEFAULT_MODEXTRAVARS* constants in ModuleGenerator class)
boegel
requested changes
May 21, 2025
rename `shell_vars` options in `modextravars` to `resolve_env_vars` (+ rename `DEFAULT_MODEXTRAVARS*` constants in `ModuleGenerator` class)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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