Skip to content
Open
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
2 changes: 1 addition & 1 deletion charts/smallest-self-host/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type: application
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)

version: 0.2.2
version: 0.3.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
28 changes: 28 additions & 0 deletions charts/smallest-self-host/templates/api-server-tts/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.apiServerTts.namePrefix }}-config
labels:
{{- include "smallest-self-host.labels" . | nindent 4 }}
data:
api.toml: |
[license_proxy]
url = [
"http://{{ .Values.licenseProxy.namePrefix }}-internal:{{ .Values.licenseProxy.port}}{{ .Values.licenseProxy.baseUrl }}"
]

[server]
base_url = "{{ .Values.apiServerTts.baseUrl }}"
host = "{{ .Values.apiServerTts.host }}"
port = {{ .Values.apiServerTts.port }}
lightning_v31_base_url = "http://{{ .Values.lightningTts.namePrefix }}-internal:{{ .Values.lightningTts.port}}{{ .Values.lightningTts.baseUrl }}"
{{- if .Values.redis.externalHost }}
redis_host = "{{ .Values.redis.externalHost }}"
{{- else }}
redis_host = "{{ .Release.Name }}-redis-master"
{{- end }}
redis_port = {{ .Values.redis.port }}
{{- if .Values.redis.auth.enabled }}
redis_password = "{{ .Values.redis.auth.password }}"
{{- end }}
redis_ssl = {{ .Values.redis.ssl }}
77 changes: 77 additions & 0 deletions charts/smallest-self-host/templates/api-server-tts/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.apiServerTts.namePrefix }}
labels:
{{- include "smallest-self-host.labels" . | nindent 4 }}
app: {{ .Values.apiServerTts.namePrefix }}
spec:
replicas: {{ .Values.scaling.replicas.apiServerTts }}
selector:
matchLabels:
app: {{ .Values.apiServerTts.namePrefix }}
{{- include "smallest-self-host.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
app: {{ .Values.apiServerTts.namePrefix }}
{{- include "smallest-self-host.selectorLabels" . | nindent 8 }}
{{- with .Values.apiServerTts.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if or .Values.global.pullSecretRef .Values.global.imageCredentials.create }}
imagePullSecrets:
- name: {{ .Values.global.pullSecretRef | default (printf "%s-registry" (include "smallest-self-host.fullname" .)) }}
{{- end }}
containers:
- name: {{ .Values.apiServerTts.namePrefix }}
image: {{ .Values.apiServerTts.image }}
imagePullPolicy: {{ .Values.apiServerTts.imagePullPolicy }}
env:
- name: LICENSE_KEY
valueFrom:
secretKeyRef:
name: {{ .Values.global.licenseKeySecretRef | default (printf "%s-license" (include "smallest-self-host.fullname" .)) }}
key: license-key
volumeMounts:
- name: api-tts-config-volume
mountPath: /etc/config
ports:
- name: http
containerPort: {{ .Values.apiServerTts.port }}
livenessProbe:
httpGet:
path: /api/v1/health
port: {{ .Values.apiServerTts.port }}
initialDelaySeconds: {{ .Values.apiServerTts.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.apiServerTts.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.apiServerTts.livenessProbe.timeoutSeconds }}
readinessProbe:
exec:
command:
- /bin/sh
- -c
- curl -sf http://localhost:{{ .Values.apiServerTts.port }}/healthz | grep -q "true"
initialDelaySeconds: {{ .Values.apiServerTts.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.apiServerTts.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.apiServerTts.readinessProbe.timeoutSeconds }}
failureThreshold: {{ .Values.apiServerTts.readinessProbe.failureThreshold }}
startupProbe:
httpGet:
path: /api/v1/health
port: {{ .Values.apiServerTts.port }}
initialDelaySeconds: {{ .Values.apiServerTts.startupProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.apiServerTts.startupProbe.periodSeconds }}
timeoutSeconds: {{ .Values.apiServerTts.startupProbe.timeoutSeconds }}
failureThreshold: {{ .Values.apiServerTts.startupProbe.failureThreshold }}
{{- if .Values.apiServerTts.resources }}
resources:
{{- toYaml .Values.apiServerTts.resources | nindent 10 }}
{{- end }}
volumes:
- name: api-tts-config-volume
configMap:
name: {{ .Values.apiServerTts.namePrefix }}-config
restartPolicy: Always
25 changes: 25 additions & 0 deletions charts/smallest-self-host/templates/api-server-tts/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.apiServerTts.namePrefix }}-external
labels:
{{- include "smallest-self-host.labels" . | nindent 4 }}
app: {{ .Values.apiServerTts.namePrefix }}
spec:
type: {{ .Values.apiServerTts.service.type | default "ClusterIP" }}
selector:
app: {{ .Values.apiServerTts.namePrefix }}
{{- include "smallest-self-host.selectorLabels" . | nindent 4 }}
{{- if and (eq .Values.apiServerTts.service.type "LoadBalancer") .Values.apiServerTts.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{- range .Values.apiServerTts.service.loadBalancerSourceRanges }}
- {{ . }}
{{- end }}
{{- end }}
{{- if and (eq .Values.apiServerTts.service.type "LoadBalancer") .Values.apiServerTts.service.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.apiServerTts.service.externalTrafficPolicy }}
{{- end }}
ports:
- name: http
port: {{ .Values.apiServerTts.port }}
targetPort: {{ .Values.apiServerTts.port }}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ data:
[server]
port = {{ .Values.lightningAsr.port }}
[model]
url = "{{ .Values.models.asrModelUrl }}"
url = "{{ .Values.lightningAsr.modelUrl | default .Values.models.asrModelUrl }}"
path = "/smallest/models"
model_name = "{{ .Values.lightningAsr.modelName }}"

Expand Down
88 changes: 88 additions & 0 deletions charts/smallest-self-host/templates/lightning-tts/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.lightningTts.namePrefix }}
labels:
{{- include "smallest-self-host.labels" . | nindent 4 }}
app: {{ .Values.lightningTts.namePrefix }}
spec:
replicas: {{ .Values.scaling.replicas.lightningTts | default 1 }}
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: {{ .Values.lightningTts.updateStrategy.rollingUpdate.maxUnavailable }}
maxSurge: {{ .Values.lightningTts.updateStrategy.rollingUpdate.maxSurge }}
selector:
matchLabels:
app: {{ .Values.lightningTts.namePrefix }}
{{- include "smallest-self-host.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
app: {{ .Values.lightningTts.namePrefix }}
{{- include "smallest-self-host.selectorLabels" . | nindent 8 }}
{{- with .Values.lightningTts.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if or .Values.global.pullSecretRef .Values.global.imageCredentials.create }}
imagePullSecrets:
- name: {{ .Values.global.pullSecretRef | default (printf "%s-registry" (include "smallest-self-host.fullname" .)) }}
{{- end }}
{{- with .Values.lightningTts.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.lightningTts.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Values.lightningTts.namePrefix }}
image: {{ .Values.lightningTts.image }}
imagePullPolicy: {{ .Values.lightningTts.imagePullPolicy | default "IfNotPresent" }}
env:
- name: LICENSE_KEY
valueFrom:
secretKeyRef:
name: {{ .Values.global.licenseKeySecretRef | default (printf "%s-license" (include "smallest-self-host.fullname" .)) }}
key: license-key
- name: PORT
value: "{{ .Values.lightningTts.port }}"
- name: REDIS_HOST
{{- if .Values.redis.externalHost }}
value: "{{ .Values.redis.externalHost }}"
{{- else }}
value: "{{ .Release.Name }}-redis-master"
{{- end }}
- name: REDIS_PORT
value: "{{ .Values.redis.port }}"
{{- if .Values.redis.auth.enabled }}
- name: REDIS_PASSWORD
value: "{{ .Values.redis.auth.password }}"
{{- end }}
ports:
- name: http
containerPort: {{ .Values.lightningTts.port }}
protocol: TCP
livenessProbe:
httpGet:
path: /health
port: {{ .Values.lightningTts.port }}
initialDelaySeconds: {{ .Values.lightningTts.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.lightningTts.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.lightningTts.livenessProbe.timeoutSeconds }}
readinessProbe:
httpGet:
path: /health
port: {{ .Values.lightningTts.port }}
initialDelaySeconds: {{ .Values.lightningTts.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.lightningTts.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.lightningTts.readinessProbe.timeoutSeconds }}
failureThreshold: {{ .Values.lightningTts.readinessProbe.failureThreshold }}
{{- if .Values.lightningTts.resources }}
resources:
{{- toYaml .Values.lightningTts.resources | nindent 10 }}
{{- end }}
restartPolicy: Always
17 changes: 17 additions & 0 deletions charts/smallest-self-host/templates/lightning-tts/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.lightningTts.namePrefix }}-internal
labels:
{{- include "smallest-self-host.labels" . | nindent 4 }}
app: {{ .Values.lightningTts.namePrefix }}
spec:
type: ClusterIP
selector:
app: {{ .Values.lightningTts.namePrefix }}
{{- include "smallest-self-host.selectorLabels" . | nindent 4 }}
ports:
- name: http
port: {{ .Values.lightningTts.port }}
targetPort: {{ .Values.lightningTts.port }}
protocol: TCP
95 changes: 91 additions & 4 deletions charts/smallest-self-host/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ global:

