{ "cells": [ { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# `Jupyterhub`: A barrier-free entrance to DKRZ\n", "\n", "With an account for **levante**, you can connect via `ssh` on a terminal interface to the system. This requires knowledge in shell programming.\n", "As a user friendly alternative, we offer you the **[jupyterhub web service](https://docs.dkrz.de/doc/software%26services/jupyterhub/index.html#)**, which, by the way, also allows you to run terminals as with `ssh` as well." ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "Features in combination with notebooks:\n", "\n", "- Software independent and interactive access to HPC resources\n", "- Tutorials prepared by experts and formatted as Jupyter-notebooks for a steep learning curve\n", "- Inline plot creation for a all in one solution\n", "- Fully supported and maintained at DKRZ\n", "\n", "⇨ **Advanced programming with a beginner friendly control**" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "How it works:\n", "\n", "**What you have to do:**\n", "\n", "1. You *log in* via:\n", "https://jupyterhub.dkrz.de/hub/login\n", "2. You *request* a notebook server\n", "\n", "**What DKRZ does in turn:**\n", "\n", "3. A server is *spawned* as a *slurm job* on levante. It uses resources as specified by your *request*.\n", "4. Your server runs for as long as you specified in the *request*. In that time, you can close the tab and revisit `jupyterhub` without it is shut down." ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Control Panel:\n", "\n", "- Either work with *jupyterhub* or *jupyterlab*\n", "- Navigate with a file browser\n", "- Launch `Notebooks` or `Consoles`" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Why do we promote Jupyter-`Notebooks`?\n", "\n", "- Cells\n", " - Clear view: Mark Cells as *Code*, *Markdown* or *Raw*\n", " - Interactive: Run a cell individually without running the entire script" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "- Code language: Python, but also Bash, R, Julia, Latex:\n", " - Use `!` before the commands and `bash` runs it instead of the python interpreter\n", " - Define a entire cell as `bash` or `latex`with the `%%` magic" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "!ls" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "slideshow": { "slide_type": "fragment" } }, "outputs": [], "source": [ "%%bash\n", "ls" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "slideshow": { "slide_type": "fragment" } }, "outputs": [], "source": [ "%%latex\n", "\\begin{align}\n", "\\frac{\\partial u}{\\partial t} + \\nabla \\cdot \\left( \\boldsymbol{v} u - D\\nabla u \\right) = f\n", "\\end{align}" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "- Modules and extensions\n", " - `python` and `jupyter` benefit from a quickly evolving package universe\n", " - Embed `html` to the notebook\n", " - Automatic code formatting when executing cell" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "from IPython.display import HTML, display, Markdown, IFrame\n", "display(Markdown(\"Time series of three different data pool disk space measures. DKRZ has published about 1.5 PB, 2.5 PB are replicated data from other data nodes. An average CMIP6 dataset contains about 5 files and covers 4GB.\"))\n", "IFrame(src=\"https://swift.dkrz.de/v1/dkrz_a44962e3ba914c309a7421573a6949a6/Pool-Statistics/pool-timeseries-hvplot.html\",width=\"900\",height=\"550\",frameborder=\"0\")" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "- Kernels:\n", " - Predefined **Software Environments** can be set in the upper right by using a specific kernel\n", " - On Jupyterhub, you can choose between a hands full of different configurations\n", " - Customized kernels can be implemented with conda. See the docs for a tutorial" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Conclusion:\n", "\n", "### ⇨ Jupyterhub is your laboratory in the web browser" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "python3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.9" } }, "nbformat": 4, "nbformat_minor": 4 }