Hi,
I’l trying to make some changes to the desktop app, by using dynamic forms, but somehow I can’t make the parameters set in the form to be properly passed onto the submit script. We are running version 2.0.27
This is the current form:
attributes:
bc_num_slots:
default: '4'
label: CPUs
max: '128'
min: '4'
widget: number_field
bc_vnc_idle: 0
bc_vnc_resolution:
required: true
desktop: xfce
memory:
default: '16'
label: Memory (GB)
max: '500'
min: '16'
widget: number_field
gpu:
widget: select
label: "GPU"
options:
- ['No', '0', data-hide-partition: true]
- ['Yes', '1']
partition:
label: "Partition"
widget: select
options:
- ["pascal", "pascal"]
- ["a100", "a100"]
reservation:
label: Especial resource reservation granted by sciCORE (optional)
value: ''
widget: text_field
cluster: scicore
form:
- bc_vnc_idle
- bc_num_slots
- memory
- bc_vnc_resolution
- bc_num_hours
- gpu
- partition
- desktop
- reservation
submit: submit/submit.yml.erb
title: sciCORE Destkop
And the submit script:
<%-
case partition
when "pascal"
slurm_args = ["--gres=gpu:1", "--partition", "pascal"]
when "a100"
slurm_args = ["--gres=gpu:1", "--partition", "a100"]
else
slurm_args = ["--partition", "scicore"]
end
%>
---
batch_connect:
template: "vnc"
script:
native:
- "-n"
- "<%= bc_num_slots.blank? ? 1 : bc_num_slots.to_i %>"
<%- if not reservation.blank? %>
- "--reservation=<% reservation %>"
<%- end %>
<%- if not memory.blank? %>
- "--mem=<%= memory %>G"
<%- end %>
<%- slurm_args.each do |arg| %>
- "<%= arg %>"
<%- end %>
The dynamic form works and partition selection only shows when I ask to use a GPU, but then even if in the POST
request the partition is sent correctly:
batch_connect_session_context[cluster] "scicore"
batch_connect_session_context[bc_num_slots] "4"
batch_connect_session_context[memory] "16"
batch_connect_session_context[bc_num_hours] "1"
batch_connect_session_context[gpu] "1"
batch_connect_session_context[partition] "pascal"
batch_connect_session_context[reservation] ""
commit "Launch"
I always end up on the default non GPU partition, and inspecting the user_defined_context.json
I see that the partition is not correctly passed: partition "#<Enumerator:0x00007fc7188d7228>"
There is surely some detail that I’m missing but after several iterations and attempts I can’t figure it out…
Any pointers or suggestions?
Thanks!