Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions sdk/python/v1beta1/kubeflow/katib/api/katib_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,14 @@ class name in this argument.
raise ValueError("Please specify name for the Experiment.")

namespace = namespace or self.namespace
namespace_labels = client.CoreV1Api().read_namespace(namespace).metadata.labels
if "katib.kubeflow.org/metrics-collector-injection" not in namespace_labels:
namespace_labels["katib.kubeflow.org/metrics-collector-injection"] = (
"enabled"
)
client.CoreV1Api().patch_namespace(
namespace, {"metadata": {"labels": namespace_labels}}
)
Comment on lines +379 to +386
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also encountered this error and fixed it with kubectl label command. Is this label designed on purpose for users who want to enable sidecar container injection? I'm curious about this👀 @kubeflow/wg-automl-leads

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should patch the namespace in our SDK with this label.
If users want to create Katib Experiments in their namespace, the label must be presented.
As you can see we apply this label to the namespace:

We just need to add it to the Katib documentation guides.
@Electronic-Waste @helenxie-bit Please can you create tracking issue to update docs ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll create an issue describing this


# Create Katib Experiment template.
experiment = models.V1beta1Experiment(
Expand Down