Introducing GCP Cloud Deploy Extensions

Brandon Bjelland
computeclub
Published in
3 min readFeb 24, 2023

TL;DR: GCP Cloud Deploy extensions is an OSS project giving engineers a framework to build custom functionality on top of the fledgling Cloud Deploy product.

Photo by SpaceX on Unsplash

Continuous Integration, Continuous Delivery, and Continuous Deployment are crucial pillars of modern software engineering. As best practices evolve and new methods become better understood (most recently, GitOps) new tools continue to spin out of the growing needs of organizations. Let me bring you up to speed on the latest in this space from Google Cloud.

Until recently, Google Cloud Platform had Cloud Build as its primary means of both building and delivering software but those tasks have distinct characteristics. While possible to use a tool like Cloud Build to do it all, in many ways it’s less than ideal — it was never meant to be a tool to orchestrate deployments across multiple environments, against many targets, and easily driven by non-engineers. Perhaps most importantly, it’s tricky follow a release as it travels through a promotion pipeline —deep product familiarity and some duct tape is very much required 🦆 Enter a new contender to the Continuous Delivery and Deployment space: Google Cloud Deploy!

Google Cloud Deploy is a powerful new product for automating application deployments in Google Cloud and beyond. Its slick UI, opinionated deployment flow, and robust permissions model makes it an exceptional tool for understanding and managing releases. However, as it’s a fledgling product, I’m left wanting more functionality than the initial offering provides. Thankfully, Cloud Deploy is built to be extended and the optional PubSub service notifications provide the interface we need to roll up our sleeves and start customizing based on Cloud Deploy emitted events. Reading these docs and feeling motivated to n̶e̶v̶e̶r̶ ̶d̶e̶p̶l̶o̶y̶ ̶J̶e̶n̶k̶i̶n̶s̶ ̶a̶g̶a̶i̶n̶ make the product work for my customers is how GCP Cloud Deploy Extensions was born.

GCP Cloud Deploy Extensions is an open source project that provides a set of extensions to help you customize and enhance your deployments based on lifecycle events of a release. These extensions are designed to be easy to use, secure, and configurable to your situation. Brainstorming a few potential use cases:

  1. As a release manager, I want to be notified via a messenger system (Teams, Slack, Google Chat) when a release is waiting for my approval.
  2. As an engineer, I want to be notified when builds fail.
  3. As anyone who cares about an application, I value its uptime and want automated rollbacks to occur if release verification steps fail.
  4. As an engineer, I want a record of which container images were released to what deployment targets. It would be great if this were captured as tags in the Artifact Registry.
  5. As an engineer, I want releases to upper environments to be automatically promoted when a lower environment rollout succeeds. This should not override mandatory approval steps.

GCP Cloud Deploy Extensions currently covers two of these (image-tagger and release-auto-promoter) and provides a Python library for quickly building your own extension. The code is open source and contributors are welcome to submit PRs of their own extensions. While the current extensions are written in Python using the fastapi framework, anything you can pack into a docker container will work. Extensions run on Cloud Run and scale to zero when not executing.

Cloud Deploy is a fast moving product that will likely fill some of these gaps over the coming months but in the meantime extensions provide a powerful way make Cloud Deploy work for your organization today. Your feedback is welcome (comments here, issues on the repo, PRs are open to contributors). Here’s what’s next for the project:

  1. expand on the documentation by providing diagrams
  2. build more extensions in more languages
  3. improve code quality, expand on tests
  4. write follow up blog posts covering design decisions, the tools, and showcasing the end-to-end demo.

Disclaimer: gcp-cloud-deploy-extensions is not an official Google supported project.

--

--

Brandon Bjelland
computeclub

Internet plumber, kombucha brewer, Aplental ski rat, husband, dog dad, father. Fumbling my way through entrepreneurship, like anything else.