Skip to content

Commit

Permalink
feat: add clean up instructions (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuan325 authored Nov 30, 2023
1 parent bde0caf commit c9021b1
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ amenities. It can help answer users questions like:
- [Setting up your Database](#setting-up-your-database)
- [Deploying the Retrieval Service](#deploying-the-retrieval-service)
- [Running the LLM-based Application](#running-the-llm-based-application)
- [Clean up Resources](#clean-up-resources)
- [Writing your own retrieval service](#writing-your-own-retrieval-service)

<!-- /TOC -->
Expand Down Expand Up @@ -132,6 +133,10 @@ of any of the database's listed below to set up and initialize your database:

[Instructions for running app locally](./docs/run_langchain_demo.md)

### Clean up Resources

[Instructions for cleaning up resources](./docs/clean_up.md)

## Writing your own retrieval service

This demo can also serve as a starting point for writing your own retrieval
Expand Down
34 changes: 34 additions & 0 deletions docs/clean_up.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Clean up

The fastest way to clean up is to delete the entire Google Cloud project. Follow
the steps below if you want to keep the project but delete resources created
through this demo.

## Before you begin

1. Set your PROJECT_ID environment variable:

```bash
export PROJECT_ID=<YOUR_PROJECT_ID>
```

## Deleting Cloud Run deployment resources

1. Delete the Cloud Run service deployed:

```bash
gcloud run services delete retrieval-service
```

1. Delete service account:

```bash
gcloud iam service-accounts delete \
retrieval-identity@$PROJECT_ID.iam.gserviceaccount.com
```

## Delete datastore resources

* [Clean up Alloydb](./datastore/alloydb.md#clean-up-resources)
* [Clean up Firestore](./datastore/firestore.md#clean-up-resources)
* [Clean up Cloud SQL](./datastore/cloudsql_postgres.md#clean-up-resources)
35 changes: 35 additions & 0 deletions docs/datastore/alloydb.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,38 @@ Private IP.
```

[pgvector]: https://github.com/pgvector/pgvector

## Clean up resources

Clean up after completing the demo.

1. Set environment variables:

```bash
export VM_INSTANCE=alloydb-proxy-vm
export CLUSTER=my-alloydb-cluster
export REGION=us-central1
export RANGE_NAME=my-allocated-range-default
```

1. Delete Compute Engine VM:

```bash
gcloud compute instances delete $VM_INSTANCE
```

1. Delete AlloyDB cluster that contains instances:

```bash
gcloud alloydb clusters delete $CLUSTER \
--force \
--region=$REGION \
--project=$PROJECT_ID
```

1. Delete an allocated IP address range:

```bash
gcloud compute addresses delete $RANGE_NAME \
--global
```
10 changes: 10 additions & 0 deletions docs/datastore/cloudsql_postgres.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,13 @@
```

[pgvector]: https://github.com/pgvector/pgvector

## Clean up resources

Clean up after completing the demo.

1. Delete the Cloud SQL instance:

```bash
gcloud sql instances delete my-cloudsql-instance
```
12 changes: 11 additions & 1 deletion docs/datastore/firestore.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,14 @@
```bash
python run_database_init.py
```
```
## Clean up resources
Clean up after completing the demo.
1. Delete the default firestore database:
```bash
gcloud alpha firestore databases delete --database='(default)'
```

0 comments on commit c9021b1

Please sign in to comment.