Skip to content

Commit 50ef480

Browse files
committed
Handle PR comments
1 parent 08f5646 commit 50ef480

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

tests/integ/kms_utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616

1717
from botocore import exceptions
1818

19-
PRINCIPAL_TEMPLATE = '["{account_id}", "{role_arn}", "arn:aws:iam::{account_id}:role/{' \
20-
'sagemaker_role}"] '
19+
PRINCIPAL_TEMPLATE = '["{account_id}", "{role_arn}", ' \
20+
'"arn:aws:iam::{account_id}:role/{sagemaker_role}"] '
2121

22-
KEY_ALIAS = "SageMakerTestKMSKey"
23-
KMS_S3_ALIAS = "SageMakerTestS3KMSKey"
24-
POLICY_NAME = "default"
22+
KEY_ALIAS = 'SageMakerTestKMSKey'
23+
KMS_S3_ALIAS = 'SageMakerTestS3KMSKey'
24+
POLICY_NAME = 'default'
2525
KEY_POLICY = '''
2626
{{
2727
"Version": "2012-10-17",

tests/integ/test_tf_script_mode.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
from tests.integ import kms_utils
2626
import tests.integ.timeout as timeout
2727

28+
ROLE = 'SageMakerRole'
29+
2830
RESOURCE_PATH = os.path.join(os.path.dirname(__file__), '..', 'data', 'tensorflow_mnist')
2931
SCRIPT = os.path.join(RESOURCE_PATH, 'mnist.py')
3032
PARAMETER_SERVER_DISTRIBUTION = {'parameter_server': {'enabled': True}}
@@ -59,12 +61,12 @@ def test_mnist(sagemaker_session, instance_type):
5961
def test_server_side_encryption(sagemaker_session):
6062

6163
bucket_with_kms, kms_key = kms_utils.get_or_create_bucket_with_encryption(sagemaker_session.boto_session,
62-
'SageMakerRole')
64+
ROLE)
6365

6466
output_path = os.path.join(bucket_with_kms, 'test-server-side-encryption', time.strftime('%y%m%d-%H%M'))
6567

6668
estimator = TensorFlow(entry_point=SCRIPT,
67-
role='SageMakerRole',
69+
role=ROLE,
6870
train_instance_count=1,
6971
train_instance_type='ml.c5.xlarge',
7072
sagemaker_session=sagemaker_session,
@@ -88,7 +90,7 @@ def test_server_side_encryption(sagemaker_session):
8890
@pytest.mark.skipif(integ.PYTHON_VERSION != 'py3', reason="Script Mode tests are only configured to run with Python 3")
8991
def test_mnist_distributed(sagemaker_session, instance_type):
9092
estimator = TensorFlow(entry_point=SCRIPT,
91-
role='SageMakerRole',
93+
role=ROLE,
9294
train_instance_count=2,
9395
# TODO: change train_instance_type to instance_type once the test is passing consistently
9496
train_instance_type='ml.c5.xlarge',
@@ -110,7 +112,7 @@ def test_mnist_distributed(sagemaker_session, instance_type):
110112

111113
def test_mnist_async(sagemaker_session):
112114
estimator = TensorFlow(entry_point=SCRIPT,
113-
role='SageMakerRole',
115+
role=ROLE,
114116
train_instance_count=1,
115117
train_instance_type='ml.c5.4xlarge',
116118
sagemaker_session=sagemaker_session,

0 commit comments

Comments
 (0)