Skip to content

Increase timeout #337

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
Aug 8, 2018
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
6 changes: 3 additions & 3 deletions tests/integ/test_chainer_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ def test_training_with_additional_hyperparameters(sagemaker_session, chainer_ful
def test_attach_deploy(chainer_training_job, sagemaker_session):
endpoint_name = 'test-chainer-attach-deploy-{}'.format(sagemaker_timestamp())

with timeout_and_delete_endpoint_by_name(endpoint_name, sagemaker_session, minutes=20):
with timeout_and_delete_endpoint_by_name(endpoint_name, sagemaker_session):
estimator = Chainer.attach(chainer_training_job, sagemaker_session=sagemaker_session)
predictor = estimator.deploy(1, 'ml.m4.xlarge', endpoint_name=endpoint_name)
_predict_and_assert(predictor)


def test_deploy_model(chainer_training_job, sagemaker_session):
endpoint_name = 'test-chainer-deploy-model-{}'.format(sagemaker_timestamp())
with timeout_and_delete_endpoint_by_name(endpoint_name, sagemaker_session, minutes=20):
with timeout_and_delete_endpoint_by_name(endpoint_name, sagemaker_session):
desc = sagemaker_session.sagemaker_client.describe_training_job(TrainingJobName=chainer_training_job)
model_data = desc['ModelArtifacts']['S3ModelArtifacts']
script_path = os.path.join(DATA_DIR, 'chainer_mnist', 'mnist.py')
Expand All @@ -93,7 +93,7 @@ def test_async_fit(sagemaker_session):
print("Waiting to re-attach to the training job: %s" % training_job_name)
time.sleep(20)

with timeout_and_delete_endpoint_by_name(endpoint_name, sagemaker_session, minutes=35):
with timeout_and_delete_endpoint_by_name(endpoint_name, sagemaker_session):
print("Re-attaching now to: %s" % training_job_name)
estimator = Chainer.attach(training_job_name=training_job_name, sagemaker_session=sagemaker_session)
predictor = estimator.deploy(1, "ml.c4.xlarge", endpoint_name=endpoint_name)
Expand Down
2 changes: 1 addition & 1 deletion tests/integ/test_pytorch_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def fixture_training_job(sagemaker_session, pytorch_full_version):
def test_sync_fit_deploy(pytorch_training_job, sagemaker_session):
# TODO: add tests against local mode when it's ready to be used
endpoint_name = 'test-pytorch-sync-fit-attach-deploy{}'.format(sagemaker_timestamp())
with timeout_and_delete_endpoint_by_name(endpoint_name, sagemaker_session, minutes=20):
with timeout_and_delete_endpoint_by_name(endpoint_name, sagemaker_session):
estimator = PyTorch.attach(pytorch_training_job, sagemaker_session=sagemaker_session)
predictor = estimator.deploy(1, 'ml.c4.xlarge', endpoint_name=endpoint_name)
data = numpy.zeros(shape=(1, 1, 28, 28), dtype=numpy.float32)
Expand Down
2 changes: 1 addition & 1 deletion tests/integ/test_randomcutforest.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_randomcutforest(sagemaker_session):
rcf.fit(rcf.record_set(train_input))

endpoint_name = name_from_base('randomcutforest')
with timeout_and_delete_endpoint_by_name(endpoint_name, sagemaker_session, minutes=20):
with timeout_and_delete_endpoint_by_name(endpoint_name, sagemaker_session):
model = RandomCutForestModel(rcf.model_data, role='SageMakerRole', sagemaker_session=sagemaker_session)
predictor = model.deploy(1, 'ml.c4.xlarge', endpoint_name=endpoint_name)

Expand Down
2 changes: 1 addition & 1 deletion tests/integ/test_tuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def test_attach_tuning_pytorch(sagemaker_session):

attached_tuner = HyperparameterTuner.attach(tuning_job_name, sagemaker_session=sagemaker_session)
best_training_job = tuner.best_training_job()
with timeout_and_delete_endpoint_by_name(best_training_job, sagemaker_session, minutes=20):
with timeout_and_delete_endpoint_by_name(best_training_job, sagemaker_session):
predictor = attached_tuner.deploy(1, 'ml.c4.xlarge')
data = np.zeros(shape=(1, 1, 28, 28), dtype=np.float32)
predictor.predict(data)
Expand Down
2 changes: 1 addition & 1 deletion tests/integ/timeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def handler(signum, frame):


@contextmanager
def timeout_and_delete_endpoint_by_name(endpoint_name, sagemaker_session, seconds=0, minutes=35, hours=0):
def timeout_and_delete_endpoint_by_name(endpoint_name, sagemaker_session, seconds=0, minutes=45, hours=0):
with timeout(seconds=seconds, minutes=minutes, hours=hours) as t:
no_errors = False
try:
Expand Down