hermes: stabilize local GPU workloads
This commit is contained in:
parent
7b443539f3
commit
48aeb4873c
@ -19,7 +19,9 @@ from urllib.request import Request, urlopen
|
||||
|
||||
|
||||
HOST = os.environ.get("HERMES_LOCAL_IMAGE_HOST", "0.0.0.0")
|
||||
PORT = int(os.environ.get("HERMES_LOCAL_IMAGE_PORT", "9004"))
|
||||
# Kubernetes reserves <SERVICE>_PORT for service-link discovery. Keep the
|
||||
# listener setting out of that namespace so it is always numeric.
|
||||
PORT = int(os.environ.get("HERMES_LOCAL_IMAGE_LISTEN_PORT", "9004"))
|
||||
MODEL_ID = os.environ.get(
|
||||
"HERMES_LOCAL_IMAGE_MODEL", "black-forest-labs/FLUX.2-klein-4B"
|
||||
)
|
||||
|
||||
@ -129,7 +129,7 @@ spec:
|
||||
pid="$!"
|
||||
trap 'kill -TERM "$pid"; wait "$pid"' TERM INT
|
||||
sleep 6
|
||||
if ! timeout 180s ollama run "${OLLAMA_FAST_MODEL}" --keepalive=-1 "reply with just pong" >/tmp/ollama-fast-warm.log 2>&1; then
|
||||
if ! timeout 180s ollama run "${OLLAMA_FAST_MODEL}" "reply with just pong" >/tmp/ollama-fast-warm.log 2>&1; then
|
||||
cat /tmp/ollama-fast-warm.log >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -43,7 +43,7 @@ spec:
|
||||
sizeLimit: 2Gi
|
||||
containers:
|
||||
- name: local-image
|
||||
image: registry.bstein.dev/bstein/hermes-local-image@sha256:2bf0e5b19ef80cf0cfe7b3d9a4b672df101a3215634a6cede85ff850ada7a28a
|
||||
image: registry.bstein.dev/bstein/hermes-local-image@sha256:316d123cc48509a53fb32c26bfb384a3ed4d934cb334d73faa0840a62e047e65
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: local-image
|
||||
@ -53,6 +53,8 @@ spec:
|
||||
value: black-forest-labs/FLUX.2-klein-4B
|
||||
- name: HERMES_LOCAL_IMAGE_REVISION
|
||||
value: e7b7dc27f91deacad38e78976d1f2b499d76a294
|
||||
- name: HERMES_LOCAL_IMAGE_LISTEN_PORT
|
||||
value: "9004"
|
||||
- name: LEASE_NAMESPACE
|
||||
value: hermes
|
||||
- name: LEASE_NAME
|
||||
|
||||
@ -604,6 +604,7 @@ def test_local_flux_runtime_and_gpu_handoff_are_flux_managed():
|
||||
assert local["ports"] == [{"name": "local-image", "containerPort": 9004}]
|
||||
assert any(mount["mountPath"] == "/models" for mount in local["volumeMounts"])
|
||||
model_env = {item["name"]: item["value"] for item in local["env"]}
|
||||
assert model_env["HERMES_LOCAL_IMAGE_LISTEN_PORT"] == "9004"
|
||||
assert model_env["HERMES_LOCAL_IMAGE_REVISION"] == (
|
||||
"e7b7dc27f91deacad38e78976d1f2b499d76a294"
|
||||
)
|
||||
@ -663,6 +664,8 @@ def test_titan20_serializes_classifier_and_local_chat_model_residency():
|
||||
assert env["OLLAMA_NUM_PARALLEL"] == "1"
|
||||
assert env["OLLAMA_KEEP_ALIVE"] == "-1"
|
||||
assert env["OLLAMA_CONTEXT_LENGTH"] == "8192"
|
||||
warm_command = " ".join(container["command"])
|
||||
assert "--keepalive=-1" not in warm_command
|
||||
models = next(item for item in pod["volumes"] if item["name"] == "models")
|
||||
assert models["persistentVolumeClaim"]["claimName"] == (
|
||||
"ollama-models-titan20"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user