-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart_notebook.sh
More file actions
executable file
·43 lines (35 loc) · 1.04 KB
/
start_notebook.sh
File metadata and controls
executable file
·43 lines (35 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
set -euo pipefail
PORT=${1-1729}
# We need to create a reverse tunnel from the
# compute node to the login node.
if [[ "${HOSTNAME}" == "licca047" ]]; then
function cleanup() {
echo "Killing process with ID ${PROXY_PID}..."
kill "${PROXY_PID}"
}
REMOTE=licca020
# Forward the port back to the login node.
ssh -N -R "${PORT}:localhost:${PORT}" "${REMOTE}" &
# Remember the PID
PROXY_PID=$!
# At the end of this script, terminate the SSH forwarding.
trap cleanup EXIT
fi
if [[ "${HOSTNAME}" == "licca047" ]]; then
SERVER="${USER}@licca-li-02.rz.uni-augsburg.de"
elif [[ "${HOSTNAME}" == *".rc.ucl.ac.uk" ]]; then
# Fibonacci or Mandelbrot
SERVER="${HOSTNAME}"
export JULIAUP_CHANNEL=1.11 # Make sure we use the right channel
export JULIA_NUM_THREADS=16
fi
echo "On your local machine run
ssh -f -N ${SERVER} -L ${PORT}:localhost:${PORT}
"
julia --project -e "
import Pkg
Pkg.instantiate()
import Pluto
Pluto.run(; launch_browser=false, port=${PORT}, auto_reload_from_file=true)
"