-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathform.yml.erb
141 lines (134 loc) · 3.59 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<%-
# get _list_partitions
p_cmd = "sinfo -ho %R | sort -u"
begin
output, status = Open3.capture2e(p_cmd)
if status.success?
_list_partitions = output.split("\n").map(&:strip).reject(&:blank?).sort
else
raise output
end
rescue => e
_list_partitions = []
p_error = e.message.strip
end
# get tensorboard modules
m_cmd = "bash -il -c 'module -t avail tensorboard 2>&1 | grep tensorboard' 2>/dev/null"
begin
output, status = Open3.capture2e(m_cmd)
if status.success?
_list_tf_versions = output.split("\n").map(&:strip).reject(&:blank?).sort
else
raise output
end
rescue => e
_list_tf_versions = []
m_error = e.message.strip
end
-%>
---
cluster: "alvis1"
form:
- tb_logdir
- tb_extra_args
- tb_runtime
#- sh_tf_version
#- sh_modules
#- sh_partition
#- sh_cpus
#- sh_gpus
#- sh_mem
#- bc_num_hours
#- bc_email_on_started
attributes:
tb_logdir:
widget: "path_selector"
label: "Tensorboard logdir"
required: true
data-filepicker: true
data-target-file-type: dirs # Valid values are: files, dirs, or both
help: "The directory that contains data to visualize."
tb_extra_args:
label: "Additional TensorBoard arguments (optional)"
tb_runtime:
widget: "select"
label: "Runtime"
options:
System provided:
<% glob_prettify_lookup(["/apps/portal/tensorboard/*.sh"]).each do |pretty_path, path| %>
- [ "<%= pretty_path %>", "<%= path %>" ]
<% end %>
User provided:
- [ "~/portal/tensorboard/*.sh", "x", disabled: true ]
<% glob_prettify_lookup(["#{Dir.home}/portal/tensorboard/*.sh"]).each do |pretty_path, path| %>
- [ "<%= pretty_path %>", "<%= path %>" ]
<% end %>
# sh_tf_version:
# label: "Tensorboard version"
# <%- if m_error -%>
# <span class="text-danger">Error when parsing module versions:</span>
# ```
# <%= m_error.gsub("\n", "\n ") %>
# ```
# <%- end -%>
# <%- if _list_tf_versions.blank? -%>
# widget: text_field
# <%- else -%>
# widget: select
# options:
# <%- _list_tf_versions.each do |q| -%>
# - [ "<%= q %>", "<%= q %>" ]
# <%- end -%>
# <%- end -%>
#
# sh_modules:
# label: "Additional modules (optional)"
# help: |
# <small>Space separated list of additional modules to load (eg. `py-numpy/1.17.2_py36`)</br/>
# Full list at https://www.sherlock.stanford.edu/docs/software/list </small>
#
# sh_partition:
# label: "Partition"
# value: "dev"
# required: true
# help: |
# <small>Partition to submit the job to</small>
# <%- if p_error -%>
# <span class="text-danger">Error when parsing partitions:</span>
# ```
# <%= p_error.gsub("\n", "\n ") %>
# ```
# <%- end -%>
# <%- if _list_partitions.blank? -%>
# widget: text_field
# <%- else -%>
# widget: select
# options:
# <%- _list_partitions.each do |q| -%>
# - [ "<%= q %>", "<%= q %>" ]
# <%- end -%>
# <%- end -%>
#
# sh_cpus:
# label: "#CPUs"
# widget: "number_field"
# help: "<small>Number of CPU cores to allocate</small>"
# required: true
# min: 1
# value: "1"
#
# sh_gpus:
# label: "#GPUs (optional)"
# widget: "number_field"
# help: "<small>Number of GPUs to allocate (don't forget to load the `cuda` module in the `Modules` field above and to select a partition with GPUs)</small>"
# min: 1
# max: 8
# value: ""
#
# sh_mem:
# label: "Memory (GB) (optional)"
# widget: "number_field"
# help: "<small>Amount of memory to allocate</small>"
#
# bc_num_hours:
# label: "Runtime (in hours)"