staging: Passage garage en mode docker

This commit is contained in:
Baptiste Jonglez 2024-06-23 11:34:36 +02:00
parent 2f8b2c74f4
commit 87464506ce

View file

@ -1,13 +1,12 @@
job "garage-staging" { job "garage-staging" {
datacenters = [ "neptune", "jupiter", "corrin", "bespin" ]
type = "system" type = "system"
priority = 90 priority = 90
datacenters = [ "neptune", "jupiter", "corrin", "bespin" ]
update { update {
max_parallel = 1 max_parallel = 2
stagger = "1m" min_healthy_time = "60s"
min_healthy_time = "10s"
} }
group "garage-staging" { group "garage-staging" {
@ -19,21 +18,27 @@ job "garage-staging" {
port "admin" { static = 3909 } port "admin" { static = 3909 }
} }
task "server" { update {
driver = "nix2" max_parallel = 10
min_healthy_time = "30s"
healthy_deadline = "5m"
}
task "server" {
driver = "docker"
config { config {
packages = [ image = "superboum/garage:v1.0.0-rc1-hotfix-red-ftr-wquorum"
"#bash", # so that we can enter a shell inside container command = "/garage"
"#coreutils",
# garage v1.0.0-rc1 as of 2024-03-28
"git+https://git.deuxfleurs.fr/Deuxfleurs/garage.git?ref=next-0.10&rev=afad62939e071621666ca7255f7164f92c4475bb"
]
command = "garage"
args = [ "server" ] args = [ "server" ]
bind = { network_mode = "host"
"/mnt/storage/garage-staging/data" = "/data", volumes = [
"/mnt/ssd/garage-staging/meta" = "/meta", "/mnt/storage/garage-staging/data:/data",
"/mnt/ssd/garage-staging/meta:/meta",
"secrets/garage.toml:/etc/garage.toml",
"secrets:/etc/garage",
]
logging {
type = "journald"
} }
} }
@ -41,27 +46,24 @@ job "garage-staging" {
RUST_LOG = "garage=info,garage_api=debug", RUST_LOG = "garage=info,garage_api=debug",
} }
# files currently owned by root, we don't want to chown everything
user = "root"
template { template {
data = file("../config/garage.toml") data = file("../config/garage.toml")
destination = "etc/garage.toml" destination = "secrets/garage.toml"
} }
template { template {
data = "{{ key \"secrets/consul/consul-ca.crt\" }}" data = "{{ key \"secrets/consul/consul-ca.crt\" }}"
destination = "etc/garage/consul-ca.crt" destination = "secrets/consul-ca.crt"
} }
template { template {
data = "{{ key \"secrets/consul/consul-client.crt\" }}" data = "{{ key \"secrets/consul/consul-client.crt\" }}"
destination = "etc/garage/consul-client.crt" destination = "secrets/consul-client.crt"
} }
template { template {
data = "{{ key \"secrets/consul/consul-client.key\" }}" data = "{{ key \"secrets/consul/consul-client.key\" }}"
destination = "etc/garage/consul-client.key" destination = "secrets/consul-client.key"
} }
resources { resources {