Skip to content

Commit

Permalink
DAOSGCP-86 Add support for advanced networking
Browse files Browse the repository at this point in the history
Signed-off-by: Łukasz Sitkiewicz <lukasz.sitkiewicz@intel.com>
  • Loading branch information
lsitkiew committed Apr 11, 2022
1 parent c11c823 commit 415180c
Show file tree
Hide file tree
Showing 19 changed files with 199 additions and 117 deletions.
45 changes: 0 additions & 45 deletions images/daos-client-image.json

This file was deleted.

53 changes: 53 additions & 0 deletions images/daos-client-image.pkr.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
packer {
required_plugins {
googlecompute = {
version = ">= v1.0.11"
source = "github.com/hashicorp/googlecompute"
}
}
}

variable "daos_repo_base_url" {
type = string
}
variable "daos_version" {
type = string
}
variable "project_id" {
type = string
}
variable "zone" {
type = string
}

source "googlecompute" "daos-client-hpc-centos-7" {
disk_size = "20"
image_family = "daos-client-hpc-centos-7"
image_guest_os_features = ["GVNIC"]
image_name = "daos-client-hpc-centos-7-v${formatdate("YYYYMMDD-hhmmss", timestamp())}"
machine_type = "n1-standard-16"
metadata = {
enable-oslogin = "False"
}
project_id = "${var.project_id}"
scopes = ["https://www.googleapis.com/auth/cloud-platform"]
source_image_family = "hpc-centos-7"
source_image_project_id = ["cloud-hpc-image-public"]
ssh_username = "packer"
zone = "${var.zone}"
}

build {
sources = ["source.googlecompute.daos-client-hpc-centos-7"]

provisioner "shell" {
environment_vars = ["DAOS_REPO_BASE_URL=${var.daos_repo_base_url}", "DAOS_VERSION=${var.daos_version}", "DAOS_INSTALL_TYPE=client"]
execute_command = "echo 'packer' | sudo -S env {{ .Vars }} {{ .Path }}"
pause_before = "5s"
scripts = [
"./scripts/tune.sh",
"./scripts/install_daos.sh"
]
}

}
45 changes: 0 additions & 45 deletions images/daos-server-image.json

This file was deleted.

53 changes: 53 additions & 0 deletions images/daos-server-image.pkr.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
packer {
required_plugins {
googlecompute = {
version = ">= v1.0.11"
source = "github.com/hashicorp/googlecompute"
}
}
}

variable "daos_repo_base_url" {
type = string
}
variable "daos_version" {
type = string
}
variable "project_id" {
type = string
}
variable "zone" {
type = string
}

source "googlecompute" "daos-server-centos-7" {
disk_size = "20"
image_family = "daos-server-centos-7"
image_guest_os_features = ["GVNIC"]
image_name = "daos-server-centos-7-v${formatdate("YYYYMMDD-hhmmss", timestamp())}"
machine_type = "n1-standard-16"
metadata = {
enable-oslogin = "False"
}
project_id = "${var.project_id}"
scopes = ["https://www.googleapis.com/auth/cloud-platform"]
source_image_family = "centos-7"
source_image_project_id = ["centos-cloud"]
ssh_username = "packer"
zone = "${var.zone}"
}

build {
sources = ["source.googlecompute.daos-server-centos-7"]

provisioner "shell" {
environment_vars = ["DAOS_REPO_BASE_URL=${var.daos_repo_base_url}", "DAOS_VERSION=${var.daos_version}", "DAOS_INSTALL_TYPE=server"]
execute_command = "echo 'packer' | sudo -S env {{ .Vars }} {{ .Path }}"
pause_before = "5s"
scripts = [
"./scripts/tune.sh",
"./scripts/install_daos.sh"
]
}

}
20 changes: 10 additions & 10 deletions images/packer_cloudbuild-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@

steps:
- name: 'gcr.io/$PROJECT_ID/packer'
entrypoint: '/bin/bash'
args:
- build
- -var
- project_id=${_PROJECT_ID}
- -var
- zone=${_ZONE}
- -var
- daos_version=${_DAOS_VERSION}
- -var
- daos_repo_base_url=${_DAOS_REPO_BASE_URL}
- daos-client-image.json
- '-c'
- |
/usr/bin/packer init daos-client-image.pkr.hcl && \
/usr/bin/packer build \
-var daos_repo_base_url=${_DAOS_REPO_BASE_URL} \
-var daos_version=${_DAOS_VERSION} \
-var project_id=${_PROJECT_ID} \
-var zone=${_ZONE} \
daos-client-image.pkr.hcl
20 changes: 10 additions & 10 deletions images/packer_cloudbuild-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@

