Skip to content

Commit

Permalink
added CI check for terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
dkijania committed Oct 5, 2023
1 parent 87ba719 commit 57f0e41
Show file tree
Hide file tree
Showing 12 changed files with 174 additions and 35,677 deletions.
23 changes: 11 additions & 12 deletions automation/terraform/testnets/berkeley-qa/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_version = ">= 0.14.0"
backend "s3" {
key = "terraform-berkeley-qa.tfstate"
key = "terraform-berkeley-qa-v2.tfstate"
encrypt = true
region = "us-west-2"
bucket = "o1labs-terraform-state"
Expand All @@ -14,10 +14,10 @@ provider "aws" {
}

provider "google" {
alias = "google-us-east4"
alias = "google-northamerica-northeast1"
project = "o1labs-192920"
region = "us-east4"
zone = "us-east4-b"
region = "northamerica-northeast1"
zone = "northamerica-northeast1-b"
}

provider "google" {
Expand Down Expand Up @@ -60,10 +60,10 @@ variable "plain_node_count" {

locals {
testnet_name = "berkeley-qa"
mina_image = "minaprotocol/mina-daemon:1.3.2beta2-release-2.0.0-6f9d956-focal-berkeley"
mina_archive_image = "minaprotocol/mina-archive:1.3.2beta2-release-2.0.0-6f9d956-focal"
seed_region = "us-central1"
seed_zone = "us-central1-b"
mina_image = "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup3-rampup-264bcac-focal-berkeley"
mina_archive_image = "gcr.io/o1labs-192920/mina-archive:2.0.0rampup3-rampup-264bcac-focal"
seed_region = "northamerica-northeast1"
seed_zone = "northamerica-northeast1-b"

# replace with `make_report_discord_webhook_url = ""` if not in use (will fail if file not present)
make_report_discord_webhook_url = ""
Expand All @@ -81,9 +81,9 @@ module "berkeley" {

artifact_path = abspath(path.module)

cluster_name = "coda-infra-central1"
cluster_region = "us-central1"
k8s_context = "gke_o1labs-192920_us-central1_coda-infra-central1"
cluster_name = "mina-infra-canada"
cluster_region = "northamerica-northeast1"
k8s_context = "gke_o1labs-192920_northamerica-northeast1_mina-infra-canada"
testnet_name = local.testnet_name

mina_image = local.mina_image
Expand Down Expand Up @@ -181,4 +181,3 @@ module "berkeley" {
seed_peers_url = "https://storage.googleapis.com/seed-lists/berkeley-qa_seeds.txt"

}

6 changes: 3 additions & 3 deletions automation/terraform/testnets/berkeley/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ variable "plain_node_count" {

locals {
testnet_name = "berkeley"
mina_image = "minaprotocol/mina-daemon:focal-berkeley-latest" #"minaprotocol/mina-daemon:1.3.2beta2-release-2.0.0-6f9d956-focal-berkeley"
mina_archive_image = "minaprotocol/mina-archive:focal-latest" #"minaprotocol/mina-archive:1.3.2beta2-release-2.0.0-6f9d956-focal"
mina_image = "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup1-rampup-b1facec-focal-berkeley" #"minaprotocol/mina-daemon:1.3.2beta2-release-2.0.0-6f9d956-focal-berkeley"
mina_archive_image = "gcr.io/o1labs-192920/mina-archive:2.0.0rampup1-rampup-b1facec-focal" #"minaprotocol/mina-archive:1.3.2beta2-release-2.0.0-6f9d956-focal"
seed_region = "us-central1"
seed_zone = "us-central1-b"

Expand Down Expand Up @@ -96,7 +96,7 @@ module "berkeley" {

archive_node_count = 3
mina_archive_schema = "create_schema.sql"
mina_archive_schema_aux_files = ["https://raw.githubusercontent.com/MinaProtocol/mina/8468f29424fa5e70cfedf69ee281f4fa24037dfe/src/app/archive/create_schema.sql", "https://raw.githubusercontent.com/MinaProtocol/mina/8468f29424fa5e70cfedf69ee281f4fa24037dfe/src/app/archive/zkapp_tables.sql"]
mina_archive_schema_aux_files = ["https://raw.githubusercontent.com/MinaProtocol/mina/b1facecde934ce3969771c34962b878d75321ca7/src/app/archive/create_schema.sql", "https://raw.githubusercontent.com/MinaProtocol/mina/b1facecde934ce3969771c34962b878d75321ca7/src/app/archive/zkapp_tables.sql"]

archive_configs = [
{
Expand Down
140 changes: 79 additions & 61 deletions automation/terraform/testnets/ci-net/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_version = ">= 0.14.0"
backend "s3" {
key = "ci-net.tfstate"
key = "terraform-nightly.tfstate"
encrypt = true
region = "us-west-2"
bucket = "o1labs-terraform-state"
Expand All @@ -13,76 +13,72 @@ provider "aws" {
region = "us-west-2"
}

variable "mina_image" {
type = string

description = "Mina daemon image to use in provisioning a ci-net"
default = "gcr.io/o1labs-192920/coda-daemon:0.2.11-develop"
}

variable "mina_archive_image" {
type = string

description = "Mina archive node image to use in provisioning a ci-net"
default = "gcr.io/o1labs-192920/coda-archive:0.2.11-develop"
provider "google" {
alias = "google-us-east4"
project = "o1labs-192920"
region = "us-east4"
zone = "us-east4-b"
}

variable "whale_count" {
type = number
default = 1
}
type = number

variable "fish_count" {
type = number
default = 1
description = "Number of online whales for the network to run"
default = 1
}

variable "archive_count" {
type = number
default = 1
}
variable "fish_count" {
type = number

variable "snark_worker_count" {
type = number
default = 1
description = "Number of online fish for the network to run"
default = 1
}

variable "ci_cluster_region" {
type = string
default = "us-west1"
variable "seed_count" {
default = 3
}

variable "ci_k8s_ctx" {
type = string
default = "gke_o1labs-192920_us-west1_mina-integration-west1"
variable "plain_node_count" {
default = 1
}

variable "ci_artifact_path" {
type = string
default = "/tmp"
}

locals {
seed_region = "us-west1"
seed_zone = "us-west1-b"
testnet_name = "ci-net"
seed_region = "us-east4"
seed_zone = "us-east4-b"
seed_discovery_keypairs = [
"CAESQBEHe2zCcQDHcSaeIydGggamzmTapdCS8SP0hb5FWvYhe9XEygmlUGV4zNu2P8zAIba4X84Gm4usQFLamjRywA8=,CAESIHvVxMoJpVBleMzbtj/MwCG2uF/OBpuLrEBS2po0csAP,12D3KooWJ9mNdbUXUpUNeMnejRumKzmQF15YeWwAPAhTAWB6dhiv",
"CAESQO+8qvMqTaQEX9uh4NnNoyOy4Xwv3U80jAsWweQ1J37AVgx7kgs4pPVSBzlP7NDANP1qvSvEPOTh2atbMMUO8EQ=,CAESIFYMe5ILOKT1Ugc5T+zQwDT9ar0rxDzk4dmrWzDFDvBE,12D3KooWFcGGeUmbmCNq51NBdGvCWjiyefdNZbDXADMK5CDwNRm5"]

mina_image = "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup3-rampup-264bcac-focal-berkeley"
mina_archive_image = "gcr.io/o1labs-192920/mina-archive:2.0.0rampup3-rampup-264bcac-focal"

# replace with `make_report_discord_webhook_url = ""` if not in use (will fail if file not present)
make_report_discord_webhook_url = ""

# replace with `make_report_accounts = ""` if not in use (will fail if file not present)
# make_report_accounts = <<EOT
# ${file("../../../${local.testnet_name}-accounts.csv")}
# EOT
make_report_accounts = ""
}


module "ci_testnet" {
providers = { google.gke = google.google-us-east4 }
source = "../../modules/o1-testnet"

artifact_path = var.ci_artifact_path
artifact_path = abspath(path.module)

# TODO: remove obsolete cluster_name var + cluster region
cluster_name = "mina-integration-west1"
cluster_region = var.ci_cluster_region
k8s_context = var.ci_k8s_ctx
testnet_name = "ci-net-${substr(sha256(terraform.workspace), 0, 7)}"
cluster_name = "coda-infra-east4"
cluster_region = "us-east4"
k8s_context = "gke_o1labs-192920_us-east4_coda-infra-east4"
testnet_name = local.testnet_name

mina_image = var.mina_image
mina_archive_image = var.mina_archive_image
mina_agent_image = "codaprotocol/coda-user-agent:0.1.8"
mina_bots_image = "codaprotocol/bots:1.0.0"
mina_image = local.mina_image
mina_archive_image = local.mina_archive_image
mina_agent_image = "codaprotocol/coda-user-agent:0.1.5"
mina_bots_image = "codaprotocol/coda-bots:0.0.13-beta-1"
mina_points_image = "codaprotocol/coda-points-hack:32b.4"

mina_faucet_amount = "10000000000"
Expand All @@ -94,8 +90,18 @@ module "ci_testnet" {
agent_max_tx = "0.0015"
agent_send_every_mins = "1"

archive_node_count = var.archive_count
mina_archive_schema = "https://raw.githubusercontent.com/MinaProtocol/mina/develop/src/app/archive/create_schema.sql"
archive_node_count = 1
mina_archive_schema = "create_schema.sql"
mina_archive_schema_aux_files = ["https://raw.githubusercontent.com/MinaProtocol/mina/berkeley/src/app/archive/create_schema.sql", "https://raw.githubusercontent.com/MinaProtocol/mina/berkeley/src/app/archive/zkapp_tables.sql"]

archive_configs = [
{
name = "archive-1"
enableLocalDaemon = true
enablePostgresDB = true
postgresHost = "archive-1-postgresql"
},
]

seed_zone = local.seed_zone
seed_region = local.seed_region
Expand All @@ -106,27 +112,39 @@ module "ci_testnet" {
block_producer_key_pass = "naughty blue worm"
block_producer_starting_host_port = 10501

worker_cpu_request = 4
cpu_request = 12
worker_mem_request = "6Gi"
mem_request = "16Gi"

snark_coordinators = [
{
snark_worker_replicas = var.snark_worker_count
snark_worker_fee = "0.025"
snark_worker_public_key = "B62qk4nuKn2U5kb4dnZiUwXeRNtP1LncekdAKddnd1Ze8cWZnjWpmMU"
snark_coordinators_host_port = 10401
snark_worker_replicas = 1
snark_worker_fee = "0.025"
snark_worker_public_key = "B62qk4nuKn2U5kb4dnZiUwXeRNtP1LncekdAKddnd1Ze8cWZnjWpmMU"
snark_coordinators_host_port = 10401
}
]

whales= [
for i in range(var.whale_count):{
whales = [
for i in range(var.whale_count) : {
duplicates = 1
}
]
fishes= [
for i in range(var.fish_count):{

fishes = [
for i in range(var.fish_count) : {
duplicates = 1
}
]

plain_node_count = 0

upload_blocks_to_gcloud = true
restart_nodes = false
restart_nodes_every_mins = "60"
make_reports = true
make_report_every_mins = "5"
make_report_discord_webhook_url = local.make_report_discord_webhook_url
make_report_accounts = local.make_report_accounts

}
2 changes: 1 addition & 1 deletion automation/terraform/testnets/devnet2/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ module "testnet_east" {
mina_agent_image = "codaprotocol/coda-user-agent:0.1.8"
mina_bots_image = "codaprotocol/coda-bots:0.0.13-beta-1"
mina_points_image = "codaprotocol/coda-points-hack:32b.4"
watchdog_image = "gcr.io/o1labs-192920/watchdog:0.4.3"
watchdog_image = "gcr.io/o1labs-192920/watchdog:0.4.13"

archive_node_count = 3
mina_archive_schema = "https://raw.githubusercontent.com/MinaProtocol/mina/fd3980820fb82c7355af49462ffefe6718800b77/src/app/archive/create_schema.sql"
Expand Down
Loading

0 comments on commit 57f0e41

Please sign in to comment.