Skip to content

Add Rstudio, VSCode, Matlab to OOD application catalogue #738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Aug 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c00d818
configure rstudio on compute node
bertiethorpe Jul 15, 2025
61668fe
Merge branch 'main' into feat/extend-ood
bertiethorpe Jul 15, 2025
5aa3a43
configure rstudio app on compute node
bertiethorpe Jul 16, 2025
724cdb4
fix rstudio_compute.yml
bertiethorpe Jul 16, 2025
eba6697
improve ood app install logic
bertiethorpe Jul 16, 2025
4d1f816
Add MATLAB ood app configuration
bertiethorpe Jul 17, 2025
741d0da
add and configure VSCode OOD app
bertiethorpe Jul 17, 2025
58727d8
WIP: debug rstudio app errors
bertiethorpe Jul 21, 2025
05db2e2
reconfigure ood code-server app
bertiethorpe Jul 29, 2025
9c925f6
Document lack of out-the-box MATLAB functionality
bertiethorpe Aug 7, 2025
f31957c
remove groups
bertiethorpe Aug 7, 2025
d57537c
Merge branch 'main' into feat/extend-ood
bertiethorpe Aug 7, 2025
ad17cb6
re-add inventory
bertiethorpe Aug 7, 2025
2359a7a
bump CI images
bertiethorpe Aug 7, 2025
32d05b9
Use lustre-release mirror
bertiethorpe Aug 8, 2025
ffdc43c
bump ood app releases, update matlab submit script, optimise portal.yml
bertiethorpe Aug 8, 2025
914aa6b
fix widget selection order
bertiethorpe Aug 8, 2025
faa4475
openondemand.md improvements
bertiethorpe Aug 8, 2025
ea0b46d
bump CI images
bertiethorpe Aug 8, 2025
0d53929
undo bastion edit
bertiethorpe Aug 8, 2025
32c613c
del duplicate sentence in openondemand.md
bertiethorpe Aug 12, 2025
ea92e0a
Update docs/openondemand.md
bertiethorpe Aug 12, 2025
3722757
Merge branch 'main' into feat/extend-ood
bertiethorpe Aug 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion ansible/portal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
name: openondemand
tasks_from: main.yml

- hosts: openondemand_desktop
- hosts: openondemand_desktop:openondemand_matlab
tags:
- openondemand
- openondemand_desktop
- openondemand_matlab
become: yes
gather_facts: yes
tasks:
Expand All @@ -36,3 +37,27 @@
name: openondemand
tasks_from: jupyter_compute.yml
when: appliances_mode != 'configure' # is run during build

- hosts: openondemand_rstudio
tags:
- openondemand
- openondemand_rstudio
become: yes
gather_facts: yes
tasks:
- import_role:
name: openondemand
tasks_from: rstudio_compute.yml
when: appliances_mode != 'configure' # is run during build

- hosts: openondemand_codeserver
tags:
- openondemand
- openondemand_codeserver
become: yes
gather_facts: yes
tasks:
- import_role:
name: openondemand
tasks_from: codeserver_compute.yml
when: appliances_mode != 'configure' # is run during build
2 changes: 1 addition & 1 deletion ansible/roles/lustre/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ lustre_mount_state: mounted
lustre_mount_options: 'defaults,_netdev,noauto,x-systemd.automount,x-systemd.requires=lnet.service,nosuid,nodev'

# below variables are for build and should not generally require changes
lustre_repo: "git://git.whamcloud.com/fs/lustre-release.git"
lustre_repo: "https://github.com/lustre/lustre-release.git"
lustre_build_packages:
- "kernel-devel-{{ ansible_kernel }}"
- git
Expand Down
7 changes: 7 additions & 0 deletions ansible/roles/openondemand/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ openondemand_desktop_screensaver: false
openondemand_filesapp_paths: []
openondemand_jupyter_partition: ''
openondemand_dashboard_links: []
openondemand_rstudio_partition: ''
openondemand_matlab_partition: ''
openondemand_codeserver_partition: ''

# Monitoring:
openondemand_exporter: true
Expand Down Expand Up @@ -100,3 +103,7 @@ openondemand_osc_ood_defaults:
oidc_uri: "{{ openondemand_auth_defaults.oidc.oidc_uri if (openondemand_auth | lower) == 'oidc' else none }}"
ood_auth_openidc: "{{ openondemand_auth_defaults.oidc.ood_auth_openidc if (openondemand_auth | lower) == 'oidc' else none }}"
httpd_auth: "{{ openondemand_auth_defaults[openondemand_auth | lower].httpd_auth }}"

