Skip to content

Commit 952e5a9

Browse files
bertiethorpesjpb
andauthored
Add Rstudio, VSCode, Matlab to OOD application catalogue (#738)
* configure rstudio on compute node * configure rstudio app on compute node * fix rstudio_compute.yml * improve ood app install logic * Add MATLAB ood app configuration * add and configure VSCode OOD app * WIP: debug rstudio app errors * reconfigure ood code-server app * Document lack of out-the-box MATLAB functionality * remove groups * re-add inventory * bump CI images * Use lustre-release mirror * bump ood app releases, update matlab submit script, optimise portal.yml * fix widget selection order * openondemand.md improvements * bump CI images * undo bastion edit * del duplicate sentence in openondemand.md * Update docs/openondemand.md Co-authored-by: Steve Brasier <[email protected]> --------- Co-authored-by: Steve Brasier <[email protected]>
1 parent f9dbeb2 commit 952e5a9

File tree

11 files changed

+405
-11
lines changed

11 files changed

+405
-11
lines changed

ansible/portal.yml

Lines changed: 26 additions & 1 deletion
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:
@@ -36,3 +37,27 @@
3637
name: openondemand
3738
tasks_from: jupyter_compute.yml
3839
when: appliances_mode != 'configure' # is run during build
40+
41+
- hosts: openondemand_rstudio
42+
tags:
43+
- openondemand
44+
- openondemand_rstudio
45+
become: yes
46+
gather_facts: yes
47+
tasks:
48+
- import_role:
49+
name: openondemand
50+
tasks_from: rstudio_compute.yml
51+
when: appliances_mode != 'configure' # is run during build
52+
53+
- hosts: openondemand_codeserver
54+
tags:
55+
- openondemand
56+
- openondemand_codeserver
57+
become: yes
58+
gather_facts: yes
59+
tasks:
60+
- import_role:
61+
name: openondemand
62+
tasks_from: codeserver_compute.yml
63+
when: appliances_mode != 'configure' # is run during build

ansible/roles/lustre/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ lustre_mount_state: mounted
66
lustre_mount_options: 'defaults,_netdev,noauto,x-systemd.automount,x-systemd.requires=lnet.service,nosuid,nodev'
77

88
# below variables are for build and should not generally require changes
9-
lustre_repo: "git://git.whamcloud.com/fs/lustre-release.git"
9+
lustre_repo: "https://github.com/lustre/lustre-release.git"
1010
lustre_build_packages:
1111
- "kernel-devel-{{ ansible_kernel }}"
1212
- git

ansible/roles/openondemand/defaults/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ openondemand_desktop_screensaver: false
2424
openondemand_filesapp_paths: []
2525
openondemand_jupyter_partition: ''
2626
openondemand_dashboard_links: []
27+
openondemand_rstudio_partition: ''
28+
openondemand_matlab_partition: ''
29+
openondemand_codeserver_partition: ''
2730

2831
# Monitoring:
2932
openondemand_exporter: true
@@ -100,3 +103,7 @@ openondemand_osc_ood_defaults:
100103
oidc_uri: "{{ openondemand_auth_defaults.oidc.oidc_uri if (openondemand_auth | lower) == 'oidc' else none }}"
101104
ood_auth_openidc: "{{ openondemand_auth_defaults.oidc.ood_auth_openidc if (openondemand_auth | lower) == 'oidc' else none }}"
102105
httpd_auth: "{{ openondemand_auth_defaults[openondemand_auth | lower].httpd_auth }}"
106+
107+
openondemand_code_server_version: 4.102.2
108+
openondemand_rstudio_version: 2025.05.1-513
109+
openondemand_matlab_version: ''
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
- name: Download Code Server RPM
2+
ansible.builtin.get_url:
3+
url: "https://github.com/coder/code-server/releases/download/v{{ openondemand_code_server_version }}/code-server-{{ openondemand_code_server_version }}-amd64.rpm"
4+
dest: /tmp/code-server.rpm
5+
mode: '0644'
6+
7+
- name: Install Code Server
8+
ansible.builtin.dnf:
9+
name: /tmp/code-server.rpm
10+
state: present
11+
disable_gpg_check: yes
12+
13+
- name: Create module directory for Code Server
14+
ansible.builtin.file:
15+
path: /opt/ohpc/pub/modulefiles/code-server
16+
state: directory
17+
mode: '0755'
18+
recurse: yes
19+
20+
- name: Create modulefile for Code Server
21+
copy:
22+
dest: "/opt/ohpc/pub/modulefiles/code-server/{{ openondemand_code_server_version }}"
23+
mode: "0644"
24+
content: |
25+
#%Module1.0#####################################################################
26+
27+
proc ModulesHelp { } {
28+
puts stderr "This module loads code-server {{ openondemand_code_server_version }}."
29+
puts stderr "\nCode Server provides a browser-based VSCode instance.\n"
30+
}
31+
32+
module-whatis "Name: code-server"
33+
module-whatis "Version: {{ openondemand_code_server_version }}"
34+
module-whatis "Category: IDE"
35+
module-whatis "Description: Run VS Code in your browser with Code Server"
36+
module-whatis "URL: https://github.com/coder/code-server"
37+
38+
set root /usr/bin/code-server
39+
40+
prepend-path PATH $root
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Should be run on compute nodes you want to run RStudio on
2+
# See https://osc.github.io/ood-documentation/latest/tutorials/tutorials-interactive-apps/add-rstudio.html
3+
# - Will already have lmod
4+
5+
- name: Install R from EPEL
6+
ansible.builtin.dnf:
7+
name: R
8+
state: present
9+
10+
- name: Download RStudio Server RPM
11+
ansible.builtin.get_url:
12+
url: "https://download2.rstudio.org/server/rhel{{ ansible_distribution_major_version }}/x86_64/rstudio-server-rhel-{{ openondemand_rstudio_version }}-x86_64.rpm"
13+
dest: /tmp/rstudio-server.rpm
14+
mode: '0644'
15+
16+
- name: Install RStudio Server
17+
ansible.builtin.dnf:
18+
name: /tmp/rstudio-server.rpm
19+
state: present
20+
disable_gpg_check: yes
21+
22+
- name: Create module directory for RStudio Server
23+
ansible.builtin.file:
24+
path: /opt/ohpc/pub/modulefiles/rstudio-server
25+
state: directory
26+
mode: '0755'
27+
recurse: yes
28+
29+
- name: Write modulefile for RStudio Server
30+
ansible.builtin.copy:
31+
dest: "/opt/ohpc/pub/modulefiles/rstudio-server/{{ openondemand_rstudio_version }}"
32+
mode: '0644'
33+
content: |
34+
#%Module1.0#####################################################################
35+
36+
proc ModulesHelp { } {
37+
puts stderr " "
38+
puts stderr "This module loads RStudio Server {{ openondemand_rstudio_version }}"
39+
puts stderr "\nRStudio Server provides a browser-based interface to R.\n"
40+
}
41+
42+
module-whatis "Name: rstudio-server"
43+
module-whatis "Version: {{ openondemand_rstudio_version }}"
44+
module-whatis "Category: IDE"
45+
module-whatis "Description: RStudio Server - IDE for R"
46+
module-whatis "URL: https://www.rstudio.com"
47+
48+
set root /usr/lib/rstudio-server
49+
50+
prepend-path PATH $root/bin

docs/openondemand.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,17 @@ For examples of all of the above see the `smslabs-example` environment in this r
2222
# Enabling Open OnDemand
2323
To enable the Open OnDemand server, add single host to the `openondemand` inventory group. Generally, this should be a node in the `login` group, as Open OnDemand must be able to access Slurm commands.
2424

25-
To enable compute nodes for virtual desktops or Jupyter notebook servers (accessed through the Open OnDemand portal), add nodes/groups to the `openondemand_desktop` and `openondemand_jupyter` inventory groups respectively. These may be all or a subset of the `compute` group.
25+
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

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

29+
## MATLAB
30+
*NB* Due to licensing, the MATLAB batch connect app requires a MATLAB intallation to be present on the relevant compute nodes. The MATLAB app is therefore disabled by default, and must be enabled by setting `openondemand_matlab_partition` in e.g. `environments/site/inventory/group_vars/all/openondemand.yml` to the name of the partition where MATLAB is available.
31+
32+
An Lmod modulefile also needs to be available on compute nodes - this is not provided by the appliance. See e.g.`roles/openondemand/tasks/rstudio_compute.yml` for an example. The modulefile must be named `matlab/$MATLAB_VERSION`, where the version matches thes `openondemand_matlab_version` variable. This variable is set to empty in the role default so must be defined in `environments/site/inventory/group_vars/all/openondemand.yml`.
33+
34+
As MATLAB requires a remote desktop, the TurboVNC and Xfce Desktop packages and configuration from the "openondemand_desktop" app will be automatically applied to nodes where the MATLAB app is enabled.
35+
2936
# Default configuration
3037

3138
See the [ansible/roles/openondemand/README.md](../ansible/roles/openondemand/README.md) for more details on the variables described below.
@@ -39,7 +46,7 @@ The following variables have been given default values to allow Open OnDemand to
3946
self-signed certificate is generated, which should probably be replaced for
4047
production environments.
4148
- `openondemand_auth` and any corresponding options. Defaults to `basic_pam`.
42-
- `openondemand_desktop_partition` and `openondemand_jupyter_partition` if the corresponding inventory groups are defined. Defaults to the first compute group defined in the `compute` OpenTofu variable in `environments/$ENV/tofu`.
49+
- `openondemand_desktop_partition`, `openondemand_jupyter_partition`, `openondemand_rstudio_partition`, and `openondemand_codeserver_partition` if the corresponding inventory groups are defined. Defaults to the first compute group defined in the `compute` OpenTofu variable in `environments/$ENV/tofu`. Note `openondemand_matlab_partition` is not set due to the additional requirements discussed above.
4350

4451
It is also recommended to set:
4552
- `openondemand_dashboard_support_url`
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
openondemand_auth: basic_pam
22
openondemand_jupyter_partition: standard
33
openondemand_desktop_partition: standard
4+
openondemand_rstudio_partition: standard
5+
openondemand_codeserver_partition: standard
46
#openondemand_dashboard_support_url:
57
#openondemand_dashboard_docs_url:
68
#openondemand_filesapp_paths:
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"cluster_image": {
3-
"RL8": "openhpc-RL8-250805-1410-35724c15",
4-
"RL9": "openhpc-RL9-250805-1409-35724c15"
3+
"RL8": "openhpc-RL8-250808-1727-faa44755",
4+
"RL9": "openhpc-RL9-250808-1727-faa44755"
55
}
66
}

0 commit comments

Comments
 (0)