I’m trying to implement a drop-down menu of possible slurm constraints to ask for in our RStudio OnDemand app, but I’d like to make it optional. Setting required: false didn’t help. Not every user would want to specify constraints in a job submission, but drop down seems the best option so they can see a list of available options. Is there a null or none option value? If were to add a blank option, how would I handle it in my submit.yml.erb?
form.yml
constraint:
required: false
widget: “select”
label: “Constraint:”
help: Select which constraint you would like to specify from the drop-down.
options:
- [“sha”, “sha”]
- [“wsu”, “wsu”]
- [“sfx”, “sfx”]
- [“hax”, “hax”]
- [“dad”, “dad”]
- [“smt”, “smt”]
- [“rom”, “rom”]
- [“asx”, “asx”]
- [“pcc”, “pcc”]
- [“asx”, “asx”]
- [“intel”, “intel”]
- [“amd”, “amd”]
- [“avx”, “avx”]
- [“avx2”, “avx2”]
- [“highmem”, “highmem”]
id: ‘constraint’
submit.yml.erb
script:
email: <%= ENV[“USER”] %>@xxxx.com
wall_time: <%= (bc_num_hours.blank? ? 1 : bc_num_hours.to_i) * 3600 %>
native:
- “-J”
- “OnDemand:RStudio”
- “-q”
- “<%= qos %>”
- “-N”
- “1”
- “–constraint=<%= constraint %>”
- “-n”
- “<%= cores_number %>”
- “–mem=<%= memory_amount %>G”
- “-t”
- “<%= (bc_num_hours.blank? ? 1 : bc_num_hours.to_i) * 60 %>”