Skip to content

Commit 05f83b5

Browse files
committed
Formatting and convention fix
1 parent bb834b4 commit 05f83b5

File tree

8 files changed

+49
-35
lines changed

8 files changed

+49
-35
lines changed

src/sagemaker/automl/automl.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,9 @@ def deploy(
402402
volume_size (int): The size, in GB, of the ML storage volume attached to individual
403403
inference instance associated with the production variant. Currenly only Amazon EBS
404404
gp2 storage volumes are supported.
405-
model_data_download_timeout (int): The timeout value, in seconds, to download and extract
406-
model data from Amazon S3 to the individual inference instance associated with this
407-
production variant.
405+
model_data_download_timeout (int): The timeout value, in seconds, to download and
406+
extract model data from Amazon S3 to the individual inference instance associated
407+
with this production variant.
408408
container_startup_health_check_timeout (int): The timeout value, in seconds, for your
409409
inference container to pass health check by SageMaker Hosting. For more information
410410
about health check see:
@@ -434,11 +434,11 @@ def deploy(
434434
deserializer=deserializer,
435435
endpoint_name=endpoint_name,
436436
kms_key=model_kms_key,
437+
tags=tags,
438+
wait=wait,
437439
volume_size=volume_size,
438440
model_data_download_timeout=model_data_download_timeout,
439441
container_startup_health_check_timeout=container_startup_health_check_timeout,
440-
tags=tags,
441-
wait=wait,
442442
)
443443

444444
def _check_problem_type_and_job_objective(self, problem_type, job_objective):

src/sagemaker/estimator.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1350,9 +1350,9 @@ def deploy(
13501350
volume_size (int): The size, in GB, of the ML storage volume attached to individual
13511351
inference instance associated with the production variant. Currenly only Amazon EBS
13521352
gp2 storage volumes are supported.
1353-
model_data_download_timeout (int): The timeout value, in seconds, to download and extract
1354-
model data from Amazon S3 to the individual inference instance associated with this
1355-
production variant.
1353+
model_data_download_timeout (int): The timeout value, in seconds, to download and
1354+
extract model data from Amazon S3 to the individual inference instance associated
1355+
with this production variant.
13561356
container_startup_health_check_timeout (int): The timeout value, in seconds, for your
13571357
inference container to pass health check by SageMaker Hosting. For more information
13581358
about health check see:

src/sagemaker/huggingface/model.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,9 @@ def deploy(
275275
volume_size (int): The size, in GB, of the ML storage volume attached to individual
276276
inference instance associated with the production variant. Currenly only Amazon EBS
277277
gp2 storage volumes are supported.
278-
model_data_download_timeout (int): The timeout value, in seconds, to download and extract
279-
model data from Amazon S3 to the individual inference instance associated with this
280-
production variant.
278+
model_data_download_timeout (int): The timeout value, in seconds, to download and
279+
extract model data from Amazon S3 to the individual inference instance associated
280+
with this production variant.
281281
container_startup_health_check_timeout (int): The timeout value, in seconds, for your
282282
inference container to pass health check by SageMaker Hosting. For more information
283283
about health check see:

src/sagemaker/model.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1098,9 +1098,9 @@ def deploy(
10981098
volume_size (int): The size, in GB, of the ML storage volume attached to individual
10991099
inference instance associated with the production variant. Currenly only Amazon EBS
11001100
gp2 storage volumes are supported.
1101-
model_data_download_timeout (int): The timeout value, in seconds, to download and extract
1102-
model data from Amazon S3 to the individual inference instance associated with this
1103-
production variant.
1101+
model_data_download_timeout (int): The timeout value, in seconds, to download and
1102+
extract model data from Amazon S3 to the individual inference instance associated
1103+
with this production variant.
11041104
container_startup_health_check_timeout (int): The timeout value, in seconds, for your
11051105
inference container to pass health check by SageMaker Hosting. For more information
11061106
about health check see:

src/sagemaker/pipeline.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,9 @@ def deploy(
176176
volume_size (int): The size, in GB, of the ML storage volume attached to individual
177177
inference instance associated with the production variant. Currenly only Amazon EBS
178178
gp2 storage volumes are supported.
179-
model_data_download_timeout (int): The timeout value, in seconds, to download and extract
180-
model data from Amazon S3 to the individual inference instance associated with this
181-
production variant.
179+
model_data_download_timeout (int): The timeout value, in seconds, to download and
180+
extract model data from Amazon S3 to the individual inference instance associated
181+
with this production variant.
182182
container_startup_health_check_timeout (int): The timeout value, in seconds, for your
183183
inference container to pass health check by SageMaker Hosting. For more information
184184
about health check see:
@@ -204,7 +204,9 @@ def deploy(
204204
)
205205

206206
production_variant = sagemaker.production_variant(
207-
self.name, instance_type, initial_instance_count,
207+
self.name,
208+
instance_type,
209+
initial_instance_count,
208210
volume_size=volume_size,
209211
model_data_download_timeout=model_data_download_timeout,
210212
container_startup_health_check_timeout=container_startup_health_check_timeout,

src/sagemaker/session.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3010,9 +3010,9 @@ def create_endpoint_config(
30103010
volume_size (int): The size, in GB, of the ML storage volume attached to individual
30113011
inference instance associated with the production variant. Currenly only Amazon EBS
30123012
gp2 storage volumes are supported.
3013-
model_data_download_timeout (int): The timeout value, in seconds, to download and extract
3014-
model data from Amazon S3 to the individual inference instance associated with this
3015-
production variant.
3013+
model_data_download_timeout (int): The timeout value, in seconds, to download and
3014+
extract model data from Amazon S3 to the individual inference instance associated
3015+
with this production variant.
30163016
container_startup_health_check_timeout (int): The timeout value, in seconds, for your
30173017
inference container to pass health check by SageMaker Hosting. For more information
30183018
about health check see:

tests/unit/sagemaker/model/test_deploy.py

+18-10
Original file line numberDiff line numberDiff line change
@@ -484,30 +484,38 @@ def test_deploy_predictor_cls(production_variant, sagemaker_session):
484484
assert predictor_async.endpoint_name == endpoint_name_async
485485
assert predictor_async.sagemaker_session == sagemaker_session
486486

487+
487488
@patch("sagemaker.production_variant")
488489
@patch("sagemaker.model.Model.prepare_container_def")
489490
@patch("sagemaker.utils.name_from_base", return_value=MODEL_NAME)
490-
def test_deploy_customized_volume_size_and_timeout(name_from_base, prepare_container_def, production_variant, sagemaker_session):
491+
def test_deploy_customized_volume_size_and_timeout(
492+
name_from_base, prepare_container_def, production_variant, sagemaker_session
493+
):
491494
volume_size_gb = 256
492495
model_data_download_timeout_sec = 1800
493496
startup_health_check_timeout_sec = 1800
494497

495498
production_variant_result = copy.deepcopy(BASE_PRODUCTION_VARIANT)
496-
production_variant_result.update({
497-
'VolumeSizeInGB': volume_size_gb,
498-
'ModelDataDownloadTimeoutInSeconds': model_data_download_timeout_sec,
499-
'ContainerStartupHealthCheckTimeoutInSeconds': startup_health_check_timeout_sec,
500-
})
499+
production_variant_result.update(
500+
{
501+
"VolumeSizeInGB": volume_size_gb,
502+
"ModelDataDownloadTimeoutInSeconds": model_data_download_timeout_sec,
503+
"ContainerStartupHealthCheckTimeoutInSeconds": startup_health_check_timeout_sec,
504+
}
505+
)
501506
production_variant.return_value = production_variant_result
502507

503508
container_def = {"Image": MODEL_IMAGE, "Environment": {}, "ModelDataUrl": MODEL_DATA}
504509
prepare_container_def.return_value = container_def
505510

506511
model = Model(MODEL_IMAGE, MODEL_DATA, role=ROLE, sagemaker_session=sagemaker_session)
507-
model.deploy(instance_type=INSTANCE_TYPE, initial_instance_count=INSTANCE_COUNT,
508-
volume_size=volume_size_gb,
509-
model_data_download_timeout=model_data_download_timeout_sec,
510-
container_startup_health_check_timeout=startup_health_check_timeout_sec)
512+
model.deploy(
513+
instance_type=INSTANCE_TYPE,
514+
initial_instance_count=INSTANCE_COUNT,
515+
volume_size=volume_size_gb,
516+
model_data_download_timeout=model_data_download_timeout_sec,
517+
container_startup_health_check_timeout=startup_health_check_timeout_sec,
518+
)
511519

512520
name_from_base.assert_called_with(MODEL_IMAGE)
513521
assert 2 == name_from_base.call_count

tests/unit/test_estimator.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -3332,10 +3332,14 @@ def test_deploy_with_customized_volume_size_timeout(create_model, sagemaker_sess
33323332
model = MagicMock()
33333333
create_model.return_value = model
33343334

3335-
estimator.deploy(INSTANCE_COUNT, INSTANCE_TYPE, endpoint_name=endpoint_name,
3336-
volume_size=volume_size_gb,
3337-
model_data_download_timeout=model_data_download_timeout_sec,
3338-
container_startup_health_check_timeout=startup_health_check_timeout_sec)
3335+
estimator.deploy(
3336+
INSTANCE_COUNT,
3337+
INSTANCE_TYPE,
3338+
endpoint_name=endpoint_name,
3339+
volume_size=volume_size_gb,
3340+
model_data_download_timeout=model_data_download_timeout_sec,
3341+
container_startup_health_check_timeout=startup_health_check_timeout_sec,
3342+
)
33393343

33403344
model.deploy.assert_called_with(
33413345
instance_type=INSTANCE_TYPE,

0 commit comments

Comments
 (0)