Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
ssh_scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sofiane Bendoukha
ssh_scripts
Commits
99512ded
Commit
99512ded
authored
8 years ago
by
Mathis Rosenhauer
Browse files
Options
Downloads
Patches
Plain Diff
Put files on mistral in .startvnc sub directory
parent
0ea299eb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
startvnc.sh
+8
-5
8 additions, 5 deletions
startvnc.sh
with
8 additions
and
5 deletions
startvnc.sh
+
8
−
5
View file @
99512ded
...
...
@@ -20,14 +20,16 @@ VNCVIEWER=/usr/bin/vncviewer # <-- Set here the correct path to your
PASSWORD
=
true
# <-- If enabled, the vncpassword will be temporarily copied to the local workstation
# End of user defined variables
ssh
${
USERNAME
}
@mistral.dkrz.de
'cat > vnc_runscript'
<<
'
EOF_runscript
'
ssh
${
USERNAME
}
@mistral.dkrz.de
'mkdir -p .startvnc'
ssh
${
USERNAME
}
@mistral.dkrz.de
'cat > .startvnc/vnc_runscript'
<<
'
EOF_runscript
'
#!/bin/bash
cd "
${
0
%/*
}
"
ACCTCODE=
$1
GEOMETRY=
$2
TIME=
$3
QOS=
$4
JOBSCRIPT=
$(
mktemp
job.XXXXX
)
LOGFILE=
$(
mktemp
out.XXXXX
)
JOBSCRIPT=
vnc.job
LOGFILE=
vnc.out
(
cat <<EOF
#!/bin/bash
...
...
@@ -37,6 +39,7 @@ cat <<EOF
#SBATCH --time=
$TIME
#SBATCH --account=
$ACCTCODE
#SBATCH --output=
$LOGFILE
/opt/TurboVNC/bin/vncserver -fg -geometry
$GEOMETRY
EOF
) >
$JOBSCRIPT
...
...
@@ -52,7 +55,7 @@ echo $JOB_ID $VNC_HOST_DISPLAY $LOGFILE $XVNC_PID
EOF_runscript
declare
-a
VARS
VARS
=(
$(
ssh
${
USERNAME
}
@mistral.dkrz.de
"/bin/bash vnc_runscript
$ACCTCODE
$GEOMETRY
$TIME
$QOS
"
)
)
VARS
=(
$(
ssh
${
USERNAME
}
@mistral.dkrz.de
"/bin/bash
.startvnc/
vnc_runscript
$ACCTCODE
$GEOMETRY
$TIME
$QOS
"
)
)
JOB_ID
=
${
VARS
[0]
}
VNC_HOST_DISPLAY
=
${
VARS
[1]
}
LOGFILE
=
${
VARS
[2]
}
...
...
@@ -72,7 +75,7 @@ ssh ${USERNAME}@mistral.dkrz.de "ssh ${USERNAME}@$VNC_HOST \"kill $XVNC_PID\"" 2
# Clean up temp files and cancel job
RM_FILES
=
"
$LOGFILE
${
LOGFILE
}
_DKRZepilog vnc_runscript"
ssh
${
USERNAME
}
@mistral.dkrz.de
"scancel
$JOB_ID
; sleep 1; rm -f
$RM_FILES
"
2> /dev/null
ssh
${
USERNAME
}
@mistral.dkrz.de
"scancel
$JOB_ID
; sleep 1;
cd .startvnc &&
rm -f
$RM_FILES
"
2> /dev/null
# Remove local vnc PasswordFile
if
[
"
$PASSWORD
"
=
true
]
;
then
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment