Skip to content

Commit

Permalink
remove hook for JupyterHub
Browse files Browse the repository at this point in the history
  • Loading branch information
lexming committed May 10, 2024
1 parent 1f352ad commit 2b37678
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions lib/vsc/eb_hooks/hooks_hydra.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,26 +260,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 2b37678

Please sign in to comment.