jupyter.hpc.ut.ee¶
jupyter.hpc.ut.ee is UTHPC centre's JupyterHub.
JupyterHub is a multi-user Jupyter server that provides a web-based login and spawns your own single-user server with JupyterLab.
Getting started¶
JuputerHub is available not only within UT network, but also from the rest of the Internet at jupyter.hpc.ut.ee with your UT credentials. To use JuputerHub, you have to have UTHPC account.
To start your single-user server, you have to choose a profile. Currently, there are 5 available options:
Profile | CPU cores | Memory | Time limit | Notes |
---|---|---|---|---|
Default | 1 | 8 GB | 6 h | runs on main partition |
Default AMD | 1 | 8 GB | 6 h | runs on amd partition |
Large memory | 2 | 32 GB | 24 h | |
Multicore | 8 | 16 GB | 24 h | |
GPU | 2 | 40 GB | 6 h | 1 GPU |
Testing | 1 | 8 GB | 2 h |
Your single-user server spins up a job in Slurm queue on the UTHPC cluster and it might take sometime to start depending on the resource availability. The started single-user server stays up until either you stop it manually or the time limit kicks in.
Note
Closing the tab doesn't close the server.
Important
If you have finished your job, please, stop your server to free up resources for other users and incur extra costs. Note that selecting ’Logout’doesn't free up resources as it keeps your server running (see Stopping a single-user server section).
As Slurm manages the resources for your single-user server. Be aware if you go over the memory limit, your server is automatically killed without warning. You can view the error messages in the corresponding error file ~/jupyter.xxx.log>
(’xxx’ represents a Slurm job id).
Stopping a single-user server¶
Use ’Stop My Server’ button in ’Hub Control Panel’ to shut down your server. Navigate to ’File’ ’Hub Control Panel’. It takes a bit of time to shut down your running server.
Usage¶
Default software and kernels¶
It has preinstalled Python 3.10.1 and R 3.6.3 kernels.
Install packages to R / Python kernel¶
Info
You can install R or python kernel either through Jupyter's Terminal or original terminal with ssh.
Jupyter users share both R/Python kernels and that's why it's not allowed to install add-on packages directly into kernels. However, you can install packages to your local $HOME
.
Regarding python packages, please read section below: Add a custom python/conda environment . Once your custom conda/python kernel created, you proceed installing packages into the virtual environment.
You can install R packages from within JupyterLab following these steps:
- Open Terminal and create library directory, then close the terminal.
mkdir -p ~/local/R_libs
- Open Notebook with R kernel, and install packages to the created dir:
install.packages("<package name>", lib="~/local/R_libs/")
- To use the package, Call the function library and specify the same lib option:
library("<package name>", lib="~/local/R_libs/")
Add a custom python/conda environment¶
Step 1 - activate your environment¶
Info
If you haven't got an environment yet, read though on how to create a python/conda environment by following our Python/Conda env guide .
#python env
source <user_env>/bin/activate
#conda env
conda activate <user_env>
Having activated the env, installs all necessary packages. Then set the env onto your JupyterLab.
Step 2 - install ipykernel to your python/conda environment¶
#python env
python -m pip install ipykernel
#conda env
conda install ipykernel
Step 3 - link the installed ipykernel with your environment¶
python -m ipykernel install --user --name=<user_env>
Step 4 - load your environment or kernel¶
Customize kernels¶
In order for to work in custom kernel, you have to modify a kernel file of your environment.
-
On
rocket.hpc.ut.ee
machine, your $HOME has your environment kernel file calledkernel.json
, which is usually located in~/.local/share/jupyter/kernels/<your env name>/kernel.json
or can be found withjupyter-kernelspec list
command -
Secondly, activate your python/conda env then activate the required modules, after that echo
$PATH
,$LIBRARY_PATH
,$LD_LIBRARY_PATH
with the following command:Copy the output from the previous commands into your clipboard.echo $PATH echo $LIBRARY_PATH echo $LD_LIBRARY_PATH
-
Finally, open
kernel.json
and copy this snippet intokernel.json
and substitute<your env bin path>
with paths obtained in the step 2 intokernel.json
file:If necessary, add a comma at the end of the previous line and ensure"env": { "PATH": "<your env PATH from step 2>", "LD_LIBRARY_PATH": "<your env LD_LIBRARY from step 2>", "LIBRARY_PATH": <your env LIBRARY_PATH from step 2>" }
}
is present, as json requires structure. -
Save the file and restart Jupyter if you have it running already.
At the end, your kernel.json
should look something like:
{
"argv": [
"/gpfs/space/home/user/.conda/envs/user_env/bin/python",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
"display_name": "user_env",
"language": "python",
"metadata": {
"debugger": true
},
"env": {
"PATH": "/gpfs/space/home/user/.conda/envs/user_env/bin:/gpfs/space/software/jupyterhub/python/jupyter/bin:/gpfs/software/soft/rocket/linux-centos7-x86_64/gcc-9.2.0/openssl-1.1.1g-pikmcqfnphdwr5n32225b7rf4fpksnr2/bin:/sbin:/bin:/usr/sbin:/usr/bin",
"LD_LIBRARY_PATH": "/gpfs/space/home/user/.conda/envs/user_env/lib:/gpfs/space/software/jupyterhub/python/jupyter/lib"
"LIBRARY_PAHT": "/gpfs/space/home/user/.conda/envs/user_env/lib:/gpfs/space/software/jupyterhub/python/jupyter/lib"
}
}
Problems and requests¶
This service is currently in beta and under development. If you notice problems or would like any more extensions or features, then please write to support@hpc.ut.ee .
Please provide the following details:
- Error details from the
jupyter.xxxxxx.log>
file. - Slurm job id.
FAQ¶
Server spawning stuck without error.
Simple fix is to refresh your page (’Ctrl’ + ’R’).
Custom plugins for JupyterHub.
You can install these into your custom python/conda environment.
Accidentally closing browser with running Jupyter.
A Jupyter session is automatically saved and survives an accidental browser/tab closure as long as time limit allows. Just re logging into jupyter.hpc.ut.ee .
Server has died.
This may happen if resource usage exceeds the limits, thus Slurm kills your server. Check the ~/jupyter.xxxxxx.err>
log file to be sure.
Server seems inaccessible / Can't get to the control panel to restart it.
In JupyterLab, ’File’ ’Hub Control Panel’. If you can't get there, you can change the URL path to /hub/home
’Spawner pending’ upon you request to start.
Wait a bit and return to JupyterHub home page and see if the server has started. Clicking the button twice might cause issues.
See also¶
- https://jupyter.org .
- Jupyter Documentation .
- Demos and tutorial: https://jupyter.org/try .
Created: 2022-04-28