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 60
/
node_exec_context.go
62 lines (51 loc) · 1.73 KB
/
node_exec_context.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
61
62
package handler
import (
"context"
"github.com/lyft/flyteidl/clients/go/events"
"github.com/lyft/flyteidl/gen/pb-go/flyteidl/core"
"github.com/lyft/flyteplugins/go/tasks/pluginmachinery/io"
"github.com/lyft/flytestdlib/promutils"
"github.com/lyft/flytestdlib/storage"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1"
)
type TaskReader interface {
Read(ctx context.Context) (*core.TaskTemplate, error)
GetTaskType() v1alpha1.TaskType
GetTaskID() *core.Identifier
}
type SetupContext interface {
EnqueueOwner() func(string)
OwnerKind() string
MetricsScope() promutils.Scope
}
type NodeExecutionMetadata interface {
GetOwnerID() types.NamespacedName
// TODO we should covert this to a generic execution identifier instead of a workflow identifier
GetExecutionID() v1alpha1.WorkflowExecutionIdentifier
GetNamespace() string
GetOwnerReference() v1.OwnerReference
GetLabels() map[string]string
GetAnnotations() map[string]string
GetK8sServiceAccount() string
}
type NodeExecutionContext interface {
DataStore() *storage.DataStore
InputReader() io.InputReader
EventsRecorder() events.TaskEventRecorder
NodeID() v1alpha1.NodeID
Node() v1alpha1.ExecutableNode
CurrentAttempt() uint32
TaskReader() TaskReader
NodeStateReader() NodeStateReader
NodeStateWriter() NodeStateWriter
NodeExecutionMetadata() NodeExecutionMetadata
MaxDatasetSizeBytes() int64
EnqueueOwnerFunc() func() error
// Deprecated
Workflow() v1alpha1.ExecutableWorkflow
// TODO We should not need to pass NodeStatus, we probably only need it for DataDir, which should actually be sent using an OutputWriter interface
// Deprecated
NodeStatus() v1alpha1.ExecutableNodeStatus
}