A JupyterLab extension to interface with the Slurm workload manager.
- JupyterLab
- NodeJS
- JupyterLab
- NodeJS
- Slurm
Note that if you are using JupyterLabHub, currently (v0.1.0) the locations of the:
- hub server
- single-user JupyterLab servers
- Slurm installation
all have to be the same as each other for this extension to work. We are looking for a fix for this. Suggestions are welcome.
To install the notebook server extension, do the following in the repository directory:
pip install .
jupyter serverextension enable --py jupyterlab-slurm --sys-prefix
Ostensibly it should be sufficient to do the following to uninstall the server extension:
jupyter serverextension disable jupyterlab-slurm
pip uninstall jupyterlab-slurm
However, it has seemed necessary at times to uninstall and then reinstall Jupyter altogether (with conda conda uninstall jupyter_core
), since serverextension disable
does not seem to delete or remove the extension. Thus, even after sourcing a newer version of the server extension, doing serverextension enable
would just re-enable the old version (rather than installing the newer version). (Plus having the output of jupyter serverextension list
cluttered by no longer existing extensions is unpleasant.)
A less permanent way to enable the notebook extension during development would be to add the following flag when starting JupyterLab:
--NotebookApp.nbserver_extensions="{'jupyterlab-slurm':True}"
To install the "JupyterLab extension" (i.e. the TypeScript/Javascript part), do the following in the repository directory (requires NodeJS v. 4.0 or higher):
npm install
npm run build
jupyter labextension install .
To reload after updating or changing the Javascript part of the extension, it is necessary to do the following:
npm run build
jupyter lab build
(This assumes you haven't added any npm dependencies to package.json
; if you have, then it is necessary to run npm install
before npm run build
.)
To uninstall the Javascript part of the extension entirely, it suffices to do
jupyter labextension uninstall jupyterlab-slurm