Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:Kubeflow Pipelines Load Component From URL

From Leeroopedia
Sources Kubeflow Pipelines, KFP Components
Domains ML_Pipelines, Component_Reuse
Last Updated 2026-02-13

Overview

Concrete tool for loading reusable pipeline components from remote YAML URLs provided by the KFP components module.

Description

kfp.components.load_component_from_url() fetches a YAML component specification from a URL and returns a callable component factory function. This is used at module level to define component operators that can be called within pipeline functions. URLs typically point to specific Git commit SHAs for reproducibility.

Usage

Call at module level to load remote components before pipeline definition. The returned factory is called within @dsl.pipeline functions.

Code Reference

Source Location: Repository: kubeflow/pipelines, File: samples/core/XGBoost/xgboost_sample.py (L4-21)

Signature:

def load_component_from_url(
    url: str,
    auth: Optional[Tuple[str, str]] = None,
) -> Callable:
    """Loads a component from a URL pointing to a component YAML file."""

Import:

from kfp import components

I/O Contract

Direction Name Type Required Description
Input url str Yes URL to component YAML file
Output return Callable A component factory function with parameters matching the YAML spec's inputs

Usage Examples

Loading XGBoost components (xgboost_sample.py)

from kfp import components

chicago_taxi_dataset_op = components.load_component_from_url(
    'https://raw.githubusercontent.com/kubeflow/pipelines/e3337b8bdcd63636934954e592d4b32c95b49129/components/datasets/Chicago%20Taxi/component.yaml'
)
xgboost_train_on_csv_op = components.load_component_from_url(
    'https://raw.githubusercontent.com/kubeflow/pipelines/567c04c51ff00a1ee525b3458425b17adbe3df61/components/XGBoost/Train/component.yaml'
)
xgboost_predict_on_csv_op = components.load_component_from_url(
    'https://raw.githubusercontent.com/kubeflow/pipelines/31939086d66d633732f75300ce69eb60e9fb0269/components/XGBoost/Predict/component.yaml'
)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment