Google Cloud Build CI/CD Pipeline

Pipeline as Code (YAML) | Cloud Platform Engineering Project

Deployment of a Dockerized Machine Learning Model through CI/CD pipelines using Google Cloud Build, Artifact Registry, and Cloud Run. Building CI/CD pipelines with the concept/technique of Pipeline as Code (PaC) by building .yaml Key-Value Pair scripts.

GitHub Tech Stack Project execution link (proof)

Project Summary

Comprehensive Project Overview

Project Category

Google Cloud Platform + Google Cloud Build + Artifact Registry + Cloud Run → CI/CD on Cloud

Industry/Domain

Cloud-Native CI/CD & MLOps Platform Engineering

DevOps Focus

MLOps with DevOps Focus with Automation

Key Technologies & Concepts

Core Technologies Used

GCP CI/CD - Keywords

Google Cloud Platform (GCP) Google Cloud Build Pipeline as Code (PAC) cloudbuild.yaml GitHub-based CI triggers Pull Request triggers Branch-based triggers Cloud Build managed Linux workers Multi-step build pipelines Docker build and push Artifact Registry Container image versioning Google Cloud Run deployment Serverless container runtime Manual approval gates Cloud Build approvals (approvalConfig) Environment separation (Staging / Production) IAM Service Accounts

Problem & Objective

What problem did this project solve?

Problems Solved

  • Deployment of a Dockerized Machine Learning Model through automatic pull request via Docker Hub and trigger, at a speed
  • Safe roll-back option whenever necessary
  • Manual Approval Intervention simulating the real world scenarios

Primary Objectives

  • Creating a robust Infrastructure through Pipeline as Code (PAC) Technique
  • Build a Working Model - Use Google Cloud Build for CI/CD Pipelines by Using YAML based pipeline Structure

Solution & Architecture

Architectural Overview

Solution Overview

Using GitHub as the source for the code and then using the YAML script to build the CI/CD Pipeline with multiple stages for build, tag, register, approve and deploy multiple versioned models of the application on Google Cloud Run, a serverless container service which runs on Kubernetes Infrastructure. Effectively it is scalable and highly available along with logging and monitoring. There is a manual approval process to have a human intervention, which is an industry grade practice.

Cloud Run was chosen to demonstrate CI/CD principles independent of backend complexity, keeping focus on pipeline design, approvals, and deployment strategy rather than application logic.

GCP
1
GitHub Repository
2
Cloud Build
3
Artifact Registry
4
Manual Approval
5
Cloud Run

Key Components

  • Subscriptions/Google account → Projects (Resource Groups) → Resources/Services
  • Services Used: Virtual machines, cloud build, cloud run, artifact registry, managed actions
  • Cloud Platform used: Google Cloud

Scalability & Reliability: Reliable is decided by metrics like Pipeline pass-rate, Test Pass rate, Pipeline duration etc. Scalability is possible because of the cloud run capabilities.

Skills & Technologies Used

Technical Proficiency Demonstrated

Primary Skills

  • PipeLine As Code (Pac): cloudbuild.yaml configuration based on Google Cloud Official documentation
  • Skill in using the cloud tools - projects, services
  • Pipeline building process
  • GitHub usage

Secondary Tools / Frameworks

  • Docker Hub usage skill → docker pull, docker push

Programming Languages & Tools

  • cloudbuild.yaml pipeline configuration file
  • gcloud CLI commands
  • GitHub CLI Commands
  • Python language

Cloud & DevOps Tools

Google Cloud Cloud Build Cloud Run Artifact Registry GitHub

Pipeline Execution & Governance

How the pipeline works and is controlled

Pipeline Execution

  • CI/CD pipelines run automatically upon changes in the code (pr, trigger)
  • Orchestration: cloudbuild.yaml, timeout
  • Logging - View Raw Logs
  • Manual Approval gates

Governance & Controls

  • Secure CI/CD authentication
  • Production deployment governance
  • Rollback via Cloud Run revisions
  • Cloud Build logs and audit trail
  • CI/CD for containerized ML services

Technical Challenges & Resolutions

Key Technical Challenges

  • Challenge 1: How to give both Manual Approval and Automated Approval at the same time?
  • Challenge 2: How to create a pipeline and wait to run it later?

Resolutions

  • Resolution 1: Manual approval gates were implemented using approve option during the build process. A timeout safeguard was configured to handle non-responsive approvals and simulate real-world escalation or rollback scenarios.
  • Resolution 2: Instead of running the pipeline just look out for save option and then trigger the pipeline through code changes at the code level.

Azure DevOps CI/CD - Architecture & YAML Mapping

Architecture to YAML construct mapping

Architecture Block YAML Construct (GCP / Cloud Build)
GitHub / Cloud Source Repo trigger: (GitHub / CSR trigger)
Cloud Build Pipeline cloudbuild.yaml (pipeline root)
Linux Runner Cloud Build worker (steps: on Google-managed Linux)
Build Stage steps: (build step definitions)
Manual Approval Cloud Build Approvals (approvalConfig:)
Dev / Staging substitutions: / separate trigger or project
Prod Separate trigger or gated approval pipeline
Artifact Storage Artifact Registry / Cloud Storage
Deployment Target gcloud run deploy / kubectl apply
Environment Identity Service Account (IAM-based)
Logging & Execution Cloud Build Logs

Pipeline Execution Evidence

Proof of successful implementation

Pipeline Run History

CI + Manual execution history demonstrating successful pipeline runs.

Pipeline Run History Screenshot

Multi-stage Execution with Manual Approvals

Evidence of multi-stage pipeline execution with manual approval gates.

Multi-stage Execution Screenshot

ML Application Deployed

The Dockerized Machine Learning Model successfully deployed via the CI/CD pipeline:

Placement Prediction System

Application deployed on Cloud Run with auto-scaling capabilities based on Kubernetes infrastructure.

Project execution link (proof) Docker Image: rajesharigala/placementapp:v1-amd64

Assets & References

Code, diagrams, study material

GitHub Repository

Source code repository containing the Dockerized ML application and Cloud Build configurations.

Access Repository

Study Material Resources

Click the button below to open the study materials

Request Study Material

Study Material - Google Cloud Build CI/CD

Google Cloud Build CI/CD Pipeline Architecture
Complete architecture diagram and setup guide for Cloud Build workflows and pipelines
Download
cloudbuild.yaml Configuration Guide
Official documentation and best practices for Cloud Build YAML configuration
Download
Pipeline as Code Best Practices for GCP
Detailed guide to implementing scalable CI/CD with Pipeline as Code approach on Google Cloud
Download
Advanced Cloud Build Configurations
Premium materials for complex workflows, approval gates, and multi-environment deployments
Download
Cloud Run Deployment Guide
Complete guide to deploying containerized applications to Cloud Run via CI/CD
Download
Artifact Registry & Security Best Practices
Security guidelines and best practices for managing container images in Artifact Registry
Download
Production Cloud Build Architecture
Enterprise architecture patterns for scalable Cloud Build deployments
Download
CI/CD for MLOps on GCP
Complete framework for implementing CI/CD for Machine Learning models on Google Cloud
Download