Skip to content

Commit

Permalink
fix: Bootstrapping (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzalezzfelipe authored Nov 8, 2024
1 parent b6ada22 commit feaebf2
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 41 deletions.
10 changes: 1 addition & 9 deletions bootstrap/cell/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ variable "salt" {
type = string
}

variable "extension_subdomain" {
type = string
}

variable "dns_zone" {
default = "demeter.run"
}

variable "storage_size" {
type = string
}
Expand All @@ -31,7 +23,7 @@ variable "tolerations" {
effect = string
key = string
operator = string
value = string
value = optional(string)
}))
default = [
{
Expand Down
1 change: 1 addition & 0 deletions bootstrap/configs/cardano-mainnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ path = "/var/data/mainnet/db"
byron_path = "/etc/genesis/mainnet/byron.json"
shelley_path = "/etc/genesis/mainnet/shelley.json"
alonzo_path = "/etc/genesis/mainnet/alonzo.json"
conway_path = "/etc/genesis/mainnet/conway.json"

[sync]
pull_batch_size = 100
Expand Down
1 change: 1 addition & 0 deletions bootstrap/configs/cardano-preprod.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ path = "/var/data/preprod/db"
byron_path = "/etc/genesis/preprod/byron.json"
shelley_path = "/etc/genesis/preprod/shelley.json"
alonzo_path = "/etc/genesis/preprod/alonzo.json"
conway_path = "/etc/genesis/preprod/conway.json"

[sync]
pull_batch_size = 100
Expand Down
1 change: 1 addition & 0 deletions bootstrap/configs/cardano-preview.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ path = "/var/data/preview/db"
byron_path = "/etc/genesis/preview/byron.json"
shelley_path = "/etc/genesis/preview/shelley.json"
alonzo_path = "/etc/genesis/preview/alonzo.json"
conway_path = "/etc/genesis/preview/conway.json"

[sync]
pull_batch_size = 100
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/instance/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ variable "tolerations" {
effect = string
key = string
operator = string
value = string
value = optional(string)
}))
default = [
{
Expand Down
51 changes: 24 additions & 27 deletions bootstrap/instance/sts.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,30 @@ resource "kubernetes_stateful_set_v1" "utxorpc" {
}
}
spec {
# @TODO: once the bootstrap command works in non-interactive, we can restore this.
# init_container {
# name = "init"
# image = "ghcr.io/txpipe/dolos:${var.dolos_version}"
# # command = ["sleep", "infinity"]
# args = [
# "-c",
# "/etc/config/dolos.toml",
# "bootstrap",
# "--download-dir",
# "/var/data/${var.network}/snapshot",
# "--skip-if-not-empty",
# # "--skip-download",
# ]
# resources {
# limits = var.resources.limits
# requests = var.resources.requests
# }
# volume_mount {
# name = "config"
# mount_path = "/etc/config"
# }
# volume_mount {
# name = "data"
# mount_path = "/var/data"
# }
# }
init_container {
name = "init"
image = "ghcr.io/txpipe/dolos:${var.dolos_version}"
args = [
"-c",
"/etc/config/dolos.toml",
"bootstrap",
"snapshot",
"--variant",
"full"
]
resources {
limits = var.resources.limits
requests = var.resources.requests
}
volume_mount {
name = "config"
mount_path = "/etc/config"
}
volume_mount {
name = "data"
mount_path = "/var/data"
}
}
container {
name = local.instance
image = "ghcr.io/txpipe/dolos:${var.dolos_version}"
Expand Down
6 changes: 2 additions & 4 deletions bootstrap/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,8 @@ module "cells" {
for_each = var.cells
source = "./cell"

namespace = var.namespace
salt = each.key
extension_subdomain = var.extension_subdomain
dns_zone = var.dns_zone
namespace = var.namespace
salt = each.key
tolerations = coalesce(each.value.tolerations, [
{
effect = "NoSchedule"
Expand Down

0 comments on commit feaebf2

Please sign in to comment.