This is an old revision of the document!
Jupyter Notebooks on Mogon / Himster
Try out the following if you want to run Jupyter on our cluster but run the browser locally.
Jupyter on head node with plain python
Setup
- ssh mogon2
- [pbotte@login23 ~]$ python3 -m venv testjupyter
- [pbotte@login23 ~]$ source testjupyter/bin/activate
- [pbotte@login23 ~]$ pip3 install jupyter
- Change config:
- [pbotte@login23 ~]$ jupyter notebook –generate-config
- change in ~/.jupyter/jupyter_notebook_config.py:
- c.NotebookApp.allow_remote_access = True
- c.NotebookApp.ip = '*'
- c.NotebookApp.open_browser = False
- double check that these lines are not commented out!
Usage
- ssh -L 12345:localhost:8888 himster2
- [pbotte@login23 ~]$ source testjupyter/bin/activate
- (testjupyter) [pbotte@login23 ~]$ jupyter notebook
- Open locally: http://localhost:12345
- Enter the code presented in terminal
Caution:
- others might already use port 8888.
- If port already in use, change config file and the port forward in SSH.
Jupyter on compute node with plain python
Usage
setup as shown above in section “Jupyter on head node with plain python”
- ssh himster2
- [pbotte@login23 ~]$ salloc -p himster2_exp -N 2 –time=01:00:00 -A m2_him_exp #change the account accordingly
- [pbotte@login23 ~]$ ssh x0784 #log into the computer node you got assigned
- [pbotte@x0784 ~]$ source testjupyter/bin/activate
- (testjupyter) [pbotte@x0784 ~]$ jupyter notebook
- ssh -L 12346:x0784.mogon:8888 himster2
- Open locally: http://localhost:12346
- Enter the code presented in terminal