Skip to content

Commit 6b47d56

Browse files
committed
infra: use generated MXNet version fixtures
1 parent bd28ca3 commit 6b47d56

10 files changed

+152
-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

+3-3
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ 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, cpu_instance_type, mxnet_training_latest_version, mxnet_latest_py_version
446446
):
447447
with timeout(seconds=AIRFLOW_CONFIG_TIMEOUT_IN_SECONDS):
448448
script_path = os.path.join(DATA_DIR, "chainer_mnist", "mnist.py")
@@ -451,8 +451,8 @@ def test_mxnet_airflow_config_uploads_data_source_to_s3(
451451
mx = MXNet(
452452
entry_point=script_path,
453453
role=ROLE,
454-
framework_version=mxnet_full_version,
455-
py_version=mxnet_full_py_version,
454+
framework_version=mxnet_training_latest_version,
455+
py_version=mxnet_latest_py_version,
456456
instance_count=SINGLE_INSTANCE_COUNT,
457457
instance_type=cpu_instance_type,
458458
sagemaker_session=sagemaker_session,

tests/integ/test_debugger.py

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

5858

5959
def test_mxnet_with_rules(
60-
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
60+
sagemaker_session, mxnet_training_latest_version, mxnet_latest_py_version, cpu_instance_type
6161
):
6262
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
6363
rules = [
@@ -74,8 +74,8 @@ def test_mxnet_with_rules(
7474
mx = MXNet(
7575
entry_point=script_path,
7676
role="SageMakerRole",
77-
framework_version=mxnet_full_version,
78-
py_version=mxnet_full_py_version,
77+
framework_version=mxnet_training_latest_version,
78+
py_version=mxnet_latest_py_version,
7979
instance_count=1,
8080
instance_type=cpu_instance_type,
8181
sagemaker_session=sagemaker_session,
@@ -118,7 +118,7 @@ def test_mxnet_with_rules(
118118

119119

120120
def test_mxnet_with_custom_rule(
121-
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
121+
sagemaker_session, mxnet_training_latest_version, mxnet_latest_py_version, cpu_instance_type
122122
):
123123
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
124124
rules = [_get_custom_rule(sagemaker_session)]
@@ -129,8 +129,8 @@ def test_mxnet_with_custom_rule(
129129
mx = MXNet(
130130
entry_point=script_path,
131131
role="SageMakerRole",
132-
framework_version=mxnet_full_version,
133-
py_version=mxnet_full_py_version,
132+
framework_version=mxnet_training_latest_version,
133+
py_version=mxnet_latest_py_version,
134134
instance_count=1,
135135
instance_type=cpu_instance_type,
136136
sagemaker_session=sagemaker_session,
@@ -167,7 +167,7 @@ def test_mxnet_with_custom_rule(
167167

168168

169169
def test_mxnet_with_debugger_hook_config(
170-
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
170+
sagemaker_session, mxnet_training_latest_version, mxnet_latest_py_version, cpu_instance_type
171171
):
172172
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
173173
debugger_hook_config = DebuggerHookConfig(
@@ -182,8 +182,8 @@ def test_mxnet_with_debugger_hook_config(
182182
mx = MXNet(
183183
entry_point=script_path,
184184
role="SageMakerRole",
185-
framework_version=mxnet_full_version,
186-
py_version=mxnet_full_py_version,
185+
framework_version=mxnet_training_latest_version,
186+
py_version=mxnet_latest_py_version,
187187
instance_count=1,
188188
instance_type=cpu_instance_type,
189189
sagemaker_session=sagemaker_session,
@@ -206,7 +206,7 @@ def test_mxnet_with_debugger_hook_config(
206206

207207

208208
def test_mxnet_with_rules_and_debugger_hook_config(
209-
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
209+
sagemaker_session, mxnet_training_latest_version, mxnet_latest_py_version, cpu_instance_type
210210
):
211211
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
212212
rules = [
@@ -228,8 +228,8 @@ def test_mxnet_with_rules_and_debugger_hook_config(
228228
mx = MXNet(
229229
entry_point=script_path,
230230
role="SageMakerRole",
231-
framework_version=mxnet_full_version,
232-
py_version=mxnet_full_py_version,
231+
framework_version=mxnet_training_latest_version,
232+
py_version=mxnet_latest_py_version,
233233
instance_count=1,
234234
instance_type=cpu_instance_type,
235235
sagemaker_session=sagemaker_session,
@@ -274,7 +274,7 @@ def test_mxnet_with_rules_and_debugger_hook_config(
274274

275275

276276
def test_mxnet_with_custom_rule_and_debugger_hook_config(
277-
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
277+
sagemaker_session, mxnet_training_latest_version, mxnet_latest_py_version, cpu_instance_type
278278
):
279279
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
280280
rules = [_get_custom_rule(sagemaker_session)]
@@ -290,8 +290,8 @@ def test_mxnet_with_custom_rule_and_debugger_hook_config(
290290
mx = MXNet(
291291
entry_point=script_path,
292292
role="SageMakerRole",
293-
framework_version=mxnet_full_version,
294-
py_version=mxnet_full_py_version,
293+
framework_version=mxnet_training_latest_version,
294+
py_version=mxnet_latest_py_version,
295295
instance_count=1,
296296
instance_type=cpu_instance_type,
297297
sagemaker_session=sagemaker_session,
@@ -330,7 +330,7 @@ def test_mxnet_with_custom_rule_and_debugger_hook_config(
330330

331331

332332
def test_mxnet_with_tensorboard_output_config(
333-
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
333+
sagemaker_session, mxnet_training_latest_version, mxnet_latest_py_version, cpu_instance_type
334334
):
335335
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
336336
tensorboard_output_config = TensorBoardOutputConfig(
@@ -345,8 +345,8 @@ def test_mxnet_with_tensorboard_output_config(
345345
mx = MXNet(
346346
entry_point=script_path,
347347
role="SageMakerRole",
348-
framework_version=mxnet_full_version,
349-
py_version=mxnet_full_py_version,
348+
framework_version=mxnet_training_latest_version,
349+
py_version=mxnet_latest_py_version,
350350
instance_count=1,
351351
instance_type=cpu_instance_type,
352352
sagemaker_session=sagemaker_session,
@@ -373,7 +373,7 @@ def test_mxnet_with_tensorboard_output_config(
373373

374374
@pytest.mark.canary_quick
375375
def test_mxnet_with_all_rules_and_configs(
376-
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
376+
sagemaker_session, mxnet_training_latest_version, mxnet_latest_py_version, cpu_instance_type
377377
):
378378
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
379379
rules = [
@@ -401,8 +401,8 @@ def test_mxnet_with_all_rules_and_configs(
401401
mx = MXNet(
402402
entry_point=script_path,
403403
role="SageMakerRole",
404-
framework_version=mxnet_full_version,
405-
py_version=mxnet_full_py_version,
404+
framework_version=mxnet_training_latest_version,
405+
py_version=mxnet_latest_py_version,
406406
instance_count=1,
407407
instance_type=cpu_instance_type,
408408
sagemaker_session=sagemaker_session,
@@ -445,7 +445,7 @@ def test_mxnet_with_all_rules_and_configs(
445445

446446

447447
def test_mxnet_with_debugger_hook_config_disabled(
448-
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
448+
sagemaker_session, mxnet_training_latest_version, mxnet_latest_py_version, cpu_instance_type
449449
):
450450
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
451451
script_path = os.path.join(DATA_DIR, "mxnet_mnist", "mnist_gluon.py")
@@ -454,8 +454,8 @@ def test_mxnet_with_debugger_hook_config_disabled(
454454
mx = MXNet(
455455
entry_point=script_path,
456456
role="SageMakerRole",
457-
framework_version=mxnet_full_version,
458-
py_version=mxnet_full_py_version,
457+
framework_version=mxnet_training_latest_version,
458+
py_version=mxnet_latest_py_version,
459459
instance_count=1,
460460
instance_type=cpu_instance_type,
461461
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_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_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_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_latest_py_version,
244248
instance_count=1,
245249
instance_type="local",
246250
sagemaker_session=sagemaker_local_session,

0 commit comments

Comments
 (0)