openondemand_code_server_version: 4.102.2
openondemand_rstudio_version: 2025.05.1-513
openondemand_matlab_version: ''
40 changes: 40 additions & 0 deletions ansible/roles/openondemand/tasks/codeserver_compute.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
- name: Download Code Server RPM
ansible.builtin.get_url:
url: "https://github.com/coder/code-server/releases/download/v{{ openondemand_code_server_version }}/code-server-{{ openondemand_code_server_version }}-amd64.rpm"
dest: /tmp/code-server.rpm
mode: '0644'

- name: Install Code Server
ansible.builtin.dnf:
name: /tmp/code-server.rpm
state: present
disable_gpg_check: yes

- name: Create module directory for Code Server
ansible.builtin.file:
path: /opt/ohpc/pub/modulefiles/code-server
state: directory
mode: '0755'
recurse: yes

- name: Create modulefile for Code Server
copy:
dest: "/opt/ohpc/pub/modulefiles/code-server/{{ openondemand_code_server_version }}"
mode: "0644"
content: |
#%Module1.0#####################################################################

proc ModulesHelp { } {
puts stderr "This module loads code-server {{ openondemand_code_server_version }}."
puts stderr "\nCode Server provides a browser-based VSCode instance.\n"
}

module-whatis "Name: code-server"
module-whatis "Version: {{ openondemand_code_server_version }}"
module-whatis "Category: IDE"
module-whatis "Description: Run VS Code in your browser with Code Server"
module-whatis "URL: https://github.com/coder/code-server"

set root /usr/bin/code-server

prepend-path PATH $root
50 changes: 50 additions & 0 deletions ansible/roles/openondemand/tasks/rstudio_compute.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Should be run on compute nodes you want to run RStudio on
# See https://osc.github.io/ood-documentation/latest/tutorials/tutorials-interactive-apps/add-rstudio.html
# - Will already have lmod

- name: Install R from EPEL
ansible.builtin.dnf:
name: R
state: present

- name: Download RStudio Server RPM
ansible.builtin.get_url:
url: "https://download2.rstudio.org/server/rhel{{ ansible_distribution_major_version }}/x86_64/rstudio-server-rhel-{{ openondemand_rstudio_version }}-x86_64.rpm"
dest: /tmp/rstudio-server.rpm
mode: '0644'

- name: Install RStudio Server
ansible.builtin.dnf:
name: /tmp/rstudio-server.rpm
state: present
disable_gpg_check: yes

- name: Create module directory for RStudio Server
ansible.builtin.file:
path: /opt/ohpc/pub/modulefiles/rstudio-server
state: directory
mode: '0755'
recurse: yes

- name: Write modulefile for RStudio Server
ansible.builtin.copy:
dest: "/opt/ohpc/pub/modulefiles/rstudio-server/{{ openondemand_rstudio_version }}"
mode: '0644'
content: |
#%Module1.0#####################################################################

proc ModulesHelp { } {
puts stderr " "
puts stderr "This module loads RStudio Server {{ openondemand_rstudio_version }}"
puts stderr "\nRStudio Server provides a browser-based interface to R.\n"
}

module-whatis "Name: rstudio-server"
module-whatis "Version: {{ openondemand_rstudio_version }}"
module-whatis "Category: IDE"
module-whatis "Description: RStudio Server - IDE for R"
module-whatis "URL: https://www.rstudio.com"

set root /usr/lib/rstudio-server

prepend-path PATH $root/bin
11 changes: 9 additions & 2 deletions docs/openondemand.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,17 @@ For examples of all of the above see the `smslabs-example` environment in this r
# Enabling Open OnDemand
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.

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.
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.

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

## MATLAB
*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.

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`.

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.

# Default configuration

See the [ansible/roles/openondemand/README.md](../ansible/roles/openondemand/README.md) for more details on the variables described below.
Expand All @@ -39,7 +46,7 @@ The following variables have been given default values to allow Open OnDemand to
self-signed certificate is generated, which should probably be replaced for
production environments.
- `openondemand_auth` and any corresponding options. Defaults to `basic_pam`.
- `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`.
- `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.

It is also recommended to set:
- `openondemand_dashboard_support_url`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
openondemand_auth: basic_pam
openondemand_jupyter_partition: standard
openondemand_desktop_partition: standard
openondemand_rstudio_partition: standard
openondemand_codeserver_partition: standard
#openondemand_dashboard_support_url:
#openondemand_dashboard_docs_url:
#openondemand_filesapp_paths:
4 changes: 2 additions & 2 deletions environments/.stackhpc/tofu/cluster_image.auto.tfvars.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"cluster_image": {
"RL8": "openhpc-RL8-250805-1410-35724c15",
"RL9": "openhpc-RL9-250805-1409-35724c15"
"RL8": "openhpc-RL8-250808-1727-faa44755",
"RL9": "openhpc-RL9-250808-1727-faa44755"
}
}
Loading