Uninstall Platforma
How do I remove Platforma, and what stays?
The removal deletes the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary and the parts that the installation made. The installers, 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 and the Helm chart keep the results and the database. Thus a mistake does not delete them: you delete them later, on purpose. In Single Server modeSingle Server mode — The mode in which the Backend and all its jobs run on one Linux machine, the server, with no Kubernetes cluster. Glossary, you delete the data folder yourself, as the last step. In each case, make a backup first.
Before you remove Platforma
-
Make a backup of the database: see Make a backup now. Copy it out of the installation: the backup files are in the primary storageprimary storage — The bucket (Amazon S3 or Google Cloud Storage) or folder where Platforma keeps all results and uploaded files. Glossary.
-
Keep the master secret outside the installation: without it, a kept database cannot read the credentials that it stores. See What to keep.
-
Write down the storage of the installation, when a new installation will use it again: see Kept data and reuse.
Remove Platforma
Tool: CloudFormation template
Delete the CloudFormation stack. The stack removes Platforma, the cluster and the network. It keeps these parts, and you delete them later, when you do not need them:
- the bucket of the primary storage, with the results of all projects and the database backups;
- 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;
- the volumes of the database (all projects) and the logs;
- the master secret.
For the steps, the rights, what stays and the commands that delete it, see Uninstall an installer installation.
Tool: install.sh in Cloud Shell
Run teardown.sh of the release of the last install.sh run. By default, it keeps the bucket of
the primary storage, the workspace, the database disk and the VPC network. With
DELETE_ALL_DATA=true, it also deletes them: the results of all projects, the database backups
and all projects. The default mode needs the role roles/config.admin and the permission
compute.disks.setLabels: the script checks them before it changes anything.
For the steps, the rights, what stays and the commands that delete it, see Uninstall an installer installation.
Tool: platforma-tf-* modules (cloud and cloud-agnostic)
Remove the roots in the reverse order of the installation: services, then cluster, then
cloud. The commands use the folders of the reference setup in the clone of
platforma-install. For a cluster that
exists, run terraform destroy in your folders services and cluster, and skip step 4.
<cloud> is aws or gcp.
Give each destroy the same -var-file and -var options as the apply of its root. The destroy
checks the input values too, and the defaults do not pass the checks. <values file> is the file
with the values of the root, terraform.tfvars in the
install guide. When the apply had -var aws_profile=<profile>, add it
to the destroy too.
-
Make a backup and write down the storage of the installation (see Before you remove Platforma).
-
Destroy the root
services. This removes the Backend.Terminal window cd <platforma-install>/terraform/cloud-agnostic/examples/servicesterraform destroy -var-file=<values file> \-var infrastructure_file=../../../<cloud>/examples/handoff/infrastructure.json \-var cluster_connection_file=../../../<cloud>/examples/handoff/cluster-connection.json -
Destroy the root
cluster. This removes 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 and the other parts of Platforma in the cluster.Terminal window cd <platforma-install>/terraform/<cloud>/examples/clusterterraform destroyThe destroy can take up to about 30 minutes: it waits until the namespaces of Platforma are gone. They stay in the state
Terminatinguntil the load balancer controller of the cloud deletes its cloud objects, some minutes after step 2. If the destroy stops withtimeout while waiting for resource to be gone, run the same destroy again. -
Destroy the root
cloud. Only for AWS and Google Cloud. The modules protect the bucket and the workspace against removal. Thus, first take them out of the Terraform state: they stay in the cloud, with the data. Then destroy the rest.Terminal window cd <platforma-install>/terraform/aws/examples/cloudterraform state rm \'module.cloud_base.aws_s3_bucket.primary[0]' \'module.cloud_base.aws_s3_bucket_ownership_controls.primary[0]' \'module.cloud_base.aws_s3_bucket_public_access_block.primary[0]' \'module.cloud_base.aws_s3_bucket_server_side_encryption_configuration.primary[0]' \'module.cloud_base.aws_s3_bucket_lifecycle_configuration.primary[0]' \'module.cloud_base.aws_s3_bucket_policy.primary[0]' \'module.cloud_base.aws_efs_file_system.workspace[0]'terraform destroy -var-file=<values file>Terminal window cd <platforma-install>/terraform/gcp/examples/cloudterraform state rm 'module.cloud_base.google_storage_bucket.primary[0]' \'module.cloud_base.google_filestore_instance.workspace[0]'terraform destroy -var-file=<values file>
For what stays and how to delete it, see What stays.
Tool: platforma-backend
Make a backup first (see Before you remove Platforma). Then remove the Backend:
helm uninstall platforma -n platformaThe team that runs the cluster then removes the parts that it made for Platforma, for example Kueue and AppWrapper. The chart never made the Secrets, so they stay.
Tool: platforma binary
-
Make a backup (see Before you remove Platforma), and copy
/etc/platformato a safe place. It holds the master secret and the license key inplatforma.env, the file of the 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 and the private key of the certificate. -
Stop the Backend and remove the service:
Terminal window sudo systemctl disable --now platformasudo rm /etc/systemd/system/platforma.servicesudo systemctl daemon-reload -
Remove the program and its settings:
Terminal window sudo rm -rf /opt/platforma /etc/platforma -
Delete the data folder last.
/data/platformaholds the database, the logs, the workspace and, when the primary storage is a folder, the results of all projects. Delete it only after you copied the backup and the results that you need. When the primary storage is a bucket, the bucket stays.Terminal window sudo rm -rf /data/platformasudo userdel platforma
What stays
-
AWS installer: the bucket, the workspace, the volumes of the database and the logs, and the master secret. The log groups of the stack and the DNS validation record also stay.
-
Google Cloud installer: by default, the bucket, the workspace, the database disk and the VPC network. After a teardown with
DELETE_ALL_DATA=true, no data stays. After each teardown, the master secret, the service account of the installer and the Cloud DNS zone stay.For the installers, see What stays and how to delete it.
-
Terraform modules: the bucket of the primary storage, the workspace and the database volume, whose reclaim policy is
Retain. The logs volume stays only withdisks.logs.reclaim_policy = "Retain"; the default isDelete, and a new installation works the same with a new, empty logs volume. On Google Cloud, a kept Filestore instance works again only when the network of the installation is kept too. On AWS, the image caches also stay: the ECR repositories<name>-software/milaboratories/pl-containersand<name>-backend/milaboratories/platforma, which ECR made at the first pull of an image. Delete them withaws ecr delete-repository --repository-name <repository> --force. -
Helm chart: the claims of the database, the logs and the workspace (
helm.sh/resource-policy: keep), and the volumes that they hold. A new installation with the same release name in the same namespace gets the same data. When you delete the claims, the reclaim policy of their StorageClass decides whether the volumes are deleted too. -
Single Server mode: what you do not delete in the steps; a bucket of the primary storage always stays.
To use the kept data again, see Kept data and reuse.
To delete it, delete the bucket, the file system and the volumes in the console of the cloud. Do
this only after you copied the backup and the results that you need. The bucket holds the results
of all projects, and the database volume holds all projects. With the Terraform modules on AWS, find the volumes by
the tag platforma-installation:
aws ec2 describe-volumes --filters Name=tag:platforma-installation,Values=<name> \ --query 'Volumes[].[VolumeId,Tags[?Key==`platforma-component`].Value|[0]]' --output textaws ec2 delete-volume --volume-id <VOLUME_ID>