Skip to content

feature: warn on 'Stopped' (non-Completed) jobs #2000

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 2 commits into from
Dec 3, 2020

Conversation

athewsey
Copy link
Collaborator

Issue #, if available: #1937

Description of changes:

Jobs ending with status "Stopped" rather than "Completed" now trigger a warning, because they're likely to have been terminated in a non-happy-path (e.g. aborted or stopped early).

As discussed on the associated issue, a user typically needs to have taken actual conscious steps (e.g. saving intermediate output) for a job terminating in this way to be considered successful: So warning as default behaviour should help to protect less-experienced users.

Some caveats / possible points of feedback:

  • This PR implements the change directly in the shared _check_job_status() function because, as far as I've been able to ascertain, this significance appears to be shared between the different types of jobs it's shared between (which includes AutoML, Training, Processing, Compilation, HyperParameterTuning, Transform).
  • In my search of the docs, I couldn't find anywhere that the current 'silent' behaviour was explicitly referenced to update... And since it's only a warning I didn't feel it merited adding something explicit.
  • The current draft uses LOGGER.warning() to show a warning message, not warnings.warn (a pattern which is already used in some other places) - but I couldn't see any existing test tooling to assert on this: Just tests likewith pytest.warns(UserWarning): which seem to work with the warnings module only. Open to the idea of using the warnings module instead, but I think the default filter behaviour would be different? (Showing once only vs showing each triggered warning).

Testing done:

Verified the unit tests run, and imported the modified library in SageMaker (Studio) notebook to check manually that attaching to Stopped jobs triggers a visible warning as expected.

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.

General

  • I have read the CONTRIBUTING doc
  • I used the commit message format described in CONTRIBUTING
  • I have passed the region in to all S3 and STS clients that I've initialized as part of this change.
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have used unique_name_from_base to create resource names in integ tests (if appropriate)

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

Jobs ending with status "Stopped" rather than "Completed" are likely
to have been terminated in non-happy-path: e.g. aborted or stopped
early. Warn users to check results in this case.
@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: b055a67
  • Result: FAILED
  • Build Logs (available for 30 days)

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

@athewsey
Copy link
Collaborator Author

athewsey commented Dec 2, 2020

Is there a way to re-kick the CI checks without adding more commits? Seems like there was some sort of availability problem

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: bc6dddd
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-pr
  • Commit ID: bc6dddd
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-local-mode-tests
  • Commit ID: bc6dddd
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-notebook-tests
  • Commit ID: bc6dddd
  • 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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants