File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
sagemaker-serve/src/sagemaker/serve Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -4439,11 +4439,21 @@ def _deploy_model_customization(
44394439 ),
44404440 )
44414441
4442- InferenceComponent .create (
4443- inference_component_name = adapter_ic_name ,
4444- endpoint_name = endpoint_name ,
4445- specification = adapter_ic_spec ,
4446- )
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
44474457 logger .info ("Created adapter InferenceComponent: '%s'" , adapter_ic_name )
44484458
44494459 else :
You can’t perform that action at this time.
0 commit comments