Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account select #5

Merged
merged 2 commits into from
Jan 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions form.yml → form.yml.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<%-
groups = OodSupport::User.new.groups.sort_by(&:id).tap { |groups|
groups.unshift(groups.delete(OodSupport::Process.group))
}.map(&:name).grep(/^P./)
-%>
---
cluster:
- "owens"
- "owens-slurm"
form:
- version
- bc_account
- account
- bc_num_hours
- bc_num_slots
- num_cores
Expand All @@ -26,9 +30,13 @@ attributes:
bc_num_slots: "1"
bc_vnc_resolution:
required: true
bc_account:
account:
label: "Project"
help: "You can leave this blank if **not** in multiple projects."
widget: select
options:
<%- groups.each do |group| %>
- "<%= group %>"
<%- end %>
node_type:
widget: select
label: "Node type"
Expand Down
10 changes: 1 addition & 9 deletions submit.yml.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<%-
ppn = num_cores.blank? ? 28 : num_cores.to_i
nodes = bc_num_slots.blank? ? 1 : bc_num_slots.to_i

torque_cluster = OodAppkit.clusters[cluster].job_config[:adapter] == 'torque'
partition = []

if node_type == 'hugemem'
Expand All @@ -12,19 +10,13 @@
end

slurm_args = partition + [ "--nodes", "#{nodes}", "--ntasks-per-node", "#{ppn}", "--licenses", "stata@osc" ]
torque_args = node_type == 'any' ? "#{nodes}:ppn=#{ppn}" : "#{nodes}:ppn=#{ppn}:#{node_type}"
%>
---
batch_connect:
template: vnc
script:
accounting_id: "<%= account %>"
native:
<%- if torque_cluster %>
resources:
nodes: "<%= torque_args %>"
software: "stata"
<%- else %>
<%- slurm_args.each do |arg| %>
- "<%= arg %>"
<%- end %>
<%- end %>