Issue with unhiding of elements using dynamic batchconnect

Hi using ood version 2.0.27-1. The issue I have is that I cannot seem to have elements initially hidden and then unhidden consistently. I had this working with custom JS, but I wanted to see if I could create equivalent functionality with the new dynamic JS. The new form.yml.erb is included below.

So for example if the default interactive partition is selected then elements for qos, cuda_version, num_gpus should all be hidden. However, if the gpu or gpu-test partitions are selected then the cuda_version, and num_gpus elements should be exposed. They are not. Likewise if the partition is set to contrib then the qos element should be unhidden and it is not.

If I set all of these elements to be unhidden in the default partition selection, then they will be correctly hidden when selecting the partitions where they are supposed to be hidden, however they will not be unhidden when selecting the elements for which data-hide-: false is defined.

I see the same behaviour with the instance selection. The desired behaviour is for the num_cores and memtask elements to be hidden unless a “Custom” instance size is selected, however this also does not seem to work.

Possibly I am missing something fundamental. Any suggestions or hints gratefully accepted.

Regards,

-Alastair

# Batch Connect app configuration file
#
# @note Used to define the submitted cluster, title, description, and
#   hard-coded/user-defined attributes that make up this Batch Connect app.
---
cluster: "HOPPER"
attributes:
  modules: "hosts/hopper python/3.8.6-ff julia/1.5.2-3z"
  modules_gpu: "hosts/hopper python/3.8.6-ff"
  modules_test: "python/3.9.9-jh"
#  extra_jupyter_args: "--notebook-dir=/scratch/${USER}"
  qos:
    label: "Quality of Service (Qos)"
    value: "interactive"
  num_gpus:
    widget: "number_field"
    label: "Number of A100 GPUs"
    value: 1
    min: 1
    max: 1
    step: 1
    help: |
      By default 1 A100 GPU will be allocated.
  cuda_version:
    label: "CUDA Version"
    value: ""
    help: |
      The module version of Cuda you wish to use, if blank the default cuda will be used
  part:
    widget: "select"
    label: "Partition"
    default: "Interactive"
    help: |
      This defines the partition/queue you wish to submit the job to. The default is
      the interactive partition.  The **Contrib** partition requires specifying a QoS
      (quality of service) parameter to authorise access.
      When specifying a partition other than the interactive partition please select
      **Custom** from the instance type menu, and specify the resources required.
    options:
      - [
          "Interactive", "interactive",
          data-min-num-cores: 2,
          data-max-num-cores: 12,
          data-hide-qos: true,
          data-set-qos: 'interactive',
          data-hide-num-gpus: true,
          data-hide-cuda-version: true
        ]
      - [
          "Contrib", "contrib",
          data-min-num-cores: 2,
          data-max-num-cores: 48,
          data-hide-qos: false,
          data-hide-num-gpus: true,
          data-hide-cuda-version: true
        ]
      - [
          "Gpuq", "gpuq",
          data-min-num-cores: 2,
          data-max-num-cores: 18,
          data-hide-qos: true,
          data-set-qos: 'gpu',
          data-hide-num-gpus: false,
          data-hide-cuda-version: false
        ]
      - [
          "Gpu-test", "gpu-test",
          data-min-num-cores: 2,
          data-max-num-cores: 28,
          data-hide-qos: true,
          data-set-qos: 'gpu-test',
          data-hide-num-gpus: false,
          data-hide-cuda-version: false
        ]
      - [
          "Amd-test", "amd-test",
          data-min-num-cores: 2,
          data-max-num-cores: 64,
          data-hide-qos: true,
          data-set-qos: 'amd-test',
          data-hide-num-gpus: true,
          data-hide-cuda-version: true
        ]
  bc_num_hours:
    widget: "number_field"
    label: "Time limit in hours."
    value: 1
    min: 1
    step: 1
    max: 12
    help: |
      A maximum of 12 hours are permitted on Hopper-Interactive. The default is 1 hours.
  num_cores:
    widget: "number_field"
    label: "Number of Cores"
    value: 2
    min: 2
    step: 1
    help: |
      By default 2 cores will be allocated. A maximum of 12 cores are permitted on Hopper-Interactive.
  memtask:
    widget: "select"
    value:  "default"
    label:  "Required Memory"
    help: |
      **default** 2 GB per core.
      Select a value to request a set total amount of
      memory independent of the number of cores requested.
      The maximum memory permitted is 48 GBytes per job on
      Hopper-Interactive.
    options:
      - [ "2GB/core", "2" ]
      - [ "16 GB", "16" ]
      - [ "32 GB", "32" ]
      - [ "48 GB", "48" ]
      - [ "64 GB", "64" ]
      - [ "128 GB","128" ]
      - [ "MAX", "178" ]
  instance:
    widget: "select"
    value: "default"
    label: "Instance Size"
    help: |
      Select the size of Jupyter Lab Instance you would like
      the options are small, medium or large with 2,4 and 8
      cores respectively, and 2 GB per core.
      Alternatively select "Custom" and choose memory and core
      counts separately.
      The default is **small** - 2 core and 4 GB or memory
    options:
      - [
          "Default", "Small",
          data-hide-memtask: true,
          data-hide-num-cores: true,
          data-set-num-cores: 2,
          data-set-memtask: 2
        ]
      - [
          "Small", "Small",
          data-hide-num-cores: true,
          data-hide-memtask: true,
          data-set-num-cores: 2,
          data-set-memtask: 2
        ]
      - [
          "Medium", "Medium",
          data-hide-num-cores: true,
          data-hide-memtask: true,
          data-set-num-cores: 4,
          data-set-memtask: 2
        ]
      - [
          "Large", "Large",
          data-hide-num-cores: true,
          data-hide-memtask: true,
          data-set-num-cores: 8,
          data-set-memtask: 2
        ]
      - [
          "Custom", "Custom",
          data-hide-num-cores: false,
          data-hide-memtask: false
        ]
  bc_account:
    label: "Account"
    value: ""
form:
  - modules
  - modules_gpu
  - modules_test
  - cuda_version
  - extra_jupyter_args
  - part
  - num_gpus
  - qos
  - bc_num_hours
  - instance
  - num_cores
  - memtask
  - bc_email_on_started

There’s a lot going on here, so I’ll have to pull this down and see what’s going on.

Get rid of all the the hide directives that are false. data-hide-something: false This is the default - things are shown - so there’s no need to set it.

Indeed there must be a bug when it is set.

Thanks Jeff,

Sorry for the slow reply I have been out sick this week. I just tested your suggestion and that was precisely the issue. It all works as expected now - great work this removes the need for 150 lines of custom javascript!

Many Thanks
-Alastair