Uninstalling watsonx Assistant

An instance administrator can uninstall watsonx Assistant.

Who needs to complete this task?

Instance administrator To uninstall watsonx Assistant, you must be an instance administrator. An instance administrator has permission to manage software in the following projects:

The operators project for the instance

The operators for this instance of IBM Software Hub are installed in the operators project. In the uninstall commands, the ${PROJECT_CPD_INST_OPERATORS} environment variable refers to the operators project.

The operands project for the instance

The IBM Software Hub control plane and the services for this instance of IBM Software Hub are installed in the operands project. In the uninstall commands, the ${PROJECT_CPD_INST_OPERANDS} environment variable refers to the operands project.

When do you need to complete this task?

Complete this task if you want to remove watsonx Assistant from an instance of IBM Software Hub.

Repeat as needed If you are responsible for multiple instances of IBM Software Hub, you can repeat this task to remove other instances of watsonx Assistant on the cluster.

Information you need to complete this task

Review the following information before you uninstall watsonx Assistant:

Environment variables
The commands in this task use environment variables so that you can run the commands exactly as written.
  • If you don't have the script that defines the environment variables, see Setting up installation environment variables.
  • To use the environment variables from the script, you must source the environment variables before you run the commands in this task. For example, run:
    source ./cpd_vars.sh

Dependent services

Before you uninstall watsonx Assistant, ensure that the following services are uninstalled:

Procedure

Complete the following tasks to uninstall watsonx Assistant:

  1. Deleting service instances
  2. Uninstalling the service
  3. Cleaning up resources

Deleting service instances

Before you uninstall watsonx Assistant, you must delete any service instances that are associated with watsonx Assistant to ensure that each instance releases the resources that it reserved.

Who needs to complete this task?
A user with the Manage service instances permission must complete this task.
When do you need to complete this task?
Complete this task before you uninstall watsonx Assistant.

From the IBM Software Hub web client:

  1. Log in to the web client as a user with sufficient permissions to complete the task.
  2. From the menu, select Services > Instances.
  3. Filter the list to show the assistant type.
  4. Delete each assistant instance in the list.

Uninstalling the service

To uninstall watsonx Assistant:

  1. Log the cpd-cli in to the Red Hat® OpenShift® Container Platform cluster:
    ${CPDM_OC_LOGIN}
    Remember: CPDM_OC_LOGIN is an alias for the cpd-cli manage login-to-ocp command.
  2. Get the name of the watsonx Assistant service.
    oc get WatsonAssistant --namespace ${PROJECT_CPD_INST_OPERANDS}
  3. Set the INSTANCE environment variable to the name of the watsonx Assistant service:
    export INSTANCE=<wa-instance-name>
  4. Delete the custom resource for watsonx Assistant.
    cpd-cli manage delete-cr \
    --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} \
    --components=watson_assistant \
    --include_dependency=true
    Wait for the cpd-cli to return the following message before you proceed to the next step:
    [SUCCESS]... The delete-cr command ran successfully
  5. Delete the OLM objects for watsonx Assistant:
    cpd-cli manage delete-olm-artifacts \
    --cpd_operator_ns=${PROJECT_CPD_INST_OPERATORS} \
    --components=watson_assistant
    Wait for the cpd-cli to return the following message:
    [SUCCESS]... The delete-olm-artifacts command ran successfully

Cleaning up resources

Who needs to complete this task?
You must be an administrator of the project where watsonx Assistant is installed.
When do you need to complete this task?
Complete this task to clean up resources after you remove watsonx Assistant from your deployment.

To delete the remaining resources:

    1. Check whether a deployment verification test exists:
      oc get dvt -n ${PROJECT_CPD_INST_OPERANDS}
    2. If a deployment verification test exists, run the following command to delete it. When you run the command, replace {dvt-name} with the name of the test:

      oc delete dvt {dvt-name} -n ${PROJECT_CPD_INST_OPERANDS}
    1. Get the remaining persistent volume claims for your instance:
      oc get pvc -n ${PROJECT_CPD_INST_OPERANDS} |grep ${INSTANCE}-
    2. Run the following command for each persistent volume claim to delete them one at a time. When you run the command, replace {pvc-name} with the name of the persistent volume claim:
      oc delete pvc {pvc-name} -n ${PROJECT_CPD_INST_OPERANDS}
    1. Get the temporary patches for your instance:
      oc get temporarypatch -n ${PROJECT_CPD_INST_OPERANDS} |grep ${INSTANCE}-
    2. Run the following command for each temporary patch to delete them one at a time. When you run the command, replace {temporarypatch-name} with the name of the temporary patch:
      oc delete temporarypatch {temporarypatch-name} -n ${PROJECT_CPD_INST_OPERANDS}
    3. If the deletion gets hung up, press Ctrl+C to exit the command. Then, run the following command. When you run the command, replace {temporarypatch-name} with the name of the temporary patch:
      oc patch temporarypatch {temporarypatch-name} -n ${PROJECT_CPD_INST_OPERANDS} --type=merge -p '{"metadata": {"finalizers":null}}'
  1. Remove watsonx Assistant data from Multicloud Object Gateway by completing the following steps:
    1. Download the MinIO client.

      Refer to the MinIO product documentation and follow the appropriate instructions for your platform.

    2. Get the host and port information for the Multicloud Object Gateway and store it in an environment variable named MCG_ENDPOINT by entering the following command:
      export MCG_ENDPOINT="$(oc get route s3 --namespace openshift-storage \
      --output jsonpath='https://{.spec.host}')"
    3. Get the access key and secret key of Multicloud Object Gateway from the noobaa-account-watson-assistant secret and store the keys in environment variables.
      export MCG_ACCESS_KEY="$(oc extract secret/noobaa-account-watson-assistant \
      --keys=AWS_ACCESS_KEY_ID --to=- --namespace ${PROJECT_CPD_INST_OPERANDS})"
      export MCG_SECRET_KEY="$(oc extract secret/noobaa-account-watson-assistant \
      --keys=AWS_SECRET_ACCESS_KEY --to=- \
      --namespace ${PROJECT_CPD_INST_OPERANDS})"
    4. Configure the MinIO client for Multicloud Object Gateway.
      mc alias set assistant "${MCG_ENDPOINT}" "${MCG_ACCESS_KEY}" "${MCG_SECRET_KEY}"
      Note: If necessary, follow the instructions in the MinIO documentation to configure a security certificate. Otherwise, specify the --insecure option to disable certificate verification. If you disable verification for the client, you must include the --insecure option when you submit the mc commands.
    5. Run the following command to confirm that the MinIO client is successfully configured. The command lists the buckets that are used by watsonx Assistant.
      mc ls assistant
      If an error is displayed, check the variables that you defined in the previous steps and ensure that the Multicloud Object Gateway host and port are accessible from your console.
    6. Delete the following objects and buckets that were created by watsonx Assistant:
      • nlclassifier-icp
      • wa-api-prod-wa-v1

      If a bucket named icp is listed, remove it. This bucket is listed only when data has been migrated from MinIO.

      To delete, run the following commands one time for each item in the list and replace <name> with a name from the list:
      mc rm --recursive --force assistant/<name>-${PROJECT_CPD_INST_OPERANDS}
      mc rb assistant/<name>-${PROJECT_CPD_INST_OPERANDS}
    7. Remove the Multicloud Object Gateway configuration from the MinIO client by entering the following command:
      mc alias remove assistant
    1. Get the remaining secrets for your instance:
      oc get secret -n ${PROJECT_CPD_INST_OPERANDS} |grep ${INSTANCE}-
    2. Run the following command for each secret to delete them one at a time. When you run the command, replace {secret-name} with the name of the secret:
      oc delete secret {secret-name} -n ${PROJECT_CPD_INST_OPERANDS}