-
Notifications
You must be signed in to change notification settings - Fork 66
Allow defining lmod hooks in host injections #525
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
Allow defining lmod hooks in host injections #525
Conversation
|
Instance
|
|
bot: build repo:eessi.io-2023.06-software arch:aarch64/generic |
Updates by the bot instance
|
|
New job on instance
|
|
New job on instance
|
|
New job on instance
|
|
New job on instance
|
|
New job on instance
|
|
New job on instance
|
|
New job on instance
|
|
New job on instance
|
|
bot: build repo:eessi.io-2023.06-software arch:x86_64/generic |
Updates by the bot instance
|
|
New job on instance
|
|
New job on instance
|
|
New job on instance
|
|
New job on instance
|
|
New job on instance
|
|
New job on instance
|
|
New job on instance
|
|
New job on instance
|
…hen running in compat layer env
… a bind-mounted location
boegel
left a comment
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
Fixes #456
For proper testing, we want this fix to be deployed first or you need to make sure to unset
LMOD_RC(after sourcing the EESSI environment). Otherwise, you'll find that no matter what local change you make, you are always executing the EESSI hook (and only the EESSI hook), since theLMOD_RCis still set :)Because our current lmod version doesn't support registering multiple hooks yet (only supported from version 8.7.36 onwards, see here), the person implementing the site-specific hook needs to define a combined function that also calls the EESSI hook (if he/she wants to append to the EESSI hook's functionality, of course you can always simply overwrite it).
The easiest way to test this PR is to do the following:
This generates the
SitePackage.pyin your current dir, in a.lmodsubdir, then point theLMOD_PACKAGE_PATHto it. You can check that it gets picked up correctly by runningmodule --configand looking for theSite Pkg locationfield. If you want, you can add someLmodMessage("somemessage")messages to thisSitePackage.pyto see when certain parts of it are executed.Then, put two dummy hooks in place in the
host_injectionsprefix, e.g.:Now, to test it:
(as you can see, I added some print statements to check the order in which they are executed, and to see if all are executed). IMPORTANT: all the functions that have to be used in other translation units (e.g. the
eessi_load_hookandsite_specific_load_hook) need to be defined without alocalkeyword (for obvious reasons :)).Similarly, if a site wants their host or architecture specific hook to just overwrite the EESSI hook, they could do:
Note that once we have Lmod version 8.7.36 or later, things become much simpler if you want to append:
The big advantage here is that the person implementing the site specific hook does not need to know the name of the EESSI hook in order to append to it.