Update an installer installation
Upgrade an installation that the AWS or Google Cloud installer made to a new version, or change its settings, with the same installer.
The installer that made the installation also updates it: to a new version of Platforma, or
to new settings. You give it all parameters of the installation again, so the installation
stays the same except for what you change. On AWS, the stack keeps the parameters, and a
change set shows what the update will change before it starts. On Google Cloud, you run
install.sh again with the answers that you saved at the installation (see
Steps). The database, the workspaceworkspace — The storage where the Backend and all jobs keep the working files of running jobs. The Backend and the jobs use it at the same time. In Kubernetes, it is a network file system; in Single Server mode, it is a folder on the server. Glossary and the results stay.
For an upgrade, this page replaces only the step “Upgrade” of Upgrade Platforma: do the steps before and after the upgrade there.
Before you start
-
For an upgrade, do the steps of Before the upgrade: read the release notes, write down the version that runs now, check the health of the installation, tell the users and make a fresh backup.
-
Have the parameters of the installation.
Tool: CloudFormation template
The stack keeps all parameters. Have the values of the secret parameters in case you change them: the stack shows
****for them. A changed secret value also needs a largerSecretsRevision. See the last step of the installation in Steps.Tool: install.sh in Cloud Shell
Have the file of the answers that you saved at the installation, for example
platforma-answers.sh. The installer does not keep the answers: each run sends all of them again. If you do not have the file, write it again with the same values: the samePROJECT_ID,DEPLOYMENT_NAMEandIM_LOCATION, the same sign-in providerssign-in provider — A configured way for users to sign in to the Backend: single sign-on (SSO), LDAP or a static list of users. One Backend can have more than one. Glossary and the full list of data librariesdata library — A folder or bucket with input data of the company. Users select files from it in the Desktop App. Platforma only reads it. Glossary. See the last step of the installation in Steps. -
Have the rights of the installation. An update needs the same rights as the installation: see Permissions. On Google Cloud, each run of
install.shneeds the roleroles/config.admin(Infrastructure Manager Admin). On AWS, the steps withkubectlalso need an EKS access entry: see Change a secret. The installer checks its permissions first. When one is missing, it stops before it changes anything and shows the command that grants the role.
Upgrade to a new version
Tool: CloudFormation template
A new release has a new template at the same address. The template holds the version of the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary, and the versions of the cluster services (KueueKueue — A Kubernetes add-on that holds jobs in a queue until the cluster has free CPU, memory and GPU for them. Glossary, AppWrapperAppWrapper — A Kubernetes add-on that wraps the pods of one job into a single unit, so that Kueue admits and starts them together. Glossary, Cluster Autoscaler, the load balancer controller and External DNS). With a change set, you see what the update changes before it starts.
-
Create a change set. In the CloudFormation console, select the stack and choose Stack actions → Create change set for current stack. Choose Replace current template → Amazon S3 URL, and paste the same template URL as for the installation: it always gives the last release.
https://platforma-cloudformation.s3.eu-central-1.amazonaws.com/cloudformation-eks-1-35.yaml -
Keep the parameters. CloudFormation shows the current values: change only what you want to change. The secret parameters show
****and keep their values. WhenPlatformaVersionhas a value, clear it: a fixed version stays after the update, and an empty one gives the version of the new template. -
Accept and create. Keep the stack options, accept that the stack makes IAM resources, and choose Submit. Result: the change set has the status
CREATE_COMPLETE. -
Review the changes on the tab Changes. Each line is a resource, with its action and whether CloudFormation replaces it:
TriggerPlatformaDeploywith the action Modify: the Backend gets the new version.TriggerHelmDeploywith Modify: the cluster services get new versions.- A node group (
NodeGroupin the name, for exampleSystemNodeGroupV5) with the action Modify, Add or Remove: its nodes are replaced or removed, and the jobsjob — One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster. Glossary on them fail. Execute the change set when no job runs. - Replacement
Truefor the cluster (EksCluster), the network (Vpc, the subnets), the bucket (S3Bucket) or the file system (EfsFileSystem): do not execute the change set. Delete it and contact MiLaboratories support.
-
Execute the change set. Choose Execute change set. Result: the status of the stack is
UPDATE_COMPLETE.
To get each new version of the Backend, create a change set with this template again. Then do the checks of After the upgrade.
Tool: install.sh in Cloud Shell
The release tag of platforma-helm sets the version: the installer deploys the chart platforma
from the folder that you run it from, and the app version of this chart is the version of the
Backend. The installer does not show the changes before it applies them. A new release can change
the node pools of the cluster, and a job fails when its node stops. So run the upgrade when no job
runs.
-
Get the new release. In Cloud Shell, select the project of the installation. In the folder
platforma-helmof the installation, check out the new release tag:Terminal window gcloud config set project <project>cd platforma-helmgit fetch --tagsgit checkout <new release tag>cd infrastructure/gcp/cloudshellWhen the folder is not there any more, clone the new tag as in the installation steps.
-
Run the installer with the saved answers:
Terminal window source platforma-answers.shbash install.shThe installer does not ask the answers that the file sets. When it asks a question, the file does not have that answer: give the value of the installation, and add it to the file.
-
Check the review and confirm. The line
Source:shows the new release tag.Project,Deploymentsand the IM location must be those of the installation: with other values, the installer makes a second installation. Answery. The installer updates the deployments<name>-infraand<name>-platformawith new revisions. Result: the installer showsDone.
Then do the checks of After the upgrade.
Change settings
To change a setting, run the update with the new value and all other values as before. The
Configuration pages describe the Terraform modulesTerraform modules — The Terraform code that MiLaboratories provides to install Platforma. The cloud-specific Terraform modules make the cluster and its cloud parts in AWS or Google Cloud; the cloud-agnostic Terraform modules install Platforma into the cluster. Glossary, the Helm chart platforma-backend and Single
Server mode: for the AWS parameter and the Google Cloud variable of each setting, see
Settings and their parameters.
Tool: CloudFormation template
- In the CloudFormation console, select the stack and choose Stack actions → Create change set for current stack → Use current template.
- Change only the parameters that you want to change: CloudFormation keeps the values of all
others. When you change a secret parameter, also set
SecretsRevisionto a larger number. Accept that the stack makes IAM resources, and choose Submit. - Review the changes, as in Upgrade to a new version, step 4, and
execute the change set. Result: the status of the stack is
UPDATE_COMPLETE.
To get a new version of Platforma at the same time, choose Replace current template instead: see Upgrade to a new version.
Tool: install.sh in Cloud Shell
- In Cloud Shell, go to the folder of the installer from the installation:
cd platforma-helm/infrastructure/gcp/cloudshell. Keep the release tag of the installation; to change the version at the same time, see Upgrade to a new version. - Change the value in the file of the saved answers, for example
export DEPLOYMENT_SIZE=medium, and load the file:source platforma-answers.sh. - Run
bash install.sh, check the review as in Upgrade to a new version, step 3, and confirm. Result: the installer showsDone.
Before you change a setting, know these effects:
- Secret parameters (AWS). The stack keeps the values of the secret parameters in Secrets
Manager, and the deployer of Platforma does not get them. Thus a change of a secret value alone
does not apply it. In the same update, set
SecretsRevisionto a larger number: for example, from1to2. The secret parameters areLicenseKey,HtpasswdContent,LdapSearchPassword,GoogleClientSecret, and the access keys and secret keys of the data libraries. For each secret, see Change a secret. - Data libraries. Give the full list each time. The installer removes the libraries that you leave out. To remove a library that projects use, see Remove a data library.
- Sign-in providers. When you add or remove a provider, all users must sign insign in — To show the Backend who you are, with a sign-in provider or a single-user token. The verb is "sign in"; the noun and the adjective are "sign-in". Glossary again one time. To move users from one provider to another, see Migrate between sign-in providers.
- Deployment size. On Google Cloud, a larger size makes new quota requests.
- Settings that make new infrastructure. On AWS:
ClusterName,PlatformaNamespace, the VPC and subnet parameters,S3BucketNameandSystemNodeAZ. On Google Cloud:REGIONandZONE_SUFFIX. A change of these settings replaces the cluster, the storage or the disks of the Backend: treat it as a new installation. On Google Cloud, a newDEPLOYMENT_NAME,PROJECT_IDorIM_LOCATIONmakes a second installation.
Change a secret
Change a secret with the installer that made the installation, not with kubectl alone. The next
run of the installer writes its own values into the Secrets again. For the master secret, which
signs out all users, see Change the master secret.
Make the new key before you remove the old one. Keep the old key valid until the check is complete: at the identity provider, in the cloud of a data library or at the license service. Then remove the old key. A restart of the Backend is a short outage: see Restart of the Backend.
Tool: CloudFormation template
The stack keeps the secret parameters in AWS Secrets Manager, and the passwords that it makes in
Parameter Store. The commands use the namespace platforma: with another PlatformaNamespace, use its value.
| Secret | Where you change it | KubernetesKubernetes — A system that runs programs on a group of machines (a cluster). Platforma can run in a Kubernetes cluster. Glossary Secret | Restart of the Backend |
|---|---|---|---|
| License key | Parameter LicenseKey | platforma-license | Do step 3 |
| Static list of usersstatic list of users — A sign-in provider that is a file with the logins and the password hashes of the users, in the htpasswd format. The Backend reads it again when it changes. Glossary | Parameter HtpasswdContent | platforma-htpasswd | Not necessary: the Backend reads the list again in 1 to 2 minutes |
Password of the login platforma (administrator) | Parameter Store, /<ClusterName>/platforma/admin-password | platforma-admin-htpasswd | Not necessary |
Password of the list that the stack made when HtpasswdContent is empty | Parameter Store, /<ClusterName>/platforma/users-password | platforma-htpasswd | Not necessary |
| LDAPLDAP — The directory of users of a company. The Backend can check logins and passwords in it. Glossary search password | Parameter LdapSearchPassword | — | The stack update restarts the Backend |
| Google client secret | Parameter GoogleClientSecret | platforma-sso-client-secret | Do step 3 |
| Keys of data library N (1 to 3) | Parameters DataLibrary<N>AccessKey and DataLibrary<N>SecretKey | platforma-library-<N>-creds | Do step 3 |
-
For a password in Parameter Store only, write the new value. Use the
ClusterNameand theRegionof the stack:Terminal window aws ssm put-parameter --name "/<ClusterName>/platforma/admin-password" \--type SecureString --overwrite --region <Region> --value '<new password>'For the other list, use
/<ClusterName>/platforma/users-password. -
Update the stack with the current template. Follow Change settings. Give the new value of each secret parameter that you change. Set
SecretsRevisionto a larger number than its value in the Parameters tab of the stack, for example from1to2. Without a largerSecretsRevision, the stack does not give the new value to the Backend. Result: the status of the stack isUPDATE_COMPLETE. -
Restart the Backend when the table says so. The
kubectlcommands need an EKS access entry for your IAM principal: see Access to the cluster.Terminal window aws eks update-kubeconfig --name <ClusterName> --region <Region>kubectl rollout restart --namespace platforma deployment/platformakubectl rollout status --namespace platforma deployment/platformaResult:
deployment "platforma" successfully rolled out. -
Check that the Backend uses the new value. See Check the change.
Access to the cluster
The kubectl commands work only for an IAM principal with an EKS access entry of the cluster. The
stack gives an access entry with the administrator rights of the cluster to the principal that
created the stack. Another operatoroperator — The person who installs and runs Platforma in your company, for example an IT engineer or a bioinformatician. Glossary makes an access entry for their own IAM role, with the rights of
the installation (see Permissions). This entry gives the role administrator
rights in the namespace platforma only:
aws eks create-access-entry --cluster-name <ClusterName> --region <Region> \ --principal-arn arn:aws:iam::<ACCOUNT_ID>:role/<role name>aws eks associate-access-policy --cluster-name <ClusterName> --region <Region> \ --principal-arn arn:aws:iam::<ACCOUNT_ID>:role/<role name> \ --policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSAdminPolicy \ --access-scope type=namespace,namespaces=platformaUse the ARN of the IAM role, not the assumed-role ARN that aws sts get-caller-identity shows.
You can keep the static list of users yourself: the Secret platforma-htpasswd, with an empty parameter
HtpasswdContent. The stack does not change such a Secret, so replace it with kubectl. See Static list of users.
Tool: install.sh in Cloud Shell
The installer keeps each secret in Google Secret Manager. When a value changes, it adds a new version, writes the Kubernetes Secret again and restarts the Backend by itself.
| Secret | Where you change it | Kubernetes Secret |
|---|---|---|
| License key | LICENSE_KEY in the file of answers | platforma-license |
| Static list of users | HTPASSWD_FILE (the path of the new file) or HTPASSWD_CONTENT, with ENABLE_LOCAL_USERS=true | platforma-htpasswd-provided |
Password of the login platforma (administrator) | Secret Manager, <DEPLOYMENT_NAME>-cluster-admin-password | platforma-admin-htpasswd |
| LDAP search password | LDAP_SEARCH_PASSWORD | platforma-ldap-search-password |
| Google client secret | GOOGLE_CLIENT_SECRET | platforma-sso-client-secret |
| Keys of an S3 data library | LIB_<N>_ACCESS_KEY and LIB_<N>_SECRET_KEY, or access_key and secret_key in DATA_LIBRARIES_JSON | platforma-datasource-<library name> |
Change the values in the file of answers, not in Secret Manager: each run writes the values of the answers into Secret Manager again. The administrator password is the exception: it is not an answer.
-
In Cloud Shell, go to the folder of the installer of the installation:
cd platforma-helm/infrastructure/gcp/cloudshell. Keep the release tag of the installation. -
Put the new value in place. For an answer, change its line in the file of answers, for example
export LICENSE_KEY=<new license key>. For the administrator password, add a new version in Secret Manager:Terminal window printf '%s' '<new password>' | gcloud secrets versions add <DEPLOYMENT_NAME>-cluster-admin-password \--project=<PROJECT_ID> --data-file=- -
Run the installer with the saved answers:
Terminal window source platforma-answers.shbash install.shFor each changed answer, the installer shows
Stored <name> in Secret Manager.before the review. For the administrator password, it shows<DEPLOYMENT_NAME>-cluster-admin-password in Secret Manager is up to date.: you added the version in step 2. Check the review and confirm. Then the installer showsKubernetes Secret <name> updated.for each changed Secret. Result: the installer showsDone.The installer does not show a line about the restart of the Backend. The Backend starts again in about 1 minute. Check 2 of Check the change shows it.
-
Check that the Backend uses the new value. See Check the change.
When you answer n at the review, the new versions stay in Secret Manager. The next run of the
installer applies them.
Check the change
Connect kubectl to the cluster. On AWS:
aws eks update-kubeconfig --name <ClusterName> --region <Region>. On Google Cloud:
gcloud container clusters get-credentials <DEPLOYMENT_NAME>-cluster --location=<REGION>-<ZONE_SUFFIX> --project=<PROJECT_ID>.
Then do these checks:
-
The Kubernetes Secret holds the new value. Do this check for keys only. A Secret with a password holds a hash, so check a password when you sign in (check 3). For example, for the license key:
Terminal window kubectl get secret platforma-license --namespace platforma \-o jsonpath='{.data.MI_LICENSE}' | base64 -d; echoFor the other Secrets, use the key of the Secret:
client-secret,password(the LDAP search password),access-keyorsecret-key. -
The Backend started after the change, where a restart is necessary. The
AGEof its pod is shorter than the time since the change:Terminal window kubectl get pods --namespace platforma \-l app.kubernetes.io/name=platforma,app.kubernetes.io/instance=platforma -
The function works with the new value:
- license key:
kubectl logs --namespace platforma deployment/platforma | grep "License is OK"shows the line; - a password or a sign-in secret: sign in with 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 as a user of that sign-in
provider. For example, use the login
platformawith the new administrator password; - keys of a data library: in the Desktop App, add a dataset from the library and see its files.
- license key:
When the check is complete, remove the old key at its source.
What an update keeps and restarts
An update keeps the data and the secrets of the installation: the database, the workspace, the
primary storageprimary storage — The bucket (Amazon S3 or Google Cloud Storage) or folder where Platforma keeps all results and uploaded files. Glossary with the results, the master secret, and the passwords that the installer made. On
AWS, these passwords are in Parameter Store, under /<ClusterName>/platforma/. On Google Cloud,
they are in Secret Manager.
The Backend restarts only when its version or its values change: the old Backend stops, then the new one starts. The Desktop App loses its connection for a short time and connects again by itself, and jobs that run in the cluster continue.
Tool: CloudFormation template
The stack installs Platforma again only when the version or a parameter of Platforma changes: an
update with the same values does not change Platforma. A changed secret parameter is an exception:
the stack applies it only when SecretsRevision also gets a larger number (see
Change settings). When the template has new versions of the
cluster services, or other node groups, the stack also installs the cluster services again. A
change of the infrastructure parameters changes only the infrastructure.
Tool: install.sh in Cloud Shell
Each run applies both deployments, <name>-infra and then <name>-platforma, and Terraform
changes only what differs from the last revision. Between the two deployments, the installer
writes the Kubernetes Secrets from Secret Manager, and shows created, updated or unchanged
for each Secret.
The installer adds a new version of a secret in Secret Manager only when the value is different. A new version restarts the Backend; with the same values, the Backend does not restart. To change a secret, see Change a secret.
The installer uses the master secret that is in Secret Manager. Do not set MASTER_SECRET on an
update: a new value replaces the master secret, and all users sign in again. To change the master
secret on purpose, see Change the master secret.
After an update, keep the folder of the new release. To uninstall later, use the teardown.sh of
this release: the teardown must have the release of the last install.sh run. See
Uninstall an installer installation.
When the update fails
Tool: CloudFormation template
The stack waits 15 minutes until the new Backend is ready. If it is not, Helm deploys the old
version again, and CloudFormation rolls back the update of the stack to the old template and
parameters. Result: the status of the stack is UPDATE_ROLLBACK_COMPLETE. The events of the stack
name the failed resource, and the log of the CodeBuild project <ClusterName>-platforma-deployer
gives the reason.
Tool: install.sh in Cloud Shell
The installer waits up to 30 minutes until the new Backend is ready. If it is not, the deployment
has the state FAILED, and the installer shows the command that describes it. The installer does
not go back to the old version: the new Backend continues to start. Its revision in
Infrastructure Manager shows the error.
Fix the cause, then run bash install.sh again with the same answers: it updates the failed
deployment. When the Backend was converting a large database, the conversion continues from the
last step that it finished. When the installer says that the deployment is busy, wait until
Infrastructure Manager finishes, then run it again.
To go back to the old version, see Go back to the old version.