-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from NAG-DevOps/update-jupyterlab-readme
Update jupyterlab readme
- Loading branch information
Showing
2 changed files
with
36 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,46 @@ | ||
<!-- TOC --><a name="README"></a> | ||
# README | ||
# Jupyter Lab on HPC Cluster | ||
|
||
This directory has example scripts to run Jupyter Labs+conda+python without containers | ||
This folder contains scripts and instructions for setting up and running Jupyter Lab on the HPC cluster using Conda without container. These scripts are designed to simplify the process of allocating resources, setting up environments, and starting Jupyter Lab. | ||
|
||
<!-- TOC --><a name="Preparation"></a> | ||
## Preparation | ||
After opening an interactive session (salloc) | ||
<!-- TOC --><a name="Prerequisites"></a> | ||
## Prerequisites | ||
Before starting, ensure you have access to the HPC cluster. | ||
|
||
Run the script `firsttime.sh`, ONLY 1 time, it will | ||
- Create a /speed-scratch/$USER/Jupyter directory: change Jupyter to any name of your choice | ||
- Set environment variables for tmp directories and for CONDA_PKGS_DIRS | ||
- Create a conda environmen named: jupyter-env (change it to any name of your choice) | ||
- Install JupyterLabs + pytorch | ||
- exit the interactive session | ||
<!-- TOC --><a name="Instructions"></a> | ||
## Instructions | ||
### For first time use, we need to | ||
|
||
## Execution | ||
After opening an interactive session (salloc) | ||
* start an interactive session | ||
|
||
Run the script `run.sh`, everytime you want to execute jupyterlabs | ||
salloc --mem=20G --gpus=1 | ||
|
||
## Browsing | ||
After Execution, create an ssh tunnel (read https://nag-devops.github.io/speed-hpc/#jupyter-notebooks-in-singularity) | ||
* load and initilize the environment | ||
|
||
Open a browser: http://localhost:XXXX/lab?token=XXXXXXXXXX | ||
module load anaconda/2023.03/default | ||
conda init tcsh | ||
source ~/.tcshrc | ||
|
||
## REMINDER | ||
Don't forget to setup the 2 scripts with the parameters of your choice | ||
Jupyter: directory, jupiter-env: environment name | ||
* run `setup-conda.sh` | ||
|
||
./setup-conda.sh | ||
|
||
The script will: | ||
- create a `/speed-scratch/$USER/Jupyter` directory (change Jupyter to any name of your choice) | ||
- set environment variables for **TMP** directories and for **CONDA_PKGS_DIRS** | ||
- create a conda environment named **jupyter-env** | ||
- install JupyterLabs and pytorch | ||
- exit the interactive session | ||
|
||
## Launching Jupeter | ||
* Run the `start_jupyterlab.sh` script each time you need to launch Jupyterlab | ||
|
||
./start_jupyterlab.sh | ||
|
||
The script will: | ||
- allocate resources for your job | ||
- start jupyter server by running `run_jupyterlab.sh` | ||
- print the ssh command that you can use to connect to the compute node runnung the jupyter notebook (this is done in a new terminal) | ||
- print the token/link to the jupyter server to paste in a web browser (starting with `http://127.0.0.1/...`) | ||
|
||
<!-- TOC end --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters