From 27bd9a3628a2da0fe6c3ea49b33cb7bddc984144 Mon Sep 17 00:00:00 2001 From: "Mark A. Olson" Date: Tue, 12 Apr 2022 17:04:40 -0700 Subject: [PATCH 1/2] DAOSGCP-85 Add daos_client_install_script output to daos_server module Needed for HPC toolkit Signed-off-by: Mark A. Olson --- terraform/examples/daos_cluster/variables.tf | 1 + terraform/modules/daos_server/README.md | 1 + terraform/modules/daos_server/main.tf | 3 ++ terraform/modules/daos_server/module.json | 4 ++ terraform/modules/daos_server/outputs.tf | 5 +++ .../scripts/daos_client_install_script.sh | 39 +++++++++++++++++++ 6 files changed, 53 insertions(+) create mode 100644 terraform/modules/daos_server/scripts/daos_client_install_script.sh diff --git a/terraform/examples/daos_cluster/variables.tf b/terraform/examples/daos_cluster/variables.tf index ddfe106..6038667 100644 --- a/terraform/examples/daos_cluster/variables.tf +++ b/terraform/examples/daos_cluster/variables.tf @@ -148,6 +148,7 @@ variable "server_daos_scm_size" { variable "server_daos_crt_timeout" { description = "crt_timeout" default = 300 + type = number } variable "server_gvnic" { diff --git a/terraform/modules/daos_server/README.md b/terraform/modules/daos_server/README.md index 8af8f49..cb46e47 100644 --- a/terraform/modules/daos_server/README.md +++ b/terraform/modules/daos_server/README.md @@ -86,6 +86,7 @@ No modules. |------|-------------| | [access\_points](#output\_access\_points) | List of DAOS servers to use as access points | | [daos\_agent\_yml](#output\_daos\_agent\_yml) | YAML to configure the daos agent. This is typically saved in /etc/daos/daos\_agent.yml | +| [daos\_client\_install\_script](#output\_daos\_client\_install\_script) | Script to install the DAOS client package. | | [daos\_config\_script](#output\_daos\_config\_script) | Script to configure the DAOS system. This will format the sytem with dmg -l and optionally create the specified pools. | | [daos\_control\_yml](#output\_daos\_control\_yml) | YAML configuring DAOS control. This is typically saved in /etc/daos/daos\_control.yml | diff --git a/terraform/modules/daos_server/main.tf b/terraform/modules/daos_server/main.tf index 97e1335..da2a85d 100644 --- a/terraform/modules/daos_server/main.tf +++ b/terraform/modules/daos_server/main.tf @@ -58,6 +58,9 @@ locals { } ) + daos_client_install_script_content = file( + "${path.module}/scripts/daos_client_install_script.sh") + # Google Virtual NIC (gVNIC) network interface nic_type = var.gvnic ? "GVNIC" : "VIRTIO_NET" total_egress_bandwidth_tier = var.gvnic ? "TIER_1" : "DEFAULT" diff --git a/terraform/modules/daos_server/module.json b/terraform/modules/daos_server/module.json index 45ef6ca..d0974e6 100644 --- a/terraform/modules/daos_server/module.json +++ b/terraform/modules/daos_server/module.json @@ -191,6 +191,10 @@ "name": "daos_agent_yml", "description": "YAML to configure the daos agent. This is typically saved in /etc/daos/daos_agent.yml" }, + { + "name": "daos_client_install_script", + "description": "Script to install the DAOS client package." + }, { "name": "daos_config_script", "description": "Script to configure the DAOS system. This will format the sytem with dmg -l and optionally create the specified pools." diff --git a/terraform/modules/daos_server/outputs.tf b/terraform/modules/daos_server/outputs.tf index c48a936..79f7821 100644 --- a/terraform/modules/daos_server/outputs.tf +++ b/terraform/modules/daos_server/outputs.tf @@ -21,3 +21,8 @@ output "daos_config_script" { description = "Script to configure the DAOS system. This will format the sytem with dmg -l and optionally create the specified pools." value = local.configure_daos_content } + +output "daos_client_install_script" { + description = "Script to install the DAOS client package." + value = local.daos_client_install_script_content +} diff --git a/terraform/modules/daos_server/scripts/daos_client_install_script.sh b/terraform/modules/daos_server/scripts/daos_client_install_script.sh new file mode 100644 index 0000000..90b337c --- /dev/null +++ b/terraform/modules/daos_server/scripts/daos_client_install_script.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Install DAOS Client package +# +# TODO: Add support for installing on openSUSE Leap 15.3 and Ubuntu 20.04 LTS +# + +DAOS_VERSION="${DAOS_VERSION:-2.0}" + +echo "BEGIN: DAOS Client Installation" + +# Determine which repo to use +# shellcheck disable=SC1091 +source "/etc/os-release" +OS_VERSION=$(echo "${VERSION_ID}" | cut -d. -f1) +OS_VERSION_ID="${ID,,}_${OS_VERSION}" +case ${OS_VERSION_ID} in + centos_7) + DAOS_OS_VERSION="CentOS7" + ;; + centos_8) + DAOS_OS_VERSION="CentOS8" + ;; + rocky_8) + DAOS_OS_VERSION="CentOS8" + ;; + *) + echo "ERROR: Unsupported OS: ${OS_VERSION_ID}. Exiting." + exit 1 + ;; +esac + +echo "Adding DAOS v${DAOS_VERSION} packages repo" +curl -s --output /etc/yum.repos.d/daos_packages.repo "https://packages.daos.io/v${DAOS_VERSION}/${DAOS_OS_VERSION}/packages/x86_64/daos_packages.repo" + +echo "Installing daos-client and daos-devel packages" +yum install -y daos-client daos-devel +systemctl enable daos_agent + +echo "END: DAOS Client Installation" From a8ac0dc5d8b031ae2e32674103024df0953d4ea8 Mon Sep 17 00:00:00 2001 From: "Mark A. Olson" Date: Tue, 12 Apr 2022 17:15:02 -0700 Subject: [PATCH 2/2] DAOSGCP-85 Fix epel-release check and download daos_packages.repo Fixed an incorrect if statement used to determine if epel-release is installed. Changed the way that the /etc/yum.repos.d/daos_packages.repo gets created. Instead of creating the file from a HEREDOC the file is now downloaded from the packages.daos.io repo. Signed-off-by: Mark A. Olson --- images/scripts/install_daos.sh | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/images/scripts/install_daos.sh b/images/scripts/install_daos.sh index 898ed34..36f9cdb 100644 --- a/images/scripts/install_daos.sh +++ b/images/scripts/install_daos.sh @@ -179,21 +179,14 @@ add_repo() { ;; esac - echo "Adding DAOS version ${DAOS_VERSION} repo" - cat > /etc/yum.repos.d/daos.repo <