This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
playground:playground [2021/02/23 16:27] msovara [Security] |
playground:playground [2025/04/29 16:06] (current) nmfuphi [Starting a notebook inside a job] |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== **Playground Test edits by MSovara** ====== | + | ====== **Edits by MSovara** ====== |
| ===== Jupyter / Ipython Notebook ===== | ===== Jupyter / Ipython Notebook ===== | ||
| Line 58: | Line 58: | ||
| </ | </ | ||
| - | Use the following command to access the .py file $ cd / | + | Use the following command to access the " |
| - | Now edit the '' | + | Now edit the '' |
| Line 65: | Line 65: | ||
| c.NotebookApp.password = ' | c.NotebookApp.password = ' | ||
| </ | </ | ||
| + | |||
| + | **Remember to uncomment it, don't just copy and paste my hash in**. | ||
| + | |||
| + | ==== Starting a notebook inside a job ==== | ||
| + | |||
| + | There might be a cleaner way of doing this... Please let us know if you have one! | ||
| + | |||
| + | **VERY IMPORTANT: | ||
| + | |||
| + | Open a terminal on your local machine and create a '' | ||
| + | |||
| + | < | ||
| + | touch .ssh/config | ||
| + | </ | ||
| + | |||
| + | If your desktop system runs Windows, a simple way to deal with this is to run a unix-like environment inside Windows. | ||
| + | |||
| + | |||
| + | Continue to edit the '' | ||
| + | < | ||
| + | Host cnode* | ||
| + | Hostname %h | ||
| + | User YOURUSERNAME | ||
| + | ProxyCommand ssh YOURUSERNAME@lengau.chpc.ac.za nc %h 22 | ||
| + | LocalForward 8838 localhost: | ||
| + | </ | ||
| + | |||
| + | |||
| + | **Note** | ||
| + | -//Each session will be assigned a different compute node (cnode* changes everytime you request for an interactive compute node session)// | ||
| + | -//Use localForward and localhost port number provided for each different session.// | ||
| + | |||
| + | Ultimately, what this will do is allow you to '' | ||
| + | |||
| + | < | ||
| + | ssh cnode* | ||
| + | </ | ||
| + | |||
| + | You should be prompted for your password, twice. This is because the '' | ||
| + | |||
| + | You are now ready to roll... | ||
| + | |||
| + | In your browser go to: http:// | ||
| + | |||
| + | The jobscript will look something like: | ||
| + | <file bash jupyter.qsub> | ||
| + | #!/bin/bash | ||
| + | #PBS -P SHORTNAME | ||
| + | #PBS -q serial | ||
| + | #PBS -l select=1: | ||
| + | #PBS -l walltime=08: | ||
| + | #PBS -N Jupyter | ||
| + | #PBS -m abe | ||
| + | #PBS -M YOUR@EMAIL.ADDRESS | ||
| + | |||
| + | module add chpc/ | ||
| + | |||
| + | JUPYTERPORT=8838 | ||
| + | |||
| + | hostname > ~/ | ||
| + | |||
| + | jupyter-notebook --port=${JUPYTERPORT} --no-browser | ||
| + | </ | ||
| + | |||
| + | If you submit that job and wait for it to start running then you can check which host the session is running on with: | ||
| + | <code bash> | ||
| + | cat ~/ | ||
| + | </ | ||
| + | |||
| + | Then, again on your local machine, you need to connect to the compute node, i.e. '' | ||
| + | |||
| + | |||
| + | |||
| + | |||