This repository shows how to deploy your Rasa Bot onto Google Cloud Run
Deployment does not include training models
To install the gcloud cli - go to
https://cloud.google.com/sdk/docs/install
To login to your google cloud account from command line simply write
gcloud auth login
This will open your browser and you can login.
Now you should create a google cloud project from console.
https://console.cloud.google.com/
Now back in the command line, set the current project
gcloud config set project PROJECT_ID
https://cloud.google.com/build/docs/deploying-builds/deploy-cloud-run
To deploy, this tutorial is followed. Make sure you have enabled cloud run.
In order to deploy using Google Cloud Build, first enable the permissions as described here
Once enabled.
Check the file cloudbuild.yaml
and replace the project cat-food-finder
with your PROJECT-ID
Before deploying, make sure you have a trained model. The image build makes the assumption that you have trained a model locally and using rasa run simply to startup that model in the cloud run container. This is quite important!!!
To deploy
run
gcloud builds submit
Upon success, Go to the google cloud console, check Cloud Run and the newly created service, click open and see the URL.
Curl the following
curl --location --request POST 'https://YOUR-URL/webhooks/rest/webhook' \
--header 'Content-Type: application/json' \
--data-raw '{
"sender": "test_user",
"message": "I am good"
}'
Response
[
{
"recipient_id": "test_user",
"text": "Great, carry on!"
}
]