Commit a96e50ef authored by Mathis Rosenhauer's avatar Mathis Rosenhauer

start-vnc: support other partitions

parent 6c86102e
......@@ -85,6 +85,9 @@ SVNC_RUNTIME=240
# set to the integer number of nodes.
SVNC_NODES="half"
# Partition for the job
SVNC_PARTITION="gpu"
# Quality of service
SVNC_QOS="normal"
......@@ -159,6 +162,7 @@ Available values for OPTION include:
-A acctcode acctcode of job
-C list constraint for feature selection
-n nodes number of nodes
-p partition run job on partition
-q qos job qos
-s options addidtional options for vncserver
-t time job runtime
......@@ -180,7 +184,7 @@ ssh_frontend () {
parse_options () {
local option
while getopts 'A:C:n:q:s:t:u:v:x:' option; do
while getopts 'A:C:n:p:q:s:t:u:v:x:' option; do
case ${option} in
A) SVNC_ACCTCODE="$OPTARG"
;;
......@@ -188,6 +192,8 @@ parse_options () {
;;
n) SVNC_NODES="$OPTARG"
;;
p) SVNC_PARTITION="$OPTARG"
;;
q) SVNC_QOS="$OPTARG"
;;
s) SVNC_SERVER_OPTIONS="$OPTARG"
......@@ -209,6 +215,7 @@ parse_options () {
readonly SVNC_ACCTCODE
readonly SVNC_CONSTRAINT
readonly SVNC_SERVER_OPTIONS
readonly SVNC_PARTITION
readonly SVNC_QOS
readonly SVNC_RUNTIME
readonly SVNC_USERNAME
......@@ -244,7 +251,7 @@ submit_vnc_job () {
ssh_frontend "cd .startvnc && sbatch" <<EOF
#!/bin/bash -l
#SBATCH --job-name=vncserver
#SBATCH --partition=gpu
#SBATCH --partition=${SVNC_PARTITION}
#SBATCH --constraint=${SVNC_CONSTRAINT}
${sbatch_resources}
#SBATCH --qos=${SVNC_QOS}
......@@ -301,9 +308,10 @@ main () {
local vnc_port_remote=$(( 5900 + vnc_display ))
until ssh -o ForwardX11=no \
-o StrictHostKeyChecking=ask \
-o ProxyCommand="ssh ${SVNC_USERNAME}@${SVNC_FRONTEND_HOST} nc ${vnc_host} 22" \
-L "${vnc_port_local}:localhost:${vnc_port_remote}" \
-Nf \
"${SVNC_USERNAME}@${vnc_host}.dkrz.de"; do
"${SVNC_USERNAME}@${vnc_host}"; do
vnc_port_local=$((5900 + RANDOM % 100))
echo "Trying local port ${vnc_port_local}."
done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment