Skip to content

Commit cb60d72

Browse files
committed
Add script to connect to the simulation beamline.
inc.: get load balancer IP addresses as no DNS name for simulation services forward local ports to the load balancer to access services from workstation launch phoebus GUI to view engineering screens provided by epics-pvcs service over http kill the ssh tunnel process forwarding the ports when phoebus is closed
1 parent 4aa121f commit cb60d72

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

t01-launch.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
THIS_DIR=$(dirname "$(readlink -f "$0")")
3+
4+
# exit on error
5+
set -e
6+
7+
# load the argus to talk to user's FEDID namespace in the Argus cluster (kubectl)
8+
module load argus
9+
10+
# setup an ssh tunnel to the gateways and opis services
11+
gateways=$(kubectl get svc t01-epics-gateways --output jsonpath='{.status.loadBalancer.ingress[0].ip}')
12+
opis=$(kubectl get svc t01-epics-opis --output jsonpath='{.status.loadBalancer.ingress[0].ip}')
13+
sock="$HOME/.ssh/cm-%r@%h:%p"
14+
ssh -fNM -S "$sock" -L 9064:$gateways:9064 -L 9075:$gateways:9075 -L 8099:$opis:80 $HOSTNAME
15+
16+
# instruct shell to kill the ssh tunnel when done
17+
SSH_PID=$(ssh -S "$sock" -O check $HOSTNAME 2>&1 | sed -n 's/.*pid=\([0-9]\+\).*/\1/p')
18+
trap 'kill $SSH_PID' EXIT
19+
20+
# use the phoebus launcher script to start the GUI
21+
$THIS_DIR/opi/phoebus-launch.sh

0 commit comments

Comments
 (0)