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.
This commit is contained in:
@@ -3,10 +3,11 @@ job "ai-frontend" {
|
|||||||
region = "home"
|
region = "home"
|
||||||
type = "service"
|
type = "service"
|
||||||
|
|
||||||
# --- OpenWebUI (Keep as is) ---
|
# --- OpenWebUI ---
|
||||||
group "openwebui" {
|
group "openwebui" {
|
||||||
count = 1
|
count = 1
|
||||||
|
|
||||||
|
# Pin to HP1
|
||||||
constraint {
|
constraint {
|
||||||
attribute = "${attr.unique.hostname}"
|
attribute = "${attr.unique.hostname}"
|
||||||
value = "hp-mini-1"
|
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" {
|
group "lobechat" {
|
||||||
count = 1
|
count = 1
|
||||||
|
|
||||||
|
# Pin to HP1
|
||||||
constraint {
|
constraint {
|
||||||
attribute = "${attr.unique.hostname}"
|
attribute = "${attr.unique.hostname}"
|
||||||
value = "hp-mini-1"
|
value = "hp-mini-1"
|
||||||
@@ -91,10 +97,9 @@ job "ai-frontend" {
|
|||||||
ports = ["http"]
|
ports = ["http"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# FIXED: Ensure 1GB RAM to prevent OOM
|
||||||
resources {
|
resources {
|
||||||
cpu = 500
|
cpu = 500
|
||||||
# --- THE FIX ---
|
|
||||||
# Increased from 512 to 1024 to prevent OOM crashes
|
|
||||||
memory = 1024
|
memory = 1024
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user