Skip to content

Commit 8059d24

Browse files
authored
Merge pull request #499 from stackhpc/feat/extra-packages
Add list of additional package installs
2 parents fed2d6e + a3be506 commit 8059d24

File tree

6 files changed

+59
-8
lines changed

6 files changed

+59
-8
lines changed

ansible/extras.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,13 @@
4545
tasks:
4646
- import_role:
4747
name: k9s
48+
49+
- hosts: extra_packages
50+
become: yes
51+
tags:
52+
- extra_packages
53+
tasks:
54+
- name: Install additional packages
55+
dnf:
56+
name: "{{ appliances_extra_packages }}"
57+
when: appliances_mode != 'configure' or appliances_extra_packages_during_configure

docs/operations.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,30 @@ This is a usually a two-step process:
6363
Deploying the additional nodes and applying these changes requires rerunning both Terraform and the Ansible site.yml playbook - follow [Deploying a Cluster](#Deploying-a-Cluster).
6464

6565
# Adding Additional Packages
66-
Packages from any enabled DNF repositories (which always includes EPEL, PowerTools and OpenHPC) can be added to all nodes by defining a list `openhpc_packages_extra` (defaulted to the empty list in the common environment) in e.g. `environments/$SITE_ENV/inventory/group_vars/all/openhpc.yml`. For example:
67-
68-
# environments/foo-base/inventory/group_vars/all/openhpc.yml:
69-
openhpc_packages_extra:
66+
By default, the following utility packages are installed during build:
67+
- htop
68+
- nano
69+
- screen
70+
- tmux
71+
- wget
72+
- bind-utils
73+
- net-tools
74+
- postfix
75+
- git
76+
- latest python version for system (3.6 for for Rocky 8.9 and 3.12 for Rocky 9.4)
77+
78+
Additional packages from any DNF repositories which are enabled during build (which always includes EPEL, PowerTools and OpenHPC) can be added to the image by defining a list `appliances_extra_packages_other` (defaulted to the empty list in the common environment) in e.g. `environments/$SITE_ENV/inventory/group_vars/all/defaults.yml`. For example:
79+
80+
```yaml
81+
# environments/foo-base/inventory/group_vars/all/defaults.yml:
82+
appliances_extra_packages_other:
7083
- somepackage
7184
- anotherpackage
7285

7386

7487
The packages available from the OpenHPC repos are described in Appendix E of the OpenHPC installation guide (linked from the [OpenHPC releases page](https://github.com/openhpc/ohpc/releases/)). Note "user-facing" OpenHPC packages such as compilers, mpi libraries etc. include corresponding `lmod` modules.
7588

76-
To add these packages to the current cluster, run the same command as for [Reconfiguring Slurm](#Reconfiguring-Slurm). TODO: describe what's required to add these to site-specific images.
89+
If you wish to install packages during runtime, the `site.yml` playbook should be run with `appliances_packages_during_configure` overriden to `true` and `cluster` should be added as a child of the `dnf_repos` group in order to temporarily re-enable DNF repositories during runtime (WARNING: this should only be done if using an unauthenticated local Pulp server. If using StackHPC Ark directly, doing this WILL leak credentials to users).
7790

7891
If additional repositories are required, these could be added/enabled as necessary in a play added to `environments/$SITE_ENV/hooks/{pre,post}.yml` as appropriate. Note such a plat should NOT exclude the builder group, so that the repositories are also added to built images. There are various Ansible modules which might be useful for this:
7992
- `ansible.builtin.yum_repository`: Add a repo from an URL providing a 'repodata' directory.
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-241218-1705-09ac4268",
4-
"RL9": "openhpc-RL9-241218-1705-09ac4268"
3+
"RL8": "openhpc-RL8-241219-1232-7f84fed4",
4+
"RL9": "openhpc-RL9-241219-1145-7f84fed4"
55
}
66
}

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,28 @@ appliances_local_users_default:
8080
appliances_local_users_extra: [] # see format of appliances_local_users_default above
8181
appliances_local_users: "{{ appliances_local_users_default + appliances_local_users_extra }}"
8282

83-
###########################################################################################
83+
################## bootstrap: extra package installs ######################################
84+
85+
appliances_extra_packages_default:
86+
- htop
87+
- nano
88+
- screen
89+
- tmux
90+
- wget
91+
- bind-utils
92+
- net-tools
93+
- postfix
94+
- git
95+
- "{{ 'python36' if ansible_distribution_version == '8.9' else 'python312' }}"
96+
97+
98+
appliances_extra_packages_during_configure: false
99+
100+
appliances_extra_packages_other: []
101+
102+
appliances_extra_packages: "{{ appliances_extra_packages_default + appliances_extra_packages_other }}"
103+
104+
###################### ark repo timestamps ###################################################
84105

85106
appliances_repo_timestamps:
86107
baseos:

environments/common/inventory/groups

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ freeipa_client
145145
[lustre]
146146
# Hosts to run lustre client
147147

148+
[extra_packages]
149+
# Hosts to install specified additional packages on
150+
148151
[dnf_repos:children]
149152
# Hosts to replace system repos with Pulp repos
150153
# Warning: when using Ark directly rather than a local Pulp server, adding hosts other than `builder` will leak Ark creds to users

environments/common/layouts/everything

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,7 @@ control
9292

9393
[lustre]
9494
# Hosts to run lustre client
95+
96+
[extra_packages:children]
97+
# Hosts to install specified additional packages on
98+
cluster

0 commit comments

Comments
 (0)