# Questions about bc\_desktop

**URL:** <https://discourse.openondemand.org/t/questions-about-bc-desktop/553>\
**Category:** Get Help\
**Created:** [October 17, 2019, 2:45pm UTC](https://discourse.openondemand.org/t/questions-about-bc-desktop/553 "2019-10-17T14:45:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wdpypere](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/wdpypere/32/224_2.png) [@wdpypere](https://discourse.openondemand.org/u/wdpypere)\
**Post date:** [October 17, 2019, 2:45pm UTC](https://discourse.openondemand.org/t/questions-about-bc-desktop/553/1 "2019-10-17T14:45:00Z")

</div>

Hi all,

I’ve got 3 questions about bc\_desktop which got me confused.

1. the files under `/var/www/ood/apps/sys/bc_desktop` are shipped with the ondemand rpm. However, the form does not specify a cluster, so it is invalid and not shown by default on the portal. If my understanding is correct, this directory gets parsed every time someone logs in and will fail by default. This seems wrong to me as it slows down the portal. Am I missing something? It seems to me this directory should not be included in the rpm.

2. At our site we use xfce. Previously we already installed the bc\_paraview app. Now when I look at how bc\_paraview starts xfce and how bc\_desktop starts xfce, these are completely different. For instance:

3. in addition to previous question, is there a way to share the startup method of xfce between several apps? Most of our predefined apps will/should use the same way. I feels prone to error to copy the same files everywhere. Is there a way to source scripts/erb files/… from a common place?

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [October 18, 2019, 8:35pm UTC](https://discourse.openondemand.org/t/questions-about-bc-desktop/553/2 "2019-10-18T20:35:14Z")

</div>

1. Yes, you’re right. But here’s the counter point - having zero clusters is the edge case. The more common case is you have at least one. So in the beginning while you’re testing, configuring, you have no clusters. But in the long run, when you’re in production serving customers you do. And as soon as you _do_ have a cluster configured, then this application is immediately there and useful without you (or an administrator) having to pause and then think … OK got to install some other dependency.
2. There _could_ have been good reasons but if there are no comments indicating why so those choices are probably lost to the ether. Or maybe they’re documented in pull requests? But it’s unclear either way.
3. I would suggest modules that you could load. Configure you’re cluster’s `script_wrapper` to load it like below.

```auto
  <snippet removed>

  batch_connect:
      basic:
        script_wrapper: "module restore\n%s"
      vnc:
        script_wrapper: "module restore\nmodule load ondemand-vnc\n%s"

```

Hope that answers some questions, though 2 may require some digging.

---

<div class="post-metadata">

**Author:** ![efranz](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/efranz/32/27_2.png) [@efranz](https://discourse.openondemand.org/u/efranz)\
**Post date:** [October 18, 2019, 11:41pm UTC](https://discourse.openondemand.org/t/questions-about-bc-desktop/553/3 "2019-10-18T23:41:30Z")

</div>

Your assessment that the form.yml in that directory gets read every time the menu is built by the dashboard is correct, and if there is no desktop config defined under `/etc/ood/config/apps/bc_desktop` then, even if a cluster is defined in the cluster config, these are wasted cycles. We are working on re-desinging the plugin architecture to do two things:

1. expand capabilities to support batch work alongside interactive work
2. address the many problems with the current solution (including what you identify)

If you have any suggestions please share on what would make life easier, or what you would like to do you cannot do now with the current plugins, please share.

* * *

The big difference between the Desktop and Paraview is Desktop launches a full desktop session, and Paraview just starts a window manager to launch only Paraview. We launch the other “GUI” apps like MATLAB and Abaqus and COMSOL in the same manner.

> bc\_desktop works in the user home dir, while bc\_paraview works in the job directory

Where do you see this? In the latest master version it looks like [we cd to the home directory](https://github.com/OSC/bc_osc_paraview/blob/5dcdbfcfaacea7e9b27357424340be12220aa0d4/template/script.sh.erb#L6-L7).

* * *

> I feels prone to error to copy the same files everywhere. Is there a way to source scripts/erb files/… from a common place?

Could you be more explicit about what you want to share? For example, in [GitHub - OSC/bc\_osc\_paraview: Batch Connect - OSC Paraview](https://github.com/OSC/bc_osc_paraview) case, might it be [https://github.com/OSC/bc\_osc\_paraview/blob/5dcdbfcfaacea7e9b27357424340be12220aa0d4/template/script.sh.erb#L9-L22](https://github.com/OSC/bc_osc_paraview/blob/5dcdbfcfaacea7e9b27357424340be12220aa0d4/template/script.sh.erb#L9-L22)?

@jeff.ohrstrom’s solution for using the cluster config is good if you want to modify what goes [before or after the job script body](https://github.com/OSC/ood_core/blob/a87f59ea9d24cdcbe505c9ab859bcb120bae9951/lib/ood_core/batch_connect/template.rb#L222-L271) but this is not the same thing as the `template/script.sh.erb` which is [executed as a child process](https://github.com/OSC/ood_core/blob/a87f59ea9d24cdcbe505c9ab859bcb120bae9951/lib/ood_core/batch_connect/template.rb#L256-L258). The cluster config modification also affects every vnc type interactive app.

There are several other options as well to share code or strings between apps (either in the form.yml.erb or the template/script.yml.erb) though the solution’s I’ve used before is not quite like using Rails partials.

---

<div class="post-metadata">

**Author:** ![westburg.2](https://avatars.discourse-cdn.com/v4/letter/w/0ea827/32.png) [@westburg.2](https://discourse.openondemand.org/u/westburg.2)\
**Post date:** [May 26, 2022, 3:24pm UTC](https://discourse.openondemand.org/t/questions-about-bc-desktop/553/4 "2022-05-26T15:24:23Z")

</div>


