Skip to content

Commit

Permalink
test(sdk): add namespace_labels.
Browse files Browse the repository at this point in the history
Signed-off-by: Electronic-Waste <[email protected]>
  • Loading branch information
Electronic-Waste committed Jul 31, 2024
1 parent 4edc40c commit 92a3bea
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/e2e/v1beta1/scripts/gh-actions/run-e2e-tune-api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from kubeflow.katib import KatibClient
from kubeflow.katib import search
from kubernetes import client
from verify import verify_experiment_results

# Experiment timeout is 40 min.
Expand Down Expand Up @@ -71,6 +72,11 @@ def objective(parameters):

katib_client = KatibClient()

namespace_labels = client.CoreV1Api().read_namespace(args.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(args.namespace, {'metadata': {'labels': namespace_labels}})

# Test with run_e2e_experiment_create_by_tune
exp_name = "tune-example"
exp_namespace = args.namespace
Expand Down

0 comments on commit 92a3bea

Please sign in to comment.