Skip to content

Mvs local mode timeout #401

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

Closed
wants to merge 2 commits into from
Closed
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
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CHANGELOG
* doc-fix: add deprecation warning for current MXNet training script format
* doc-fix: add docs on deploying TensorFlow model directly from existing model
* doc-fix: fix code example for using Gzip compression for TensorFlow training data
* bug-fix: Setting health check timeout limit on local mode to 30s

1.10.0
======
Expand Down
4 changes: 3 additions & 1 deletion src/sagemaker/local/local_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
from sagemaker.session import Session
from sagemaker.utils import get_config_value

HEALTH_CHECK_TIMEOUT_LIMIT = 30

logger = logging.getLogger(__name__)
logger.setLevel(logging.WARNING)

Expand Down Expand Up @@ -123,7 +125,7 @@ def create_endpoint(self, EndpointName, EndpointConfigName):
endpoint_url = "http://localhost:%s/ping" % serving_port
while True:
i += 1
if i >= 10:
if i >= HEALTH_CHECK_TIMEOUT_LIMIT:
raise RuntimeError("Giving up, endpoint: %s didn't launch correctly" % EndpointName)

logger.info("Checking if endpoint is up, attempt: %s" % i)
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/test_local_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def test_create_endpoint(serve, request, LocalSession):
@patch('urllib3.PoolManager.request', return_value=BAD_RESPONSE)
@patch('sagemaker.local.local_session.LocalSession')
@patch('time.sleep')
def test_create_endpoint_fails(*args):
def test_create_endpoint_fails(sleep, *args):
local_sagemaker_client = sagemaker.local.local_session.LocalSagemakerClient()
local_sagemaker_client.variants = [{'InstanceType': 'ml.c4.99xlarge', 'InitialInstanceCount': 10}]
local_sagemaker_client.primary_container = {'ModelDataUrl': '/some/model/path',
Expand All @@ -214,6 +214,8 @@ def test_create_endpoint_fails(*args):
with pytest.raises(RuntimeError):
local_sagemaker_client.create_endpoint('my-endpoint', 'some-endpoint-config')

assert 29 == sleep.call_count


def test_file_input_all_defaults():
prefix = 'pre'
Expand Down