Skip to content

Commit ca9e5c8

Browse files
committed
Merge branch 'zwei' into xgb
2 parents e6292d2 + 8df2583 commit ca9e5c8

10 files changed

+198
-161
lines changed

tests/conftest.py

+1-40
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717

1818
import boto3
1919
import pytest
20-
import tests.integ
2120
from botocore.config import Config
2221
from packaging.version import Version
2322

2423
from sagemaker import Session, image_uris, utils
2524
from sagemaker.local import LocalSession
2625
from sagemaker.rl import RLEstimator
26+
import tests.integ
2727

2828
DEFAULT_REGION = "us-west-2"
2929
CUSTOM_BUCKET_NAME_PREFIX = "sagemaker-custom-bucket"
@@ -115,30 +115,6 @@ def chainer_py_version(request):
115115
return request.param
116116

117117

118-
# TODO: current version fixtures are legacy fixtures that aren't useful
119-
# and no longer verify whether images are valid
120-
@pytest.fixture(
121-
scope="module",
122-
params=[
123-
"0.12",
124-
"0.12.1",
125-
"1.0",
126-
"1.0.0",
127-
"1.1",
128-
"1.1.0",
129-
"1.2",
130-
"1.2.1",
131-
"1.3",
132-
"1.3.0",
133-
"1.4",
134-
"1.4.0",
135-
"1.4.1",
136-
],
137-
)
138-
def mxnet_version(request):
139-
return request.param
140-
141-
142118
@pytest.fixture(scope="module", params=["py2", "py3"])
143119
def mxnet_py_version(request):
144120
return request.param
@@ -200,21 +176,6 @@ def rl_ray_version(request):
200176
return request.param
201177

202178

203-
@pytest.fixture(scope="module")
204-
def mxnet_full_version():
205-
return "1.6.0"
206-
207-
208-
@pytest.fixture(scope="module")
209-
def mxnet_full_py_version():
210-
return "py3"
211-
212-
213-
@pytest.fixture(scope="module")
214-
def ei_mxnet_full_version():
215-
return "1.5.1"
216-
217-
218179
@pytest.fixture(scope="module")
219180
def pytorch_full_version():
220181
return "1.5.0"

