Skip to content

Commit

Permalink
Merge pull request #19 from vub-hpc/jupyter
Browse files Browse the repository at this point in the history
remove hook for JupyterHub
  • Loading branch information
wpoely86 authored May 12, 2024
2 parents 1f352ad + fb78c8e commit f12bc62
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions lib/vsc/eb_hooks/hooks_hydra.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from distutils.version import LooseVersion

from easybuild.framework.easyconfig.constants import EASYCONFIG_CONSTANTS
from easybuild.tools.config import install_path

from vsc.eb_hooks.ib_modules import IB_MODULE_SOFTWARE, IB_MODULE_SUFFIX, IB_OPT_MARK

Expand Down Expand Up @@ -260,26 +259,6 @@ def pre_module_hook(self, *args, **kwargs): # pylint: disable=unused-argument
self.log.info("[pre-module hook] Set MATLAB Runtime Component Cache folder")
self.cfg['modluafooter'] = """
setenv("MCR_CACHE_ROOT", os.getenv("TMPDIR") or pathJoin("/tmp", os.getenv("USER")))
"""

# Set single MODULEPATH in JupyterHub
if self.name == 'JupyterHub':
mod_install_path = os.path.join(install_path('mod'), "all")
self.log.info("[parse hook] Setting single MODULEPATH on module load to: %s", mod_install_path[-9:])

# cannot know MODULEPATH in advance for archs with IB variants, use environment at load time
local_arch = os.getenv('VSC_ARCH_LOCAL') + os.getenv("VSC_ARCH_SUFFIX")
archless_path = [f'"{p}"' for p in mod_install_path.split(local_arch)]
if len(archless_path) > 1:
archless_path.insert(1, 'os.getenv("VSC_ARCH_LOCAL") .. os.getenv("VSC_ARCH_SUFFIX")')
modulepath = ", ".join(archless_path)

self.cfg['modluafooter'] = f"""
-- restrict MODULEPATH to current software generation
if ( mode() ~= "spider" ) then
pushenv("MODULEPATH", "/etc/modulefiles/vsc")
prepend_path("MODULEPATH", pathJoin({modulepath}))
end
"""

##########################
Expand Down

0 comments on commit f12bc62

Please sign in to comment.