Skip to content

Commit 4d1f816

Browse files
committed
Add MATLAB ood app configuration
1 parent eba6697 commit 4d1f816

File tree

6 files changed

+61
-1
lines changed

6 files changed

+61
-1
lines changed

ansible/portal.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,15 @@
4848
name: openondemand
4949
tasks_from: rstudio_compute.yml
5050
when: appliances_mode != 'configure' # is run during build
51+
52+
- hosts: openondemand_matlab
53+
tags:
54+
- openondemand
55+
- openondemand_matlab
56+
become: yes
57+
gather_facts: yes
58+
tasks:
59+
- import_role:
60+
name: openondemand
61+
tasks_from: vnc_compute.yml
62+
when: appliances_mode != 'configure' # is run during build

ansible/roles/openondemand/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ openondemand_filesapp_paths: []
2525
openondemand_jupyter_partition: ''
2626
openondemand_dashboard_links: []
2727
openondemand_rstudio_partition: ''
28+
openondemand_matlab_partition: ''
2829

2930
# Monitoring:
3031
openondemand_exporter: true

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ openondemand_auth: basic_pam
22
openondemand_jupyter_partition: standard
33
openondemand_desktop_partition: standard
44
openondemand_rstudio_partition: standard
5+
openondemand_matlab_partition: standard
56
#openondemand_dashboard_support_url:
67
#openondemand_dashboard_docs_url:
78
#openondemand_filesapp_paths:

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

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +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: "{{ openhpc_partitions[0]['name'] }}"
1819

1920
# Regex defining hosts which openondemand can proxy; the default regex is compute nodes (for apps) and grafana host,
2021
# e.g. if the group `compute` has hosts `compute-{0,1,2,..}` this will be '(compute-\d+)|(control)'.
@@ -90,12 +91,17 @@ openondemand_install_app_rstudio: # mapping, values as for ansible.builtin.git:
9091
rstudio:
9192
repo: https://github.com/stackhpc/ood-stackhpc-rstudio.git
9293
version: main
94+
openondemand_install_app_matlab:
95+
matlab:
96+
repo: https://github.com/stackhpc/ood-stackhpc-matlab.git
97+
version: main
9398
# osc:ood role var (NB only active when not in configure):
9499
ood_install_apps: >-
95100
{{
96101
{}
97102
| combine(openondemand_install_app_jupyter if openondemand_jupyter_partition else {})
98103
| combine(openondemand_install_app_rstudio if openondemand_rstudio_partition else {})
104+
| combine(openondemand_install_app_matlab if openondemand_matlab_partition else {})
99105
}}
100106
101107
# https://github.com/OSC/ondemand/tree/master/apps/bc_desktop
@@ -211,6 +217,39 @@ openondemand_apps_rstudio_default:
211217
- <%= "--nodelist=#{node}" %>
212218
openondemand_apps_rstudio: "{{ {'rstudio':openondemand_apps_rstudio_default} if openondemand_rstudio_partition | default(none) else {} }}"
213219

220+
openondemand_apps_matlab_default:
221+
title: MATLAB
222+
description: Request a desktop to run MATLAB.
223+
cluster: slurm
224+
form:
225+
- desktop
226+
- bc_queue
227+
- bc_num_hours
228+
- num_cores
229+
- node
230+
attributes:
231+
desktop: xfce
232+
# bc_account: # i.e. slurm account
233+
# value: root
234+
bc_queue:
235+
value: "{{ openondemand_matlab_partition | default(none) }}"
236+
num_cores:
237+
label: Number of cores
238+
value: 1
239+
node:
240+
label: Node name
241+
help: Select a particular node or leave empty to let Slurm pick the next available
242+
value: ""
243+
submit: |
244+
---
245+
script:
246+
job_name: "ood-matlab"
247+
native:
248+
- <%= "--nodes=1" %>
249+
- <%= "--ntasks=#{num_cores}" %>
250+
- <%= "--nodelist=#{node}" %>
251+
openondemand_apps_matlab: "{{ {'matlab':openondemand_apps_matlab_default} if openondemand_matlab_partition | default(none) else {} }}"
252+
214253
# osc.ood:ood_apps - see https://github.com/OSC/ood-ansible#ood_apps
215254
openondemand_dashboard_support_url: ''
216255
openondemand_dashboard_docs_url: ''
@@ -230,7 +269,7 @@ openondemand_apps:
230269
ood_brand_bg_color: "#0e6ec8"
231270
ood_dashboard_title: "{{ openhpc_cluster_name }}"
232271

233-
ood_apps: "{{ openondemand_apps | combine(openondemand_apps_jupyter) | combine(openondemand_apps_desktop) | combine(openondemand_apps_rstudio) }}"
272+
ood_apps: "{{ openondemand_apps | combine(openondemand_apps_jupyter) | combine(openondemand_apps_desktop) | combine(openondemand_apps_rstudio) | combine(openondemand_apps_matlab) }}"
234273

235274
# Prometheus config for Open Ondemand exporter
236275
# https://osc.github.io/ood-documentation/latest/monitoring/prometheus.html#prometheus-configuration

environments/common/inventory/groups

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ fail2ban
9191
[openondemand_rstudio]
9292
# Subset of compute to run RStudio servers on via Open Ondemand
9393

94+
[openondemand_matlab]
95+
# Subset of compute to run RStudio servers on via Open Ondemand
96+
9497
[etc_hosts]
9598
# Hosts to manage /etc/hosts e.g. if no internal DNS. See ansible/roles/etc_hosts/README.md
9699

environments/common/layouts/everything

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ compute
5959
# Subset of compute to run RStudio servers on via Open Ondemand
6060
compute
6161

62+
[openondemand_matlab:children]
63+
# Subset of compute to run a MATLAB interactive desktop on via Open Ondemand
64+
compute
65+
6266
[etc_hosts:children]
6367
# Hosts to manage /etc/hosts e.g. if no internal DNS. See ansible/roles/etc_hosts/README.md
6468
cluster

0 commit comments

Comments
 (0)