Staging: cleanup garage job

This commit is contained in:
Alex 2022-11-29 14:42:53 +01:00
parent c9f9ed4c71
commit 14e3e6deff
Signed by untrusted user: lx
GPG key ID: 0E496D15096376BE
2 changed files with 60 additions and 116 deletions

View file

@ -10,9 +10,6 @@ rpc_bind_addr = "[{{ env "meta.public_ipv6" }}]:3991"
rpc_public_addr = "[{{ env "meta.public_ipv6" }}]:3991" rpc_public_addr = "[{{ env "meta.public_ipv6" }}]:3991"
rpc_secret = "{{ key "secrets/garage-staging/rpc_secret" | trimSpace }}" rpc_secret = "{{ key "secrets/garage-staging/rpc_secret" | trimSpace }}"
#consul_host = "localhost:8500"
#consul_service_name = "garage-staging-rpc-self-advertised"
bootstrap_peers = [] bootstrap_peers = []
[consul_discovery] [consul_discovery]

View file

@ -1,13 +1,13 @@
job "garage-staging" { job "garage-staging" {
type = "system" type = "system"
#datacenters = [ "neptune", "pluton" ] priority = 90
datacenters = [ "neptune" ] datacenters = [ "neptune" ]
priority = 80 update {
max_parallel = 1
constraint { stagger = "30s"
attribute = "${attr.cpu.arch}" min_healthy_time = "10s"
value = "amd64"
} }
group "garage-staging" { group "garage-staging" {
@ -19,43 +19,6 @@ job "garage-staging" {
port "admin" { static = 3909 } port "admin" { static = 3909 }
} }
update {
max_parallel = 1
min_healthy_time = "30s"
healthy_deadline = "5m"
}
# task "repair" {
# lifecycle {
# hook = "prestart"
# sidecar = false
# }
# driver = "docker"
# config {
# image = "dxflrs/amd64_garage:v0.7.99-k2v"
# command = "/garage"
# args = [ "offline-repair", "--yes", "object_counters" ]
# network_mode = "host"
# volumes = [
# "/mnt/storage/garage-staging/data:/data",
# "/mnt/ssd/garage-staging/meta:/meta",
# "secrets/garage.toml:/etc/garage.toml",
# ]
# }
# template {
# data = file("../config/garage.toml")
# destination = "secrets/garage.toml"
# }
# resources {
# memory = 2000
# cpu = 1000
# }
# }
task "server" { task "server" {
driver = "nix2" driver = "nix2"
@ -71,6 +34,12 @@ job "garage-staging" {
"/mnt/ssd/garage-staging/meta" = "/meta", "/mnt/ssd/garage-staging/meta" = "/meta",
} }
} }
env = {
RUST_LOG = "garage=debug",
}
# files currently owned by root, we don't want to chown everything
user = "root" user = "root"
template { template {
@ -93,14 +62,6 @@ job "garage-staging" {
destination = "etc/garage/consul-client.key" destination = "etc/garage/consul-client.key"
} }
template {
data = <<EOH
RUST_LOG=garage=debug
EOH
destination = "secrets/env"
env = true
}
resources { resources {
memory = 2000 memory = 2000
memory_max = 3000 memory_max = 3000
@ -110,26 +71,31 @@ EOH
kill_signal = "SIGINT" kill_signal = "SIGINT"
kill_timeout = "20s" kill_timeout = "20s"
service {
name = "garage-staging-rpc"
tags = ["garage-staging-rpc"]
port = "rpc"
# No check on RPC, it wouldn't try connecting to the correct address
# (Garage listens only on IPv6 for RPC, see config file)
}
service { service {
name = "garage-staging-s3-api" name = "garage-staging-s3-api"
tags = [ tags = [
"garage-staging-api", "garage-staging-api",
"tricot garage-staging.home.adnab.me",
"tricot garage.staging.deuxfleurs.org", "tricot garage.staging.deuxfleurs.org",
"tricot-add-header Access-Control-Allow-Origin *", "tricot-add-header Access-Control-Allow-Origin *",
] ]
port = "s3" port = "s3"
#address_mode = "host" check {
#check { type = "tcp"
# type = "tcp" interval = "60s"
# interval = "60s" timeout = "5s"
# timeout = "5s" check_restart {
# check_restart { limit = 3
# limit = 3 grace = "90s"
# grace = "90s" }
# ignore_warnings = false }
# }
#}
} }
service { service {
@ -140,38 +106,15 @@ EOH
"tricot-add-header Access-Control-Allow-Origin *", "tricot-add-header Access-Control-Allow-Origin *",
] ]
port = "k2v" port = "k2v"
#address_mode = "driver" check {
# check { type = "tcp"
# type = "tcp" interval = "60s"
# port = 3993 timeout = "5s"
# address_mode = "driver" check_restart {
# interval = "60s" limit = 3
# timeout = "5s" grace = "90s"
# check_restart { }
# limit = 3
# grace = "90s"
# ignore_warnings = false
# }
# }
} }
service {
name = "garage-staging-rpc"
tags = ["garage-staging-rpc"]
port = "rpc"
#address_mode = "driver"
#check {
# type = "tcp"
# port = 3991
# address_mode = "driver"
# interval = "60s"
# timeout = "5s"
# check_restart {
# limit = 3
# grace = "90s"
# ignore_warnings = false
# }
#}
} }
service { service {
@ -184,19 +127,15 @@ EOH
"tricot-add-header Access-Control-Allow-Origin *", "tricot-add-header Access-Control-Allow-Origin *",
] ]
port = "web" port = "web"
#address_mode = "driver" check {
#check { type = "tcp"
# type = "tcp" interval = "60s"
# port = 3992 timeout = "5s"
# address_mode = "driver" check_restart {
# interval = "60s" limit = 3
# timeout = "5s" grace = "90s"
# check_restart { }
# limit = 3 }
# grace = "90s"
# ignore_warnings = false
# }
#}
} }
service { service {
@ -205,11 +144,19 @@ EOH
"garage-staging-admin", "garage-staging-admin",
] ]
port = "admin" port = "admin"
#address_mode = "driver" check {
type = "tcp"
interval = "60s"
timeout = "5s"
check_restart {
limit = 3
grace = "90s"
}
}
} }
restart { restart {
interval = "1m" interval = "5m"
attempts = 10 attempts = 10
delay = "15s" delay = "15s"
mode = "delay" mode = "delay"