chore(ollama): enhance job specification with new web UI and metrics configuration
All checks were successful
Lint / lint (push) Successful in 1m44s
Terraform Plan and Apply / cicd (push) Successful in 1m6s

This commit is contained in:
Ben Martin 2025-03-22 13:05:12 +00:00
parent bfda1e27f7
commit 4895fdb6e4
Signed by: ben
GPG key ID: 859A655FCD290E4A

View file

@ -1,9 +1,14 @@
job "ollama" {
group "ollama" {
network {
mode = "bridge"
port "api" {
static = 11434
to = 11434
}
port "envoy_metrics" {
to = 9102
}
}
@ -23,7 +28,6 @@ job "ollama" {
config {
image = "ollama/ollama:latest"
runtime = "nvidia"
ports = ["api"]
volumes = [
"alloc/data/:/root/.ollama"
@ -43,7 +47,127 @@ job "ollama" {
service {
provider = "consul"
port = "api"
port = "11434"
meta {
envoy_metrics_port = "${NOMAD_HOST_PORT_envoy_metrics}"
}
connect {
sidecar_service {
proxy {
expose {
path {
path = "/metrics"
protocol = "http"
local_path_port = 9102
listener_port = "envoy_metrics"
}
}
transparent_proxy {}
}
}
}
}
}
group "open-webui" {
network {
mode = "bridge"
port "http" {
to = 8080
}
port "envoy_metrics" {
to = 9102
}
}
ephemeral_disk {
migrate = true
size = 200
}
task "open-webui" {
driver = "docker"
config {
image = "ghcr.io/open-webui/open-webui:main"
force_pull = true
volumes = [
"alloc/data/:/app/backend/data"
]
}
env {
OLLAMA_BASE_URL = "http://ollama-ollama.virtual.consul"
}
resources {
cpu = 100
memory = 1024
}
}
service {
provider = "consul"
port = 8080
meta {
envoy_metrics_port = "${NOMAD_HOST_PORT_envoy_metrics}"
}
connect {
sidecar_service {
proxy {
expose {
path {
path = "/metrics"
protocol = "http"
local_path_port = 9102
listener_port = "envoy_metrics"
}
}
transparent_proxy {}
}
}
}
}
}
group "open-webui-ingress-group" {
network {
mode = "bridge"
port "inbound" {
to = 8080
}
}
service {
port = "inbound"
tags = [
"traefik.enable=true",
"traefik.http.routers.openwebui.rule=Host(`eos.brmartin.co.uk`)",
"traefik.http.routers.openwebui.entrypoints=websecure"
]
connect {
gateway {
ingress {
listener {
port = 8080
protocol = "http"
service {
name = "ollama-open-webui"
hosts = ["*"]
}
}
}
}
}
}
}
}