Skip to content
This repository was archived by the owner on Aug 26, 2020. It is now read-only.

change: stream stderr even when capture_error is True - #233

Merged
laurenyu merged 4 commits into
aws:masterfrom
laurenyu:stderr
Oct 29, 2019
Merged

laurenyu merged 4 commits into
aws:masterfrom
laurenyu:stderr

Conversation

@laurenyu

@laurenyu laurenyu commented Oct 29, 2019 •

Copy link
Copy Markdown
Contributor

Issue #, if available:
https://github.com/aws/sagemaker-python-sdk/issues/1100

Description of changes:
when capture_error=True, stderr is included in the error message but not in the container logs. here's my attempt to have stderr both streamed and captured.

Testing done:
I manually tested this with our PyTorch image, which sets capture_error=True (I think it's the only one of our team's to do so?)

I wrote a dummy training script:

import sys
import time

sys.stdout.write("hello\n")
sys.stderr.write("world\n")

time.sleep(10)

sys.stdout.write("test\n")
sys.stderr.write("1\n")
sys.stdout.write("2\n")
sys.stderr.write("3\n")

raise ValueError("4")

relevant output:

algo-1-o29gd_1  | Invoking script with the following command:
algo-1-o29gd_1  | 
algo-1-o29gd_1  | /opt/conda/bin/python mnist.py --processor cpu
algo-1-o29gd_1  | 
algo-1-o29gd_1  | 
algo-1-o29gd_1  | hello
algo-1-o29gd_1  | world
algo-1-o29gd_1  | test
algo-1-o29gd_1  | 1
algo-1-o29gd_1  | 2
algo-1-o29gd_1  | 3
algo-1-o29gd_1  | Traceback (most recent call last):
algo-1-o29gd_1  |   File "mnist.py", line 14, in <module>
algo-1-o29gd_1  |     raise ValueError("4")
algo-1-o29gd_1  | ValueError: 4
algo-1-o29gd_1  | 2019-10-29 18:19:32,830 sagemaker-containers ERROR    ExecuteUserScriptError:
algo-1-o29gd_1  | Command "/opt/conda/bin/python mnist.py --processor cpu"
algo-1-o29gd_1  | world
algo-1-o29gd_1  | 1
algo-1-o29gd_1  | 3
algo-1-o29gd_1  | Traceback (most recent call last):
algo-1-o29gd_1  |   File "mnist.py", line 14, in <module>
algo-1-o29gd_1  |     raise ValueError("4")
algo-1-o29gd_1  | ValueError: 4

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

  • I have read the CONTRIBUTING doc
  • I used the commit message format described in CONTRIBUTING
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have updated any necessary documentation (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@sagemaker-bot

Copy link
Copy Markdown

AWS CodeBuild CI Report

  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot

Copy link
Copy Markdown

AWS CodeBuild CI Report

  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot

Copy link
Copy Markdown

AWS CodeBuild CI Report

  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot

Copy link
Copy Markdown

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants