Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <[email protected]>
  • Loading branch information
pingsutw committed Nov 15, 2023
1 parent 8454aa9 commit 97979d9
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
10 changes: 10 additions & 0 deletions flytepropeller/pkg/compiler/transformers/k8s/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ func buildFlyteWorkflowSpec(wf *core.CompiledWorkflow, tasks []*core.CompiledTas

var failureN *v1alpha1.NodeSpec
if n := wf.Template.GetFailureNode(); n != nil {
for _, in := range n.Inputs {
in.Binding = &core.BindingData{
Value: &core.BindingData_Promise{
Promise: &core.OutputReference{
Var: in.Binding.GetPromise().GetVar(),
NodeId: v1alpha1.StartNodeID,
},
},
}
}
nodes, ok := buildNodeSpec(n, tasks, errs.NewScope())
if !ok {
return nil, errs
Expand Down
34 changes: 34 additions & 0 deletions flytepropeller/pkg/controller/executors/failure_node_lookup.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package executors

import (
"context"
"github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1"
)

type FailureNodeLookup struct {
NodeSpec *v1alpha1.NodeSpec
NodeStatus v1alpha1.ExecutableNodeStatus
}

func (f FailureNodeLookup) GetNode(nodeID v1alpha1.NodeID) (v1alpha1.ExecutableNode, bool) {
return f.NodeSpec, true
}

func (f FailureNodeLookup) GetNodeExecutionStatus(ctx context.Context, id v1alpha1.NodeID) v1alpha1.ExecutableNodeStatus {
return f.NodeStatus
}

func (f FailureNodeLookup) ToNode(id v1alpha1.NodeID) ([]v1alpha1.NodeID, error) {
return []v1alpha1.NodeID{v1alpha1.StartNodeID}, nil
}

func (f FailureNodeLookup) FromNode(id v1alpha1.NodeID) ([]v1alpha1.NodeID, error) {
return nil, nil
}

func NewFailureNodeLookup(nodeSpec *v1alpha1.NodeSpec, nodeStatus v1alpha1.ExecutableNodeStatus) NodeLookup {
return FailureNodeLookup{
NodeSpec: nodeSpec,
NodeStatus: nodeStatus,
}
}

0 comments on commit 97979d9

Please sign in to comment.