2026-06-01 22:41:19 +02:00
|
|
|
variable "image_tag" {
|
|
|
|
|
description = "Docker image tag"
|
|
|
|
|
type = string
|
2026-06-01 22:43:54 +02:00
|
|
|
default = "core"
|
2026-06-01 22:41:19 +02:00
|
|
|
}
|
|
|
|
|
|
2026-06-01 23:53:58 +02:00
|
|
|
job "check" {
|
2026-06-01 22:41:19 +02:00
|
|
|
region = "global"
|
|
|
|
|
datacenters = ["dc1"]
|
|
|
|
|
type = "service"
|
|
|
|
|
|
|
|
|
|
meta {
|
|
|
|
|
uuid = uuidv4()
|
|
|
|
|
deployed_at = "[[ timeNowUTC ]]"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
update {
|
|
|
|
|
stagger = "30s"
|
|
|
|
|
max_parallel = 1
|
|
|
|
|
auto_revert = true
|
|
|
|
|
progress_deadline = "20m"
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-01 23:53:58 +02:00
|
|
|
group "check-group" {
|
2026-06-01 22:41:19 +02:00
|
|
|
count = 1
|
|
|
|
|
|
|
|
|
|
constraint {
|
|
|
|
|
attribute = "${node.unique.name}"
|
2026-06-01 22:44:46 +02:00
|
|
|
value = "int"
|
2026-06-01 22:41:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
update {
|
|
|
|
|
canary = 1
|
|
|
|
|
auto_promote = true
|
|
|
|
|
min_healthy_time = "30s"
|
|
|
|
|
healthy_deadline = "15m"
|
|
|
|
|
progress_deadline = "20m"
|
|
|
|
|
auto_revert = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
network {
|
|
|
|
|
port "http" {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
reschedule {
|
|
|
|
|
attempts = 5
|
|
|
|
|
interval = "10m"
|
|
|
|
|
delay = "30s"
|
|
|
|
|
delay_function = "exponential"
|
|
|
|
|
max_delay = "120s"
|
|
|
|
|
unlimited = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
service {
|
|
|
|
|
provider = "consul"
|
2026-06-01 23:53:58 +02:00
|
|
|
name = "check"
|
2026-06-01 22:41:19 +02:00
|
|
|
port = "http"
|
|
|
|
|
|
|
|
|
|
tags = [
|
|
|
|
|
"traefik.enable=true",
|
2026-06-01 23:53:58 +02:00
|
|
|
"traefik.http.routers.check.rule=Host(`check.i80.dk`)",
|
|
|
|
|
"traefik.http.routers.check.tls=true",
|
2026-06-01 22:41:19 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
check {
|
|
|
|
|
name = "http_health"
|
|
|
|
|
type = "http"
|
|
|
|
|
port = "http"
|
|
|
|
|
path = "/health"
|
|
|
|
|
interval = "15s"
|
|
|
|
|
timeout = "5s"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-01 23:53:58 +02:00
|
|
|
task "check-task" {
|
2026-06-01 22:41:19 +02:00
|
|
|
driver = "docker"
|
|
|
|
|
|
|
|
|
|
config {
|
|
|
|
|
image = "ghcr.io/kreuzberg-dev/kreuzberg:${var.image_tag}"
|
|
|
|
|
ports = ["http"]
|
|
|
|
|
force_pull = true
|
|
|
|
|
args = [
|
|
|
|
|
"serve",
|
|
|
|
|
"--host", "0.0.0.0",
|
|
|
|
|
"--port", "${NOMAD_PORT_http}",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
restart {
|
|
|
|
|
attempts = 5
|
|
|
|
|
interval = "10m"
|
|
|
|
|
delay = "20s"
|
|
|
|
|
mode = "fail"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
env {
|
|
|
|
|
RUST_LOG = "info"
|
|
|
|
|
KREUZBERG_CACHE_DIR = "/app/.kreuzberg"
|
|
|
|
|
HF_HOME = "/app/.kreuzberg/huggingface"
|
|
|
|
|
LD_LIBRARY_PATH = "/usr/local/lib:/usr/lib:/lib"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resources {
|
2026-06-03 06:51:54 +02:00
|
|
|
cpu = 900
|
|
|
|
|
memory = 2024
|
|
|
|
|
memory_max = 8096
|
2026-06-01 22:41:19 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|