2626MODEL_DATA = "s3://bucket/model.tar.gz"
2727MODEL_IMAGE = "mi"
2828ENTRY_POINT = "blah.py"
29- INSTANCE_TYPE = "p2.xlarge"
3029ROLE = "some-role"
3130
3231DATA_DIR = os .path .join (os .path .dirname (__file__ ), ".." , "data" )
4039IMAGE_NAME = "fakeimage"
4140REGION = "us-west-2"
4241MODEL_NAME = "{}-{}" .format (MODEL_IMAGE , TIMESTAMP )
42+ ENDPOINT_NAME = "{}-{}" .format (MODEL_NAME , INSTANCE_TYPE .replace ("." , "-" ))
4343GIT_REPO = "https://github.com/aws/sagemaker-python-sdk.git"
4444BRANCH = "test-branch-git-config"
4545COMMIT = "ae15c9d7d5b97ea95ea451e4662ee43da3401d73"
@@ -210,7 +210,7 @@ def test_deploy(sagemaker_session, tmpdir):
210210 model = DummyFrameworkModel (sagemaker_session , source_dir = str (tmpdir ))
211211 model .deploy (instance_type = INSTANCE_TYPE , initial_instance_count = 1 )
212212 sagemaker_session .endpoint_from_production_variants .assert_called_with (
213- MODEL_NAME ,
213+ ENDPOINT_NAME ,
214214 [
215215 {
216216 "InitialVariantWeight" : 1 ,
@@ -255,7 +255,7 @@ def test_deploy_tags(sagemaker_session, tmpdir):
255255 tags = [{"ModelName" : "TestModel" }]
256256 model .deploy (instance_type = INSTANCE_TYPE , initial_instance_count = 1 , tags = tags )
257257 sagemaker_session .endpoint_from_production_variants .assert_called_with (
258- MODEL_NAME ,
258+ ENDPOINT_NAME ,
259259 [
260260 {
261261 "InitialVariantWeight" : 1 ,
@@ -280,7 +280,7 @@ def test_deploy_accelerator_type(tfo, time, sagemaker_session):
280280 instance_type = INSTANCE_TYPE , initial_instance_count = 1 , accelerator_type = ACCELERATOR_TYPE
281281 )
282282 sagemaker_session .endpoint_from_production_variants .assert_called_with (
283- MODEL_NAME ,
283+ ENDPOINT_NAME ,
284284 [
285285 {
286286 "InitialVariantWeight" : 1 ,
@@ -305,7 +305,7 @@ def test_deploy_kms_key(tfo, time, sagemaker_session):
305305 model = DummyFrameworkModel (sagemaker_session )
306306 model .deploy (instance_type = INSTANCE_TYPE , initial_instance_count = 1 , kms_key = key )
307307 sagemaker_session .endpoint_from_production_variants .assert_called_with (
308- MODEL_NAME ,
308+ ENDPOINT_NAME ,
309309 [
310310 {
311311 "InitialVariantWeight" : 1 ,
@@ -350,7 +350,7 @@ def test_deploy_update_endpoint(sagemaker_session, tmpdir):
350350 accelerator_type = ACCELERATOR_TYPE ,
351351 )
352352 sagemaker_session .create_endpoint_config .assert_called_with (
353- name = model . name ,
353+ name = endpoint_name ,
354354 model_name = model .name ,
355355 initial_instance_count = INSTANCE_COUNT ,
356356 instance_type = INSTANCE_TYPE ,
@@ -359,7 +359,7 @@ def test_deploy_update_endpoint(sagemaker_session, tmpdir):
359359 kms_key = None ,
360360 )
361361 config_name = sagemaker_session .create_endpoint_config (
362- name = model . name ,
362+ name = endpoint_name ,
363363 model_name = model .name ,
364364 initial_instance_count = INSTANCE_COUNT ,
365365 instance_type = INSTANCE_TYPE ,
0 commit comments