-
Notifications
You must be signed in to change notification settings - Fork 203
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 user-local modules with hierarchical naming schemes #1472
Conversation
Automatic reply from Jenkins: Can I test this? |
Jenkins: ok to test |
EasyBuild framework unit test suite PASSed (see https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2329/console for more details). This pull request is now ready for review/testing. Please try and find someone who can tackle this; contact @boegel if you're not sure what to do. |
user_modpath_exts = ActiveMNS().det_user_modpath_extensions(self.cfg) | ||
self.log.debug("Including user module path extensions returned by naming scheme: %s" | ||
% user_modpath_exts) | ||
quoted_user_modpath_exts = [quote_str(os.path.join(user_modpath, ext)) for ext in user_modpath_exts] |
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.
maybe we should be quoting in module_generator.use
instead, if it's so important to do this?
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.
I think quoting only gets important if the path contains some crazy characters that are evaluated by Tcl/Lua. That is, the quotes are more a "safety net" rather than required. AFAIR, I did the quoting outside of module_generator.use
to allow both prefix
and path
to be expressions that are evaluated when loading the modulefile. But I agree that this may be over-engineered.
@geimer: sorry it took me so long to give this a proper review, you should have pinged me earlier There's a couple of loose ends here, so too late to make it in for EB v2.5.0 I'm afraid, so I'm going to put 2.6.0 as milestone on this... Next to the remarks inline:
Other than that, this looks really reasonable to me, you have to stop pretending to not know Python. ;-) Let me know if you need any help in tackling the remarks (or just throw your hands up and let me take over, that's fine by me). |
@boegel: OK, I believe the culprit is in Seems like this is getting more and more unrelated to the original topic of this PR, just because it triggers already existing bugs in other areas of the code... What do you think? |
@boegel: Well, not really. I just noticed as well that the Lua syntax was missing here. The more difficult issue is that with user-local modules, the argument given to |
@geimer: it sounds like we'll need to rework that to parse the output of |
@boegel: Something like this, yes. But since |
@geimer: I meant to say |
@boegel: Looks like |
@geimer In what sense, exactly? And do you mean with module files written in Tcl, or using |
@boegel: I tried |
@geimer: it doesn't even include the |
Seems like you're right, urgh. test module:
'
'
'
'
|
@boegel: I've adjusted the regex in W.r.t. Apart from this, I believe all your comments have been addressed. Please take another look. |
EasyBuild framework unit test suite PASSed (see https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2523/console for more details). This pull request is now ready for review/testing. Please try and find someone who can tackle this; contact @boegel if you're not sure what to do. |
@@ -588,7 +588,7 @@ def modpath_extensions_for(self, mod_names): | |||
modpath_exts = {} | |||
for mod_name in mod_names: | |||
modtxt = self.read_module_file(mod_name) | |||
useregex = re.compile(r"^\s*module\s+use\s+(\S+)", re.M) | |||
useregex = re.compile(r'^\s*module\s+use\s+"?([^" \t\n\r\f\v]+)"?', re.M) |
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.
@geimer: please use \s
instead of \t\n\r\f\v
, cfr. https://docs.python.org/2/library/re.html
\s
When the UNICODE flag is not specified, it matches any whitespace character,
this is equivalent to the set [ \t\n\r\f\v].
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.
@boegel: I wasn't aware that one can use character classes within character classes. But makes sense.
EasyBuild framework unit test suite FAILed. See https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2528/console for more details. Please fix the reported issues by pushing additional commits to the branch corresponding with this pull request; contact @boegel if you're not sure what to do. |
tests failed due to a temporary issue with GitHub, it seems, let's try again Jenkins: test this please |
EasyBuild framework unit test suite PASSed (see https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2529/console for more details). This pull request is now ready for review/testing. Please try and find someone who can tackle this; contact @boegel if you're not sure what to do. |
@boegel: W.r.t. And now the potential use case: Assume that we have a system-wide software installation using EB in I guess a bunch of other things may need to be resolved before the use case above will work with EB. But it is something I would like to see at some point (and I know at least one other guy in our group who already asked whether this would be possible). |
@geimer: OK, I see what you're saying. The current implementation of For your use case to work, we will need a way of dealing with those too. Can you please open a separate issue on this with largely a copy-paste of your last comment, and a pointer to this PR? This is good to go btw, thanks a lot for your work and dedicated follow-up on this, much appreciated. |
Allow user-local modules with hierarchical naming schemes
@@ -126,6 +126,18 @@ def det_modpath_extensions(self, ec): | |||
# by default: an empty list of subdirectories to extend $MODULEPATH with | |||
return [] | |||
|
|||
def det_user_modpath_extensions(self, ec): |
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.
@geimer @boegel This does not seem to be respecting EASYBUILD_SUFFIX_MODULES_PATH
(which defaults to all
):
conflict("GCCcore")
prepend_path("MODULEPATH", "/usr/local/software/jureca/Stages/Devel-2017a/modules/all/Compiler/GCCcore/5.4.0")
if isDir(pathJoin(os.getenv("HOME"), ".local/EasyBuild/modules/Compiler/GCCcore/5.4.0")) then
prepend_path("MODULEPATH", pathJoin(os.getenv("HOME"), ".local/EasyBuild/modules/Compiler/GCCcore/5.4.0"))
end
Notice the missing all
in the local path.
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.
@ocaisa what was the full EasyBuild configuration here (eb --show-config
)?
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.
-bash-4.2$ eb --show-config
#
# Current EasyBuild configuration
# (C: command line argument, D: default value, E: environment variable, F: configuration file)
#
buildpath (E) = /dev/shm/ocaisa
experimental (E) = True
fixed-installdir-naming-scheme (E) = True
group-writable-installdir (E) = True
hide-deps (E) = ANTLR, APR, APR-util, AT-SPI2-ATK, AT-SPI2-core, ATK, Autoconf, Automake, adwaita-icon-theme, ant, assimp, Bison, babl, binutils, byacc, bzip2, CUSP, Coreutils, cairo, configurable-http-proxy, DB, DBus, DocBook-XML, Dyninst, dbus-glib, damageproto, ETSF_IO, Exiv2, eudev, expat, FFmpeg, FLTK, FTGL, fixesproto, fontsproto, fontconfig, freeglut, freetype, GCCcore, GDAL, GEGL, GL2PS, GLEW, GLib, GLPK, GPC, GObject-Introspection, GTI, GTK+, GTS, Gdk-Pixbuf, Ghostscript, GraphicsMagick, GtkSourceView, g2clib, g2lib, gc, gexiv2, glproto, gperf, guile, grib_api, gsettings-desktop-schemas, gettext, HarfBuzz, icc, ifort, inputproto, intltool, itstool, JUnit, JSON-C, JSON-GLib, JasPer, jhbuild, kbproto, LZO, LibTIFF, LibUUID, Libint, LittleCMS, libGLU, libICE, libSM, libX11, libXau, libXaw, libXcursor, libXdamage, libXdmcp, libXext, libXfixes, libXfont, libXft, libXi, libXinerama, libXmu, libXpm, libXrandr, libXrender, libXt, libXtst, libcerf, libcroco, libctl, libdap, libdrm, libdwarf, libelf, libepoxy, libevent, libffi, libfontenc, libgd, libgeotiff, libglade, libidn, libjpeg-turbo, libmatheval, libmypaint, libpng, libpciaccess, libpthread-stubs, libreadline, librsvg, libtool, libunistring, libunwind, libyaml, libxcb, libxkbcommon, libxml2, libxslt, libyuv, M4, Mesa, makedepend, motif, msgpack-c, NASM, ncurses, nettle, nodejs, nvenc_sdk, nvidia, OPARI2, OTF2, PCRE, PDT, PROJ, Pango, Pmw, PnMPI, PyCairo, PyGObject, Python-Xpra, pixman, pkg-config, pkgconfig, popt, pscom, Qhull, Qt, Qt5, qrupdate, randrproto, recordproto, renderproto, S-Lang, SCons, SIP, SQLite, SWIG, Serf, Szip, scrollkeeper, Tcl, Tk, texinfo, UDUNITS, util-linux, vpx, wxPropertyGrid, wxWidgets, XML-Parser, XZ, XKeyboardConfig, x264, x265, xbitmaps, xcb-proto, xcb-util, xcb-util-image, xcb-util-keysyms, xcb-util-renderutil, xcb-util-wm, xextproto, xineramaproto, xorg-macros, xprop, xproto, xtrans, YAXT, Yasm, zlib
hide-toolchains (E) = GCCcore
include-easyblocks (E) = /work/zam/swmanage/EasyBuild/Custom_EasyBlocks/Devel-2017a/*.py, /work/zam/swmanage/EasyBuild/Custom_EasyBlocks/Devel-2017a/generic/*.py
include-module-naming-schemes (E) = /work/zam/swmanage/EasyBuild/Custom_MNS/Devel-2017a/*.py
include-toolchains (E) = /work/zam/swmanage/EasyBuild/Custom_Toolchains/Devel-2017a/*.py
installpath (E) = /usr/local/software/jureca/Stages/Devel-2017a
job-backend-config (E) = /usr/local/software/FZJ/gc3pie.cfg
job-cores (E) = 48
job-max-walltime (E) = 1
minimal-toolchains (E) = True
module-naming-scheme (E) = CustomHierarchicalMNS
packagepath (E) = /usr/local/software/jureca/Stages/Devel-2017a/packages
prefix (E) = /usr/local/software/jureca/Stages/Devel-2017a
repositorypath (E) = /usr/local/software/jureca/Stages/Devel-2017a/eb_repo
robot (E) = /work/zam/swmanage/EasyBuild/Golden_Repo/Devel-2017a, /usr/local/software/jureca/Stages/Devel-2017a/eb_repo, /work/zam/swmanage/EasyBuild/Golden_Repo/Devel-2017a
robot-paths (E) = /work/zam/swmanage/EasyBuild/Golden_Repo/Devel-2017a, /usr/local/software/jureca/Stages/Devel-2017a/eb_repo, /work/zam/swmanage/EasyBuild/Golden_Repo/Devel-2017a
set-gid-bit (E) = True
sourcepath (E) = /work/zam/swmanage/EasyBuild/sources
subdir-user-modules (E) = .local/EasyBuild/modules
umask (E) = 002
use-existing-modules (E) = True
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.
I get the same effect with using HierarchicalMNS
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 occurs with a vanilla instance and the command line:
eb --module-naming-scheme=HierarchicalMNS --subdir-user-modules=.local/EasyBuild/modules GCCcore-5.4.0.eb -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.
fix implemented in #2250
If one uses EB's default MNS, user-local modules are no problem, as a site only needs to 'module use' something like '$HOME/.local/modules' in their modules setup script. However, when using an HMNS, this per-user location needs to be taken into account by the EB-generated modules which extend
$MODULEPATH.
This PR introduces a new option 'subdir-user-modules' (empty by default) which allows to define a location relative to the user's
$HOME
in which a user-local modules hierarchy (according to the module naming scheme, configurable viadet_user_modpath_extensions
) is searched. The corresponding modules will then include an additionalmodule use
statement to pick up modules from the this location. To prevent errors if the directory does not exist (C modules), thismodule use
is guarded by a check.