Greetings,
After upgrading to OnDemand 4.0, the .erb job submission scripts stopped processing the statements inside the ruby evaluation tags (<%- -%>). Those were working as intended with OnDemand 3.X. Here is a sample submit.yml.erb script:
batch_connect:
template: “basic”
set_host: “host=$(hostname -A | awk ‘{print $2}’)”
min_port: 8000
max_port: 8999
script:
native:
- “–constraint=jupyter”
- “–mem”
- “<%= memory %>G”
- “–cpus-per-task”
- “<%= cpus %>”
<%- if gpuType == “First” -%>
- “–gres=gpu:<%= gpus %>”
<%- end -%>
<%- if gpuType == “A100” || gpuType == “V100” || gpuType == “L40S” || gpuType == “TITAN_V” -%>
- “–gres=gpu:<%= gpuType %>:<%= gpus %>”
<%- end -%>
- “–time”
- “<%= custom_num_hours %>:00:00”
- “–nodes=1”
- “–mail-type=ALL”
- “–mail-user”
- “<%= slurm_email_address %>”
<%- if num_cores.to_i > 8 || custom_num_hours.to_i > 2 -%>
- “–partition=long”
<%- else -%>
- “–partition=<%= custom_queue %>”
<%- end -%>
Note that variable values like cpu and custom_queue were still being evaluated correctly