Courseiva

PMLE Automating and Orchestrating ML Pipelines Practice Question

An ML pipeline runs on Vertex AI and includes a component that uses a third-party library not available in the default Python environment. The team wants to avoid building a custom container image. Which approach should they use?

⚠ Common exam trap

Watch out — candidates often confuse the `packages_to_install` parameter in Vertex AI's `@dsl.component` with a generic pip install in the pipeline definition, or they assume a pre-built container image avoids custom image building—but in Vertex AI, any container image that includes the library must be custom-built or selected from a registry, which still involves image management overhead. The `packages_to_install` parameter is the native Vertex AI way to install packages without custom containers.

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

✓

Use the packages_to_install parameter in @dsl.component

The `packages_to_install` parameter in the `@dsl.component` decorator allows you to specify a list of third-party Python packages (e.g., via pip) that will be installed at runtime in the component's execution environment, without needing to build a custom container image. This is the recommended approach in Vertex AI Pipelines when you need to use a library not present in the default Python environment, as it avoids the overhead of custom container creation while ensuring the dependency is available for that specific component.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Install the library using pip in the pipeline definition

    Why it's wrong here

    A pip install inside the pipeline definition runs at execution time on the component's existing environment, so it does not provision the library into the component's runtime reliably. It is tempting because pip is the standard Python installer, and it would work when installing into a controlled environment you own.

  • ✗

    Use a container component with a pre-built image

    Why it's wrong here

    A container component requires an image, so this still means supplying or building one, contradicting the stated wish to avoid custom images. It is tempting because container components give full dependency control, and they would be correct when the team accepts image maintenance.

  • ✓

    Use the packages_to_install parameter in @dsl.component

    Why this is correct

    Using `packages_to_install` in `@dsl.component` lets the Vertex AI Pipelines compiler install the third-party library into the component's runtime environment at execution, satisfying the constraint of avoiding a custom container image. The dependency is resolved by pip during task startup rather than being baked into the image.

  • ✗

    Add the library to the Vertex AI custom training image

    Why it's wrong here

    Modifying the custom training image still requires building and maintaining that image, which the team explicitly wants to avoid. It is tempting because baking dependencies into an image gives reproducible environments, and it would be right if image builds were acceptable.

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 →

How Courseiva writes practice questions · Editorial policy

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.