Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| software:juypter:caviness [2026-03-26 16:34] – Add VALET package definition and activation mbotto | software:juypter:caviness [2026-03-30 14:16] (current) – Delete obsolete copy (with misspelled path name) of Jupyter Notebook Caviness page mbotto | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Jupyter Notebook Python Virtual Environment on Caviness====== | ||
| - | <note warning> | ||
| - | This page is under construction. | ||
| - | </ | ||
| - | |||
| - | The following steps will walk you through setting up a Conda virtual environment with Python 3 and Jupyter Notebook. It will also cover the steps of requesting a compute node to run a Jupyter Notebook session on Caviness. Lastly, it will explain how to set up SSH connections to be able to connect to the Jupyter Notebook session running on a compute node. | ||
| - | |||
| - | Before starting, make sure you set your workgroup. This example will demonstrate how to create a shared directory in your workgroup storage where you can create Conda environments that are accessible to everyone in your workgroup. | ||
| - | |||
| - | <note warning> | ||
| - | If you do not have a '' | ||
| - | </ | ||
| - | |||
| - | Before creating the Jupyter Notebook environment, | ||
| - | |||
| - | <code bash> | ||
| - | [user@login00.caviness ~]$ workgroup -g my_workgroup | ||
| - | [(my_workgroup: | ||
| - | </ | ||
| - | |||
| - | <note important> | ||
| - | The environment variable '' | ||
| - | |||
| - | <code bash> | ||
| - | [user@login00.caviness ~]$ ls -d ${WORKDIR}/ | ||
| - | </ | ||
| - | </ | ||
| - | |||
| - | =====Create Jupyter Notebook Virtual Environment===== | ||
| - | |||
| - | This example will use the Miniforge VALET package to enable usage of the Conda package manager. If you are new to Conda, make sure to review the documentation for [[software: | ||
| - | |||
| - | Start by loading the Miniforge VALET package (this command loads the default version, but you can specify a different version as needed): | ||
| - | |||
| - | <code bash> | ||
| - | [(my_workgroup: | ||
| - | Adding package `miniforge/ | ||
| - | </ | ||
| - | |||
| - | After loading Miniforge, we can now use '' | ||
| - | |||
| - | <code bash> | ||
| - | [(my_workgroup: | ||
| - | Retrieving notices: done | ||
| - | Channels: | ||
| - | - conda-forge | ||
| - | Platform: linux-64 | ||
| - | Collecting package metadata (repodata.json): | ||
| - | Solving environment: | ||
| - | . | ||
| - | . | ||
| - | . | ||
| - | ## Package Plan ## | ||
| - | |||
| - | environment location: / | ||
| - | |||
| - | added / updated specs: | ||
| - | - jupyter | ||
| - | - python=3 | ||
| - | . | ||
| - | . | ||
| - | . | ||
| - | Proceed ([y]/n)? y | ||
| - | . | ||
| - | . | ||
| - | . | ||
| - | Downloading and Extracting Packages: | ||
| - | |||
| - | Preparing transaction: | ||
| - | Verifying transaction: | ||
| - | Executing transaction: | ||
| - | # | ||
| - | # To activate this environment, | ||
| - | # | ||
| - | # $ conda activate / | ||
| - | # | ||
| - | # To deactivate an active environment, | ||
| - | # | ||
| - | # $ conda deactivate | ||
| - | </ | ||
| - | |||
| - | =====VALET Package Definition===== | ||
| - | |||
| - | The new virtual environment can easily be added to your login shell and job runtime environments using VALET. Ensure you have a workgroup VALET package definition directory present, and get the path to the parent directory of your Jupyter Notebook virtual environment: | ||
| - | |||
| - | <code bash> | ||
| - | [(my_workgroup: | ||
| - | [(my_workgroup: | ||
| - | / | ||
| - | </ | ||
| - | |||
| - | Take note of the path echoed, then create a new file in '' | ||
| - | |||
| - | <code yaml jupyter-notebook.vpkg_yaml> | ||
| - | jupyter-notebook: | ||
| - | prefix: / | ||
| - | description: | ||
| - | flags: | ||
| - | - no-standard-paths | ||
| - | actions: | ||
| - | - action: source | ||
| - | script: | ||
| - | sh: miniforge-activate.sh | ||
| - | order: failure-first | ||
| - | success: 0 | ||
| - | versions: | ||
| - | " | ||
| - | description: | ||
| - | dependencies: | ||
| - | - miniforge | ||
| - | </ | ||
| - | |||
| - | =====Activating the Jupyter Notebook Virtual Environment with VALET===== | ||
| - | The versions of the virtual environment declared in the VALET package are listed using the '' | ||
| - | |||
| - | <code bash> | ||
| - | [(my_workgroup: | ||
| - | |||
| - | Available versions in package (* = default version): | ||
| - | |||
| - | [/ | ||
| - | jupyter-notebook | ||
| - | * 20260326 | ||
| - | </ | ||
| - | |||
| - | Activating the virtual environment is accomplished using the '' | ||
| - | |||
| - | < | ||
| - | [(my_workgroup: | ||
| - | Adding dependency `miniforge/ | ||
| - | Adding package `jupyter-notebook/ | ||
| - | (/ | ||
| - | </ | ||