Using sacctmgr to get max cores and max mem for an account

auto_accounts could work for you, up to a point. It’s dynamic WRT to clusters and qos (I think we’re lacking queues?), but won’t set min and max cpus.

If it were me - I would use auto_accounts to populate accounts then use data-min and data-max attributes to set mins and maxes.

https://osc.github.io/ood-documentation/latest/how-tos/app-development/interactive/dynamic-form-widgets.html?#dynamic-min-and-maxes

Lastly - if you have to write Ruby to do query Slurm you should write it in an initializer because those form.yml.erb files are rendered a lot (I mean they’re read & rendered even without hitting that specific page) so embedding too much ruby (or ruby that queries other systems) is going to cause issues for your site.