We are experiencing some unexpected shutdowns on the JupyterHub service recently and are trying to fix the issue ASAP. Please make sure to save your work frequently in case the shutdown happens.
JupyterHub on Triton User Menu¶
JupyterHub provides Jupyter Notebook for multiple users.
Through JupyterHub on Triton, you can request and start a Jupyter Notebook server on one of Triton’s compute nodes (using LSF job scheduler behind the scenes). In this way, you can interactively test your Python or R programs through the Notebook with the supercomputer resources.
Currently all requested Notebook servers are running in only one compute node. It is recommended to use the Notebook as a testing tool and submit formal jobs via LSF.
Using JupyterHub on Triton¶
Starting your Jupyter Notebook server¶
- Press the
Start My Notebook Serverbutton to launch the resource request page.
- Choose the memory, number of CPU cores, time you want to run the Notebook server and whether or not you want to use a GPU.
- Press the
Requestbutton to request and start a Notebook server.
When using the JupyterHub, you need to be clear that there are three things you need to turn off:
- Close Notebook File - After saving, press
Filein the menu bar and choose
Close and Halt.
- Stop Notebook Server - Click the
Control Panelbutton at the top-right corner and press
Stop My Notebook Server.
- Logout from JupyterHub - Click the
Logout from JupyterHubbutton at the top-right corner.
If you only logout from JupyterHub without stopping the Notebook Server first, the Notebook Server will run until the time you set up when starting it.
Using Jupyter Notebook¶
After the notebook server starts, you will see the interface page showing your home directory.
You can create notebook files, text files and folders, or open terminals
New button at the top-right corner under the menu bar.
Details can be found at the official Jupyter Notebook User Documentation.
Creating Your Python Kernel¶
ssh <caneid>@triton.ccs.miami.eduto login to Triton
ml wml_anaconda3if you need to install deep learning packages
conda create -n <your environment> python=<version> <package1> <package2> ...
conda activate <your environment>
- (your environment)$
conda install ipykernel
- (your environment)$
ipython kernel install --user --name <kernel name> --display-name "<the displayed name for the kernel>"
Here is an example:
y on your keyboard when you see
$ ml anaconda3 $ conda create -n myenv python=3.7 numpy scipy $ conda activate myenv (myenv)$ conda install ipykernel (myenv)$ ipython kernel install --user --name my_py37_kernel --display-name "My Python 3.7 with NumPy and SciPy"
Later on, you can still install new packages to the kernel using
conda install <package> after activating the environment.
If the package could not be found, you can search Anaconda
Cloud and choose Platform
If Anaconda Cloud does not have the package neither, you could try
Issues may arise when using pip and conda together. Only after conda has been used to install as many packages as possible should pip be used to install any remaining software. If modifications are needed to the environment, it is best to create a new environment rather than running conda after pip.
After a package is installed, you can use it in your notebook by running
import <package name> in a cell.
Creating Your R kernel¶
conda create -n <your r environemnt> -c conda-forge r-base
conda activate <your r environemnt>
- (<your r environemnt>)$
- (inside R) >
install.packages(c('repr', 'IRdisplay', 'IRkernel'))
- (inside R) >
IRkernel::installspec(name='<your r kernel name>', displayname='<display name of your kernel>')
Later on, you can still install new R packages to the kernel by activating the environment, entering R and running
(The pacakge will be installed at
/~/.conda/envs/<your r environment>/lib/R/library)
After a R package is installed, you can use it in your notebook by running
library('<package name>') in a cell.
Using Pre-installed Kernels¶
Several kernels has been pre-installed on Triton. You can use them to test your code if you do not need
additional packages. On the Notebook Dashboard page, you can create a
new notebook file (.ipynb) with a selected kernel by clicking on the
New button at the top-right corner under the menu bar. On the
Notebook Editor page, you can change kernel by clicking
the menubar and choosing
- Python 2.7 and Python 3.7 kernels are the Anaconda2 2019.07 and Anaconda3 2019.07 base environments. Each of them has over 150 packages automatically installed.
- WML CE kernels have the IBM Watson Machine
Learning Community Edition
(You can check different versions by changing
Releasesversion in the
Filtersbar on the website.)
- R kernel includes the R Base Package.
Switching to JupyterLab¶
After the Jupyter Notebook server starts, you can switch to JupyterLab by changing the url from
.../lab. If you want to stop the server from JupyterLab, choose
Hub Control Panel in the menu bar, then press
Stop My Notebook Server button in the panel.