Skip to content

Commit ffdc43c

Browse files
committed
bump ood app releases, update matlab submit script, optimise portal.yml
1 parent 32d05b9 commit ffdc43c

File tree

6 files changed

+65
-42
lines changed

6 files changed

+65
-42
lines changed

ansible/portal.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
name: openondemand
1414
tasks_from: main.yml
1515

16-
- hosts: openondemand_desktop
16+
- hosts: openondemand_desktop:openondemand_matlab
1717
tags:
1818
- openondemand
1919
- openondemand_desktop
20+
- openondemand_matlab
2021
become: yes
2122
gather_facts: yes
2223
tasks:
@@ -49,19 +50,6 @@
4950
tasks_from: rstudio_compute.yml
5051
when: appliances_mode != 'configure' # is run during build
5152

52-
# Requires openondemand_matlab_partition to be set in group_vars, as well as MATLAB installed on target compute nodes
53-
- hosts: openondemand_matlab
54-
tags:
55-
- openondemand
56-
- openondemand_matlab
57-
become: yes
58-
gather_facts: yes
59-
tasks:
60-
- import_role:
61-
name: openondemand
62-
tasks_from: vnc_compute.yml
63-
when: appliances_mode != 'configure' # is run during build
64-
6553
- hosts: openondemand_codeserver
6654
tags:
6755
- openondemand

ansible/roles/openondemand/defaults/main.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,6 @@ openondemand_osc_ood_defaults:
104104
ood_auth_openidc: "{{ openondemand_auth_defaults.oidc.ood_auth_openidc if (openondemand_auth | lower) == 'oidc' else none }}"
105105
httpd_auth: "{{ openondemand_auth_defaults[openondemand_auth | lower].httpd_auth }}"
106106

107-
ondemand_code_server_version: 4.102.2
108-
ondemand_rstudio_version: 2025.05.1-513
107+
openondemand_code_server_version: 4.102.2
108+
openondemand_rstudio_version: 2025.05.1-513
109+
openondemand_matlab_version: ''

ansible/roles/openondemand/tasks/codeserver_compute.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- name: Download Code Server RPM
22
ansible.builtin.get_url:
3-
url: "https://github.com/coder/code-server/releases/download/v{{ ondemand_code_server_version }}/code-server-{{ ondemand_code_server_version }}-amd64.rpm"
3+
url: "https://github.com/coder/code-server/releases/download/v{{ openondemand_code_server_version }}/code-server-{{ openondemand_code_server_version }}-amd64.rpm"
44
dest: /tmp/code-server.rpm
55
mode: '0644'
66

@@ -19,18 +19,18 @@
1919

2020
- name: Create modulefile for Code Server
2121
copy:
22-
dest: "/opt/ohpc/pub/modulefiles/code-server/{{ ondemand_code_server_version }}"
22+
dest: "/opt/ohpc/pub/modulefiles/code-server/{{ openondemand_code_server_version }}"
2323
mode: "0644"
2424
content: |
2525
#%Module1.0#####################################################################
2626
2727
proc ModulesHelp { } {
28-
puts stderr "This module loads code-server {{ ondemand_code_server_version }}."
28+
puts stderr "This module loads code-server {{ openondemand_code_server_version }}."
2929
puts stderr "\nCode Server provides a browser-based VSCode instance.\n"
3030
}
3131
3232
module-whatis "Name: code-server"
33-
module-whatis "Version: {{ ondemand_code_server_version }}"
33+
module-whatis "Version: {{ openondemand_code_server_version }}"
3434
module-whatis "Category: IDE"
3535
module-whatis "Description: Run VS Code in your browser with Code Server"
3636
module-whatis "URL: https://github.com/coder/code-server"

ansible/roles/openondemand/tasks/rstudio_compute.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
- name: Download RStudio Server RPM
1111
ansible.builtin.get_url:
12-
url: "https://download2.rstudio.org/server/rhel{{ ansible_distribution_major_version }}/x86_64/rstudio-server-rhel-{{ ondemand_rstudio_version }}-x86_64.rpm"
12+
url: "https://download2.rstudio.org/server/rhel{{ ansible_distribution_major_version }}/x86_64/rstudio-server-rhel-{{ openondemand_rstudio_version }}-x86_64.rpm"
1313
dest: /tmp/rstudio-server.rpm
1414
mode: '0644'
1515

@@ -28,19 +28,19 @@
2828

