Table of contents

Installing the Watson Speech to Text service

An administrator can install the Watson™ Speech to Text service on IBM® Cloud Pak for Data.

Before you begin

Required role: To complete this task, you must be an administrator of the project (namespace) where you will deploy the service. The cluster-admin role is required to deploy IBM Watson Speech services.

If you are running the installation on a cluster that is connected to the internet, ensure that your repo.yaml file includes the appropriate registry entry for the service. For details, see Obtaining the installation files.

About this task

The procedure deploys a single installation of the IBM Watson Speech services. A single installation can accommodate up to 30 service instances.

Procedure

Setting up the cluster: Before installing Watson Speech services, verify that Portworx is installed and that the portworx-sc storage class exists. For information about other supported storage solutions, see Storage considerations.

  1. If the portworx-sc storageclass does not exist (use the oc get sc portworx-sc command to check), create it by running the following command.
    oc create -f {manifest-file}

    where {manifest-file} is a YAML file that contains the following specifications:

    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata: 
      name: portworx-sc
    parameters: 
      block_size: 64k
      io_profile: db
      priority_io: high
      repl: "3"
      snap_interval: "0"
    provisioner: kubernetes.io/portworx-volume
    reclaimPolicy: Delete
    volumeBindingMode: Immediate
  2. To verify that the storageclass was created properly, run the following command.
    oc get storageclass | grep portworx-sc
  3. Log in to Red Hat® OpenShift®.
    oc login

    For Red Hat OpenShift version 4.x, you can navigate to the OpenShift console in your browser (use the oc get routes -n openshift-console command to get the URL) and select "kubeadmin" in the upper right. Then select "copy login command". Select "Display token" and paste the token in a terminal window.

  4. Set up required labels. You must add a label to the namespace where IBM Cloud Pak for Data is installed.
    oc label --overwrite namespace {namespace-name} ns={namespace-name}

    where {namespace-name} is the namespace where IBM Cloud Pak for Data is installed, normally zen.

  5. Make sure you are pointing at the correct OpenShift project.
    oc project {namespace-name}

    where {namespace-name} is the namespace where IBM Cloud Pak for Data is installed.

  6. Create secrets objects with credentials to access the datastores. You must create secrets objects for Minio and PostgreSQL manually within the {namespace-name} namespace to set the access credentials for the Minio and PostgreSQL datastores.
    • Minio:

      apiVersion:v1
      kind:Secret
      metadata:
        name:minio
      type:Opaque
      data:
        accesskey:YWRtaW4=
        secretkey:YWRtaW4xMjM0

      where accesskey and secretkey are values of your choice encoded in base64. For example:

      echo -n "admin" | base64
      YWRtaW4=
      
      echo -n "admin1234" | base64
      YWRtaW4xMjM0
    • PostgreSQL:

      apiVersion:v1
      data:
        pg_repl_password:cmVwbHVzZXI=
        pg_su_password:c3RvbG9u
      kind:Secret
      metadata:
        name:user-provided-postgressql# This name can be anything you choose.
      type:Opaque

      where both pg_repl_password and pg_su_password are again your choice and base64-encoded.

  7. Choose one of the following options based on whether or not the cluster can connect to the internet:
    • Installing the assembly on an internet-connected cluster

      Use the following command to install the Watson Speech services assembly on a host that is connected to the internet:

      ./{cpd-tool} --repo ./repo.yaml \ 
      --assembly watson-speech \ 
      --version 1.1.4 \ 
      --namespace {project_namespace} \ 
      --transfer-image-to {registry_location}/{project_namespace} \ 
      --target-registry-username {OpenShift_username} \ 
      --target-registry-password {OpenShift_password} \ 
      --insecure-skip-tls-verify \ 
      --cluster-pull-prefix {registry_from_cluster}/{project_namespace} \ 
      --override ./speech-override.yaml

      where

      • {cpd-tool} is cpd-linux if you run the command from a Linux terminal, cpd-darwin if you run it from Mac OS, and so on.
      • {project_namespace} is the namespace in which you installed IBM Cloud Pak for Data, typically zen.
      • {registry_location}/{project_namespace} is $(oc registry info)/{project_namespace}. The oc registry info command retrieves the registry location for the mandatory {project_namespace} value, which must be the same value that you used previously, typically zen.
      • {OpenShift_username} is the name of a user with access to the OpenShift registry in the target namespace. The default {OpenShift_username} is typically one of the following:
        • kubeadmin for OpenShift 4.x.
        • ocadmin for OpenShift 3.x.
      • {OpenShift_password} is the password for the specified {OpenShift_username}. You can specify $(oc whoami -t) to retrieve the password automatically.
      • --insecure-skip-tls-verify prevents 509 errors if you are using the OpenShift registry with the default self-signed certificate. Omit the option if you are not using the default self-signed certificate.
      • {registry_from_cluster}/{project_namespace} is the address of the internal OpenShift Docker registry for the mandatory {project_namespace} value, which is typically zen. The {registry_from_cluster} is one of the following:
        • image-registry.openshift-image-registry.svc:5000 for OpenShift 4.x.
        • docker-registry.default.svc:5000 for OpenShift 3.x.

      For example, a complete installation command might look like the following:

      ./cpd-linux --repo ./repo.yaml \ 
      --assembly watson-speech \ 
      --version 1.1.4 \ 
      --namespace zen \ 
      --transfer-image-to $(oc registry info)/zen \ 
      --target-registry-username kubeadmin \ 
      --target-registry-password $(oc whoami -t) \ 
      --insecure-skip-tls-verify \ 
      --cluster-pull-prefix image-registry.openshift-image-registry.svc:5000/zen \ 
      --override ./speech-override.yaml
    • Installing the assembly on an air-gapped cluster

      Use the following procedure to install the Watson Speech services assembly in an air-gapped cluster. You must use the same version and build of cpd-linux throughout the process.

      1. Make sure you have completed setting up the cluster and have created the speech-repo.yaml and speech-override.yaml files described in previous procedures.
      2. Download the images and assembly files. Run the following command in a location that has access to the internet and to the cpd-linux tool.
        ./cpd-linux preloadImages --repo speech-repo.yaml --assembly watson-speech --version ${assembly-version} --action download --download-path ./{speech-workspace}

        where

        • {assembly-version} is the release version, currently 1.1.4.
        • {speech-workspace} is the directory to which the images are to be downloaded.
      3. Push the {speech-workspace} directory to a location that has access to the OpenShift cluster to be installed and the same version of the cpd-linux tool that you used in the previous step. First, log in to the OpenShift cluster.
        oc login
        
      4. Push the Docker images to the internal docker registry.
        ./cpd-linux preloadImages --action push --load-from ./{speech-workspace} --assembly watson-speech --version ${assembly-version} --transfer-image-to $(oc registry info)/{namespace-name} --target-registry-username kubeadmin --target-registry-password $(oc whoami -t) --insecure-skip-tls-verify
        

        where

        • {speech-workspace} is the directory to which the images were downloaded.
        • {assembly-version} is the release version, currently 1.1.4.
        • {namespace-name} is the namespace into which IBM Cloud Pak for Data was installed, normally zen.
      5. Get the Docker secrets.
        oc get secrets | grep default-dockercfg
        
      6. Modify the speech-override.yaml file and update global.image.pullSecret with the name of the secret that you discovered in the previous step.
      7. Install the Watson Speech services.
        ./cpd-linux --load-from ./{speech-workspace} --assembly watson-speech --version ${assembly-version} --namespace {namespace-name} --cluster-pull-prefix {docker-registry}/{namespace} -o speech-override.yaml

        where

        • {namespace-name} is the namespace into which IBM Cloud Pak for Data was installed, normally zen.
        • {docker-registry} is the address of the internal OpenShift docker registry:
          • docker-registry.default.svc:5000 for Red Hat OpenShift 3.x.
          • image-registry.openshift-image-registry.svc:5000 for Red Hat OpenShift 4.x.
        • {assembly_version} is the release version, currently 1.1.4.

What to do next

Verify the installation: For both internet-connected and air-gapped installations, follow this procedure to verify that the installation succeeded.
  1. Check the status of the assembly and modules.
    ./cpd-linux status --namespace {namespace-name} --assembly watson-speech [--patches]

    where

    • {namespace-name} is the namespace into which IBM Cloud Pak for Data was installed, normally zen.
    • --patches displays additional patches that have been applied.
  2. Set up your Helm environment.
    export TILLER_NAMESPACE=zen
    oc get secret helm-secret -n $TILLER_NAMESPACE -o yaml|grep -A3 '^data:'|tail -3 | awk -F: '{system("echo "$2" |base64 --decode > "$1)}'
    export HELM_TLS_CA_CERT=$PWD/ca.cert.pem
    export HELM_TLS_CERT=$PWD/helm.cert.pem
    export HELM_TLS_KEY=$PWD/helm.key.pem
    helm version --tls

    If the installation succeeded, these commands return output like the following:

    Client: &version.Version{SemVer:"v2.14.3", GitCommit:"0e7f3b6637f7af8fcfddb3d2941fcc7cbebb0085", GitTreeState:"clean"}
    Server: &version.Version{SemVer:"v2.14.3", GitCommit:"0e7f3b6637f7af8fcfddb3d2941fcc7cbebb0085
  3. Check the status of resources.
    helm status watson-speech --tls
  4. Run Helm tests.
    helm test watson-speech --tls [--timeout=18000] [--cleanup]
    

    where

    • --timeout={time} waits for the time in seconds for the tests to run.
    • --cleanup deletes test pods upon completion.