Skip to content

Commit 9e5dca6

Browse files
SSRraymondRaymond Liu
and
Raymond Liu
authored
fix: Fix integration test error in test_default_right_size_and_deploy_unregistered_base_model (aws#3701)
Co-authored-by: Raymond Liu <[email protected]>
1 parent 67dc885 commit 9e5dca6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/integ/test_inference_recommender.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import pytest
1818

19+
from sagemaker import image_uris
1920
from sagemaker.model import Model
2021
from sagemaker.sklearn.model import SKLearnModel, SKLearnPredictor
2122
from sagemaker.utils import unique_name_from_base
@@ -248,11 +249,20 @@ def default_right_sized_unregistered_base_model(sagemaker_session, cpu_instance_
248249
ir_job_name = unique_name_from_base("test-ir-right-size-job-name")
249250
model_data = sagemaker_session.upload_data(path=IR_SKLEARN_MODEL)
250251
payload_data = sagemaker_session.upload_data(path=IR_SKLEARN_PAYLOAD)
252+
region = sagemaker_session._region_name
253+
image_uri = image_uris.retrieve(
254+
framework="sklearn", region=region, version="1.0-1", image_scope="inference"
255+
)
251256

252257
iam_client = sagemaker_session.boto_session.client("iam")
253258
role_arn = iam_client.get_role(RoleName="SageMakerRole")["Role"]["Arn"]
254259

255-
model = Model(model_data=model_data, role=role_arn, entry_point=IR_SKLEARN_ENTRY_POINT)
260+
model = Model(
261+
model_data=model_data,
262+
role=role_arn,
263+
entry_point=IR_SKLEARN_ENTRY_POINT,
264+
image_uri=image_uri,
265+
)
256266

257267
return (
258268
model.right_size(

0 commit comments

Comments
 (0)