Add Nomad job and Gitea deploy workflow
Some checks failed
Deploy fil (kreuzberg) / deploy (push) Has been cancelled
Some checks failed
Deploy fil (kreuzberg) / deploy (push) Has been cancelled
Deploy kreuzberg as 'fil' service on fil.i80.dk via Nomad. Uses upstream ghcr.io/kreuzberg-dev/kreuzberg:latest image.
This commit is contained in:
110
kreuzberg.nomad
Normal file
110
kreuzberg.nomad
Normal file
@@ -0,0 +1,110 @@
|
||||
variable "image_tag" {
|
||||
description = "Docker image tag"
|
||||
type = string
|
||||
default = "latest"
|
||||
}
|
||||
|
||||
job "fil" {
|
||||
region = "global"
|
||||
datacenters = ["dc1"]
|
||||
type = "service"
|
||||
|
||||
meta {
|
||||
uuid = uuidv4()
|
||||
deployed_at = "[[ timeNowUTC ]]"
|
||||
}
|
||||
|
||||
update {
|
||||
stagger = "30s"
|
||||
max_parallel = 1
|
||||
auto_revert = true
|
||||
progress_deadline = "20m"
|
||||
}
|
||||
|
||||
group "fil-group" {
|
||||
count = 1
|
||||
|
||||
constraint {
|
||||
attribute = "${node.unique.name}"
|
||||
value = "autobox.i80.dk"
|
||||
}
|
||||
|
||||
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"
|
||||
name = "fil"
|
||||
port = "http"
|
||||
|
||||
tags = [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.fil.rule=Host(`fil.i80.dk`)",
|
||||
"traefik.http.routers.fil.tls=true",
|
||||
]
|
||||
|
||||
check {
|
||||
name = "http_health"
|
||||
type = "http"
|
||||
port = "http"
|
||||
path = "/health"
|
||||
interval = "15s"
|
||||
timeout = "5s"
|
||||
}
|
||||
}
|
||||
|
||||
task "fil-task" {
|
||||
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 {
|
||||
cpu = 500
|
||||
memory = 1024
|
||||
memory_max = 4096
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user