Skip to content

Commit

Permalink
deprecated agent state to agent phase in webapi
Browse files Browse the repository at this point in the history
Signed-off-by: Future-Outlier <[email protected]>
  • Loading branch information
Future-Outlier committed Jan 18, 2024
1 parent 7b3f405 commit e830971
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flyteidl/protos/flyteidl/admin/agent.proto
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ message Resource {
string message = 3;
// log information for the task execution.
repeated core.TaskLog log_links = 4;
// The phase of the execution is used to determine the phase of the plugin's execution.
core.TaskExecution.Phase phase = 5;
}

// A message used to delete a task.
Expand Down
4 changes: 4 additions & 0 deletions flyteplugins/go/tasks/plugins/webapi/agent/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ func (p Plugin) Delete(ctx context.Context, taskCtx webapi.DeleteContext) error
func (p Plugin) Status(ctx context.Context, taskCtx webapi.StatusContext) (phase core.PhaseInfo, err error) {
resource := taskCtx.Resource().(ResourceWrapper)
taskInfo := &core.TaskInfo{Logs: resource.LogLinks}
logger.Infof(ctx, "@@@ resource.State [%v]", resource.State)
// switch resource.Phase {
// if it is undefined, default is 0 in the protobuf, then we will use resource.State to determine the phase
// }

switch resource.State {
case admin.State_PENDING:
Expand Down

0 comments on commit e830971

Please sign in to comment.