@@ -4428,6 +4428,9 @@ def _deploy_model_customization(
44284428 base_ic = InferenceComponent .get (inference_component_name = base_ic_name )
44294429 base_ic .wait_for_status ("InService" )
44304430
4431+ # Wait for endpoint to stabilize after base IC creation
4432+ endpoint .wait_for_status ("InService" )
4433+
44314434 # Deploy adapter IC
44324435 adapter_ic_name = inference_component_name or f"{ endpoint_name } -adapter"
44334436 adapter_s3_uri = getattr (self , "_adapter_s3_uri" , None )
@@ -4439,21 +4442,11 @@ def _deploy_model_customization(
44394442 ),
44404443 )
44414444
4442- for attempt in range (3 ):
4443- try :
4444- InferenceComponent .create (
4445- inference_component_name = adapter_ic_name ,
4446- endpoint_name = endpoint_name ,
4447- specification = adapter_ic_spec ,
4448- )
4449- break
4450- except ClientError as e :
4451- if "Could not find endpoint" in str (e ) and attempt < 2 :
4452- import time
4453- logger .info ("Endpoint not yet visible, retrying in %ds..." , 5 * (attempt + 1 ))
4454- time .sleep (5 * (attempt + 1 ))
4455- else :
4456- raise
4445+ InferenceComponent .create (
4446+ inference_component_name = adapter_ic_name ,
4447+ endpoint_name = endpoint_name ,
4448+ specification = adapter_ic_spec ,
4449+ )
44574450 logger .info ("Created adapter InferenceComponent: '%s'" , adapter_ic_name )
44584451
44594452 else :
0 commit comments