Hi Trey,

On 02/09/14 01:24, Trey Dockendorf wrote:
Yes, you can use a custom module naming scheme, which would probably
derive from the existing HierarchicalMNS.

Documentation for that is available at
https://github.com/hpcugent/easybuild/wiki/Using-a-custom-module-naming-scheme,
but (still) needs to be updated w.r.t. the extended support for
hierarchical schemes.

Initial attempts failing.

$ ls -R /home/treydock/easybuild/easybuild_overrides/
/home/treydock/easybuild/easybuild_overrides/:
easybuild

/home/treydock/easybuild/easybuild_overrides/easybuild:
__init__.py  __init__.pyc  tools

/home/treydock/easybuild/easybuild_overrides/easybuild/tools:
__init__.py  __init__.pyc  module_naming_scheme

/home/treydock/easybuild/easybuild_overrides/easybuild/tools/module_naming_scheme:
__init__.py  __init__.pyc  local_module_naming_scheme.py  
local_module_naming_scheme.pyc

$ cat 
/home/treydock/easybuild/easybuild_overrides/easybuild/tools/module_naming_scheme/local_module_naming_scheme.py
import os
from easybuild.tools.module_naming_scheme import HierarchicalMNS

class LocalModuleNamingScheme(HierarchicalMNS):
   """Class implementing local module naming scheme."""

   def det_short_module_name(self, ec):
       """
       Determine short module name, i.e. the name under which modules will be 
exposed to users.
       Examples: GCC/4.8.3, OpenMPI/1.6.5, OpenBLAS/0.2.9, HPL/2.1, Python/2.7.5
       """
       return os.path.join(ec['name'].lower(), ec['version'] + 
ec['versionsuffix'])

$ MYEBDIR=$HOME/easybuild/my_easyblocks
$ EB_MNS_DIR=$HOME/easybuild/easybuild_overrides
$ export PYTHONPATH=$PYTHONPATH:$MYEBDIR:$EB_MNS_DIR
$ echo $PYTHONPATH
:/home/treydock/easybuild/my_easyblocks:/home/treydock/easybuild/easybuild_overrides

You need to make sure the framework is in your Python search patch too, and it should be in there first (before your easybuild_overrides dir).

Also, make sure *all* the __init__.py files contain the extend_path line (maybe that by itself it enough to fix your problem).


$ eb --avail-module-naming-schemes
Traceback (most recent call last):
   File "/usr/lib/python2.6/site-packages/easybuild/main.py", line 52, in 
<module>
     import easybuild.tools.options as eboptions
   File "/usr/lib/python2.6/site-packages/easybuild/tools/options.py", line 41, in 
<module>
     from easybuild.framework.easyblock import EasyBlock
   File "/usr/lib/python2.6/site-packages/easybuild/framework/easyblock.py", line 52, 
in <module>
     from easybuild.framework.easyconfig.easyconfig import (EasyConfig, 
ActiveMNS, ITERATE_OPTIONS,
   File 
"/usr/lib/python2.6/site-packages/easybuild/framework/easyconfig/__init__.py", line 
35, in <module>
     from easybuild.framework.easyconfig.easyconfig import EasyConfig
   File 
"/usr/lib/python2.6/site-packages/easybuild/framework/easyconfig/easyconfig.py", line 
50, in <module>
     from easybuild.tools.module_naming_scheme import DEVEL_MODULE_SUFFIX
ImportError: cannot import name DEVEL_MODULE_SUFFIX

I think this signals that the __init__.pyt in easybuild_overrides/easybuild/tools/module_naming_scheme doesn't contain an extend_path? Either that, or the path /usr/lib/python2.6/site-packages/ isn't first in your Python search path.

It should be though, since the DEVEL_MODULE_SUFFIX is provided by the __init__.py in /usr/lib/python2.6/site-packages/easybuild/tools/module_naming_scheme.


regards,

Kenneth

EasyBuild takes into account that certain modules may have been
loaded,
and should stay loaded.

I haven't used this in combination with sticky modules myself (maybe
others have).
If you notice any issues related to this, let us know, since that
would
be a bug.

I'll give it a try and see how it works, thanks.

- Trey

Reply via email to