Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic widget not working as expected #3669

Closed
mani91-ug opened this issue Jul 11, 2024 · 2 comments
Closed

Dynamic widget not working as expected #3669

mani91-ug opened this issue Jul 11, 2024 · 2 comments
Milestone

Comments

@mani91-ug
Copy link

mani91-ug commented Jul 11, 2024

I have the following form.yml file:

cluster: "my_cluster"

submit: "submit/submit.yml.erb"

form:
  - extra_jupyter_args
  - bc_account
  - partition
  - bc_num_hours
  - bc_num_slots
  - num_cores
  - mem
  - bc_email_on_started

attributes:
  extra_jupyter_args: ""
  partition:
    label: "Partition"
    widget: select
    options:
       - [
          "HB120v2","HB120v2",
          data-max-num-cores: 120,
          data-max-mem: 456,
         ]
       - [
          "HB120v2Spot","HB120v2Spot",
          data-max-num-cores: 120,
          data-max-mem: 456,
         ]
       - [
          "HB120v3","HB120v3",
          data-max-num-cores: 120,
          data-max-mem: 456,
         ]
       - [
          "HB120v3Spot","HB120v3Spot",
          data-max-num-cores: 120,
          data-max-mem: 456,
         ]
       - [
          "HC44","HC44",
          data-max-num-cores: 44,
          data-max-mem: 352,
         ]
       - [
          "HC44Spot","HC44Spot",
          data-max-num-cores: 44,
          data-max-mem: 352,
         ]
  bc_num_slots: 1
  num_cores:
    label: "Number of cores"
    widget: number_field
    help: "Total number of cores for job, note that only one node can be provisioned"
    max: 44
    min: 1
    step: 1
    value: 1
  mem:
    label: "Amount of memory/GiB"
    widget: number_field
    help: "Total memory available to job"
    max: 352
    min: 1
    step: 1
    value: 1

Despite the use of 'data-max' in the 'partition' attribute's options, num_cores and mem stay fixed at 44 and 352 when I change to the options which allow 120 cores and 456 GiB memory.

I'm using the latest release of OOD.

Is there something incorrect in my form.yml?

@osc-bot osc-bot added this to the Backlog milestone Jul 11, 2024
@johrstrom
Copy link
Contributor

I can't replicate, it works for me as expected. I suspect you haven't enabled dynamic batch connect settings and since you've set the defaults to 44 and 352, they stay that way.

https://osc.github.io/ood-documentation/latest/reference/files/ondemand-d-ymls.html#bc-dynamic-js

@mani91-ug
Copy link
Author

That appeared to do the trick, I created the directory /etc/ood/config/ondemand.d/ and placed a file called interactiveForms.yml with the contents:

bc_dynamic_js: true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants