Skip to content
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

Module alias/wrapper detection is broken/incomplete #3215

Closed
Flamefire opened this issue Feb 26, 2020 · 1 comment · Fixed by #3216
Closed

Module alias/wrapper detection is broken/incomplete #3215

Flamefire opened this issue Feb 26, 2020 · 1 comment · Fixed by #3216
Milestone

Comments

@Flamefire
Copy link
Contributor

Flamefire commented Feb 26, 2020

Some modules have wrapper modules or aliases. E.g. Java/11 is not a real modules but implemented via a .modulerc.lua as module_version("Java/11.0.6-ppc64le", "11")

Similar thing exists for aliases: module_alias(...)

When EasyBuild checks for an existing module it runs module show <modname> and checks the output with a regexp ^\s*\S*/<modname>.*(\.lua)?:\s*$

This isn't exactly reliable. E.g. one might have a module Java/site-default-11 or so. Additionally not all possible modulerc locations are considered and aliases are completely unsupported. See https://lmod.readthedocs.io/en/latest/093_modulerc.html

The obvious solution would be to start parsing the modulerc files correctly.

But: Of course it isn't as this is what the modules tool can do way better.

Hence the better solution would be to check for _mlstatus = False and if that is found the module isn't available. Getting the filename isn't required for the correct return value of <ModulesTool>.exist so this can be greatly simplified.

Edit: This doesn't seem to work reliably for some reason. Sometimes lmod seems to return only _mlstatus = True even though the module isn't found. But only in EB, can't reproduce in shell. Seems to be that LMOD_QUIET=1 also suppresses the error code

In case we need the filename sometime later we should split the stdout/stderr and parse only stderr for a filename (LMod, not sure about EnvironmentModules)

@Flamefire
Copy link
Contributor Author

I propose to remove the fallback via module_wrapper_exists as it would need to implement functionality of the module tool. Current state:

Fallback considers only:

  • module_version command
  • only module paths and 1 given directory

Fallback hence fails for:

  • module_alias
  • system MODULERC files
  • ~/.modulerc.lua or ~/.modulerc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants