Combined GUI application

Hi all,

I am wondering if there is a way to create per-app icons in the dashboard itself that will all reuse just a single “GUI app’s” code.

Currently, I am working on an experimental interactive application that allows users to select the GUI application (eg. MATLAB, Mathematica) that they want to start. This is how the form for the app looks like.

The user would first select the GUI application that they want to launch. The version field is a dynamically generated select widget that would allow users to choose the version of the GUI application that they want to launch. After launching, a vncserver instance would be started from a container. In the job execution script, the module for the GUI app selected would be loaded and the GUI application will be launched through the predefined start_command of the specified app.

Since the GUI apps are all using similar form.yml, submit.yml and script.sh (except for the module loaded and the start command, we choose this approach so as to minimize code replication when trying to create multiple GUI app.

I feel that there could be a more user friendly way to do this with the per-app icons in the dashboard that all points to this single generic GUI application. In this way, instead of using the select widget in the form to select the GUI app to start, the name field would be determined by the dashboard icon that they will click. Is there any suggestion on how to approach this?

We use Ansible to deploy our apps, and the GUI apps, while separate on the OOD server, are deployed from form.yml, etc, templates as well as having the individual icons pushed out to /var/www/ood/apps/sys/appname.

I think you can approach this by making other applications that are just a lot of symlinks to the original.

So you’d have symlinks to the form.yml, submit.yml and template directories and perhaps the only difference in these apps is the manifest.yml (for titles) and the icon.png. So you sort of fake out OnDemand by having a real matlab app, only that app is mostly symlinks to your generic gui app.

At least, that’s my first idea. You could have them all as subapps to the original app, but that may through titles off and require more work. It’s an option to investigate anyhow.

https://osc.github.io/ood-documentation/latest/how-tos/app-development/interactive/sub-apps.html?#sub-apps-and-reconfiguring-exsting-apps

Thank you very much to everyone for all your replies!

There are a few different methods that were raised:

  1. Manually managing the multiple GUI apps that are only slightly different copies of each other (current, possible to use ansible to automate this process)
  2. Using symlinks to reuse common parts of the app (eg. script.sh)
  3. Using a new generic GUI application, which will appear only once in the dashboard, and users will select the actual application in the form
  4. Using subapps of an original generic app, overriding the necessary form fields

I have just tried the subapps approach. After some experimentation, I found out that gui_app/local directory will be taken as a form.yml override, creating a subapp for each valid yml file in the local directory. I was wondering if there is a way to also override files other than form.yml such as the manifest.yml and the icon.png?

Thank you.

Yea subapps may not fit here because of this. I don’t think you can override these with subapps.

Seems like seperate apps that all symlink to the same form.yml, submit.yml and template directory may be the only option.

Hi everyone,

After some digging, it seems that it is possible to override the icon of the subapp directly through the form.yml Renamed icon_uri yaml property to icon by abujeda · Pull Request #2579 · OSC/ondemand · GitHub. However, I tried to experiment with it and it seems to only use font awesome icons. Is there a way to use my custom icon that is located in the gui_app/local directory?

Thanks

You can use custom icons too in subapps:

#RStudio/local/memory.yml
cluster: "dev-cluster"
title: "RStudio SubApp Custom Icon"
icon: "/public/fasrc_logo.png"

Thanks everyone once again for your replies.

I have managed to expand my generic GUI app using the subapps approach suggested by Jeff. Also, with the help of @abujeda, I managed to customize my subapps icon and title. For reference, this is the matlab.yml for the matlab subapp that was based off the generic GUI application

---
title: MATLAB GUI App
cluster:
  - "hpcondemand-cnode"
caption: "MATLAB SubApp"
icon: "/public/matlab.png"
form:
  - start_command
  - version
  - bc_queue
  - bc_num_hours
  - bc_vnc_resolution
attributes:
  start_command: "matlab -desktop"
  version:
    display: true
    widget: select
    label: "MATLAB App version"
    help: "This defines the MATLAB version you want to load."
    options:
       - [
           "2023a", "MATLAB/2023a",
         ]
       - [
           "2022b", "MATLAB/2022b_Update_5",
         ]
       - [
           "2021b", "MATLAB/2021b",
         ]

However, I was thinking if the subapp section of the Open Ondemand documentation should be updated to include information about how the form.yml file in the subapps can also be used to override other things such as the manifest and the icons. If so, I can help to make a contribution to it.

Thanks everyone!