Skip to content

Uninstall an installer installation

guidemaintain-uninstalling-cloud-installer

Remove an installation that the AWS or Google Cloud installer made, keep or delete its data, and delete what stays.

The installer that made the installation also removes it. On AWS, you delete the CloudFormation stack. On Google Cloud, you run teardown.sh in Cloud Shell. By default, both keep the data of Platforma, so a mistake does not delete the results and the projects. The bucket of the primary storageprimary storage — The bucket (Amazon S3 or Google Cloud Storage) or folder where Platforma keeps all results and uploaded files. Glossary, 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 database disk stay until you delete them yourself. For the other installation pathsinstallation path — A set of tools and steps that installs Platforma. There are five installation paths: the AWS installer, the Google Cloud installer, the Terraform modules, the Helm chart and Single Server mode. Glossary, see Uninstall Platforma.

Before you start

  1. Make a backup of the database, and copy it out of the installation: see Make a backup now. The backup files are in the bucket of the primary storage. You can delete this bucket later.

  2. Keep a copy of the master secret in the secret store of the company. Without it, all users 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 after a reinstall, and the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary cannot read the storage keys that a kept database stores for a storage that is no longer in the settings. See What to keep. The AWS stack and the default Google Cloud teardown keep the master secret; keep a copy in case someone deletes it. The Google Cloud teardown that deletes all data also deletes the master secret in Secret Manager: then your copy is the only one.

    Tool: CloudFormation template

    Terminal window
    aws ssm get-parameter --name /<CLUSTER_NAME>/platforma/master-secret \
    --with-decryption --query Parameter.Value --output text > master-secret.txt
  3. Have the rights.

    Tool: CloudFormation template

    The person who deletes the stack needs the three installer policies: see Permissions. Some of their statements also let you delete the parts that stay after the uninstall: LeftLogGroups, KeptVolumes, KeptVolumesRead and KeptMasterSecret.

  4. Google Cloud: use the teardown.sh of the release of the last install.sh run. After an update, this is the release tag of the update. In Cloud Shell, the folder platforma-helm of that run has it; git -C platforma-helm describe --tags shows the release tag.

Remove the installation

Tool: CloudFormation template

The stack always keeps the data of Platforma. There is no option to delete the data with the stack: you delete the kept parts later, when you do not need them.

  1. Write down the bucket. In the CloudFormation console, open the stack and note the output S3BucketOutput: the name of the bucket of the primary storage. The outputs go away with the stack.

  2. Delete the stack. Select the stack and choose Delete. The stack removes these parts: Platforma, the load balancer, the DNS records of the domain, the cluster, the network and the roles. It keeps these parts:

    • the bucket, with the results of all projects and the database backups;
    • the workspace;
    • the database volume, with all projects, and the logs volume;
    • the master secret.

    Result: after about 25 minutes, the status of the stack is DELETE_COMPLETE.

    The log of the delete names the kept volumes. To see their IDs:

    Terminal window
    aws logs filter-log-events --log-group-name /aws/codebuild/<CLUSTER_NAME>-helm-deployer \
    --filter-pattern '"KEPT EBS volume ("' --query 'events[].message' --output text

What stays and how to delete it

The kept parts cost money until you delete them. Delete them only after you copied the backup and the results that you need. The bucket holds the results of all projects and the database backups. The database volume or disk holds all projects.

Tool: CloudFormation template

These parts stay after the stack is deleted:

  • The S3 bucket of the primary storage (S3BucketOutput), with the results of all projects and the database backups.
  • The EFS file system of the workspace, with the name <CLUSTER_NAME>-workspace.
  • The EBS volumes of the database and the logs. Their StorageClass keeps them also when their claims or the namespace are deleted before the stack. The database volume holds all projects.
  • The master secret in Parameter Store, /<CLUSTER_NAME>/platforma/master-secret. A new stack with the same cluster name uses it again.
  • The log groups of the stack: /aws/codebuild/<CLUSTER_NAME>-helm-deployer, /aws/codebuild/<CLUSTER_NAME>-platforma-deployer, /aws/lambda/<CLUSTER_NAME>-helm-trigger, and with GPU nodes (EnableGpu) also /aws/lambda/<CLUSTER_NAME>-gpu-subnet-resolver.
  • The DNS validation record of the certificate: a CNAME record in the hosted zone of the domain. Its name starts with _ and its value ends with acm-validations.aws.

To delete them with the AWS CLI, replace the values in angle brackets:

Terminal window
# Empty and delete the bucket. This deletes the results of all projects and the database backups.
aws s3 rb s3://<BUCKET_NAME> --force
# Find and delete the volumes of the database and the logs. This deletes all projects.
aws ec2 describe-volumes \
--filters Name=status,Values=available Name=tag:ebs.csi.aws.com/cluster-name,Values=<CLUSTER_NAME> \
--query "Volumes[].[VolumeId,Size,Tags[?Key=='kubernetes.io/created-for/pvc/name'].Value|[0]]" \
--output table
aws ec2 delete-volume --volume-id <VOLUME_ID>
# Delete the master secret, only together with the database volume.
aws ssm delete-parameter --name /<CLUSTER_NAME>/platforma/master-secret
# Find and delete the file system of the workspace.
aws efs describe-file-systems \
--query "FileSystems[?Name=='<CLUSTER_NAME>-workspace'].FileSystemId" --output text
aws efs delete-file-system --file-system-id <FILE_SYSTEM_ID>
# Delete the log groups. Without GPU nodes, the last one does not exist.
for g in /aws/codebuild/<CLUSTER_NAME>-helm-deployer /aws/codebuild/<CLUSTER_NAME>-platforma-deployer \
/aws/lambda/<CLUSTER_NAME>-helm-trigger /aws/lambda/<CLUSTER_NAME>-gpu-subnet-resolver; do
aws logs delete-log-group --log-group-name "$g"
done

To delete the validation record, open the hosted zone in the Route 53 console, select the CNAME record of the certificate and choose Delete record.

Install again with the same names

The installers do not attach kept data to a new installation: a new installation starts with new, empty storage. To use the kept bucket, workspace and database disk again, install with 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: see Kept data and reuse.

Tool: CloudFormation template

A new stack with the same cluster name uses the kept master secret. It makes a new bucket, a new file system and new volumes, and the kept ones stay until you delete them.

Next