Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOSGCP-86 Add support for advanced networking #30

Merged
merged 2 commits into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 2 additions & 0 deletions terraform/examples/daos_cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ No resources.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_client_gvnic"></a> [client\_gvnic](#input\_client\_gvnic) | Use Google Virtual NIC (gVNIC) network interface on DAOS clients | `bool` | `false` | no |
| <a name="input_client_instance_base_name"></a> [client\_instance\_base\_name](#input\_client\_instance\_base\_name) | MIG instance base names to use | `string` | `"daos-client"` | no |
| <a name="input_client_labels"></a> [client\_labels](#input\_client\_labels) | Set of key/value label pairs to assign to daos-client instances | `any` | `{}` | no |
| <a name="input_client_machine_type"></a> [client\_machine\_type](#input\_client\_machine\_type) | GCP machine type. ie. c2-standard-16 | `string` | `"c2-standard-16"` | no |
Expand All @@ -252,6 +253,7 @@ No resources.
| <a name="input_server_daos_disk_count"></a> [server\_daos\_disk\_count](#input\_server\_daos\_disk\_count) | Number of local ssd's to use | `number` | `16` | no |
| <a name="input_server_daos_disk_type"></a> [server\_daos\_disk\_type](#input\_server\_daos\_disk\_type) | Daos disk type to use. For now only suported one is local-ssd | `string` | `"local-ssd"` | no |
| <a name="input_server_daos_scm_size"></a> [server\_daos\_scm\_size](#input\_server\_daos\_scm\_size) | scm\_size | `number` | `200` | no |
| <a name="input_server_gvnic"></a> [server\_gvnic](#input\_server\_gvnic) | Use Google Virtual NIC (gVNIC) network interface on DAOS servers | `bool` | `false` | no |
| <a name="input_server_instance_base_name"></a> [server\_instance\_base\_name](#input\_server\_instance\_base\_name) | MIG instance base names to use | `string` | `"daos-server"` | no |
| <a name="input_server_labels"></a> [server\_labels](#input\_server\_labels) | Set of key/value label pairs to assign to daos-server instances | `any` | `{}` | no |
| <a name="input_server_machine_type"></a> [server\_machine\_type](#input\_server\_machine\_type) | GCP machine type. ie. e2-medium | `string` | `"n2-custom-36-215040"` | no |
Expand Down
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
}
14 changes: 14 additions & 0 deletions terraform/examples/daos_cluster/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
"header": "",
"footer": "",
"inputs": [
{
"name": "client_gvnic",
"type": "bool",
"description": "Use Google Virtual NIC (gVNIC) network interface on DAOS clients",
"default": false,
"required": false
},
{
"name": "client_instance_base_name",
"type": "string",
Expand Down Expand Up @@ -145,6 +152,13 @@
"default": 200,
"required": false
},
{
"name": "server_gvnic",
"type": "bool",
"description": "Use Google Virtual NIC (gVNIC) network interface on DAOS servers",
"default": false,
"required": false
},
{
"name": "server_instance_base_name",
"type": "string",
Expand Down
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}"
Loading