Commit c74b4d6 1 parent 274060f commit c74b4d6 Copy full SHA for c74b4d6
File tree 2 files changed +12
-14
lines changed
sdk/python/v1beta1/kubeflow/katib/api
2 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -560,20 +560,6 @@ class name in this argument.
560
560
# Create PVC for the Storage Initializer.
561
561
# TODO (helenxie-bit): PVC Creation should be part of Katib Controller.
562
562
try :
563
- if not utils .is_valid_pvc_name (name ):
564
- raise ValueError (
565
- f"""
566
- Invalid PVC name '{ name } '. It must comply with RFC 1123.
567
-
568
- A lowercase RFC 1123 subdomain must consist of lowercase
569
- alphanumeric characters, '-' or '.',
570
- and must start and end with an alphanumeric character.
571
- For example, 'example.com' is valid.
572
- The regex used for validation is:
573
- '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\ .[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'
574
- """
575
- )
576
-
577
563
self .core_api .create_namespaced_persistent_volume_claim (
578
564
namespace = namespace ,
579
565
body = training_utils .get_pvc_spec (
@@ -583,6 +569,11 @@ class name in this argument.
583
569
),
584
570
)
585
571
except Exception as e :
572
+ if hasattr (e , "status" ) and e .status == 422 :
573
+ raise ValueError (
574
+ f"An Experiment with the name { name } is not valid."
575
+ )
576
+
586
577
pvc_list = self .core_api .list_namespaced_persistent_volume_claim (
587
578
namespace = namespace
588
579
)
Original file line number Diff line number Diff line change @@ -310,6 +310,13 @@ def create_experiment(
310
310
},
311
311
ValueError ,
312
312
),
313
+ (
314
+ "wrong name format" ,
315
+ {
316
+ "name" : "Llama3.1-fine-tune" ,
317
+ },
318
+ ValueError ,
319
+ ),
313
320
(
314
321
"invalid hybrid parameters - objective and model_provider_parameters" ,
315
322
{
You can’t perform that action at this time.
0 commit comments