mediumMultiple Select
Automate ML Pipelines with Cloud Build and Vertex AI
Which THREE actions should be taken to automate a machine learning pipeline using Cloud Build and Vertex AI?
Quick Answer
The answer is to configure a Cloud Build trigger to run on commits to the source repository. This is correct because the cloudbuild.yaml file can define a step that builds a custom training container and submits it as a Vertex AI PipelineJob, creating a fully automated ML CI/CD pipeline where every code change triggers model retraining and deployment. On the Google Professional Machine Learning Engineer exam, this pattern tests your understanding of how Cloud Build acts as the CI orchestrator that invokes Vertex AI Pipelines, a common scenario in the "ML solution testing, automating, and deploying" section. A frequent trap is thinking you need a separate CI tool like Jenkins or that Vertex AI alone handles the commit trigger, but Cloud Build provides the native Git integration. Memory tip: think "Commit triggers Container, Container triggers Pipeline" — Cloud Build is the gatekeeper that connects your source code to Vertex AI’s orchestration.
⚠ Common exam trap
Google Cloud often tests the distinction between event-driven triggers (Cloud Build triggers, Pub/Sub) and polling mechanisms (Cloud Scheduler, Cloud Functions) — the trap here is that candidates may think polling or separate functions are needed for automation, when in fact Cloud Build's native triggers and pipeline submission are the correct, integrated approach.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Write a cloudbuild.yaml that builds a training container and submits a Vertex AI PipelineJob
Option A is correct because a cloudbuild.yaml file is the declarative configuration Cloud Build uses to define build steps, and one of those steps can build a custom training container image (e.g., via docker build) and then submit a Vertex AI PipelineJob using the gcloud ai pipelines run command or the Vertex AI SDK. Option D is correct because Vertex AI Pipelines is the native service for orchestrating ML workflow steps such as training, evaluation, and deployment as a directed acyclic graph, and Cloud Build can invoke that pipeline as part of CI/CD, giving a fully automated, reproducible ML pipeline. Option E is correct because a Cloud Build trigger bound to the source repository (e.g., a GitHub or Cloud Source Repositories trigger on push or pull request) is what actually initiates the automated build/pipeline run on commits, which is the core of CI/CD automation. Option B is not appropriate because Cloud Functions is not the intended mechanism for retraining models on build completion; Cloud Build triggers or Pub/Sub notifications are the correct integration points, and this adds unnecessary complexity. Option C is not appropriate because polling for build artifacts with Cloud Scheduler is an anti-pattern; event-driven triggers (Cloud Build triggers or Pub/Sub) are preferred over scheduled polling for reacting to new builds.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Write a cloudbuild.yaml that builds a training container and submits a Vertex AI PipelineJob
Why this is correct
Cloud Build executes declarative build steps from cloudbuild.yaml, so this file can both build the training container image and invoke the Vertex AI API to submit a PipelineJob, providing the end-to-end automation the scenario demands.
- ✗
Use Cloud Functions to retrain the model each time a build completes
Why it's wrong here
Cloud Functions cannot natively orchestrate Vertex AI training pipelines; Cloud Build steps or Vertex AI Pipelines trigger training directly on commit. Cloud Functions suits lightweight event-driven glue, such as reacting to a Pub/Sub message, not managing multi-step ML workflows with dependency tracking and artefact lineage.
- ✗
Set up a Cloud Scheduler job to poll for new build artifacts
Why it's wrong here
Polling for build artefacts introduces latency and wasted invocations; Cloud Build publishes build events to Pub/Sub, which triggers the pipeline immediately. Cloud Scheduler suits fixed-time batch jobs, such as nightly data exports, not event-driven ML retraining where each successful build must kick off training without delay.
- ✓
Define the training and deployment steps in a Vertex AI Pipeline and submit it from Cloud Build
Why this is correct
Defining training and deployment as Vertex AI Pipeline components gives orchestration and repeatability, while Cloud Build acts as the CI trigger that submits the PipelineJob. This satisfies the requirement to automate the full pipeline rather than individual scripts.
- ✓
Configure a Cloud Build trigger to run on commits to the source repository
Why this is correct
A Cloud Build trigger bound to source-repository commits supplies the event-driven entry point the pipeline requires, automatically starting builds whenever code changes land. This satisfies the automation constraint by removing manual invocation, letting subsequent steps deploy and retrain Vertex AI models without human intervention.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
Go deeper
Related to this question
About these practice questions
One of 775 original PMLE practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on PMLE
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. The exhibit shows a Cloud Build configuration. An ML engineer wants to automate the deployment of a model to Vertex AI after training. What is missing in this config to successfully deploy the model?
medium- A.A step to upload the training image to Artifact Registry
- ✓ B.A step to build the serving container image
- C.A step to run unit tests
- D.A step to create the Vertex AI Endpoint
Why B: The Cloud Build configuration shown is for training a model, but to deploy it to Vertex AI, a serving container image must be built and pushed to Artifact Registry. Vertex AI requires a custom serving container (or a prebuilt one) to host the model for predictions. Without a step to build the serving container image (e.g., using a Dockerfile that includes the model and serving dependencies), the deployment will fail because there is no runnable image to deploy to the endpoint.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This PMLE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PMLE exam.