From 92a3beaa9da954a1e5599a87ec458ddcef8ceb3e Mon Sep 17 00:00:00 2001 From: Electronic-Waste <2690692950@qq.com> Date: Wed, 31 Jul 2024 13:56:31 +0000 Subject: [PATCH] test(sdk): add namespace_labels. Signed-off-by: Electronic-Waste <2690692950@qq.com> --- test/e2e/v1beta1/scripts/gh-actions/run-e2e-tune-api.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/e2e/v1beta1/scripts/gh-actions/run-e2e-tune-api.py b/test/e2e/v1beta1/scripts/gh-actions/run-e2e-tune-api.py index 458420dfe42..b2f55cfeaf2 100644 --- a/test/e2e/v1beta1/scripts/gh-actions/run-e2e-tune-api.py +++ b/test/e2e/v1beta1/scripts/gh-actions/run-e2e-tune-api.py @@ -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. @@ -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