Jupyter-lmod: an extension to interact with Lmod Environment Modules

218 views
Skip to first unread message

Félix-Antoine Fortin

unread,
Apr 7, 2017, 3:29:03 PM4/7/17
to Project Jupyter
Hi all,

I have recently released an extension that allows to interact 
with Lmod environment modules directly in Jupyter's interface.
The extension is named jupyterlmod:

For those who do not know about environment modules, from 
Wikipedia [1]: 
> Environment Modules system is a tool to help users manage 
> their Unix or Linux shell environment, by allowing groups of 
> related environment-variable settings to be made or removed 
> dynamically.

Lmod is a Lua based module system that also provides a Python
interface to interact with the modules. [2]

On a system with environment modules, a user who wishes
to use a specific set of modules would first have to load them
before launching the Jupyter notebook process. jupyter-lmod
removes that necessity by allowing the user to manage its 
environment modules directly inside Jupyter's interface.

The extension adds a tab (Softwares) to Jupyter tree interface. 
In this tab, it is possible to search for available modules and 
load them. The interface also allows modules viewing and unloading. 
Module collections are supported through the save and restore 
buttons.

The interface works by modifying the os.environ content of the
Jupyter notebook process which spawned kernels inherits. The 
instructions to modify os.environ are provided by Lmod Python
interface. Actions taken on the modules only affect kernels 
that are spawned afterward or restarted.

The main target for this extension are Jupyterhub hosted on 
HPC servers. At least, that's why I built it for our site.

The package is available on PyPI and the source code is on
Github. If you have any questions or comments, I'm all ears.

Finally, a quick preview:






















--

Thomas Kluyver

unread,
Apr 11, 2017, 6:18:19 AM4/11/17
to Project Jupyter
Thanks Félix-Antoine,

There's a long-running discussion on how to capture environment metadata in notebooks - I've mentioned your project there so that we think about environment modules for that discussion as well.
https://github.com/jupyter/nbformat/pull/60

Thomas

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/239dd2ac-3cfc-41c8-b18f-cbdc6586ae0a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Fernando Perez

unread,
Apr 21, 2017, 6:39:51 PM4/21/17
to Project Jupyter

On Fri, Apr 7, 2017 at 12:29 PM, Félix-Antoine Fortin <felix-anto...@calculquebec.ca> wrote:
I have recently released an extension that allows to interact 
with Lmod environment modules directly in Jupyter's interface.
The extension is named jupyterlmod:

Cool, thanks for sharing this, and glad Thomas already put it in context.  Will forward this info to some of our local HPC folks where these kinds of problems are common.

Cheers

f


--
Fernando Perez (@fperez_org; http://fperez.org)
fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
fernando.perez-at-berkeley: contact me here for any direct mail
Reply all
Reply to author
Forward
0 new messages