==== Using DKRZ's Jupyterhub ==== Jupyterhub is a multi-user server to serve Jupyter Notebooks to a large number of users. It is integrated with Mistral's batch scheduling system to allocate computing resources and launch Jupyter Notebooks directly on the HPC system. It therefore also supports the execution of parallel computation. * To access it you only need to go to it's login page [[https://jupyterhub.dkrz.de/hub/login]] and enter DKRZ's username and password. * Once there we have two Spawner options to start a session within **Levante**: //preset// and //advanced//. * If we choose the **//preset//** the info that we will fill is the following one: * job profile: //5 GB Interactive 12hr (e.g.)// * account: //bm1159// * Reservation: //empty// * Quality of Service (QoS): //empty// The //preset// spawner loads the //classical// notebook mode. To switch it to the //jupyterlab// mode we simply need to go the URL and add ''/lab'' before ''/tree'': classical notebook: https://jupyterhub.dkrz.de/user/k204229/preset/tree/home/dkrz/k204229? jupyterlab: https://jupyterhub.dkrz.de/user/k204229/preset/lab/tree/home/dkrz/k204229? \\ {{ :climxtreme:jupyter-preset.gif?nolink |}} \\ * The **//advanced//** session is especially for advanced users with a certain knowledge of Mistral and Slurm configuration (thorough info about all the advanced options can be found [[https://docs.dkrz.de/doc/software&services/jupyterhub/spawner_options.html#advanced|here]]). Among many other options it offers us the possibility to choose between //Jupyter notebook, Jupyterlab// and //Terminal// session. The essential parameters that we will need to fill up to open a session with similar characteristics as the //preset// but using //Jupyerlab// are the following ones: * account: //bmx825// * partition: //Miklip// * reservation: ClimXtreme (**NOTE: only at the day of the workshop**, 2021.04.15, otherwise //None//) * time: //12.00// * memory: //5120// MB * Quality of Service (QoS): //empty// * user interface: //JupyterLab// {{ :climxtreme:adv_session.png?nolink |}} \\ Once the session is open, we can navigate through our folder structure via web or also via virtual terminal. It allows us to choose among multiple python preset kernels, one R kernel and one Julia kernel as well, but we also have the choice to load [[https://docs.dkrz.de/doc/software&services/jupyterhub/kernels.html#use-your-own-kernel|our own environment]]. Naturally we can open and run our jupyter notebook files here. We can use Jupyterhub as a simple text editor as well, but we could also connect some local IDE (e.g. VS Code) [[https://docs.dkrz.de/blog/2020/vscoderemote.html|remotely with some kernel in DKRZ]]. ===== Important Notes ===== There are a few points you should be aware of when working with Jupyter Notebooks on the jupyterhub server: - **Sessions are persistent**. If you close the browser tab without stopping the server before, you can revisit the jupyterhub site and carry on working. \\ \\ - **Closing browser’s tab or log-in out will not stop your session**, __**your session will continue consuming resources**__ (see next point). \\ \\ - **It is preferable to close the session when you finish**. This depends on how you started the session (preset, advanced):\\ \\ * JupyterLab: File -> __**Hub Control Panel**__ -> (preset/advanced) and then stop. \\ \\ * classical Jupyter: **__Control Panel__** -> (preset/advanced) and then stop \\ \\ {{ :climxtreme:closing-session.png?nolink&600 |}}