Skip to content

Commit

Permalink
Merge pull request #3 from aurora-opensource/patches/handle-stop-state
Browse files Browse the repository at this point in the history
fix(component): Handle Stop State for Sagemaker Jobs Fixes #kubeflow#7117
  • Loading branch information
vinayan3 authored Mar 7, 2022
2 parents 87c29ac + 0167ec4 commit 40c347e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,19 @@ def test_get_job_status(self):
SageMakerJobStatus(is_completed=True, raw_status="Completed"),
)

self.component._get_debug_rule_status = MagicMock(
return_value=SageMakerJobStatus(
is_completed=True, has_error=False, raw_status="Stopped"
)
)
self.component._sm_client.describe_training_job.return_value = {
"TrainingJobStatus": "Stopped"
}
self.assertEqual(
self.component._get_job_status(),
SageMakerJobStatus(is_completed=True, raw_status="Stopped"),
)

self.component._sm_client.describe_training_job.return_value = {
"TrainingJobStatus": "Failed",
"FailureReason": "lolidk",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _get_job_status(self) -> SageMakerJobStatus:
)
status = response["TrainingJobStatus"]

if status == "Completed":
if status == "Completed" or status == "Stopped":
return self._get_debug_rule_status()
if status == "Failed":
message = response["FailureReason"]
Expand Down

0 comments on commit 40c347e

Please sign in to comment.