Skip to content

Commit

Permalink
Add startup probe to determine if model is downloaded
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Minkin <minkinj@amazon.com>
  • Loading branch information
jonminkin97 committed Feb 6, 2025
1 parent b3d963d commit 7c3110c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
9 changes: 9 additions & 0 deletions helm-charts/common/ollama-service/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,19 @@ spec:
- name: http
containerPort: {{ .Values.service.targetPort }}
protocol: TCP
{{- if .Values.livenessProbe }}
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
{{- end }}
{{- if .Values.readinessProbe }}
readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 12 }}
{{- end }}
startupProbe:
httpGet:
# Ollama uses lazy loading for models, but this verifies the model has been downloaded
path: /v1/models/{{ .Values.LLM_MODEL_ID }}
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
Expand Down
16 changes: 8 additions & 8 deletions helm-charts/common/ollama-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ resources: {}
# memory: 128Mi

# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
livenessProbe:
httpGet:
path: /api/version
port: http
readinessProbe:
httpGet:
path: /api/version
port: http
# livenessProbe:
# httpGet:
# path: /api/version
# port: http
# readinessProbe:
# httpGet:
# path: /api/version
# port: http


LLM_MODEL_ID: "llama3.2:1b"
Expand Down

0 comments on commit 7c3110c

Please sign in to comment.