-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feature : module file generation may be disabled via configuration file #617
Conversation
Nice! Can you make it use positive logic? I think it would be easier to understand if the syntax looked like this:
And I think it would be easy to make this simple for users if |
@tgamblin Sure, will do the change. |
@alalazo: FYI, per the last telcon, I am thinking of adding another layer to the prefs:
These would take progressively higher precedence. This would enable us to easily maintain nice default settings in (1) but sites could override them in (2). Currently there is only Module config would fit nicely into this. Thoughts? |
Hope not adding noise: |
@luigi-calori: I like this idea too -- I mentioned it in #552 and I think it is @alalazo's plan. I don't see why we couldn't add templates, or site-specific boilerplate as well. But maybe we could add that after the module config is in place in a separate PR? |
The naming scheme in #498 would be really helpful at our site as it could allow spack generate modules to co-exist with our current in-house modules, so, if possible, it would be good to have both module-related PR merged. Regarding template, as I' m really a newbie, I would like to make sure the file config syntax ( yaml, am I right?) could support definition of general strings allowing variable expansion for templating. Currently the content of the module seem fully defined in lib/spack/spack/modules.py No customization seem allowed, neither from the individual package.py nor by site or user config yaml files. For example, at our site, virtualgl module define a custom alias for vglrun and include tcl code to inspect available X display. If a simple subst syntax could be defined such as @{variable_name} then write() and write_header() functions could be replaced by substitutions in the (default/site/user)template then the custom tcl instruction of my virtualgl module could be define in it's package like the description and expanded in the template as @{module_footer} Agree better to have a separate PR, likely when this is merged. |
#552 has a quite self-explanatory title though (not to mention a description that took me a lot of time to write) 😄 |
@tgamblin In fact you're right. My plan on module files generation is more or less:
At that point we'll have a central place to customize module files generation behavior and we could proceed with :
|
Sorry, either I' ve been misunderstood or I was too dumb in reading docs: I greatly appreciated your PR #552 but maybe I 've missed some feature: I understood it as solid basis for environment handling. What I did not spot was the ability to add further instructions to modules apart from env variables and paths. (Tcl) modules can contain arbitrary tcl code such as the tcl code added for module help I did not spot any way to add arbitrary tcl code to the module generated without changing spack core, that is the reason for my comments and proposal. Please let me know if it is already possible or if it is considered undesirable. In the latter case, those (rare) cases where a greater customization is needed should be hand hacked |
@alalazo The #498 PR essentially collects module files of the various versions and variants of a program into a common directory, named for that program. It is useful for both TCL modules and Lmod modules, whether using a flat or hierarchical structure. The naming scheme probably needs to be tweaked but I did not try to tackle that in that PR. :) |
@glennpj by naming scheme I really mean the layout of the module files on disk. What you have done in #498 seems to me quite better than the current state of things. For lmod in #107 I have done basically the same, implementing the usual "Core/Compiler/MPI" subdivision. The idea of the customization is just to permit schemes like e.g.:
and all sorts of similar combinations that the various sites would like to have instead of the default ones. |
@tgamblin updated description and made the logic positive. |
@alalazo: looks good to me -- ready to merge? |
@tgamblin yes |
Thanks! |
Rationale
Introduce a configuration file for site-specific customization on module files
Modifications :
enable
keyword to explicitly enable the generation of the module files (defaults to 'tcl' and 'dotkit')Example of use :
Add the following lines in the file to enable only
dotkit
file generation: