Skip to content

comet_ml.integration.kubeflow ¶

comet_logger_component ¶

comet_logger_component(
    api_key=None,
    project_name=None,
    workspace=None,
    packages_to_install=None,
    base_image=None,
)

Inject the Comet Logger component which continuously track and report the current pipeline status to Comet.ml.

Parameters:

  • api_key (str, default: None ) –

    Your Comet API Key, if not provided, the value set in the configuration system will be used.

  • project_name (str, default: None ) –

    The project name where all of the pipeline tasks are logged. If not provided, the value set in the configuration system will be used.

  • workspace (str, default: None ) –

    The workspace name where all of the pipeline tasks are logged. If not provided, the value set in the configuration system will be used.

Example
1
2
3
4
5
@dsl.pipeline(name='ML training pipeline')
def ml_training_pipeline():
    import comet_ml.integration.kubeflow

    comet_ml.integration.kubeflow.comet_logger_component()

initialize_comet_logger ¶

initialize_comet_logger(experiment, workflow_uid, pod_name)

Logs the Kubeflow task identifiers needed to track your pipeline status in Comet.ml. You need to call this function from every components you want to track with Comet.ml.

Parameters:

  • experiment (Experiment) –

    An already created Experiment object.

  • workflow_uid (str) –

    The Kubeflow workflow uid, see below to get it automatically from Kubeflow.

  • pod_name (str) –

    The Kubeflow pod name, see below to get it automatically from Kubeflow.

Example
1
2
3
4
5
6
7
8
def my_component() -> None:
    import comet_ml.integration.kubeflow

    experiment = comet_ml.Experiment()
    workflow_uid = "{{workflow.uid}}"
    pod_name = "{{pod_name}}"

    comet_ml.integration.kubeflow.initialize_comet_logger(experiment, workflow_uid, pod_name)
Nov. 18, 2024