From 558874b3949253a34baec5e91d917d7965710725 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Thu, 12 Dec 2024 11:46:24 +0000 Subject: [PATCH 01/11] Added extra package installs to bootstrap --- ansible/bootstrap.yml | 9 ++++++++ .../inventory/group_vars/all/defaults.yml | 21 ++++++++++++++++++- environments/common/inventory/groups | 5 +++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/ansible/bootstrap.yml b/ansible/bootstrap.yml index 733d4b3f8..432a2a319 100644 --- a/ansible/bootstrap.yml +++ b/ansible/bootstrap.yml @@ -216,6 +216,15 @@ msg: "{{ updates.results | length }} changes to packages - see {{ update_log_path }} for details" when: "update_enable | default('false') | bool" +- hosts: extra_packages + become: yes + tags: + - extra_packages + tasks: + dnf: + - name: "{{ appliances_extra_packages }}" + when: appliances_mode != 'configure' or appliances_packages_during_configure + - hosts: - selinux - update diff --git a/environments/common/inventory/group_vars/all/defaults.yml b/environments/common/inventory/group_vars/all/defaults.yml index 2a88f035d..c6bf8564b 100644 --- a/environments/common/inventory/group_vars/all/defaults.yml +++ b/environments/common/inventory/group_vars/all/defaults.yml @@ -79,4 +79,23 @@ appliances_local_users_default: appliances_local_users_extra: [] # see format of appliances_local_users_default above appliances_local_users: "{{ appliances_local_users_default + appliances_local_users_extra }}" -########################################################################################### +################## bootstrap: extra package installs ###################################### + +appliances_default_extra_packages: + - htop + - nano + - screen + - tmux + - wget + - bind-utils + - net-tools + - postfix + - git + - "{{ 'python36' if ansible_distribution_version == '8.9' else 'python312' }}" + + +appliances_packages_during_configure: false + +appliances_other_extra_packages: [] + +appliances_extra_packages: "{{ appliances_default_extra_packages + appliances_other_extra_packages }}" diff --git a/environments/common/inventory/groups b/environments/common/inventory/groups index 9b9aa5bf0..d8ad503fe 100644 --- a/environments/common/inventory/groups +++ b/environments/common/inventory/groups @@ -144,3 +144,8 @@ freeipa_client [lustre] # Hosts to run lustre client + +[extra_packages:children] +# Hosts to install specified additional packages on +cluster +builder From f343f67395a143493f2b48c5638c2b7a2e4101b3 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Fri, 13 Dec 2024 15:02:01 +0000 Subject: [PATCH 02/11] moved to later in build/site and moved groups --- ansible/bootstrap.yml | 9 --------- ansible/fatimage.yml | 2 ++ ansible/packages.yml | 10 ++++++++++ ansible/site.yml | 1 + environments/common/inventory/groups | 4 +--- environments/common/layouts/everything | 4 ++++ 6 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 ansible/packages.yml diff --git a/ansible/bootstrap.yml b/ansible/bootstrap.yml index 432a2a319..733d4b3f8 100644 --- a/ansible/bootstrap.yml +++ b/ansible/bootstrap.yml @@ -216,15 +216,6 @@ msg: "{{ updates.results | length }} changes to packages - see {{ update_log_path }} for details" when: "update_enable | default('false') | bool" -- hosts: extra_packages - become: yes - tags: - - extra_packages - tasks: - dnf: - - name: "{{ appliances_extra_packages }}" - when: appliances_mode != 'configure' or appliances_packages_during_configure - - hosts: - selinux - update diff --git a/ansible/fatimage.yml b/ansible/fatimage.yml index b28e4f308..c40aca6fd 100644 --- a/ansible/fatimage.yml +++ b/ansible/fatimage.yml @@ -199,6 +199,8 @@ name: cloudalchemy.grafana tasks_from: install.yml +- ansible.builtin.import_playbook: packages.yml + - name: Run post.yml hook vars: appliances_environment_root: "{{ lookup('env', 'APPLIANCES_ENVIRONMENT_ROOT') }}" diff --git a/ansible/packages.yml b/ansible/packages.yml new file mode 100644 index 000000000..e447dcda7 --- /dev/null +++ b/ansible/packages.yml @@ -0,0 +1,10 @@ + +- hosts: extra_packages + become: yes + tags: + - extra_packages + tasks: + - name: Install additional packages + dnf: + name: "{{ appliances_extra_packages }}" + when: appliances_mode != 'configure' or appliances_packages_during_configure diff --git a/ansible/site.yml b/ansible/site.yml index bb379399d..878b15a35 100644 --- a/ansible/site.yml +++ b/ansible/site.yml @@ -27,6 +27,7 @@ - import_playbook: slurm.yml - import_playbook: portal.yml - import_playbook: monitoring.yml +- import_playbook: packages.yml - name: Run post.yml hook vars: diff --git a/environments/common/inventory/groups b/environments/common/inventory/groups index d8ad503fe..2a6244962 100644 --- a/environments/common/inventory/groups +++ b/environments/common/inventory/groups @@ -145,7 +145,5 @@ freeipa_client [lustre] # Hosts to run lustre client -[extra_packages:children] +[extra_packages] # Hosts to install specified additional packages on -cluster -builder diff --git a/environments/common/layouts/everything b/environments/common/layouts/everything index ba5cbc08d..6f6f63590 100644 --- a/environments/common/layouts/everything +++ b/environments/common/layouts/everything @@ -92,3 +92,7 @@ control [lustre] # Hosts to run lustre client + +[extra_packages:children] +# Hosts to install specified additional packages on +cluster From 34fee1cb17a32c4d0fc52cb2997e8f1c6458f730 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Mon, 16 Dec 2024 12:26:27 +0000 Subject: [PATCH 03/11] updated docs --- docs/operations.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/docs/operations.md b/docs/operations.md index a20d7f10c..50eef9053 100644 --- a/docs/operations.md +++ b/docs/operations.md @@ -63,17 +63,28 @@ This is a usually a two-step process: 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). # Adding Additional Packages -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: - - # environments/foo-base/inventory/group_vars/all/openhpc.yml: - openhpc_packages_extra: +By default, the following utility packages are installed during build: +- htop +- nano +- screen +- tmux +- wget +- bind-utils +- net-tools +- postfix +- git +- latest python version for system (3.6 for for Rocky 8.9 and 3.12 for Rocky 9.4) +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_other_extra_package` (defaulted to the empty list in the common environment) in e.g. `environments/$SITE_ENV/inventory/group_vars/all/defaults.yml`. For example: + + # environments/foo-base/inventory/group_vars/all/defaults.yml: + appliances_other_extra_package: - somepackage - anotherpackage 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. -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. +If you wish to install packages during runtime, the `site.yml` playbook should be run `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-enabled 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). 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: - `ansible.builtin.yum_repository`: Add a repo from an URL providing a 'repodata' directory. From a4352920dcd0dd1ccb9ab798b44a75aa4d2a1ec9 Mon Sep 17 00:00:00 2001 From: wtripp180901 <78219569+wtripp180901@users.noreply.github.com> Date: Mon, 16 Dec 2024 13:42:52 +0000 Subject: [PATCH 04/11] bump image --- .../.stackhpc/terraform/cluster_image.auto.tfvars.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/environments/.stackhpc/terraform/cluster_image.auto.tfvars.json b/environments/.stackhpc/terraform/cluster_image.auto.tfvars.json index 8659f3e90..44059d97c 100644 --- a/environments/.stackhpc/terraform/cluster_image.auto.tfvars.json +++ b/environments/.stackhpc/terraform/cluster_image.auto.tfvars.json @@ -1,6 +1,6 @@ { "cluster_image": { - "RL8": "openhpc-RL8-241213-1402-a2a705c9", - "RL9": "openhpc-RL9-241213-1402-a2a705c9" + "RL8": "openhpc-RL8-241216-1231-83161c73", + "RL9": "openhpc-RL9-241216-1232-83161c73" } } From 30a278ee64e7202b8ec7a3da9753d81c5c7fd42d Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Mon, 16 Dec 2024 15:37:12 +0000 Subject: [PATCH 05/11] moved to extras --- ansible/extras.yml | 10 ++++++++++ ansible/packages.yml | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) delete mode 100644 ansible/packages.yml diff --git a/ansible/extras.yml b/ansible/extras.yml index 107f85252..ea5c8eb12 100644 --- a/ansible/extras.yml +++ b/ansible/extras.yml @@ -44,3 +44,13 @@ tasks: - import_role: name: k9s + +- hosts: extra_packages + become: yes + tags: + - extra_packages + tasks: + - name: Install additional packages + dnf: + name: "{{ appliances_extra_packages }}" + when: appliances_mode != 'configure' or appliances_packages_during_configure diff --git a/ansible/packages.yml b/ansible/packages.yml deleted file mode 100644 index e447dcda7..000000000 --- a/ansible/packages.yml +++ /dev/null @@ -1,10 +0,0 @@ - -- hosts: extra_packages - become: yes - tags: - - extra_packages - tasks: - - name: Install additional packages - dnf: - name: "{{ appliances_extra_packages }}" - when: appliances_mode != 'configure' or appliances_packages_during_configure From 1ba41d8bfb1b1e3ec716cb39c4a34bc3ed8f4cb1 Mon Sep 17 00:00:00 2001 From: wtripp180901 <78219569+wtripp180901@users.noreply.github.com> Date: Tue, 17 Dec 2024 12:54:45 +0000 Subject: [PATCH 06/11] bump --- .../.stackhpc/terraform/cluster_image.auto.tfvars.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/environments/.stackhpc/terraform/cluster_image.auto.tfvars.json b/environments/.stackhpc/terraform/cluster_image.auto.tfvars.json index 7c59abf36..be9dfe5cb 100644 --- a/environments/.stackhpc/terraform/cluster_image.auto.tfvars.json +++ b/environments/.stackhpc/terraform/cluster_image.auto.tfvars.json @@ -1,6 +1,6 @@ { "cluster_image": { - "RL8": "openhpc-RL8-241216-1607-2357a730", - "RL9": "openhpc-RL9-241216-1607-2357a730" + "RL8": "openhpc-RL8-241217-1146-d77be652", + "RL9": "openhpc-RL9-241217-1145-d77be652" } } From 357f7e25e7ccdefb8748096d25cb8f9315c63ce9 Mon Sep 17 00:00:00 2001 From: wtripp180901 <78219569+wtripp180901@users.noreply.github.com> Date: Thu, 19 Dec 2024 11:41:06 +0000 Subject: [PATCH 07/11] docs suggestions Co-authored-by: Steve Brasier <33413598+sjpb@users.noreply.github.com> --- docs/operations.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/operations.md b/docs/operations.md index 50eef9053..edf8881f0 100644 --- a/docs/operations.md +++ b/docs/operations.md @@ -74,8 +74,10 @@ By default, the following utility packages are installed during build: - postfix - git - latest python version for system (3.6 for for Rocky 8.9 and 3.12 for Rocky 9.4) -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_other_extra_package` (defaulted to the empty list in the common environment) in e.g. `environments/$SITE_ENV/inventory/group_vars/all/defaults.yml`. For example: +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_other_extra_packages` (defaulted to the empty list in the common environment) in e.g. `environments/$SITE_ENV/inventory/group_vars/all/defaults.yml`. For example: + +```yaml # environments/foo-base/inventory/group_vars/all/defaults.yml: appliances_other_extra_package: - somepackage @@ -84,7 +86,7 @@ Additional packages from any DNF repositories which are enabled during build (wh 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. -If you wish to install packages during runtime, the `site.yml` playbook should be run `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-enabled 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). +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). 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: - `ansible.builtin.yum_repository`: Add a repo from an URL providing a 'repodata' directory. From 1e2e6d8a2c319d4d9c1e5b5d83f5bea64aed7b77 Mon Sep 17 00:00:00 2001 From: wtripp180901 <78219569+wtripp180901@users.noreply.github.com> Date: Thu, 19 Dec 2024 13:28:34 +0000 Subject: [PATCH 08/11] bump --- .../.stackhpc/terraform/cluster_image.auto.tfvars.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/environments/.stackhpc/terraform/cluster_image.auto.tfvars.json b/environments/.stackhpc/terraform/cluster_image.auto.tfvars.json index be9dfe5cb..4f21c6b99 100644 --- a/environments/.stackhpc/terraform/cluster_image.auto.tfvars.json +++ b/environments/.stackhpc/terraform/cluster_image.auto.tfvars.json @@ -1,6 +1,6 @@ { "cluster_image": { - "RL8": "openhpc-RL8-241217-1146-d77be652", - "RL9": "openhpc-RL9-241217-1145-d77be652" + "RL8": "openhpc-RL8-241219-1232-7f84fed4", + "RL9": "openhpc-RL9-241219-1145-7f84fed4" } } From 6a8ecda6ce5c2074ba5d37cc955947626a73b7b1 Mon Sep 17 00:00:00 2001 From: wtripp180901 <78219569+wtripp180901@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:52:11 +0000 Subject: [PATCH 09/11] variable renames from review Co-authored-by: Steve Brasier <33413598+sjpb@users.noreply.github.com> --- environments/common/inventory/group_vars/all/defaults.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/environments/common/inventory/group_vars/all/defaults.yml b/environments/common/inventory/group_vars/all/defaults.yml index 9ce228493..417eb9eed 100644 --- a/environments/common/inventory/group_vars/all/defaults.yml +++ b/environments/common/inventory/group_vars/all/defaults.yml @@ -82,7 +82,7 @@ appliances_local_users: "{{ appliances_local_users_default + appliances_local_us ################## bootstrap: extra package installs ###################################### -appliances_default_extra_packages: +appliances_extra_packages_default: - htop - nano - screen @@ -95,11 +95,11 @@ appliances_default_extra_packages: - "{{ 'python36' if ansible_distribution_version == '8.9' else 'python312' }}" -appliances_packages_during_configure: false +appliances_extra_packages_during_configure: false -appliances_other_extra_packages: [] +appliances_extra_packages_other: [] -appliances_extra_packages: "{{ appliances_default_extra_packages + appliances_other_extra_packages }}" +appliances_extra_packages: "{{ appliances_extra_packages_default + appliances_extra_packages_other }}" ###################### ark repo timestamps ################################################### From ef33eefbef836f1dcff8d3d91be9e164d7fc9a84 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Thu, 19 Dec 2024 14:55:35 +0000 Subject: [PATCH 10/11] updated docs --- docs/operations.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/operations.md b/docs/operations.md index edf8881f0..4bebe1b3f 100644 --- a/docs/operations.md +++ b/docs/operations.md @@ -75,11 +75,11 @@ By default, the following utility packages are installed during build: - git - latest python version for system (3.6 for for Rocky 8.9 and 3.12 for Rocky 9.4) -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_other_extra_packages` (defaulted to the empty list in the common environment) in e.g. `environments/$SITE_ENV/inventory/group_vars/all/defaults.yml`. For example: +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: ```yaml # environments/foo-base/inventory/group_vars/all/defaults.yml: - appliances_other_extra_package: + appliances_extra_packages_other: - somepackage - anotherpackage From a3be506598ff8f818c0d3c053bc0f3c2a56f8dc0 Mon Sep 17 00:00:00 2001 From: wtripp180901 <78219569+wtripp180901@users.noreply.github.com> Date: Fri, 20 Dec 2024 09:35:22 +0000 Subject: [PATCH 11/11] missed variable rename --- ansible/extras.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/extras.yml b/ansible/extras.yml index e5ea63408..fd1aa4c1c 100644 --- a/ansible/extras.yml +++ b/ansible/extras.yml @@ -54,4 +54,4 @@ - name: Install additional packages dnf: name: "{{ appliances_extra_packages }}" - when: appliances_mode != 'configure' or appliances_packages_during_configure + when: appliances_mode != 'configure' or appliances_extra_packages_during_configure