Document version: 237. Automatically generated.

Upgrading SentiOne Automate

This guide will allow you to upgrade SentiOne Automate platform on your managed Kubernetes environment. External services such as ElasticSearch and RabbitMQ are not covered by this guide.

Prerequisites

We assume you're performing the upgrade using a Unix-based OS. Also, the following is required:

  • Access to the Kubernetes cluster where SentiOne Automate is installed.
  • Network access to SentiOne image repository (harbor-vm-proxy.sentione.com). Please contact your SentiOne representative if you don't have your Kubernetes cluster IP address whitelisted yet.
  • Helm installed on your OS.
  • Target version number to upgrade, provided by the SentiOne DevOps Team.
  • Dedicated Automate configuration repository has been cloned to local filesystem

Conventions

  • CAPITAL_LETTERS_VARIABLE_NAME - fragment which should be replaced with actual values matching particular environment
  • AUTOMATE_CONFIG_REPO_PATH - Path to automate configuration repository (eg. /home/user/automate-config)
  • ENVIRONMENT_NAME - Environment name (eg. production)

Example

$ cd AUTOMATE_CONFIG_REPO_PATH/ENVIRONMENT_NAME/external-services

Should be substituted with:

$ cd /home/user/automate-config/production/external-services

Upgrade process

👍

Scheduling downtime

Upgrade process will require some downtime that depends on how many versions will the platform be upgraded by and other factors. Please contact your SentiOne account manager if you need to schedule support from our DevOps Team.

Upgrading SentiOne Automate boils down to:

  • Backing up the application databases (PostgreSQL, ElasticSearch).
  • Integrating latest changes into values.yaml kept in Automate configuration repository). Make sure to follow Upgrade Tasks to keep track of them. If your platform deployment spans across multiple environments, you will need to apply those changes to each Helm custom values file.
  • Upgrading the Helm release (includes pulling the latest Docker images of components)
    • Rolling back if you need to return to the previous version

Repeat the following upgrade steps for each platform environment.

1. Apply all upgrade tasks

For each version you're upgrading, check Upgrade Tasks and update the custom values file.

📘

Example

If you're upgrading from 198 to 201, follow the upgrade tasks from the oldest to the latest version: 199 ➡️ 200 ➡️ 201.

You will find the values file in the repo-ext.sentione.com in the 'config' repository at the following location: <env-name>/kubernetes/helm/automate/values.yaml.

2. Back up the PostgreSQL database and ElasticSearch.

2.1 Prepare PostgreSQL dump

📘

Example based on defaults

In case you have renamed your databases, make sure to provide their new names for backup.

Use pg_dump to back up all objects related to the database hosting the SentiOne Automate platform:

$ pg_dump -d chatbots-admin -U db_user -W -h dbhost.example.com > ./chatbots-admin-$(date '+%Y%m%d-%H%M%S').sql \
    && pg_dump -d chatbots-analytics -U db_user -W -h dbhost.example.com > ./chatbots-analytics-$(date '+%Y%m%d-%H%M%S').sql \
    && pg_dump -d chatbots-cron-orchestrator -U db_user -W -h dbhost.example.com > ./chatbots-cron-orchestrator-$(date '+%Y%m%d-%H%M%S').sql \
    && pg_dump -d chatbots-dialog-manager -U db_user -W -h dbhost.example.com > ./chatbots-dialog-manager-$(date '+%Y%m%d-%H%M%S').sql \

2.2 Prepare ElasticSearch snapshot

A snapshot is required for a proper ElasticSearch backup. See Elastic Docs 6.8.23 - Snapshot And Restore for full documentation.

3. Upgrade Automate

3.1 Update charts repository

Issue following command

$ helm repo update

3.1 Use Helm to upgrade to the desired platform version.

E.g. if you're upgrading from an earlier release to 199.0.1:

$ helm upgrade --wait --debug '--timeout=30m' --namespace sentione \
-f AUTOMATE_CONFIG_REPO_PATH/ENVIRONMENT_NAME/kubernetes/helm/automate/values.yaml \
--version 199.0.1 \
automate sentione-hub/automate 

3.4. Consider the upgrade process done once:

  • helm upgrade command has succeeded. You should see the following text: Release "automate" has been upgraded. Happy Helming!
  • All Deployments in the Automate platform Kubernetes namespace are running and ready.

Rollback

In case you need to roll back to the previous release, follow the steps:

1. Stop all running apps

Scale down all Automate platform apps to 0:

$ kubectl scale deploy -n sentione --replicas=0 --all

2. Restore PostgreSQL database

Use psql to restore the pg_dump that you've prepared in Prepare PostgreSQL dump. Replace <date_here> with a proper timestamp.

$ psql -d chatbots-admin -U db_user -W -h dbhost.example.com < ./chatbots-admin-<date_here>.sql \
    && psql -d chatbots-analytics -U db_user -W -h dbhost.example.com < ./chatbots-analytics-<date_here>.sql \
    && psql -d chatbots-cron-orchestrator -U db_user -W -h dbhost.example.com < ./chatbots-cron-orchestrator-<date_here>.sql \
    && psql -d chatbots-dialog-manager -U db_user -W -h dbhost.example.com < ./chatbots-dialog-manager-<date_here>.sql \

3. Restore ElasticSearch snapshot

Similarly to Prepare ElasticSearch snapshot, follow Elastic Docs 6.8.23 - Snapshot And Restore - Restore to restore the ES snapshot you've prepared.

4. Rollback Helm release

After restoring the databases, you can roll back the Helm release to the previously working version:

$ helm rollback automate --namespace sentione --version <PUT_PREVIOUS_VERSION_HERE>