Uninstall an installer installation
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
-
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.
-
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.txtTool: install.sh in Cloud Shell
Terminal window gcloud secrets versions access latest --project=<PROJECT_ID> \--secret=<DEPLOYMENT_NAME>-cluster-platforma-master-secret > master-secret.txt -
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,KeptVolumesReadandKeptMasterSecret.Tool: install.sh in Cloud Shell
The person who runs
teardown.shneeds the roles of the installation and the twocontainerroles: see Permissions. Each teardown needs the roleroles/config.admin(Infrastructure Manager Admin) to delete the deployments. The default teardown keeps the data, and for this it needs:- from
roles/config.admin, on the project or on the deployment<DEPLOYMENT_NAME>-infra, the permissionsconfig.deployments.lock,getLock,getState,updateStateandunlock. With them, the script takes the kept data out of the Terraform state of the deployment; - the permission
compute.disks.setLabelson the project, for example in the roleroles/compute.storageAdmin, to put labels on the kept database disk.
In the default mode,
teardown.shchecks these rights before it changes anything. When one is missing, it stops and shows the command that grants the role. The teardown that deletes all data does not check them first, and it does not need the state permissions orcompute.disks.setLabels. It deletes the Secret Manager secrets of the installation: for this, it uses the roleroles/secretmanager.admin, which the installation also needs. - from
-
Google Cloud: use the
teardown.shof the release of the lastinstall.shrun. After an update, this is the release tag of the update. In Cloud Shell, the folderplatforma-helmof that run has it;git -C platforma-helm describe --tagsshows 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.
-
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. -
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
Tool: install.sh in Cloud Shell
teardown.sh has two modes:
- Keep the data (the default). The script keeps the bucket of the primary storage, the Filestore instance of the workspace with its VPC network, the database disk, and the secrets of the installation in Secret Manager. It deletes all other parts, also the logs disk.
- Delete all data:
DELETE_ALL_DATA=trueor the flag--delete-all-data. The script also deletes the bucket, with the results of all projects and the database backups. It deletes the workspace, the database disk with all projects, the VPC network, and the secrets in Secret Manager, also the master secret. You cannot get them back.
-
Open the folder of the installer and load the answers. In Cloud Shell, go to the folder of the release of the last
install.shrun, and load the answers that you saved at the installation. The script usesPROJECT_ID,DEPLOYMENT_NAMEandIM_LOCATION. Their defaults are the project ofgcloud,platformaandeurope-west1.Terminal window cd platforma-helm/infrastructure/gcp/cloudshellsource platforma-answers.sh -
Run the teardown in the mode that you need:
Terminal window # Keep the databash teardown.sh# Delete all data: the results of all projects, the database backups, all projects# and the secrets in Secret Manager, also the master secretDELETE_ALL_DATA=true bash teardown.shThe script shows what it deletes and what it keeps. Then it asks you to type
delete <DEPLOYMENT_NAME> from <PROJECT_ID>. The script stops the Backend and deletes the deployment<DEPLOYMENT_NAME>-platforma. Then it deletes the deployment<DEPLOYMENT_NAME>-infra: the cluster, the network of the nodes, Cloud NAT, the service accounts, the certificate and the DNS record. Each deployment takes about 10 minutes.Result: the script shows
Teardown complete: the customer data is kept, with the names of the kept parts and the commands that delete them. In the other mode, it showsTeardown complete: all data is deleted. Save this output.If Cloud Shell disconnects, run the script again. Do not delete the deployments in Infrastructure Manager directly. Such a delete stops on the disks of Platforma, and it deletes the workspace.
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
CNAMErecord in the hosted zone of the domain. Its name starts with_and its value ends withacm-validations.aws.
To delete them with the AWS CLI, replace the values in angle brackets:
# 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 tableaws 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 textaws 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"doneTo delete the validation record, open the hosted zone in the Route 53 console, select the CNAME
record of the certificate and choose Delete record.
Tool: install.sh in Cloud Shell
After a teardown that keeps the data, these parts stay. <name> is DEPLOYMENT_NAME:
- The bucket of the primary storage,
platforma-<name>-cluster-<suffix>, with the results of all projects and the database backups. - The Filestore instance of the workspace,
<name>-cluster-workspace. - The database disk, with all projects. It has the labels
platforma-installation=<name>-clusterandplatforma-component=database. - The VPC network
<prefix>-vpc, with its private service access range<prefix>-vpc-psaand the peering: the Filestore instance needs them.<prefix>isRESOURCE_NAME_PREFIX, by defaultplatforma. - The secrets of the installation in Secret Manager,
<name>-cluster-*: the master secret, the administrator password, the license key, and the sign-in secrets and data librarydata 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 keys that you gave. For the full list, see How secrets are handled. A new installation with the sameDEPLOYMENT_NAMEuses the master secret and the administrator password again. Delete the master secret only together with the database disk.
After each teardown, also after the one that deletes all data, these parts stay:
- the service account
platforma-im-deployer, with the Owner role on the project. All installations in the project share it: keep it while another installation in the project uses it; - the Cloud DNS zone of the domain, which the installer did not make.
To delete the kept data later, run the teardown again in the mode that deletes all data. Use the
same folder and the same answers. The script finds the kept parts by their names and labels,
deletes them and checks that they are gone. This deletes the results of all projects, the database
backups, all projects and the secrets in Secret Manager, also the master secret. It needs these
roles, or Owner: roles/file.editor, roles/compute.storageAdmin, roles/compute.networkAdmin,
roles/servicenetworking.networksAdmin and roles/secretmanager.admin.
source platforma-answers.shDELETE_ALL_DATA=true bash teardown.shOr delete the parts one by one, with the commands that the teardown showed at its end:
gcloud storage rm -r gs://<BUCKET_NAME> --project=<PROJECT_ID>gcloud filestore instances delete <name>-cluster-workspace --location=<ZONE> --project=<PROJECT_ID>gcloud compute disks list --project=<PROJECT_ID> \ --filter="labels.platforma-installation=<name>-cluster AND labels.platforma-component=database"gcloud compute disks delete <DISK_NAME> --zone=<ZONE> --project=<PROJECT_ID>
# After the Filestore instance is deleted:gcloud services vpc-peerings delete --network=<prefix>-vpc \ --service=servicenetworking.googleapis.com --project=<PROJECT_ID>gcloud compute addresses delete <prefix>-vpc-psa --global --project=<PROJECT_ID>gcloud compute networks delete <prefix>-vpc --project=<PROJECT_ID>
# Find and delete the secrets of the installation. Delete the master secret only together# with the database disk.gcloud secrets list --project=<PROJECT_ID> --filter="labels.platforma-installation=<name>-cluster"gcloud secrets delete <SECRET_NAME> --project=<PROJECT_ID>To delete the service account of the installer:
gcloud projects remove-iam-policy-binding <PROJECT_ID> \ --member=serviceAccount:platforma-im-deployer@<PROJECT_ID>.iam.gserviceaccount.com \ --role=roles/owner --condition=Nonegcloud iam service-accounts delete platforma-im-deployer@<PROJECT_ID>.iam.gserviceaccount.com \ --project=<PROJECT_ID>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.
Tool: install.sh in Cloud Shell
A new install.sh run with the same DEPLOYMENT_NAME checks for kept data with its names: a
bucket, a Filestore instance or a VPC network. When it finds one, it stops before it makes
anything. Then do one of these, and run install.sh again:
- delete the kept data:
DELETE_ALL_DATA=true bash teardown.shwith the oldDEPLOYMENT_NAME(see What stays and how to delete it); - install with a new
DEPLOYMENT_NAME. When the VPC network is kept, also set a newRESOURCE_NAME_PREFIX: the name of the network does not depend onDEPLOYMENT_NAME.
A kept database disk or kept secrets in Secret Manager do not stop the installer: it makes a new
disk. With the same DEPLOYMENT_NAME, the installer uses the kept master secret and the kept
administrator password again.