ai: persist titan-20 model cache
All checks were successful
Tests / Declarative: Post Actions passed: 246
All checks were successful
Tests / Declarative: Post Actions passed: 246
This commit is contained in:
parent
878cfb1d00
commit
7b443539f3
@ -36,8 +36,10 @@ spec:
|
|||||||
runtimeClassName: nvidia
|
runtimeClassName: nvidia
|
||||||
volumes:
|
volumes:
|
||||||
- name: models
|
- name: models
|
||||||
# Accelerator nodes are not Longhorn attach targets; keep the model cache pod-local.
|
# The pod is pinned to titan-20. A local-path claim preserves the
|
||||||
emptyDir: {}
|
# 10 GiB model cache across rollouts without involving Longhorn.
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: ollama-models-titan20
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: warm-model
|
- name: warm-model
|
||||||
image: ollama/ollama@sha256:2c9595c555fd70a28363489ac03bd5bf9e7c5bdf2890373c3a830ffd7252ce6d
|
image: ollama/ollama@sha256:2c9595c555fd70a28363489ac03bd5bf9e7c5bdf2890373c3a830ffd7252ce6d
|
||||||
@ -127,7 +129,10 @@ spec:
|
|||||||
pid="$!"
|
pid="$!"
|
||||||
trap 'kill -TERM "$pid"; wait "$pid"' TERM INT
|
trap 'kill -TERM "$pid"; wait "$pid"' TERM INT
|
||||||
sleep 6
|
sleep 6
|
||||||
timeout 180s ollama run "${OLLAMA_FAST_MODEL}" --keepalive -1 "reply with just pong" >/tmp/ollama-fast-warm.log 2>&1
|
if ! timeout 180s ollama run "${OLLAMA_FAST_MODEL}" --keepalive=-1 "reply with just pong" >/tmp/ollama-fast-warm.log 2>&1; then
|
||||||
|
cat /tmp/ollama-fast-warm.log >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
touch /tmp/ollama-fast-ready
|
touch /tmp/ollama-fast-ready
|
||||||
wait "$pid"
|
wait "$pid"
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
|||||||
@ -11,3 +11,16 @@ spec:
|
|||||||
requests:
|
requests:
|
||||||
storage: 30Gi
|
storage: 30Gi
|
||||||
storageClassName: asteria
|
storageClassName: asteria
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: ollama-models-titan20
|
||||||
|
namespace: ai
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 30Gi
|
||||||
|
storageClassName: local-path
|
||||||
|
|||||||
@ -663,6 +663,10 @@ def test_titan20_serializes_classifier_and_local_chat_model_residency():
|
|||||||
assert env["OLLAMA_NUM_PARALLEL"] == "1"
|
assert env["OLLAMA_NUM_PARALLEL"] == "1"
|
||||||
assert env["OLLAMA_KEEP_ALIVE"] == "-1"
|
assert env["OLLAMA_KEEP_ALIVE"] == "-1"
|
||||||
assert env["OLLAMA_CONTEXT_LENGTH"] == "8192"
|
assert env["OLLAMA_CONTEXT_LENGTH"] == "8192"
|
||||||
|
models = next(item for item in pod["volumes"] if item["name"] == "models")
|
||||||
|
assert models["persistentVolumeClaim"]["claimName"] == (
|
||||||
|
"ollama-models-titan20"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_chat_auth_file_mount_survives_atomic_provider_refresh():
|
def test_chat_auth_file_mount_survives_atomic_provider_refresh():
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user