From d028b6bc4b819aeb32dc0e92697178e2e8462117 Mon Sep 17 00:00:00 2001 From: Garrison Davis Date: Mon, 14 Nov 2022 08:55:08 -0700 Subject: [PATCH] Make tflint and terraform fmt changes --- qa/scripts/setupSmokeTest.sh | 11 +++----- .../.modules/featurebase-cluster/variables.tf | 15 ++++++++--- qa/tf/ci/smoketest/main.tf | 26 +++++++++---------- qa/tf/ci/smoketest/outputs.tf | 10 +++---- 4 files changed, 33 insertions(+), 29 deletions(-) diff --git a/qa/scripts/setupSmokeTest.sh b/qa/scripts/setupSmokeTest.sh index 546cd5868..dd9ad749e 100755 --- a/qa/scripts/setupSmokeTest.sh +++ b/qa/scripts/setupSmokeTest.sh @@ -129,18 +129,14 @@ cp config.sh ./qa/testcases/bug-repros/config.sh #wait until we can connect to one of the hosts for i in {0..24} do - ssh -A -i ~/.ssh/gitlab-featurebase-ci.pem -o StrictHostKeyChecking=no -o ConnectTimeout=10 ec2-user@${DATANODE0} "pwd" - if [ $? -eq 0 ] - then + if ssh -A -i ~/.ssh/gitlab-featurebase-ci.pem -o StrictHostKeyChecking=no -o ConnectTimeout=10 ec2-user@${DATANODE0} "pwd"; then echo "Cluster is up after ${i} tries." break fi sleep 10 done -ssh -A -i ~/.ssh/gitlab-featurebase-ci.pem -o StrictHostKeyChecking=no -o ConnectTimeout=10 ec2-user@${DATANODE0} "pwd" -if [ $? -ne 0 ] -then +if ! ssh -A -i ~/.ssh/gitlab-featurebase-ci.pem -o StrictHostKeyChecking=no -o ConnectTimeout=10 ec2-user@${DATANODE0} "pwd"; then echo "Unable to connect to cluster - giving up" exit 1 fi @@ -150,8 +146,7 @@ setupClusterNodes $BRANCH_NAME # verify featurebase running for i in {0..24}; do sleep 1 - curl -k -v https://${DATANODE0}:10101/status -H "Authorization: Bearer ${ADMIN_TOKEN}" - if [ $? -eq 0 ]; then + if curl -k -v https://${DATANODE0}:10101/status -H "Authorization: Bearer ${ADMIN_TOKEN}"; then echo "Cluster is up after ${i} tries" exit 0 fi diff --git a/qa/tf/.modules/featurebase-cluster/variables.tf b/qa/tf/.modules/featurebase-cluster/variables.tf index 8cc9533f4..8c3a3628d 100644 --- a/qa/tf/.modules/featurebase-cluster/variables.tf +++ b/qa/tf/.modules/featurebase-cluster/variables.tf @@ -34,32 +34,40 @@ variable "fb_cluster_replica_count" { } variable "subnet" { + type = string default = "" } variable "zone" { + type = string default = "" } variable "fb_data_disk_type" { + type = string default = "gp3" } variable "fb_data_disk_iops" { + type = number default = 1000 } variable "fb_data_disk_size_gb" { + type = number default = 100 } variable "fb_ingest_disk_type" { + type = string default = "gp3" } variable "fb_ingest_disk_iops" { + type = number default = 1000 } variable "fb_ingest_disk_size_gb" { + type = number default = 100 } @@ -79,6 +87,7 @@ variable "public_subnets" { } variable "vpc_cidr" { + type = string default = "10.0.0.0/16" } @@ -115,15 +124,15 @@ variable "vpc_private_subnets" { variable "user_data" { description = "Cloud init script" - type = string + type = string } variable "ebs_volumes" { - type = list(string) + type = list(string) default = ["/dev/sdb"] } variable "use_spot_instances" { - type = bool + type = bool default = false } diff --git a/qa/tf/ci/smoketest/main.tf b/qa/tf/ci/smoketest/main.tf index 19ef9ccca..e00960195 100644 --- a/qa/tf/ci/smoketest/main.tf +++ b/qa/tf/ci/smoketest/main.tf @@ -1,16 +1,16 @@ module "ci-cluster" { - source = "../../.modules/featurebase-cluster" - cluster_prefix = var.cluster_prefix - region = var.region - profile = var.profile - fb_data_node_type = "m6g.large" - fb_data_node_count = 1 - fb_ingest_type = "m6g.large" - vpc_id = "vpc-05a26a122f961dc2b" - vpc_cidr_block = "10.0.0.0/16" - vpc_public_subnets = ["subnet-066b4b922b54e51a2","subnet-037b8884269a69025","subnet-08482631514426210",] - vpc_private_subnets = ["subnet-0319dde319380326f","subnet-0517ca9a646d80f88","subnet-05a7b685ed27eb1cf",] - user_data = "../../.modules/featurebase-cluster/cloud-init.sh" - use_spot_instances = true + source = "../../.modules/featurebase-cluster" + cluster_prefix = var.cluster_prefix + region = var.region + profile = var.profile + fb_data_node_type = "m6g.large" + fb_data_node_count = 1 + fb_ingest_type = "m6g.large" + vpc_id = "vpc-05a26a122f961dc2b" + vpc_cidr_block = "10.0.0.0/16" + vpc_public_subnets = ["subnet-066b4b922b54e51a2", "subnet-037b8884269a69025", "subnet-08482631514426210", ] + vpc_private_subnets = ["subnet-0319dde319380326f", "subnet-0517ca9a646d80f88", "subnet-05a7b685ed27eb1cf", ] + user_data = "../../.modules/featurebase-cluster/cloud-init.sh" + use_spot_instances = true } diff --git a/qa/tf/ci/smoketest/outputs.tf b/qa/tf/ci/smoketest/outputs.tf index 886c6f783..92d67ff96 100644 --- a/qa/tf/ci/smoketest/outputs.tf +++ b/qa/tf/ci/smoketest/outputs.tf @@ -1,19 +1,19 @@ output "ingest_ips" { - description = "List of ingest IPs" - value = module.ci-cluster.ingest_ips + description = "List of ingest IPs" + value = module.ci-cluster.ingest_ips } output "data_node_ips" { description = "List of data node IPs" - value = module.ci-cluster.data_node_ips + value = module.ci-cluster.data_node_ips } output "cluster_prefix" { description = "The cluster prefix used" - value = module.ci-cluster.cluster_prefix + value = module.ci-cluster.cluster_prefix } output "fb_cluster_replica_count" { description = "The cluster replica count used" - value = module.ci-cluster.fb_cluster_replica_count + value = module.ci-cluster.fb_cluster_replica_count }