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 62
/
executor.go
60 lines (52 loc) · 1.84 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
56
57
58
59
60
package interfaces
import (
"context"
"time"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/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
TaskPluginOverrides []*admin.PluginOverride
ExecutionConfig *admin.WorkflowExecutionConfig
Auth *admin.AuthRole
}
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
TaskPluginOverrides []*admin.PluginOverride
ExecutionConfig *admin.WorkflowExecutionConfig
}
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
}