diff --git a/tests/integ/__init__.py b/tests/integ/__init__.py index e8ed234689..4d28b692ce 100644 --- a/tests/integ/__init__.py +++ b/tests/integ/__init__.py @@ -28,6 +28,9 @@ HOSTING_NO_P2_REGIONS = ['ca-central-1', 'eu-west-2', 'us-west-1', 'eu-central-1'] HOSTING_NO_P3_REGIONS = ['ap-southeast-1', 'ap-southeast-2', 'ap-south-1', 'ca-central-1', 'eu-west-2', 'us-west-1'] +# EI is currently only supported in the following regions +# regions were derived from https://aws.amazon.com/machine-learning/elastic-inference/pricing/ +EI_SUPPORTED_REGIONS = ['us-east-1', 'us-east-2', 'us-west-2', 'eu-west-1', 'ap-northeast-1', 'ap-northeast-2'] logging.getLogger('boto3').setLevel(logging.INFO) logging.getLogger('botocore').setLevel(logging.INFO) diff --git a/tests/integ/test_mxnet_train.py b/tests/integ/test_mxnet_train.py index 074540b7a9..570dbba31e 100644 --- a/tests/integ/test_mxnet_train.py +++ b/tests/integ/test_mxnet_train.py @@ -18,6 +18,7 @@ import numpy import pytest +import tests.integ from sagemaker.mxnet.estimator import MXNet from sagemaker.mxnet.model import MXNetModel from sagemaker.utils import sagemaker_timestamp @@ -71,6 +72,10 @@ def test_deploy_model(mxnet_training_job, sagemaker_session): predictor.predict(data) +@pytest.mark.continuous_testing +@pytest.mark.regional_testing +@pytest.mark.skipif(tests.integ.test_region() not in tests.integ.EI_SUPPORTED_REGIONS, + reason="EI isn't supported in that specific region.") def test_deploy_model_with_accelerator(mxnet_training_job, sagemaker_session, ei_mxnet_version): endpoint_name = 'test-mxnet-deploy-model-ei-{}'.format(sagemaker_timestamp()) diff --git a/tests/integ/test_tf.py b/tests/integ/test_tf.py index 6a140a4930..54343703e6 100644 --- a/tests/integ/test_tf.py +++ b/tests/integ/test_tf.py @@ -17,6 +17,7 @@ import pytest +import tests.integ from sagemaker.tensorflow import TensorFlow, TensorFlowModel from sagemaker.utils import sagemaker_timestamp from tests.integ import DATA_DIR, TRAINING_DEFAULT_TIMEOUT_MINUTES, PYTHON_VERSION @@ -76,6 +77,10 @@ def test_deploy_model(sagemaker_session, tf_training_job): assert dict_result == list_result +@pytest.mark.continuous_testing +@pytest.mark.regional_testing +@pytest.mark.skipif(tests.integ.test_region() not in tests.integ.EI_SUPPORTED_REGIONS, + reason="EI isn't supported in that specific region.") @pytest.mark.skipif(PYTHON_VERSION != 'py2', reason="TensorFlow image supports only python 2.") def test_deploy_model_with_accelerator(sagemaker_session, tf_training_job, ei_tf_version): endpoint_name = 'test-tf-deploy-model-ei-{}'.format(sagemaker_timestamp())