Skip to content

Commit

Permalink
* refactor(sdk): added option for custom metric collector for tune in…
Browse files Browse the repository at this point in the history
… katlib_client.py

Signed-off-by: prakhar479 [email protected]
  • Loading branch information
prakhar479 committed Aug 9, 2024
1 parent 8eb0e86 commit 1489e53
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sdk/python/v1beta1/kubeflow/katib/api/katib_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ def tune(
pip_index_url: The PyPI url from which to install Python packages.
metrics_collector_config: Specify the config of metrics collector,
for example, `metrics_collector_config = {"kind": "Push"}`.
Currently, we only support `StdOut` and `Push` metrics collector.
for using custom metric collectors use "custom_collector" key,
for example, `metrics_collector_config = {"custom_collector": "prometheus "}`.
Raises:
ValueError: Function arguments have incorrect type or value.
TimeoutError: Timeout to create Katib Experiment.
Expand Down Expand Up @@ -387,7 +387,9 @@ def tune(
# Add metrics collector to the Katib Experiment.
# Up to now, We only support parameter `kind`, of which default value is `StdOut`, to specify the kind of metrics collector.
experiment.spec.metrics_collector_spec = models.V1beta1MetricsCollectorSpec(
collector=models.V1beta1CollectorSpec(kind=metrics_collector_config["kind"])
collector=models.V1beta1CollectorSpec(
kind=metrics_collector_config["kind"],
custom_collector=metrics_collector_config["custom_collector"])
)

# Create Trial specification.
Expand Down

0 comments on commit 1489e53

Please sign in to comment.