Skip to content

infra: use generated MXNet version fixtures #1718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 1 addition & 40 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@

import boto3
import pytest
import tests.integ
from botocore.config import Config
from packaging.version import Version

from sagemaker import Session, image_uris, utils
from sagemaker.local import LocalSession
from sagemaker.rl import RLEstimator
import tests.integ

DEFAULT_REGION = "us-west-2"
CUSTOM_BUCKET_NAME_PREFIX = "sagemaker-custom-bucket"
Expand Down Expand Up @@ -115,30 +115,6 @@ def chainer_py_version(request):
return request.param


# TODO: current version fixtures are legacy fixtures that aren't useful
# and no longer verify whether images are valid
@pytest.fixture(
scope="module",
params=[
"0.12",
"0.12.1",
"1.0",
"1.0.0",
"1.1",
"1.1.0",
"1.2",
"1.2.1",
"1.3",
"1.3.0",
"1.4",
"1.4.0",
"1.4.1",
],
)
def mxnet_version(request):
return request.param


@pytest.fixture(scope="module", params=["py2", "py3"])
def mxnet_py_version(request):
return request.param
Expand Down Expand Up @@ -200,21 +176,6 @@ def rl_ray_version(request):
return request.param


@pytest.fixture(scope="module")
def mxnet_full_version():
return "1.6.0"


@pytest.fixture(scope="module")
def mxnet_full_py_version():
return "py3"


@pytest.fixture(scope="module")
def ei_mxnet_full_version():
return "1.5.1"


