/tag/jupyter
Loading Module in Jupyter
Users cannot load modules inside a JupyterLab session. If you need access to modules, please request a desktop session instead of JupyterLab. Fill out the form as you normally would for JupyterLab. After you get to a desktop, open a terminal (next to Firefox in the top bar) and type these commands:
module load jupyterlab module load … # your modules here jupyter-lab This should start up Firefox shortly. If you accidentally close the window, right-click on the link in the terminal and choose “open link” to restart.
An example of using LaTeX inside a JupyterLab session is shown in the screenshot below.
Clear OOD Files
To clear OOD Session files, the HPC system will need to be accessed via a terminal. See documentation for information on how to access via SSH.
You can find the session files and logs for all Open on Demand apps at:
~/ondemand/data/sys/dashboard/batch_connect/sys Under this directory you will see subdirectories for the Open on Demand applications that you have used before. Under each subdirectory you can find the files that are created when you launch a new session.
To quickly clear all session files for OnDemand from your /home directory run:
rm -rf ondemand Other directories related to Open on Demand such as .
Ivy Secure Environment
Ivy is a secure computing environment for researchers consisting of virtual machines (Linux and Windows). Researchers can use Ivy to process and store sensitive data with the confidence that the environment is secure and meets HIPAA, FERPA, CUI or ITAR requirements.
Facilities Statement - Are you submitting a grant proposal and need standard information about UVA research computing environments? Get it here. Overview Ivy consists of both virtual computing environments and secure storage. In order to obtain access to either system, users must
Submit an account request, Complete the Information Security Awareness Training, and Ensure their personal computer meets all High Security VPN requirements.
Converting a Jupyter Notebook to a Python Script
Sometimes it may be useful to convert a Jupyter notebook into a Python executable script. Once your notebook is opened in OOD you can select File > Export Notebook As … > Export Notebook to Executable Script:
This will download a Python executable with a ‘.py’ extension into your local computer’s Downloads folder. Your notebook may also show “Download as” instead of “Export Notebook As …”. Either of these selections will allow you to download a Python executable.
This script can be copied to the HPC system in the working directory where JupyterLab was accessing the notebook. Information on transferring files to and from Rivanna can be found here.
Converting a Jupyter Notebook to a PDF
Users cannot load modules inside the OpenOnDemand App for JupyterLab. Therefore it is not possible to convert a Jupyter Notebook to a PDF directly inside the JupyterLab Interactive App on OpenOnDemand.
There are 2 ways to convert a Jupyter Notebook to a PDF:
Both methods require Jupyter to be installed within a conda environment. The following example will install Jupyter into a conda environment named ‘jupyter’: module load miniforge conda create -n jupyter source activate jupyter mamba install jupyter -y Directly from the command line. ssh from your terminal and type the following: module load miniforge texlive # Load conda environment with Jupyter installed source activate jupyter jupyter nbconvert –to pdf you_script.
Custom Jupyter Kernels
You can create custom kernels from a conda environment or an Apptainer container.
In both cases you’ll need to install the ipykernel package.
Jupyter kernel based on a conda environment To create a custom kernel of the conda environment myenv that uses Python 3.7:
module load miniforge conda create -n myenv python=3.7 ipykernel <other_packages> source activate myenv python -m ipykernel install –user –name myenv –display-name "My Env" Note:
You can customize the display name for your kernel. It is shown when you hover over a tile in JupyterLab. If you do not specify a display name, the default Python [conda env:<ENV_NAME>] will be shown.