Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add events and actions for task reschedule #140

Merged
merged 1 commit into from
Nov 12, 2024
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
4 changes: 4 additions & 0 deletions pkg/apis/bus/v1alpha1/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ const (
// This action can not work together with job level events, e.g. JobUnschedulable
RestartTaskAction Action = "RestartTask"

// RestartPodAction if this action is set, only the pod will be restarted; default action.
// This action can just work together with pod level events, e.g. PodFailed
RestartPodAction Action = "RestartPod"

// TerminateJobAction if this action is set, the whole job wil be terminated
// and can not be resumed: all Pod of Job will be evicted, and no Pod will be recreated.
TerminateJobAction Action = "TerminateJob"
Expand Down
6 changes: 6 additions & 0 deletions pkg/apis/bus/v1alpha1/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ const (
// PodEvictedEvent is triggered if Pod was deleted
PodEvictedEvent Event = "PodEvicted"

// PodPendingEvent is triggered if Pod was pending
PodPendingEvent Event = "PodPending"

// PodRunningEvent is triggered if Pod was running
PodRunningEvent Event = "PodRunning"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the intention for PodRunning?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the pod corresponding to a podFailed/podEvicted event returns to the running state, its delayed action should be canceled. So we need to be able to detect the pod running event.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense:)


// JobUnknownEvent These below are several events can lead to job 'Unknown'
// 1. Task Unschedulable, this is triggered when part of
// pods can't be scheduled while some are already running in gang-scheduling case.
Expand Down