The purpose of this pull request is to create a deployment script for Cloud Run and update as needed (eventually we want to replace this with something that uses Cloud Workflows, Cloud Build, and/or Terraform). See Issue #2 for additional information on this.
The objectives in creating the deployment script are to:
[x] create the necessary Pub/Sub topic(s) and subscription(s)
[x] create the BigQuery dataset and table(s)
[x] instruct Cloud Build to containerize the module and deploy it to Cloud Run
In order to deploy the classifier module to Cloud Run, the script must:
containerize the classifier module
store the resulting image in the Container Registry
deploy the module to Cloud Run using the aforementioned container image
It is important for the reader to be aware that Cloud Run modules are triggered via a Pub/Sub subscription. Once the Cloud Run module is deployed, its URL will be printed to the screen. This URL is needed in order to create the Pub/Sub subscription trigger. For now, the URL must be manually copy-pasted into the following code in order to create the subscription:
The purpose of this pull request is to create a deployment script for Cloud Run and update as needed (eventually we want to replace this with something that uses Cloud Workflows, Cloud Build, and/or Terraform). See Issue #2 for additional information on this.
The objectives in creating the deployment script are to:
In order to deploy the classifier module to Cloud Run, the script must:
It is important for the reader to be aware that Cloud Run modules are triggered via a Pub/Sub subscription. Once the Cloud Run module is deployed, its URL will be printed to the screen. This URL is needed in order to create the Pub/Sub subscription trigger. For now, the URL must be manually copy-pasted into the following code in order to create the subscription:
Future work includes figuring out a way to automate this.
The Cloud Run module will be active as soon as the subscription is created. To stop the Cloud Run module, you must delete the trigger subscription:
gcloud pubsub subscriptions delete "${subscrip}"