# Unable to Specify Cores or Memory for Interactive Desktop

**URL:** <https://discourse.openondemand.org/t/unable-to-specify-cores-or-memory-for-interactive-desktop/1038>\
**Category:** Get Help\
**Created:** [July 27, 2020, 9:51pm UTC](https://discourse.openondemand.org/t/unable-to-specify-cores-or-memory-for-interactive-desktop/1038 "2020-07-27T21:51:05Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlsimms](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jlsimms/32/516_2.png) [@jlsimms](https://discourse.openondemand.org/u/jlsimms)\
**Post date:** [July 27, 2020, 9:51pm UTC](https://discourse.openondemand.org/t/unable-to-specify-cores-or-memory-for-interactive-desktop/1038/1 "2020-07-27T21:51:05Z")

</div>

Hello all,

I have a production instance of OOD that is close to vanilla/default, and I’m trying to customize it a little. In particular, the Interactive Desktop app by default provides one core to users, and I can’t even determine how it allocates memory. Basically, I’d like to be able to specify the number of cores and memory a user can request for their Interactive Desktop session.

The edits I’ve made to `form.yml` and `submit.yml.erb` do not seem to be working, despite my success at similar changes for our Jupyter Notebook/Lab application. For instance, here are some relevant lines from my `form.yml`:

```auto
attributes:
  desktop: "mate"
  bc_vnc_idle: 0
  bc_vnc_resolution:
    required: true
  node_type: null
  memory:
    widget: "number_field"
    max: 128000
    min: 2000
    step: 2000
    value: 4000
    label: "Memory (MB)"
    help: "Enter a value in MB between 2000 and 128000"
  cores:
    widget: "number_field"
    max: 16
    min: 1
    step: 1
    value: 1
    label: "Number of cores"
    help: "Enter a value between 1 and 16"

```

The fields show up on the form within OOD, but if I choose, e.g., 2 cores, running `nproc` on the resulting Desktop session shows 1 core only. Here are some relevant lines from `submit.yml.erb`:

```auto
  native: # ... array of command line arguments ...
    - "-c"
    - "<%= cores.blank? ? 1 : cores.to_i %>"
    - "--mem"
    - "<%= memory %>M"

```

This approach worked well with our Jupyter app, so I’m not sure what is failing here. I suspect I might be missing something trivial, or perhaps this behavior is different for Interactive Desktop sessions. Any advice would be welcome!

Warmest regards,  
Jason

---

<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:** [July 27, 2020, 10:48pm UTC](https://discourse.openondemand.org/t/unable-to-specify-cores-or-memory-for-interactive-desktop/1038/2 "2020-07-27T22:48:36Z")

</div>

You only have `attributes` listed here. What about the `form` entires? `bc_desktop` is special in that you’re actually re-configuring an existing app ([this one that’s distributed with the code base](https://github.com/OSC/ondemand/tree/72f2c72bd232c34890c38c3e76d163890e73b320/apps/bc_desktop), so you probably have to also should set `bc_num_slots: nil` to let your own `cores` field take over.

You can always check your `/var/log/ondemand-nginx/$USER/error.log` for the actual command being executed. You can grep for `execve`. Here’s an example of a job I just ran on our Torque cluster.

```auto
App 45099 output: [2020-07-27 17:33:37 -0400] INFO "execve = [{\"PBS_DEFAULT\"=>\"quick-batch.ten.osc.edu\", \"LD_LIBRARY_PATH\"=>\"/opt/torque/lib64:/opt/rh/rh-nodejs10/root/usr/lib64:/opt/rh/rh-ruby25/root/usr/local/lib64:/opt/rh/rh-ruby25/root/usr/lib64:/opt/rh/httpd24/root/usr/lib64:/opt/ood/ondemand/root/usr/lib64\"}, \"/opt/torque/bin/qsub\", \"-d\", \"/users/PZS0714/johrstrom/ondemand/data/sys/dashboard/batch_connect/sys/bc_desktop/vdi-owens/output/e50db490-2580-4e3a-8311-beef4604eb8f\", \"-N\", \"ondemand/sys/dashboard/sys/bc_desktop/vdi-owens\", \"-S\", \"/bin/bash\", \"-o\", \"/users/PZS0714/johrstrom/ondemand/data/sys/dashboard/batch_connect/sys/bc_desktop/vdi-owens/output/e50db490-2580-4e3a-8311-beef4604eb8f/output.log\", \"-j\", \"oe\", \"-l\", \"walltime=08:00:00\", \"-l\", \"nodes=1:ppn=1:owens\", \"/tmp/qsub.20200727-45099-6bv0nc\"]"

```

---

<div class="post-metadata">

**Author:** ![jlsimms](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jlsimms/32/516_2.png) [@jlsimms](https://discourse.openondemand.org/u/jlsimms)\
**Post date:** [July 27, 2020, 11:29pm UTC](https://discourse.openondemand.org/t/unable-to-specify-cores-or-memory-for-interactive-desktop/1038/3 "2020-07-27T23:29:01Z")

</div>

Here are my form definitions:

```auto
form:
  - bc_vnc_idle
  - desktop
  - bc_num_hours
  - cores
  - memory
  - bc_num_slots
  - node_type
  - bc_queue
  - bc_vnc_resolution
  - bc_email_on_started

```

I did go ahead and set `bc_num_slots` to `null` as well. And here is what Slurm is trying to run… I have no idea where this string is forming:

```auto
App 6672 output: [2020-07-27 19:23:29 -0400] INFO "execve = [{\"SLURM_CONF\"=>\"/opt/slurm/slurm.conf\"}, \"/usr/bin/squeue\", \"--all\", \"--states=all\", \"--noconvert\", \"-o\", \"\\u001E%a\\u001F%A\\u001F%B\\u001F%c\\u001F%C\\u001F%d\\u001F%D\\u001F%e\\u001F%E\\u001F%f\\u001F%F\\u001F%g\\u001F%G\\u001F%h\\u001F%H\\u001F%i\\u001F%I\\u001F%j\\u001F%J\\u001F%k\\u001F%K\\u001F%l\\u001F%L\\u001F%m\\u001F%M\\u001F%n\\u001F%N\\u001F%o\\u001F%O\\u001F%q\\u001F%P\\u001F%Q\\u001F%r\\u001F%S\\u001F%t\\u001F%T\\u001F%u\\u001F%U\\u001F%v\\u001F%V\\u001F%w\\u001F%W\\u001F%x\\u001F%X\\u001F%y\\u001F%Y\\u001F%z\\u001F%Z\\u001F%b\", \"-j\", \"2724\", \"-M\", \"hpc\"]

```

Jason

---

<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:** [July 27, 2020, 11:47pm UTC](https://discourse.openondemand.org/t/unable-to-specify-cores-or-memory-for-interactive-desktop/1038/4 "2020-07-27T23:47:23Z")

</div>

You’re looking for an `sbatch` command to submit a job. You’ve given an `squeue` that gets info from SLURM.

Also, just to be clear (and make sure you don’t have a typo), it’s `nil` not `null`.

---

<div class="post-metadata">

**Author:** ![jlsimms](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jlsimms/32/516_2.png) [@jlsimms](https://discourse.openondemand.org/u/jlsimms)\
**Post date:** [July 27, 2020, 11:59pm UTC](https://discourse.openondemand.org/t/unable-to-specify-cores-or-memory-for-interactive-desktop/1038/5 "2020-07-27T23:59:57Z")

</div>

So, here is the `sbatch` command:

```auto
App 11306 output: [2020-07-27 19:55:58 -0400] INFO "execve = [{\"SLURM_CONF\"=>\"/opt/slurm/slurm.conf\"}, \"/usr/bin/sbatch\", \"-D\", \"/home/simmsj/ondemand/data/sys/dashboard/batch_connect/sys/bc_desktop/hpc/output/08b4a3cf-cd5a-49d7-b719-4595d73e13b1\", \"-J\", \"sys/dashboard/sys/bc_desktop/hpc\", \"-o\", \"/home/simmsj/ondemand/data/sys/dashboard/batch_connect/sys/bc_desktop/hpc/output/08b4a3cf-cd5a-49d7-b719-4595d73e13b1/output.log\", \"-t\", \"01:00:00\", \"-N\", \"1\", \"--parsable\", \"-M\", \"hpc\"]"

```

I don’t see, e.g., a `-c 4` or anything similar, which I would expect based on how I have `submit.yml.erb` configured. It’s like it’s ignoring that file. I don’t know where or why, for instance, it is including the `-N 1`, and also excluding `--mem`. Very confusing.

Jason

---

<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:** [July 28, 2020, 1:17pm UTC](https://discourse.openondemand.org/t/unable-to-specify-cores-or-memory-for-interactive-desktop/1038/6 "2020-07-28T13:17:32Z")

</div>

It could actually be ignoring that file. Try adding a `sumbit: "relative/path/to/submit.yml.erb"` in the form.yml. The `-N 1` is coming from `bc_num_slots`.

Also [here’s how we configure our bc\_desktops at OSC](https://github.com/OSC/osc-ood-config/tree/master/ondemand.osc.edu/apps/bc_desktop) because examples are always good. It may be good to have an example you can go off of. Note how we also have to specify a brand new submit yml.

---

<div class="post-metadata">

**Author:** ![jlsimms](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jlsimms/32/516_2.png) [@jlsimms](https://discourse.openondemand.org/u/jlsimms)\
**Post date:** [July 28, 2020, 1:51pm UTC](https://discourse.openondemand.org/t/unable-to-specify-cores-or-memory-for-interactive-desktop/1038/7 "2020-07-28T13:51:51Z")

</div>

Thanks, I’ll work with it some more and see where I get. Also, though, I do see this line in your `owens.yml`: `bc_queue: null`

I thought you were specific that it was `nil` and not `null`. Yet again I am confused. 🙂

Jason

---

<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:** [July 28, 2020, 2:13pm UTC](https://discourse.openondemand.org/t/unable-to-specify-cores-or-memory-for-interactive-desktop/1038/8 "2020-07-28T14:13:16Z")

</div>

My sincere apologies. It’s me who’s confused. You’re right, you should use `null` because that’s what yaml expects (nil is a ruby thing).

---

<div class="post-metadata">

**Author:** ![jlsimms](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jlsimms/32/516_2.png) [@jlsimms](https://discourse.openondemand.org/u/jlsimms)\
**Post date:** [July 28, 2020, 4:38pm UTC](https://discourse.openondemand.org/t/unable-to-specify-cores-or-memory-for-interactive-desktop/1038/9 "2020-07-28T16:38:31Z")

</div>

At the head of my `submit.yml.erb` file, within the `bc_desktop` app directory, it says:

```auto
batch_connect:
  template: vnc

```

Do you think this is somehow instructing it to look elsewhere and ignore subsequent instructions in that file? I’s also stymied because if you look at the `sbatch` command that is submitted, one of the arguments is `--parsable`. So from within the `bc_desktop` directory, as well as within various parent directories, I ran `grep -r parsable *`, just to try to find where that is constructed, and nothing came back. Once again, I can’t figure out how that string is being built.

Jason

---

<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:** [July 28, 2020, 5:16pm UTC](https://discourse.openondemand.org/t/unable-to-specify-cores-or-memory-for-interactive-desktop/1038/10 "2020-07-28T17:16:32Z")

</div>

So it’s important to keep in mind that with the `bc_desktop`, you’re overwriting our configuration. The files you’ve pointed out are ours. So you need to specify your own `submit.yml.erb` location.

Ignoring your configs is not quite the right word, it’s more like it needs to be explicitly told that there’s another `submit.yml`. So in your `form.yml` you need to specify the `submit:` attribute to point to some other file [as we do here for our owens desktop](https://github.com/OSC/osc-ood-config/blob/5b300bd78ece822e291af77fab52fce510919960/ondemand.osc.edu/apps/bc_desktop/owens.yml#L50). Sorry, it took until now that this is your issue!

We’ll then take both of these configs (what we provide in our source tree and what you override in `/etc/ood/apps/config/bc_desktop`) and merge them (giving precedence to _your_ configs over ours).

`--parsable` is something we pass to SLURM all the time just to get parsable output back, so that’s not really an app thing but just the way the SLURM integration was built.

---

<div class="post-metadata">

**Author:** ![jlsimms](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jlsimms/32/516_2.png) [@jlsimms](https://discourse.openondemand.org/u/jlsimms)\
**Post date:** [July 28, 2020, 5:59pm UTC](https://discourse.openondemand.org/t/unable-to-specify-cores-or-memory-for-interactive-desktop/1038/11 "2020-07-28T17:59:42Z")

</div>

Thanks for this more detailed description. Where, though, is _your_ config file that is merged with _my_ config file? So, if I specify an override to merge with yours, I know where mine is, but where is your “master” config file for the `bc_desktop` application? You mention it’s in “our source tree,” but where is that on the system?

Thanks!

Jason

---

<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:** [July 28, 2020, 6:06pm UTC](https://discourse.openondemand.org/t/unable-to-specify-cores-or-memory-for-interactive-desktop/1038/12 "2020-07-28T18:06:08Z")

</div>

Your files should be kept in `/etc/ood/config/apps/bc_desktop`. The source code (from the installation) gets distributed to `/var/www/ood/apps/sys/bc_desktop`.

---

<div class="post-metadata">

**Author:** ![jlsimms](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jlsimms/32/516_2.png) [@jlsimms](https://discourse.openondemand.org/u/jlsimms)\
**Post date:** [July 28, 2020, 6:28pm UTC](https://discourse.openondemand.org/t/unable-to-specify-cores-or-memory-for-interactive-desktop/1038/13 "2020-07-28T18:28:08Z")

</div>

Aha! That solved the problem!

I was unaware that there were local config files within `/etc`. I was editing the versions within `/var`, which were subsequently getting overwritten by the local options. I’ve got it working now.

Thank you for your patience and guidance. We got there in the end, and I learned a lot!

Jason

---

<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:43pm UTC](https://discourse.openondemand.org/t/unable-to-specify-cores-or-memory-for-interactive-desktop/1038/14 "2022-05-26T15:43:13Z")

</div>


