Skip to content

only load modules using short module names#1754

Merged
boegel merged 7 commits intoeasybuilders:developfrom
boegel:sanity_check_load_short_name
May 10, 2016
Merged

only load modules using short module names#1754
boegel merged 7 commits intoeasybuilders:developfrom
boegel:sanity_check_load_short_name

Conversation

@boegel
Copy link
Member

@boegel boegel commented May 9, 2016

This fixes a long-standing bug, which has remain hidden up until now because it only causes actual problems in particular circumstances, e.g. when running the sanity check commands during the sanity check of installing OpenMPI with a PGI toolchain when using a hierarchical module naming scheme, cfr. easybuilders/easybuild-easyconfigs#2899. The combination of sanity check commands with a toolchain that actually corresponds to a software package (rather than just a bundle of other modules) and a hierarchical module naming scheme is required to trigger this bug...

The problem is that the temporary module that is generated and loaded at the start of the sanity check was being loaded with the full name (e.g. Compiler/GCC/4.7.2/OpenMPI/1.6.4) rather than the short name (e.g. OpenMPI/1.6.4).

The latter requires that the module for the toolchain used to perform must be loaded first, to make sure that $MODULEPATH is extended properly for the load with the short name to be work, and it's exactly this missing load that was causing problems when performing the sanity check commands for OpenMPI installed on top of PGI, i.e. that the PGI compiler commands (e.g. pgcc) were not available in $PATH (because the PGI module wasn't actually loaded during the sanity check).

This change fixes this problem, by making sure that all loads performed by EasyBuild are done with the short module name and that $MODULEPATH is prepended as needed to make the temporary (fake) module loadable.

(WIP because I want to look into a dedicated test to catch this...)

cc @bartoldeman, @ocaisa, @damianam, @geimer

@hpcugentbot
Copy link

EasyBuild framework unit test suite FAILed.

See https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/3010/console for more details.

Please fix the reported issues by pushing additional commits to the branch corresponding with this pull request; contact @boegel if you're not sure what to do.

@hpcugentbot
Copy link

EasyBuild framework unit test suite PASSed (see https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/3011/console for more details).

This pull request is now ready for review/testing.

Please try and find someone who can tackle this; contact @boegel if you're not sure what to do.

""" Verify if the given dependencies exist and add them """
self.log.debug("add_dependencies: adding toolchain dependencies %s" % dependencies)

# use *full* module name to check existence of dependencies, since the modules may not be avaialble in the
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpicking: avaialble? ;-)

Copy link
Member Author

Choose a reason for hiding this comment

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

nice catch :)

@hpcugentbot
Copy link

EasyBuild framework unit test suite PASSed (see https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/3012/console for more details).

This pull request is now ready for review/testing.

Please try and find someone who can tackle this; contact @boegel if you're not sure what to do.

@hpcugentbot
Copy link

EasyBuild framework unit test suite PASSed (see https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/3013/console for more details).

This pull request is now ready for review/testing.

Please try and find someone who can tackle this; contact @boegel if you're not sure what to do.

@boegel boegel changed the title only load modules using short module names (WIP) only load modules using short module names May 10, 2016
@boegel
Copy link
Member Author

boegel commented May 10, 2016

dedicated unit test added that triggers the bug, i.e. without the fix implemented here, it fails with:

======================================================================
ERROR: test_toy_sanity_check_commands (__main__.ToyBuildTest)
Test toy build with extra sanity check commands.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/framework/toy_build.py", line 1115, in test_toy_sanity_check_commands
    self.eb_main(args, logfile=self.dummylogfn, do_build=True, verbose=True, raise_error=True)
  File "/Users/kehoste/work/easybuild-framework/test/framework/utilities.py", line 276, in eb_main
    raise myerr
EasyBuildError: "Build of /tmp/eb-95zh3u/eb-EdLoTc/toy-0.0-tweaked.eb failed
(err: 'build failed (first 300 chars): Sanity check failed:
sanity check command env | grep EBROOTGCC  exited with code 1 (output: ),
sanity check command env | grep EBROOTGOOLF  exited with code 1 (output: )')"

----------------------------------------------------------------------

@hpcugentbot
Copy link

EasyBuild framework unit test suite PASSed (see https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/3015/console for more details).

This pull request is now ready for review/testing.

Please try and find someone who can tackle this; contact @boegel if you're not sure what to do.

@wpoely86
Copy link
Member

👍

@boegel
Copy link
Member Author

boegel commented May 10, 2016

This is good to go imho; @geimer took a look at it and didn't seem to have any objections (other than a silly typo), @wpoely86 gave it thumbs up and @bartoldeman confirmed that this fixes the problem he was having with easybuilders/easybuild-easyconfigs#2899 (which is confirmed with the test report that uses HierarchicalMNS)

I'm still somewhat surprised that this didn't pop up earlier, but it only comes forward under very specific circumstances...

@boegel boegel merged commit a576a8e into easybuilders:develop May 10, 2016
@boegel boegel deleted the sanity_check_load_short_name branch May 10, 2016 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants