Skip to content

Increase read timeout for sagemaker runtime #355

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 5 commits into from
Aug 21, 2018
Merged
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
9 changes: 6 additions & 3 deletions src/sagemaker/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
from sagemaker.utils import name_from_image, secondary_training_status_message, secondary_training_status_changed
import sagemaker.logs


logging.basicConfig()
LOGGER = logging.getLogger('sagemaker')
LOGGER.setLevel(logging.INFO)
Expand Down Expand Up @@ -93,7 +92,12 @@ def _initialize(self, boto_session, sagemaker_client, sagemaker_runtime_client):
self.sagemaker_client = sagemaker_client or self.boto_session.client('sagemaker')
prepend_user_agent(self.sagemaker_client)

self.sagemaker_runtime_client = sagemaker_runtime_client or self.boto_session.client('runtime.sagemaker')
if sagemaker_runtime_client is not None:
self.sagemaker_runtime_client = sagemaker_runtime_client
else:
config = botocore.config.Config(read_timeout=80)
self.sagemaker_runtime_client = self.boto_session.client('runtime.sagemaker', config=config)

prepend_user_agent(self.sagemaker_runtime_client)

self.local_mode = False
Expand Down Expand Up @@ -1028,7 +1032,6 @@ def _deployment_entity_exists(describe_fn):


def _train_done(sagemaker_client, job_name, last_desc):

in_progress_statuses = ['InProgress', 'Created']

desc = sagemaker_client.describe_training_job(TrainingJobName=job_name)
Expand Down