From c4fef381ebc040ac9bac8178a17aa29c132df0c1 Mon Sep 17 00:00:00 2001 From: Kevin Su Date: Wed, 23 Oct 2024 11:00:22 -0700 Subject: [PATCH] Add JobDeploymentStatusSuspending Signed-off-by: Kevin Su --- flyteplugins/go/tasks/plugins/k8s/ray/ray.go | 2 ++ flyteplugins/go/tasks/plugins/k8s/ray/ray_test.go | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/flyteplugins/go/tasks/plugins/k8s/ray/ray.go b/flyteplugins/go/tasks/plugins/k8s/ray/ray.go index 6cecd81c04..95a87f4efa 100644 --- a/flyteplugins/go/tasks/plugins/k8s/ray/ray.go +++ b/flyteplugins/go/tasks/plugins/k8s/ray/ray.go @@ -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 diff --git a/flyteplugins/go/tasks/plugins/k8s/ray/ray_test.go b/flyteplugins/go/tasks/plugins/k8s/ray/ray_test.go index 0c733144af..38b2f56785 100644 --- a/flyteplugins/go/tasks/plugins/k8s/ray/ray_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/ray/ray_test.go @@ -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 {