mediumMultiple Choice
PMLE Practice Question: An ML team is using Vertex AI Pipelines to…
An ML team is using Vertex AI Pipelines to automate model training and deployment. They want to reuse components across multiple pipelines. What is the best practice for managing component code?
⚠ Common exam trap
Google Cloud often tests the misconception that inline definitions or YAML duplication are acceptable for reuse, but the trap here is that candidates overlook the requirement for versioned, decoupled, and independently deployable components, which only container images in a registry can provide.
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
✓
Store components as container images in Artifact Registry and reference them from pipelines
Vertex AI Pipelines natively supports reusable components by packaging them as container images stored in Artifact Registry. This allows teams to version, share, and reference components across multiple pipelines without duplicating code, ensuring consistency and reducing maintenance overhead. Container images encapsulate the component's runtime environment and logic, making them portable and independently deployable.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Define components inline in the pipeline definition
Why it's wrong here
Inline definitions bind component code to a single pipeline, so other pipelines cannot import or version it independently. Inlining tempts teams seeking a self-contained YAML, but it suits one-off prototypes; reusable components belong in a container registry or Artifact Registry, referenced by each pipeline.
- ✗
Embed component code in Cloud Composer DAGs
Why it's wrong here
Cloud Composer DAGs orchestrate workflows but do not package Vertex AI pipeline components, which require containerised code with declared interfaces. Composer tempts teams already using Airflow, yet it is the right choice for general orchestration, not for defining reusable Vertex AI pipeline components.
- ✗
Copy the component definitions into each pipeline's YAML file
Why it's wrong here
Copying definitions into each YAML duplicates code, so fixes and version updates must be applied in every pipeline, defeating reuse. Copying tempts teams wanting quick per-pipeline control, but it suits throwaway experiments; shared components should live in a registry and be referenced by digest.
- ✗
Use Cloud Functions to define components
Why it's wrong here
Cloud Functions cannot express Vertex AI pipeline components, which must be containerised with defined inputs, outputs and artefacts; they execute event-driven snippets, not pipeline steps. The serverless model tempts teams wanting reusable code, but Cloud Functions suit lightweight event handlers, not DAG component packaging.
- ✓
Store components as container images in Artifact Registry and reference them from pipelines
Why this is correct
Packaging components as versioned container images in Artifact Registry gives immutable, portable artefacts that any pipeline can reference by digest. This satisfies cross-pipeline reuse, since component code and dependencies travel together independently of the pipeline definition or local Python environments.
Go deeper
Related to this question
About these practice questions
Courseiva writes every PMLE question from scratch — 775 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
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.