Skip to content

Commit

Permalink
Add Nemo server to Backend deployment Helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Nov 10, 2023
1 parent b3fcbe7 commit 7cb886a
Show file tree
Hide file tree
Showing 11 changed files with 165 additions and 4 deletions.
4 changes: 2 additions & 2 deletions neon_diana_utils/helm_charts/backend/diana-backend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.11
version: 0.1.12

# 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 All @@ -32,7 +32,7 @@ dependencies:
version: 11.13.0
repository: https://charts.bitnami.com/bitnami
- name: diana-http
version: 0.0.8
version: 0.0.9
repository: file://../http-services
- name: diana-mq
version: 0.0.7
Expand Down
8 changes: 6 additions & 2 deletions neon_diana_utils/helm_charts/backend/http-services/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: diana-http
description: Deploy DIANA HTTP Services

type: application
version: 0.0.8
version: 0.0.9
appVersion: "1.0.1a7"
dependencies:
- name: libretranslate
Expand Down Expand Up @@ -37,4 +37,8 @@ dependencies:
- name: ww-snowboy
alias: ww-snowboy
version: 0.0.4
repository: file://../../http/ww-snowboy
repository: file://../../http/ww-snowboy
- name: stt-nemo
alias: stt-nemo
version: 0.0.1
repository: file://../../http/stt-nemo
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ libretranslate:
ingress:
enabled: False
# image.tag:
stt-nemo:
subdomain: &host_nemo nemo
servicePort: *default_port
ingress:
enabled: False
tts-coqui:
subdomain: &host_coqui coqui
servicePort: *default_port
Expand Down Expand Up @@ -55,6 +60,9 @@ ingress:
tlsSecretName: tls-letsencrypt-prod
certIssuer: letsencrypt-private-key
rules:
- host: *host_nemo
serviceName: backend-nemo
servicePort: *default_port
- host: *host_libretranslate
serviceName: backend-libre
servicePort: *default_port
Expand Down
23 changes: 23 additions & 0 deletions neon_diana_utils/helm_charts/http/stt-nemo/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
12 changes: 12 additions & 0 deletions neon_diana_utils/helm_charts/http/stt-nemo/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v2
name: stt-nemo
description: Deploy a Nemo STT Server

type: application
version: 0.0.1
appVersion: "1.0.1a7"

dependencies:
- name: base-http
version: 0.0.4
repository: file://../../base/base-http
62 changes: 62 additions & 0 deletions neon_diana_utils/helm_charts/http/stt-nemo/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "stt-nemo.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "stt-nemo.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "stt-nemo.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "stt-nemo.labels" -}}
helm.sh/chart: {{ include "stt-nemo.chart" . }}
{{ include "stt-nemo.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "stt-nemo.selectorLabels" -}}
app.kubernetes.io/name: {{ include "stt-nemo.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "stt-nemo.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "stt-nemo.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{- include "base-http.deployment" .}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{- include "base-http.ingress" .}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{- include "base-http.service" .}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "tts-coqui.fullname" . }}-test-connection"
labels:
{{- include "tts-coqui.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "tts-coqui.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never
34 changes: 34 additions & 0 deletions neon_diana_utils/helm_charts/http/stt-nemo/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Default values for tts-coqui.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

serviceName: backend-nemo
replicaCount: 1
subdomain: nemo
domain: diana.local
servicePort: "8080"

image:
repository: ghcr.io/neongeckocom/neon-stt-plugin-nemo
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: dev

service:
type: ClusterIP
targetPort: "8080"

ingress:
enabled: true
className: nginx
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- paths:
- path: /
pathType: Prefix
backend:
service:
tls:
secretName: tls-letsencrypt-prod

0 comments on commit 7cb886a

Please sign in to comment.