-
Notifications
You must be signed in to change notification settings - Fork 202
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
lift invalidating of module caches into helper method that can be used by easyblocks #2571
Conversation
…idate_module_caches_for lift relevant code block into 'invalidate_module_caches' helper method, which can be used easily by easyblocks that overwrite make_module_step
After trying to come up with a test to verify the fix done in 3354ade, I noticed there wasn't actually a problem at all in framework... The actual bug was that the So, I've rolled back the call to I've added the test I was working on as well, since it doesn't hurt; as far as I can tell there was no test yet that accurately verifies that the module caches are reset in between builds... |
71c8505
to
3faea7b
Compare
easybuild/tools/modules.py
Outdated
@@ -1106,7 +1106,7 @@ class Lmod(ModulesTool): | |||
"""Interface to Lmod.""" | |||
COMMAND = 'lmod' | |||
COMMAND_ENVIRONMENT = 'LMOD_CMD' | |||
REQ_VERSION = '5.8' | |||
REQ_VERSION = '6.6.3' |
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.
This is a substantial bump in the required Lmod version, but since 6.6.3 was released on Nov 13th 2016, I don't expect this to be a big problem.
A sufficiently recent Lmod version is needed in order for .modulerc
to be picked up by Lmod, which is needed for the ModuleAlias
easyblock (see easybuilders/easybuild-easyblocks#1503).
In theory, Lmod 6.0 should be sufficient for that, but several (unrelated) tests failed when using older Lmod 6.x versions.
Lmod 6.6.3 is the last 6.x release, so this way EasyBuild is still compatible with both Lmod 6.x & 7.x.
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...waiting for travis
modulerc_txt = modgen.modulerc(module_version=module_version_spec) | ||
one_moddir = os.path.join(self.test_installpath, 'modules', 'all', 'one') | ||
write_file(os.path.join(one_moddir, '.modulerc'), modulerc_txt) | ||
|
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.
What happens if you repeat 1446 at this point (1.0.2 doesn't exist yet but the rc file does)?
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.
Well, it won't make a difference because of the modules cache (the result for avail one/1.0
& show one/1.0
is cached).
And even if we clear the cache, it will still fail, since the underlying module doesn't exist yet (I'll add that to the test).
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, waiting on travis
While testing the
ModulesAlias
easyblock (cfr. easybuilders/easybuild-easyblocks#1503), I noticed that the caching we do formodule show
commands is a bit too aggressive...Module aliases show up in the output of
module --terse avail
in such a way that a fallback is needed tomodule show
to recognize that a module alias is already in place.The result of a
module show
command is cached the first time if it is run, but if multiple builds are being performed in the same session, this is a problem since the later build will see the outdated/incorrect result in a module alias was install in an early build.For example, if
Bazel
hasJava/1.8
specified as a dependency to be resolved by a module alias that still needs to be installed, theJava/1.8
alias that is in place by the timeBazel
is installed will not be observed because the originalmodule show Java/1.8
that came back empty is cached.Clearing the
module avail
andmodule show
caches before every new build is started deals with this issue.