Skip to content

probe external modules for missing metadata that is not provided via extermal module metadata file #3174

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

Merged
merged 23 commits into from
Apr 9, 2020

Conversation

victorusu
Copy link
Contributor

This commit handles metadata for external module dependencies when there is no entry in the metadata file

It should look for the pair of variables definitions in the modules in the given order

  1. CRAY_XXXX_PREFIX and CRAY_XXXX_VERSION
  2. CRAY_XXXX_DIR and CRAY_XXXX_VERSION
  3. CRAY_XXXX_ROOT and CRAY_XXXX_VERSION
  4. XXXX_PREFIX and XXXX_VERSION
  5. XXXX_DIR and XXXX_VERSION
  6. XXXX_ROOT and XXXX_VERSION
  7. XXXX_HOME and XXXX_VERSION

If no pair is found, an empty dependency dictionary is returned, as is the default behavior.

This avoids the need for a very large metadata file.

victorusu and others added 5 commits July 10, 2017 16:00
We got a request from one of our customers to enable the module names always as lowercases. 
This is the implementation of this feature. We would like to contribute this feature back.
Adding the lowercase module name scheme
This commit handles metadata for external module dependencies when there
is not entry in the metadata file

It should look for the pair of variables definitions in the modules in the
given order
  1. CRAY_XXXX_PREFIX and CRAY_XXXX_VERSION
  2. CRAY_XXXX_DIR and CRAY_XXXX_VERSION
  2. CRAY_XXXX_ROOT and CRAY_XXXX_VERSION
  5. XXXX_PREFIX and XXXX_VERSION
  4. XXXX_DIR and XXXX_VERSION
  5. XXXX_ROOT and XXXX_VERSION
  3. XXXX_HOME and XXXX_VERSION

If no pair is found, an empty dependency dictionary is returned, as is the
default behaviour

This avoids the need for a very large metadata file.
@victorusu victorusu requested a review from boegel January 23, 2020 14:19
@boegel boegel added this to the next release (4.1.2?) milestone Jan 25, 2020
prefix = self.modules_tool.get_variable_from_modulefile(dep_name, p)
version = self.modules_tool.get_variable_from_modulefile(dep_name, v)

if prefix and version:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if prefix is found but not version, and if the version is in dep_name, can't we simply use that one?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point is to only trust the metadata obtained by probing the module if it provides both the installation prefix and software version.
If it only provides one of both, we could have a "lucky hit", and the obtained metadata may be less trustworthy...

Let's go forward as is with this strict requirement, which can easily be loosened up later (the other way around is more difficult).

The other scenario, where the prefix is already known from the metadata file, but (only) the version is available through the module, may actually be more likely (since the prefix can be specified as the name of the environment variable specifying the installation prefix, not an actual hardcoded prefix, which can be done generically in the metadata file).

This does not fix the style checks

short_ext_modname = dep_name.split('/')[0]
if not 'name' in dependency:
dependency['name'] = [short_ext_modname]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the test is failing because this is added regardless of finding the rest of the metadata, if this is moved inside the if dep_prefix and dep_version: block then it doesn't create a problem

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, thanks for pointing this out @migueldiascosta!

@easybuilders easybuilders deleted a comment from boegelbot Mar 29, 2020
victorusu and others added 2 commits April 8, 2020 15:01
….get_setenv_value_from_modulefile, and add dedicated test for it
Copy link
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@victorusu I've reworked this a bit with the changes in victorusu#5.

Most significant changes:

  • renaming of _handle_ext_module_metadata_by_probing_modules to probe_external_module_metadata
  • changed logic in handle_external_module_metadata
  • fixed broken test (see @migueldiascosta's suggestion, thanks!)
  • renamed get_variable_from_modulefile to get_setenv_value_from_modulefile
  • added tests fo both get_setenv_value_from_modulefile and probing of external modules for missing metadata

boegel and others added 3 commits April 8, 2020 20:54
…ns prefix value in probe_external_module_metadata
fixes, cleanup, enhancements and tests for probing external modules for missing metadata
@easybuilders easybuilders deleted a comment from boegelbot Apr 9, 2020
@easybuilders easybuilders deleted a comment from boegelbot Apr 9, 2020
@boegel boegel merged commit 51953e6 into easybuilders:develop Apr 9, 2020
@boegel boegel changed the title Add probe of PREFIX and VERSION variable in external modules probe external modules for missing metadata that is not provided via extermal module metadata file Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants