cmd-ntrf / jupyter-lmod

Jupyter plugin that provides a tab for TACC Lmod (https://github.com/TACC/Lmod)
MIT License
28 stars 13 forks source link

How to load openmpi/python3 as module using jupyterlab-lmod in Jupyterhub #34

Closed zainul1114 closed 3 years ago

zainul1114 commented 3 years ago

Hi all, My default jupyterhub is using with python3.6.9 I am trying to load openmpi4.0/python3.7.6 packages via jupyter labextension - jupyterlab-lmod and i am not able to get any available modules.

image

and module avail command result as follows

image

Please guide/help me how to load/unload modules into jupyterhub environment.

Regards, Zain

cmd-ntrf commented 3 years ago

Since version 2.0 of jupyter-lmod, the parsing of lmod output is done with regular expressions : https://github.com/cmd-ntrf/jupyter-lmod/blob/master/lmod/__init__.py#L15

It is possible that your version of lmod output mismatch the regular expressions and jupyter-lmod fails in parsing lmod output. To test this, install jupyterlmod in a virtual environment on your cluster, and in an ipython shell execute the following commands:

%autoawait
import lmod
await lmod.avail()

It should return the list of available modules. If this list is empty, there is a problem with the regex or lmod output. If it is not empty, the problem lies elsewhere and I'll keep digging.

zainul1114 commented 3 years ago

Hi,

when i try to run above commands i am getting below.. image

Please help me resolve this.

Regards, Zain

cmd-ntrf commented 3 years ago

As indicated in the stack trace, the environment variable LMOD_CMD is not defined.

Refer to LMOD FAQ for more info on the variable: https://lmod.readthedocs.io/en/latest/040_FAQ.html

The variable needs to be defined before launching Jupyter Notebook. Typically, it is definef by a script in /etc/profile.d/ that is sourced when a user starts a shell.

zainul1114 commented 3 years ago

Hi , I have tried to setup the Lua and Lmod for Jupyterlmod Lua Version: Lua 5.1.4.9-rtm Lmod Version: Lmod-8.4 Python Version: 3.6.9

I have installed jupyterlmod and configured it with Jupyterhub. When I tried to launch jupyterhub, I got the blow issue.

Juppyterhub log:

[I 2021-02-23 12:13:13.107 LabApp] JupyterLab extension loaded from /data/apps/pkgs/ai/py36/3_6_9/lib/python3.6/site-packages/jupyterlab[I 2021-02-23 12:13:13.107 LabApp] JupyterLab application directory is /data/apps/pkgs/ai/py36/3_6_9/share/jupyter/lab[W 2021-02-23 12:13:13.127 SingleUserNotebookApp notebookapp:1996] Error loading server extension jupyterlmod Traceback (most recent call last): File "/data/apps/pkgs/ai/py36/3_6_9/lib/python3.6/site-packages/notebook/notebookapp.py", line 1988, in init_server_extensions mod = importlib.import_module(modulename) File "/data/apps/pkgs/ai/py36/3_6_9/lib/python3.6/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 955, in _find_and_load_unlocked File "", line 665, in _load_unlocked File "", line 678, in exec_module File "", line 219, in _call_with_frames_removed File "/data/apps/pkgs/ai/py36/3_6_9/lib/python3.6/site-packages/jupyterlmod/init.py", line 3, in from . import handler File "/data/apps/pkgs/ai/py36/3_6_9/lib/python3.6/site-packages/jupyterlmod/handler.py", line 4, in import lmod File "/data/apps/pkgs/ai/py36/3_6_9/lib/python3.6/site-packages/lmod/init.py", line 11, in LMOD_CMD = os.environ["LMOD_CMD"] File "/data/apps/pkgs/ai/py36/3_6_9/lib/python3.6/os.py", line 669, in getitem raise KeyError(key) from None KeyError: 'LMOD_CMD'[I 2021-02-23 12:13:13.185 SingleUserNotebookApp mixins:557] Starting jupyterhub-singleuser server version 1.3.0[I 2021-02-23 12:13:13.192 JupyterHub log:181] 200 GET /hub/api (@127.0.0.1 http://127.0.0.1) 1.39ms [image: image.png]

However, i am able to fetch module avail from the command line,

[root@jupyterlmod luarocks]# jupyter serverextension list config dir: /data/apps/pkgs/ai/py36/3_6_9/etc/jupyter jupyterlab enabled

Other labextensions (built into JupyterLab) app dir: /data/apps/pkgs/ai/py36/3_6_9/share/jupyter/lab jupyterlab-lmod v0.8.1 enabled OK

[root@jupyterlmod luarocks]# type module module is a function module () { eval $($LMOD_CMD bash "$@") && eval $(${LMOD_SETTARG_CMD:-:} -s sh) } [root@jupyterlmod luarocks]# echo $LMOD_CMD /usr/local/lmod/lmod/libexec/lmod [root@jupyterlmod luarocks]# echo $MODULEPATH /usr/local/modulefiles/Linux:/usr/local/modulefiles/Core:/usr/local/lmod/lmod/modulefiles/Core [root@jupyterlmod luarocks]# source $MODULESHOME/init/bash; module avail


/usr/local/lmod/lmod/modulefiles/Core

lmod settarg use.own

Use "module spider" to find all possible modules and extensions. Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys".

[root@jupyterlmod luarocks]# lua -v Lua 5.1.4.9-rtm Copyright (C) 1994-2008 Lua.org, PUC-Rio [root@jupyterlmod luarocks]# ls /usr/local/lua/ bin/ include/ lib/ man/ share/ [root@jupyterlmod luarocks]# ls /usr/local/lmod/lmod/ init/ lib/ libexec/ messageDir/ modulefiles/ settarg/ share/ shells/ tools/ [root@jupyterlmod luarocks]#

I am not able to load modules from Jupyterlmod. Please help me to resolve this issue.

Regards, Zain

On Sun, Feb 7, 2021 at 7:36 PM Félix-Antoine Fortin < notifications@github.com> wrote:

As indicated in the stack trace, the environment variable LMOD_CMD is not defined.

Refer to LMOD FAQ for more info on the variable: https://lmod.readthedocs.io/en/latest/040_FAQ.html

The variable needs to be defined before launching Jupyter Notebook. Typically, it is definef by a script in /etc/profile.d/ that is sourced when a user starts a shell.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cmd-ntrf/jupyter-lmod/issues/34#issuecomment-774679864, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHSJWETAVQ4M3VSFTENAHLTS52M5TANCNFSM4VCNPZHQ .

cmd-ntrf commented 3 years ago

What is the JupyterHub spawner you are using? LocalSpawner? SudoSpawner? BatchSpawner?

zainul1114 commented 3 years ago

Hi,

I think I am using the local spawner. Actually i am using below configuration on my jupyterhub_config.py

PAM

c.PAMAuthenticator.open_sessions = False

ssl

c.JupyterHub.ssl_cert = '/etc/jupyterhub/jhubssl.crt' c.JupyterHub.ssl_key = '/etc/jupyterhub/jhubssl.key'

Allow root

c.Spawner.args = ['--allow-root']

Create a whitelist of users

c.Authenticator.whitelist = {'zain'} c.Authenticator.admin_users = {'zain'} c.PAMAuthenticator.admin_groups = {'wheel'}

Use LocalAuthenticator to create system users

c.LocalAuthenticator.create_system_users = True

c.Authenticator.delete_invalid_users = True

Jlab on Jhub

c.Spawner.default_url = '/lab'

How to check which spawner is using on jupyterhub.

Regards, Zain

On Tue, Feb 23, 2021 at 8:10 PM Félix-Antoine Fortin < notifications@github.com> wrote:

What is the JupyterHub spawner you are using? LocalSpawner? SudoSpawner? BatchSpawner?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cmd-ntrf/jupyter-lmod/issues/34#issuecomment-784248958, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHSJWERHUARIHMRWCFA2I7TTAO45JANCNFSM4VCNPZHQ .

-- Regards

Zain

cmd-ntrf commented 3 years ago

Ok, I think I found what is your problem.

Jupyter Notebook spawned by JupterHub do not inherit the environment variables set for the JupyterHub process to avoid leaking variables that would contain secrets like the API token.

It is possible to tell the spawner that some variables can be safely inherited by the notebook using the variable c.Spawner.env_keep in the JupyterHub config file.

Add this to your configuration file and restart JupyterHub:

c.Spawner.env_keep = ['LMOD_CMD']
zainul1114 commented 3 years ago

Hi, i have added c.Spawner.env_keep = ['LMOD_CMD'] this to my jupyterhub_config.py and i restartd jupyterhub then i am getting below error

[I 2021-02-23 21:29:03.384 JupyterHub spawner:1417] Spawning jupyterhub-singleuser --port=49976 --NotebookApp.default_url=/lab --allow-root [E 2021-02-23 21:29:03.418 JupyterHub user:640] Unhandled error starting zain's server: [Errno 2] No such file or directory: 'jupyterhub-singleuser': 'jupyterhub-singleuser' [W 2021-02-23 21:29:03.474 JupyterHub web:1787] 500 GET /hub/spawn/zain?next=%2Fhub%2Fuser%2Fzain%2F (192.168.43.8): Error in Authenticator.pre_spawn_start: FileNotFoundError [Errno 2] No such file or directory: 'jupyterhub-singleuser': 'jupyterhub-singleuser' [E 2021-02-23 21:29:03.525 JupyterHub log:166] { "X-Forwarded-Host": "192.168.43.42:8090", "X-Forwarded-Proto": "https", "X-Forwarded-Port": "8090", "X-Forwarded-For": "192.168.43.8", "Cookie": "jupyterhub-hub-login=[secret]; username-192-168-43-42-8888=[secret]; _xsrf=[secret]; jupyterhub-session-id=[secret]", "Accept-Language": "en-US,en;q=0.9", "Accept-Encoding": "gzip, deflate, br", "Referer": "https://192.168.43.42:8090/hub/user/zain/", "Sec-Fetch-Dest": "document", "Sec-Fetch-User": "?1", "Sec-Fetch-Mode": "navigate", "Sec-Fetch-Site": "same-origin", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9", "User-Agent": "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36", "Upgrade-Insecure-Requests": "1", "Sec-Ch-Ua-Mobile": "?0", "Sec-Ch-Ua": "\"Chromium\";v=\"88\", \"Google Chrome\";v=\"88\", \";Not A Brand\";v=\"99\"", "Connection": "close", "Host": "192.168.43.42:8090" } [E 2021-02-23 21:29:03.527 JupyterHub log:174] 500 GET /hub/spawn/zain?next=%2Fhub%2Fuser%2Fzain%2F (zain@192.168.43.8) 285.73ms

[image: image.png] Please help me to resolve this? Regards, Zain

On Tue, Feb 23, 2021 at 8:57 PM Félix-Antoine Fortin < notifications@github.com> wrote:

Ok, I think I found what is your problem.

Jupyter Notebook spawned by JupterHub do not inherit the environment variables set for the JupyterHub process to avoid leaking variables that would contain secrets like the API token.

It is possible to tell the spawner that some variables can be safely inherited by the notebook using the variable c.Spawner.env_keep in the JupyterHub config file.

Add this to your configuration file and restart JupyterHub:

c.Spawner.env_keep = ['LMOD_CMD']

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cmd-ntrf/jupyter-lmod/issues/34#issuecomment-784282746, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHSJWEXZ77QP3A3YEPLXYWTTAPCPLANCNFSM4VCNPZHQ .

-- Regards

Zain

cmd-ntrf commented 3 years ago

Ah right, because there are default values in the LocalSpawner that did not follow.

Add this instead :

c.Spawner.env_keep =  [
'PATH',
'PYTHONPATH',
'CONDA_ROOT',
'CONDA_DEFAULT_ENV',
'VIRTUAL_ENV',
'LANG',
'LC_ALL',
'JUPYTERHUB_SINGLEUSER_APP',
'LMOD_CMD',
]
zainul1114 commented 3 years ago

Hi, Now i have added c.Spawner.env_keep.append = ['LMOD_CMD'] to my config file. Even though i am getting the same error message as earlier.

[W 2021-02-23 21:44:23.476 SingleUserNotebookApp notebookapp:1678] Error loading server extension jupyterlmod Traceback (most recent call last): File "/usr/local/py36/3_6_9/lib/python3.6/site-packages/notebook/notebookapp.py", line 1670, in init_server_extensions mod = importlib.import_module(modulename) File "/usr/local/py36/3_6_9/lib/python3.6/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 955, in _find_and_load_unlocked File "", line 665, in _load_unlocked File "", line 678, in exec_module File "", line 219, in _call_with_frames_removed File "/usr/local/py36/3_6_9/lib/python3.6/site-packages/jupyterlmod/init.py", line 3, in from . import handler File "/usr/local/py36/3_6_9/lib/python3.6/site-packages/jupyterlmod/handler.py", line 4, in import lmod File "/usr/local/py36/3_6_9/lib/python3.6/site-packages/lmod/init.py", line 11, in LMOD_CMD = os.environ["LMOD_CMD"] File "/usr/local/py36/3_6_9/lib/python3.6/os.py", line 669, in getitem raise KeyError(key) from None KeyError: 'LMOD_CMD'[I 2021-02-23 21:44:23.529 SingleUserNotebookApp singleuser:561] Starting jupyterhub-singleuser server version 1.1.0

But I am able to login to the jupyterhub.

On Tue, Feb 23, 2021 at 9:40 PM Zainul Abiddin zainul1114@gmail.com wrote:

Hi, i have added c.Spawner.env_keep = ['LMOD_CMD'] this to my jupyterhub_config.py and i restartd jupyterhub then i am getting below error

[I 2021-02-23 21:29:03.384 JupyterHub spawner:1417] Spawning jupyterhub-singleuser --port=49976 --NotebookApp.default_url=/lab --allow-root [E 2021-02-23 21:29:03.418 JupyterHub user:640] Unhandled error starting zain's server: [Errno 2] No such file or directory: 'jupyterhub-singleuser': 'jupyterhub-singleuser' [W 2021-02-23 21:29:03.474 JupyterHub web:1787] 500 GET /hub/spawn/zain?next=%2Fhub%2Fuser%2Fzain%2F (192.168.43.8): Error in Authenticator.pre_spawn_start: FileNotFoundError [Errno 2] No such file or directory: 'jupyterhub-singleuser': 'jupyterhub-singleuser' [E 2021-02-23 21:29:03.525 JupyterHub log:166] { "X-Forwarded-Host": "192.168.43.42:8090", "X-Forwarded-Proto": "https", "X-Forwarded-Port": "8090", "X-Forwarded-For": "192.168.43.8", "Cookie": "jupyterhub-hub-login=[secret]; username-192-168-43-42-8888=[secret]; _xsrf=[secret]; jupyterhub-session-id=[secret]", "Accept-Language": "en-US,en;q=0.9", "Accept-Encoding": "gzip, deflate, br", "Referer": "https://192.168.43.42:8090/hub/user/zain/", "Sec-Fetch-Dest": "document", "Sec-Fetch-User": "?1", "Sec-Fetch-Mode": "navigate", "Sec-Fetch-Site": "same-origin", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9", "User-Agent": "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36", "Upgrade-Insecure-Requests": "1", "Sec-Ch-Ua-Mobile": "?0", "Sec-Ch-Ua": "\"Chromium\";v=\"88\", \"Google Chrome\";v=\"88\", \";Not A Brand\";v=\"99\"", "Connection": "close", "Host": "192.168.43.42:8090" } [E 2021-02-23 21:29:03.527 JupyterHub log:174] 500 GET /hub/spawn/zain?next=%2Fhub%2Fuser%2Fzain%2F (zain@192.168.43.8) 285.73ms

[image: image.png] Please help me to resolve this? Regards, Zain

On Tue, Feb 23, 2021 at 8:57 PM Félix-Antoine Fortin < notifications@github.com> wrote:

Ok, I think I found what is your problem.

Jupyter Notebook spawned by JupterHub do not inherit the environment variables set for the JupyterHub process to avoid leaking variables that would contain secrets like the API token.

It is possible to tell the spawner that some variables can be safely inherited by the notebook using the variable c.Spawner.env_keep in the JupyterHub config file.

Add this to your configuration file and restart JupyterHub:

c.Spawner.env_keep = ['LMOD_CMD']

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cmd-ntrf/jupyter-lmod/issues/34#issuecomment-784282746, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHSJWEXZ77QP3A3YEPLXYWTTAPCPLANCNFSM4VCNPZHQ .

-- Regards

Zain

-- Regards

Zain

cmd-ntrf commented 3 years ago

Hi, Now i have added c.Spawner.env_keep.append = ['LMOD_CMD'] to my config file.

This does not append the environment variable to the existing list, it creates a new attribute named "append". I am uncertain it is possible to add values to list traitlets. If it is, it would either be like this:

c.Spawner.env_keep.append('LMOD_CMD')

Or like this

c.Spawner.env_keep.extend(['LMOD_CMD'])
zainul1114 commented 3 years ago

Hi, I have added the below code c.Spawner.env_keep = [ 'PATH', 'PYTHONPATH', 'CONDA_ROOT', 'CONDA_DEFAULT_ENV', 'VIRTUAL_ENV', 'LANG', 'LC_ALL', 'JUPYTERHUB_SINGLEUSER_APP', 'LMOD_CMD', ]

and i am able to get log while running jupyterhub

[I 2021-02-23 21:53:09.040 SingleUserNotebookApp init:26] Loading lmod extension[I 2021-02-23 21:53:09.094 SingleUserNotebookApp singleuser:561] Starting jupyterhub-singleuser server version 1.1.0

However,i have run the below commands

[root@master ~]# source /usr/local/lmod/lmod/init/profile [root@master ~]# module avail

/usr/local/lmod/lmod/modulefiles/Core

lmod settarg

Use "module spider" to find all possible modules and extensions. Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys". [root@master ~]#

and i am not able to get the modules loaded on jupyterhub as [image: image.png]

On Tue, Feb 23, 2021 at 9:48 PM Félix-Antoine Fortin < notifications@github.com> wrote:

Ah right, because there are default values in the LocalSpawner that did not follow.

Add this instead :

c.Spawner.env_keep = ['PATH','PYTHONPATH','CONDA_ROOT','CONDA_DEFAULT_ENV','VIRTUAL_ENV','LANG','LC_ALL','JUPYTERHUB_SINGLEUSER_APP','LMOD_CMD', ]

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cmd-ntrf/jupyter-lmod/issues/34#issuecomment-784320595, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHSJWETSCIJMWH5G2JU5WY3TAPIL7ANCNFSM4VCNPZHQ .

-- Regards

Zain

cmd-ntrf commented 3 years ago

If no module shows up, it is probably because you are missing some more variables to keep, like MODULEPATH.

zainul1114 commented 3 years ago

Hi,

Anyhow i have tested this as you suggested initially,

[image: image.png]

Please let me know if it is the correct output we are trying to fetch..

On Tue, Feb 23, 2021 at 10:02 PM Zainul Abiddin zainul1114@gmail.com wrote:

Hi, I have added the below code c.Spawner.env_keep = [ 'PATH', 'PYTHONPATH', 'CONDA_ROOT', 'CONDA_DEFAULT_ENV', 'VIRTUAL_ENV', 'LANG', 'LC_ALL', 'JUPYTERHUB_SINGLEUSER_APP', 'LMOD_CMD', ]

and i am able to get log while running jupyterhub

[I 2021-02-23 21:53:09.040 SingleUserNotebookApp init:26] Loading lmod extension[I 2021-02-23 21:53:09.094 SingleUserNotebookApp singleuser:561] Starting jupyterhub-singleuser server version 1.1.0

However,i have run the below commands

[root@master ~]# source /usr/local/lmod/lmod/init/profile [root@master ~]# module avail

/usr/local/lmod/lmod/modulefiles/Core

lmod settarg

Use "module spider" to find all possible modules and extensions. Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys". [root@master ~]#

and i am not able to get the modules loaded on jupyterhub as [image: image.png]

On Tue, Feb 23, 2021 at 9:48 PM Félix-Antoine Fortin < notifications@github.com> wrote:

Ah right, because there are default values in the LocalSpawner that did not follow.

Add this instead :

c.Spawner.env_keep = ['PATH','PYTHONPATH','CONDA_ROOT','CONDA_DEFAULT_ENV','VIRTUAL_ENV','LANG','LC_ALL','JUPYTERHUB_SINGLEUSER_APP','LMOD_CMD', ]

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cmd-ntrf/jupyter-lmod/issues/34#issuecomment-784320595, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHSJWETSCIJMWH5G2JU5WY3TAPIL7ANCNFSM4VCNPZHQ .

-- Regards

Zain

-- Regards

Zain

cmd-ntrf commented 3 years ago

FYI, your screenshots are not getting through and appear as [image: image.png] text.

zainul1114 commented 3 years ago

Hi, I am getting the below output when i run i command line [root@master ~]# type module module is a function module () { eval $($LMOD_CMD bash "$@") && eval $(${LMOD_SETTARG_CMD:-:} -s sh) } [root@master ~]# echo $LMOD_CMD /usr/local/lmod/lmod/libexec/lmod [root@master ~]# echo $MODULEPATH /usr/local/modulefiles/Linux:/usr/local/modulefiles/Core:/usr/local/lmod/lmod/modulefiles/Core [root@master ~]#

[image: image.png]

On Tue, Feb 23, 2021 at 10:11 PM Félix-Antoine Fortin < notifications@github.com> wrote:

If no module shows up, it is probably because you are missing some more variables to keep, like MODULEPATH.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cmd-ntrf/jupyter-lmod/issues/34#issuecomment-784337470, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHSJWEXYQTWT7JCCC5JDZ7TTAPLC7ANCNFSM4VCNPZHQ .

-- Regards

Zain

zainul1114 commented 3 years ago

Hi,

I am trying to share the output which you initially advised, and i am getting %autoawait IPython autoawait is on, and set to use asyncio

import lmodawait lmod.avail() []

!module avail /bin/bash: module: command not found

On Tue, Feb 23, 2021 at 10:14 PM Félix-Antoine Fortin < notifications@github.com> wrote:

FYI, your screenshots are not getting through and appear as [image: image.png] text.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cmd-ntrf/jupyter-lmod/issues/34#issuecomment-784339390, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHSJWERFIN4CCIIATR3VPPTTAPLNFANCNFSM4VCNPZHQ .

-- Regards

Zain

cmd-ntrf commented 3 years ago

Have you tried adding MODULEPATH to the env_keep list?

The module command will not work directly in a notebook because the function definition is not kept.

zainul1114 commented 3 years ago

Hi,

Now i have added MODULEPATH to env_keep list I am able to view modules lmod and settarg on the left side of the panel, However, still am getting !module avail output as /bin/bash: module: command not found .

%autoawait IPython autoawait is on, and set to use asyncio

import lmodawait lmod.avail() ['lmod', 'settarg\n']

!module avail /bin/bash: module: command not found

Please find the attached screenshot. [image: image.png]

On Tue, Feb 23, 2021 at 10:24 PM Félix-Antoine Fortin < notifications@github.com> wrote:

Have you tried adding MODULEPATH to the env_keep list?

The module command will not work directly in a notebook because the function definition is not kept.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cmd-ntrf/jupyter-lmod/issues/34#issuecomment-784346657, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHSJWETQHFH4QZQ25PCRKELTAPMT3ANCNFSM4VCNPZHQ .

-- Regards

Zain

zainul1114 commented 3 years ago

Hi,

Thanks for your great help.. without YOU it would not have been possible.

And help me to get the !module avail output also properly from jupyterhub.

On Tue, Feb 23, 2021 at 10:37 PM Zainul Abiddin zainul1114@gmail.com wrote:

Hi,

Now i have added MODULEPATH to env_keep list I am able to view modules lmod and settarg on the left side of the panel, However, still am getting !module avail output as /bin/bash: module: command not found .

%autoawait IPython autoawait is on, and set to use asyncio

import lmodawait lmod.avail() ['lmod', 'settarg\n']

!module avail /bin/bash: module: command not found

Please find the attached screenshot. [image: image.png]

On Tue, Feb 23, 2021 at 10:24 PM Félix-Antoine Fortin < notifications@github.com> wrote:

Have you tried adding MODULEPATH to the env_keep list?

The module command will not work directly in a notebook because the function definition is not kept.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cmd-ntrf/jupyter-lmod/issues/34#issuecomment-784346657, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHSJWETQHFH4QZQ25PCRKELTAPMT3ANCNFSM4VCNPZHQ .

-- Regards

Zain

-- Regards

Zain

cmd-ntrf commented 3 years ago

The module command inside a Jupyter Notebook have no use. This is why jupyter-lmod exists, to load the modules at the right level in the jupyter notebook process hierarchy such as the kernel can inherit the notebook environment variable.

Doing ! module load won't do anything useful.

zainul1114 commented 3 years ago

Thank you for the clarification.

On Tue, 23 Feb, 2021, 11:08 pm Félix-Antoine Fortin, < notifications@github.com> wrote:

The module command inside a Jupyter Notebook have no use. This is why jupyter-lmod exists, to load the modules at the right level in the jupyter notebook process hierarchy such as the kernel can inherit the notebook environment variable.

Doing ! module load won't do anything useful.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cmd-ntrf/jupyter-lmod/issues/34#issuecomment-784377174, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHSJWEU6XCU6YAZZT5OKMCLTAPRZDANCNFSM4VCNPZHQ .

zainul1114 commented 3 years ago

Hi, How could we remove created collections on jupyter-lmod.

On Tue, Feb 23, 2021 at 11:42 PM Zainul Abiddin zainul1114@gmail.com wrote:

Thank you for the clarification.

On Tue, 23 Feb, 2021, 11:08 pm Félix-Antoine Fortin, < notifications@github.com> wrote:

The module command inside a Jupyter Notebook have no use. This is why jupyter-lmod exists, to load the modules at the right level in the jupyter notebook process hierarchy such as the kernel can inherit the notebook environment variable.

Doing ! module load won't do anything useful.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cmd-ntrf/jupyter-lmod/issues/34#issuecomment-784377174, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHSJWEU6XCU6YAZZT5OKMCLTAPRZDANCNFSM4VCNPZHQ .

-- Regards

Zain

cmd-ntrf commented 3 years ago

It is not currently possible.

You can create a new issue asking for the feature to be implemented.