2929
- name: Write modulefile for RStudio Server
3030
ansible.builtin.copy:
31-
dest: "/opt/ohpc/pub/modulefiles/rstudio-server/{{ ondemand_rstudio_version }}"
31+
dest: "/opt/ohpc/pub/modulefiles/rstudio-server/{{ openondemand_rstudio_version }}"
3232
mode: '0644'
3333
content: |
3434
#%Module1.0#####################################################################
3535
3636
proc ModulesHelp { } {
3737
puts stderr " "
38-
puts stderr "This module loads RStudio Server {{ ondemand_rstudio_version }}"
38+
puts stderr "This module loads RStudio Server {{ openondemand_rstudio_version }}"
3939
puts stderr "\nRStudio Server provides a browser-based interface to R.\n"
4040
}
4141
4242
module-whatis "Name: rstudio-server"
43-
module-whatis "Version: {{ ondemand_rstudio_version }}"
43+
module-whatis "Version: {{ openondemand_rstudio_version }}"
4444
module-whatis "Category: IDE"
4545
module-whatis "Description: RStudio Server - IDE for R"
4646
module-whatis "URL: https://www.rstudio.com"

docs/openondemand.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ To enable the Open OnDemand server, add single host to the `openondemand` invent
2424

2525
To enable compute nodes for virtual desktops, Jupyter notebooks, RStudio, VSCode, or MATLAB (accessed through the Open OnDemand portal), add nodes/groups to the `openondemand_desktop`, `openondemand_jupyter`, `openondemand_rstudio`, `openondemand_codeserver`, and `openondemand_matlab` inventory groups respectively. These may be all or a subset of the `compute` group.
2626

27-
*Note* that due to licensing, the MATLAB batch connect app only works with a MATLAB distribution already installed on the target site compute nodes, as well as Lmod configured with the correct modulefiles. MATLAB app also requires the same TurboVNC and Xfce Desktop software installed for the virtual desktop, so this is included for `openondemand_matlab` groups. To enable the MATLAB app, the `openondemand_matlab_partition` must also be defined in group_vars as it is set to `null` by default.
27+
*Note* that due to licensing, the MATLAB batch connect app only works with a MATLAB distribution already installed on the target site compute nodes, as well as Lmod configured with a module file for the software. See the compute node prerequisite software installation (e.g.`roles/openondemand/tasks/rstudio_compute.yml`) for where these modulefiles are written to. We append them to the `/opt/ohpc/pub/modulefiles` directory on the compute node for simplicity. MATLAB app also requires the same TurboVNC and Xfce Desktop software installed for the virtual desktop, so this is included for `openondemand_matlab` groups. To enable the MATLAB app, the `openondemand_matlab_partition` must also be defined in group_vars as it is set to `''` by default.
2828

2929
The above functionality is configured by running the `ansible/portal.yml` playbook. This is automatically run as part of `ansible/site.yml`.
3030

environments/common/inventory/group_vars/all/openondemand.yml

Lines changed: 51 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ openondemand_auth: basic_pam
1515
openondemand_jupyter_partition: "{{ openhpc_partitions[0]['name'] }}"
1616
openondemand_desktop_partition: "{{ openhpc_partitions[0]['name'] }}"
1717
openondemand_rstudio_partition: "{{ openhpc_partitions[0]['name'] }}"
18-
openondemand_matlab_partition: null # Requires target site to already have MATLAB so set to null
18+
openondemand_matlab_partition: '' # Requires target site to already have MATLAB so set to empty
1919
openondemand_codeserver_partition: "{{ openhpc_partitions[0]['name'] }}"
2020

