From 4df1b186ec9b8131a9d78941fdd1c6f695049748 Mon Sep 17 00:00:00 2001 From: Bharath Krishna Date: Mon, 4 Mar 2024 12:57:46 -0800 Subject: [PATCH 1/2] python sdk - fixed generate_name when name not provided --- sdk/python/v1beta1/kubeflow/katib/api/katib_client.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sdk/python/v1beta1/kubeflow/katib/api/katib_client.py b/sdk/python/v1beta1/kubeflow/katib/api/katib_client.py index c52b55ab482..f708dd75d5c 100644 --- a/sdk/python/v1beta1/kubeflow/katib/api/katib_client.py +++ b/sdk/python/v1beta1/kubeflow/katib/api/katib_client.py @@ -93,6 +93,12 @@ def create_experiment( namespace = namespace or self.namespace + name = experiment.metadata.get('name') + generate_name = experiment.metadata.get('generateName') + + if not name and not generate_name: + experiment.metadata.generateName = "experiment-" #prefix + try: self.custom_api.create_namespaced_custom_object( constants.KUBEFLOW_GROUP, From db68f0d1f8c8f6e92f705db75d0d4237c7d8ff06 Mon Sep 17 00:00:00 2001 From: Bharath Krishna Date: Mon, 4 Mar 2024 13:00:45 -0800 Subject: [PATCH 2/2] prefix change Signed-off-by: Bharath Krishna --- sdk/python/v1beta1/kubeflow/katib/api/katib_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/python/v1beta1/kubeflow/katib/api/katib_client.py b/sdk/python/v1beta1/kubeflow/katib/api/katib_client.py index f708dd75d5c..d3cfd7ffa47 100644 --- a/sdk/python/v1beta1/kubeflow/katib/api/katib_client.py +++ b/sdk/python/v1beta1/kubeflow/katib/api/katib_client.py @@ -97,7 +97,7 @@ def create_experiment( generate_name = experiment.metadata.get('generateName') if not name and not generate_name: - experiment.metadata.generateName = "experiment-" #prefix + experiment.metadata.generateName = "exp-" #prefix try: self.custom_api.create_namespaced_custom_object(