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

add support for --update-lmod-caches (disabled by default) and --compile-lmod-caches (WIP) #1177

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

boegel
Copy link
Member

@boegel boegel commented Feb 12, 2015

@rtmclay: it would be great if you could give this a review, especially w.r.t. the FIXME I have in there

@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1334/
Test FAILed.

def compile_cache(self, cache_fp):
"""Compile Lmod cache file using luac."""
if build_option('compile_lmod_caches'):
# FIXME: ask Lmod to compile, to ensure that luac that matches the lua used by Lmod is used?
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 on letting lmod compile the cache. then we also don't need to test if luac is in PATH etc etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

that's just a side-effect, but yes, that's good

it's important that Lmod uses the luac that matches the lua it's using, since the Lua version has to be part of the filename of the compiled cache (I still need to fix that here)

@pforai
Copy link
Contributor

pforai commented Feb 13, 2015

Can we look into drop using $LMOD_IGNORE_CACHE=1 globally?

@boegel boegel mentioned this pull request Feb 14, 2015
27 tasks
from easybuild.tools.module_naming_scheme import DEVEL_MODULE_SUFFIX
from easybuild.tools.run import run_cmd
from easybuild.tools.toolchain import DUMMY_TOOLCHAIN_NAME, DUMMY_TOOLCHAIN_VERSION
from vsc.utils.missing import nub

# relative to user's home directory
LMOD_USER_CACHE_RELDIR = '.lmod.d/.cache'
Copy link
Member

Choose a reason for hiding this comment

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

  --with-useDotFiles=yes/no
                          If yes use ~/.lmod.d/.cache, if no use
                          ~/.lmod.d/__cache__

Copy link
Member Author

Choose a reason for hiding this comment

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

this is just a default, --update-lmod-caches takes an argument if you want to update caches in another location

since .lmod.d/.cache is the default in Lmod, I think just keeping this as is makes sense

@boegel
Copy link
Member Author

boegel commented Feb 14, 2015

@pforai: OK, I'll try and tackle that bit in here, as discussed... It should boil down to always updating the cache before every build is started. Although this will take a little while, it will avoid having to scan the module tree multiple times when running, since module avail, which is done for each dependency, etc., will become very fast...

…if luac is available), fix filename of compiled cache
@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1348/
Test FAILed.

@boegel
Copy link
Member Author

boegel commented Feb 14, 2015

@pforai: I took a look, and there's more needed to make sure we can not ignore the cache...

We need to make sure that we can/should update the cache actively being used by Lmod in the environment we're running in. This could be a system cache (where we may not have permissions to to update it), or just our local user cache.

So, it seems like we need the following cmdline options:

  • --ignore-lmod-caches (enabled by default, to make sure?)
  • --update-lmod-caches[=<dir> (which is there now)

Iff --ignore-lmod-caches is set to False, we need to somehow query Lmod which cache it will be using, an try to update it. If that works, we can continue. If not, we need to scream bloody murder and end it before it goes bad somehow (e.g. accidentally reinstalling something because we don't see it in ml av).

Auto-updating the 'live' Lmod cache is probably also not a good idea in a general sense, since we don't know for which $MODULEPATH it was built... Although it may be fine to assume that the $MODULEPATH is correct when eb is being asked to update the live cache.

In short, I need to give this more thought, so we should probably stay away from also tackling that in this PR.

@boegel
Copy link
Member Author

boegel commented Feb 14, 2015

@stdweird: please re-review?

@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1349/
Test PASSed.

@boegel
Copy link
Member Author

boegel commented Feb 15, 2015

@pforai: One thing we can do is generate our own Lmod cache in /tmp, and then configure Lmod to use that cache via $LMOD_RC. With that in place, we can disable LMOD_IGNORE_CACHE...

…rect naming of 'old' compiled cache, only build moduleT cache, restructure new code a bit
@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1361/
Test FAILed.

@rtmclay
Copy link

rtmclay commented Feb 16, 2015

This looks O.K. to me. You might want to add support for -D with the spider command as a way to track down Lmod problems when building the spider cache.

'optarch': ("Set architecture optimization, overriding native architecture optimizations",
None, 'store', None),
'umask': ("umask to use (e.g. '022'); non-user write permissions on install directories are removed",
None, 'store', None),
'update-lmod-cache': ("Update Lmod cache files in specified dir after generating module file",
Copy link
Contributor

Choose a reason for hiding this comment

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

(again) module tool neutral option name

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, I'll make this more neutral, something like update-modules-tool-cache.

@rtmclay
Copy link

rtmclay commented Feb 16, 2015

the script createSystemCacheFile.sh is part of the standard Lmod distribution. But it has to be modified to be used at each site.

@boegel
Copy link
Member Author

boegel commented Feb 16, 2015

@rtmclay: is there any reason why there is no dedicated option in Lmod to update the cache(s) at a specific location?

@stdweird
Copy link
Contributor

@rtmclay what needs customisation? it would be better if EB can just use it instead trying to reproduce it in python (it would be even better if lmod had a lmod --make-cache option).

@boegel
Copy link
Member Author

boegel commented Feb 16, 2015

@stdweird: the location of the cache and timestamp files, potentially also the $MODULEPATH for which the cache is built, the luac being used (which has to match the one Lmod is using), etc.

But, I agree that there should be a dedicated cmdline option in Lmod for doing this. The only reason I'm reproducing it now is because there isn't (yet). If there was, I would use it for sure.

@rtmclay
Copy link

rtmclay commented Feb 16, 2015

The script createSystemCacheFile.sh can be modified to take arguments but having the lmod command do it is just wrong. I'm not going to take bug reports that updating the system cache fails when the user doesn't have permission to write to that directory. I can modify it when I get back. Or I'll take a PR on that.

@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1369/
Test FAILed.

@boegel
Copy link
Member Author

boegel commented Feb 17, 2015

Jenkins: test this please

@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1370/
Test FAILed.

@boegel
Copy link
Member Author

boegel commented Feb 17, 2015

Jenkins: test this please

@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1375/
Test FAILed.

@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1376/
Test FAILed.

@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1379/
Test PASSed.

Conflicts:
	easybuild/framework/easyblock.py
	easybuild/tools/modules.py
	easybuild/tools/options.py
	test/framework/modulestool.py
@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1412/
Test FAILed.

@boegel boegel mentioned this pull request Mar 11, 2015
8 tasks
@boegel boegel modified the milestone: v2.x Jan 23, 2016
@akesandgren
Copy link
Contributor

@boegel Relevance?

@boegel boegel modified the milestones: 3.x, 4.x Feb 20, 2020
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.

None yet

7 participants