Skip to content

Commit 71ea233

Browse files
author
Roja Reddy Sareddy
committed
model builder fixes
1 parent 8a763c6 commit 71ea233

1 file changed

Lines changed: 8 additions & 15 deletions

File tree

sagemaker-serve/src/sagemaker/serve/model_builder.py

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)