Skip to content

fix: Fix integration test error in test_default_right_size_and_deploy_unregistered_base_model #3701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion tests/integ/test_inference_recommender.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import pytest

from sagemaker import image_uris
from sagemaker.model import Model
from sagemaker.sklearn.model import SKLearnModel, SKLearnPredictor
from sagemaker.utils import unique_name_from_base
Expand Down Expand Up @@ -248,11 +249,20 @@ def default_right_sized_unregistered_base_model(sagemaker_session, cpu_instance_
ir_job_name = unique_name_from_base("test-ir-right-size-job-name")
model_data = sagemaker_session.upload_data(path=IR_SKLEARN_MODEL)
payload_data = sagemaker_session.upload_data(path=IR_SKLEARN_PAYLOAD)
region = sagemaker_session._region_name
image_uri = image_uris.retrieve(
framework="sklearn", region=region, version="1.0-1", image_scope="inference"
)

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

model = Model(model_data=model_data, role=role_arn, entry_point=IR_SKLEARN_ENTRY_POINT)
model = Model(
model_data=model_data,
role=role_arn,
entry_point=IR_SKLEARN_ENTRY_POINT,
image_uri=image_uri,
)

return (
model.right_size(
Expand Down