Problems with dynamic widget data-option-for-cluster

I have data-max-bc-num-slots working as expected on a per-cluster basis so Dynamic Widgets seem to be enabled. However, I can’t get data-option-for-cluster-XXX to have any discernible effect. It could be I’m using it wrong, but from the documentation, this seems like this should work.

Goal: On cluster cougar, do not list r2020b as a Matlab version option.
form.yml first few lines:

,,,
attributes:
  cluster:
    widget: "select"
    options:
      - [ "Cougar Cluster", "cougar", data-max-bc-num-slots: 94 ]

  modules: "matlab"

  version:
    widget: select
    label: "Matlab GUI version"
    help: "This defines the version of the application you want to use"
    options:
      - [ "Default", "default" ]
      - [ "R2022a", "r2022a" ]
      - [ "R2020b", "r2020b", data-option-for-cluster-cougar: false ]
      - [ "R2020a", "r2020a" ]

...

When I use this form, all 3 drop down entries are present on cluster cougar, despite the “data-option”.
Can someone tell me what I’m doing wrong here? I did a Help->restart web server after changing the form, but that also made no difference.

Thanks,
Ric

You’re only showing a partial of the form. You didn’t happen to use id in the cluster attributes did you? changing the id will break this feature.

attributes:
  cluster:
    id: this_will_break_dynamic_bc
    widget: "select"
    options:
      - [ "Cougar Cluster", "cougar", data-max-bc-num-slots: 94 ]

No ID, and, as stated,“data-max-bc-num-slots” works as expected. If Dynamics were disabled, I’d expect that to fail as well as “data-option-for-cluster-cougar”. In any case, here’s all of form.yml:

# Matlab GUI submission file.
#
---
form:
  - cluster
  - modules
  - version
  - bc_num_hours
  - bc_num_slots
  - ua_mem_per_core
  - gpucount
  - bc_account
  - ua_queue
  - bc_vnc_resolution

attributes:
  cluster:
    widget: "select"
    options:
      - [ "Cougar Cluster", "cougar", data-max-bc-num-slots: 94 ]

  modules: "matlab"

  version:
    widget: select
    label: "Matlab GUI version"
    help: "This defines the version of the application you want to use"
    options:
      - [ "Default", "default" ]
      - [ "R2022a", "r2022a" ]
      - [ "R2020b", "r2020b", data-option-for-cluster-cougar: false ]
      - [ "R2020a", "r2020a" ]

  bc_num_hours:
    label: "Run Time"
    help: "Enter maximum number of wall clock hours the job is allowed to run."
    widget: "number_field"
    value: 1

  bc_num_slots:
    label: "Core count on a single node"
    help: "Enter the number of cores on a single node that the job is allowed to use."
    widget: "number_field"
    value: 1
    min: 1

  ua_mem_per_core:
    label: "Memory per core"
    help: "Enter the number of Gigabytes of RAM needed per core."
    widget: "number_field"
    value: 4
    min: 4

  bc_account:
    label: "PI Group"
    help: "Enter an HPC PI group to be charged for time used."

  ua_queue:
    label: "Queue"

    help: "Please select a queue from the drop-down above; we <B>STRONGLY</B> recommend <B>AGAINST</B> using <B>windfall</B> here."
    widget: select
    options:
      - [ "High Priority", "high_pri" ]
      - [ "Standard", "standard" ]
      - [ "Windfall", "windfall" ]
      - [ "Qualified Special Projects", "qualified" ]
    value: "standard"

  gpucount:
    label: "GPUs required"
    help: "Enter number of gpus needed per node, if any."
    widget: "number_field"
    value: 0
    min: 0
    max: 4

I cannot replicate on version 2.0.29. R2020b is hidden on page load for me on both chrome and firefox.

What version of OnDemand are you on? We’ve been patching dynamic javascript like crazy over the past 6-12 months. I spot checked the commit history and this hasn’t changed that much, so I’m not quite sure what bug you may be running into and if we’ve patched it or what.

$ rpm -q ondemand
ondemand-2.0.29-1.el7.x86_64
on both my ood servers, and both seem to ignore the “data-option-for-cluster-XXX” option. I also tried with a private browsing page in case there was browser side cache doing something rude.

Any debug or trace or ?? that I could turn on? If there is, where would that write the output?

It’d be in your browsers console log if there were errors. Looks like in 2.0 we minify the javascript so it’d be very hard to set a breakpoint (because all the variables are single characters).

I wonder if there’s a browser plugin that’s interfering. Have you tried a different browser?

Also to be clear - in the first message, you state 3 options are shown. I see 3 out of 4 options being shown.

What I’m seeing below is what you’re expecting correct?

Sigh, off by 1 again! All 4 of the options (Default, R2022a, R2020b, R2020a) are in the drop down for me. I don’t have any browser add ins at all.

Failure observed on MacOS Ventura 13.1, with Safari 16.2 (18614.3.7.1.5) on an M1 Macbook Pro. I just tried Firefox 109.0.1 on the same system, and the dropdown works as expected. Testing on an x86 Mac with same versions of software shows same result.

So this is some kind of Safari Browser behavior problem, at least for me.

Nothing is visible in the Safari->Develop->Show javascript console.
Ric

Had a coworker try the same test - shows all 4 dropdown items in Safari, where as Firefox obeys the “data-option-for-cluster-XXX” option

Thanks. There must be some bug on our side with regards to Safari.

I filed a bug upstream. I’ll try to work on it best I can, but I’m a PC so I need to figure out how to debug on a Mac.

If there’s something you want me to try, drop me a note.
Ric

Thanks, I appreciate it but it’s javascript development at this point so a bit burdensome. If you have any javascript developers with a Mac, pull requests welcome! :laughing:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.