This guide walks you through deploying Firesearch to Google Cloud Platform.
Did you know? You can run Firesearch on your dev machine using the Firestore emulator and Docker. Follow our tutorial to get started.
Firesearch is a middleware service that sits between Firestore and your backend services, and your public web and mobile clients.
Firesearch uses a number of Google Cloud APIs and services.
You should ensure the following are enabled in your Google Cloud project:
Billing may be required in GCP for some of these services to work—you will be prompted by the Google Cloud Console UI as you enable the services.
Now that you have enabled all the appropriate APIs, you can set up the secrets for Firesearch.
Firesearch uses the Google Cloud Console > Security > Secret Manager to get the required secret strings.
Use the Secret Manager user interface in the Google Cloud Console to add the four secrets listed below.
For each secret, you must give the Secret Manager Secret Accessor permission role to the service account you will be using to run the instance.
You can use the default service account (just start typing gserviceaccount
to see the account in the dropdown).
You should add all four of the following secret strings:
FIRESEARCH_API_KEY
- (string) A key string that must be sent in the X-API-Key
header—can be shared with trusted clients (i.e. backend services or cloud functions) FIRESEARCH_BASICAUTH_USER
- (string) The "Basic" authentication username to access the Firesearch Console FIRESEARCH_BASICAUTH_PASSWORD
- (string) The "Basic" authentication password to access the Firesearch Console FIRESEARCH_LICENCE
- (string) This is the licence key you get from https://firesearch.dev/licences Once you have added these secrets and verified the permissions, you are ready to create the Firesearch instance.
In this section you will get the Firesearch service running in production on Google Cloud.
firesearch
256 MiB
memory (or 512 MiB
if you're using an ML image) PROJECT_ID
If Firesearch fails to start, you will find useful information in the logs:
Once the instance is running, access the instance URL (provided by Cloud Run) in a browser.
Once Firesearch is running, you will be prompted to enter the "Basic" authentication credentials that mirror those in your secrets.
Once authenticated, you will be able to access the Firesearch Console.
Firesearch is now running in your environment.
Congratulations, you are successfully running Firesearch in production.
/api
) so you can start to write code to interact with it using the Client libs and SDKs If Firesearch fails to start, you will find useful information in the logs:
If Firesearch starts but is unable to run, you will be presented with an error message in the browser when you access the console.
After you make changes, you will need to deploy the instance again which you can do using the EDIT AND DEPLOY NEW REVISION button, and then clicking DEPLOY.
You may see an error similar to:
Unable to connect to firestore: rpc error: code = NotFound desc = The project does not exist or it does not contain an active Cloud Datastore or Cloud Firestore database.
Firesearch is having trouble connecting to Firestore.
Firesearch is unable to read the secrets from the Secret Manager.
Usually this is a permission problem. Ensure the service account you used to create your Cloud Run instance has at least the Secret Manager Secret Accessor role.