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

Fix naming, add new parameters for microservices #10

Merged
merged 1 commit into from
Apr 22, 2023
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
4 changes: 3 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ module "ec2_asg_stats" {
postgres_password = var.deploy_rds_db ? module.rds[0].db_instance_password : var.blockscout_settings["postgres_password"]
postgres_user = var.deploy_rds_db ? module.rds[0].db_instance_username : var.blockscout_settings["postgres_user"]
postgres_host = var.deploy_rds_db ? module.rds[0].db_instance_address : module.ec2_database[0].private_dns
create_database = var.stats_create_database
}
tags = local.final_tags
}
Expand Down Expand Up @@ -436,7 +437,8 @@ module "ec2_asg_eth_bytecode_db" {
postgres_password = var.deploy_rds_db ? module.rds[0].db_instance_password : var.blockscout_settings["postgres_password"]
postgres_user = var.deploy_rds_db ? module.rds[0].db_instance_username : var.blockscout_settings["postgres_user"]
postgres_host = var.deploy_rds_db ? module.rds[0].db_instance_address : module.ec2_database[0].private_dns
verifier_url = var.verifier_enabled ? (var.verifier_url != "" ? var.verifier_url : module.alb_verifier[0].lb_dns_name) : var.verifier_url
verifier_url = var.verifier_enabled ? (var.verifier_url != "" ? var.verifier_url : "http://${module.alb_verifier[0].lb_dns_name}") : var.verifier_url
create_database = var.eth_bytecode_db_create_database
}
tags = local.final_tags
}
Expand Down
5 changes: 3 additions & 2 deletions templates/docker_compose_eth-bytecode-db.tftpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.8'
services:
sig-provider:
container_name: 'stats'
eth-bytecode-db:
container_name: 'eth-bytecode-db'
image: ${docker_image}
restart: always
environment:
Expand All @@ -11,6 +11,7 @@ services:
ETH_BYTECODE_DB__SERVER__HTTP__MAX_BODY_SIZE: 10485760
ETH_BYTECODE_DB__TRACING__FORMAT: "json"
ETH_BYTECODE_DB__VERIFIER__URI: '${verifier_url}'
ETH_BYTECODE_DB__DATABASE__CREATE_DATABASE: "${create_database}"
RUST_LOG : info
ports:
- 8050:8050
Expand Down
3 changes: 2 additions & 1 deletion templates/docker_compose_stats.tftpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: '3.8'
services:
sig-provider:
stats:
container_name: 'stats'
image: ${docker_image}
restart: always
Expand All @@ -11,6 +11,7 @@ services:
STATS__METRICS__ENABLED: "true"
STATS__RUN_MIGRATIONS: "true"
STATS__TRACING__FORMAT: "json"
STATS__CREATE_DATABASE: "${create_database}"
ports:
- 8050:8050
- 8051:8051
Expand Down
2 changes: 1 addition & 1 deletion terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.39.0"
version = ">= 4.64.0"
}
random = {
source = "hashicorp/random"
Expand Down
12 changes: 11 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ variable "user" {
variable "image_name" {
description = "OS image mask"
type = string
default = "ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*"
default = "ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-202304*"
}
variable "image_owner" {
description = "ID of image owner"
Expand Down Expand Up @@ -257,6 +257,11 @@ variable "stats_docker_image" {
type = string
default = "ghcr.io/blockscout/stats:main"
}
variable "stats_create_database" {
description = "Create database in application start"
type = bool
default = true
}

## eth-bytecode-db settings
variable "eth_bytecode_db_enabled" {
Expand Down Expand Up @@ -284,3 +289,8 @@ variable "verifier_url" {
type = string
default = ""
}
variable "eth_bytecode_db_create_database" {
description = "Create database in application start"
type = bool
default = true
}