Created
March 22, 2022 13:14
-
-
Save sofianhamiti/18b7de4c2369751ae605668ca7410a36 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sagemaker.workflow.retry import ( | |
| StepRetryPolicy, | |
| StepExceptionTypeEnum, | |
| SageMakerJobStepRetryPolicy, | |
| SageMakerJobExceptionTypeEnum | |
| ) | |
| step_retry_policy = StepRetryPolicy( | |
| exception_types=[ | |
| StepExceptionTypeEnum.SERVICE_FAULT, | |
| StepExceptionTypeEnum.THROTTLING, | |
| ], | |
| backoff_rate=2.0, | |
| interval_seconds=30, | |
| expire_after_mins=240 # keep trying for for 4 hours max | |
| ) | |
| job_retry_policy = SageMakerJobStepRetryPolicy( | |
| exception_types=[SageMakerJobExceptionTypeEnum.RESOURCE_LIMIT], | |
| failure_reason_types=[ | |
| SageMakerJobExceptionTypeEnum.INTERNAL_ERROR, | |
| SageMakerJobExceptionTypeEnum.CAPACITY_ERROR, | |
| ], | |
| backoff_rate=2.0, | |
| interval_seconds=30, | |
| expire_after_mins=240 # keep trying for for 4 hours max | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment