Skip to content

Commit

Permalink
DAOSGCP-85 Add daos_client_install_script output to daos_server module (
Browse files Browse the repository at this point in the history
#32)

* DAOSGCP-85 Add daos_client_install_script output to daos_server module

Needed for HPC toolkit

Signed-off-by: Mark A. Olson <[email protected]>
  • Loading branch information
markaolson authored Apr 13, 2022
1 parent 24753dd commit 5a68fe9
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 11 deletions.
15 changes: 4 additions & 11 deletions images/scripts/install_daos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,14 @@ add_repo() {
;;
esac

echo "Adding DAOS version ${DAOS_VERSION} repo"
cat > /etc/yum.repos.d/daos.repo <<EOF
[daos-packages]
name=DAOS v${DAOS_VERSION} Packages
baseurl=${DAOS_REPO_BASE_URL}/v${DAOS_VERSION}/${DAOS_OS_VERSION}/packages/x86_64/
enabled=1
gpgcheck=1
protect=1
gpgkey=https://packages.daos.io/RPM-GPG-KEY
EOF
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"

}

install_epel() {
# DAOS has dependencies on packages in epel
if rpm -qa | grep -q "epel-release"; then
if ! rpm -qa | grep -q "epel-release"; then
yum install -y epel-release
fi
}
Expand Down
1 change: 1 addition & 0 deletions terraform/examples/daos_cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ variable "server_daos_scm_size" {
variable "server_daos_crt_timeout" {
description = "crt_timeout"
default = 300
type = number
}

variable "server_gvnic" {
Expand Down
1 change: 1 addition & 0 deletions terraform/modules/daos_server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ No modules.
|------|-------------|
| <a name="output_access_points"></a> [access\_points](#output\_access\_points) | List of DAOS servers to use as access points |
| <a name="output_daos_agent_yml"></a> [daos\_agent\_yml](#output\_daos\_agent\_yml) | YAML to configure the daos agent. This is typically saved in /etc/daos/daos\_agent.yml |
| <a name="output_daos_client_install_script"></a> [daos\_client\_install\_script](#output\_daos\_client\_install\_script) | Script to install the DAOS client package. |
| <a name="output_daos_config_script"></a> [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. |
| <a name="output_daos_control_yml"></a> [daos\_control\_yml](#output\_daos\_control\_yml) | YAML configuring DAOS control. This is typically saved in /etc/daos/daos\_control.yml |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
3 changes: 3 additions & 0 deletions terraform/modules/daos_server/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions terraform/modules/daos_server/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
5 changes: 5 additions & 0 deletions terraform/modules/daos_server/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 5a68fe9

Please sign in to comment.