-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding installation script for miniconda, and SLURM job files for sin…
…gularity and Jupyter notebook launchers
- Loading branch information
1 parent
308e21c
commit 8f5b071
Showing
3 changed files
with
78 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,21 @@ | ||
| #!/bin/bash | ||
| #SBATCH --partition debug | ||
| #SBATCH --nodes 1 | ||
| #SBATCH --ntasks-per-node 1 | ||
| #SBATCH --mem-per-cpu 2G | ||
| #SBATCH --time 1-0:00:00 | ||
| #SBATCH --job-name singularity-helloworld | ||
| #SBATCH --output hellowrold-singularity-%J.log | ||
|
|
||
| date | ||
| hostname | ||
|
|
||
| module load singularity | ||
|
|
||
| echo "================================================ " | ||
| echo "download image" | ||
| singularity pull shub://singularityhub/hello-world | ||
| echo "Executing the hello-world image" | ||
| singularity run ./hello-world_latest.sif | ||
| echo "================================================ " | ||
|
|
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,30 @@ | ||
| #!/bin/bash | ||
| #SBATCH --partition debug | ||
| #SBATCH --nodes 1 | ||
| #SBATCH --ntasks-per-node 1 | ||
| #SBATCH --mem-per-cpu 4G | ||
| #SBATCH --time 2-0:00:00 | ||
| #SBATCH --job-name jupyter-notebook-tunnel | ||
| #SBATCH --output jupyter-notebook-tunnel-%J.log | ||
|
|
||
| # get tunneling info | ||
| XDG_RUNTIME_DIR="" | ||
| # port=$(shuf -i8080-8084 -n1) | ||
| port=8080 | ||
| node=$(hostname -s) | ||
| ip=$(hostname -i) | ||
| user=$(whoami) | ||
| cluster=$(hostname -f) | ||
|
|
||
| # print tunneling instructions jupyter-log | ||
| echo -e " | ||
| CloudShell port forward command for WebPreview | ||
| gcloud compute ssh ${node} -- -A -t -l ${user} -f -N -L ${port}:${ip}:${port} | ||
| " | ||
|
|
||
| module load miniconda | ||
|
|
||
| # DON'T USE ADDRESS BELOW. | ||
| # DO USE TOKEN BELOW | ||
| jupyter-notebook --no-browser --port=${port} --ip=${ip} | ||
|
|
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,27 @@ | ||
| conda_version=4.9.2 | ||
| wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh | ||
| chmod +x /tmp/miniconda.sh | ||
| /tmp/miniconda.sh -b -p /apps/miniconda/$conda_version -f | ||
| /apps/miniconda/$conda_version/bin/conda install jupyter -y | ||
|
|
||
| #conda_version=$( /apps/miniconda/bin/conda --version | awk '{print $2}') | ||
| mkdir -p /apps/modulefiles/miniconda | ||
| bash -c "cat > /apps/modulefiles/miniconda/${conda_version}" << CONDA_MODULEFILE | ||
| #%Module1.0##################################################################### | ||
| ## | ||
| ## modules miniconda/conda_version | ||
| ## | ||
| ## modulefiles/miniconda/conda_version | ||
| ## | ||
| proc ModulesHelp { } { | ||
| global version modroot | ||
| puts stderr "miniconda/$conda_version - sets the environment for miniconda" | ||
| } | ||
| module-whatis "Sets the environment for using miniconda" | ||
| # for Tcl script use only | ||
| set topdir /apps/miniconda/$conda_version | ||
| set version $conda_version | ||
| set sys linux86 | ||
| prepend-path PATH /apps/miniconda/$conda_version/bin | ||
| CONDA_MODULEFILE | ||
|
|