OSC / puppet-module-openondemand

0 stars 16 forks source link

support ondemand.d directory and related configurations #54

Closed johrstrom closed 3 years ago

johrstrom commented 3 years ago

I'm not sure if puppet already supports these, but here are 2 new things to support in 2.0.

Add support for pinning apps https://osc.github.io/ood-documentation/latest/customization.html#pinning-applications-to-the-dashboard

and customizing the dashboard https://osc.github.io/ood-documentation/latest/customization.html#custom-layouts-in-the-dashboard

treydock commented 3 years ago

@johrstrom Is there is any schema file that defines what possible values there are for those two configurations? Or does the OnDemand docs contain all possible keys? I would imagine for the dashboard layout the values for widgets can be anything if a site deploys custom widgets. Really just knowing the keys for what's allowed will help so I can make a set of custom Puppet data types to handle input validation.

johrstrom commented 3 years ago

For dashboard_layout, it's really only values that are dynamic, as you indicate with widgets. The default layout in the docs is exhaustive, meaning it has all possible keys.

pinned_apps on the other hand, has user defined keys and variable types. Take field_of_science as an example, that's completely user defined and we accept it. It accepts string elements like sys/jupyter and map elements. The values can be mostly anything. You may be able to enforce types or regexes in some places?

Here's the test file I'm using for ansible with some comments.

pinned_apps:
  # string elements should be 'tokens' in the form [dev,sys,usr]/<glob>
  - "usr/*"
  - sys/jupyter

  # user defined key that can be anything, value can be anything
  - field_of_science: 'biology'

  # type should only only be [dev, sys, usr]
  - type: dev
    category: 'system'

  # here category and subcategory are known keys, field_of_science is not known beforehand. values can be any string.
  - type: sys
    category: 'minimal'
    subcategory: 'class_instruction'
    field_of_science: 'biology'

# needs to be an integer
pinned_apps_menu_length: 10

# can be any string like 'field_of_science'
pinned_apps_group_by: category

dashboard_layout:
  rows:
    - columns:

      # width needs to be an integer
      - width: 8

        # the value of widgets here can be anything
        widgets:
          - pinned_apps
          - motd
      - width: 4
        widgets:
          - xdmod_widget_job_efficiency
          - xdmod_widget_jobs
johrstrom commented 3 years ago

Oh and these files can be in .erb format too, so there's that. The idea here being you want 1 layout for some group(s) and another for others.