Interactive desktop: DISPLAY error

@emily.dragowsky I am glad you are making progress and sorry that this has been so difficult.

I’m not sure about the problem you are having with DISPLAY not being set, but I can tell you how to modify the environment of the desktop apps without having to copy and modify the job template directly. There are two options.

The first is modifying the cluster config files to add a batch_connect: section. There is some basic documentation https://osc.github.io/ood-documentation/master/app-development/interactive/setup/modify-cluster-configuration.html?highlight=batch_connect and https://osc.github.io/ood-documentation/master/installation/cluster-config-schema.html#batch-connect of how these configuration options are managed. We use this to setup the environment properly for TurboVNC and WebSockify. Ours looks like this:

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

Where the module load ondemand-vnc loads the turbovnc module and then sets WEBSOCKIFY_CMD=/usr/local/novnc/utils/websockify/run. The code that submits the interactive app job uses the script_wrapper: value with string interpolation to replace %s with the rest of the generated job script. So its a way to prepend or append code to it.

A second way is you can add another submit script with an arbitrary name like slurm.yml.erb file to /etc/ood/config/apps/bc_desktop/submit/ and reference this in the desktop configs under /etc/ood/config/apps/bc_desktop/submit/. Then in this custom slurm.yml.erb file you can add to the script: hash a key value pair for each attribute listed here: https://www.rubydoc.info/gems/ood_core/OodCore/Job/Script. The examples in the documentation show using native: but you can also do job_environment:. Here is an example in an earlier version of our Jupyter interactive app where we set the environment variables PYTHON_MODULE and possibly CUDA_MODULE: https://github.com/OSC/bc_osc_jupyter/blob/a89c50706dc45ef01b035b8157ca8a46244e19d7/submit.yml.erb#L3-L7

script:
  job_environment:
    PYTHON_MODULE: "python/3.5"
    <%- if node_type.include? "gpus" -%>
    CUDA_MODULE: "cuda/8.0.44"
    <%- end -%>
  native:
    resources:
      nodes: "<%= bc_num_slots %><%= node_type %>"