# use this if you want to share model volume across multiple pods, this prevents duplicate model downloads
models:
# default model url for lightning-asr
# you can change this to the model url you want to use
# contact support@smallest.ai to get the model urls
asrModelUrl: "" # GET THIS FROM SUPPORT
# DEPRECATED: use lightningAsr.modelUrl instead. This field will be removed in a future version.
asrModelUrl: ""
volumes:
aws:
efs:
Expand All @@ -33,6 +31,10 @@ scaling:
replicas:
# default replica count for lightning-asr
lightningAsr: 1
# default replica count for lightning-tts
lightningTts: 1
# default replica count for api-server-tts
apiServerTts: 1
# default replica count for license-proxy
licenseProxy: 1

Expand Down Expand Up @@ -123,6 +125,9 @@ lightningAsr:
baseUrl: ""
podAnnotations: {}

# model url for lightning-asr, contact support@smallest.ai to get the model url
modelUrl: ""

updateStrategy:
rollingUpdate:
maxUnavailable: 0
Expand Down Expand Up @@ -154,6 +159,88 @@ lightningAsr:
requests:
memory: 10Gi

# ============ TTS STACK ============

lightningTts:
namePrefix: lightning-tts
image: "quay.io/smallestinc/lightning-v3.1:latest"
imagePullPolicy: IfNotPresent
port: 8876
baseUrl: ""
podAnnotations: {}

# model url for lightning-tts, contact support@smallest.ai to get the model url
modelUrl: ""

updateStrategy:
rollingUpdate:
maxUnavailable: 0
maxSurge: 1

livenessProbe:
initialDelaySeconds: 300
periodSeconds: 30
timeoutSeconds: 10

readinessProbe:
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 10
failureThreshold: 20

# we recommend using nodeSelector to schedule lightning-tts on GPU nodes
nodeSelector:

# we recommend using tolerations to allow lightning-tts to run on GPU nodes
tolerations:

labels: []

resources:
limits:
memory: 12Gi
requests:
memory: 10Gi

apiServerTts:
namePrefix: api-server-tts
image: "quay.io/smallestinc/self-hosted-api-server:latest"
imagePullPolicy: IfNotPresent
port: 7100
baseUrl: ""
host: "0.0.0.0"
podAnnotations: {}

livenessProbe:
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5

readinessProbe:
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3

startupProbe:
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30

service:
type: ClusterIP
loadBalancerSourceRanges: []
externalTrafficPolicy: ""

resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 500m
memory: 512Mi

licenseProxy:
namePrefix: license-proxy
image: "quay.io/smallestinc/license-proxy:latest"
Expand Down
Loading