tests/integ/test_airflow_config.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,10 @@ def test_chainer_airflow_config_uploads_data_source_to_s3(
442442

443443
@pytest.mark.canary_quick
444444
def test_mxnet_airflow_config_uploads_data_source_to_s3(
445-
sagemaker_session, cpu_instance_type, mxnet_full_version, mxnet_full_py_version
445+
sagemaker_session,
446+
cpu_instance_type,
447+
mxnet_training_latest_version,
448+
mxnet_training_latest_py_version,
446449
):
447450
with timeout(seconds=AIRFLOW_CONFIG_TIMEOUT_IN_SECONDS):
448451
script_path = os.path.join(DATA_DIR, "chainer_mnist", "mnist.py")
@@ -451,8 +454,8 @@ def test_mxnet_airflow_config_uploads_data_source_to_s3(
451454
mx = MXNet(
452455
entry_point=script_path,
453456
role=ROLE,
454-
framework_version=mxnet_full_version,
455-
py_version=mxnet_full_py_version,
457+
framework_version=mxnet_training_latest_version,
458+
py_version=mxnet_training_latest_py_version,
456459
instance_count=SINGLE_INSTANCE_COUNT,
457460
instance_type=cpu_instance_type,
458461
sagemaker_session=sagemaker_session,

tests/integ/test_debugger.py

+48-24
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@
5757

5858

5959
def test_mxnet_with_rules(
60-
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
60+
sagemaker_session,
61+
mxnet_training_latest_version,
62+
mxnet_training_latest_py_version,
63+
cpu_instance_type,
6164
):
6265
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
6366
rules = [
@@ -74,8 +77,8 @@ def test_mxnet_with_rules(
7477
mx = MXNet(
7578
entry_point=script_path,
7679
role="SageMakerRole",
77-
framework_version=mxnet_full_version,
78-
py_version=mxnet_full_py_version,
80+
framework_version=mxnet_training_latest_version,
81+
py_version=mxnet_training_latest_py_version,
7982
instance_count=1,
8083
instance_type=cpu_instance_type,
8184
sagemaker_session=sagemaker_session,
@@ -118,7 +121,10 @@ def test_mxnet_with_rules(
118121

119122

120123
def test_mxnet_with_custom_rule(
121-
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
124+
sagemaker_session,
125+
mxnet_training_latest_version,
126+
mxnet_training_latest_py_version,
127+
cpu_instance_type,
122128
):
123129
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
124130
rules = [_get_custom_rule(sagemaker_session)]
@@ -129,8 +135,8 @@ def test_mxnet_with_custom_rule(
129135
mx = MXNet(
130136
entry_point=script_path,
131137
role="SageMakerRole",
132-
framework_version=mxnet_full_version,
133-
py_version=mxnet_full_py_version,
138+
framework_version=mxnet_training_latest_version,
139+
py_version=mxnet_training_latest_py_version,
134140
instance_count=1,
135141
instance_type=cpu_instance_type,
136142
sagemaker_session=sagemaker_session,
@@ -167,7 +173,10 @@ def test_mxnet_with_custom_rule(
167173

168174

169175
def test_mxnet_with_debugger_hook_config(
170-
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
176+
sagemaker_session,
177+
mxnet_training_latest_version,
178+
mxnet_training_latest_py_version,
179+
cpu_instance_type,
171180
):
172181
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
173182
debugger_hook_config = DebuggerHookConfig(
@@ -182,8 +191,8 @@ def test_mxnet_with_debugger_hook_config(
182191
mx = MXNet(
183192
entry_point=script_path,
184193
role="SageMakerRole",
185-
framework_version=mxnet_full_version,
186-
py_version=mxnet_full_py_version,
194+
framework_version=mxnet_training_latest_version,
195+
py_version=mxnet_training_latest_py_version,
187196
instance_count=1,
188197
instance_type=cpu_instance_type,
189198
sagemaker_session=sagemaker_session,
@@ -206,7 +215,10 @@ def test_mxnet_with_debugger_hook_config(
206215

207216

208217
def test_mxnet_with_rules_and_debugger_hook_config(
209-
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
218+
sagemaker_session,
219+
mxnet_training_latest_version,
220+
mxnet_training_latest_py_version,
221+
cpu_instance_type,
210222
):
211223
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
212224
rules = [
@@ -228,8 +240,8 @@ def test_mxnet_with_rules_and_debugger_hook_config(
228240
mx = MXNet(
229241
entry_point=script_path,
230242
role="SageMakerRole",
231-
framework_version=mxnet_full_version,
232-
py_version=mxnet_full_py_version,
243+
framework_version=mxnet_training_latest_version,
244+
py_version=mxnet_training_latest_py_version,
233245
instance_count=1,
234246
instance_type=cpu_instance_type,
235247
sagemaker_session=sagemaker_session,
@@ -274,7 +286,10 @@ def test_mxnet_with_rules_and_debugger_hook_config(
274286

275287

276288
def test_mxnet_with_custom_rule_and_debugger_hook_config(
277-
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
289+
sagemaker_session,
290+
mxnet_training_latest_version,
291+
mxnet_training_latest_py_version,
292+
cpu_instance_type,
278293
):
279294
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
280295
rules = [_get_custom_rule(sagemaker_session)]
@@ -290,8 +305,8 @@ def test_mxnet_with_custom_rule_and_debugger_hook_config(
290305
mx = MXNet(
291306
entry_point=script_path,
292307
role="SageMakerRole",
293-
framework_version=mxnet_full_version,
294-
py_version=mxnet_full_py_version,
308+
framework_version=mxnet_training_latest_version,
309+
py_version=mxnet_training_latest_py_version,
295310
instance_count=1,
296311
instance_type=cpu_instance_type,
297312
sagemaker_session=sagemaker_session,
@@ -330,7 +345,10 @@ def test_mxnet_with_custom_rule_and_debugger_hook_config(
330345

331346

332347
def test_mxnet_with_tensorboard_output_config(
333-
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
348+
sagemaker_session,
349+
mxnet_training_latest_version,
350+
mxnet_training_latest_py_version,
351+
cpu_instance_type,
334352
):
335353
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
336354
tensorboard_output_config = TensorBoardOutputConfig(
@@ -345,8 +363,8 @@ def test_mxnet_with_tensorboard_output_config(
345363
mx = MXNet(
346364
entry_point=script_path,
347365
role="SageMakerRole",
348-
framework_version=mxnet_full_version,
349-
py_version=mxnet_full_py_version,
366+
framework_version=mxnet_training_latest_version,
367+
py_version=mxnet_training_latest_py_version,
350368
instance_count=1,
351369
instance_type=cpu_instance_type,
352370
sagemaker_session=sagemaker_session,
@@ -373,7 +391,10 @@ def test_mxnet_with_tensorboard_output_config(
373391

374392
@pytest.mark.canary_quick
375393
def test_mxnet_with_all_rules_and_configs(
376-
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
394+
sagemaker_session,
395+
mxnet_training_latest_version,
396+
mxnet_training_latest_py_version,
397+
cpu_instance_type,
377398
):
378399
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
379400
rules = [
@@ -401,8 +422,8 @@ def test_mxnet_with_all_rules_and_configs(
401422
mx = MXNet(
402423
entry_point=script_path,
403424
role="SageMakerRole",
404-
framework_version=mxnet_full_version,
405-
py_version=mxnet_full_py_version,
425+
framework_version=mxnet_training_latest_version,
426+
py_version=mxnet_training_latest_py_version,
406427
instance_count=1,
407428
instance_type=cpu_instance_type,
408429
sagemaker_session=sagemaker_session,
@@ -445,7 +466,10 @@ def test_mxnet_with_all_rules_and_configs(
445466

446467

447468
def test_mxnet_with_debugger_hook_config_disabled(
448-
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
469+
sagemaker_session,
470+
mxnet_training_latest_version,
471+
mxnet_training_latest_py_version,
472+
cpu_instance_type,
449473
):
450474
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
451475
script_path = os.path.join(DATA_DIR, "mxnet_mnist", "mnist_gluon.py")
@@ -454,8 +478,8 @@ def test_mxnet_with_debugger_hook_config_disabled(
454478
mx = MXNet(
455479
entry_point=script_path,
456480
role="SageMakerRole",
457-
framework_version=mxnet_full_version,
458-
py_version=mxnet_full_py_version,
481+
framework_version=mxnet_training_latest_version,
482+
py_version=mxnet_training_latest_py_version,
459483
instance_count=1,
460484
instance_type=cpu_instance_type,
461485
sagemaker_session=sagemaker_session,

tests/integ/test_git.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ def test_github(sagemaker_local_session, pytorch_full_version, pytorch_full_py_v
8181

8282
@pytest.mark.local_mode
8383
@pytest.mark.skip("needs a secure authentication approach")
84-
def test_private_github(sagemaker_local_session, mxnet_full_version, mxnet_full_py_version):
84+
def test_private_github(
85+
sagemaker_local_session, mxnet_training_latest_version, mxnet_training_latest_py_version
86+
):
8587
script_path = "mnist.py"
8688
data_path = os.path.join(DATA_DIR, "mxnet_mnist")
8789
git_config = {
@@ -99,8 +101,8 @@ def test_private_github(sagemaker_local_session, mxnet_full_version, mxnet_full_
99101
role="SageMakerRole",
100102
source_dir=source_dir,
101103
dependencies=dependencies,
102-
framework_version=mxnet_full_version,
103-
py_version=mxnet_full_py_version,
104+
framework_version=mxnet_training_latest_version,
105+
py_version=mxnet_training_latest_py_version,
104106
instance_count=1,
105107
instance_type="local",
106108
sagemaker_session=sagemaker_local_session,
@@ -223,7 +225,9 @@ def test_github_with_ssh_passphrase_not_configured(
223225

224226
@pytest.mark.local_mode
225227
@pytest.mark.skip("needs a secure authentication approach")
226-
def test_codecommit(sagemaker_local_session, mxnet_full_version, mxnet_full_py_version):
228+
def test_codecommit(
229+
sagemaker_local_session, mxnet_training_latest_version, mxnet_training_latest_py_version
230+
):
227231
script_path = "mnist.py"
228232
data_path = os.path.join(DATA_DIR, "mxnet_mnist")
229233
git_config = {
@@ -239,8 +243,8 @@ def test_codecommit(sagemaker_local_session, mxnet_full_version, mxnet_full_py_v
239243
role="SageMakerRole",
240244
source_dir=source_dir,
241245
dependencies=dependencies,
242-
framework_version=mxnet_full_version,
243-
py_version=mxnet_full_py_version,
246+
framework_version=mxnet_training_latest_version,
247+
py_version=mxnet_training_latest_py_version,
244248
instance_count=1,
245249
instance_type="local",
246250
sagemaker_session=sagemaker_local_session,

0 commit comments

Comments
 (0)