From 328de82f2d81fb4b8fc848d2c178858b49f2c2db Mon Sep 17 00:00:00 2001 From: Kevin Su Date: Fri, 5 Apr 2024 03:49:13 -0700 Subject: [PATCH 1/2] feat(webapi): Change phase to initializing on job submit --- .../go/tasks/pluginmachinery/internal/webapi/monitor.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor.go index c68634d0e0..e1e3bb7b6a 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor.go @@ -2,6 +2,7 @@ package webapi import ( "context" + "time" "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" @@ -38,7 +39,7 @@ func monitor(ctx context.Context, tCtx core.TaskExecutionContext, p Client, cach } return state, core.PhaseInfoFailure(errors.CacheFailed, cacheItem.ErrorMessage, nil), nil } - return state, core.PhaseInfoRunning(0, nil), nil + return state, core.PhaseInfoInitializing(time.Now(), core.DefaultPhaseVersion, "job submitted", nil), nil } newPhase, err := p.Status(ctx, newPluginContext(cacheItem.ResourceMeta, cacheItem.Resource, "", tCtx)) From 6bedcf1f512a89be81afd35f3ed26057a82b6f97 Mon Sep 17 00:00:00 2001 From: Kevin Su Date: Fri, 5 Apr 2024 11:47:40 -0700 Subject: [PATCH 2/2] nit Signed-off-by: Kevin Su --- .../go/tasks/pluginmachinery/internal/webapi/monitor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor.go index e1e3bb7b6a..4edbadcb07 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor.go @@ -39,7 +39,7 @@ func monitor(ctx context.Context, tCtx core.TaskExecutionContext, p Client, cach } return state, core.PhaseInfoFailure(errors.CacheFailed, cacheItem.ErrorMessage, nil), nil } - return state, core.PhaseInfoInitializing(time.Now(), core.DefaultPhaseVersion, "job submitted", nil), nil + return state, core.PhaseInfoQueued(time.Now(), core.DefaultPhaseVersion, "job submitted"), nil } newPhase, err := p.Status(ctx, newPluginContext(cacheItem.ResourceMeta, cacheItem.Resource, "", tCtx))