-
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 #47 from carlos-encs/master
jupyter labs no container scripts.
- Loading branch information
Showing
3 changed files
with
53 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!-- TOC --><a name="README"></a> | ||
# README | ||
|
||
This directory has example scripts to run Jupyter Labs+conda+python without containers | ||
|
||
<!-- TOC --><a name="Preparation"></a> | ||
## Preparation | ||
After opening an interactive session (salloc) | ||
|
||
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 | ||
|
||
## Execution | ||
After opening an interactive session (salloc) | ||
|
||
Run the script `run.sh`, everytime you want to execute jupyterlabs | ||
|
||
## Browsing | ||
After Execution, create an ssh tunnel (read https://nag-devops.github.io/speed-hpc/#jupyter-notebooks-in-singularity) | ||
|
||
Open a browser: http://localhost:XXXX/lab?token=XXXXXXXXXX | ||
|
||
## REMINDER | ||
Don't forget to setup the 2 scripts with the parameters of your choice | ||
Jupyter: directory, jupiter-env: environment name | ||
|
||
<!-- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/encs/bin/tcsh | ||
|
||
mkdir -p /speed-scratch/$USER/Jupyter | ||
module load anaconda3/2023.03/default | ||
setenv TMPDIR /speed-scratch/$USER/tmp | ||
setenv TMP /speed-scratch/$USER/tmp | ||
setenv CONDA_PKGS_DIRS /speed-scratch/$USER/Jupyter/pkgs | ||
conda create -p /speed-scratch/$USER/Jupyter/jupyter-env -y | ||
conda activate /speed-scratch/$USER/Jupyter/jupyter-env | ||
conda install -c conda-forge jupyterlab -y | ||
pip3 install --quiet torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 | ||
exit |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/encs/bin/tcsh | ||
|
||
cd /speed-scratch/$USER/Jupyter | ||
module load anaconda3/2023.03/default | ||
setenv TMPDIR /speed-scratch/$USER/tmp | ||
setenv TMP /speed-scratch/$USER/tmp | ||
setenv CONDA_PKGS_DIRS /speed-scratch/$USER/Jupyter/pkgs | ||
conda activate /speed-scratch/$USER/Jupyter/jupyter-env | ||
jupyter lab --no-browser --notebook-dir=$PWD --ip="0.0.0.0" --port=8888 --port-retries=50 | ||
|