@pytest.fixture(scope="module")
def pytorch_full_version():
return "1.5.0"
Expand Down
9 changes: 6 additions & 3 deletions tests/integ/test_airflow_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,10 @@ def test_chainer_airflow_config_uploads_data_source_to_s3(

@pytest.mark.canary_quick
def test_mxnet_airflow_config_uploads_data_source_to_s3(
sagemaker_session, cpu_instance_type, mxnet_full_version, mxnet_full_py_version
sagemaker_session,
cpu_instance_type,
mxnet_training_latest_version,
mxnet_training_latest_py_version,
):
with timeout(seconds=AIRFLOW_CONFIG_TIMEOUT_IN_SECONDS):
script_path = os.path.join(DATA_DIR, "chainer_mnist", "mnist.py")
Expand All @@ -451,8 +454,8 @@ def test_mxnet_airflow_config_uploads_data_source_to_s3(
mx = MXNet(
entry_point=script_path,
role=ROLE,
framework_version=mxnet_full_version,
py_version=mxnet_full_py_version,
framework_version=mxnet_training_latest_version,
py_version=mxnet_training_latest_py_version,
instance_count=SINGLE_INSTANCE_COUNT,
instance_type=cpu_instance_type,
sagemaker_session=sagemaker_session,
Expand Down
72 changes: 48 additions & 24 deletions tests/integ/test_debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@


def test_mxnet_with_rules(
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
sagemaker_session,
mxnet_training_latest_version,
mxnet_training_latest_py_version,
cpu_instance_type,
):
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
rules = [
Expand All @@ -74,8 +77,8 @@ def test_mxnet_with_rules(
mx = MXNet(
entry_point=script_path,
role="SageMakerRole",
framework_version=mxnet_full_version,
py_version=mxnet_full_py_version,
framework_version=mxnet_training_latest_version,
py_version=mxnet_training_latest_py_version,
instance_count=1,
instance_type=cpu_instance_type,
sagemaker_session=sagemaker_session,
Expand Down Expand Up @@ -118,7 +121,10 @@ def test_mxnet_with_rules(


def test_mxnet_with_custom_rule(
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
sagemaker_session,
mxnet_training_latest_version,
mxnet_training_latest_py_version,
cpu_instance_type,
):
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
rules = [_get_custom_rule(sagemaker_session)]
Expand All @@ -129,8 +135,8 @@ def test_mxnet_with_custom_rule(
mx = MXNet(
entry_point=script_path,
role="SageMakerRole",
framework_version=mxnet_full_version,
py_version=mxnet_full_py_version,
framework_version=mxnet_training_latest_version,
py_version=mxnet_training_latest_py_version,
instance_count=1,
instance_type=cpu_instance_type,
sagemaker_session=sagemaker_session,
Expand Down Expand Up @@ -167,7 +173,10 @@ def test_mxnet_with_custom_rule(


def test_mxnet_with_debugger_hook_config(
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
sagemaker_session,
mxnet_training_latest_version,
mxnet_training_latest_py_version,
cpu_instance_type,
):
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
debugger_hook_config = DebuggerHookConfig(
Expand All @@ -182,8 +191,8 @@ def test_mxnet_with_debugger_hook_config(
mx = MXNet(
entry_point=script_path,
role="SageMakerRole",
framework_version=mxnet_full_version,
py_version=mxnet_full_py_version,
framework_version=mxnet_training_latest_version,
py_version=mxnet_training_latest_py_version,
instance_count=1,
instance_type=cpu_instance_type,
sagemaker_session=sagemaker_session,
Expand All @@ -206,7 +215,10 @@ def test_mxnet_with_debugger_hook_config(


def test_mxnet_with_rules_and_debugger_hook_config(
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
sagemaker_session,
mxnet_training_latest_version,
mxnet_training_latest_py_version,
cpu_instance_type,
):
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
rules = [
Expand All @@ -228,8 +240,8 @@ def test_mxnet_with_rules_and_debugger_hook_config(
mx = MXNet(
entry_point=script_path,
role="SageMakerRole",
framework_version=mxnet_full_version,
py_version=mxnet_full_py_version,
framework_version=mxnet_training_latest_version,
py_version=mxnet_training_latest_py_version,
instance_count=1,
instance_type=cpu_instance_type,
sagemaker_session=sagemaker_session,
Expand Down Expand Up @@ -274,7 +286,10 @@ def test_mxnet_with_rules_and_debugger_hook_config(


def test_mxnet_with_custom_rule_and_debugger_hook_config(
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
sagemaker_session,
mxnet_training_latest_version,
mxnet_training_latest_py_version,
cpu_instance_type,
):
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
rules = [_get_custom_rule(sagemaker_session)]
Expand All @@ -290,8 +305,8 @@ def test_mxnet_with_custom_rule_and_debugger_hook_config(
mx = MXNet(
entry_point=script_path,
role="SageMakerRole",
framework_version=mxnet_full_version,
py_version=mxnet_full_py_version,
framework_version=mxnet_training_latest_version,
py_version=mxnet_training_latest_py_version,
instance_count=1,
instance_type=cpu_instance_type,
sagemaker_session=sagemaker_session,
Expand Down Expand Up @@ -330,7 +345,10 @@ def test_mxnet_with_custom_rule_and_debugger_hook_config(


def test_mxnet_with_tensorboard_output_config(
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
sagemaker_session,
mxnet_training_latest_version,
mxnet_training_latest_py_version,
cpu_instance_type,
):
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
tensorboard_output_config = TensorBoardOutputConfig(
Expand All @@ -345,8 +363,8 @@ def test_mxnet_with_tensorboard_output_config(
mx = MXNet(
entry_point=script_path,
role="SageMakerRole",
framework_version=mxnet_full_version,
py_version=mxnet_full_py_version,
framework_version=mxnet_training_latest_version,
py_version=mxnet_training_latest_py_version,
instance_count=1,
instance_type=cpu_instance_type,
sagemaker_session=sagemaker_session,
Expand All @@ -373,7 +391,10 @@ def test_mxnet_with_tensorboard_output_config(

@pytest.mark.canary_quick
def test_mxnet_with_all_rules_and_configs(
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
sagemaker_session,
mxnet_training_latest_version,
mxnet_training_latest_py_version,
cpu_instance_type,
):
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
rules = [
Expand Down Expand Up @@ -401,8 +422,8 @@ def test_mxnet_with_all_rules_and_configs(
mx = MXNet(
entry_point=script_path,
role="SageMakerRole",
framework_version=mxnet_full_version,
py_version=mxnet_full_py_version,
framework_version=mxnet_training_latest_version,
py_version=mxnet_training_latest_py_version,
instance_count=1,
instance_type=cpu_instance_type,
sagemaker_session=sagemaker_session,
Expand Down Expand Up @@ -445,7 +466,10 @@ def test_mxnet_with_all_rules_and_configs(


def test_mxnet_with_debugger_hook_config_disabled(
sagemaker_session, mxnet_full_version, mxnet_full_py_version, cpu_instance_type
sagemaker_session,
mxnet_training_latest_version,
mxnet_training_latest_py_version,
cpu_instance_type,
):
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
script_path = os.path.join(DATA_DIR, "mxnet_mnist", "mnist_gluon.py")
Expand All @@ -454,8 +478,8 @@ def test_mxnet_with_debugger_hook_config_disabled(
mx = MXNet(
entry_point=script_path,
role="SageMakerRole",
framework_version=mxnet_full_version,
py_version=mxnet_full_py_version,
framework_version=mxnet_training_latest_version,
py_version=mxnet_training_latest_py_version,
instance_count=1,
instance_type=cpu_instance_type,
sagemaker_session=sagemaker_session,
Expand Down
16 changes: 10 additions & 6 deletions tests/integ/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ def test_github(sagemaker_local_session, pytorch_full_version, pytorch_full_py_v

@pytest.mark.local_mode
@pytest.mark.skip("needs a secure authentication approach")
def test_private_github(sagemaker_local_session, mxnet_full_version, mxnet_full_py_version):
def test_private_github(
sagemaker_local_session, mxnet_training_latest_version, mxnet_training_latest_py_version
):
script_path = "mnist.py"
data_path = os.path.join(DATA_DIR, "mxnet_mnist")
git_config = {
Expand All @@ -99,8 +101,8 @@ def test_private_github(sagemaker_local_session, mxnet_full_version, mxnet_full_
role="SageMakerRole",
source_dir=source_dir,
dependencies=dependencies,
framework_version=mxnet_full_version,
py_version=mxnet_full_py_version,
framework_version=mxnet_training_latest_version,
py_version=mxnet_training_latest_py_version,
instance_count=1,
instance_type="local",
sagemaker_session=sagemaker_local_session,
Expand Down Expand Up @@ -223,7 +225,9 @@ def test_github_with_ssh_passphrase_not_configured(

@pytest.mark.local_mode
@pytest.mark.skip("needs a secure authentication approach")
def test_codecommit(sagemaker_local_session, mxnet_full_version, mxnet_full_py_version):
def test_codecommit(
sagemaker_local_session, mxnet_training_latest_version, mxnet_training_latest_py_version
):
script_path = "mnist.py"
data_path = os.path.join(DATA_DIR, "mxnet_mnist")
git_config = {
Expand All @@ -239,8 +243,8 @@ def test_codecommit(sagemaker_local_session, mxnet_full_version, mxnet_full_py_v
role="SageMakerRole",
source_dir=source_dir,
dependencies=dependencies,
framework_version=mxnet_full_version,
py_version=mxnet_full_py_version,
framework_version=mxnet_training_latest_version,
py_version=mxnet_training_latest_py_version,
instance_count=1,
instance_type="local",
sagemaker_session=sagemaker_local_session,
Expand Down
Loading