# Reusing Singularity VNC bc\_desktop configuration in apps

**URL:** https://discourse.openondemand.org/t/reusing-singularity-vnc-bc-desktop-configuration-in-apps/1882
**Category:** Get Help
**Tags:** question
**Created:** [January 25, 2022, 9:40am UTC](https://discourse.openondemand.org/t/reusing-singularity-vnc-bc-desktop-configuration-in-apps/1882 "2022-01-25T09:40:32Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![tomgreen66](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/tomgreen66/32/588_2.png) [@tomgreen66](https://discourse.openondemand.org/u/tomgreen66)
#### Post date: [January 25, 2022, 9:40am UTC](https://discourse.openondemand.org/t/reusing-singularity-vnc-bc-desktop-configuration-in-apps/1882/1 "2022-01-25T09:40:32Z")

</div>

Hi,

I have been using an approach to run the VNC desktop in OpenOndemand inside a Singularity container as suggested in a previous post. This has a lot of configuration inside `/etc/ood/config/apps/bc_desktop` to specify the commands to run (basically redirects the VNC script to a temporary file and then runs singularity with a container using the temporary file. This works well but I am finding I am duplicating this code in every app I am using, for example to create an app for Matlab I would duplicate the VNC configuration ([open-ondemand-apps/container.yml.erb at main · SupercomputingWales/open-ondemand-apps · GitHub](https://github.com/SupercomputingWales/open-ondemand-apps/blob/main/bc_desktop/submit/container.yml.erb)) and then create the script to run Matlab. Is there a way of not replicating and reusing the configuration in bc\_desktop? This would make things much easier to launch apps. I assume if I didnt use Singularity the vnc template would handle a lot of the logic - its just I override it with Singularity configuration.

---

<div class="post-metadata">

### Author: ![travert](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/travert/32/3074_2.png) [@travert](https://discourse.openondemand.org/u/travert)
#### Post date: [January 25, 2022, 8:06pm UTC](https://discourse.openondemand.org/t/reusing-singularity-vnc-bc-desktop-configuration-in-apps/1882/2 "2022-01-25T20:06:06Z")

</div>

Hi and thanks for posting.

Sounds like a non-standard setup from a previous thread but I’m not sure which thread you are referring to.

Since most of the script generation is handled using ERB and the views to pass information to the scripts like you said, you would basically have to harvest what’s happening from those in the standard setup to try and recreate some of that script generation.

I’m not sure this answers the question, but I’m somewhat unsure if I’m understanding what you’re asking.

---

<div class="post-metadata">

### Author: ![tomgreen66](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/tomgreen66/32/588_2.png) [@tomgreen66](https://discourse.openondemand.org/u/tomgreen66)
#### Post date: [February 8, 2022, 11:19am UTC](https://discourse.openondemand.org/t/reusing-singularity-vnc-bc-desktop-configuration-in-apps/1882/3 "2022-02-08T11:19:06Z")

</div>

Hi,

Thank - what I am trying to ask if whether the recommended approach is for the VNC configuration can be specified at the cluster level and then reused in applications rather than defining the vnc configuration in every app. I tried adding to the cluster definition as [Add Cluster Configuration Files — Open OnDemand 2.0.20 documentation](https://osc.github.io/ood-documentation/latest/installation/add-cluster-config.html) but couldn’t get it to accept some of my configuration that I defined in [https://github.com/SupercomputingWales/open-ondemand-apps/blob/main/bc\_desktop/submit/container.yml.erb](https://github.com/SupercomputingWales/open-ondemand-apps/blob/main/bc_desktop/submit/container.yml.erb) - maybe I can create wrappers for all that code and define the location for some of those scripts I override. I wasn’t sure what was possible in the cluster level VNC configuration.

---

<div class="post-metadata">

### Author: ![travert](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/travert/32/3074_2.png) [@travert](https://discourse.openondemand.org/u/travert)
#### Post date: [February 8, 2022, 4:09pm UTC](https://discourse.openondemand.org/t/reusing-singularity-vnc-bc-desktop-configuration-in-apps/1882/4 "2022-02-08T16:09:59Z")

</div>

Thanks for the clarification.

I think some documentation around what you are speaking about would be the `submit.yml.erb` file: [submit.yml.erb — Open OnDemand 2.0.20 documentation](https://osc.github.io/ood-documentation/latest/reference/files/submit-yml-erb.html#setting-batch-connect-options-globally)

The key thing which I think you are after here is:  
“All of these configuration items can also be applied globally to the entire cluster in the cluster definition files under `/etc/ood/config/clusters.d/`. **If set globally, the option is applied to all applications in that cluster.** ”

Which sounds like what you are trying to do. Is this on the right path of what you are hoping for?

---

<div class="post-metadata">

### Author: ![tomgreen66](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/tomgreen66/32/588_2.png) [@tomgreen66](https://discourse.openondemand.org/u/tomgreen66)
#### Post date: [February 10, 2022, 1:45pm UTC](https://discourse.openondemand.org/t/reusing-singularity-vnc-bc-desktop-configuration-in-apps/1882/5 "2022-02-10T13:45:07Z")

</div>

Hi,

Okay - that does sound like it should be possible. I tried adding in the configuration options to the cluster definition files but it would fail processing the cluster definition file and not like the shell code being defined within the yaml - maybe I need to be careful with the cluster definition being yaml and the submit script being erb - I will try making scripts to contain a lot of code anyway and refactor a bit.

Thanks.

---

<div class="post-metadata">

### Author: ![novosirj](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/novosirj/32/339_2.png) [@novosirj](https://discourse.openondemand.org/u/novosirj)
#### Post date: [February 22, 2022, 6:03pm UTC](https://discourse.openondemand.org/t/reusing-singularity-vnc-bc-desktop-configuration-in-apps/1882/6 "2022-02-22T18:03:37Z")

</div>

I think he’s talking about running this way:

> [@Mate Desktop in a Singularity container?](https://discourse.openondemand.org/t/mate-desktop-in-a-singularity-container/696/21):
>
> OK, I think I’ve solved this (finally sweat_smile). The first issue you’ve had, turns out the easiest thing to do is just to remove mate-power-manager. Users shouldn’t be able to restart the node anyhow which I think is that widget does. The second is something we’d [already seen apparently](https://github.com/OSC/ondemand-packaging/issues/71) and I just forgot about it. So, if you’ll notice in the definition file, there’s a different RPM url. I was not able to solve the issue with turbovnc 2.1.1. It says you need the openssl or gnutls librarie…

I’m here because I had a similar question – how to avoid having to duplicate that for every app (which honestly isn’t a huge burden, but it would be a nice-to-have).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/b/bae70bd0ed39a3ae769c2108155f4cb3e9da8385.png) [@system](https://discourse.openondemand.org/u/system)
#### Post date: [August 21, 2022, 6:04pm UTC](https://discourse.openondemand.org/t/reusing-singularity-vnc-bc-desktop-configuration-in-apps/1882/7 "2022-08-21T18:04:16Z")

</div>

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