Skip to content

Commit 2366fc4

Browse files
knakadnadiaya
authored andcommitted
change: fix test_auto_ml tests for regions without ml.c4.xlarge hosts. (#1199)
1 parent a7799e4 commit 2366fc4

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

tests/integ/test_auto_ml.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
ROLE = "SageMakerRole"
2828
PREFIX = "sagemaker/beta-automl-xgboost"
29-
HOSTING_INSTANCE_TYPE = "ml.c4.xlarge"
3029
AUTO_ML_INSTANCE_TYPE = "ml.m5.2xlarge"
3130
INSTANCE_COUNT = 1
3231
RESOURCE_POOLS = [{"InstanceType": AUTO_ML_INSTANCE_TYPE, "PoolSize": INSTANCE_COUNT}]
@@ -216,7 +215,7 @@ def test_best_candidate(sagemaker_session):
216215
tests.integ.test_region() in tests.integ.NO_AUTO_ML_REGIONS,
217216
reason="AutoML is not supported in the region yet.",
218217
)
219-
def test_deploy_best_candidate(sagemaker_session):
218+
def test_deploy_best_candidate(sagemaker_session, cpu_instance_type):
220219
auto_ml_utils.create_auto_ml_job_if_not_exist(sagemaker_session)
221220

222221
auto_ml = AutoML(
@@ -229,7 +228,7 @@ def test_deploy_best_candidate(sagemaker_session):
229228
auto_ml.deploy(
230229
candidate=best_candidate,
231230
initial_instance_count=INSTANCE_COUNT,
232-
instance_type=HOSTING_INSTANCE_TYPE,
231+
instance_type=cpu_instance_type,
233232
endpoint_name=endpoint_name,
234233
)
235234

@@ -244,7 +243,7 @@ def test_deploy_best_candidate(sagemaker_session):
244243
tests.integ.test_region() in tests.integ.NO_AUTO_ML_REGIONS,
245244
reason="AutoML is not supported in the region yet.",
246245
)
247-
def test_candidate_estimator_default_rerun_and_deploy(sagemaker_session):
246+
def test_candidate_estimator_default_rerun_and_deploy(sagemaker_session, cpu_instance_type):
248247
auto_ml_utils.create_auto_ml_job_if_not_exist(sagemaker_session)
249248

250249
auto_ml = AutoML(
@@ -261,7 +260,7 @@ def test_candidate_estimator_default_rerun_and_deploy(sagemaker_session):
261260
candidate_estimator.fit(inputs)
262261
auto_ml.deploy(
263262
initial_instance_count=INSTANCE_COUNT,
264-
instance_type=HOSTING_INSTANCE_TYPE,
263+
instance_type=cpu_instance_type,
265264
candidate=candidate,
266265
endpoint_name=endpoint_name,
267266
)
@@ -277,7 +276,7 @@ def test_candidate_estimator_default_rerun_and_deploy(sagemaker_session):
277276
tests.integ.test_region() in tests.integ.NO_AUTO_ML_REGIONS,
278277
reason="AutoML is not supported in the region yet.",
279278
)
280-
def test_candidate_estimator_rerun_with_optional_args(sagemaker_session):
279+
def test_candidate_estimator_rerun_with_optional_args(sagemaker_session, cpu_instance_type):
281280
auto_ml_utils.create_auto_ml_job_if_not_exist(sagemaker_session)
282281

283282
auto_ml = AutoML(
@@ -294,7 +293,7 @@ def test_candidate_estimator_rerun_with_optional_args(sagemaker_session):
294293
candidate_estimator.fit(inputs, encrypt_inter_container_traffic=True)
295294
auto_ml.deploy(
296295
initial_instance_count=INSTANCE_COUNT,
297-
instance_type=HOSTING_INSTANCE_TYPE,
296+
instance_type=cpu_instance_type,
298297
candidate=candidate,
299298
endpoint_name=endpoint_name,
300299
)

0 commit comments

Comments
 (0)