cognitive-services-speech-onpremise

by Helm

Helm chartv0.3.3

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.

ServiceCPU/containerMemory/container
Speech-to-text1 decoder requires minimum 1250 milli cores If optimization is enabled, requires 2150 milli coresRequest: 4GB Limited: 8GB
Text-to-Speech1 concurrency requires minimum 600 milli cores If optimization is enabled, requires 1200 milli coresRequest: 2GB Limited: 3GB

Installing the Chart

  1. To deploy Speech Service in kubernetes cluster, two sample files are provided as a reference under dir speech-onprem/tests

    • sample-deployment.yaml
    • multi-decoders-sample-deployment.yaml
    • serviceannotation-sample-deployment.yaml
    • speechToText-only-plus-sentiment-deployment.yaml
    • speechToText-only-deployment.yaml
    • textToSpeech-only-deployment.yaml
  2. To install speech-onprem helm chart, run

    helm 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 --set argument

    helm 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-onprem helm 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-sample
    
    helm 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
    
  3. This chart supports helm test command. It creates speech-to-text-readiness-test and text-to-speech-readiness-test pods in the cluster to verify speech-to-text and text-to-speech services 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,

  1. override helm values though command: helm install --set <KEY>=<VALUE> ...
  2. 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:

  1. added in umbrella chart values.yaml file.
  2. 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.

ParameterDescriptionValuesDefault
speechToText.enabledSpecifies whether enable speech-to-text servicetrue/falsetrue
speechToText.verification.enabledSpecifies whether enable helm test capability for speech-to-text servicetrue/falsetrue
speechToText.verification.image.registrySpecifies 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 registryvalid docker registrydocker.io
speechToText.verification.image.repositorySpecifies docker image repository that helm test uses to test speech-to-text service. Helm test pod uses this repository to pull test-use imagevalid docker image repositoryantsu/on-prem-client
speechToText.verification.image.tagSpecifies docker image tag that used helm test for speech-to-text service. Helm test pod uses this tag to pull test-use imagevalid docker image taglatest
speechToText.verification.image.pullByHashSpecifies 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/falsefalse
speechToText.verification.image.argumentsSpecifies the arguments to execute test-use docker image. Helm test pod passes these arguments to container when running helm testvalid 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.enabledSpecifies whether enable text-to-speech servicetrue/falsetrue
textToSpeech.verification.enabledSpecifies whether enable helm test capability for text-to-speech servicetrue/falsetrue
textToSpeech.verification.image.registrySpecifies 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 registryvalid docker registrydocker.io
textToSpeech.verification.image.repositorySpecifies docker image repository that helm test uses to test text-to-speech service. Helm test pod uses this repository to pull test-use imagevalid docker image repositoryantsu/on-prem-client
textToSpeech.verification.image.tagSpecifies docker image tag that used helm test for text-to-speech service. Helm test pod uses this tag to pull test-use imagevalid docker image taglatest
textToSpeech.verification.image.pullByHashSpecifies 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/falsefalse
textToSpeech.verification.image.argumentsSpecifies the arguments to execute test-use docker image. Helm test pod passes these arguments to container when running helm testvalid 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.numberOfConcurrentRequest overrides numberOfConcurrentRequest.

ParameterDescriptionValuesDefault
enabledSpecifies whether enable speech-to-text servicetrue/falsefalse
numberOfConcurrentRequestSpecifies how many concurrent requests for speech-to-text service. This chart automatically calculate CPU and memory resources, based on this value.int2
optimizeForAudioFileSpecifies if service needs to optimize for audio input via audio file. If yes, this chart will allocate more CPU resource to service. Default is falsetrue/falsefalse
image.registrySpecifies the speech-to-text docker image registryvalid docker image registry
image.repositorySpecifies the speech-to-text docker image repositoryvalida docker image repository
image.tagSpecifies the speech-to-text docker image tagvalid docker image tag
image.pullSecretsSpecifies the image secrets for pulling speech-to-text docker imagevalida secrets name
image.pullByHashSpecifies 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/falsefalse
image.hashSpecifies speech-to-text docker image hash. Only use it when image.pullByHash:true.valid docker image hash
image.args.eulaOne of the required arguments by speech-to-text container, which indicates you've accepted the license. The value of this option must be: acceptaccept, if you want to use the container
image.args.billingOne 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.apikeyOne of the required arguments by speech-to-text container, which is used to track billing information.valid apikey
service.typeSpecifies 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 typeLoadBalancer
service.portSpecifies the port of speech-to-text serviceint80
service.annotationsThe annotations user can add to speech-to-text service metadata. For instance: annotations: some/annotation1: value1 some/annotation2: value2annotations, one per each line
serivce.autoScaler.enabledSpecifies if enable Horizontal Pod Autoscaler If enabled, speech-to-text-autoscaler will be deployed in the Kubernetes clustertrue/falsetrue
service.podDisruption.enabledSpecifies if enable Pod Disruption Budget If enabled, speech-to-text-poddisruptionbudget will be deployed in the Kubernetes clustertrue/falsetrue

####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.

ParameterDescriptionValuesDefault
textanalytics.enabledSpecifies whether enable text-analytics servicetrue/falsefalse
textanalytics.image.registrySpecifies the text-analytics docker image registryvalid docker image registry
textanalytics.image.repositorySpecifies the text-analytics docker image repositoryvalida docker image repository
textanalytics.image.tagSpecifies the text-analytics docker image tagvalid docker image tag
textanalytics.image.pullSecretsSpecifies the image secrets for pulling text-analytics docker imagevalida secrets name
textanalytics.image.pullByHashSpecifies 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/falsefalse
textanalytics.image.hashSpecifies text-analytics docker image hash. Only use it when image.pullByHash:true.valid docker image hash
textanalytics.image.args.eulaOne of the required arguments by text-analytics container, which indicates you've accepted the license. The value of this option must be: acceptaccept, if you want to use the container
textanalytics.image.args.billingOne 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.apikeyOne of the required arguments by text-analytics container, which is used to track billing information.valid apikey
textanalytics.cpuRequestSpecifies the requested CPU for text-analytics containerint3000m
textanalytics.cpuLimitSpecifies 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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartcognitive-services-speech-onpremise is pinned at v0.3.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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