Skip to content

Commit

Permalink
Add JobDeploymentStatusSuspending
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <[email protected]>
  • Loading branch information
pingsutw committed Oct 23, 2024
1 parent ae052b7 commit c4fef38
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions flyteplugins/go/tasks/plugins/k8s/ray/ray.go
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,8 @@ func (plugin rayJobResourceHandler) GetTaskPhase(ctx context.Context, pluginCont
phaseInfo, err = pluginsCore.PhaseInfoSuccess(info), nil
case rayv1.JobDeploymentStatusSuspended:
phaseInfo, err = pluginsCore.PhaseInfoQueuedWithTaskInfo(time.Now(), pluginsCore.DefaultPhaseVersion, "Suspended", info), nil
case rayv1.JobDeploymentStatusSuspending:
phaseInfo, err = pluginsCore.PhaseInfoQueuedWithTaskInfo(time.Now(), pluginsCore.DefaultPhaseVersion, "Suspending", info), nil
case rayv1.JobDeploymentStatusFailed:
failInfo := fmt.Sprintf("Failed to run Ray job %s with error: [%s] %s", rayJob.Name, rayJob.Status.Reason, rayJob.Status.Message)
phaseInfo, err = pluginsCore.PhaseInfoFailure(flyteerr.TaskFailedWithError, failInfo, info), nil
Expand Down
4 changes: 2 additions & 2 deletions flyteplugins/go/tasks/plugins/k8s/ray/ray_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -755,8 +755,8 @@ func TestGetTaskPhase(t *testing.T) {
{rayv1.JobDeploymentStatusRunning, pluginsCore.PhaseRunning, false},
{rayv1.JobDeploymentStatusComplete, pluginsCore.PhaseSuccess, false},
{rayv1.JobDeploymentStatusFailed, pluginsCore.PhasePermanentFailure, false},
{rayv1.JobDeploymentStatusSuspended, pluginsCore.PhaseQueued, true},
{rayv1.JobDeploymentStatusSuspending, pluginsCore.PhaseUndefined, true},
{rayv1.JobDeploymentStatusSuspended, pluginsCore.PhaseQueued, false},
{rayv1.JobDeploymentStatusSuspending, pluginsCore.PhaseQueued, false},
}

for _, tc := range testCases {
Expand Down

0 comments on commit c4fef38

Please sign in to comment.