cognitive-services-speech-onpremise
by Helm
A Helm chart for Kubernetes for all on-prem speech service components
About this chart
On-premises Speech Service
On-premises Speech(henceforth referred to as speech-onprem) Servicve enable customer to build one speech service that is optmized to take advantage of both robust cloud capabilities and edge locality, based on customer's on-premises requirements. This speech-onprem service supports two main component services speech-to-text and text-to-speech, which customer can choose to enable any of them or both.
Introduction
This chart deploys Speech Service containers on a Kubernetes by Helm. This chart supports the deployment of two services:
- speech-to-text
- text-tot-speech
User is able to deploy only one of them or both.
This chart supports helm test command. User is able to apply this command to verify speech service is running properly.
Prerequisites
- Helm 2.12.3, Kubernetes 1.12.2
- Helm 2.14.0, Kubernetes 1.14.1
Resources Required
Please read Speech Service container computing resource as a reference.
This Helm chart automatically calculates CPU and memory requirements base on how many decodes (concurrent requests) that user specifies and also whether optimization for audio/text input is enabled. This Helm chart sets 2 concurrent requests and optimization disabled as default.
| Service | CPU/container | Memory/container |
|---|---|---|
| Speech-to-text | 1 decoder requires minimum 1250 milli cores If optimization is enabled, requires 2150 milli cores | Request: 4GB Limited: 8GB |
| Text-to-Speech | 1 concurrency requires minimum 600 milli cores If optimization is enabled, requires 1200 milli cores | Request: 2GB Limited: 3GB |
Installing the Chart
-
To deploy Speech Service in kubernetes cluster, two sample files are provided as a reference under dir
speech-onprem/testssample-deployment.yamlmulti-decoders-sample-deployment.yamlserviceannotation-sample-deployment.yamlspeechToText-only-plus-sentiment-deployment.yamlspeechToText-only-deployment.yamltextToSpeech-only-deployment.yaml
-
To install
speech-onpremhelm chart, runhelm install <PATH_TO_SPEECH_ONPREM_ON_YOUR_LOCAL> \ --values <PATH_TO_YOUR_CUSTOMIZED_VALUES_FILE> \ --name <RELEASE_NAME>To apply your own docker repo secret, use
--setargumenthelm install <PATH_TO_SPEECH_ONPREM_ON_YOUR_LOCAL> \ --set speechToText.image.pullSecrets={<YOUR_OWN_SECRET_NAME>},textToSpeech.image.pullSecrets={YOUR_OWN_SECRET_NAME} \ --values <PATH_TO_YOUR_CUSTOMIZED_VALUES_FILE> \ --name <RELEASE_NAME>i.e.
speech-onpremhelm chart is located under Windows D: drive on my local. Commands below access it via WindowsLinuxSubsystem (WSL).helm install speech-onprem \ --values speech-onprem/test/sample-deployment.yaml \ --name onprem-samplehelm install speech-onprem \ --set speechToText.image.pullSecrets={my-container-preview},textToSpeech.image.pullSecrets={my-container-preview} \ --values speech-onprem/test/sample-deployment.yaml \ --name onprem-sample -
This chart supports
helm testcommand. It createsspeech-to-text-readiness-testandtext-to-speech-readiness-testpods in the cluster to verifyspeech-to-textandtext-to-speechservices are running successfully.helm test <RELEASE_NAME>i.e.
helm test onprem-sample
Configuration
The Helm chart ships with reasonable defaults. However, since it is named on-premises, it should definitely support customization and configuration overrides. To apply customized configurations,
- override helm values though command:
helm install --set <KEY>=<VALUE> ... - create a new separate values.yaml file and apply it through command:
helm install --values <YOUR_VALUES_FILE_PATH>
Please check below sections for the details of configurable options of the Helm chart.
Note: configurable options may change in future.
SPEECH-ONPREM (umbrella chart)
Values in umbrella chart override the corresponding sub-chart values. Therefore, if user chooses .yaml file to apply on-premises customized values, it should follow one of the methods below:
- added in umbrella chart values.yaml file.
- create a new separate .yaml file to override.
No customized values in sub-chart values.yaml, No customized values in sub-chart values.yaml, No customized values in sub-chart values.yaml.
| Parameter | Description | Values | Default |
|---|---|---|---|
speechToText.enabled | Specifies whether enable speech-to-text service | true/false | true |
speechToText.verification.enabled | Specifies whether enable helm test capability for speech-to-text service | true/false | true |
speechToText.verification.image.registry | Specifies docker image repository that helm test uses to test speech-to-text service. Helm creates separate pod inside the cluster for testing and pulls the test-use image from this registry | valid docker registry | docker.io |
speechToText.verification.image.repository | Specifies docker image repository that helm test uses to test speech-to-text service. Helm test pod uses this repository to pull test-use image | valid docker image repository | antsu/on-prem-client |
speechToText.verification.image.tag | Specifies docker image tag that used helm test for speech-to-text service. Helm test pod uses this tag to pull test-use image | valid docker image tag | latest |
speechToText.verification.image.pullByHash | Specifies whether test-use docker image is pulled by hash. If yes, speechToText.verification.image.hash should be added, with valid image hash value. It's false by default. | true/false | false |
speechToText.verification.image.arguments | Specifies the arguments to execute test-use docker image. Helm test pod passes these arguments to container when running helm test | valid arguments as the test docker image requires | "./speech-to-text-client" "./audio/whatstheweatherlike.wav" "--expect=What's the weather like""--host=$(SPEECH_TO_TEXT_HOST)""--port=$(SPEECH_TO_TEXT_PORT)" |
textToSpeech.enabled | Specifies whether enable text-to-speech service | true/false | true |
textToSpeech.verification.enabled | Specifies whether enable helm test capability for text-to-speech service | true/false | true |
textToSpeech.verification.image.registry | Specifies docker image repository that helm test uses to test text-to-speech service. Helm creates separate pod inside the cluster for testing and pulls the test-use image from this registry | valid docker registry | docker.io |
textToSpeech.verification.image.repository | Specifies docker image repository that helm test uses to test text-to-speech service. Helm test pod uses this repository to pull test-use image | valid docker image repository | antsu/on-prem-client |
textToSpeech.verification.image.tag | Specifies docker image tag that used helm test for text-to-speech service. Helm test pod uses this tag to pull test-use image | valid docker image tag | latest |
textToSpeech.verification.image.pullByHash | Specifies whether test-use docker image is pulled by hash. If yes, textToSpeech.verification.image.hash should be added, with valid image hash value. It's false by default. | true/false | false |
textToSpeech.verification.image.arguments | Specifies the arguments to execute test-use docker image. Helm test pod passes these arguments to container when running helm test | valid arguments as the test docker image requires | "./text-to-speech-client" "--input='What's the weather like'" "--host=$(TEXT_TO_SPEECH_HOST)""--port=$(TEXT_TO_SPEECH_PORT)" |
SPEECH-TO-TEXT (subchart: charts/speechToText)
Again, no customized values in sub-chart values.yaml!
Add prefix
speechToText.on any parameter below into your own .yaml file/umbrella chart's values.yaml can override the corresponding values here. i.e.speechToText.numberOfConcurrentRequestoverridesnumberOfConcurrentRequest.
| Parameter | Description | Values | Default |
|---|---|---|---|
enabled | Specifies whether enable speech-to-text service | true/false | false |
numberOfConcurrentRequest | Specifies how many concurrent requests for speech-to-text service. This chart automatically calculate CPU and memory resources, based on this value. | int | 2 |
optimizeForAudioFile | Specifies if service needs to optimize for audio input via audio file. If yes, this chart will allocate more CPU resource to service. Default is false | true/false | false |
image.registry | Specifies the speech-to-text docker image registry | valid docker image registry | |
image.repository | Specifies the speech-to-text docker image repository | valida docker image repository | |
image.tag | Specifies the speech-to-text docker image tag | valid docker image tag | |
image.pullSecrets | Specifies the image secrets for pulling speech-to-text docker image | valida secrets name | |
image.pullByHash | Specifies if pulling docker image by hash. If yes, image.hash is required to have as well. If no, set it as 'false'. Default is false. | true/false | false |
image.hash | Specifies speech-to-text docker image hash. Only use it when image.pullByHash:true. | valid docker image hash | |
image.args.eula | One of the required arguments by speech-to-text container, which indicates you've accepted the license. The value of this option must be: accept | accept, if you want to use the container | |
image.args.billing | One of the required arguments by speech-to-text container, which specifies the billing endpoint URI The billing endpoint URI value is available on the Azure portal's Speech Overview page. | valid billing endpoint URI | |
image.args.apikey | One of the required arguments by speech-to-text container, which is used to track billing information. | valid apikey | |
service.type | Specifies the type of speech-to-text service in Kubernetes. Kubernetes Service Types Instruction Default is LoadBalancer (please make sure you cloud provider supports) | valid Kuberntes service type | LoadBalancer |
service.port | Specifies the port of speech-to-text service | int | 80 |
service.annotations | The annotations user can add to speech-to-text service metadata. For instance: annotations: some/annotation1: value1 some/annotation2: value2 | annotations, one per each line | |
serivce.autoScaler.enabled | Specifies if enable Horizontal Pod Autoscaler If enabled, speech-to-text-autoscaler will be deployed in the Kubernetes cluster | true/false | true |
service.podDisruption.enabled | Specifies if enable Pod Disruption Budget If enabled, speech-to-text-poddisruptionbudget will be deployed in the Kubernetes cluster | true/false | true |
####Text Analytics Support From speech-to-text onprem container 2.2.0, it supports sentiment analysis feature. This feature is back supported by Text Analytics service. In order to support such feature in Speech Onprem Helm Chart, below parameters are added to Speech-To-Text subchart.
| Parameter | Description | Values | Default |
|---|---|---|---|
textanalytics.enabled | Specifies whether enable text-analytics service | true/false | false |
textanalytics.image.registry | Specifies the text-analytics docker image registry | valid docker image registry | |
textanalytics.image.repository | Specifies the text-analytics docker image repository | valida docker image repository | |
textanalytics.image.tag | Specifies the text-analytics docker image tag | valid docker image tag | |
textanalytics.image.pullSecrets | Specifies the image secrets for pulling text-analytics docker image | valida secrets name | |
textanalytics.image.pullByHash | Specifies if pulling docker image by hash. If yes, image.hash is required to have as well. If no, set it as 'false'. Default is false. | true/false | false |
textanalytics.image.hash | Specifies text-analytics docker image hash. Only use it when image.pullByHash:true. | valid docker image hash | |
textanalytics.image.args.eula | One of the required arguments by text-analytics container, which indicates you've accepted the license. The value of this option must be: accept | accept, if you want to use the container | |
textanalytics.image.args.billing | One of the required arguments by text-analytics container, which specifies the billing endpoint URI The billing endpoint URI value is available on the Azure portal's Speech Overview page. | valid billing endpoint URI | |
textanalytics.image.args.apikey | One of the required arguments by text-analytics container, which is used to track billing information. | valid apikey | |
textanalytics.cpuRequest | Specifies the requested CPU for text-analytics container | int | 3000m |
textanalytics.cpuLimit | Specifies the limited CPU for text-analytics container | `8000 |
Deploy cognitive-services-speech-onpremise with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has cognitive-services-speech-onpremise on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartcognitive-services-speech-onpremise is pinned at v0.3.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply