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 53
/
exec_metadata.go
49 lines (43 loc) · 1.91 KB
/
exec_metadata.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
package core
import (
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
v1 "k8s.io/api/core/v1"
v12 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
)
// TaskOverrides interface to expose any overrides that have been set for this task (like resource overrides etc)
type TaskOverrides interface {
GetResources() *v1.ResourceRequirements
GetConfig() *v1.ConfigMap
}
// TaskExecutionID is a simple Interface to expose the ExecutionID of the running Task
type TaskExecutionID interface {
// GetGeneratedName returns the computed/generated name for the task id
// deprecated: use GetGeneratedNameWithLength
GetGeneratedName() string
// GetGeneratedNameWith returns the generated name within a bounded length. If the name is smaller than minLength,
// it'll get right-padded with character '0'. If the name is bigger than maxLength, it'll get hashed to fit within.
GetGeneratedNameWith(minLength, maxLength int) (string, error)
// GetID returns the underlying idl task identifier.
GetID() core.TaskExecutionIdentifier
}
// TaskExecutionMetadata represents any execution information for a Task. It is used to communicate meta information about the
// execution or any previously stored information
type TaskExecutionMetadata interface {
// GetOwnerID returns the owning Kubernetes object
GetOwnerID() types.NamespacedName
// GetTaskExecutionID is a specially generated task execution id, that is guaranteed to be unique and consistent for subsequent calls
GetTaskExecutionID() TaskExecutionID
GetNamespace() string
GetOwnerReference() v12.OwnerReference
GetOverrides() TaskOverrides
GetLabels() map[string]string
GetMaxAttempts() uint32
GetAnnotations() map[string]string
GetK8sServiceAccount() string
GetSecurityContext() core.SecurityContext
IsInterruptible() bool
GetPlatformResources() *v1.ResourceRequirements
GetInterruptibleFailureThreshold() int32
GetEnvironmentVariables() map[string]string
}