diff --git a/doc.zih.tu-dresden.de/docs/access/jupyterhub.md b/doc.zih.tu-dresden.de/docs/access/jupyterhub.md index b5f5df5ebac439f705fd2d639f70022ee25c78ab..639960a5676b464dadbad5475323f358c4c790cc 100644 --- a/doc.zih.tu-dresden.de/docs/access/jupyterhub.md +++ b/doc.zih.tu-dresden.de/docs/access/jupyterhub.md @@ -1,7 +1,7 @@ # JupyterHub With our JupyterHub service we offer you a quick and easy way to -work with jupyter notebooks on Taurus. +work with Jupyter notebooks on ZIH systems. Subpages: @@ -10,15 +10,15 @@ Subpages: ## Disclaimer -This service is provided "as-is", use at your own discretion. Please -understand that JupyterHub is a complex software system of which we are +This service is provided "as-is", use at your own discretion. +Please understand that JupyterHub is a complex software system of which we are not the developers and don't have any downstream support contracts for, -so we merely offer an installation of it but cannot give extensive -support in every case. +so we merely offer an installation of it but cannot give extensive support +in every case. ## Access -!!! note +!!! note This service is only available for users with an active HPC project. See [here](../access/overview.md) how to apply for an HPC project. @@ -26,7 +26,7 @@ JupyterHub is available here: [https://taurus.hrsk.tu-dresden.de/jupyter](https: ## Start a Session -Start a new session by clicking on the +Start a new session by clicking on the  button. @@ -55,13 +55,13 @@ saved in your browser and are lost if you delete your browsing data. Use the import/export feature (available through the button) to save your presets in text files. -!!! info +!!! info The [alpha](https://doc.zih.tu-dresden.de/hpc-wiki/bin/view/Compendium/AlphaCentauri) partition is available only in the extended form. ## Applications -You can choose between JupyterLab or the classic notebook app. +You can choose between JupyterLab or classic Jupyter notebooks. ### JupyterLab @@ -79,7 +79,7 @@ several views: - details about selected notebook cell - list of open tabs -### Classic Notebook +### Classic Jupyter Notebook  {: align="center"} @@ -90,10 +90,10 @@ several views: Initially you will get a list of your home directory. You can open existing notebooks or files by clicking on them. -Above the table on the right side is the "New â·" button which lets you +Above the table on the right side is the button `New` which lets you create new notebooks, files, directories or terminals. -## The Notebook +## Jupyter Notebooks in General In JupyterHub you can create scripts in notebooks. Notebooks are programs which are split in multiple logical code blocks. @@ -119,7 +119,7 @@ tab instead.  {: align="center"} -**Classic notebook**: Click on the control panel button on the top right +**Classic Jupyter notebook**: Click on the control panel button on the top right of your screen.  @@ -131,35 +131,32 @@ Now you are back on the JupyterHub page and you can stop your server by clicking ## Error handling -We want to explain some errors that you might face sooner or later. If -you need help open a ticket at HPC support. +We want to explain some errors that you might face sooner or later. +If you need help open a ticket at [HPC support](mailto:hpcsupport@zih.tu-dresden.de). ### Error while starting a session  {: align="center"} -This message often appears instantly if your Slurm parameters are not -valid. Please check those settings against the available hardware. +This message often appears instantly if your Slurm parameters are not valid. +Please check those settings against the available hardware. Useful pages for valid Slurm parameters: -- [Slurm batch system (Taurus)] **TODO LINK** (../jobs_and_resources/SystemTaurus#Batch_System) +- [Slurm batch system (Taurus)](../jobs_and_resources/system_taurus.md#batch-system) - [General information how to use Slurm](../jobs_and_resources/slurm.md) ### Error message in JupyterLab -**TODO ADD IMAGE** \<a href="%ATTACHURL%/jupyterlab_error_directory_not_found.png">\<img -alt="" width="400" -src="<https://doc.zih.tu-dresden.de/hpc-wiki/pub/Compendium/JupyterHub/jupyterlab_error_directory_not_found.png>" -style="border: 1px solid #888;" title="Error message: Directory not -found"/>\</a> + +{: align="center"} If the connection to your notebook server unexpectedly breaks you maybe will get this error message. Sometimes your notebook server might hit a Slurm or hardware limit and gets killed. Then usually the logfile of the corresponding Slurm job might contain useful information. These logfiles are located in your -home directory and have the name "jupyter-session-\<jobid>.log". +home directory and have the name `jupyter-session-<jobid>.log`. ------------------------------------------------------------------------ @@ -172,10 +169,8 @@ Machine Learning Community Edition (formerly PowerAI)](https://developer.ibm.com/linuxonpower/deep-learning-powerai/) package suite. You can open a list with all included packages of the exact standard environment through the spawner form: - -**TODO ADD IMAGE** \<img alt="environment_package_list.png" -src="%ATTACHURL%/environment_package_list.png" style="border: 1px solid -\#888;" title="JupyterHub environment package list" /> + +{: align="center"} This list shows all packages of the currently selected conda environment. This depends on your settings for partition (cpu @@ -183,11 +178,11 @@ architecture) and standard environment. There are three standard environments: -- production, -- test, -- python-env-python3.8.6. +- production +- test +- python-env-python3.8.6 -**Python-env-python3.8.6**virtual environment can be used for all x86 +**Python-env-python3.8.6** virtual environment can be used for all x86 partitions(gpu2, alpha, etc). It gives the opportunity to create a user kernel with the help of a python environment. @@ -216,142 +211,111 @@ called kernels. Creating and using your own kernel has the benefit that you can install your own preferred python packages and use them in your notebooks. -We currently have two different architectures at Taurus. Build your -kernel environment on the **same architecture** that you want to use +We currently have two different architectures at ZIH systems. +Build your kernel environment on the **same architecture** that you want to use later on with the kernel. In the examples below we use the name "my-kernel" for our user kernel. We recommend to prefix your kernels -with keywords like "intel", "ibm", "ml", "venv", "conda". This way you -can later recognize easier how you built the kernel and on which -hardware it will work. +with keywords like `haswell`, `ml`, `romeo`, `venv`, `conda`. This way you +can later recognize easier how you built the kernel and on which hardware it will work. **Intel nodes** (e.g. haswell, gpu2): - srun --pty -n 1 -c 2 --mem-per-cpu 2583 -t 08:00:00 bash -l - -If you don't need Sandy Bridge support for your kernel you can create -your kernel on partition 'haswell'. +```console +maria@login$ srun --pty --ntasks=1 --cpus-per-task=2 --mem-per-cpu=2541 --time=08:00:00 bash -l +``` **Power nodes** (ml partition): - srun --pty -p ml -n 1 -c 2 --mem-per-cpu 5772 -t 08:00:00 bash -l +```console +maria@login$ srun --pty --partition=ml --ntasks=1 --cpus-per-task=2 --mem-per-cpu=1443 --time=08:00:00 bash -l +```` Create a virtual environment in your home directory. You can decide between python virtualenvs or conda environments. -<span class="twiki-macro RED"></span> **Note** <span -class="twiki-macro ENDCOLOR"></span>: Please take in mind that Python -venv is the preferred way to create a Python virtual environment. +!!! note + Please take in mind that Python venv is the preferred way to create a Python virtual environment. #### Python virtualenv -```bash -$ module load Python/3.8.6-GCCcore-10.2.0 - -$ mkdir user-kernel #please use Workspaces! - -$ cd user-kernel - -$ virtualenv --system-site-packages my-kernel +```console +marie@compute$ module load Python/3.8.6-GCCcore-10.2.0 +marie@compute$ mkdir user-kernel # please use workspaces! +marie@compute$ cd user-kernel +marie@compute$ virtualenv --system-site-packages my-kernel Using base prefix '/sw/installed/Python/3.6.6-fosscuda-2018b' New python executable in .../user-kernel/my-kernel/bin/python Installing setuptools, pip, wheel...done. - -$ source my-kernel/bin/activate - -(my-kernel) $ pip install ipykernel +marie@compute$ source my-kernel/bin/activate +marie@compute$ pip install ipykernel Collecting ipykernel -... +[...] Successfully installed ... ipykernel-5.1.0 ipython-7.5.0 ... - -(my-kernel) $ pip install --upgrade pip - -(my-kernel) $ python -m ipykernel install --user --name my-kernel --display-name="my kernel" +marie@compute$ pip install --upgrade pip +marie@compute$ python -m ipykernel install --user --name my-kernel --display-name="my kernel" Installed kernelspec my-kernel in .../.local/share/jupyter/kernels/my-kernel - -[now install additional packages for your notebooks] - -(my-kernel) $ deactivate +marie@compute$ pip install [...] # now install additional packages for your notebooks +marie@compute$ deactivate ``` #### Conda environment Load the needed module for Intel nodes -``` -module load Anaconda3 +```console +marie@compute$ module load Anaconda3 ``` ... or for IBM nodes (ml partition): -``` -module load PythonAnaconda +```console +marie@ml$ module load PythonAnaconda ``` Continue with environment creation, package installation and kernel registration: -``` -$ mkdir user-kernel #please use Workspaces! - -$ conda create --prefix /home/<USER>/user-kernel/my-kernel python=3.6 +```console +marie@compute$ mkdir user-kernel # please use workspaces! +marie@compute$ conda create --prefix /home/<USER>/user-kernel/my-kernel python=3.6 Collecting package metadata: done Solving environment: done [...] - -$ conda activate /home/<USER>/user-kernel/my-kernel - -$ conda install ipykernel +marie@compute$ conda activate /home/<USER>/user-kernel/my-kernel +marie@compute$ conda install ipykernel Collecting package metadata: done Solving environment: done [...] - -$ python -m ipykernel install --user --name my-kernel --display-name="my kernel" +marie@compute$ python -m ipykernel install --user --name my-kernel --display-name="my kernel" Installed kernelspec my-kernel in [...] - -[now install additional packages for your notebooks] - -$ conda deactivate +marie@compute$ conda install [..] # now install additional packages for your notebooks +marie@compute$ conda deactivate ``` Now you can start a new session and your kernel should be available. -**In JupyterLab**: - -Your kernels are listed on the launcher page: +**JupyterLab**: Your kernels are listed on the launcher page: -**TODO ADD IMAGE**\<a href="%ATTACHURL%/user-kernel_in_jupyterlab_launcher.png">\<img -alt="jupyterlab_app.png" height="410" -src="<https://doc.zih.tu-dresden.de/hpc-wiki/pub/Compendium/JupyterHub/user-kernel_in_jupyterlab_launcher.png>" -style="border: 1px solid #888;" title="JupyterLab kernel launcher -list"/>\</a> + +{: align="center"} You can switch kernels of existing notebooks in the menu: -**TODO ADD IMAGE** \<a href="%ATTACHURL%/jupyterlab_change_kernel.png">\<img -alt="jupyterlab_app.png" -src="<https://doc.zih.tu-dresden.de/hpc-wiki/pub/Compendium/JupyterHub/jupyterlab_change_kernel.png>" -style="border: 1px solid #888;" title="JupyterLab kernel switch"/>\</a> - -**In classic notebook app**: + +{: align="center"} -Your kernel is listed in the New menu: +**Classic Jupyter notebook**: Your kernel is listed in the New menu: -**TODO ADD IMAGE** \<a href="%ATTACHURL%/user-kernel_in_jupyter_notebook.png">\<img -alt="jupyterlab_app.png" -src="<https://doc.zih.tu-dresden.de/hpc-wiki/pub/Compendium/JupyterHub/user-kernel_in_jupyter_notebook.png>" -style="border: 1px solid #888;" title="Classic notebook (create notebook -with new kernel)"/>\</a> + +{: align="center"} You can switch kernels of existing notebooks in the kernel menu: -**TODO ADD IMAGE** \<a href="%ATTACHURL%/switch_kernel_in_jupyter_notebook.png">\<img -alt="jupyterlab_app.png" -src="<https://doc.zih.tu-dresden.de/hpc-wiki/pub/Compendium/JupyterHub/switch_kernel_in_jupyter_notebook.png>" -style="border: 1px solid #888;" title="Classic notebook (kernel -switch)"/>\</a> + +{: align="center"} -**Note**: Both python venv and conda virtual environments will be -mention in the same list. +!!! note + Both python venv and conda virtual environments will be mention in the same list. ### Loading modules diff --git a/Compendium_attachments/JupyterHub/switch_kernel_in_jupyter_notebook.png b/doc.zih.tu-dresden.de/docs/access/misc/jupyter_notebook_change_kernel.png similarity index 100% rename from Compendium_attachments/JupyterHub/switch_kernel_in_jupyter_notebook.png rename to doc.zih.tu-dresden.de/docs/access/misc/jupyter_notebook_change_kernel.png diff --git a/Compendium_attachments/JupyterHub/user-kernel_in_jupyter_notebook.png b/doc.zih.tu-dresden.de/docs/access/misc/jupyter_notebook_user_kernel_launcher.png similarity index 100% rename from Compendium_attachments/JupyterHub/user-kernel_in_jupyter_notebook.png rename to doc.zih.tu-dresden.de/docs/access/misc/jupyter_notebook_user_kernel_launcher.png diff --git a/Compendium_attachments/JupyterHub/jupyterlab_change_kernel.png b/doc.zih.tu-dresden.de/docs/access/misc/jupyterlab_change_kernel.png similarity index 100% rename from Compendium_attachments/JupyterHub/jupyterlab_change_kernel.png rename to doc.zih.tu-dresden.de/docs/access/misc/jupyterlab_change_kernel.png diff --git a/Compendium_attachments/JupyterHub/jupyterlab_error_directory_not_found.png b/doc.zih.tu-dresden.de/docs/access/misc/jupyterlab_error_directory_not_found.png similarity index 100% rename from Compendium_attachments/JupyterHub/jupyterlab_error_directory_not_found.png rename to doc.zih.tu-dresden.de/docs/access/misc/jupyterlab_error_directory_not_found.png diff --git a/Compendium_attachments/JupyterHub/user-kernel_in_jupyterlab_launcher.png b/doc.zih.tu-dresden.de/docs/access/misc/jupyterlab_user_kernel_launcher.png similarity index 100% rename from Compendium_attachments/JupyterHub/user-kernel_in_jupyterlab_launcher.png rename to doc.zih.tu-dresden.de/docs/access/misc/jupyterlab_user_kernel_launcher.png