25
25
from tests .integ import kms_utils
26
26
import tests .integ .timeout as timeout
27
27
28
+ ROLE = 'SageMakerRole'
29
+
28
30
RESOURCE_PATH = os .path .join (os .path .dirname (__file__ ), '..' , 'data' , 'tensorflow_mnist' )
29
31
SCRIPT = os .path .join (RESOURCE_PATH , 'mnist.py' )
30
32
PARAMETER_SERVER_DISTRIBUTION = {'parameter_server' : {'enabled' : True }}
@@ -59,12 +61,12 @@ def test_mnist(sagemaker_session, instance_type):
59
61
def test_server_side_encryption (sagemaker_session ):
60
62
61
63
bucket_with_kms , kms_key = kms_utils .get_or_create_bucket_with_encryption (sagemaker_session .boto_session ,
62
- 'SageMakerRole' )
64
+ ROLE )
63
65
64
66
output_path = os .path .join (bucket_with_kms , 'test-server-side-encryption' , time .strftime ('%y%m%d-%H%M' ))
65
67
66
68
estimator = TensorFlow (entry_point = SCRIPT ,
67
- role = 'SageMakerRole' ,
69
+ role = ROLE ,
68
70
train_instance_count = 1 ,
69
71
train_instance_type = 'ml.c5.xlarge' ,
70
72
sagemaker_session = sagemaker_session ,
@@ -88,7 +90,7 @@ def test_server_side_encryption(sagemaker_session):
88
90
@pytest .mark .skipif (integ .PYTHON_VERSION != 'py3' , reason = "Script Mode tests are only configured to run with Python 3" )
89
91
def test_mnist_distributed (sagemaker_session , instance_type ):
90
92
estimator = TensorFlow (entry_point = SCRIPT ,
91
- role = 'SageMakerRole' ,
93
+ role = ROLE ,
92
94
train_instance_count = 2 ,
93
95
# TODO: change train_instance_type to instance_type once the test is passing consistently
94
96
train_instance_type = 'ml.c5.xlarge' ,
@@ -110,7 +112,7 @@ def test_mnist_distributed(sagemaker_session, instance_type):
110
112
111
113
def test_mnist_async (sagemaker_session ):
112
114
estimator = TensorFlow (entry_point = SCRIPT ,
113
- role = 'SageMakerRole' ,
115
+ role = ROLE ,
114
116
train_instance_count = 1 ,
115
117
train_instance_type = 'ml.c5.4xlarge' ,
116
118
sagemaker_session = sagemaker_session ,
0 commit comments