Prepare and test your skills
Prepare and test your skills
Pipeline orchestration architecture is the decision about how machine learning (ML) steps are defined, packaged, and run as one connected end-to-end system. On Google Cloud, Gemini Enterprise Agent Platform Pipelines (opens in a new tab) acts as the managed serverless orchestrator for directed acyclic graphs (DAGs), while Cloud Dataflow (opens in a new tab) provides scalable batch and stream preprocessing that runs inside those DAGs with the Apache Beam runner. The choice between managed services, self-managed platforms, template reuse, and custom definitions balances scalability, cost (opens in a new tab), maintenance overhead, and control.
Managed orchestration with Agent Platform Pipelines means Google provisions, scales, and runs the pipeline infrastructure while the team defines modular components. The pipeline definition flows from developer code to the managed control plane, and the control plane then launches each containerized component, passes output artifacts as inputs to subsequent components, and records lineage in Vertex ML Metadata. Because execution, scheduling, and artifact tracking are managed, teams avoid maintaining their own orchestrator cluster but accept the managed service interfaces and serverless execution model.
Agent Platform Pipelines serves as the central orchestrator for production MLOps when repeatability and governance matter. The service supports defining end-to-end workflows with modular components for data processing, training, evaluation, and deployment, automating runs with schedules or triggers such as new data arrivals or code changes, and retaining automated parameterization and versioning with a version history for every run. Monitoring flows from pipeline execution metrics into operational monitoring (opens in a new tab) with built-in logging, tracing, and Cloud Monitoring alerts. This contrasts with running Kubeflow directly on Kubernetes, where Kubeflow is an ML toolkit that makes ML workflow deployments on Kubernetes easier to use, portable, and scalable.
Choose the managed pipelines service when serverless operation, automatic artifact tracking, scheduled runs, and execution metrics outweigh the need for direct cluster control. Choose self-managed Kubeflow or self-hosted Airflow when portability across Kubernetes environments and direct control of the cluster outweigh maintenance overhead and the need to manage scaling, upgrades, and reliability yourself.
Pipeline SDK selection determines how much structure, reuse, and TensorFlow optimization the DAG inherits. Kubeflow Pipelines (KFP) SDK v2.0 or later defines reusable end-to-end workflows where each step is a containerized component with input parameters and output artifacts, and the KFP SDK facilitates experimentation and reuse without starting over. TensorFlow Extended (TFX) v0.30.0 or later provides pipeline components built on TFX libraries whose data processing libraries use Apache Beam directly, so TensorFlow Transform calls translate to Beam operations without extra configuration work.
Building and running a KFP-based pipeline follows an ordered workflow where each stage depends on the previous stage:
Choose TFX when the workflow processes terabytes of structured or text data in TensorFlow and benefits from built-in Beam integration by selecting the Dataflow runner at pipeline build time. Choose KFP for general-purpose modular components, control-flow logic, and broad reuse across training, evaluation, deployment, prompt management, batched inference, human-in-the-loop evaluation, and coordination of agent components.
Dataflow integration patterns determine where Apache Beam code lives and who manages its packaging and dependencies. Data flows from upstream pipeline components into a Dataflow job for preprocessing or postprocessing, and the transformed output flows back into downstream steps such as training with Agent Platform Managed Training CustomJob, registration in Model Registry, and deployment to Agent Platform endpoints. All patterns use the Dataflow runner, but they differ sharply in complexity, control, and maintenance burden.
| Integration option | How Beam code is packaged | Complexity and control tradeoff |
|---|---|---|
| Built-in Beam integration with TFX or KFP | Use native TFX libraries or KFP operators that already invoke Beam and the Dataflow runner | Least complex; fastest development and least dependency management, but least custom control |
| Dataflow template called from pipeline | Build Beam logic as a Dataflow template, then call the template from a pipeline component | Medium complexity; isolates data processing for reuse across pipelines with separate template versioning |
| Fully custom component with inline Beam pipeline | Define a custom Beam pipeline in Python directly inside the component and run it with the Dataflow runner | Most complex; maximum control over logic and containers, but the team must manage all pipeline dependencies |
When using Dataflow with KFP, the pipeline can invoke processing through the DataflowPythonJobOp operator, the DataflowFlexTemplateJobOp operator, or a fully custom component. The documentation recommends DataflowPythonJobOp for the standard Python-job case, reserving Flex Templates for template-based reuse and fully custom components for logic that neither operator can express.
Exam tip: Built-in TFX or KFP Beam integration is least complex, calling a Dataflow template is intermediate, and embedding a custom Beam pipeline with the Dataflow runner inside the component is most complex because dependency management stays with the developer.
Reusable templates and automation convert a single pipeline run into a standardized, continuously operated MLOps platform. Agent Platform Pipelines supports reusable pipeline templates for standardized workflows, scheduled pipeline runs for recurring retraining, and execution metrics for monitoring workflows, including specialized generative AI steps such as prompt engineering, response filtering, data augmentation, and evaluation of generated outputs against quality and safety guidelines. The orchestrator depends on surrounding services: Dataflow for data processing, CustomJob for training without managing provisioning, Model Registry for model versioning, and endpoints for serving.
Operational maturity depends on infrastructure-as-code and CI/CD surrounding the orchestrator. Teams define GKE clusters with workload-optimized node pools, Agent Platform endpoints with machine types and scaling policies, and Cloud Storage buckets with Terraform, accelerate provisioning with Cluster Toolkit blueprints, and manage ongoing configuration declaratively with Config Connector YAML manifests applied to GKE. Pipeline compilation, Cloud Build testing of infrastructure and packaging, stress testing with tools such as Locust, bulk evaluation, and data-integrity validation before retraining complete the automated lifecycle, so every code, data, and configuration change flows through versioned, repeatable deployment.
ML accelerator selection determines whether computationally intensive Dataflow steps scale through parallelism alone or through specialized hardware for higher performance (opens in a new tab). Dataflow workers can attach NVIDIA GPUs of types T4, L4, A100, H100, and V100 for accelerated processing, but GPU use requires a custom container image that includes the necessary GPU drivers and libraries. Dataflow also supports Cloud TPUs, Google's custom AI accelerators optimized for large models on PyTorch, JAX, and TensorFlow, in single-host configurations where each worker manages one or more TPU devices.
Choose GPUs when the Beam preprocessing or large-model inference step needs broadly supported acceleration with explicit driver control via custom containers. Choose TPUs when the inference workload runs on a TPU-optimized framework and fits the single-host worker model, trading flexible GPU type selection for higher throughput on large AI models.
Implementing and optimizing pipeline components and execution means building modular, containerized steps for the full ML lifecycle and running them on managed infrastructure with controlled resources, dependencies, and performance optimizations. In Google Cloud, Gemini Enterprise Agent Platform Pipelines acts as the central orchestrator for data processing, training, evaluation, and deployment, while services such as Dataflow, Agent Platform custom training, Model Registry, and Agent Platform endpoints perform the work inside each step. Optimization comes from reusable templates, scheduled runs, typed component interfaces, autoscaling resources, and control-flow logic that skips or branches work.
Modular pipeline components from ingestion to deployment are containerized steps where each component declares inputs and produces output artifacts that flow directly to the next component. Pipelines are defined programmatically by using the Kubeflow Pipelines (KFP) SDK or TensorFlow Extended SDK, compiled to YAML as part of a CI/CD flow, and executed on a schedule with Cloud Scheduler or on triggers such as new data or code changes. Gemini Enterprise Agent Platform Pipelines automates every step from data preparation to model training, evaluation, and deployment on this model.
Data flows from ingestion and preprocessing components into training and evaluation components and then into deployment components that publish to Model Registry and Agent Platform endpoints. Preprocessing is implemented with Dataflow for Apache Beam batch and stream processing, Managed Service for Apache Spark for Apache Spark workloads, or BigQuery for SQL-based processing, with schema validation by TensorFlow Data Validation (TFDV) and automated data quality scans in BigQuery. Training execution uses the CustomJob resource in Agent Platform Managed Training to submit jobs to one or more worker nodes without provisioning infrastructure, including hyperparameter tuning jobs, and trained models flow into Model Registry for versioning and then to endpoints for serving. For generative AI, Agent Platform Pipelines orchestrates specialized components for prompt management, batched inference, response filtering, data augmentation, human-in-the-loop evaluation, and coordinating Agent Development Kit components.
| Preprocessing option | Engine | Choose when |
|---|---|---|
| Dataflow | Apache Beam for batch and stream | The pipeline needs unified batch and streaming with ML-component integration and event-driven processing with Eventarc |
| Managed Service for Apache Spark | Apache Spark serverless | The workload is Spark-native transformation and preparation |
| BigQuery | SQL engine with data quality scans | The transformation is SQL-based and benefits from large-scale SQL validation |
Execution environments in Agent Platform Pipelines isolate each component in its own container with its own runtime, language, and libraries. Containerization decouples the execution environment managed by the orchestrator from the custom code runtime inside the component, makes code reproducible between development, preproduction, and production, and lets experimental code in notebooks coexist with modularized production component code. Component interfaces declare expected types and properties for parameters, so the orchestrator validates inputs before a component executes and prevents failures from incorrect settings.
Resource allocation is configured per workload rather than per cluster, and the training service depends on worker-pool specifications to provision compute. A CustomJob defines machine type, accelerator type and count, and number of worker pools, with Cloud Tensor Processing Units (TPUs) or graphics processing units (GPUs) for deep-learning models such as large language models and diffusion models. Node pools can use A100, H100, H200, or B200 GPUs for training and L4 GPUs for inference, and jobs that tolerate interruption and implement checkpointing can use Spot VMs to reduce cost (opens in a new tab). Scheduling goodput is optimized with Dynamic Workload Scheduler or reservations for Agent Platform Managed Training, while data pipelines use Dataflow horizontal autoscaling to adjust worker instances based on CPU utilization, pipeline parallelism, and pending data. For online inference, Agent Platform endpoints autoscale replica count between a configured minimum and maximum based on traffic, CPU utilization, and replica utilization, with a minimum of two replicas for high availability.
Optimization with templates, scheduling, control flow, and reuse combines standardization, automation, and conditional execution to improve speed and cost efficiency. Reusable pipeline templates standardize workflows across projects, scheduled pipeline runs automate recurring retraining, and execution metrics with built-in logging, tracing, and Cloud Monitoring alerts track progress and resource usage. Automated parameterization and versioning create a version history for every pipeline run, so the same inputs and code produce comparable and repeatable results in operations (opens in a new tab).
Control flow and reuse prevent redundant work when the pipeline runs. Kubeflow Pipelines components provide core automation, while Control Flows enable advanced designs such as conditional gates that run or skip branches based on upstream outputs, such as deploying only when evaluation passes. The Agent Platform Feature Store serves as a centralized repository that supplies the same feature definitions to experimentation, continuous training, and online serving, which avoids training-serving skew and redundant feature engineering. For experimentation, data scientists fetch an offline extract from the feature store; for continuous training, the pipeline fetches a batch of up-to-date feature values; for online prediction, the prediction service batches feature values for the requested entity, such as customer demographics, product features, and session aggregates, and retrieves them together.
Reliability through validation, idempotency, and fault tolerance ensures pipelines stop for bad schemas, retrain for shifted data, and resume safely after failures. Data validation runs before training to decide whether to retrain or stop, and model validation runs after training to decide whether to promote the new model. Data validation distinguishes two conditions: data schema skews, such as unexpected features, missing features, or unexpected values, require stopping the pipeline for investigation, while data values skews, or significant changes in statistical properties, require retraining to capture changing patterns. Offline model validation then follows an ordered sequence that links training quality to safe deployment:
Idempotency and recovery depend on the ML metadata store, which records lineage so a failed run resumes from the most recent completed step without re-executing prior steps. Each pipeline execution records pipeline and component versions, start time, end time, and duration for each step, executor identity and parameter arguments, pointers to step artifacts such as prepared data and validation anomalies, pointer to the previous trained model for rollback, and evaluation metrics for training and testing sets. Fault tolerance extends to compute and data through asynchronous checkpointing for distributed training, Pathways for resilient and elastic training, Cloud Storage multi-regional buckets for data redundancy, and multi-zone or regional serving with load balancing to route traffic to healthy instances, supporting overall reliability (opens in a new tab) and performance (opens in a new tab) under failure and load.
Exam tip: Stop the pipeline for data schema skews that violate the expected schema, but retrain the model for data values skews that change statistical patterns.
Operational excellence for ML pipelines is the ability to detect failures, regressions, and drift quickly, recover safely, and prove what ran and why. Gemini Enterprise Agent Platform Pipelines sits at the center as the orchestrator, while Cloud Monitoring, Cloud Logging, and Model Monitoring on Gemini Enterprise Agent Platform provide the signals that trigger investigation, alerting, and retraining. Versioned artifacts, lineage records, and access controls then connect each run to its data, code, model, and deployment decision.
Pipeline run monitoring tracks the health of the orchestrated workflow itself, not just the final model score. Gemini Enterprise Agent Platform Pipelines emits execution metrics for progress and resource usage, and those metrics flow into Cloud Monitoring for dashboards and alerts. Detailed event context flows from each component to Cloud Logging for troubleshooting, while request flow across distributed steps is traced with Cloud Trace and code-level bottlenecks are profiled with Cloud Profiler.
Holistic coverage requires signals from every layer that a pipeline depends on. Infrastructure signals include CPU, GPU, and TPU utilization, memory, network throughput and latency, and disk I/O for both managed training and serving and self-managed resources such as GKE nodes and Cloud Run instances. Application signals follow the four golden signals of latency, traffic, error rate, and saturation, where saturation shows how close accelerators and other critical resources are to capacity limits. Dataflow ingestion rates, processed volumes, transformation latencies, and job success and failure rates show whether upstream data steps are starving or breaking downstream training and evaluation.
| Observability layer | What it tracks | Primary Google Cloud tools |
|---|---|---|
| Infrastructure and application | Processor and memory use, latency, traffic, error rate, saturation, accelerator temperature | Cloud Monitoring, Cloud Logging, Cloud Trace, Cloud Profiler, NVIDIA DCGM |
| Data pipeline and quality | Ingestion rate, transformation latency, schema adherence, freshness, completeness, lineage | Dataflow, TensorFlow Data Validation (TFDV), Knowledge Catalog, BigQuery |
| Model and generative output | Data drift, prediction drift, latency, throughput, toxicity, hallucination, token counts | Model Monitoring on Agent Platform, Gen AI evaluation service |
Specialized serving metrics are integrated rather than left in silos. Metrics from frameworks such as vLLM or NVIDIA Triton Inference Server are collected into Cloud Monitoring through Google Cloud Managed Service for Prometheus, alongside the metrics that Agent Platform exports directly to Cloud Monitoring. Training reliability (opens in a new tab) adds model FLOPS utilization (MFU), iterations per second, tokens per second, and tokens per device, so compute efficiency regressions are visible before they become cost (opens in a new tab) or deadline failures.
Continuous model and data monitoring detects when production behavior no longer matches training assumptions. Model Monitoring on Gemini Enterprise Agent Platform automatically detects performance degradation, data drift as changes in input distribution versus training, and prediction drift as changes in model outputs. Drift detection jobs are configured with thresholds and alerts, and real-time serving signals such as prediction latency, throughput, and error rates are tracked alongside them. When drift exceeds a threshold, the result can automatically trigger a continuous retraining or fine-tuning pipeline that uses updated data.
Data quality monitoring provides the early warning before model metrics move. TensorFlow Data Validation (TFDV) validates schemas and detects anomalies, while BigQuery supports large-scale SQL-based quality checks and Dataflow supports programmatic checks on streaming or batch data. Knowledge Catalog governs accuracy against ground truth or outlier rates, freshness against update SLAs, completeness through null-value and fill rates, and validity and consistency through schema and duplication checks. Validation results and metrics are stored in BigQuery for historical analysis, validation artifacts are archived in Cloud Storage, and trends visualized with Cloud Monitoring reveal drift that should trigger retraining.
Generative AI endpoints need additional output observability because failures appear as unsafe or incoherent text rather than a numeric error. Key signals include input-output token counts, hallucination or query-resolution failure rates, toxicity scores, user-feedback ratings, and shifts in prediction distributions. The Gen AI evaluation service automates assessment of outputs against defined criteria, while retrieval-augmented generation (RAG) systems add relevance of retrieved context, groundedness to sources, and vector-database query throughput. Feature-serving drift, output-schema violations, and unexpected output shifts generate alerts, with real-time validation events routed through Pub/Sub for response.
Boundary validation prevents bad data, configs, and files from propagating through the pipeline and causing expensive or silent failures. Validation applies to raw data, processed data, configurations, arguments, files, and model outputs at each component edge. Because the check runs before a component executes, errors are caught where they enter rather than after they corrupt training or deployment.
Automated data validation combines statistical, SQL, and streaming controls:
Configuration and file validation protect reproducibility and integrity. Configuration files in YAML or JSON are validated against schemas with libraries such as jsonschema before a run starts and before a component executes, while command-line arguments and pipeline parameters are checked for types, valid values, and required fields with libraries such as argparse. Component parameter types and properties are also enforced by the built-in input validation of Agent Platform Pipelines. Files such as CSV, Parquet, images, datasets, model artifacts, and evaluation reports are checked for format correctness, size, and checksums with Cloud Storage data validation, and validated versioned configs are stored in Cloud Storage or Artifact Registry.
Exam tip: Data schema skew stops the pipeline for investigation, while data value skew triggers retraining to capture changing patterns.
Robust pipeline operation combines proactive health checks, controlled release, and fast rollback. Health checks on AI-specific signals such as latency, throughput, GPU utilization, and drift can trigger replacement of faulty nodes, deployment of more capacity, or automatic retraining. Fault isolation uses the circuit breaker pattern with thresholds on error rates and latency, so a failing component opens the circuit and falls back to a simpler model or cached data instead of causing cascading failures. Redundancy comes from GKE multi-zone or regional clusters, Cloud Run services deployed across regions with Cloud Load Balancing routing to healthy instances, multi-region Cloud Storage buckets, asynchronous checkpointing for distributed training, and resilient training with Pathways.
Controlled deployment limits the blast radius of a new model version. Agent Platform endpoints split traffic for rolling deployment, while GKE supports canary deployment and A/B testing of model or agent variants. A canary release follows an ordered sequence where each step depends on the prior step succeeding:
Alerting and remediation close the loop from signal to action in operational excellence (opens in a new tab). Model Monitoring results and custom business metrics are integrated into Cloud Monitoring for unified dashboards and alerts, with notification channels such as email, Slack, or PagerDuty and automated remediation such as traffic rollback to the previous stable version. Service level objectives (SLOs) quantify acceptable reliability from the user perspective, for example 99.9% successful API responses, 95th-percentile inference latency below 300 ms, time to first token below 500 ms for 99% of requests, and harmful-output rate below 0.1%. Alerts on error-budget loss and burn rate provide early warning of reliability problems before SLOs are breached, linking performance (opens in a new tab) to user impact.
Versioning and lineage make every pipeline run reproducible, debuggable, and auditable from raw data to prediction. Model Registry tracks model versions and metadata and links each version to training parameters, evaluation metrics, dataset version, code version, and framework or foundation-model details, including fine-tuning parameters and generative quality and safety results for foundation models. Model files and pretrained weights are stored in Cloud Storage, while serving and training container images are versioned and tagged in Artifact Registry. Experiments on Gemini Enterprise Agent Platform logs parameters, code and dataset versions, and training and evaluation results for comparison and debugging, with Agent Platform TensorBoard for metric visualization and Agent Platform Vizier for hyperparameter optimization history.
Lineage records connect pipeline executions to the artifacts they consumed and produced. Agent Platform ML Metadata logs data sources, transformations, model parameters, and experiment results, including lineage of pipeline artifacts for debugging and root-cause analysis. Knowledge Catalog provides the enterprise data catalog, automatically discovering assets in BigQuery, Cloud Storage, and Pub/Sub, enriching them with ownership, sensitivity, and lineage, and enabling search for model and dataset resources. Each pipeline execution records pipeline and component versions, start and end times, executor, parameter arguments, pointers to intermediate artifacts such as prepared data and computed statistics, pointers to prior model versions for rollback and comparison, and training and test evaluation metrics.
Governance enforces who can change what and preserves evidence for compliance under security (opens in a new tab) controls. Identity and Access Management (IAM) applies least-privilege, dedicated service accounts, such as a training service account with read access to one training bucket and write access to Model Registry but no access to production endpoints, with IAM Conditions for attribute-based control. Cloud Audit Logs capture API calls, data access, and configuration changes for Agent Platform endpoints, models, and datasets, streaming to Cloud Logging for real-time analysis, exporting to BigQuery for long-term audit, and integrating with security information and event management (SIEM) systems. Sensitive Data Protection checks scan pipelines and storage for personally identifiable information (PII), private endpoints with Private Service Connect isolate inference inside a VPC network, and generative audit trails record who accessed models or tools, what data was used for fine-tuning or prompting, and what queries reached production endpoints.
Use Gemini Enterprise Agent Platform Pipelines when serverless operation, automatic artifact tracking, scheduled runs, and execution metrics outweigh the need for direct cluster control. Choose self-managed Kubeflow or self-hosted Airflow when portability across Kubernetes environments and direct control of the cluster outweigh maintenance overhead and the need to manage scaling, upgrades, and reliability yourself.
Choose TensorFlow Extended (TFX) when the workflow processes terabytes of structured or text data in TensorFlow and benefits from built-in Apache Beam integration by selecting the Dataflow runner at pipeline build time. Choose Kubeflow Pipelines (KFP) SDK v2.0 or later for general-purpose modular components, control-flow logic, and broad reuse across training, evaluation, deployment, prompt management, batched inference, human-in-the-loop evaluation, and coordination of agent components.
Built-in TensorFlow Extended or Kubeflow Pipelines Beam integration with the Dataflow runner is least complex with fastest development and least dependency management but least custom control. Calling a Dataflow template from a pipeline component is intermediate complexity and isolates data processing for reuse across pipelines with separate template versioning. Embedding a custom Beam pipeline with the Dataflow runner inside the component is most complex with maximum control over logic and containers, but the team must manage all pipeline dependencies.
For data schema skew such as unexpected features, missing features, or unexpected values, stop the pipeline for investigation. For data values skew where statistical properties change significantly, retrain the model to capture the changing patterns.
Last updated