-
Notifications
You must be signed in to change notification settings - Fork 49
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
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
|
fa888dd
to
17170db
Compare
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
|
f06718d
to
35b5aad
Compare
35b5aad
to
12d17a4
Compare
…hen running in compat layer env
… a bind-mounted location
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_RC
is 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.py
in your current dir, in a.lmod
subdir, then point theLMOD_PACKAGE_PATH
to it. You can check that it gets picked up correctly by runningmodule --config
and looking for theSite Pkg location
field. If you want, you can add someLmodMessage("somemessage")
messages to thisSitePackage.py
to see when certain parts of it are executed.Then, put two dummy hooks in place in the
host_injections
prefix, 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_hook
andsite_specific_load_hook
) need to be defined without alocal
keyword (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.