forked from OSC/bc_example_rstudio
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathform.yml.erb
90 lines (90 loc) · 2.54 KB
/
form.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<%-
require 'open3'
begin
#oodqueues = ['ondemand', 'ondemand-p100', 'cryogars']
oodqueues = ['ondemand']
# Command to Run
script = '/cm/shared/apps/slurm/current/bin/sinfo -h --format="%P"'
# Create a partitions array to dynamically populate the queues associated
# with the user
partitions = []
# Store the output, error, status
output, status = Open3.capture2('bash', stdin_data: script)
# puts status
if status.success?
# Add it to the custom_envs array by splitting the output at '\n'.
output.split("\n").each do |queue|
if oodqueues.include?(queue)
queue = queue.gsub("*", "")
partitions.push(queue)
end
end
puts partitions
else
partition_error = "Error"
end
rescue => e
partition_error = e.message.strip
end
-%>
---
cluster:
- "borah"
form:
- bc_num_slots
- bc_num_hours
- bc_vnc_resolution
- custom_queue
- num_cores
- version
- bc_email_on_started
attributes:
bc_num_slots: 1
bc_vnc_resolution:
required: true
version:
widget: select
label: "RStudio version"
help: "This defines the RStudio version you want to load."
options:
- [
"2023.06.1", "2023.06.1",
]
num_cores:
widget: hidden_field
bc_num_hours:
value: 1
min: 1
max: 4
custom_queue:
label: Partition
widget: select
cacheable: false
help: |
- **ondemand** <br>
Standard Borah nodes have 48 cores and 186 GB of memory.
By selecting the "ondemand" partition, you will be given 4 CPU cores.
<%- if partitions.include?("ondemand-p100")-%>
- **ondemand-p100** <br>
These are HPC nodes with 2 [NVIDIA Tesla P100 GPUs], 28 cores, and
251 GB of memory.
By selecting the "ondemand-p100" partition, you will be given 14 cores
and 1 GPU.
[NVIDIA Tesla P100 GPUs]: http://www.nvidia.com/object/tesla-p100.html
<%- end -%>
<%- if partitions.include?("cryogars")-%>
- **cryogars** <br>
This node has 2 [NVIDIA A30 GPUs], 64 cores, and 1 TB of memory.
By selecting the "cryogars" partition, you will be given 32 cores
and 1 GPU.
[NVIDIA A30 GPUs]: https://www.nvidia.com/a30
<%- end -%>
<%- if partition_error || partitions.blank?-%>
<div class="text-danger">Error while fetching Partition. Please contact
support!</div>
<%- else -%>
options:
<%- partitions.each do |q| -%>
- [ "<%= q %>", "<%= q %>" ]
<%- end -%>
<%- end -%>