Skip to content

Commit 82257f2

Browse files
committed
fix integ tests
1 parent 3e2ab64 commit 82257f2

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

tests/integ/test_local_mode.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ def _initialize(self, boto_session, sagemaker_client, sagemaker_runtime_client):
5757

5858

5959
@pytest.fixture(scope='module')
60-
def mxnet_model(sagemaker_local_session):
60+
def mxnet_model(sagemaker_local_session, mxnet_full_version):
6161
script_path = os.path.join(DATA_DIR, 'mxnet_mnist', 'mnist.py')
6262
data_path = os.path.join(DATA_DIR, 'mxnet_mnist')
6363

6464
mx = MXNet(entry_point=script_path, role='SageMakerRole',
65-
train_instance_count=1, train_instance_type='local',
66-
sagemaker_session=sagemaker_local_session)
65+
train_instance_count=1, train_instance_type='local', launch_parameter_server=True,
66+
sagemaker_session=sagemaker_local_session, framework_version=mxnet_full_version)
6767

6868
train_input = mx.sagemaker_session.upload_data(path=os.path.join(data_path, 'train'),
6969
key_prefix='integ-test-data/mxnet_mnist/train')
@@ -306,16 +306,16 @@ def test_local_mode_serving_from_local_model(sagemaker_local_session, mxnet_mode
306306
fcntl.lockf(local_mode_lock, fcntl.LOCK_UN)
307307

308308

309-
def test_mxnet_local_mode(sagemaker_local_session):
309+
def test_mxnet_local_mode(sagemaker_local_session, mxnet_full_version):
310310
local_mode_lock_fd = open(LOCK_PATH, 'w')
311311
local_mode_lock = local_mode_lock_fd.fileno()
312312

313313
script_path = os.path.join(DATA_DIR, 'mxnet_mnist', 'mnist.py')
314314
data_path = os.path.join(DATA_DIR, 'mxnet_mnist')
315315

316316
mx = MXNet(entry_point=script_path, role='SageMakerRole', py_version=PYTHON_VERSION,
317-
train_instance_count=1, train_instance_type='local',
318-
sagemaker_session=sagemaker_local_session)
317+
train_instance_count=1, train_instance_type='local', launch_parameter_server=True,
318+
sagemaker_session=sagemaker_local_session, framework_version=mxnet_full_version)
319319

320320
train_input = mx.sagemaker_session.upload_data(path=os.path.join(data_path, 'train'),
321321
key_prefix='integ-test-data/mxnet_mnist/train')
@@ -338,15 +338,15 @@ def test_mxnet_local_mode(sagemaker_local_session):
338338
fcntl.lockf(local_mode_lock, fcntl.LOCK_UN)
339339

340340

341-
def test_mxnet_local_data_local_script():
341+
def test_mxnet_local_data_local_script(mxnet_full_version):
342342
local_mode_lock_fd = open(LOCK_PATH, 'w')
343343
local_mode_lock = local_mode_lock_fd.fileno()
344344

345345
script_path = os.path.join(DATA_DIR, 'mxnet_mnist', 'mnist.py')
346346
data_path = os.path.join(DATA_DIR, 'mxnet_mnist')
347347

348-
mx = MXNet(entry_point=script_path, role='SageMakerRole',
349-
train_instance_count=1, train_instance_type='local',
348+
mx = MXNet(entry_point=script_path, role='SageMakerRole', framework_version=mxnet_full_version,
349+
train_instance_count=1, train_instance_type='local', launch_parameter_server=True,
350350
sagemaker_session=LocalNoS3Session())
351351

352352
train_input = 'file://' + os.path.join(data_path, 'train')
@@ -368,14 +368,15 @@ def test_mxnet_local_data_local_script():
368368
fcntl.lockf(local_mode_lock, fcntl.LOCK_UN)
369369

370370

371-
def test_local_transform_mxnet(sagemaker_local_session, tmpdir):
371+
def test_local_transform_mxnet(sagemaker_local_session, tmpdir, mxnet_full_version):
372372
local_mode_lock_fd = open(LOCK_PATH, 'w')
373373
local_mode_lock = local_mode_lock_fd.fileno()
374374
data_path = os.path.join(DATA_DIR, 'mxnet_mnist')
375375
script_path = os.path.join(data_path, 'mnist.py')
376376

377377
mx = MXNet(entry_point=script_path, role='SageMakerRole', train_instance_count=1,
378-
train_instance_type='ml.c4.xlarge', sagemaker_session=sagemaker_local_session)
378+
train_instance_type='ml.c4.xlarge', framework_version=mxnet_full_version,
379+
sagemaker_session=sagemaker_local_session, launch_parameter_server=True)
379380

380381
train_input = mx.sagemaker_session.upload_data(path=os.path.join(data_path, 'train'),
381382
key_prefix='integ-test-data/mxnet_mnist/train')

tests/integ/test_transformer.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@
2929

3030

3131
@pytest.mark.continuous_testing
32-
def test_transform_mxnet(sagemaker_session):
32+
def test_transform_mxnet(sagemaker_session, mxnet_full_version):
3333
data_path = os.path.join(DATA_DIR, 'mxnet_mnist')
3434
script_path = os.path.join(data_path, 'mnist.py')
3535

3636
mx = MXNet(entry_point=script_path, role='SageMakerRole', train_instance_count=1,
37-
train_instance_type='ml.c4.xlarge', sagemaker_session=sagemaker_session)
37+
train_instance_type='ml.c4.xlarge', launch_parameter_server=True,
38+
sagemaker_session=sagemaker_session, framework_version=mxnet_full_version)
3839

3940
train_input = mx.sagemaker_session.upload_data(path=os.path.join(data_path, 'train'),
4041
key_prefix='integ-test-data/mxnet_mnist/train')
@@ -103,7 +104,7 @@ def test_attach_transform_kmeans(sagemaker_session):
103104
attached_transformer.wait()
104105

105106

106-
def test_transform_mxnet_vpc(sagemaker_session):
107+
def test_transform_mxnet_vpc(sagemaker_session, mxnet_full_version):
107108
data_path = os.path.join(DATA_DIR, 'mxnet_mnist')
108109
script_path = os.path.join(data_path, 'mnist.py')
109110

@@ -113,6 +114,7 @@ def test_transform_mxnet_vpc(sagemaker_session):
113114

114115
mx = MXNet(entry_point=script_path, role='SageMakerRole', train_instance_count=1,
115116
train_instance_type='ml.c4.xlarge', sagemaker_session=sagemaker_session,
117+
framework_version=mxnet_full_version, launch_parameter_server=True,
116118
subnets=subnet_ids, security_group_ids=[security_group_id])
117119

118120
train_input = mx.sagemaker_session.upload_data(path=os.path.join(data_path, 'train'),

0 commit comments

Comments
 (0)