Continuous integration/continuous delivery platforms are at the heart of modern DevOps practices. They’re where software is built, where tests are run, and where we get the insights we need to improve our code and manage our software development processes. What used to be manual processes have been automated, making sure best practices happen every time. But CI/CD pipeline tooling can be resource-intensive, requiring significant data center space and the time to set pipelines up, configure them and connect them to all the other tooling that makes up your software development platform. Google’s announcement of Cloud Build at its Google Cloud Next 2018 event aims to address those issues, providing a cloud-hosted CI/CD-as-a-service application that integrates with its own platform, with third party services and with on-premises tooling.
It’s not surprising that Google has given Cloud Build a cloud-native focus. Build targets include Docker containers, and you can use a build to automate deployments to Kubernetes-managed platforms--including Google’s own Kubernetes Engine. You don’t even need a separate configuration file to create a Docker image; all you need is a standard Dockerfile for your project. Creating a Cloud Build configuration lets you add more steps to your build, using familiar YAML syntax to create the steps in your pipeline. A REST API provides insights into operations, letting you integrate your Cloud Build pipeline into the rest of your DevOps tooling and into your dashboards.
Other build types deliver code into a Google Cloud storage bucket, ready for use in your apps and services. This means you’ll need an appropriate Google Cloud billing account for your storage and compute services. Code is hosted along with a Cloud Build YAML configuration, using the appropriate Cloud Build builder image in each step to handle compilation and tests. Each builder is a container that contains all the tools needed to support the language you’re using, like Go or C++. Builders can also contain tools like maven and gradle to handle more complex builds, as well as add support for Git and other environments.
James Governor of analyst firm Red Monk notes that “CI/CD is the on ramp to most of what is good in modern software development. Setting up pipelines, however, remains a significant management overhead. Google is betting it can simplify end-to-end pipelines, with slick integration with Github and other tools.”
Getting the Most out of Cloud Build
To get the most out of Cloud Build, you must implement your own custom builders. These are Docker images that contain your own code, ready to handle tests. Separate builders can handle unit tests for each step of a build, with final integration tests before you deploy to your target environment.
Cloud Build takes CI/CD pipeline automation and ties it to Google’s own cloud services. Build times can be tuned by choosing more powerful virtual machines to host your build servers, while tests can be farmed out to on-demand workflows, with support for parallel operations. You can also trigger builds from actions in your source control system, so a commit to a build branch of a git repository could be used to trigger a Cloud Build operation. Rules in your configuration file handle which changes launch a build, as well as giving access to your repository.
Costs are low if you’re making infrequent, relatively small builds with a simple CI/CD pipeline. You get 120 free build-minutes a day, with up to 10 concurrent builds. Google is running Cloud Build as a service, so you’re not billed for queued time builds. Additional build-minutes are only $0.0034, on a standard single-core build server. More powerful servers cost substantially more: An eight-core VM costs $0.016 per build-minute, rising to $0.064 per build-minute on a 32-core VM. There’s a default 100GB SSD as part of each server, though you can add up to 1,000GB more at a cost of $0.17 per GB per month.
Cloud Build can best be thought of as an extension of Google’s existing Cloud Platform, adding much needed DevOps tooling to GCP and to its own Kubernetes service. However, it’s only part of the story. To get the most out of it, you’re going to need to add your own dashboards and integrations with other pieces of your software development process. Still, it’s a much-needed start, and Cloud Build’s support for delivering a wider range of software artifacts means it’s also an option for on-premises and app development.