From aab5e073102efa0bbfdae28d818d9e6a29e90587 Mon Sep 17 00:00:00 2001 From: Preston Hunter Date: Sat, 27 Dec 2025 23:33:08 -0500 Subject: [PATCH] fix(ai-frontend): Prevent LobeChat OOM and update host constraints This commit addresses several issues and updates in the `ai-frontend.nomad` job configuration: - **LobeChat OOM Fix**: Increased `lobechat` service memory allocation from 512MB to 1024MB to prevent out-of-memory crashes and improve stability. - **Node Constraint Update**: Updated the `attr.unique.hostname` constraint for both `openwebui` and `lobechat` groups from `hp1-home` to `hp-mini-1` to reflect the correct node hostname. - **Static Port Assignment**: Explicitly added `static` port definitions for `http` in both `openwebui` (8080) and `lobechat` (3210) services to ensure consistent port binding. - **Minor Housekeeping**: Cleaned up comments and formatted resource blocks for better readability. --- stacks/ai/ai-frontend.nomad | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/stacks/ai/ai-frontend.nomad b/stacks/ai/ai-frontend.nomad index 33cec6c..b539705 100644 --- a/stacks/ai/ai-frontend.nomad +++ b/stacks/ai/ai-frontend.nomad @@ -3,25 +3,26 @@ job "ai-frontend" { region = "home" type = "service" - # --- OpenWebUI --- + # --- OpenWebUI (Keep as is) --- group "openwebui" { count = 1 - # PIN TO HP1 (Change "hp-mini-1" to your actual node name if different) constraint { attribute = "${attr.unique.hostname}" - value = "hp1-home" + value = "hp-mini-1" } network { - port "http" { to = 8080 } + port "http" { + static = 8080 + to = 8080 + } } service { name = "openwebui" port = "http" tags = ["traefik.enable=true"] - check { type = "http" path = "/health" @@ -34,7 +35,6 @@ job "ai-frontend" { driver = "podman" env { - # Magic: Uses Consul to find the P52 automatically OLLAMA_BASE_URL = "http://ollama.service.consul:11434" } @@ -46,32 +46,30 @@ job "ai-frontend" { ] } - resources { - cpu = 1000 - memory = 1024 - } + resources { cpu = 1000; memory = 1024 } } } - # --- LobeChat --- + # --- LobeChat (UPDATED) --- group "lobechat" { count = 1 - # PIN TO HP1 constraint { attribute = "${attr.unique.hostname}" - value = "hp1-home" + value = "hp-mini-1" } network { - port "http" { to = 3210 } + port "http" { + static = 3210 + to = 3210 + } } service { name = "lobechat" port = "http" tags = ["traefik.enable=true"] - check { type = "http" path = "/api/health" @@ -95,7 +93,9 @@ job "ai-frontend" { resources { cpu = 500 - memory = 512 + # --- THE FIX --- + # Increased from 512 to 1024 to prevent OOM crashes + memory = 1024 } } }