From c00d818c40e520192c2ef981f33b0924140e3893 Mon Sep 17 00:00:00 2001 From: bertiethorpe Date: Tue, 15 Jul 2025 16:31:50 +0000 Subject: [PATCH 01/20] configure rstudio on compute node --- ansible/portal.yml | 12 +++++ ansible/roles/openondemand/defaults/main.yml | 1 + .../openondemand/tasks/rstudio_compute.yml | 4 ++ .../inventory/group_vars/all/openondemand.yml | 1 + .../inventory/group_vars/all/openondemand.yml | 53 +++++++++++++++++-- environments/common/inventory/groups | 3 ++ environments/common/layouts/everything | 4 ++ 7 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 ansible/roles/openondemand/tasks/rstudio_compute.yml diff --git a/ansible/portal.yml b/ansible/portal.yml index d34beca57..e04e20a23 100644 --- a/ansible/portal.yml +++ b/ansible/portal.yml @@ -36,3 +36,15 @@ 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 diff --git a/ansible/roles/openondemand/defaults/main.yml b/ansible/roles/openondemand/defaults/main.yml index 23359f01c..03a26f7c2 100644 --- a/ansible/roles/openondemand/defaults/main.yml +++ b/ansible/roles/openondemand/defaults/main.yml @@ -24,6 +24,7 @@ openondemand_desktop_screensaver: false openondemand_filesapp_paths: [] openondemand_jupyter_partition: '' openondemand_dashboard_links: [] +openondemand_rstudio_partition: '' # Monitoring: openondemand_exporter: true diff --git a/ansible/roles/openondemand/tasks/rstudio_compute.yml b/ansible/roles/openondemand/tasks/rstudio_compute.yml new file mode 100644 index 000000000..b94522f0b --- /dev/null +++ b/ansible/roles/openondemand/tasks/rstudio_compute.yml @@ -0,0 +1,4 @@ +# 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 + diff --git a/environments/.stackhpc/inventory/group_vars/all/openondemand.yml b/environments/.stackhpc/inventory/group_vars/all/openondemand.yml index 735da25df..6ee37557e 100644 --- a/environments/.stackhpc/inventory/group_vars/all/openondemand.yml +++ b/environments/.stackhpc/inventory/group_vars/all/openondemand.yml @@ -1,6 +1,7 @@ openondemand_auth: basic_pam openondemand_jupyter_partition: standard openondemand_desktop_partition: standard +openondemand_rstudio_partition: standard #openondemand_dashboard_support_url: #openondemand_dashboard_docs_url: #openondemand_filesapp_paths: diff --git a/environments/common/inventory/group_vars/all/openondemand.yml b/environments/common/inventory/group_vars/all/openondemand.yml index f2998f4ab..6c7171f8c 100644 --- a/environments/common/inventory/group_vars/all/openondemand.yml +++ b/environments/common/inventory/group_vars/all/openondemand.yml @@ -14,6 +14,7 @@ openondemand_auth: basic_pam openondemand_jupyter_partition: "{{ openhpc_partitions[0]['name'] }}" openondemand_desktop_partition: "{{ openhpc_partitions[0]['name'] }}" +openondemand_rstudio_partition: "{{ openhpc_partitions[0]['name'] }}" # Regex defining hosts which openondemand can proxy; the default regex is compute nodes (for apps) and grafana host, # e.g. if the group `compute` has hosts `compute-{0,1,2,..}` this will be '(compute-\d+)|(control)'. @@ -47,8 +48,6 @@ openondemand_clusters: basic: script_wrapper: | module purge - export PATH=/opt/jupyter-py39/bin/:$PATH - %s set_host: host=$(hostname -s) vnc: script_wrapper: | @@ -87,7 +86,10 @@ openondemand_install_apps_default: jupyter: repo: https://github.com/OSC/bc_example_jupyter.git version: master # defaults (optional) -openondemand_install_apps_extra: {} # mapping, values as for ansible.builtin.git: repo (required)/dest/version(default main)/umask +openondemand_install_apps_extra: # mapping, values as for ansible.builtin.git: repo (required)/dest/version(default main)/umask + rstudio: + repo: https://github.com/stackhpc/ood-stackhpc-rstudio.git + version: main # osc:ood role var (NB only active when not in configure): ood_install_apps: "{{ openondemand_install_apps_default if openondemand_jupyter_partition | default(none) else {} | combine(openondemand_install_apps_extra) }}" @@ -151,6 +153,10 @@ openondemand_apps_jupyter_default: --- batch_connect: template: "basic" + script_wrapper: | + module purge + export PATH=/opt/jupyter-py39/bin/:$PATH + %s script: job_name: "ood-jupyter" native: @@ -159,6 +165,47 @@ openondemand_apps_jupyter_default: - <%= "--nodelist=#{node}" %> openondemand_apps_jupyter: "{{ {'jupyter':openondemand_apps_jupyter_default} if openondemand_jupyter_partition | default(none) else {} }}" +openondemand_apps_rstudio_default: + title: RStudio + description: Request a RStudio server + cluster: slurm + form: + - bc_queue + - rstudio_module + - bc_num_hours + - num_cores + - node + attributes: + num_cores: + label: Number of cores FOO + value: 1 + bc_queue: + value: "{{ openondemand_rstudio_partition | default(none) }}" + node: "" + rstudio_module: + label: RStudio module + required: true + cachable: true + help: Choose your RStudio module - 2023.09 is only for el8 partitions + widget: select + options: + - ["RStudio-Server/2022.07.2+576-foss-2022a-Java-11-R-4.2.1", "RStudio-Server/2022.07.2+576-foss-2022a-Java-11-R-4.2.1"] + - ["RStudio-Server/1.4.1717-foss-2021a-Java-11-R-4.1.0", "RStudio-Server/1.4.1717-foss-2021a-Java-11-R-4.1.0"] + - ["RStudio-Server/2023.09.1+494-foss-2023a-Java-11-R-4.3.2", "RStudio-Server/2023.09.1+494-foss-2023a-Java-11-R-4.3.2"] + submit: | + --- + batch_connect: + template: "basic" + conn_params: + - csrf_token + script: + job_name: "ood-rstudio" + native: + - <%= "--nodes=1" %> + - <%= "--ntasks=#{num_cores}" %> + - <%= "--nodelist=#{node}" %> +openondemand_apps_rstudio: "{{ {'rstudio':openondemand_apps_rstudio_default} if openondemand_rstudio_partition | default(none) else {} }}" + # osc.ood:ood_apps - see https://github.com/OSC/ood-ansible#ood_apps openondemand_dashboard_support_url: '' openondemand_dashboard_docs_url: '' diff --git a/environments/common/inventory/groups b/environments/common/inventory/groups index 1cc5523fb..e38ec46eb 100644 --- a/environments/common/inventory/groups +++ b/environments/common/inventory/groups @@ -88,6 +88,9 @@ fail2ban [openondemand_jupyter] # Subset of compute to run a Jupyter Notebook servers on via Open Ondemand +[openondemand_rstudio] +# Subset of compute to run RStudio servers on via Open Ondemand + [etc_hosts] # Hosts to manage /etc/hosts e.g. if no internal DNS. See ansible/roles/etc_hosts/README.md diff --git a/environments/common/layouts/everything b/environments/common/layouts/everything index b7a7035e6..a4efaf9d2 100644 --- a/environments/common/layouts/everything +++ b/environments/common/layouts/everything @@ -55,6 +55,10 @@ compute # Subset of compute to run a Jupyter Notebook servers on via Open Ondemand compute +[openondemand_rstudio:children] +# Subset of compute to run RStudio servers on via Open Ondemand +compute + [etc_hosts:children] # Hosts to manage /etc/hosts e.g. if no internal DNS. See ansible/roles/etc_hosts/README.md cluster From 5aa3a43c25e05c0465295da81f63afdb065f2ed4 Mon Sep 17 00:00:00 2001 From: bertiethorpe Date: Wed, 16 Jul 2025 08:36:56 +0000 Subject: [PATCH 02/20] configure rstudio app on compute node --- .../openondemand/tasks/rstudio_compute.yml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/ansible/roles/openondemand/tasks/rstudio_compute.yml b/ansible/roles/openondemand/tasks/rstudio_compute.yml index b94522f0b..215dc1163 100644 --- a/ansible/roles/openondemand/tasks/rstudio_compute.yml +++ b/ansible/roles/openondemand/tasks/rstudio_compute.yml @@ -2,3 +2,30 @@ # See https://osc.github.io/ood-documentation/latest/tutorials/tutorials-interactive-apps/add-rstudio.html # - Will already have lmod +- name: Install R and RStudio Server on RHEL-based system + hosts: all + become: true + tasks: + - name: Install EPEL and dependencies + ansible.builtin.yum: + name: + - epel-release + - R + state: present + + - name: Download RStudio Server RPM + ansible.builtin.get_url: + url: https://download2.rstudio.org/server/centos8/x86_64/rstudio-server-rhel-2023.12.1-402-x86_64.rpm + dest: /tmp/rstudio-server.rpm + mode: '0644' + + - name: Install RStudio Server + ansible.builtin.yum: + name: /tmp/rstudio-server.rpm + state: present + + - name: Ensure rstudio-server service is enabled and stopped (used only in OOD job) + ansible.builtin.service: + name: rstudio-server + enabled: false + state: stopped From 724cdb479512726a8c31888501b9bc34d87423f8 Mon Sep 17 00:00:00 2001 From: bertiethorpe Date: Wed, 16 Jul 2025 10:40:22 +0000 Subject: [PATCH 03/20] fix rstudio_compute.yml --- .../openondemand/tasks/rstudio_compute.yml | 44 +++++++++---------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/ansible/roles/openondemand/tasks/rstudio_compute.yml b/ansible/roles/openondemand/tasks/rstudio_compute.yml index 215dc1163..515647d86 100644 --- a/ansible/roles/openondemand/tasks/rstudio_compute.yml +++ b/ansible/roles/openondemand/tasks/rstudio_compute.yml @@ -2,30 +2,26 @@ # See https://osc.github.io/ood-documentation/latest/tutorials/tutorials-interactive-apps/add-rstudio.html # - Will already have lmod -- name: Install R and RStudio Server on RHEL-based system - hosts: all - become: true - tasks: - - name: Install EPEL and dependencies - ansible.builtin.yum: - name: - - epel-release - - R - state: present +- name: Install EPEL and dependencies + ansible.builtin.yum: + name: + - epel-release + - R + state: present - - name: Download RStudio Server RPM - ansible.builtin.get_url: - url: https://download2.rstudio.org/server/centos8/x86_64/rstudio-server-rhel-2023.12.1-402-x86_64.rpm - dest: /tmp/rstudio-server.rpm - mode: '0644' +- name: Download RStudio Server RPM + ansible.builtin.get_url: + url: https://download2.rstudio.org/server/centos8/x86_64/rstudio-server-rhel-2023.12.1-402-x86_64.rpm + dest: /tmp/rstudio-server.rpm + mode: '0644' - - name: Install RStudio Server - ansible.builtin.yum: - name: /tmp/rstudio-server.rpm - state: present +- name: Install RStudio Server + ansible.builtin.yum: + name: /tmp/rstudio-server.rpm + state: present - - name: Ensure rstudio-server service is enabled and stopped (used only in OOD job) - ansible.builtin.service: - name: rstudio-server - enabled: false - state: stopped +- name: Ensure rstudio-server service is disabled and stopped + ansible.builtin.service: + name: rstudio-server + enabled: false + state: stopped From eba66972dacde642b73564a15da6431f3d068852 Mon Sep 17 00:00:00 2001 From: bertiethorpe Date: Wed, 16 Jul 2025 17:10:10 +0000 Subject: [PATCH 04/20] improve ood app install logic --- .../inventory/group_vars/all/openondemand.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/environments/common/inventory/group_vars/all/openondemand.yml b/environments/common/inventory/group_vars/all/openondemand.yml index 6c7171f8c..bc27dcf41 100644 --- a/environments/common/inventory/group_vars/all/openondemand.yml +++ b/environments/common/inventory/group_vars/all/openondemand.yml @@ -82,16 +82,21 @@ openondemand_clusters_grafana: jobid: "jobid" # define installation of openondemand apps (see openondemand_apps_* below for configuration): -openondemand_install_apps_default: +openondemand_install_app_jupyter: jupyter: repo: https://github.com/OSC/bc_example_jupyter.git version: master # defaults (optional) -openondemand_install_apps_extra: # mapping, values as for ansible.builtin.git: repo (required)/dest/version(default main)/umask +openondemand_install_app_rstudio: # mapping, values as for ansible.builtin.git: repo (required)/dest/version(default main)/umask rstudio: repo: https://github.com/stackhpc/ood-stackhpc-rstudio.git version: main # osc:ood role var (NB only active when not in configure): -ood_install_apps: "{{ openondemand_install_apps_default if openondemand_jupyter_partition | default(none) else {} | combine(openondemand_install_apps_extra) }}" +ood_install_apps: >- + {{ + {} + | combine(openondemand_install_app_jupyter if openondemand_jupyter_partition else {}) + | combine(openondemand_install_app_rstudio if openondemand_rstudio_partition else {}) + }} # https://github.com/OSC/ondemand/tree/master/apps/bc_desktop # also https://osc.github.io/ood-documentation/latest/enable-desktops/custom-job-submission.html#enable-desktops-custom-job-submission @@ -225,7 +230,7 @@ openondemand_apps: ood_brand_bg_color: "#0e6ec8" ood_dashboard_title: "{{ openhpc_cluster_name }}" -ood_apps: "{{ openondemand_apps | combine(openondemand_apps_jupyter) | combine(openondemand_apps_desktop) }}" +ood_apps: "{{ openondemand_apps | combine(openondemand_apps_jupyter) | combine(openondemand_apps_desktop) | combine(openondemand_apps_rstudio) }}" # Prometheus config for Open Ondemand exporter # https://osc.github.io/ood-documentation/latest/monitoring/prometheus.html#prometheus-configuration From 4d1f8161219b5de6001e20ad5033909e9936840f Mon Sep 17 00:00:00 2001 From: bertiethorpe Date: Thu, 17 Jul 2025 12:14:09 +0000 Subject: [PATCH 05/20] Add MATLAB ood app configuration --- ansible/portal.yml | 12 ++++++ ansible/roles/openondemand/defaults/main.yml | 1 + .../inventory/group_vars/all/openondemand.yml | 1 + .../inventory/group_vars/all/openondemand.yml | 41 ++++++++++++++++++- environments/common/inventory/groups | 3 ++ environments/common/layouts/everything | 4 ++ 6 files changed, 61 insertions(+), 1 deletion(-) diff --git a/ansible/portal.yml b/ansible/portal.yml index e04e20a23..8d94e218c 100644 --- a/ansible/portal.yml +++ b/ansible/portal.yml @@ -48,3 +48,15 @@ name: openondemand tasks_from: rstudio_compute.yml when: appliances_mode != 'configure' # is run during build + +- hosts: openondemand_matlab + tags: + - openondemand + - openondemand_matlab + become: yes + gather_facts: yes + tasks: + - import_role: + name: openondemand + tasks_from: vnc_compute.yml + when: appliances_mode != 'configure' # is run during build \ No newline at end of file diff --git a/ansible/roles/openondemand/defaults/main.yml b/ansible/roles/openondemand/defaults/main.yml index 03a26f7c2..340d07255 100644 --- a/ansible/roles/openondemand/defaults/main.yml +++ b/ansible/roles/openondemand/defaults/main.yml @@ -25,6 +25,7 @@ openondemand_filesapp_paths: [] openondemand_jupyter_partition: '' openondemand_dashboard_links: [] openondemand_rstudio_partition: '' +openondemand_matlab_partition: '' # Monitoring: openondemand_exporter: true diff --git a/environments/.stackhpc/inventory/group_vars/all/openondemand.yml b/environments/.stackhpc/inventory/group_vars/all/openondemand.yml index 6ee37557e..5cfd6d909 100644 --- a/environments/.stackhpc/inventory/group_vars/all/openondemand.yml +++ b/environments/.stackhpc/inventory/group_vars/all/openondemand.yml @@ -2,6 +2,7 @@ openondemand_auth: basic_pam openondemand_jupyter_partition: standard openondemand_desktop_partition: standard openondemand_rstudio_partition: standard +openondemand_matlab_partition: standard #openondemand_dashboard_support_url: #openondemand_dashboard_docs_url: #openondemand_filesapp_paths: diff --git a/environments/common/inventory/group_vars/all/openondemand.yml b/environments/common/inventory/group_vars/all/openondemand.yml index bc27dcf41..fa0f273a5 100644 --- a/environments/common/inventory/group_vars/all/openondemand.yml +++ b/environments/common/inventory/group_vars/all/openondemand.yml @@ -15,6 +15,7 @@ openondemand_auth: basic_pam openondemand_jupyter_partition: "{{ openhpc_partitions[0]['name'] }}" openondemand_desktop_partition: "{{ openhpc_partitions[0]['name'] }}" openondemand_rstudio_partition: "{{ openhpc_partitions[0]['name'] }}" +openondemand_matlab_partition: "{{ openhpc_partitions[0]['name'] }}" # Regex defining hosts which openondemand can proxy; the default regex is compute nodes (for apps) and grafana host, # 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: rstudio: repo: https://github.com/stackhpc/ood-stackhpc-rstudio.git version: main +openondemand_install_app_matlab: + matlab: + repo: https://github.com/stackhpc/ood-stackhpc-matlab.git + version: main # osc:ood role var (NB only active when not in configure): ood_install_apps: >- {{ {} | combine(openondemand_install_app_jupyter if openondemand_jupyter_partition else {}) | combine(openondemand_install_app_rstudio if openondemand_rstudio_partition else {}) + | combine(openondemand_install_app_matlab if openondemand_matlab_partition else {}) }} # https://github.com/OSC/ondemand/tree/master/apps/bc_desktop @@ -211,6 +217,39 @@ openondemand_apps_rstudio_default: - <%= "--nodelist=#{node}" %> openondemand_apps_rstudio: "{{ {'rstudio':openondemand_apps_rstudio_default} if openondemand_rstudio_partition | default(none) else {} }}" +openondemand_apps_matlab_default: + title: MATLAB + description: Request a desktop to run MATLAB. + cluster: slurm + form: + - desktop + - bc_queue + - bc_num_hours + - num_cores + - node + attributes: + desktop: xfce + # bc_account: # i.e. slurm account + # value: root + bc_queue: + value: "{{ openondemand_matlab_partition | default(none) }}" + num_cores: + label: Number of cores + value: 1 + node: + label: Node name + help: Select a particular node or leave empty to let Slurm pick the next available + value: "" + submit: | + --- + script: + job_name: "ood-matlab" + native: + - <%= "--nodes=1" %> + - <%= "--ntasks=#{num_cores}" %> + - <%= "--nodelist=#{node}" %> +openondemand_apps_matlab: "{{ {'matlab':openondemand_apps_matlab_default} if openondemand_matlab_partition | default(none) else {} }}" + # osc.ood:ood_apps - see https://github.com/OSC/ood-ansible#ood_apps openondemand_dashboard_support_url: '' openondemand_dashboard_docs_url: '' @@ -230,7 +269,7 @@ openondemand_apps: ood_brand_bg_color: "#0e6ec8" ood_dashboard_title: "{{ openhpc_cluster_name }}" -ood_apps: "{{ openondemand_apps | combine(openondemand_apps_jupyter) | combine(openondemand_apps_desktop) | combine(openondemand_apps_rstudio) }}" +ood_apps: "{{ openondemand_apps | combine(openondemand_apps_jupyter) | combine(openondemand_apps_desktop) | combine(openondemand_apps_rstudio) | combine(openondemand_apps_matlab) }}" # Prometheus config for Open Ondemand exporter # https://osc.github.io/ood-documentation/latest/monitoring/prometheus.html#prometheus-configuration diff --git a/environments/common/inventory/groups b/environments/common/inventory/groups index e38ec46eb..b95df7faa 100644 --- a/environments/common/inventory/groups +++ b/environments/common/inventory/groups @@ -91,6 +91,9 @@ fail2ban [openondemand_rstudio] # Subset of compute to run RStudio servers on via Open Ondemand +[openondemand_matlab] +# Subset of compute to run RStudio servers on via Open Ondemand + [etc_hosts] # Hosts to manage /etc/hosts e.g. if no internal DNS. See ansible/roles/etc_hosts/README.md diff --git a/environments/common/layouts/everything b/environments/common/layouts/everything index a4efaf9d2..911cf961e 100644 --- a/environments/common/layouts/everything +++ b/environments/common/layouts/everything @@ -59,6 +59,10 @@ compute # Subset of compute to run RStudio servers on via Open Ondemand compute +[openondemand_matlab:children] +# Subset of compute to run a MATLAB interactive desktop on via Open Ondemand +compute + [etc_hosts:children] # Hosts to manage /etc/hosts e.g. if no internal DNS. See ansible/roles/etc_hosts/README.md cluster From 741d0da870939412d644cf895df4122e02594066 Mon Sep 17 00:00:00 2001 From: bertiethorpe Date: Thu, 17 Jul 2025 14:18:54 +0000 Subject: [PATCH 06/20] add and configure VSCode OOD app --- ansible/portal.yml | 12 +++++ ansible/roles/openondemand/defaults/main.yml | 1 + .../openondemand/tasks/codeserver_compute.yml | 18 ++++++++ .../inventory/group_vars/all/openondemand.yml | 1 + .../inventory/group_vars/all/openondemand.yml | 46 ++++++++++++++++++- environments/common/inventory/groups | 3 ++ environments/common/layouts/everything | 4 ++ 7 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 ansible/roles/openondemand/tasks/codeserver_compute.yml diff --git a/ansible/portal.yml b/ansible/portal.yml index 8d94e218c..5eb7162ac 100644 --- a/ansible/portal.yml +++ b/ansible/portal.yml @@ -59,4 +59,16 @@ - import_role: name: openondemand tasks_from: vnc_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 \ No newline at end of file diff --git a/ansible/roles/openondemand/defaults/main.yml b/ansible/roles/openondemand/defaults/main.yml index 340d07255..b03da5736 100644 --- a/ansible/roles/openondemand/defaults/main.yml +++ b/ansible/roles/openondemand/defaults/main.yml @@ -26,6 +26,7 @@ openondemand_jupyter_partition: '' openondemand_dashboard_links: [] openondemand_rstudio_partition: '' openondemand_matlab_partition: '' +openondemand_codeserver_partition: '' # Monitoring: openondemand_exporter: true diff --git a/ansible/roles/openondemand/tasks/codeserver_compute.yml b/ansible/roles/openondemand/tasks/codeserver_compute.yml new file mode 100644 index 000000000..b496b36be --- /dev/null +++ b/ansible/roles/openondemand/tasks/codeserver_compute.yml @@ -0,0 +1,18 @@ +- name: Download code-server binary + get_url: + url: "https://github.com/coder/code-server/releases/download/v4.22.1/code-server-4.22.1-linux-amd64.tar.gz" + dest: "/tmp/code-server.tar.gz" + mode: '0644' + +- name: Extract code-server binary + unarchive: + src: "/tmp/code-server.tar.gz" + dest: "/opt/" + remote_src: yes + +- name: Symlink code-server to /usr/local/bin + file: + src: "/opt/code-server-4.22.1-linux-amd64/bin/code-server" + dest: "/usr/local/bin/code-server" + state: link + force: yes diff --git a/environments/.stackhpc/inventory/group_vars/all/openondemand.yml b/environments/.stackhpc/inventory/group_vars/all/openondemand.yml index 5cfd6d909..de0058147 100644 --- a/environments/.stackhpc/inventory/group_vars/all/openondemand.yml +++ b/environments/.stackhpc/inventory/group_vars/all/openondemand.yml @@ -3,6 +3,7 @@ openondemand_jupyter_partition: standard openondemand_desktop_partition: standard openondemand_rstudio_partition: standard openondemand_matlab_partition: standard +openondemand_codeserver_partition: standard #openondemand_dashboard_support_url: #openondemand_dashboard_docs_url: #openondemand_filesapp_paths: diff --git a/environments/common/inventory/group_vars/all/openondemand.yml b/environments/common/inventory/group_vars/all/openondemand.yml index fa0f273a5..30e679de9 100644 --- a/environments/common/inventory/group_vars/all/openondemand.yml +++ b/environments/common/inventory/group_vars/all/openondemand.yml @@ -16,6 +16,7 @@ openondemand_jupyter_partition: "{{ openhpc_partitions[0]['name'] }}" openondemand_desktop_partition: "{{ openhpc_partitions[0]['name'] }}" openondemand_rstudio_partition: "{{ openhpc_partitions[0]['name'] }}" openondemand_matlab_partition: "{{ openhpc_partitions[0]['name'] }}" +openondemand_codeserver_partition: "{{ openhpc_partitions[0]['name'] }}" # Regex defining hosts which openondemand can proxy; the default regex is compute nodes (for apps) and grafana host, # e.g. if the group `compute` has hosts `compute-{0,1,2,..}` this will be '(compute-\d+)|(control)'. @@ -95,6 +96,10 @@ openondemand_install_app_matlab: matlab: repo: https://github.com/stackhpc/ood-stackhpc-matlab.git version: main +openondemand_install_app_codeserver: + codeserver: + repo: https://github.com/stackhpc/bc_osc_codeserver.git + version: main # osc:ood role var (NB only active when not in configure): ood_install_apps: >- {{ @@ -102,6 +107,7 @@ ood_install_apps: >- | combine(openondemand_install_app_jupyter if openondemand_jupyter_partition else {}) | combine(openondemand_install_app_rstudio if openondemand_rstudio_partition else {}) | combine(openondemand_install_app_matlab if openondemand_matlab_partition else {}) + | combine(openondemand_install_app_codeserver if openondemand_codeserver_partition else {}) }} # https://github.com/OSC/ondemand/tree/master/apps/bc_desktop @@ -250,6 +256,36 @@ openondemand_apps_matlab_default: - <%= "--nodelist=#{node}" %> openondemand_apps_matlab: "{{ {'matlab':openondemand_apps_matlab_default} if openondemand_matlab_partition | default(none) else {} }}" +openondemand_apps_codeserver_default: + title: Codeserver + description: Request a Codeserver + cluster: slurm + form: + - bc_queue + - bc_num_hours + - num_cores + - node + attributes: # TODO + num_cores: + label: Number of cores FOO + value: 1 + bc_queue: + value: "{{ openondemand_codeserver_partition | default(none) }}" + node: "" + submit: | + --- + batch_connect: + template: "basic" + conn_params: + - code_server_version + script: + job_name: "ood-codeserver" + native: + - <%= "--nodes=1" %> + - <%= "--ntasks=#{num_cores}" %> + - <%= "--nodelist=#{node}" %> +openondemand_apps_codeserver: "{{ {'codeserver':openondemand_apps_codeserver_default} if openondemand_codeserver_partition | default(none) else {} }}" + # osc.ood:ood_apps - see https://github.com/OSC/ood-ansible#ood_apps openondemand_dashboard_support_url: '' openondemand_dashboard_docs_url: '' @@ -269,7 +305,15 @@ openondemand_apps: ood_brand_bg_color: "#0e6ec8" ood_dashboard_title: "{{ openhpc_cluster_name }}" -ood_apps: "{{ openondemand_apps | combine(openondemand_apps_jupyter) | combine(openondemand_apps_desktop) | combine(openondemand_apps_rstudio) | combine(openondemand_apps_matlab) }}" +ood_apps: >- + {{ + openondemand_apps + | combine(openondemand_apps_jupyter) + | combine(openondemand_apps_desktop) + | combine(openondemand_apps_rstudio) + | combine(openondemand_apps_matlab) + | combine(openondemand_apps_codeserver) + }} # Prometheus config for Open Ondemand exporter # https://osc.github.io/ood-documentation/latest/monitoring/prometheus.html#prometheus-configuration diff --git a/environments/common/inventory/groups b/environments/common/inventory/groups index b95df7faa..cc634e01b 100644 --- a/environments/common/inventory/groups +++ b/environments/common/inventory/groups @@ -94,6 +94,9 @@ fail2ban [openondemand_matlab] # Subset of compute to run RStudio servers on via Open Ondemand +[openondemand_codeserver] +# Subset of compute to run a Codeserver VSCode instance on via Open Ondemand + [etc_hosts] # Hosts to manage /etc/hosts e.g. if no internal DNS. See ansible/roles/etc_hosts/README.md diff --git a/environments/common/layouts/everything b/environments/common/layouts/everything index 911cf961e..b681e1681 100644 --- a/environments/common/layouts/everything +++ b/environments/common/layouts/everything @@ -63,6 +63,10 @@ compute # Subset of compute to run a MATLAB interactive desktop on via Open Ondemand compute +[openondemand_codeserver:children] +# Subset of compute to run a Codeserver VSCode instance on via Open Ondemand +compute + [etc_hosts:children] # Hosts to manage /etc/hosts e.g. if no internal DNS. See ansible/roles/etc_hosts/README.md cluster From 58727d84bf9383285e418e55b2426004723ef5b7 Mon Sep 17 00:00:00 2001 From: bertiethorpe Date: Mon, 21 Jul 2025 15:45:22 +0000 Subject: [PATCH 07/20] WIP: debug rstudio app errors --- .../inventory/group_vars/all/openondemand.yml | 72 ++++++++++++++----- 1 file changed, 56 insertions(+), 16 deletions(-) diff --git a/environments/common/inventory/group_vars/all/openondemand.yml b/environments/common/inventory/group_vars/all/openondemand.yml index 30e679de9..5dfc788e3 100644 --- a/environments/common/inventory/group_vars/all/openondemand.yml +++ b/environments/common/inventory/group_vars/all/openondemand.yml @@ -50,6 +50,7 @@ openondemand_clusters: basic: script_wrapper: | module purge + %s set_host: host=$(hostname -s) vnc: script_wrapper: | @@ -99,7 +100,7 @@ openondemand_install_app_matlab: openondemand_install_app_codeserver: codeserver: repo: https://github.com/stackhpc/bc_osc_codeserver.git - version: main + version: master # osc:ood role var (NB only active when not in configure): ood_install_apps: >- {{ @@ -186,19 +187,9 @@ openondemand_apps_rstudio_default: title: RStudio description: Request a RStudio server cluster: slurm - form: - - bc_queue - - rstudio_module - - bc_num_hours - - num_cores - - node attributes: - num_cores: - label: Number of cores FOO - value: 1 - bc_queue: + bc_queue: value: "{{ openondemand_rstudio_partition | default(none) }}" - node: "" rstudio_module: label: RStudio module required: true @@ -209,6 +200,49 @@ openondemand_apps_rstudio_default: - ["RStudio-Server/2022.07.2+576-foss-2022a-Java-11-R-4.2.1", "RStudio-Server/2022.07.2+576-foss-2022a-Java-11-R-4.2.1"] - ["RStudio-Server/1.4.1717-foss-2021a-Java-11-R-4.1.0", "RStudio-Server/1.4.1717-foss-2021a-Java-11-R-4.1.0"] - ["RStudio-Server/2023.09.1+494-foss-2023a-Java-11-R-4.3.2", "RStudio-Server/2023.09.1+494-foss-2023a-Java-11-R-4.3.2"] + extra_modules_script: + label: Extra modules script + 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 + widget: text_field + required: false + cores: + label: Number of CPU cores + help: How many CPU cores to reserve for your session. NB Ensure this is within the maximum allowed by your chosen partition. + widget: number_field + min: 1 + max: 48 + step: 1 + value: 1 + cachable: true + ram: + widget: number_field + label: RAM in GB + help: How much RAM to reserve for your session. NB Ensure this is within the maximum allowed by your chosen partition + min: 4 + max: 700 + step: 1 + value: 4 + cachable: true + bc_num_hours: + widget: number_field + help: Maximum runtime in hours for your session. NB Ensure this is within the maximum allowed by your chosen partition + min: 1 + max: 240 + step: 1 + value: 30 + cachable: true + bc_email_on_started: false + auto_modules_RStudio-Server: + default: false + form: + - bc_queue + - rstudio_module + - auto_queues + - extra_modules_script + - cores + - ram + - bc_num_hours + - bc_email_on_started submit: | --- batch_connect: @@ -216,11 +250,17 @@ openondemand_apps_rstudio_default: conn_params: - csrf_token script: - job_name: "ood-rstudio" native: - - <%= "--nodes=1" %> - - <%= "--ntasks=#{num_cores}" %> - - <%= "--nodelist=#{node}" %> + - "--partition" + - "<%= bc_queue %>" + - "--ntasks" + - "1" + - "--mem" + - "<%= ram.blank? ? 4 : ram.to_i %>G" + - "--cpus-per-task" + - "<%= cores.blank? ? 1 : cores.to_i %>"<% if auto_queues.start_with?("gpu") %> + - "--gpus-per-task" + - "1"<% end %> openondemand_apps_rstudio: "{{ {'rstudio':openondemand_apps_rstudio_default} if openondemand_rstudio_partition | default(none) else {} }}" openondemand_apps_matlab_default: From 05db2e2d5fe486925edb300298768ac5542e3377 Mon Sep 17 00:00:00 2001 From: bertiethorpe Date: Tue, 29 Jul 2025 10:25:26 +0000 Subject: [PATCH 08/20] reconfigure ood code-server app --- ansible/roles/openondemand/defaults/main.yml | 2 + .../openondemand/tasks/codeserver_compute.yml | 52 ++++++++++----- .../openondemand/tasks/rstudio_compute.yml | 48 ++++++++++---- .../inventory/group_vars/all/openondemand.yml | 65 ++++++++++++++----- 4 files changed, 124 insertions(+), 43 deletions(-) diff --git a/ansible/roles/openondemand/defaults/main.yml b/ansible/roles/openondemand/defaults/main.yml index b03da5736..699035ca0 100644 --- a/ansible/roles/openondemand/defaults/main.yml +++ b/ansible/roles/openondemand/defaults/main.yml @@ -103,3 +103,5 @@ 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 }}" + +code_server_version: 4.102.2 \ No newline at end of file diff --git a/ansible/roles/openondemand/tasks/codeserver_compute.yml b/ansible/roles/openondemand/tasks/codeserver_compute.yml index b496b36be..504b37d5f 100644 --- a/ansible/roles/openondemand/tasks/codeserver_compute.yml +++ b/ansible/roles/openondemand/tasks/codeserver_compute.yml @@ -1,18 +1,40 @@ -- name: Download code-server binary - get_url: - url: "https://github.com/coder/code-server/releases/download/v4.22.1/code-server-4.22.1-linux-amd64.tar.gz" - dest: "/tmp/code-server.tar.gz" +- name: Download Code Server RPM + ansible.builtin.get_url: + url: "https://github.com/coder/code-server/releases/download/v{{ code_server_version }}/code-server-{{ code_server_version }}-amd64.rpm" + dest: /tmp/code-server.rpm mode: '0644' -- name: Extract code-server binary - unarchive: - src: "/tmp/code-server.tar.gz" - dest: "/opt/" - remote_src: yes +- name: Install Code Server + ansible.builtin.dnf: + name: /tmp/code-server.rpm + state: present + disable_gpg_check: yes -- name: Symlink code-server to /usr/local/bin - file: - src: "/opt/code-server-4.22.1-linux-amd64/bin/code-server" - dest: "/usr/local/bin/code-server" - state: link - force: 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/{{ code_server_version }}" + mode: "0644" + content: | + #%Module1.0##################################################################### + + proc ModulesHelp { } { + puts stderr "This module loads code-server {{ code_server_version }}." + puts stderr "VS Code in the browser. Visit http://127.0.0.1:8080" + } + + module-whatis "Name: code-server" + module-whatis "Version: {{ 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 diff --git a/ansible/roles/openondemand/tasks/rstudio_compute.yml b/ansible/roles/openondemand/tasks/rstudio_compute.yml index 515647d86..0b67eccb4 100644 --- a/ansible/roles/openondemand/tasks/rstudio_compute.yml +++ b/ansible/roles/openondemand/tasks/rstudio_compute.yml @@ -2,26 +2,50 @@ # See https://osc.github.io/ood-documentation/latest/tutorials/tutorials-interactive-apps/add-rstudio.html # - Will already have lmod -- name: Install EPEL and dependencies - ansible.builtin.yum: - name: - - epel-release - - R +- 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/centos8/x86_64/rstudio-server-rhel-2023.12.1-402-x86_64.rpm + url: "https://download2.rstudio.org/server/rhel{{ ansible_distribution_major_version }}/x86_64/rstudio-server-rhel-2025.05.1-513-x86_64.rpm" dest: /tmp/rstudio-server.rpm mode: '0644' - name: Install RStudio Server - ansible.builtin.yum: + ansible.builtin.dnf: name: /tmp/rstudio-server.rpm state: present + disable_gpg_check: yes -- name: Ensure rstudio-server service is disabled and stopped - ansible.builtin.service: - name: rstudio-server - enabled: false - state: stopped +- 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/2025.05.1 + mode: '0644' + content: | + #%Module1.0##################################################################### + + proc ModulesHelp { } { + puts stderr " " + puts stderr "This module loads RStudio Server 2025.05.1" + puts stderr "\nRStudio Server provides a browser-based interface to R.\n" + } + + module-whatis "Name: rstudio-server" + module-whatis "Version: 2025.05.1" + module-whatis "Category: IDE" + module-whatis "Description: RStudio Server - IDE for R" + module-whatis "URL: https://www.rstudio.com" + + set version 2025.05.1 + set root /usr/lib/rstudio-server + + prepend-path PATH $root/bin diff --git a/environments/common/inventory/group_vars/all/openondemand.yml b/environments/common/inventory/group_vars/all/openondemand.yml index 5dfc788e3..ded10595a 100644 --- a/environments/common/inventory/group_vars/all/openondemand.yml +++ b/environments/common/inventory/group_vars/all/openondemand.yml @@ -194,12 +194,10 @@ openondemand_apps_rstudio_default: label: RStudio module required: true cachable: true - help: Choose your RStudio module - 2023.09 is only for el8 partitions + help: Choose your RStudio module widget: select options: - - ["RStudio-Server/2022.07.2+576-foss-2022a-Java-11-R-4.2.1", "RStudio-Server/2022.07.2+576-foss-2022a-Java-11-R-4.2.1"] - - ["RStudio-Server/1.4.1717-foss-2021a-Java-11-R-4.1.0", "RStudio-Server/1.4.1717-foss-2021a-Java-11-R-4.1.0"] - - ["RStudio-Server/2023.09.1+494-foss-2023a-Java-11-R-4.3.2", "RStudio-Server/2023.09.1+494-foss-2023a-Java-11-R-4.3.2"] + - ["rstudio-server/2025.05.1","rstudio-server/2025.05.1"] extra_modules_script: label: Extra modules script 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 @@ -297,21 +295,51 @@ openondemand_apps_matlab_default: openondemand_apps_matlab: "{{ {'matlab':openondemand_apps_matlab_default} if openondemand_matlab_partition | default(none) else {} }}" openondemand_apps_codeserver_default: - title: Codeserver - description: Request a Codeserver + title: Code Server + description: Request a Code Server cluster: slurm form: - bc_queue - bc_num_hours - - num_cores - - node - attributes: # TODO - num_cores: - label: Number of cores FOO - value: 1 + - codeserver_module + - cores + - ram + attributes: + codeserver_module: + label: Code Server module + required: true + cachable: true + help: Choose your Code Server module + widget: select + options: + - ["code-server/4.102.2","code-server/4.102.2"] bc_queue: value: "{{ openondemand_codeserver_partition | default(none) }}" - node: "" + cores: + label: Number of CPU cores + help: How many CPU cores to reserve for your session. NB Ensure this is within the maximum allowed by your chosen partition. + widget: number_field + min: 1 + max: 48 + step: 1 + value: 1 + cachable: true + ram: + widget: number_field + label: RAM in GB + help: How much RAM to reserve for your session. NB Ensure this is within the maximum allowed by your chosen partition + min: 4 + max: 700 + step: 1 + value: 4 + cachable: true + bc_num_hours: + widget: number_field + help: Maximum runtime in hours for your session. NB Ensure this is within the maximum allowed by your chosen partition + min: 1 + max: 240 + step: 1 + value: 30 submit: | --- batch_connect: @@ -321,9 +349,14 @@ openondemand_apps_codeserver_default: script: job_name: "ood-codeserver" native: - - <%= "--nodes=1" %> - - <%= "--ntasks=#{num_cores}" %> - - <%= "--nodelist=#{node}" %> + - "--partition" + - "<%= bc_queue %>" + - "--ntasks" + - "1" + - "--mem" + - "<%= ram.blank? ? 4 : ram.to_i %>G" + - "--cpus-per-task" + - "<%= cores.blank? ? 1 : cores.to_i %>" openondemand_apps_codeserver: "{{ {'codeserver':openondemand_apps_codeserver_default} if openondemand_codeserver_partition | default(none) else {} }}" # osc.ood:ood_apps - see https://github.com/OSC/ood-ansible#ood_apps From 9c925f63e174984823ba19b4eb4a52fb666db798 Mon Sep 17 00:00:00 2001 From: bertiethorpe Date: Thu, 7 Aug 2025 14:27:19 +0000 Subject: [PATCH 09/20] Document lack of out-the-box MATLAB functionality --- ansible/portal.yml | 1 + ansible/roles/openondemand/defaults/main.yml | 3 ++- .../openondemand/tasks/codeserver_compute.yml | 14 +++++++------- .../roles/openondemand/tasks/rstudio_compute.yml | 9 ++++----- docs/openondemand.md | 6 ++++-- .../inventory/group_vars/all/openondemand.yml | 1 - .../inventory/group_vars/all/openondemand.yml | 6 +++--- 7 files changed, 21 insertions(+), 19 deletions(-) diff --git a/ansible/portal.yml b/ansible/portal.yml index 5eb7162ac..049b4f4be 100644 --- a/ansible/portal.yml +++ b/ansible/portal.yml @@ -49,6 +49,7 @@ tasks_from: rstudio_compute.yml when: appliances_mode != 'configure' # is run during build +# Requires openondemand_matlab_partition to be set in group_vars, as well as MATLAB installed on target compute nodes - hosts: openondemand_matlab tags: - openondemand diff --git a/ansible/roles/openondemand/defaults/main.yml b/ansible/roles/openondemand/defaults/main.yml index 699035ca0..bfb9bc7f7 100644 --- a/ansible/roles/openondemand/defaults/main.yml +++ b/ansible/roles/openondemand/defaults/main.yml @@ -104,4 +104,5 @@ openondemand_osc_ood_defaults: 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 }}" -code_server_version: 4.102.2 \ No newline at end of file +ondemand_code_server_version: 4.102.2 +ondemand_rstudio_version: 2025.05.1-513 \ No newline at end of file diff --git a/ansible/roles/openondemand/tasks/codeserver_compute.yml b/ansible/roles/openondemand/tasks/codeserver_compute.yml index 504b37d5f..b36b49608 100644 --- a/ansible/roles/openondemand/tasks/codeserver_compute.yml +++ b/ansible/roles/openondemand/tasks/codeserver_compute.yml @@ -1,6 +1,6 @@ - name: Download Code Server RPM ansible.builtin.get_url: - url: "https://github.com/coder/code-server/releases/download/v{{ code_server_version }}/code-server-{{ code_server_version }}-amd64.rpm" + url: "https://github.com/coder/code-server/releases/download/v{{ ondemand_code_server_version }}/code-server-{{ ondemand_code_server_version }}-amd64.rpm" dest: /tmp/code-server.rpm mode: '0644' @@ -17,22 +17,22 @@ mode: '0755' recurse: yes -- name: Create modulefile for code-server +- name: Create modulefile for Code Server copy: - dest: "/opt/ohpc/pub/modulefiles/code-server/{{ code_server_version }}" + dest: "/opt/ohpc/pub/modulefiles/code-server/{{ ondemand_code_server_version }}" mode: "0644" content: | #%Module1.0##################################################################### proc ModulesHelp { } { - puts stderr "This module loads code-server {{ code_server_version }}." - puts stderr "VS Code in the browser. Visit http://127.0.0.1:8080" + puts stderr "This module loads code-server {{ ondemand_code_server_version }}." + puts stderr "\nCode Server provides a browser-based VSCode instance.\n" } module-whatis "Name: code-server" - module-whatis "Version: {{ code_server_version }}" + module-whatis "Version: {{ ondemand_code_server_version }}" module-whatis "Category: IDE" - module-whatis "Description: Run VS Code in your browser with code-server" + 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 diff --git a/ansible/roles/openondemand/tasks/rstudio_compute.yml b/ansible/roles/openondemand/tasks/rstudio_compute.yml index 0b67eccb4..457e2d7db 100644 --- a/ansible/roles/openondemand/tasks/rstudio_compute.yml +++ b/ansible/roles/openondemand/tasks/rstudio_compute.yml @@ -9,7 +9,7 @@ - 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-2025.05.1-513-x86_64.rpm" + url: "https://download2.rstudio.org/server/rhel{{ ansible_distribution_major_version }}/x86_64/rstudio-server-rhel-{{ ondemand_rstudio_version }}-x86_64.rpm" dest: /tmp/rstudio-server.rpm mode: '0644' @@ -28,24 +28,23 @@ - name: Write modulefile for RStudio Server ansible.builtin.copy: - dest: /opt/ohpc/pub/modulefiles/rstudio-server/2025.05.1 + dest: "/opt/ohpc/pub/modulefiles/rstudio-server/{{ ondemand_rstudio_version }}" mode: '0644' content: | #%Module1.0##################################################################### proc ModulesHelp { } { puts stderr " " - puts stderr "This module loads RStudio Server 2025.05.1" + puts stderr "This module loads RStudio Server {{ ondemand_rstudio_version }}" puts stderr "\nRStudio Server provides a browser-based interface to R.\n" } module-whatis "Name: rstudio-server" - module-whatis "Version: 2025.05.1" + module-whatis "Version: {{ ondemand_rstudio_version }}" module-whatis "Category: IDE" module-whatis "Description: RStudio Server - IDE for R" module-whatis "URL: https://www.rstudio.com" - set version 2025.05.1 set root /usr/lib/rstudio-server prepend-path PATH $root/bin diff --git a/docs/openondemand.md b/docs/openondemand.md index 70a3bc642..aa9ef1734 100644 --- a/docs/openondemand.md +++ b/docs/openondemand.md @@ -22,7 +22,9 @@ 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. + +*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. The above functionality is configured by running the `ansible/portal.yml` playbook. This is automatically run as part of `ansible/site.yml`. @@ -33,7 +35,7 @@ See the [ansible/roles/openondemand/README.md](../ansible/roles/openondemand/REA The following variables have been given default values to allow Open OnDemand to work in a newly created environment without additional configuration, but generally should be overridden in `environments/site/inventory/group_vars/all/` with site-specific values: - `openondemand_servername` - this must be defined for both `openondemand` and `grafana` hosts (when Grafana is enabled). Default is `ansible_host` (i.e. the IP address) of the first host in the `openondemand` group. - `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`. It is also recommended to set: - `openondemand_dashboard_support_url` diff --git a/environments/.stackhpc/inventory/group_vars/all/openondemand.yml b/environments/.stackhpc/inventory/group_vars/all/openondemand.yml index de0058147..a8f88e5c4 100644 --- a/environments/.stackhpc/inventory/group_vars/all/openondemand.yml +++ b/environments/.stackhpc/inventory/group_vars/all/openondemand.yml @@ -2,7 +2,6 @@ openondemand_auth: basic_pam openondemand_jupyter_partition: standard openondemand_desktop_partition: standard openondemand_rstudio_partition: standard -openondemand_matlab_partition: standard openondemand_codeserver_partition: standard #openondemand_dashboard_support_url: #openondemand_dashboard_docs_url: diff --git a/environments/common/inventory/group_vars/all/openondemand.yml b/environments/common/inventory/group_vars/all/openondemand.yml index ded10595a..666961f0b 100644 --- a/environments/common/inventory/group_vars/all/openondemand.yml +++ b/environments/common/inventory/group_vars/all/openondemand.yml @@ -15,7 +15,7 @@ openondemand_auth: basic_pam openondemand_jupyter_partition: "{{ openhpc_partitions[0]['name'] }}" openondemand_desktop_partition: "{{ openhpc_partitions[0]['name'] }}" openondemand_rstudio_partition: "{{ openhpc_partitions[0]['name'] }}" -openondemand_matlab_partition: "{{ openhpc_partitions[0]['name'] }}" +openondemand_matlab_partition: null # Requires target site to already have MATLAB so set to null openondemand_codeserver_partition: "{{ openhpc_partitions[0]['name'] }}" # Regex defining hosts which openondemand can proxy; the default regex is compute nodes (for apps) and grafana host, @@ -197,7 +197,7 @@ openondemand_apps_rstudio_default: help: Choose your RStudio module widget: select options: - - ["rstudio-server/2025.05.1","rstudio-server/2025.05.1"] + - ["rstudio-server/{{ ondemand_rstudio_version }}","RStudio v{{ ondemand_rstudio_version }}"] extra_modules_script: label: Extra modules script 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 @@ -312,7 +312,7 @@ openondemand_apps_codeserver_default: help: Choose your Code Server module widget: select options: - - ["code-server/4.102.2","code-server/4.102.2"] + - ["code-server/{{ ondemand_code_server_version }}","Code Server v{{ ondemand_code_server_version}}"] bc_queue: value: "{{ openondemand_codeserver_partition | default(none) }}" cores: From f31957c90645b1d8fff174d2801815f6a97bdbb3 Mon Sep 17 00:00:00 2001 From: bertiethorpe Date: Thu, 7 Aug 2025 15:11:34 +0000 Subject: [PATCH 10/20] remove groups --- environments/common/inventory/groups | 9 --------- environments/common/layouts/everything | 12 ------------ 2 files changed, 21 deletions(-) diff --git a/environments/common/inventory/groups b/environments/common/inventory/groups index cc634e01b..1cc5523fb 100644 --- a/environments/common/inventory/groups +++ b/environments/common/inventory/groups @@ -88,15 +88,6 @@ fail2ban [openondemand_jupyter] # Subset of compute to run a Jupyter Notebook servers on via Open Ondemand -[openondemand_rstudio] -# Subset of compute to run RStudio servers on via Open Ondemand - -[openondemand_matlab] -# Subset of compute to run RStudio servers on via Open Ondemand - -[openondemand_codeserver] -# Subset of compute to run a Codeserver VSCode instance on via Open Ondemand - [etc_hosts] # Hosts to manage /etc/hosts e.g. if no internal DNS. See ansible/roles/etc_hosts/README.md diff --git a/environments/common/layouts/everything b/environments/common/layouts/everything index b681e1681..b7a7035e6 100644 --- a/environments/common/layouts/everything +++ b/environments/common/layouts/everything @@ -55,18 +55,6 @@ compute # Subset of compute to run a Jupyter Notebook servers on via Open Ondemand compute -[openondemand_rstudio:children] -# Subset of compute to run RStudio servers on via Open Ondemand -compute - -[openondemand_matlab:children] -# Subset of compute to run a MATLAB interactive desktop on via Open Ondemand -compute - -[openondemand_codeserver:children] -# Subset of compute to run a Codeserver VSCode instance on via Open Ondemand -compute - [etc_hosts:children] # Hosts to manage /etc/hosts e.g. if no internal DNS. See ansible/roles/etc_hosts/README.md cluster From ad17cb66741df20f46e92b8fa7a38184be09fcd3 Mon Sep 17 00:00:00 2001 From: bertiethorpe Date: Thu, 7 Aug 2025 15:14:02 +0000 Subject: [PATCH 11/20] re-add inventory --- environments/common/inventory/groups | 9 +++++++++ environments/site/inventory/groups | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/environments/common/inventory/groups b/environments/common/inventory/groups index 2396fa66a..57b644152 100644 --- a/environments/common/inventory/groups +++ b/environments/common/inventory/groups @@ -99,6 +99,15 @@ fail2ban [openondemand_jupyter] # Subset of compute to run a Jupyter Notebook servers on via Open Ondemand +[openondemand_rstudio] +# Subset of compute to run RStudio servers on via Open Ondemand + +[openondemand_matlab] +# Subset of compute to run RStudio servers on via Open Ondemand + +[openondemand_codeserver] +# Subset of compute to run a Codeserver VSCode instance on via Open Ondemand + [etc_hosts] # Hosts to manage /etc/hosts e.g. if no internal DNS. See ansible/roles/etc_hosts/README.md diff --git a/environments/site/inventory/groups b/environments/site/inventory/groups index da0562060..9df61dc13 100644 --- a/environments/site/inventory/groups +++ b/environments/site/inventory/groups @@ -55,6 +55,18 @@ compute # Subset of compute to run a Jupyter Notebook servers on via Open Ondemand compute +[openondemand_rstudio:children] +# Subset of compute to run RStudio servers on via Open Ondemand +compute + +[openondemand_matlab:children] +# Subset of compute to run a MATLAB interactive desktop on via Open Ondemand +compute + +[openondemand_codeserver:children] +# Subset of compute to run a Codeserver VSCode instance on via Open Ondemand +compute + [etc_hosts:children] # Hosts to manage /etc/hosts e.g. if no internal DNS. See ansible/roles/etc_hosts/README.md cluster From 2359a7a0d1106260a2801e454f8bb91c7e60587e Mon Sep 17 00:00:00 2001 From: bertiethorpe Date: Thu, 7 Aug 2025 15:53:57 +0000 Subject: [PATCH 12/20] bump CI images --- environments/.stackhpc/tofu/cluster_image.auto.tfvars.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/environments/.stackhpc/tofu/cluster_image.auto.tfvars.json b/environments/.stackhpc/tofu/cluster_image.auto.tfvars.json index 23ba55943..87dba4eb0 100644 --- a/environments/.stackhpc/tofu/cluster_image.auto.tfvars.json +++ b/environments/.stackhpc/tofu/cluster_image.auto.tfvars.json @@ -1,6 +1,6 @@ { "cluster_image": { - "RL8": "openhpc-RL8-250805-1410-35724c15", - "RL9": "openhpc-RL9-250805-1409-35724c15" + "RL8": "openhpc-RL8-250807-1516-ad17cb66", + "RL9": "openhpc-RL9-250807-1516-ad17cb66" } } From 32d05b9fc0bf74eea64d122b6509088aed619514 Mon Sep 17 00:00:00 2001 From: bertiethorpe Date: Fri, 8 Aug 2025 09:27:14 +0000 Subject: [PATCH 13/20] Use lustre-release mirror --- ansible/roles/lustre/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/lustre/defaults/main.yml b/ansible/roles/lustre/defaults/main.yml index 0fe5d61a1..14ddc0551 100644 --- a/ansible/roles/lustre/defaults/main.yml +++ b/ansible/roles/lustre/defaults/main.yml @@ -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 From ffdc43ce69b688d5824bf0c981e5454d2627124b Mon Sep 17 00:00:00 2001 From: bertiethorpe Date: Fri, 8 Aug 2025 15:31:35 +0000 Subject: [PATCH 14/20] bump ood app releases, update matlab submit script, optimise portal.yml --- ansible/portal.yml | 16 +---- ansible/roles/openondemand/defaults/main.yml | 5 +- .../openondemand/tasks/codeserver_compute.yml | 8 +-- .../openondemand/tasks/rstudio_compute.yml | 8 +-- docs/openondemand.md | 2 +- .../inventory/group_vars/all/openondemand.yml | 68 ++++++++++++++----- 6 files changed, 65 insertions(+), 42 deletions(-) diff --git a/ansible/portal.yml b/ansible/portal.yml index 049b4f4be..58ca69fad 100644 --- a/ansible/portal.yml +++ b/ansible/portal.yml @@ -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: @@ -49,19 +50,6 @@ tasks_from: rstudio_compute.yml when: appliances_mode != 'configure' # is run during build -# Requires openondemand_matlab_partition to be set in group_vars, as well as MATLAB installed on target compute nodes -- hosts: openondemand_matlab - tags: - - openondemand - - openondemand_matlab - become: yes - gather_facts: yes - tasks: - - import_role: - name: openondemand - tasks_from: vnc_compute.yml - when: appliances_mode != 'configure' # is run during build - - hosts: openondemand_codeserver tags: - openondemand diff --git a/ansible/roles/openondemand/defaults/main.yml b/ansible/roles/openondemand/defaults/main.yml index bfb9bc7f7..851804e03 100644 --- a/ansible/roles/openondemand/defaults/main.yml +++ b/ansible/roles/openondemand/defaults/main.yml @@ -104,5 +104,6 @@ openondemand_osc_ood_defaults: 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 }}" -ondemand_code_server_version: 4.102.2 -ondemand_rstudio_version: 2025.05.1-513 \ No newline at end of file +openondemand_code_server_version: 4.102.2 +openondemand_rstudio_version: 2025.05.1-513 +openondemand_matlab_version: '' \ No newline at end of file diff --git a/ansible/roles/openondemand/tasks/codeserver_compute.yml b/ansible/roles/openondemand/tasks/codeserver_compute.yml index b36b49608..7b39bf75d 100644 --- a/ansible/roles/openondemand/tasks/codeserver_compute.yml +++ b/ansible/roles/openondemand/tasks/codeserver_compute.yml @@ -1,6 +1,6 @@ - name: Download Code Server RPM ansible.builtin.get_url: - url: "https://github.com/coder/code-server/releases/download/v{{ ondemand_code_server_version }}/code-server-{{ ondemand_code_server_version }}-amd64.rpm" + 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' @@ -19,18 +19,18 @@ - name: Create modulefile for Code Server copy: - dest: "/opt/ohpc/pub/modulefiles/code-server/{{ ondemand_code_server_version }}" + 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 {{ ondemand_code_server_version }}." + 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: {{ ondemand_code_server_version }}" + 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" diff --git a/ansible/roles/openondemand/tasks/rstudio_compute.yml b/ansible/roles/openondemand/tasks/rstudio_compute.yml index 457e2d7db..99dd83a9b 100644 --- a/ansible/roles/openondemand/tasks/rstudio_compute.yml +++ b/ansible/roles/openondemand/tasks/rstudio_compute.yml @@ -9,7 +9,7 @@ - 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-{{ ondemand_rstudio_version }}-x86_64.rpm" + 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' @@ -28,19 +28,19 @@ - name: Write modulefile for RStudio Server ansible.builtin.copy: - dest: "/opt/ohpc/pub/modulefiles/rstudio-server/{{ ondemand_rstudio_version }}" + 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 {{ ondemand_rstudio_version }}" + 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: {{ ondemand_rstudio_version }}" + 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" diff --git a/docs/openondemand.md b/docs/openondemand.md index 273f8faa2..74b8e6a74 100644 --- a/docs/openondemand.md +++ b/docs/openondemand.md @@ -24,7 +24,7 @@ To enable the Open OnDemand server, add single host to the `openondemand` invent 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. -*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. +*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. The above functionality is configured by running the `ansible/portal.yml` playbook. This is automatically run as part of `ansible/site.yml`. diff --git a/environments/common/inventory/group_vars/all/openondemand.yml b/environments/common/inventory/group_vars/all/openondemand.yml index 666961f0b..707e954e1 100644 --- a/environments/common/inventory/group_vars/all/openondemand.yml +++ b/environments/common/inventory/group_vars/all/openondemand.yml @@ -15,7 +15,7 @@ openondemand_auth: basic_pam openondemand_jupyter_partition: "{{ openhpc_partitions[0]['name'] }}" openondemand_desktop_partition: "{{ openhpc_partitions[0]['name'] }}" openondemand_rstudio_partition: "{{ openhpc_partitions[0]['name'] }}" -openondemand_matlab_partition: null # Requires target site to already have MATLAB so set to null +openondemand_matlab_partition: '' # Requires target site to already have MATLAB so set to empty openondemand_codeserver_partition: "{{ openhpc_partitions[0]['name'] }}" # Regex defining hosts which openondemand can proxy; the default regex is compute nodes (for apps) and grafana host, @@ -92,7 +92,7 @@ openondemand_install_app_jupyter: openondemand_install_app_rstudio: # mapping, values as for ansible.builtin.git: repo (required)/dest/version(default main)/umask rstudio: repo: https://github.com/stackhpc/ood-stackhpc-rstudio.git - version: main + version: 2025.08.1 openondemand_install_app_matlab: matlab: repo: https://github.com/stackhpc/ood-stackhpc-matlab.git @@ -100,7 +100,7 @@ openondemand_install_app_matlab: openondemand_install_app_codeserver: codeserver: repo: https://github.com/stackhpc/bc_osc_codeserver.git - version: master + version: 2025.08.1 # osc:ood role var (NB only active when not in configure): ood_install_apps: >- {{ @@ -197,7 +197,7 @@ openondemand_apps_rstudio_default: help: Choose your RStudio module widget: select options: - - ["rstudio-server/{{ ondemand_rstudio_version }}","RStudio v{{ ondemand_rstudio_version }}"] + - ["rstudio-server/{{ openondemand_rstudio_version }}","RStudio v{{ openondemand_rstudio_version }}"] extra_modules_script: label: Extra modules script 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: template: "basic" conn_params: - csrf_token + - rstudio_module script: native: - "--partition" @@ -269,29 +270,62 @@ openondemand_apps_matlab_default: - desktop - bc_queue - bc_num_hours - - num_cores - - node + - matlab_module + - cores + - ram attributes: desktop: xfce # bc_account: # i.e. slurm account # value: root bc_queue: value: "{{ openondemand_matlab_partition | default(none) }}" - num_cores: - label: Number of cores + matlab_module: + label: MATLAB module + required: true + cachable: true + help: Choose your MATLAB module + widget: select + options: + - ["matlab/{{ openondemand_matlab_version }}","MATLAB v{{ openondemand_matlab_version }}"] + cores: + label: Number of CPU cores + help: How many CPU cores to reserve for your session. NB Ensure this is within the maximum allowed by your chosen partition. + widget: number_field + min: 1 + max: 48 + step: 1 value: 1 - node: - label: Node name - help: Select a particular node or leave empty to let Slurm pick the next available - value: "" + cachable: true + ram: + widget: number_field + label: RAM in GB + help: How much RAM to reserve for your session. NB Ensure this is within the maximum allowed by your chosen partition + min: 4 + max: 700 + step: 1 + value: 4 + cachable: true + bc_num_hours: + widget: number_field + help: Maximum runtime in hours for your session. NB Ensure this is within the maximum allowed by your chosen partition + min: 1 + max: 240 + step: 1 + value: 30 + cachable: true submit: | --- script: job_name: "ood-matlab" native: - - <%= "--nodes=1" %> - - <%= "--ntasks=#{num_cores}" %> - - <%= "--nodelist=#{node}" %> + - "--partition" + - "<%= bc_queue %>" + - "--ntasks" + - "1" + - "--mem" + - "<%= ram.blank? ? 4 : ram.to_i %>G" + - "--cpus-per-task" + - "<%= cores.blank? ? 1 : cores.to_i %>" openondemand_apps_matlab: "{{ {'matlab':openondemand_apps_matlab_default} if openondemand_matlab_partition | default(none) else {} }}" openondemand_apps_codeserver_default: @@ -312,7 +346,7 @@ openondemand_apps_codeserver_default: help: Choose your Code Server module widget: select options: - - ["code-server/{{ ondemand_code_server_version }}","Code Server v{{ ondemand_code_server_version}}"] + - ["code-server/{{ openondemand_code_server_version }}","Code Server v{{ openondemand_code_server_version}}"] bc_queue: value: "{{ openondemand_codeserver_partition | default(none) }}" cores: @@ -345,7 +379,7 @@ openondemand_apps_codeserver_default: batch_connect: template: "basic" conn_params: - - code_server_version + - codeserver_module script: job_name: "ood-codeserver" native: From 914aa6b9ae63a6b399a3a12f963ff2c251d49420 Mon Sep 17 00:00:00 2001 From: bertiethorpe Date: Fri, 8 Aug 2025 16:35:57 +0000 Subject: [PATCH 15/20] fix widget selection order --- .../common/inventory/group_vars/all/openondemand.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/environments/common/inventory/group_vars/all/openondemand.yml b/environments/common/inventory/group_vars/all/openondemand.yml index 707e954e1..bd8ba7693 100644 --- a/environments/common/inventory/group_vars/all/openondemand.yml +++ b/environments/common/inventory/group_vars/all/openondemand.yml @@ -96,7 +96,7 @@ openondemand_install_app_rstudio: # mapping, values as for ansible.builtin.git: openondemand_install_app_matlab: matlab: repo: https://github.com/stackhpc/ood-stackhpc-matlab.git - version: main + version: 2025.08.1 openondemand_install_app_codeserver: codeserver: repo: https://github.com/stackhpc/bc_osc_codeserver.git @@ -197,7 +197,7 @@ openondemand_apps_rstudio_default: help: Choose your RStudio module widget: select options: - - ["rstudio-server/{{ openondemand_rstudio_version }}","RStudio v{{ openondemand_rstudio_version }}"] + - ["RStudio v{{ openondemand_rstudio_version }}", "rstudio-server/{{ openondemand_rstudio_version }}}"] extra_modules_script: label: Extra modules script 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 @@ -286,7 +286,7 @@ openondemand_apps_matlab_default: help: Choose your MATLAB module widget: select options: - - ["matlab/{{ openondemand_matlab_version }}","MATLAB v{{ openondemand_matlab_version }}"] + - ["MATLAB v{{ openondemand_matlab_version }}", "matlab/{{ openondemand_matlab_version }}"] cores: label: Number of CPU cores help: How many CPU cores to reserve for your session. NB Ensure this is within the maximum allowed by your chosen partition. @@ -346,7 +346,7 @@ openondemand_apps_codeserver_default: help: Choose your Code Server module widget: select options: - - ["code-server/{{ openondemand_code_server_version }}","Code Server v{{ openondemand_code_server_version}}"] + - ["Code Server v{{ openondemand_code_server_version}}", "code-server/{{ openondemand_code_server_version }}"] bc_queue: value: "{{ openondemand_codeserver_partition | default(none) }}" cores: From faa44755035802dfd433bc04e1f71a4eee036098 Mon Sep 17 00:00:00 2001 From: bertiethorpe Date: Fri, 8 Aug 2025 17:23:41 +0000 Subject: [PATCH 16/20] openondemand.md improvements --- docs/openondemand.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/openondemand.md b/docs/openondemand.md index 74b8e6a74..4204c830e 100644 --- a/docs/openondemand.md +++ b/docs/openondemand.md @@ -24,10 +24,15 @@ To enable the Open OnDemand server, add single host to the `openondemand` invent 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. -*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. - 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. 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 modulefile. The path of the modulefile needs to adhere to a convention to work with the common environemnt's default batch connect form. The modulefile must be created as `matlab/< MATLAB_VERSION >`, where the version should match the `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. @@ -41,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`, `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`. +- `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` From ea0b46db0b2074dd483b347bb68911778c046483 Mon Sep 17 00:00:00 2001 From: bertiethorpe Date: Fri, 8 Aug 2025 19:54:17 +0000 Subject: [PATCH 17/20] bump CI images --- environments/.stackhpc/inventory/group_vars/all/bastion.yml | 2 +- environments/.stackhpc/tofu/cluster_image.auto.tfvars.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/environments/.stackhpc/inventory/group_vars/all/bastion.yml b/environments/.stackhpc/inventory/group_vars/all/bastion.yml index a1001e862..d415947dd 100644 --- a/environments/.stackhpc/inventory/group_vars/all/bastion.yml +++ b/environments/.stackhpc/inventory/group_vars/all/bastion.yml @@ -4,7 +4,7 @@ bastion_config: user: slurm-app-ci ip: 128.232.222.183 LEAFCLOUD: - user: slurm-app-ci + user: bertie ip: 195.114.30.222 SMS: user: slurm-app-ci diff --git a/environments/.stackhpc/tofu/cluster_image.auto.tfvars.json b/environments/.stackhpc/tofu/cluster_image.auto.tfvars.json index 87dba4eb0..af148393a 100644 --- a/environments/.stackhpc/tofu/cluster_image.auto.tfvars.json +++ b/environments/.stackhpc/tofu/cluster_image.auto.tfvars.json @@ -1,6 +1,6 @@ { "cluster_image": { - "RL8": "openhpc-RL8-250807-1516-ad17cb66", - "RL9": "openhpc-RL9-250807-1516-ad17cb66" + "RL8": "openhpc-RL8-250808-1727-faa44755", + "RL9": "openhpc-RL9-250808-1727-faa44755" } } From 0d539296909c9b675e63d123534b7b054308cf8f Mon Sep 17 00:00:00 2001 From: bertiethorpe Date: Fri, 8 Aug 2025 19:54:57 +0000 Subject: [PATCH 18/20] undo bastion edit --- environments/.stackhpc/inventory/group_vars/all/bastion.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environments/.stackhpc/inventory/group_vars/all/bastion.yml b/environments/.stackhpc/inventory/group_vars/all/bastion.yml index d415947dd..a1001e862 100644 --- a/environments/.stackhpc/inventory/group_vars/all/bastion.yml +++ b/environments/.stackhpc/inventory/group_vars/all/bastion.yml @@ -4,7 +4,7 @@ bastion_config: user: slurm-app-ci ip: 128.232.222.183 LEAFCLOUD: - user: bertie + user: slurm-app-ci ip: 195.114.30.222 SMS: user: slurm-app-ci From 32c613c8ace6b9331e89c188dd5f1d713af5851c Mon Sep 17 00:00:00 2001 From: bertiethorpe <84867280+bertiethorpe@users.noreply.github.com> Date: Tue, 12 Aug 2025 09:43:09 +0100 Subject: [PATCH 19/20] del duplicate sentence in openondemand.md --- docs/openondemand.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/openondemand.md b/docs/openondemand.md index 4204c830e..ff12618fd 100644 --- a/docs/openondemand.md +++ b/docs/openondemand.md @@ -27,7 +27,7 @@ To enable compute nodes for virtual desktops, Jupyter notebooks, RStudio, VSCode 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. 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. +*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 modulefile. The path of the modulefile needs to adhere to a convention to work with the common environemnt's default batch connect form. The modulefile must be created as `matlab/< MATLAB_VERSION >`, where the version should match the `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`. From ea92e0a5c2fdda3146636a6cb5000484841eed25 Mon Sep 17 00:00:00 2001 From: bertiethorpe <84867280+bertiethorpe@users.noreply.github.com> Date: Tue, 12 Aug 2025 09:43:21 +0100 Subject: [PATCH 20/20] Update docs/openondemand.md Co-authored-by: Steve Brasier <33413598+sjpb@users.noreply.github.com> --- docs/openondemand.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/openondemand.md b/docs/openondemand.md index ff12618fd..5dd3029fc 100644 --- a/docs/openondemand.md +++ b/docs/openondemand.md @@ -29,7 +29,7 @@ The above functionality is configured by running the `ansible/portal.yml` playbo ## 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 modulefile. The path of the modulefile needs to adhere to a convention to work with the common environemnt's default batch connect form. The modulefile must be created as `matlab/< MATLAB_VERSION >`, where the version should match the `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`. +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.