From eca4f0d16ec4418c2dd13a5a1821e3f85bd54f5b Mon Sep 17 00:00:00 2001 From: carlos-encs <110119864+carlos-encs@users.noreply.github.com> Date: Fri, 3 May 2024 11:38:44 -0400 Subject: [PATCH 1/9] jupyter, no container --- src/jupyterlabs/README.md | 28 ++++++++++++++++++++++++++++ src/jupyterlabs/firsttime.sh | 9 +++++++++ src/jupyterlabs/run.sh | 8 ++++++++ 3 files changed, 45 insertions(+) create mode 100644 src/jupyterlabs/README.md create mode 100644 src/jupyterlabs/firsttime.sh create mode 100644 src/jupyterlabs/run.sh diff --git a/src/jupyterlabs/README.md b/src/jupyterlabs/README.md new file mode 100644 index 0000000..b8f118f --- /dev/null +++ b/src/jupyterlabs/README.md @@ -0,0 +1,28 @@ + +# README + +This directory has example scripts to run Jupyter Labs+conda+python without containers + + +## 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 + + \ No newline at end of file diff --git a/src/jupyterlabs/firsttime.sh b/src/jupyterlabs/firsttime.sh new file mode 100644 index 0000000..67aa5bd --- /dev/null +++ b/src/jupyterlabs/firsttime.sh @@ -0,0 +1,9 @@ +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 +conda activate /speed-scratch/$USER/Jupyter/jupyter-env +conda install -c conda-forge jupyterlab +pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 diff --git a/src/jupyterlabs/run.sh b/src/jupyterlabs/run.sh new file mode 100644 index 0000000..d8e97d6 --- /dev/null +++ b/src/jupyterlabs/run.sh @@ -0,0 +1,8 @@ +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 + From ca61492b0ea1e24895d7080dc2b6d7304ddd8464 Mon Sep 17 00:00:00 2001 From: carlos-encs <110119864+carlos-encs@users.noreply.github.com> Date: Fri, 3 May 2024 11:46:43 -0400 Subject: [PATCH 2/9] jupyterlabs + pytorch --- src/jupyterlabs/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/jupyterlabs/README.md b/src/jupyterlabs/README.md index b8f118f..0822c25 100644 --- a/src/jupyterlabs/README.md +++ b/src/jupyterlabs/README.md @@ -6,6 +6,7 @@ This directory has example scripts to run Jupyter Labs+conda+python without cont ## 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 @@ -15,6 +16,7 @@ Run the script firsttime.sh, ONLY 1 time, it will ## Execution After opening an interactive session (salloc) + Run the script run.sh, everytime you want to execute jupyterlabs ## Browsing From 7dbb929586540be8b09aecf319d342c255201e5c Mon Sep 17 00:00:00 2001 From: carlos-encs <110119864+carlos-encs@users.noreply.github.com> Date: Fri, 3 May 2024 11:49:15 -0400 Subject: [PATCH 3/9] jupyterlabs + pytorch --- src/jupyterlabs/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jupyterlabs/README.md b/src/jupyterlabs/README.md index 0822c25..779cd6c 100644 --- a/src/jupyterlabs/README.md +++ b/src/jupyterlabs/README.md @@ -7,7 +7,7 @@ This directory has example scripts to run Jupyter Labs+conda+python without cont ## Preparation After opening an interactive session (salloc) -Run the script firsttime.sh, ONLY 1 time, it will +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) @@ -17,7 +17,7 @@ Run the script firsttime.sh, ONLY 1 time, it will ## Execution After opening an interactive session (salloc) -Run the script run.sh, everytime you want to execute jupyterlabs +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) From 9f4f8430bc4ec129703c58d0ffb99e0f8e3fc27e Mon Sep 17 00:00:00 2001 From: carlos-encs <110119864+carlos-encs@users.noreply.github.com> Date: Fri, 3 May 2024 11:50:11 -0400 Subject: [PATCH 4/9] text formatting --- src/jupyterlabs/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/jupyterlabs/README.md b/src/jupyterlabs/README.md index 779cd6c..6b9d08b 100644 --- a/src/jupyterlabs/README.md +++ b/src/jupyterlabs/README.md @@ -21,6 +21,7 @@ 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 From 930a5f12d89564c0a25a80b96d070776fbe92175 Mon Sep 17 00:00:00 2001 From: carlos-encs <110119864+carlos-encs@users.noreply.github.com> Date: Fri, 3 May 2024 12:18:28 -0400 Subject: [PATCH 5/9] Update firsttime.sh -y option --- src/jupyterlabs/firsttime.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/jupyterlabs/firsttime.sh b/src/jupyterlabs/firsttime.sh index 67aa5bd..a1c7c6c 100644 --- a/src/jupyterlabs/firsttime.sh +++ b/src/jupyterlabs/firsttime.sh @@ -3,7 +3,7 @@ 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 +conda create -p /speed-scratch/$USER/Jupyter/jupyter-env -y conda activate /speed-scratch/$USER/Jupyter/jupyter-env -conda install -c conda-forge jupyterlab -pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 +conda install -c conda-forge jupyterlab -y +pip3 install -y torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 From 16282697fe8552410acd61799e08123593011137 Mon Sep 17 00:00:00 2001 From: carlos-encs <110119864+carlos-encs@users.noreply.github.com> Date: Fri, 3 May 2024 12:21:44 -0400 Subject: [PATCH 6/9] option added: -y --- src/jupyterlabs/firsttime.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/jupyterlabs/firsttime.sh b/src/jupyterlabs/firsttime.sh index a1c7c6c..d993986 100644 --- a/src/jupyterlabs/firsttime.sh +++ b/src/jupyterlabs/firsttime.sh @@ -1,3 +1,5 @@ +#!/encs/bin/tcsh + mkdir -p /speed-scratch/$USER/Jupyter module load anaconda3/2023.03/default setenv TMPDIR /speed-scratch/$USER/tmp From 734a2c70069bdc00af890601e735e49d4bc7660a Mon Sep 17 00:00:00 2001 From: carlos-encs <110119864+carlos-encs@users.noreply.github.com> Date: Fri, 3 May 2024 12:21:57 -0400 Subject: [PATCH 7/9] option added: -y --- src/jupyterlabs/run.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/jupyterlabs/run.sh b/src/jupyterlabs/run.sh index d8e97d6..9e8d21f 100644 --- a/src/jupyterlabs/run.sh +++ b/src/jupyterlabs/run.sh @@ -1,3 +1,5 @@ +#!/encs/bin/tcsh + cd /speed-scratch/$USER/Jupyter module load anaconda3/2023.03/default setenv TMPDIR /speed-scratch/$USER/tmp From f80960e8091f8e073f14e8128484d8af8277e903 Mon Sep 17 00:00:00 2001 From: Carlos Alarcon Date: Fri, 3 May 2024 12:33:39 -0400 Subject: [PATCH 8/9] +x added --- src/jupyterlabs/firsttime.sh | 0 src/jupyterlabs/run.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 src/jupyterlabs/firsttime.sh mode change 100644 => 100755 src/jupyterlabs/run.sh diff --git a/src/jupyterlabs/firsttime.sh b/src/jupyterlabs/firsttime.sh old mode 100644 new mode 100755 diff --git a/src/jupyterlabs/run.sh b/src/jupyterlabs/run.sh old mode 100644 new mode 100755 From b3df430c969b5b99c2c23a44dfd161ea54d7909e Mon Sep 17 00:00:00 2001 From: carlos-encs <110119864+carlos-encs@users.noreply.github.com> Date: Fri, 3 May 2024 13:52:56 -0400 Subject: [PATCH 9/9] Update firsttime.sh: --quiet added --- src/jupyterlabs/firsttime.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/jupyterlabs/firsttime.sh b/src/jupyterlabs/firsttime.sh index d993986..f85dca5 100755 --- a/src/jupyterlabs/firsttime.sh +++ b/src/jupyterlabs/firsttime.sh @@ -8,4 +8,5 @@ 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 -y torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 +pip3 install --quiet torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 +exit