-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bec8694
commit 2311b5d
Showing
10 changed files
with
288 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
charts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
dependencies: | ||
- name: mongodb | ||
repository: oci://registry-1.docker.io/bitnamicharts | ||
version: 14.3.0 | ||
digest: sha256:1536cff09b6be684c82ea0780c96f266c549494dfacec84371054fa30e6c5cfa | ||
generated: "2023-11-21T15:00:46.692964492+02:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
apiVersion: v2 | ||
name: huggingface-model | ||
description: Helm chart for deploy Hugging Face models and chat-ui to Kubernetes cluster. See [Hugging Face models](https://huggingface.co/models) | ||
description: Helm chart for deploy Hugging Face models to Kubernetes cluster. See [Hugging Face models](https://huggingface.co/models) | ||
|
||
type: application | ||
|
||
version: 0.0.23 | ||
version: 0.1.0 | ||
|
||
dependencies: | ||
- condition: mongodb.enabled | ||
name: mongodb | ||
repository: oci://registry-1.docker.io/bitnamicharts | ||
version: 14.x.x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{{- if .Values.chat.enabled }} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "huggingface-model.fullname" . }}-chat | ||
labels: | ||
{{- include "huggingface-model.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.chat.replicaCount }} | ||
selector: | ||
matchLabels: | ||
{{- include "huggingface-chat.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
{{- with .Values.chat.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "huggingface-chat.selectorLabels" . | nindent 8 }} | ||
spec: | ||
{{- with .Values.chat.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
containers: | ||
- name: model | ||
image: {{ .Values.chat.image.repo }}:{{ .Values.chat.image.tag }} | ||
imagePullPolicy: {{ .Values.chat.image.pullPolicy }} | ||
ports: | ||
- containerPort: 3000 | ||
env: | ||
- name: MODELS | ||
value: '{{ toRawJson (fromYamlArray (include "huggingface-model.chat.base-config" .)) }}' | ||
- name: MONGODB_HOST | ||
value: {{ if .Values.mongodb.install }}{{ include "mongodb.service.nameOverride" .Subcharts.mongodb }}{{ else }}{{ .Values.chat.mongodb.host }}{{ end }} | ||
{{- if .Values.mongodb.port }} | ||
- name: MONGODB_PORT | ||
value: {{ .Values.chat.mongodb.port | quote }} | ||
{{- end }} | ||
- name: MONGODB_USER | ||
value: {{ .Values.chat.mongodb.user | default "root" }} | ||
{{- if .Values.mongodb.install }} | ||
- name: MONGODB_URL_PARAMS | ||
value: "admin?directConnection=true&authSource=admin" | ||
- name: MONGODB_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ include "mongodb.service.nameOverride" .Subcharts.mongodb }} | ||
key: mongodb-root-password | ||
{{- else }} | ||
{{- if .Values.mongodb.password }} | ||
- name: MONGODB_PASSWORD | ||
value: {{ .Values.chat.mongodb.password | quote }} | ||
- name: MONGODB_URL_PARAMS | ||
value: {{ .Values.chat.mongodb.urlParams }} | ||
{{- end }} | ||
{{- end }} | ||
resources: | ||
{{- toYaml .Values.chat.resources | nindent 12 }} | ||
{{- with .Values.chat.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.chat.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.chat.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{{- if and .Values.chat.enabled .Values.chat.ingress.enabled }} | ||
{{- $fullName := printf "%s-chat" (include "huggingface-model.fullname" .) -}} | ||
{{- $serviceName := printf "%s-chat" (include "huggingface-model.fullname" .) -}} | ||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} | ||
apiVersion: networking.k8s.io/v1 | ||
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} | ||
apiVersion: networking.k8s.io/v1beta1 | ||
{{- else -}} | ||
apiVersion: extensions/v1beta1 | ||
{{- end }} | ||
kind: Ingress | ||
metadata: | ||
name: {{ $fullName }} | ||
labels: | ||
{{- include "huggingface-model.labels" . | nindent 4 }} | ||
{{- with .Values.chat.ingress.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
{{- if .Values.chat.ingress.tls }} | ||
tls: | ||
{{- range .Values.chat.ingress.tls }} | ||
- hosts: | ||
{{- range .hosts }} | ||
- {{ . | quote }} | ||
{{- end }} | ||
secretName: {{ .secretName }} | ||
{{- end }} | ||
{{- end }} | ||
rules: | ||
{{- range .Values.chat.ingress.hosts }} | ||
- host: {{ .host | quote }} | ||
http: | ||
paths: | ||
{{- range .paths }} | ||
- path: {{ .path }} | ||
pathType: {{ .pathType }} | ||
backend: | ||
service: | ||
name: {{ $serviceName }} | ||
port: | ||
{{- if .servicePort }} | ||
{{- .servicePort | toYaml | nindent 18 }} | ||
{{- else }} | ||
number: 8080 | ||
{{- end }} | ||
{{- if .extendedOptions }} | ||
{{- .extendedOptions | toYaml | nindent 14 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "huggingface-model.fullname" . }}-chat | ||
labels: | ||
{{- include "huggingface-model.labels" . | nindent 4 }} | ||
spec: | ||
type: {{ .Values.service.type | default "ClusterIP" }} | ||
ports: | ||
- name: http | ||
port: {{ .Values.service.port | default 8080 }} | ||
targetPort: 3000 | ||
selector: | ||
{{- include "huggingface-chat.selectorLabels" . | nindent 4 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.