Skip to content

Commit 6c9d3c5

Browse files
author
Dan Choi
committed
increase timeout to 120 and ping interval to 5
1 parent b4d1d5f commit 6c9d3c5

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/sagemaker/local/entities.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
logger.setLevel(logging.WARNING)
3030

3131
_UNUSED_ARN = 'local:arn-does-not-matter'
32-
HEALTH_CHECK_TIMEOUT_LIMIT = 30
32+
HEALTH_CHECK_TIMEOUT_LIMIT = 120
3333

3434

3535
class _LocalTrainingJob(object):
@@ -405,7 +405,7 @@ def _wait_for_serving_container(serving_port):
405405

406406
endpoint_url = 'http://localhost:%s/ping' % serving_port
407407
while True:
408-
i += 1
408+
i += 5
409409
if i >= HEALTH_CHECK_TIMEOUT_LIMIT:
410410
raise RuntimeError('Giving up, endpoint didn\'t launch correctly')
411411

@@ -416,7 +416,7 @@ def _wait_for_serving_container(serving_port):
416416
else:
417417
return
418418

419-
time.sleep(1)
419+
time.sleep(5)
420420

421421

422422
def _perform_request(endpoint_url, pool_manager=None):

src/sagemaker/local/image.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@
3636
import sagemaker.local.data
3737
import sagemaker.local.utils
3838
import sagemaker.utils
39+
from sagemaker.local.entities import HEALTH_CHECK_TIMEOUT_LIMIT
3940

4041
CONTAINER_PREFIX = 'algo'
4142
DOCKER_COMPOSE_FILENAME = 'docker-compose.yaml'
4243

44+
4345
# Environment variables to be set during training
4446
REGION_ENV_NAME = 'AWS_REGION'
4547
TRAINING_JOB_NAME_ENV_NAME = 'TRAINING_JOB_NAME'
@@ -359,6 +361,9 @@ def _generate_compose_file(self, command, additional_volumes=None, additional_en
359361
additional_env_var_list = ['{}={}'.format(k, v) for k, v in additional_env_vars.items()]
360362
environment.extend(additional_env_var_list)
361363

364+
if os.environ.get('COMPOSE_HTTP_TIMEOUT') is None:
365+
os.environ['COMPOSE_HTTP_TIMEOUT'] = str(HEALTH_CHECK_TIMEOUT_LIMIT)
366+
362367
if command == 'train':
363368
optml_dirs = {'output', 'output/data', 'input'}
364369

0 commit comments

Comments
 (0)