Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ spec:
- name: "{{ tpl $key $ }}"
value: "{{ tpl (print $value) $ }}"
{{- end }}
{{- if .Values.model.downloadUrl }}
# Note this overrides any previous env setting if downloading is enabled
- name: "APP_MEDCAT_MODEL_PACK"
value: "/models/{{ .Values.model.name}}"
{{- end}}
{{- with .Values.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 12 }}
Expand All @@ -70,13 +75,47 @@ spec:
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.volumeMounts }}
{{- if or .Values.model.downloadUrl .Values.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- if .Values.volumeMounts }}
{{- toYaml .Values.volumeMounts | nindent 2 }}
{{- end }}
{{- if .Values.model.downloadUrl }}
- name: models
mountPath: /models
{{- end }}
{{- end }}
{{- with .Values.volumes }}
{{- if .Values.model.downloadUrl }}
initContainers:
- name: model-downloader
image: busybox:1.28
command:
- sh
- -c
- |
echo "Downloading model $MODEL_NAME from $MODEL_PACK_URL"
mkdir -p /models
wget -O "/models/$MODEL_NAME" "$MODEL_PACK_URL"
echo "Download finished"
env:
- name: MODEL_PACK_URL
value: {{ .Values.model.downloadUrl}}
- name: MODEL_NAME
value: {{ .Values.model.name}}
volumeMounts:
- name: models
mountPath: /models
{{- end }}

{{- if or .Values.model.downloadUrl .Values.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- if .Values.volumes }}
{{- toYaml .Values.volumes | nindent 2 }}
{{- end }}
{{- if .Values.model.downloadUrl }}
- name: models
emptyDir: {}
{{- end }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@ spec:
targetPort: http
protocol: TCP
name: http
{{- if (and (eq .Values.service.type "NodePort") ( .Values.service.nodePort)) }}
nodePort: {{ .Values.service.nodePort }}
{{- end }}
selector:
{{- include "medcat-service.selectorLabels" . | nindent 4 }}
7 changes: 7 additions & 0 deletions deployment/kubernetes/charts/medcat-service-helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ env:
# DEID_MODE: true
# DEID_REDACT: true

# Enable downloading of public models using wget on startup. Model will be downloaded to /models/<name> and used for APP_MEDCAT_MODEL_PACK
# model:
# Public URL to download a model pack from
# downloadUrl: "http://localhost:9000/models/my-model.zip"
# Name of the model pack to save to. Will be stored at /models/<name>
# name: my-model.zip

# This is for the secrets for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
imagePullSecrets: []
# This is to override the chart name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
{{- if (and (eq .Values.service.type "NodePort") ( .Values.service.nodePort)) }}
nodePort: {{ .Values.service.nodePort }}
{{- end }}
targetPort: http
protocol: TCP
name: http
Expand Down
Loading