2121
# Regex defining hosts which openondemand can proxy; the default regex is compute nodes (for apps) and grafana host,
@@ -92,15 +92,15 @@ openondemand_install_app_jupyter:
9292
openondemand_install_app_rstudio: # mapping, values as for ansible.builtin.git: repo (required)/dest/version(default main)/umask
9393
rstudio:
9494
repo: https://github.com/stackhpc/ood-stackhpc-rstudio.git
95-
version: main
95+
version: 2025.08.1
9696
openondemand_install_app_matlab:
9797
matlab:
9898
repo: https://github.com/stackhpc/ood-stackhpc-matlab.git
9999
version: main
100100
openondemand_install_app_codeserver:
101101
codeserver:
102102
repo: https://github.com/stackhpc/bc_osc_codeserver.git
103-
version: master
103+
version: 2025.08.1
104104
# osc:ood role var (NB only active when not in configure):
105105
ood_install_apps: >-
106106
{{
@@ -197,7 +197,7 @@ openondemand_apps_rstudio_default:
197197
help: Choose your RStudio module
198198
widget: select
199199
options:
200-
- ["rstudio-server/{{ ondemand_rstudio_version }}","RStudio v{{ ondemand_rstudio_version }}"]
200+
- ["rstudio-server/{{ openondemand_rstudio_version }}","RStudio v{{ openondemand_rstudio_version }}"]
201201
extra_modules_script:
202202
label: Extra modules script
203203
help: If you'd like to load additional modules alongside RStudio-Server, put the 'module load ...' commands into a text file (one 'module load...' per line) and specify its path here
@@ -247,6 +247,7 @@ openondemand_apps_rstudio_default:
247247
template: "basic"
248248
conn_params:
249249
- csrf_token
250+
- rstudio_module
250251
script:
251252
native:
252253
- "--partition"
@@ -269,29 +270,62 @@ openondemand_apps_matlab_default:
269270
- desktop
270271
- bc_queue
271272
- bc_num_hours
272-
- num_cores
273-
- node
273+
- matlab_module
274+
- cores
275+
- ram
274276
attributes:
275277
desktop: xfce
276278
# bc_account: # i.e. slurm account
277279
# value: root
278280
bc_queue:
279281
value: "{{ openondemand_matlab_partition | default(none) }}"
280-
num_cores:
281-
label: Number of cores
282+
matlab_module:
283+
label: MATLAB module
284+
required: true
285+
cachable: true
286+
help: Choose your MATLAB module
287+
widget: select
288+
options:
289+
- ["matlab/{{ openondemand_matlab_version }}","MATLAB v{{ openondemand_matlab_version }}"]
290+
cores:
291+
label: Number of CPU cores
292+
help: How many CPU cores to reserve for your session. NB Ensure this is within the maximum allowed by your chosen partition.
293+
widget: number_field
294+
min: 1
295+
max: 48
296+
step: 1
282297
value: 1
283-
node:
284-
label: Node name
285-
help: Select a particular node or leave empty to let Slurm pick the next available
286-
value: ""
298+
cachable: true
299+
ram:
300+
widget: number_field
301+
label: RAM in GB
302+
help: How much RAM to reserve for your session. NB Ensure this is within the maximum allowed by your chosen partition
303+
min: 4
304+
max: 700
305+
step: 1
306+
value: 4
307+
cachable: true
308+
bc_num_hours:
309+
widget: number_field
310+
help: Maximum runtime in hours for your session. NB Ensure this is within the maximum allowed by your chosen partition
311+
min: 1
312+
max: 240
313+
step: 1
314+
value: 30
315+
cachable: true
287316
submit: |
288317
---
289318
script:
290319
job_name: "ood-matlab"
291320
native:
292-
- <%= "--nodes=1" %>
293-
- <%= "--ntasks=#{num_cores}" %>
294-
- <%= "--nodelist=#{node}" %>
321+
- "--partition"
322+
- "<%= bc_queue %>"
323+
- "--ntasks"
324+
- "1"
325+
- "--mem"
326+
- "<%= ram.blank? ? 4 : ram.to_i %>G"
327+
- "--cpus-per-task"
328+
- "<%= cores.blank? ? 1 : cores.to_i %>"
295329
openondemand_apps_matlab: "{{ {'matlab':openondemand_apps_matlab_default} if openondemand_matlab_partition | default(none) else {} }}"
296330

297331
openondemand_apps_codeserver_default:
@@ -312,7 +346,7 @@ openondemand_apps_codeserver_default:
312346
help: Choose your Code Server module
313347
widget: select
314348
options:
315-
- ["code-server/{{ ondemand_code_server_version }}","Code Server v{{ ondemand_code_server_version}}"]
349+
- ["code-server/{{ openondemand_code_server_version }}","Code Server v{{ openondemand_code_server_version}}"]
316350
bc_queue:
317351
value: "{{ openondemand_codeserver_partition | default(none) }}"
318352
cores:
@@ -345,7 +379,7 @@ openondemand_apps_codeserver_default:
345379
batch_connect:
346380
template: "basic"
347381
conn_params:
348-
- code_server_version
382+
- codeserver_module
349383
script:
350384
job_name: "ood-codeserver"
351385
native:

0 commit comments

Comments
 (0)