Skip to content

Commit 6218498

Browse files
authored
Merge branch 'dev' into smdmp-1.6.0-doc
2 parents cb821fd + 5ec2ff4 commit 6218498

File tree

2 files changed

+26
-11
lines changed

2 files changed

+26
-11
lines changed

tests/integ/sagemaker/lineage/conftest.py

+20-7
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
from tests.integ.sagemaker.lineage.helpers import name, names
3737

3838
SLEEP_TIME_SECONDS = 1
39-
STATIC_PIPELINE_NAME = "SdkIntegTestStaticPipeline14"
40-
STATIC_ENDPOINT_NAME = "SdkIntegTestStaticEndpoint14"
39+
STATIC_PIPELINE_NAME = "SdkIntegTestStaticPipeline15"
40+
STATIC_ENDPOINT_NAME = "SdkIntegTestStaticEndpoint15"
4141

4242

4343
@pytest.fixture
@@ -518,6 +518,13 @@ def _get_static_pipeline_execution_arn(sagemaker_session):
518518
def static_endpoint_context(sagemaker_session, static_pipeline_execution_arn):
519519
endpoint_arn = get_endpoint_arn_from_static_pipeline(sagemaker_session)
520520

521+
if endpoint_arn is None:
522+
_deploy_static_endpoint(
523+
execution_arn=static_pipeline_execution_arn,
524+
sagemaker_session=sagemaker_session,
525+
)
526+
endpoint_arn = get_endpoint_arn_from_static_pipeline(sagemaker_session)
527+
521528
contexts = sagemaker_session.sagemaker_client.list_contexts(SourceUri=endpoint_arn)[
522529
"ContextSummaries"
523530
]
@@ -584,11 +591,17 @@ def static_dataset_artifact(static_model_artifact, sagemaker_session):
584591

585592

586593
def get_endpoint_arn_from_static_pipeline(sagemaker_session):
587-
endpoint_arn = sagemaker_session.sagemaker_client.describe_endpoint(
588-
EndpointName=STATIC_ENDPOINT_NAME
589-
)["EndpointArn"]
594+
try:
595+
endpoint_arn = sagemaker_session.sagemaker_client.describe_endpoint(
596+
EndpointName=STATIC_ENDPOINT_NAME
597+
)["EndpointArn"]
590598

591-
return endpoint_arn
599+
return endpoint_arn
600+
except ClientError as e:
601+
error = e.response["Error"]
602+
if error["Code"] == "ValidationException":
603+
return None
604+
raise e
592605

593606

594607
def get_model_package_arn_from_static_pipeline(pipeline_execution_arn, sagemaker_session):
@@ -654,7 +667,7 @@ def _deploy_static_endpoint(execution_arn, sagemaker_session):
654667
sagemaker_session=sagemaker_session,
655668
)
656669
model_package.deploy(1, "ml.t2.medium", endpoint_name=STATIC_ENDPOINT_NAME)
657-
time.sleep(60)
670+
time.sleep(120)
658671
except ClientError as e:
659672
if e.response["Error"]["Code"] == "ValidationException":
660673
print(f"Endpoint {STATIC_ENDPOINT_NAME} already exists. Continuing.")

tests/integ/test_auto_ml.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
import os
1616

1717
import pytest
18-
import tests.integ
19-
from sagemaker import AutoML, CandidateEstimator, AutoMLInput
20-
2118
from botocore.exceptions import ClientError
19+
20+
import tests.integ
21+
from sagemaker import AutoML, AutoMLInput, CandidateEstimator
2222
from sagemaker.utils import unique_name_from_base
23-
from tests.integ import DATA_DIR, AUTO_ML_DEFAULT_TIMEMOUT_MINUTES, auto_ml_utils
23+
from tests.integ import AUTO_ML_DEFAULT_TIMEMOUT_MINUTES, DATA_DIR, auto_ml_utils
2424
from tests.integ.timeout import timeout
2525

2626
ROLE = "SageMakerRole"
@@ -169,6 +169,7 @@ def test_auto_ml_describe_auto_ml_job(sagemaker_session):
169169
}
170170
},
171171
"TargetAttributeName": TARGET_ATTRIBUTE_NAME,
172+
"ContentType": "text/csv;header=present",
172173
}
173174
]
174175
expected_default_output_config = {
@@ -205,6 +206,7 @@ def test_auto_ml_attach(sagemaker_session):
205206
}
206207
},
207208
"TargetAttributeName": TARGET_ATTRIBUTE_NAME,
209+
"ContentType": "text/csv;header=present",
208210
}
209211
]
210212
expected_default_output_config = {

0 commit comments

Comments
 (0)