Skip to content

Latest commit

 

History

History
50 lines (33 loc) · 1.33 KB

File metadata and controls

50 lines (33 loc) · 1.33 KB

Setup and configure Firestore

Before you begin

  1. Make sure you have a GoogleCloud project and billing is enabled.

  2. Install required dependencies:

    cd retrieval_service
    pip install -r requirements.txt

Create a Cloud Firestore database

  1. In the Firebase console, click Add project, then follow the on-screen instructions to create a Firebase project or to add Firebase services to an existing GCP project.

  2. Navigate to the Cloud Firestore section of the Firebase console. You'll be prompted to select an existing Firebase project. Follow the database creation workflow.

Initialize data in Firestore

  1. Create or edit your existing retrieval_service/config.yml:

    host: 0.0.0.0
    datastore:
        kind: "firestore"
        projectId: <YOUR_GCP_PROJECT_ID> # (Optional) default to env variable `GCLOUD_PROJECT`
  2. Change to the retrieval_service directory:

    cd retrieval_service
  3. Populate your Firestore database with the command below. It will take several minutes to run:

    python run_database_init.py

Clean up resources

Clean up after completing the demo.

  1. Delete the default firestore database:

    gcloud alpha firestore databases delete --database='(default)'