GoogleCloudPlatform / automlops

Build MLOps Pipelines in Minutes
Apache License 2.0
143 stars 34 forks source link

CI/CD for Cloud Run deployment #62

Open AtulanZaman opened 1 month ago

AtulanZaman commented 1 month ago

Currently, the implementation for cloud run (CR) deployment is such that, we create an image using a "local_provisioner" and create the cloud run resource in Terraform referencing the latest version of the newly created container.

Problem with this approach is that if there are any updates to the implementation of the service and a new image is pushed, the CR instance doesn't get updated, even if Terraform is re-ran, since the version of the image is not saved in state due to the "latest" image reference.

My recommendation would be, as part of the submission service component, we also generate a cloudbuild or github actions workflow for the submission service, so that if any changes are pushed to the submission service, we build the new image and deploy the new image to the CR instance, using a templatized workflow. Here are two references from Cloud Build and Github Actions:

https://cloud.google.com/build/docs/deploying-builds/deploy-cloud-run https://github.com/google-github-actions/deploy-cloudrun