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_secret = "{{ key "secrets/garage-staging/rpc_secret" | trimSpace }}"
#consul_host = "localhost:8500"
#consul_service_name = "garage-staging-rpc-self-advertised"
bootstrap_peers = []
[consul_discovery]

View file

@ -1,13 +1,13 @@
job "garage-staging" {
type = "system"
#datacenters = [ "neptune", "pluton" ]
priority = 90
datacenters = [ "neptune" ]
priority = 80
constraint {
attribute = "${attr.cpu.arch}"
value = "amd64"
update {
max_parallel = 1
stagger = "30s"
min_healthy_time = "10s"
}
group "garage-staging" {
@ -19,43 +19,6 @@ job "garage-staging" {
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" {
driver = "nix2"
@ -71,6 +34,12 @@ job "garage-staging" {
"/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"
template {
@ -93,14 +62,6 @@ job "garage-staging" {
destination = "etc/garage/consul-client.key"
}
template {
data = <<EOH
RUST_LOG=garage=debug
EOH
destination = "secrets/env"
env = true
}
resources {
memory = 2000
memory_max = 3000
@ -110,26 +71,31 @@ EOH
kill_signal = "SIGINT"
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 {
name = "garage-staging-s3-api"
tags = [
"garage-staging-api",
"tricot garage-staging.home.adnab.me",
"tricot garage.staging.deuxfleurs.org",
"tricot-add-header Access-Control-Allow-Origin *",
]
port = "s3"
#address_mode = "host"
#check {
# type = "tcp"
# interval = "60s"
# timeout = "5s"
# check_restart {
# limit = 3
# grace = "90s"
# ignore_warnings = false
# }
#}
check {
type = "tcp"
interval = "60s"
timeout = "5s"
check_restart {
limit = 3
grace = "90s"
}
}
}
service {
@ -140,38 +106,15 @@ EOH
"tricot-add-header Access-Control-Allow-Origin *",
]
port = "k2v"
#address_mode = "driver"
# check {
# type = "tcp"
# port = 3993
# address_mode = "driver"
# interval = "60s"
# timeout = "5s"
# 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
# }
#}
check {
type = "tcp"
interval = "60s"
timeout = "5s"
check_restart {
limit = 3
grace = "90s"
}
}
}
service {
@ -184,19 +127,15 @@ EOH
"tricot-add-header Access-Control-Allow-Origin *",
]
port = "web"
#address_mode = "driver"
#check {
# type = "tcp"
# port = 3992
# address_mode = "driver"
# interval = "60s"
# timeout = "5s"
# check_restart {
# limit = 3
# grace = "90s"
# ignore_warnings = false
# }
#}
check {
type = "tcp"
interval = "60s"
timeout = "5s"
check_restart {
limit = 3
grace = "90s"
}
}
}
service {
@ -205,11 +144,19 @@ EOH
"garage-staging-admin",
]
port = "admin"
#address_mode = "driver"
check {
type = "tcp"
interval = "60s"
timeout = "5s"
check_restart {
limit = 3
grace = "90s"
}
}
}
restart {
interval = "1m"
interval = "5m"
attempts = 10
delay = "15s"
mode = "delay"