This repository has been archived by the owner on Oct 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
/
executor.go
55 lines (47 loc) · 1.52 KB
/
executor.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package interfaces
import (
"context"
"time"
"github.com/lyft/flyteidl/gen/pb-go/flyteidl/admin"
"github.com/lyft/flyteidl/gen/pb-go/flyteidl/core"
"github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1"
)
type ExecuteWorkflowInput struct {
ExecutionID *core.WorkflowExecutionIdentifier
WfClosure core.CompiledWorkflowClosure
Inputs *core.LiteralMap
Reference admin.LaunchPlan
AcceptedAt time.Time
Labels map[string]string
Annotations map[string]string
QueueingBudget time.Duration
}
type ExecuteTaskInput struct {
ExecutionID *core.WorkflowExecutionIdentifier
WfClosure core.CompiledWorkflowClosure
Inputs *core.LiteralMap
ReferenceName string
Auth *admin.AuthRole
AcceptedAt time.Time
Labels map[string]string
Annotations map[string]string
QueueingBudget time.Duration
}
type TerminateWorkflowInput struct {
ExecutionID *core.WorkflowExecutionIdentifier
Cluster string
}
type ExecutionInfo struct {
Cluster string
}
type FlyteWorkflowInterface interface {
BuildFlyteWorkflow(
wfClosure *core.CompiledWorkflowClosure, inputs *core.LiteralMap, executionID *core.WorkflowExecutionIdentifier,
namespace string) (*v1alpha1.FlyteWorkflow, error)
}
type Executor interface {
ExecuteWorkflow(
ctx context.Context, input ExecuteWorkflowInput) (*ExecutionInfo, error)
ExecuteTask(ctx context.Context, input ExecuteTaskInput) (*ExecutionInfo, error)
TerminateWorkflowExecution(ctx context.Context, input TerminateWorkflowInput) error
}