Clean up¶
Now that you have completed the guide, it is crucial to properly manage and remove the resources and environments you have created. This is necessary to avoid unnecessary incurring costs and potential security concerns.
Here's a step-by-step guide to help you do that.
- Clean up the cloud provider resources
- Clean up your local environment
- Clean up your repository
Warning
If you are using a new cloud account such as Google Cloud, make sure to delete the resources you created before the credits are consumed. Otherwise, you will be charged for the resources you created.
Clean up cloud provider resources¶
In this section, you will delete the resources you created on the cloud provider.
Delete the Kubernetes cluster
To delete the Google Kubernetes cluster you created, you can execute the following command:
Execute the following command(s) in a terminal | |
---|---|
Press Y to confirm the deletion.
To disable the Google Kubernetes Engine API, you can execute the following command:
Execute the following command(s) in a terminal | |
---|---|
Delete the Google Artifact Registry
To delete the Google Artifact Registry used to store the Docker images you created, you can execute the following command:
Execute the following command(s) in a terminal | |
---|---|
Press Y to confirm the deletion.
To disable the Google Artifact Registry API, you can execute the following command:
Execute the following command(s) in a terminal | |
---|---|
Delete the Google Storage bucket
Warning
If you intend to keep the Git repository but proceed with deleting the Google Storage bucket, the DVC remote will be disrupted. To continue using DVC with the Git repository, you will need to reconfigure it with a new remote.
To delete the Google Storage bucket you created, you can execute the following command:
Execute the following command(s) in a terminal | |
---|---|
Press Y to confirm the deletion.
Delete the Google Service Account
To delete the Google Service Account you created, you can execute the following command:
Execute the following command(s) in a terminal | |
---|---|
Press Y to confirm the deletion.
Delete the local Google Service Account
You can run the following command to delete the Google Service Account you exported locally:
Execute the following command(s) in a terminal | |
---|---|
Unlink the billing account
You can run the following command to unlink the billing account from the project:
Execute the following command(s) in a terminal | |
---|---|
Press Y to confirm the unlinking.
Delete the Google Cloud project
To delete the Google Cloud project you created, you can execute the following command:
Execute the following command(s) in a terminal | |
---|---|
Press Y to confirm the deletion.
Close the Billing Account
To close the Billing Account you created:
- Go to the Google Cloud Billing Console.
- Select the Billing Account you created.
- Click on Account management in the menu.
- Select Actions from the project list and select Disable billing.
- Select Close Billing Account at the top of the page.
- Follow the instructions to close the account.
Remove the Payment method
To remove the payment method you added:
- Go to the Payment method in the 3-dots top right menu.
- Select the card you added and select Remove.
- Follow the instructions to remove the payment method.
This guide has been written with Google Cloud in mind. We are open to contributions to add support for other cloud providers such as Amazon Web Services, Exoscale, Microsoft Azure or Self-hosted Kubernetes but we might not officially support them.
If you want to contribute, please open an issue or a pull request on the GitHub repository. Your help is greatly appreciated!
Clean up your repository¶
In this section, you will delete the repository you created on GitHub or GitLab.
To delete the GitHub repository you created:
- Go to the repository page in GitHub.
- Click on Settings above the repository.
- Scroll down to the "Danger Zone" section at the bottom of the page.
- Click on Delete this repository.
- Follow the instructions to delete the repository.
To delete the GitHub Personal Access Token you created:
- Go to your GitHub Settings at the top right of the page.
- Click on Developers settings in the left sidebar.
- Click on Personal access tokens in the left sidebar and then on Tokens (classic).
- Find the Personal Access Token you created for this guide.
- Click on the Delete button next to it.
- Follow the instructions to delete the token.
To delete the GitLab repository you created:
- Go to the repository page in GitLab.
- Click on the Settings button on the left side of the page.
- Scroll down to the "Advanced" section at the bottom of the page and click on "Expand".
- Scroll down to "Delete this project".
- Click on the Delete project button.
- Follow the instructions to delete the repository.
To delete the GitLab Personal Access Token you created:
- Go to your GitLab Profile preferences at the top right of the page.
- Click on Access Tokens in the left sidebar.
- Find the Personal Access Token you created for this guide.
- Click on the Revoke button next to it.
- Follow the instructions to revoke the token.
Clean up your local environment¶
In this section, you will delete the local environment you created for this guide.
Start by ensuring you have left the virtual environment created in the previous chapter.
Then, you can delete the Python virtual environment directory.
Execute the following command(s) in a terminal | |
---|---|
Double-check everything¶
Before you finish, double-check that you have deleted all the resources and environments you created. This will ensure that you don't incur unexpected costs or leave any security vulnerabilities.
Here is a checklist of all the resources and environments you created.
Tip
You can click on the list items to mark them as completed if needed.
- The cloud provider Kubernetes cluster
- The cloud provider container registry
- The cloud provider S3 bucket
- The cloud provider credentials
- The cloud provider project
- The GitHub or GitLab Personal Access Tokens
- The GitHub or GitLab repository
- The projects directories
- The
a-guide-to-mlops-jupyter-notebook
directory - The
a-guide-to-mlops
directory
- The
Summary¶
By following these steps, you have successfully cleaned up the resources and environments you created during the guide. We hope you found this guide helpful and that it has given you a good understanding of the importance of cleaning up after yourself in cloud computing environments.