Skip to content

allow ei versions to be configurable in integ test #639

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 2 commits into from
Feb 12, 2019
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
22 changes: 12 additions & 10 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ def pytest_addoption(parser):
parser.addoption('--boto-config', action='store', default=None)
parser.addoption('--chainer-full-version', action='store', default=Chainer.LATEST_VERSION)
parser.addoption('--mxnet-full-version', action='store', default=MXNet.LATEST_VERSION)
parser.addoption('--ei-mxnet-full-version', action='store', default=MXNet.LATEST_VERSION)
parser.addoption('--pytorch-full-version', action='store', default=PyTorch.LATEST_VERSION)
parser.addoption('--rl-coach-full-version', action='store',
default=RLEstimator.COACH_LATEST_VERSION)
parser.addoption('--rl-ray-full-version', action='store',
default=RLEstimator.RAY_LATEST_VERSION)
parser.addoption('--sklearn-full-version', action='store', default=SKLEARN_VERSION)
parser.addoption('--tf-full-version', action='store', default=TensorFlow.LATEST_VERSION)
parser.addoption('--ei-tf-full-version', action='store', default=TensorFlow.LATEST_VERSION)


def pytest_configure(config):
Expand Down Expand Up @@ -109,11 +111,6 @@ def mxnet_version(request):
return request.param


@pytest.fixture(scope='module', params=['1.3', '1.3.0'])
def ei_mxnet_version(request):
return request.param


@pytest.fixture(scope='module', params=['0.4', '0.4.0', '1.0', '1.0.0'])
def pytorch_version(request):
return request.param
Expand All @@ -131,11 +128,6 @@ def tf_version(request):
return request.param


@pytest.fixture(scope='module', params=['1.12', '1.12.0'])
def ei_tf_version(request):
return request.param


@pytest.fixture(scope='module', params=['0.10.1', '0.10.1', '0.11', '0.11.0'])
def rl_coach_tf_version(request):
return request.param
Expand All @@ -161,6 +153,11 @@ def mxnet_full_version(request):
return request.config.getoption('--mxnet-full-version')


@pytest.fixture(scope='module')
def ei_mxnet_full_version(request):
return request.config.getoption('--ei-mxnet-full-version')


@pytest.fixture(scope='module')
def pytorch_full_version(request):
return request.config.getoption('--pytorch-full-version')
Expand All @@ -184,3 +181,8 @@ def sklearn_full_version(request):
@pytest.fixture(scope='module')
def tf_full_version(request):
return request.config.getoption('--tf-full-version')


@pytest.fixture(scope='module')
def ei_tf_full_version(request):
return request.config.getoption('--ei-tf-full-version')
4 changes: 2 additions & 2 deletions tests/integ/test_mxnet_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@ def test_deploy_model_with_update_non_existing_endpoint(mxnet_training_job, sage
@pytest.mark.regional_testing
@pytest.mark.skipif(tests.integ.test_region() not in tests.integ.EI_SUPPORTED_REGIONS,
reason="EI isn't supported in that specific region.")
def test_deploy_model_with_accelerator(mxnet_training_job, sagemaker_session, ei_mxnet_version):
def test_deploy_model_with_accelerator(mxnet_training_job, sagemaker_session, ei_mxnet_full_version):
endpoint_name = 'test-mxnet-deploy-model-ei-{}'.format(sagemaker_timestamp())

with timeout_and_delete_endpoint_by_name(endpoint_name, sagemaker_session):
desc = sagemaker_session.sagemaker_client.describe_training_job(TrainingJobName=mxnet_training_job)
model_data = desc['ModelArtifacts']['S3ModelArtifacts']
script_path = os.path.join(DATA_DIR, 'mxnet_mnist', 'mnist.py')
model = MXNetModel(model_data, 'SageMakerRole', entry_point=script_path,
framework_version=ei_mxnet_version, py_version=PYTHON_VERSION,
framework_version=ei_mxnet_full_version, py_version=PYTHON_VERSION,
sagemaker_session=sagemaker_session)
predictor = model.deploy(1, 'ml.m4.xlarge', endpoint_name=endpoint_name, accelerator_type='ml.eia1.medium')

Expand Down
4 changes: 2 additions & 2 deletions tests/integ/test_tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test_deploy_model(sagemaker_session, tf_training_job):
@pytest.mark.skipif(tests.integ.test_region() not in tests.integ.EI_SUPPORTED_REGIONS,
reason="EI isn't supported in that specific region.")
@pytest.mark.skipif(PYTHON_VERSION != 'py2', reason="TensorFlow image supports only python 2.")
def test_deploy_model_with_accelerator(sagemaker_session, tf_training_job, ei_tf_version):
def test_deploy_model_with_accelerator(sagemaker_session, tf_training_job, ei_tf_full_version):
endpoint_name = 'test-tf-deploy-model-ei-{}'.format(sagemaker_timestamp())

with timeout_and_delete_endpoint_by_name(endpoint_name, sagemaker_session):
Expand All @@ -92,7 +92,7 @@ def test_deploy_model_with_accelerator(sagemaker_session, tf_training_job, ei_tf

script_path = os.path.join(DATA_DIR, 'iris', 'iris-dnn-classifier.py')
model = TensorFlowModel(model_data, 'SageMakerRole', entry_point=script_path,
framework_version=ei_tf_version, sagemaker_session=sagemaker_session)
framework_version=ei_tf_full_version, sagemaker_session=sagemaker_session)

json_predictor = model.deploy(initial_instance_count=1, instance_type='ml.c4.xlarge',
endpoint_name=endpoint_name, accelerator_type='ml.eia1.medium')
Expand Down