Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Plugin changes for plumbing k8s events into TaskExecutionEvent #406

Merged
merged 4 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion go/tasks/pluginmachinery/core/phase.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import (
"fmt"
"time"

"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
structpb "github.com/golang/protobuf/ptypes/struct"

"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
)

const DefaultPhaseVersion = uint32(0)
Expand Down Expand Up @@ -83,6 +84,11 @@ type ExternalResource struct {
Phase Phase
}

type ReasonInfo struct {
Reason string
OccurredAt *time.Time
}

type TaskInfo struct {
// log information for the task execution
Logs []*core.TaskLog
Expand All @@ -96,6 +102,8 @@ type TaskInfo struct {
CustomInfo *structpb.Struct
// A collection of information about external resources launched by this task
ExternalResources []*ExternalResource
// Additional reasons for this case. Note, these are not included in the phase state.
AdditionalReasons []ReasonInfo
}

func (t *TaskInfo) String() string {
Expand Down
6 changes: 5 additions & 1 deletion go/tasks/pluginmachinery/flytek8s/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import (

"k8s.io/apimachinery/pkg/api/resource"

config2 "github.com/flyteorg/flytestdlib/config"
v1 "k8s.io/api/core/v1"

config2 "github.com/flyteorg/flytestdlib/config"

"github.com/flyteorg/flyteplugins/go/tasks/config"
)

Expand Down Expand Up @@ -167,6 +168,9 @@ type K8sPluginConfig struct {
// DefaultPodTemplateResync defines the frequency at which the k8s informer resyncs the default
// pod template resources.
DefaultPodTemplateResync config2.Duration `json:"default-pod-template-resync" pflag:",Frequency of resyncing default pod templates"`

// SendObjectEvents indicates whether to send k8s object events in TaskExecutionEvent updates (similar to kubectl get events).
SendObjectEvents bool `json:"send-object-events" pflag:",If true, will send k8s object events in TaskExecutionEvent updates."`
}

// FlyteCoPilotConfig specifies configuration for the Flyte CoPilot system. FlyteCoPilot, allows running flytekit-less containers
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading