From 57308bff4ca08e6ad23798e1ff231b7f14c850b2 Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 25 May 2022 16:28:36 +0100 Subject: [PATCH 1/4] Changing source AMI from Centos8 to Rocky8 Centos8 is now end of life and is not supported. Rocky8 however can fit as a dropin replacement and is supported. The AMI is used from the Rocky community AMI ownership ID: 792107900819 as stated: https://forums.rockylinux.org/t/rocky-linux-official-aws-ami/3049/24 --- roles/packer/files/all.pkr.hcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/packer/files/all.pkr.hcl b/roles/packer/files/all.pkr.hcl index f92c810d..3850bd76 100644 --- a/roles/packer/files/all.pkr.hcl +++ b/roles/packer/files/all.pkr.hcl @@ -63,10 +63,10 @@ source "amazon-ebs" "aws" { instance_type = var.aws_instance_type source_ami_filter { filters = { - name = "CentOS 8.*" + name = "Rocky-8*" architecture = var.aws_arch } - owners = ["125523088429"] + owners = ["792107900819"] #Owner ID as stated from https://forums.rockylinux.org/t/rocky-linux-official-aws-ami/3049/25 most_recent = true } ssh_username = var.ssh_username From 7297274386d3638beed4eb67f9709867eebbba15 Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 25 May 2022 16:29:34 +0100 Subject: [PATCH 2/4] Chaning ssh name for AWS compute nodes Rocky8 default user is rocky instead of centos. --- roles/packer/templates/variables.pkrvars.hcl.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/packer/templates/variables.pkrvars.hcl.j2 b/roles/packer/templates/variables.pkrvars.hcl.j2 index 02d22f0e..ce5f3e95 100644 --- a/roles/packer/templates/variables.pkrvars.hcl.j2 +++ b/roles/packer/templates/variables.pkrvars.hcl.j2 @@ -1,7 +1,7 @@ ca_cert = "{{ ca_cert }}" cluster = "{{ startnode_config.cluster_id }}" destination_image_name = "citc-slurm-compute" -ssh_username = "{%- if ansible_local.citc.csp in ["aws", "google"] -%}centos{%- else -%}opc{%- endif -%}" +ssh_username = "{%- if ansible_local.citc.csp in ["google"] -%}centos{%- elif ansible_local.citc.csp in ["aws"] -%}rocky{%- else -%}opc{%- endif -%}" aws_arch = "x86_64" aws_region = "{%- if startnode_config.region is defined -%}{{ startnode_config.region }}{%- endif -%}" From 1abfbce507e5c60f36ef32d11b8f82f358c4026b Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 25 May 2022 16:30:43 +0100 Subject: [PATCH 3/4] Changing aws_instance_type to micro The packer fails due to a memory error this is removed when the instance type is micro. --- roles/packer/templates/variables.pkrvars.hcl.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/packer/templates/variables.pkrvars.hcl.j2 b/roles/packer/templates/variables.pkrvars.hcl.j2 index ce5f3e95..a475bfd5 100644 --- a/roles/packer/templates/variables.pkrvars.hcl.j2 +++ b/roles/packer/templates/variables.pkrvars.hcl.j2 @@ -5,7 +5,7 @@ ssh_username = "{%- if ansible_local.citc.csp in ["google"] -%}centos{%- elif an aws_arch = "x86_64" aws_region = "{%- if startnode_config.region is defined -%}{{ startnode_config.region }}{%- endif -%}" -aws_instance_type = "t2.nano" +aws_instance_type = "t2.micro" google_destination_image_family = "citc-slurm-compute" google_network = "{%- if startnode_config.network_name is defined -%}{{ startnode_config.network_name }}{%- endif -%}" From dd4e04ee5b0e73f3b03d0872768ea26238533bf1 Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 25 May 2022 16:40:55 +0100 Subject: [PATCH 4/4] Adding kernel-devel and headers Rocky8 does not come with the kernel-devel and headers as default, without these the nvidia drivers fail to install properly. Therefore, they are installed here to maintain documentation. --- roles/packer/templates/prepare_ansible.sh.j2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/packer/templates/prepare_ansible.sh.j2 b/roles/packer/templates/prepare_ansible.sh.j2 index 0637bb52..f8cbb2e0 100644 --- a/roles/packer/templates/prepare_ansible.sh.j2 +++ b/roles/packer/templates/prepare_ansible.sh.j2 @@ -9,9 +9,13 @@ $(hostname) cluster_id={{ startnode_config.cluster_id }} packer_run=yes EOF' -{% if ansible_local.citc.csp in ["aws", "google"] %} +{% if ansible_local.citc.csp == "google" %} sudo yum install -y epel-release sudo dnf config-manager --set-enabled powertools +{% elif ansible_local.citc.csp == "aws" %} +sudo yum install -y epel-release +sudo dnf config-manager --set-enabled powertools +sudo dnf install -y kernel-devel-$(uname -r) kernel-headers-$(uname -r) {% elif ansible_local.citc.csp == "oracle" %} sudo dnf install -y oracle-epel-release-el8 sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm