[solved] Not able to change widget for bc_queue (in bc_desktop app config)

when I’m trying to let user select queue name from drop-down widget aka “select”, I’m not able to do it with the default attribute bc_queue.

Example:

/etc/ood/config/apps/bc_desktop/(redacted).yml:

when using custom attribute (bc_queue1) - works as expected - I can see the “select” widget and select “cpu” or “gpu” partition:

attributes:
    bc_account: ''
    bc_email_on_started: 0
    bc_num_slots: 1
    desktop: xfce
    bc_queue1:
      label: Slurm partition
      widget: "select"
      value: "cpu"
      options:
        - ["normal","cpu"]
        - ["GPU","gpu"]
cluster: (redacted)
title: Cluster Desktop
form:
  - bc_queue1

when I’m using default attribute name (bc_queue instead of bc_queue1 above ):

attributes:
    bc_account: ''
    bc_email_on_started: 0
    bc_num_slots: 1
    desktop: xfce
    bc_queue:
      label: Slurm partition
      widget: "select"
      value: "cpu"
      options:
        - ["normal","cpu"]
        - ["GPU","gpu"]
cluster: (redacted)
title: Cluster Desktop
form:
  - bc_queue

i see just standard textbox and the select widget is ignored.

Is there any good reason for that?
Isn’t that bug?

Indeed I’d prefer to use default attribute name because otherwise I’d be forced to use patched bc_desktop. This is indeed not un-doable but I like to be aligned with upstream and not letting every dnf update break my setup.

cheers from Prague.

ok, the solution was to create custom attribute of required type.
So to modify bc_desktop config /etc/ood/config/apps/bc_desktop/(redacted).yml:

attributes:
    bc_account: ''
    bc_email_on_started: 0
    bc_num_slots: 1
    bc_queue: null
    desktop: xfce
    slurm_partition:
      label: Slurm partition
      widget: "select"
      value: "cpu"
      options:
        - ["normal","cpu"]
        - ["GPU","gpu"]
cluster: (redacted)
title: Cluster Desktop
form:
  - slurm_partition
  - bc_vnc_idle
  - desktop
  - bc_account
  - bc_num_hours
  - bc_num_slots
  - node_type
  - bc_queue
  - bc_vnc_resolution
  - bc_email_on_started

submit: "submit/my_submit.yml.erb"

and create /etc/ood/config/apps/bc_desktop/submit/my_submit.yml.erb containing:

---
script:
  queue_name: <%= slurm_partition %>
  native:
   - "-N"
   - "<%= bc_num_slots.blank? ? 1 : bc_num_slots.to_i %>"

works. :slight_smile:

bc_queue is hard coded to be just a text field. We can change that so that you can override it (we just did it with bc_account because it was hard coded too).

That said - we’re also looking into auto populating partition information. Do you only have those 2 partitions?

See here for more info on that.

I have more partitions at my cluster(s), but to bc_desktop users, only ‘gpu’ and ‘cpu’ partititions are relevant - other partitions are just defining different (worse) QoS.

Thanks, the trick there presented by @Micket with apps/dashboard/initializers/ood.rb is really nice.

It could be really useful to us to present eg. available Lmod/Easybuild software modules / conda environments, etc. to user in OOD gui. I have already one open request to implement conda/venv “bring-your-own” jupyterlab environment (conda+venv) so this can help me avoid hardcoding things into our Ansible.

This is coming in 2.1. You can the features currently in nightly: Features Currently in 2.1 Nightly · Issue #1780 · OSC/ondemand · GitHub

Where? With us?

Ah, sorry for possibly unclear wording.
I meant request of my user at my system, so it’s up to me to fix that and thanks to your hint above, I know how!