-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* restore the script files deleted in #263 * change scripts path for testing module * create hetzner module for resources * make provisioners reusable by main module and testing module * change backend * Fixes based on PR agent
- Loading branch information
1 parent
51c00c9
commit 6bdc29a
Showing
15 changed files
with
810 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
terraform { | ||
cloud { | ||
organization = "subspace-sre" | ||
|
||
workspaces { | ||
name = var.workspace_name | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
module "network" { | ||
source = "../../templates/terraform/hetzner" | ||
path_to_scripts = "../../templates/scripts" | ||
network_name = var.network_name | ||
|
||
bootstrap-node-config = { | ||
deployment-version = 1 | ||
instance-count = var.instance_count["bootstrap"] | ||
repo-org = "subspace" | ||
node-tag = "bootstrap-node" | ||
additional-node-ips = var.additional_node_ips["bootstrap"] | ||
reserved-only = true | ||
prune = false | ||
genesis-hash = var.genesis_hash | ||
dsn-listen-port = 30533 | ||
node-dsn-port = 30433 | ||
} | ||
|
||
bootstrap-node-evm-config = { | ||
deployment-version = 1 | ||
instance-count = var.instance_count["bootstrap"] | ||
repo-org = "subspace" | ||
node-tag = "bootstrap-node" | ||
additional-node-ips = var.additional_node_ips["bootstrap"] | ||
reserved-only = true | ||
prune = false | ||
genesis-hash = var.genesis_hash | ||
dsn-listen-port = 30533 | ||
node-dsn-port = 30433 | ||
operator-port = 30334 | ||
} | ||
|
||
node-config = { | ||
deployment-version = 1 | ||
instance-count = var.instance_count["node"] | ||
repo-org = "subspace" | ||
node-tag = "subspace-node" | ||
additional-node-ips = var.additional_node_ips["node"] | ||
reserved-only = true | ||
prune = false | ||
node-dsn-port = 30433 | ||
} | ||
|
||
domain-node-config = { | ||
deployment-version = 1 | ||
instance-count = var.instance_count["domain"] | ||
repo-org = "subspace" | ||
node-tag = "subspace-node" | ||
additional-node-ips = var.additional_node_ips["domain"] | ||
domain-prefix = "domain" | ||
reserved-only = true | ||
prune = false | ||
node-dsn-port = 30433 | ||
enable-domains = true | ||
domain-id = var.domain_id | ||
domain-labels = var.domain_labels | ||
} | ||
|
||
farmer-node-config = { | ||
deployment-version = 1 | ||
instance-count = var.instance_count["farmer"] | ||
repo-org = "subspace" | ||
node-tag = "farmer-node" | ||
additional-node-ips = var.additional_node_ips["farmer"] | ||
reserved-only = true | ||
prune = false | ||
plot-size = "10G" | ||
reward-address = var.farmer_reward_address | ||
force-block-production = true | ||
node-dsn-port = 30433 | ||
|
||
} | ||
|
||
tf_token = var.tf_token | ||
private_key_path = var.private_key_path | ||
branch_name = var.branch_name | ||
ssh_user = var.ssh_user | ||
genesis_hash = var.genesis_hash | ||
} | ||
|
||
# External data source to run the shell command and extract the value of the operator bootnode connection parameter | ||
data "external" "operator_peer_multiaddr" { | ||
program = ["bash", "-c", "echo '{\"OPERATOR_MULTI_ADDR\": \"'$(sed -nr 's/^NODE_0_OPERATOR_MULTI_ADDR=(.*)/\\1/p' ./bootstrap_node_evm_keys.txt)'\"}'"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
output "bootstrap-node-ipv4-addresses" { | ||
value = module.network.bootstrap-node-ipv4-addresses | ||
description = "Bootstrap node IPv4 Addresses" | ||
} | ||
|
||
output "bootstrap-node-evm-ipv4-addresses" { | ||
value = module.network.bootstrap-node-evm-ipv4-addresses | ||
description = "Bootstrap node EVM IPv4 Addresses" | ||
} | ||
|
||
output "node-ipv4-addresses" { | ||
value = module.network.node-ipv4-addresses | ||
description = "subspace node IPv4 Addresses" | ||
} | ||
|
||
output "domain-node-ipv4-addresses" { | ||
value = module.network.domain-node-ipv4-addresses | ||
description = "domain node IPv4 Addresses" | ||
} | ||
|
||
|
||
output "farmer-nodes-ipv4-addresses" { | ||
value = module.network.farmer-node-ipv4-addresses | ||
description = "Farmer node IPv4 Addresses" | ||
} | ||
|
||
# Output the operator_peer_multiaddr value | ||
output "operator_peer_multiaddr" { | ||
value = data.external.operator_peer_multiaddr.result["operator_peer_multiaddr"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
variable "farmer_reward_address" { | ||
description = "Farmer's reward address" | ||
type = string | ||
} | ||
|
||
variable "network_name" { | ||
description = "Network name" | ||
type = string | ||
} | ||
|
||
//todo change this to a map | ||
variable "domain_id" { | ||
description = "Domain ID" | ||
type = list(number) | ||
default = [0] | ||
} | ||
|
||
//todo change this to a map | ||
variable "domain_labels" { | ||
description = "Tag of the domain to run" | ||
type = list(string) | ||
default = ["evm"] | ||
} | ||
|
||
variable "instance_count" { | ||
type = map(number) | ||
default = { | ||
bootstrap = 2 | ||
node = 1 | ||
farmer = 1 | ||
domain = 2 | ||
evm_bootstrap = 1 | ||
} | ||
} | ||
|
||
variable "additional_node_ips" { | ||
type = map(list(string)) | ||
default = { | ||
bootstrap = [""] | ||
node = [""] | ||
farmer = [""] | ||
domain = [""] | ||
evm_bootstrap = [""] | ||
} | ||
} | ||
|
||
variable "ssh_user" { | ||
type = string | ||
default = "root" | ||
} | ||
|
||
variable "private_key_path" { | ||
type = string | ||
default = "~/.ssh/hetzner" | ||
} | ||
|
||
variable "tf_token" { | ||
type = string | ||
sensitive = true | ||
} | ||
|
||
variable "branch_name" { | ||
description = "name of testing branch" | ||
type = string | ||
default = "main" | ||
} | ||
|
||
variable "genesis_hash" { | ||
description = "Genesis hash" | ||
type = string | ||
} | ||
|
||
variable "workspace_name" { | ||
description = "Name of the workspace" | ||
type = string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.