Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
CLASS-HPC-GCP/slurm-gcp/examples/jupyter_launch.slrm
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
30 lines (25 sloc)
695 Bytes
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
#!/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} | |