Skip to content

Commit

Permalink
Update user guide for namespace label in Katib Python SDK example (#3976
Browse files Browse the repository at this point in the history
)

* doc(katib): add guidance of namespace label configuration in Getting-Started

Signed-off-by: Xinmin Du <2812493086@qq.com>

* doc(katib): move guidance to Metrics Collector, add note in getting-start

Signed-off-by: Xinmin Du <2812493086@qq.com>

* Update content/en/docs/components/katib/user-guides/metrics-collector.md

Co-authored-by: Shao Wang <77665902+Electronic-Waste@users.noreply.github.com>
Signed-off-by: Du Xinmin <2812493086@qq.com>

---------

Signed-off-by: Xinmin Du <2812493086@qq.com>
Signed-off-by: Du Xinmin <2812493086@qq.com>
Co-authored-by: Shao Wang <77665902+Electronic-Waste@users.noreply.github.com>
  • Loading branch information
Doris-xm and Electronic-Waste authored Jan 26, 2025
1 parent 59c9e6c commit 2a5ef22
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
5 changes: 5 additions & 0 deletions content/en/docs/components/katib/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ If you install Katib as part of Kubeflow Platform, you can open a new
**Note**. If you use Katib within Kubeflow Platform to run this example, you need to use this
namespace: `KatibClient(namespace="kubeflow-user-example-com")`.

**Note**. The `kubeflow` namespace is pre-configured with the required label
`katib.kubeflow.org/metrics-collector-injection: enabled` for metrics collection. If you want to use pull-based metrics collector
in other namespaces, you can attach this label following the instructions in the
[Metrics Collector](/docs/components/katib/user-guides/metrics-collector/#prerequisites).

```python
# [1] Create an objective function.
def objective(parameters):
Expand Down
24 changes: 24 additions & 0 deletions content/en/docs/components/katib/user-guides/metrics-collector.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,30 @@ weight = 40

This guide describes how Katib metrics collector works.

## Prerequisites

Before running your hyperparameter tuning Katib Experiment with Python SDK,
ensure the namespace label `katib.kubeflow.org/metrics-collector-injection: enabled`
is present. This label enables the sidecar container injection for pull-based metrics collectors to collect metrics during the experiment.

You can configure the namespace by adding the following label `katib.kubeflow.org/metrics-collector-injection: enabled`
as is shown in the sample code:

```yaml
apiVersion: v1
kind: Namespace
metadata:
name: <your-namespace>
labels:
katib.kubeflow.org/metrics-collector-injection: enabled
```
Or you can add the label to an existing namespace using the following command:
```bash
kubectl label namespace <your-namespace> katib.kubeflow.org/metrics-collector-injection=enabled
```

## Overview

There are two ways to collect metrics:
Expand Down

0 comments on commit 2a5ef22

Please sign in to comment.