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

Commit

Permalink
Plugin changes for plumbing k8s events into TaskExecutionEvent (#406)
Browse files Browse the repository at this point in the history
* Plugin changes for k8s events

Signed-off-by: Andrew Dye <[email protected]>

* make generate

Signed-off-by: Andrew Dye <[email protected]>

* Comment for SendObjectEvents

Signed-off-by: Andrew Dye <[email protected]>

* make generate

Signed-off-by: Andrew Dye <[email protected]>

---------

Signed-off-by: Andrew Dye <[email protected]>
  • Loading branch information
andrewwdye committed Sep 27, 2023
1 parent 8b417f4 commit 01ebefd
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
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.

0 comments on commit 01ebefd

Please sign in to comment.