Prerequisites
Before upgrading the application, you need to stream the new version to your Docker Registry. If you need to install hsk8s, refer to the hsk8s (Hyperscience Kubernetes CLI) article.
export HS_APP_VERSION=<version>
export HS_TOKEN=<token>
hsk8s image stream your-docker-registry.net --token $HS_TOKEN --aws
hsk8s image stream your-docker-registry.net --token $HS_TOKEN --aws --forms --forms-repo --forms-version $HS_APP_VERSION
hsk8s image stream your-docker-registry.net --token $HS_TOKEN --aws --blocks --blocks-repo --forms-version $HS_APP_VERSION
hsk8s image stream your-docker-registry.net --token $HS_TOKEN --aws --trainer --trainer-repo --forms-version $HS_APP_VERSIONNote Replace <version>and <token> with actual values. You should have received your token from Hyperscience sales representative.
Note Replace your-docker-registry.net with your Docker registry endpoint.
Make sure that you have imported environment variables from hsk8s (Hyperscience Kubernetes CLI):
source hs_env.bashMinor Upgrade
Update the image tags in your values.yaml file with the new forms version that you want to install.
app:
tag: ""
trainer:
- Note You need kubectl access to run the following command. Once you have saved your changes run the following helm command to upgrade the release:
helm upgrade $HS_HELM_RELEASE -f values.yaml $HS_HELM_CHART
This will kick-off the upgrade process, during which you can expect some downtime.
Major Upgrade
IMPORTANT: When performing a major version upgrade on the Hyperscience application, a new version of the trainer needs to be spawned first to maintain automation performance. More information on that topic can be found in the Upgrade Process Overview.
values.yaml
trainer:
tags:
-
- Apply the changes $ helm upgrade $HS_HELM_RELEASE -f values.yaml $HS_HELM_CHART
Two new trainer pods will be started and once the artifact jobs are finished the following changes are to be made to the values.yaml file
app:
tag: ""
trainer:
- # Delete the itemApply the changes $ helm upgrade $HS_HELM_RELEASE -f values.yaml $HS_HELM_CHART
Step by step sample
Initially a new init job will be created. Both the frontend and backend pods will be stuck in Init until the init-job is completed.
$ helm upgrade $HS_HELM_RELEASE -f values.yaml $HS_HELM_CHART
$ kubectl get pod
NAME READY STATUS RESTARTS AGE
hs-block-lambdapython-77677cd4f6-v5cnk 1/1 Running 0 18h
hyperscience-backend-7c7777d9dd-l4nb5 0/7 Init:0/1 0 49s
hyperscience-frontend-6984bb49c4-g557k 0/2 Init:0/1 0 46s
hyperscience-hyperoperator-68f8cfcb57-79wvs 1/1 Running 0 46s
hyperscience-init-job-kaxsg-5nhwk 0/3 Init:0/2 0 41s
trainer-b683d4f1-bmbdq 0/9 ContainerCreating 0 41sNote Some restarts of the trainer pod are expected until the init job completes.
$ kubectl get pod
NAME READY STATUS RESTARTS AGE
hs-block-lambdapython-77677cd4f6-v5cnk 1/1 Running 0 18h
hyperscience-backend-7c7777d9dd-l4nb5 0/7 Init:0/1 0 3m57s
hyperscience-frontend-6984bb49c4-g557k 0/2 Init:0/1 0 3m54s
hyperscience-hyperoperator-68f8cfcb57-79wvs 1/1 Running 0 3m54s
hyperscience-init-job-kaxsg-5nhwk 3/3 Running 0 3m49s
trainer-b683d4f1-bmbdq 3/9 CrashLoopBackOff 8 3m49sOnce the init job completes and the backend pod is started hyperoperator will update all needed blocks.
$ kubectl get pod
NAME READY STATUS RESTARTS AGE
hs-block-lambdapython-55c5b997fb-kbz8s 1/1 Running 0 39s
hs-block-lambdapython-77677cd4f6-v5cnk 1/1 Terminating 0 18h
hyperscience-backend-7c7777d9dd-l4nb5 7/7 Running 0 5m22s
hyperscience-frontend-6984bb49c4-g557k 2/2 Running 0 5m19s
hyperscience-hyperoperator-68f8cfcb57-79wvs 1/1 Running 0 5m19s
hyperscience-init-job-kaxsg-5nhwk 0/3 Completed 0 5m14s
trainer-b683d4f1-bmbdq 8/9 Running 22 5m14s