steps:
- name: 'gcr.io/$PROJECT_ID/packer'
entrypoint: '/bin/bash'
args:
- build
- -var
- project_id=${_PROJECT_ID}
- -var
- zone=${_ZONE}
- -var
- daos_version=${_DAOS_VERSION}
- -var
- daos_repo_base_url=${_DAOS_REPO_BASE_URL}
- daos-server-image.json
- '-c'
- |
/usr/bin/packer init daos-server-image.pkr.hcl && \
/usr/bin/packer build \
-var daos_repo_base_url=${_DAOS_REPO_BASE_URL} \
-var daos_version=${_DAOS_VERSION} \
-var project_id=${_PROJECT_ID} \
-var zone=${_ZONE} \
daos-server-image.pkr.hcl
7 changes: 4 additions & 3 deletions terraform/examples/daos_cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ module "daos_server" {
daos_disk_type = var.server_daos_disk_type
daos_crt_timeout = var.server_daos_crt_timeout
daos_scm_size = var.server_daos_scm_size

service_account = var.server_service_account
pools = var.server_pools
service_account = var.server_service_account
pools = var.server_pools
gvnic = var.server_gvnic
}

module "daos_client" {
Expand All @@ -52,4 +52,5 @@ module "daos_client" {
service_account = var.client_service_account
daos_agent_yml = module.daos_server.daos_agent_yml
daos_control_yml = module.daos_server.daos_control_yml
gvnic = var.client_gvnic
}
12 changes: 11 additions & 1 deletion terraform/examples/daos_cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,12 @@ variable "server_daos_scm_size" {
variable "server_daos_crt_timeout" {
description = "crt_timeout"
default = 300
type = number
}

variable "server_gvnic" {
description = "Use Google Virtual NIC (gVNIC) network interface on DAOS servers"
default = false
type = bool
}

variable "client_labels" {
Expand Down Expand Up @@ -234,3 +239,8 @@ variable "client_preemptible" {
type = string
}

variable "client_gvnic" {
description = "Use Google Virtual NIC (gVNIC) network interface on DAOS clients"
default = false
type = bool
}
6 changes: 3 additions & 3 deletions terraform/examples/io500/build_daos_io500_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ create_tmp_dir() {
cp -r "${IMAGES_DIR}" "${TMP_DIR}/"
TMP_IMAGES_DIR="${TMP_DIR}/$(basename "${IMAGES_DIR}")"
TMP_SCRIPTS_DIR="${TMP_IMAGES_DIR}/scripts"
TMP_CLIENT_PACKER_FILE="${TMP_IMAGES_DIR}/daos-client-image.json"
TMP_SERVER_PACKER_FILE="${TMP_IMAGES_DIR}/daos-server-image.json"
TMP_CLIENT_PACKER_FILE="${TMP_IMAGES_DIR}/daos-client-image.pkr.hcl"
TMP_SERVER_PACKER_FILE="${TMP_IMAGES_DIR}/daos-server-image.pkr.hcl"
}

cleanup() {
Expand All @@ -184,7 +184,7 @@ add_script() {
script_name="$1"
comma="$2"
if ! grep -q "${script_name}" "${TMP_CLIENT_PACKER_FILE}"; then
sed -i "\|\"./scripts/install_daos.sh\",$|a \\ \"./scripts/${script_name}\"${comma}" "${TMP_CLIENT_PACKER_FILE}"
sed -i "\|\"./scripts/install_daos.sh\",$|a \\ \"./scripts/${script_name}\"${comma}" "${TMP_CLIENT_PACKER_FILE}"
fi
}

Expand Down
4 changes: 4 additions & 0 deletions terraform/examples/io500/config/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ DAOS_SERVER_MACHINE_TYPE=n2-highmem-32 # n2-custom-20-131072 n2-custom-40-262144
DAOS_SERVER_DISK_COUNT=8
DAOS_SERVER_CRT_TIMEOUT=300
DAOS_SERVER_SCM_SIZE=100
DAOS_SERVER_GVNIC=false

# Client(s)
DAOS_CLIENT_INSTANCE_COUNT="1"
DAOS_CLIENT_MACHINE_TYPE=c2-standard-16 # c2-standard-16 n2-standard-2
DAOS_CLIENT_GVNIC=false

# Storage
DAOS_POOL_SIZE="$(awk -v disk_count=${DAOS_SERVER_DISK_COUNT} -v server_count=${DAOS_SERVER_INSTANCE_COUNT} 'BEGIN {pool_size = 375 * disk_count * server_count / 1000; print pool_size"TB"}')"
Expand Down Expand Up @@ -68,6 +70,7 @@ export TF_VAR_server_mig_name="${DAOS_SERVER_BASE_NAME}"
export TF_VAR_server_machine_type="${DAOS_SERVER_MACHINE_TYPE}"
export TF_VAR_server_os_project="${TF_VAR_project_id}"
export TF_VAR_server_os_family="daos-server-io500-centos-7"
export TF_VAR_server_gvnic="${DAOS_SERVER_GVNIC}"
# Clients
export TF_VAR_client_preemptible=${PREEMPTIBLE_INSTANCES}
export TF_VAR_client_number_of_instances=${DAOS_CLIENT_INSTANCE_COUNT}
Expand All @@ -79,3 +82,4 @@ export TF_VAR_client_mig_name="${DAOS_CLIENT_BASE_NAME}"
export TF_VAR_client_machine_type="${DAOS_CLIENT_MACHINE_TYPE}"
export TF_VAR_client_os_project="${TF_VAR_project_id}"
export TF_VAR_client_os_family="daos-client-io500-hpc-centos-7"
export TF_VAR_client_gvnic="${DAOS_CLIENT_GVNIC}"
4 changes: 4 additions & 0 deletions terraform/examples/io500/config/config_1c_1s_8d.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ DAOS_SERVER_MACHINE_TYPE=n2-highmem-32
DAOS_SERVER_DISK_COUNT=8
DAOS_SERVER_CRT_TIMEOUT=300
DAOS_SERVER_SCM_SIZE=100
DAOS_SERVER_GVNIC=false

# Client(s)
DAOS_CLIENT_INSTANCE_COUNT="1"
DAOS_CLIENT_MACHINE_TYPE=c2-standard-16
DAOS_CLIENT_GVNIC=false

# Storage
DAOS_POOL_SIZE="$(awk -v disk_count=${DAOS_SERVER_DISK_COUNT} -v server_count=${DAOS_SERVER_INSTANCE_COUNT} 'BEGIN {pool_size = 375 * disk_count * server_count / 1000; print pool_size"TB"}')"
Expand Down Expand Up @@ -69,6 +71,7 @@ export TF_VAR_server_mig_name="${DAOS_SERVER_BASE_NAME}"
export TF_VAR_server_machine_type="${DAOS_SERVER_MACHINE_TYPE}"
export TF_VAR_server_os_project="${TF_VAR_project_id}"
export TF_VAR_server_os_family="daos-server-io500-centos-7"
export TF_VAR_server_gvnic="${DAOS_SERVER_GVNIC}"
# Clients
export TF_VAR_client_preemptible=${PREEMPTIBLE_INSTANCES}
export TF_VAR_client_number_of_instances=${DAOS_CLIENT_INSTANCE_COUNT}
Expand All @@ -80,3 +83,4 @@ export TF_VAR_client_mig_name="${DAOS_CLIENT_BASE_NAME}"
export TF_VAR_client_machine_type="${DAOS_CLIENT_MACHINE_TYPE}"
export TF_VAR_client_os_project="${TF_VAR_project_id}"
export TF_VAR_client_os_family="daos-client-io500-hpc-centos-7"
export TF_VAR_client_gvnic="${DAOS_CLIENT_GVNIC}"
4 changes: 4 additions & 0 deletions terraform/examples/io500/config/config_2c_2s_16d.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ DAOS_SERVER_MACHINE_TYPE=n2-custom-36-262144
DAOS_SERVER_DISK_COUNT=16
DAOS_SERVER_CRT_TIMEOUT=300
DAOS_SERVER_SCM_SIZE=200
DAOS_SERVER_GVNIC=false

# Client(s)
DAOS_CLIENT_INSTANCE_COUNT="2"
DAOS_CLIENT_MACHINE_TYPE=c2-standard-16
DAOS_CLIENT_GVNIC=false

# Storage
DAOS_POOL_SIZE="$(awk -v disk_count=${DAOS_SERVER_DISK_COUNT} -v server_count=${DAOS_SERVER_INSTANCE_COUNT} 'BEGIN {pool_size = 375 * disk_count * server_count / 1000; print pool_size"TB"}')"
Expand Down Expand Up @@ -69,6 +71,7 @@ export TF_VAR_server_mig_name="${DAOS_SERVER_BASE_NAME}"
export TF_VAR_server_machine_type="${DAOS_SERVER_MACHINE_TYPE}"
export TF_VAR_server_os_project="${TF_VAR_project_id}"
export TF_VAR_server_os_family="daos-server-io500-centos-7"
export TF_VAR_server_gvnic="${DAOS_SERVER_GVNIC}"
# Clients
export TF_VAR_client_preemptible=${PREEMPTIBLE_INSTANCES}
export TF_VAR_client_number_of_instances=${DAOS_CLIENT_INSTANCE_COUNT}
Expand All @@ -80,3 +83,4 @@ export TF_VAR_client_mig_name="${DAOS_CLIENT_BASE_NAME}"
export TF_VAR_client_machine_type="${DAOS_CLIENT_MACHINE_TYPE}"
export TF_VAR_client_os_project="${TF_VAR_project_id}"
export TF_VAR_client_os_family="daos-client-io500-hpc-centos-7"
export TF_VAR_client_gvnic="${DAOS_CLIENT_GVNIC}"
Loading

0 comments on commit 415180c

Please sign in to comment.