-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubmit.yml.erb
76 lines (73 loc) · 2.11 KB
/
submit.yml.erb
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<%-
cores = bc_num_cores.blank? ? 1 : bc_num_cores.to_i
mem = bc_memory.blank? ? 1 : bc_memory.to_i
nodes = bc_num_slots.blank? ? 1 : bc_num_slots.to_i
begin
cmd = "rpm -E %{rhel}"
output, status = Open3.capture2e(cmd)
if status.success?
rhel_version = output.strip.to_s
case rhel_version
when "7"
image = "/work/HCC/APPTAINER/IMAGES/xfce_el7.sif"
when "8"
image = "/work/HCC/APPTAINER/IMAGES/xfce_el8.sif"
end
else
raise output
end
rescue => e
image = "/work/HCC/APPTAINER/IMAGES/xfce_el7.sif"
end
%>
---
batch_connect:
template: vnc
set_host: "host=$(hostname)"
websockify_cmd: '/usr/bin/websockify'
script_wrapper: |
export WORK=${HOME/#\/home/\/work}
export COMMON=${HOME/#\/home/\/common}
export NRDSTOR=${HOME/#\/home/\/mnt/nrdstor}
export APPTAINER_CACHEDIR=${WORK}/.apptainer
export REGISTRY="hcc-docker-registry.unl.edu"
cat << "CTRSCRIPT" > container.sh
export PATH="${PATH}:/opt/TurboVNC/bin:/util/opt/bin"
export XFCE_ROOT="/"
touch $HOME/.cache/sessions/xfce4-session-`hostname`:1
%s
CTRSCRIPT
# https://github.com/hpcng/singularity/issues/5185
cat << "BASE" > /tmp/99-base.sh
if [ -z "${LD_LIBRARY_PATH}" ]; then
LD_LIBRARY_PATH="/.singularity.d/libs"
else
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/.singularity.d/libs"
fi
export LD_LIBRARY_PATH
export PS1="[\u@\h \W]\$ "
BASE
chmod +x /tmp/99-base.sh
export APPTAINER_BINDPATH="${TMPDIR}:/tmp,/home,/work,/common,/util,/media,/mnt,/srv,/var/run,/run,/tmp/99-base.sh:/.singularity.d/env/99-base.sh:ro"
apptainer exec <%= image %> /bin/bash container.sh
script:
# Slurm option is mem, memory is passed from the form
copy_environment: true
email: ["<%= bc_email_address.strip %>"]
native:
- "--qos"
- "<%= qos_type %>"
- "--mem"
- "<%= mem %>GB"
- "--licenses"
- "common"
- "--ntasks-per-node"
- "<%= cores %>"
- "--nodes"
- "<%= nodes %>"
- "--constraint"
- "<%= bc_constraint.strip %>"
- "--gres"
- "<%= bc_gres.strip %>"
- "--reservation"
- "<%= bc_reservation.strip %>"