Skip to content

Upgrade Platforma

guidemaintain-upgrading

Install a new version of the Backend, and return to the old version if the upgrade causes problems.

An upgrade replaces the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary with a new version, while your projects and results stay where they are. Jobsjob — One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster. Glossary that run in the cluster continue, and the Desktop AppDesktop App — The program that each user installs on their own computer to work with Platforma. It is a client of the Backend. Glossary connects again by itself after a short break.

The new version can change the format of the database when it starts for the first time. An older version cannot start on that database again. So a fresh backup and the name of the old version are your way back: you get both in the steps before the upgrade.

Upgrade to the most recent release: you can go to it directly from any older version, and you do not need to install the versions between them. Only the most recent release gets fixes. See Supported versions.

Before the upgrade

  1. Read what changes. Read the release notes of the new version, and of each version that you skip: a major version can change the configuration. Check whether it needs a newer Desktop App: if it does, plan to upgrade the Desktop App on the computers of the users at the same time. The Desktop App and the Backend have their own versions.

  2. Write down the version that runs now. You need it to go back.

    Tool: CloudFormation template

    Terminal window
    kubectl get deployment platforma -n platforma \
    -o jsonpath='{.spec.template.spec.containers[?(@.name=="platforma")].image}{"\n"}{.metadata.labels.helm\.sh/chart}{"\n"}'

    Result: the image, for example quay.io/milaboratories/platforma:4.7.0, and the chart, for example platforma-4.7.0: the chart version is 4.7.0.

    Also save the template of the stack. You need it to go back:

    Terminal window
    aws cloudformation get-template --stack-name <stack-name> \
    --query TemplateBody --output text > template-before-upgrade.yaml
  3. Check that the installation is healthy. Do not start an upgrade on an installation that already has problems: after the upgrade, you cannot tell which problems the upgrade caused. Connect with the Desktop App, open a project, and check that its results are there. Then check the Backend:

    Tool: CloudFormation template

    Terminal window
    kubectl get pods -n platforma -l app.kubernetes.io/instance=platforma
    kubectl get pods -n kueue-system
    kubectl get pods -n appwrapper-system

    Result: all pods are Running, with no recent restarts.

  4. Tell the users. The Backend restarts during the upgrade, and the Desktop App loses its connection for a short time. Choose a time when few people work.

  5. Make a fresh backup. Follow Make a backup now, and copy the backup out of the installation. Keep it until you are sure that the new version works well.

Upgrade

Tool: CloudFormation template

Update the stack with a change set from the template of the new release: see Upgrade to a new version on the page “Update an installer installation”.

After the upgrade

  1. The Backend runs. The first start after an upgrade can take longer, because the Backend converts the database to the new format. Do not restart the Backend during this time.

    The same rule applies on all paths when the conversion stops, for example when an apply or a stack update fails, or the server restarts. Do not deploy the old version: it does not start on a converted database. Start the new version again, and the conversion continues from the last step that it finished.

    Tool: CloudFormation template

    Terminal window
    kubectl get pods -n platforma -l app.kubernetes.io/instance=platforma

    Result: the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary pod is Running and Ready.

    If the pod does not become Ready, read its recent output. This output shows only the failures at start. The full log is in /var/log/platforma in the Backend container.

    Terminal window
    kubectl logs deployment/platforma -n platforma -c platforma --tail=50
  2. The Backend has the new version. Run the command from Before the upgrade, step 2, again.

  3. Your projects are there. In the Desktop App, open an existing project and check its results.

  4. Jobs run. Run a small BlockBlock — A small application for one step of an analysis, for example the import of reads or clustering. It can combine several tools. Glossary and check that its job starts and finishes.

Go back to the old version

Contact MiLaboratories support first. Go back to the old version only when support cannot fix the problem quickly, because the database returns to the state of the backup:

  • All changes that users made after the backup are lost. Results made after the backup stay in the storage, but no project refers to them.
  • Some results that existed at the time of the backup can be gone, because the new version can delete them. Run their Blocks again, or get the files back with the versioning or soft delete of the bucket.
  1. Restore the backup.

    Tool: CloudFormation template

    Follow Restore up to the step “Start the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary”. In the restore pod, use the old image that you wrote down before the upgrade.

  2. Deploy the old version. This also starts the Backend.

    Tool: CloudFormation template

    Update the stack with the template that you saved before the upgrade, template-before-upgrade.yaml. In the console, select Update, then Replace existing template, then Upload a template file. Check that the parameter PlatformaVersion is the chart version that you wrote down.

  3. Check the old version with the steps of After the upgrade.

Upgrade the nodes

A job fails when its node stops. Upgrade the nodes of the Platforma pools when no job runs. In a cluster without an autoscaler, after a change of the nodes of a job pool, apply platforma-tf-services-cluster again, so that the quotas match the new nodes.

Next