From 2d80813ac857493f597563837ca2f4b99ca88dd1 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Wed, 12 Feb 2025 20:02:11 -0500 Subject: [PATCH] add kokoro-tts --- .../kokoro-tts-cpu/kokoro-tts-deployment.yaml | 55 +++++++++++++++++++ .../kokoro-tts-cpu/kokoro-tts-ingress.yaml | 16 ++++++ .../bases/kokoro-tts-cpu/kustomization.yaml | 26 +++++++++ .../kokoro-tts-deployment-patch.yaml | 40 ++++++++++++++ .../bases/kokoro-tts-gpu/kustomization.yaml | 8 +++ .../bases/openwebui/openwebui-deployment.yaml | 4 ++ 6 files changed, 149 insertions(+) create mode 100644 kustomize/bases/kokoro-tts-cpu/kokoro-tts-deployment.yaml create mode 100644 kustomize/bases/kokoro-tts-cpu/kokoro-tts-ingress.yaml create mode 100644 kustomize/bases/kokoro-tts-cpu/kustomization.yaml create mode 100644 kustomize/bases/kokoro-tts-gpu/kokoro-tts-deployment-patch.yaml create mode 100644 kustomize/bases/kokoro-tts-gpu/kustomization.yaml diff --git a/kustomize/bases/kokoro-tts-cpu/kokoro-tts-deployment.yaml b/kustomize/bases/kokoro-tts-cpu/kokoro-tts-deployment.yaml new file mode 100644 index 0000000..aa6433c --- /dev/null +++ b/kustomize/bases/kokoro-tts-cpu/kokoro-tts-deployment.yaml @@ -0,0 +1,55 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: server + labels: + app.kubernetes.io/component: server +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app.kubernetes.io/component: server + template: + metadata: + labels: + app.kubernetes.io/component: server + spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + # Image only supports amd64 + - key: kubernetes.io/arch + operator: In + values: + - amd64 + containers: + - name: kokoro-tts + image: ghcr.io/remsky/kokoro-fastapi-cpu:v0.1.4 + ports: + - name: http + containerPort: 8880 + resources: + requests: + cpu: 1000m + memory: 1.5Gi + limits: + cpu: 4000m + memory: 2Gi +--- +apiVersion: v1 +kind: Service +metadata: + name: server + labels: + app.kubernetes.io/component: server +spec: + selector: + app.kubernetes.io/component: server + ports: + - name: http + port: 8880 + targetPort: http \ No newline at end of file diff --git a/kustomize/bases/kokoro-tts-cpu/kokoro-tts-ingress.yaml b/kustomize/bases/kokoro-tts-cpu/kokoro-tts-ingress.yaml new file mode 100644 index 0000000..5a8bffa --- /dev/null +++ b/kustomize/bases/kokoro-tts-cpu/kokoro-tts-ingress.yaml @@ -0,0 +1,16 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: server +spec: + rules: + - host: ${TTS_EXTERNAL_HOST} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: server + port: + name: http diff --git a/kustomize/bases/kokoro-tts-cpu/kustomization.yaml b/kustomize/bases/kokoro-tts-cpu/kustomization.yaml new file mode 100644 index 0000000..8c4fc7f --- /dev/null +++ b/kustomize/bases/kokoro-tts-cpu/kustomization.yaml @@ -0,0 +1,26 @@ +resources: + - kokoro-tts-deployment.yaml + - kokoro-tts-ingress.yaml + +namePrefix: kokoro-tts- + +commonLabels: + app.kubernetes.io/name: kokoro-tts + +configMapGenerator: + - name: kustomize-generated-config + literals: + - TTS_EXTERNAL_HOST=tts.badjware.dev + - TTS_EXTERNAL_URL=https://tts.badjware.dev + +replacements: + - source: + kind: ConfigMap + name: kustomize-generated-config + fieldPath: data.TTS_EXTERNAL_HOST + targets: + - select: + kind: Ingress + name: server + fieldPaths: + - spec.rules.0.host diff --git a/kustomize/bases/kokoro-tts-gpu/kokoro-tts-deployment-patch.yaml b/kustomize/bases/kokoro-tts-gpu/kokoro-tts-deployment-patch.yaml new file mode 100644 index 0000000..4781b63 --- /dev/null +++ b/kustomize/bases/kokoro-tts-gpu/kokoro-tts-deployment-patch.yaml @@ -0,0 +1,40 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: server + labels: + app.kubernetes.io/component: server +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app.kubernetes.io/component: server + template: + metadata: + labels: + app.kubernetes.io/component: server + spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + # Image only supports amd64 + - key: kubernetes.io/arch + operator: In + values: + - amd64 + runtimeClassName: nvidia + containers: + - name: kokoro-tts + image: ghcr.io/remsky/kokoro-fastapi-gpu:v0.1.4 + resources: + requests: + cpu: 500m + memory: 1.5Gi + limits: + cpu: 1000m + memory: 2Gi + nvidia.com/gpu: "1" \ No newline at end of file diff --git a/kustomize/bases/kokoro-tts-gpu/kustomization.yaml b/kustomize/bases/kokoro-tts-gpu/kustomization.yaml new file mode 100644 index 0000000..71a49dc --- /dev/null +++ b/kustomize/bases/kokoro-tts-gpu/kustomization.yaml @@ -0,0 +1,8 @@ +resources: + - ../../bases/kokoro-tts-cpu + +patches: + - target: + kind: Deployment + name: kokoro-tts-server + path: kokoro-tts-deployment-patch.yaml \ No newline at end of file diff --git a/kustomize/bases/openwebui/openwebui-deployment.yaml b/kustomize/bases/openwebui/openwebui-deployment.yaml index b6e00c4..120111e 100644 --- a/kustomize/bases/openwebui/openwebui-deployment.yaml +++ b/kustomize/bases/openwebui/openwebui-deployment.yaml @@ -39,6 +39,10 @@ spec: value: "false" - name: ENABLE_OAUTH_SIGNUP value: "true" + - name: OAUTH_MERGE_ACCOUNTS_BY_EMAIL + value: "true" + - name: ENABLE_OAUTH_ROLE_MANAGEMENT + value: "false" - name: OAUTH_CLIENT_ID valueFrom: secretKeyRef: