From 1957f155864f6c0c6bb3b7dca5b322b51c826abb Mon Sep 17 00:00:00 2001 From: Preston Hunter Date: Sat, 27 Dec 2025 23:36:46 -0500 Subject: [PATCH] refactor(ai-frontend): Improve Nomad job configuration and clarity * Reformatted the `resources` block for the `openwebui` group to a multi-line format to resolve an illegal semicolon syntax issue. * Added explicit comments to both `openwebui` and `lobechat` groups to clarify the host pinning constraint. * Streamlined comments in the `lobechat` group's `resources` block to concisely state the memory allocation, removing outdated "fix" comments and adding a current "FIXED" comment. These changes enhance the readability, maintainability, and correctness of the Nomad job definition. --- stacks/ai/ai-frontend.nomad | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/stacks/ai/ai-frontend.nomad b/stacks/ai/ai-frontend.nomad index b539705..1945952 100644 --- a/stacks/ai/ai-frontend.nomad +++ b/stacks/ai/ai-frontend.nomad @@ -3,10 +3,11 @@ job "ai-frontend" { region = "home" type = "service" - # --- OpenWebUI (Keep as is) --- + # --- OpenWebUI --- group "openwebui" { count = 1 + # Pin to HP1 constraint { attribute = "${attr.unique.hostname}" value = "hp-mini-1" @@ -46,14 +47,19 @@ job "ai-frontend" { ] } - resources { cpu = 1000; memory = 1024 } + # FIXED: Expanded to multi-line to remove illegal semicolon + resources { + cpu = 1000 + memory = 1024 + } } } - # --- LobeChat (UPDATED) --- + # --- LobeChat --- group "lobechat" { count = 1 + # Pin to HP1 constraint { attribute = "${attr.unique.hostname}" value = "hp-mini-1" @@ -91,10 +97,9 @@ job "ai-frontend" { ports = ["http"] } + # FIXED: Ensure 1GB RAM to prevent OOM resources { cpu = 500 - # --- THE FIX --- - # Increased from 512 to 1024 to prevent OOM crashes memory = 1024 } }