-
Notifications
You must be signed in to change notification settings - Fork 18
Feature: Add wait with logs to subset of Job types #201
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
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
src/sagemaker_core/main/logs.py
Outdated
|
|
||
| class CloudWatchLogsClient(metaclass=SingletonMeta): | ||
| """ | ||
| A singleton class for creating a SageMaker client. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit : Not a sagemaker client
src/sagemaker_core/main/logs.py
Outdated
| self.client = session.client( | ||
| "logs", | ||
| session.region_name, | ||
| config=Config(retries={"max_attempts": 10, "mode": "standard"}), | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is really needed only once , we can create it during the first call and have a check
if not self.client:
session = Session()
self.client = session.client(
"logs",
session.region_name,
config=Config(retries={"max_attempts": 10, "mode": "standard"}),
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, let me add this, good catch
Issue #, if available:
Description of changes:
Add log stream handlers that will be used for streaming cloudwatch log events during wait
Only adding support for a subset of job type:
set(["TrainingJob", "ProcessingJob", "TransformJob"])Both MultiLogStreamHandler and LogStreamHandler utilize a
get_latest_log_event()method which returns a generator that yields:Testing