Skip to content

Commit ee9e5a9

Browse files
authored
Ensure OnDemand app installs during image build do not need a cluster to be deployed (#843)
* Ensure OOD app installs work for site image builds * add ood app image build docs * fix partition defaults and document * Add detail to docs * add newlines * fix linting * markdown prettier * bump CI images * Fix trivyscan action version * fix cluster_compute_group group_var * remove cluster compute group safe var indirection * Bump new CI images
1 parent cbb0cf4 commit ee9e5a9

File tree

6 files changed

+24
-9
lines changed

6 files changed

+24
-9
lines changed

ansible/roles/openondemand/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ This role enables SSL on the Open Ondemand server, using the following self-sign
6969
- `new_window`: Optional. Whether to open link in new window. Bool, default `false`.
7070
- `app_name`: Optional. Unique name for app appended to `/var/www/ood/apps/sys/`. Default is `name`, useful if that is not unique or not suitable as a path component.
7171
- `openondemand_dashboard_support_url`: Optional. URL or email etc to show as support contact under Help in dashboard. Default `(undefined)`.
72-
- `openondemand_desktop_partition`: Optional. Name of Slurm partition to use for remote desktops. Requires a corresponding group named "openondemand_desktop" and entry in openhpc_partitions.
72+
- `openondemand_desktop_partition`: Optional. Name of Slurm partition to use for remote desktops, by default supplied with `openhpc_partitions` entry. During open ondemand config the string is used to provide a default partition in the UX. During image build, with `openondemand` group, setting this partition as a boolean determines if app installed in image.
7373
- `openondemand_desktop_screensaver`: Optional. Whether to enable screen locking/screensaver. **NB:** Users must have passwords if this is enabled. Bool, default `false`.
7474
- `openondemand_filesapp_paths`: List of paths (in addition to $HOME, which is always added) to include shortcuts to within the Files dashboard app.
75-
- `openondemand_jupyter_partition`: Required. Name of Slurm partition to use for Jupyter Notebook servers. Requires a corresponding group named "openondemand_jupyter" and entry in openhpc_partitions.
75+
- `openondemand_jupyter_partition`: Required. Name of Slurm partition to use for Jupyter Notebook servers, by default supplied with `openhpc_partitions` entry. During open ondemand config the string is used to provide a default partition in the UX. During image build, with `openondemand` group, setting this partition as a boolean determines if app installed in image.
7676
- `openondemand_gres_options`: Optional. A list of `[label, value]` items used
7777
to provide a drop-down for resource/GRES selection in application forms. The
7878
default constructs a list from all GRES definitions in the cluster. See the

docs/openondemand.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ The appliance automatically configures Open OnDemand to proxy Grafana and adds a
6363

6464
[^1]: Note that if `openondemand_auth` is `basic_pam` and anonymous Grafana login is enabled, the appliance will (by default) configure Open OnDemand's Apache server to remove the Authorisation header from proxying of all `node/` addresses. This is done as otherwise Grafana tries to use this header to authenticate, which fails with the default configuration where only the admin Grafana user `grafana` is created. Note that the removal of this header in this configuration means it cannot be used to authenticate proxied interactive applications - however the appliance-deployed remote desktop and Jupyter Notebook server applications use other authentication methods. An alternative if using `basic_pam` is not to enable anonymous Grafana login and to create Grafana users matching the local users (e.g. in `environments/<env>/hooks/post.yml`).
6565

66+
## Image Build
67+
68+
By default, most ondemand apps are installed in image builds when the build includes the inventory group `openondemand` (which is the default for "fatimage" builds). The apps installed are
69+
defined by the `openondemand_<app>_partition` variables in `environments/common/inventory/group_vars/all/builder/defaults.yml`. Note that in this case the values are not strings and are instead
70+
simply truthy, i.e. they do not describe cluster partition groups but just whether those apps will be installed in the image or not.
71+
72+
For e.g. site-specific image builds where different app installs are required, due to precedence rules these must overriden in a `builder`-groupvars file e.g. `environments/site/inventory/group_vars/all/builder/defaults.yml`.
73+
6674
## Access
6775

6876
By default the appliance authenticates against OOD with basic auth through PAM. When creating a new environment, a new user with username `demo_user` will be created.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"cluster_image": {
3-
"RL8": "openhpc-RL8-251119-1202-332ac921",
4-
"RL9": "openhpc-RL9-251119-1202-332ac921"
3+
"RL8": "openhpc-RL8-251119-1833-cb477455",
4+
"RL9": "openhpc-RL9-251119-1834-cb477455"
55
}
66
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ openhpc_rebuild_partition: # not a role var - could actually add more indirectio
2727
DisableRootJobs: false
2828
PreemptMode: "OFF"
2929
OverSubscribe: EXCLUSIVE
30-
openhpc_nodegroups: "{{ cluster_compute_groups | map('community.general.dict_kv', 'name') }}" # create nodegroup for each compute group
30+
openhpc_nodegroups: "{{ cluster_compute_groups | default([]) | map('community.general.dict_kv', 'name') }}" # create nodegroup for each compute group
3131
openhpc_user_partitions: "{{ openhpc_nodegroups }}" # create partition for each nodegroup (actually role default) - this is what we'd expect to be changed
3232
# yamllint disable-line rule:line-length
3333
openhpc_partitions: "{{ openhpc_user_partitions + ([openhpc_rebuild_partition] if groups['rebuild'] | length > 0 else []) }}" # auto-create rebuild partition if reqd.

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ openondemand_servername: "{{ hostvars[groups['openondemand'].0].ansible_host if
1212

1313
openondemand_auth: basic_pam
1414

15-
openondemand_jupyter_partition: "{{ openhpc_partitions[0]['name'] }}"
16-
openondemand_desktop_partition: "{{ openhpc_partitions[0]['name'] }}"
17-
openondemand_rstudio_partition: "{{ openhpc_partitions[0]['name'] }}"
15+
# Manages case where openhpc_partitions are not defined e.g. for site image builds
16+
openondemand_jupyter_partition: "{{ openhpc_partitions[0].name | default('') }}"
17+
openondemand_desktop_partition: "{{ openhpc_partitions[0].name | default('') }}"
18+
openondemand_rstudio_partition: "{{ openhpc_partitions[0].name | default('') }}"
1819
openondemand_matlab_partition: '' # Requires target site to already have MATLAB so set to empty
19-
openondemand_codeserver_partition: "{{ openhpc_partitions[0]['name'] }}"
20+
openondemand_codeserver_partition: "{{ openhpc_partitions[0].name | default('') }}"
2021

2122
# Regex defining hosts which openondemand can proxy; the default regex is compute nodes (for apps) and grafana host,
2223
# e.g. if the group `compute` has hosts `compute-{0,1,2,..}` this will be '(compute-\d+)|(control)'.

environments/common/inventory/group_vars/builder/defaults.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,9 @@ sssd_enabled: false
2727
slurm_exporter_state: stopped
2828
appliances_mode: build
2929
proxy_remove: true
30+
# for image build ood partition var is just truthy as no cluster_groups defined
31+
openondemand_jupyter_partition: true
32+
openondemand_desktop_partition: true
33+
openondemand_rstudio_partition: false
34+
openondemand_matlab_partition: false
35+
openondemand_codeserver_partition: false

0 commit comments

Comments
 (0)