Documentation ¶
Index ¶
- func GeneratePlaceholderName(taskGroupName, appID string) string
- func GetPlaceholderResourceRequests(resources map[string]resource.Quantity) v1.ResourceList
- type AStates
- type AddApplicationRequest
- type AddTaskRequest
- type AllocatedTaskEvent
- type Application
- func (app *Application) AreAllTasksTerminated() bool
- func (app *Application) GetAllocatedTasks() []*Task
- func (app *Application) GetApplicationID() string
- func (app *Application) GetApplicationState() string
- func (app *Application) GetBoundTasks() []*Task
- func (app *Application) GetNewTasks() []*Task
- func (app *Application) GetOriginatingTask() *Task
- func (app *Application) GetPendingTasks() []*Task
- func (app *Application) GetPlaceHolderTasks() []*Task
- func (app *Application) GetQueue() string
- func (app *Application) GetSchedulingParamsDefinition() string
- func (app *Application) GetTags() map[string]string
- func (app *Application) GetTask(taskID string) (*Task, error)
- func (app *Application) GetTaskGroupsDefinition() string
- func (app *Application) GetUser() string
- func (app *Application) Schedule() bool
- func (app *Application) SetPlaceholderTimeout(timeout int64)
- func (app *Application) SetState(state string)
- func (app *Application) String() string
- func (app *Application) TriggerAppSubmission() error
- type ApplicationEvent
- type ApplicationEventType
- type ApplicationMetadata
- type ApplicationStatusChangeEvent
- type AsyncRMCallback
- func (callback *AsyncRMCallback) GetStateDump() (string, error)
- func (callback *AsyncRMCallback) Predicates(args *si.PredicatesArgs) error
- func (callback *AsyncRMCallback) PreemptionPredicates(args *si.PreemptionPredicatesArgs) *si.PreemptionPredicatesResponse
- func (callback *AsyncRMCallback) SendEvent(eventRecords []*si.EventRecord)
- func (callback *AsyncRMCallback) UpdateAllocation(response *si.AllocationResponse) error
- func (callback *AsyncRMCallback) UpdateApplication(response *si.ApplicationResponse) error
- func (callback *AsyncRMCallback) UpdateContainerSchedulingState(request *si.UpdateContainerSchedulingStateRequest)
- func (callback *AsyncRMCallback) UpdateNode(response *si.NodeResponse) error
- type BindTaskEvent
- type CachedSchedulerNodeEvent
- type Context
- func (ctx *Context) AddApplication(request *AddApplicationRequest) *Application
- func (ctx *Context) AddPendingPodAllocation(podKey string, nodeID string)
- func (ctx *Context) AddPod(obj interface{})
- func (ctx *Context) AddSchedulingEventHandlers()
- func (ctx *Context) AddTask(request *AddTaskRequest) *Task
- func (ctx *Context) ApplicationEventHandler() func(obj interface{})
- func (ctx *Context) AssumePod(name string, node string) error
- func (ctx *Context) DeletePod(obj interface{})
- func (ctx *Context) EventsToRegister(queueingHintFn framework.QueueingHintFn) []framework.ClusterEventWithHint
- func (ctx *Context) ForgetPod(name string)
- func (ctx *Context) GetAllApplications() []*Application
- func (ctx *Context) GetApplication(appID string) *Application
- func (ctx *Context) GetInProgressPodAllocation(podKey string) (nodeID string, ok bool)
- func (ctx *Context) GetPendingPodAllocation(podKey string) (nodeID string, ok bool)
- func (ctx *Context) GetSchedulerCache() *schedulercache.SchedulerCache
- func (ctx *Context) GetStateDump() (string, error)
- func (ctx *Context) HandleContainerStateUpdate(request *si.UpdateContainerSchedulingStateRequest)
- func (ctx *Context) InitializeState() error
- func (ctx *Context) IsPluginMode() bool
- func (ctx *Context) IsPodFitNode(name, node string, allocate bool) error
- func (ctx *Context) IsPodFitNodeViaPreemption(name, node string, allocations []string, startIndex int) (index int, ok bool)
- func (ctx *Context) IsPreemptSelfAllowed(priorityClassName string) bool
- func (ctx *Context) IsTaskMaybeSchedulable(taskID string) bool
- func (ctx *Context) LoadConfigMaps() ([]*v1.ConfigMap, error)
- func (ctx *Context) NotifyApplicationComplete(appID string)
- func (ctx *Context) NotifyApplicationFail(appID string)
- func (ctx *Context) NotifyTaskComplete(appID, taskID string)
- func (ctx *Context) PublishEvents(eventRecords []*si.EventRecord)
- func (ctx *Context) RemoveApplication(appID string) error
- func (ctx *Context) RemoveApplicationInternal(appID string)
- func (ctx *Context) RemovePodAllocation(podKey string)
- func (ctx *Context) RemoveTask(appID, taskID string)
- func (ctx *Context) StartPodAllocation(podKey string, nodeID string) bool
- func (ctx *Context) TaskEventHandler() func(obj interface{})
- func (ctx *Context) UpdateApplication(app *Application)
- func (ctx *Context) UpdatePod(_, newObj interface{})
- type FailApplicationEvent
- type FailTaskEvent
- type Placeholder
- type PlaceholderManager
- type RejectTaskEvent
- type ReleaseAppAllocationAskEvent
- type ReleaseAppAllocationEvent
- type ResumingApplicationEvent
- type RunApplicationEvent
- type SchedulerNodeEventType
- type SchedulingPolicyParameters
- type SimpleApplicationEvent
- type SimpleTaskEvent
- type SubmitApplicationEvent
- type SubmitTaskEvent
- type TStates
- type Task
- func (task *Task) DeleteTaskPod(pod *v1.Pod) error
- func (task *Task) GetTaskID() string
- func (task *Task) GetTaskPod() *v1.Pod
- func (task *Task) GetTaskSchedulingState() TaskSchedulingState
- func (task *Task) GetTaskState() string
- func (task *Task) IsOriginator() bool
- func (task *Task) IsPlaceholder() bool
- func (task *Task) MarkPreviouslyAllocated(allocationID string, nodeID string)
- func (task *Task) SetTaskSchedulingState(state TaskSchedulingState)
- func (task *Task) UpdatePodCondition(podCondition *v1.PodCondition) (bool, *v1.Pod)
- func (task *Task) UpdateTaskPod(pod *v1.Pod, podMutator func(pod *v1.Pod)) (*v1.Pod, error)
- func (task *Task) UpdateTaskPodStatus(pod *v1.Pod) (*v1.Pod, error)
- type TaskEventType
- type TaskGroup
- type TaskMetadata
- type TaskSchedulingState
- type UpdateApplicationReservationEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GeneratePlaceholderName ¶ added in v1.5.0
GeneratePlaceholderName creates the placeholder name for a pod, pod name can not be longer than 63 chars, appID and taskGroupName will be truncated if they go over 28/20 chars respectively, and each name will be suffixed with a randomly generated 10-character nonce.
func GetPlaceholderResourceRequests ¶ added in v1.5.0
func GetPlaceholderResourceRequests(resources map[string]resource.Quantity) v1.ResourceList
GetPlaceholderResourceRequests converts the map of resources requested into a list of resources for the request specification that can be added to a pod. No checks on what is requested.
Types ¶
type AStates ¶ added in v1.1.0
type AStates struct { New string Submitted string Accepted string Reserving string Running string Rejected string Completed string Killing string Killed string Failing string Failed string Resuming string }
func ApplicationStates ¶ added in v1.1.0
func ApplicationStates() *AStates
type AddApplicationRequest ¶ added in v1.5.0
type AddApplicationRequest struct {
Metadata ApplicationMetadata
}
type AddTaskRequest ¶ added in v1.5.0
type AddTaskRequest struct {
Metadata TaskMetadata
}
type AllocatedTaskEvent ¶
type AllocatedTaskEvent struct {
// contains filtered or unexported fields
}
------------------------ Allocate Event ------------------------
func NewAllocateTaskEvent ¶
func NewAllocateTaskEvent(appID string, taskID string, allocationID string, nid string) AllocatedTaskEvent
func (AllocatedTaskEvent) GetApplicationID ¶
func (ae AllocatedTaskEvent) GetApplicationID() string
func (AllocatedTaskEvent) GetArgs ¶
func (ae AllocatedTaskEvent) GetArgs() []interface{}
func (AllocatedTaskEvent) GetEvent ¶
func (ae AllocatedTaskEvent) GetEvent() string
func (AllocatedTaskEvent) GetTaskID ¶
func (ae AllocatedTaskEvent) GetTaskID() string
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func NewApplication ¶
func NewApplication(appID, queueName, user string, groups []string, tags map[string]string, scheduler api.SchedulerAPI) *Application
func (*Application) AreAllTasksTerminated ¶ added in v1.5.0
func (app *Application) AreAllTasksTerminated() bool
func (*Application) GetAllocatedTasks ¶
func (app *Application) GetAllocatedTasks() []*Task
func (*Application) GetApplicationID ¶
func (app *Application) GetApplicationID() string
func (*Application) GetApplicationState ¶
func (app *Application) GetApplicationState() string
func (*Application) GetBoundTasks ¶ added in v1.3.0
func (app *Application) GetBoundTasks() []*Task
func (*Application) GetNewTasks ¶
func (app *Application) GetNewTasks() []*Task
func (*Application) GetOriginatingTask ¶ added in v1.1.0
func (app *Application) GetOriginatingTask() *Task
func (*Application) GetPendingTasks ¶
func (app *Application) GetPendingTasks() []*Task
func (*Application) GetPlaceHolderTasks ¶ added in v1.1.0
func (app *Application) GetPlaceHolderTasks() []*Task
func (*Application) GetQueue ¶
func (app *Application) GetQueue() string
func (*Application) GetSchedulingParamsDefinition ¶
func (app *Application) GetSchedulingParamsDefinition() string
func (*Application) GetTags ¶
func (app *Application) GetTags() map[string]string
func (*Application) GetTaskGroupsDefinition ¶
func (app *Application) GetTaskGroupsDefinition() string
func (*Application) GetUser ¶
func (app *Application) GetUser() string
func (*Application) Schedule ¶
func (app *Application) Schedule() bool
Schedule is called in every scheduling interval, we are not using dispatcher here because we want to make state transition in sync mode in order to prevent generating too many duplicate events. However, it must ensure non of these calls is expensive, usually, they do nothing more than just triggering the state transition. return true if the app needs scheduling or false if not
func (*Application) SetPlaceholderTimeout ¶
func (app *Application) SetPlaceholderTimeout(timeout int64)
func (*Application) SetState ¶
func (app *Application) SetState(state string)
SetState is only for testing this is just used for testing, it is not supposed to change state like this
func (*Application) String ¶
func (app *Application) String() string
func (*Application) TriggerAppSubmission ¶ added in v1.5.0
func (app *Application) TriggerAppSubmission() error
type ApplicationEvent ¶
type ApplicationEvent struct {
// contains filtered or unexported fields
}
------------------------ ApplicationEvent is used for testing and rejected app's events ------------------------
func NewApplicationEvent ¶
func NewApplicationEvent(appID string, eventType ApplicationEventType, msg string) ApplicationEvent
func (ApplicationEvent) GetApplicationID ¶
func (st ApplicationEvent) GetApplicationID() string
func (ApplicationEvent) GetArgs ¶
func (st ApplicationEvent) GetArgs() []interface{}
func (ApplicationEvent) GetEvent ¶
func (st ApplicationEvent) GetEvent() string
type ApplicationEventType ¶ added in v1.1.0
type ApplicationEventType int
---------------------------------------------- Application events ----------------------------------------------
const ( SubmitApplication ApplicationEventType = iota AcceptApplication TryReserve UpdateReservation RunApplication RejectApplication CompleteApplication FailApplication KillApplication KilledApplication ReleaseAppAllocation ReleaseAppAllocationAsk AppStateChange ResumingApplication AppTaskCompleted )
func (ApplicationEventType) String ¶ added in v1.1.0
func (ae ApplicationEventType) String() string
type ApplicationMetadata ¶ added in v1.5.0
type ApplicationStatusChangeEvent ¶
type ApplicationStatusChangeEvent struct {
// contains filtered or unexported fields
}
------------------------ ApplicationStatusChangeEvent updates the status in the application CRD ------------------------
func NewApplicationStatusChangeEvent ¶
func NewApplicationStatusChangeEvent(appID string, eventType ApplicationEventType, state string) ApplicationStatusChangeEvent
func (ApplicationStatusChangeEvent) GetApplicationID ¶
func (st ApplicationStatusChangeEvent) GetApplicationID() string
func (ApplicationStatusChangeEvent) GetArgs ¶
func (st ApplicationStatusChangeEvent) GetArgs() []interface{}
func (ApplicationStatusChangeEvent) GetEvent ¶
func (st ApplicationStatusChangeEvent) GetEvent() string
func (ApplicationStatusChangeEvent) GetState ¶
func (st ApplicationStatusChangeEvent) GetState() string
type AsyncRMCallback ¶ added in v1.5.0
type AsyncRMCallback struct {
// contains filtered or unexported fields
}
RM callback is called from the scheduler core, we need to ensure the response is handled asynchronously to avoid blocking the scheduler.
func NewAsyncRMCallback ¶ added in v1.5.0
func NewAsyncRMCallback(ctx *Context) *AsyncRMCallback
func (*AsyncRMCallback) GetStateDump ¶ added in v1.5.0
func (callback *AsyncRMCallback) GetStateDump() (string, error)
func (*AsyncRMCallback) Predicates ¶ added in v1.5.0
func (callback *AsyncRMCallback) Predicates(args *si.PredicatesArgs) error
func (*AsyncRMCallback) PreemptionPredicates ¶ added in v1.5.0
func (callback *AsyncRMCallback) PreemptionPredicates(args *si.PreemptionPredicatesArgs) *si.PreemptionPredicatesResponse
func (*AsyncRMCallback) SendEvent ¶ added in v1.5.0
func (callback *AsyncRMCallback) SendEvent(eventRecords []*si.EventRecord)
func (*AsyncRMCallback) UpdateAllocation ¶ added in v1.5.0
func (callback *AsyncRMCallback) UpdateAllocation(response *si.AllocationResponse) error
func (*AsyncRMCallback) UpdateApplication ¶ added in v1.5.0
func (callback *AsyncRMCallback) UpdateApplication(response *si.ApplicationResponse) error
func (*AsyncRMCallback) UpdateContainerSchedulingState ¶ added in v1.5.0
func (callback *AsyncRMCallback) UpdateContainerSchedulingState(request *si.UpdateContainerSchedulingStateRequest)
func (*AsyncRMCallback) UpdateNode ¶ added in v1.5.0
func (callback *AsyncRMCallback) UpdateNode(response *si.NodeResponse) error
type BindTaskEvent ¶
type BindTaskEvent struct {
// contains filtered or unexported fields
}
------------------------ Bound Event ------------------------
func NewBindTaskEvent ¶
func NewBindTaskEvent(appID string, taskID string) BindTaskEvent
func (BindTaskEvent) GetApplicationID ¶
func (bt BindTaskEvent) GetApplicationID() string
func (BindTaskEvent) GetArgs ¶
func (bt BindTaskEvent) GetArgs() []interface{}
func (BindTaskEvent) GetEvent ¶
func (bt BindTaskEvent) GetEvent() string
func (BindTaskEvent) GetTaskID ¶
func (bt BindTaskEvent) GetTaskID() string
type CachedSchedulerNodeEvent ¶
type CachedSchedulerNodeEvent struct { NodeID string Event SchedulerNodeEventType }
func (CachedSchedulerNodeEvent) GetArgs ¶
func (sn CachedSchedulerNodeEvent) GetArgs() []interface{}
func (CachedSchedulerNodeEvent) GetEvent ¶
func (sn CachedSchedulerNodeEvent) GetEvent() string
func (CachedSchedulerNodeEvent) GetNodeID ¶
func (sn CachedSchedulerNodeEvent) GetNodeID() string
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
context maintains scheduling state, like apps and apps' tasks.
func NewContext ¶
func NewContext(apis client.APIProvider) *Context
NewContext create a new context for the scheduler using a default (empty) configuration VisibleForTesting
func NewContextWithBootstrapConfigMaps ¶ added in v1.3.0
func NewContextWithBootstrapConfigMaps(apis client.APIProvider, bootstrapConfigMaps []*v1.ConfigMap) *Context
NewContextWithBootstrapConfigMaps creates a new context for the scheduler using configuration bootstrapped from Kubernetes ConfigMaps
func (*Context) AddApplication ¶
func (ctx *Context) AddApplication(request *AddApplicationRequest) *Application
func (*Context) AddPendingPodAllocation ¶
func (*Context) AddSchedulingEventHandlers ¶
func (ctx *Context) AddSchedulingEventHandlers()
func (*Context) AddTask ¶
func (ctx *Context) AddTask(request *AddTaskRequest) *Task
this implements ApplicationManagementProtocol
func (*Context) ApplicationEventHandler ¶
func (ctx *Context) ApplicationEventHandler() func(obj interface{})
func (*Context) AssumePod ¶
assume a pod will be running on a node, in scheduler, we maintain a cache where stores info for each node what pods are supposed to be running on it. And we keep this cache in-sync between core and the shim. this way, the core can make allocation decisions with consideration of other assumed pods before they are actually bound to the node (bound is slow).
func (*Context) EventsToRegister ¶ added in v1.4.0
func (ctx *Context) EventsToRegister(queueingHintFn framework.QueueingHintFn) []framework.ClusterEventWithHint
EventsToRegister returns the Kubernetes events that should be watched for updates which may effect predicate processing
func (*Context) ForgetPod ¶
forget pod must be called when a pod is assumed to be running on a node, but then for some reason it is failed to bind or released.
func (*Context) GetAllApplications ¶ added in v1.3.0
func (ctx *Context) GetAllApplications() []*Application
func (*Context) GetApplication ¶
func (ctx *Context) GetApplication(appID string) *Application
func (*Context) GetInProgressPodAllocation ¶
func (*Context) GetPendingPodAllocation ¶
func (*Context) GetSchedulerCache ¶ added in v1.3.0
func (ctx *Context) GetSchedulerCache() *schedulercache.SchedulerCache
VisibleForTesting
func (*Context) GetStateDump ¶ added in v1.2.0
func (*Context) HandleContainerStateUpdate ¶
func (ctx *Context) HandleContainerStateUpdate(request *si.UpdateContainerSchedulingStateRequest)
this function handles the pod scheduling failures with respect to the different causes, and update the pod condition accordingly. the cluster autoscaler depends on the certain pod condition in order to trigger auto-scaling.
func (*Context) InitializeState ¶ added in v1.5.0
InitializeState is used to initialize the state of the scheduler context using the Kubernetes informers. This registers priority classes, nodes, and pods and ensures the scheduler core is synchronized.
func (*Context) IsPluginMode ¶
func (*Context) IsPodFitNode ¶
evaluate given predicates based on current context
func (*Context) IsPodFitNodeViaPreemption ¶ added in v1.3.0
func (*Context) IsPreemptSelfAllowed ¶ added in v1.2.0
func (*Context) IsTaskMaybeSchedulable ¶ added in v1.5.0
IsTaskMaybeSchedulable returns true if a task might be currently able to be scheduled. This uses a bloom filter cached from a set of taskIDs to perform efficient negative lookups.
func (*Context) LoadConfigMaps ¶ added in v1.2.0
func (*Context) NotifyApplicationComplete ¶
inform the scheduler that the application is completed, the complete state may further explained to completed_with_errors(failed) or successfully_completed, either way we need to release all allocations (if exists) for this application
func (*Context) NotifyApplicationFail ¶
func (*Context) NotifyTaskComplete ¶
func (*Context) PublishEvents ¶
func (ctx *Context) PublishEvents(eventRecords []*si.EventRecord)
func (*Context) RemoveApplication ¶
func (*Context) RemoveApplicationInternal ¶
func (*Context) RemovePodAllocation ¶
func (*Context) RemoveTask ¶
func (*Context) StartPodAllocation ¶
func (*Context) TaskEventHandler ¶
func (ctx *Context) TaskEventHandler() func(obj interface{})
func (*Context) UpdateApplication ¶
func (ctx *Context) UpdateApplication(app *Application)
type FailApplicationEvent ¶
type FailApplicationEvent struct {
// contains filtered or unexported fields
}
------------------------ Fail application ------------------------
func NewFailApplicationEvent ¶
func NewFailApplicationEvent(appID, message string) FailApplicationEvent
func (FailApplicationEvent) GetApplicationID ¶
func (fe FailApplicationEvent) GetApplicationID() string
func (FailApplicationEvent) GetArgs ¶
func (fe FailApplicationEvent) GetArgs() []interface{}
func (FailApplicationEvent) GetEvent ¶
func (fe FailApplicationEvent) GetEvent() string
type FailTaskEvent ¶
type FailTaskEvent struct {
// contains filtered or unexported fields
}
------------------------ Fail Event ------------------------
func NewFailTaskEvent ¶
func NewFailTaskEvent(appID string, taskID string, failedMessage string) FailTaskEvent
func (FailTaskEvent) GetApplicationID ¶
func (fe FailTaskEvent) GetApplicationID() string
func (FailTaskEvent) GetArgs ¶
func (fe FailTaskEvent) GetArgs() []interface{}
func (FailTaskEvent) GetEvent ¶
func (fe FailTaskEvent) GetEvent() string
func (FailTaskEvent) GetTaskID ¶
func (fe FailTaskEvent) GetTaskID() string
type Placeholder ¶
type Placeholder struct {
// contains filtered or unexported fields
}
func (*Placeholder) String ¶
func (p *Placeholder) String() string
type PlaceholderManager ¶
type PlaceholderManager struct { // a simple mutex will do we do not have separate read and write paths sync.RWMutex // contains filtered or unexported fields }
PlaceholderManager is a service to manage the lifecycle of app placeholders
func NewPlaceholderManager ¶
func NewPlaceholderManager(clients *client.Clients) *PlaceholderManager
func (*PlaceholderManager) Start ¶
func (mgr *PlaceholderManager) Start()
func (*PlaceholderManager) Stop ¶
func (mgr *PlaceholderManager) Stop()
type RejectTaskEvent ¶
type RejectTaskEvent struct {
// contains filtered or unexported fields
}
------------------------ Reject Event ------------------------
func NewRejectTaskEvent ¶
func NewRejectTaskEvent(appID string, taskID string, rejectedMessage string) RejectTaskEvent
func (RejectTaskEvent) GetApplicationID ¶
func (re RejectTaskEvent) GetApplicationID() string
func (RejectTaskEvent) GetArgs ¶
func (re RejectTaskEvent) GetArgs() []interface{}
func (RejectTaskEvent) GetEvent ¶
func (re RejectTaskEvent) GetEvent() string
func (RejectTaskEvent) GetTaskID ¶
func (re RejectTaskEvent) GetTaskID() string
type ReleaseAppAllocationAskEvent ¶
type ReleaseAppAllocationAskEvent struct {
// contains filtered or unexported fields
}
func NewReleaseAppAllocationAskEvent ¶
func NewReleaseAppAllocationAskEvent(appID string, allocTermination si.TerminationType, taskID string) ReleaseAppAllocationAskEvent
func (ReleaseAppAllocationAskEvent) GetApplicationID ¶
func (re ReleaseAppAllocationAskEvent) GetApplicationID() string
func (ReleaseAppAllocationAskEvent) GetArgs ¶
func (re ReleaseAppAllocationAskEvent) GetArgs() []interface{}
func (ReleaseAppAllocationAskEvent) GetEvent ¶
func (re ReleaseAppAllocationAskEvent) GetEvent() string
type ReleaseAppAllocationEvent ¶
type ReleaseAppAllocationEvent struct {
// contains filtered or unexported fields
}
------------------------ Release application allocations ------------------------
func NewReleaseAppAllocationEvent ¶
func NewReleaseAppAllocationEvent(appID string, allocTermination si.TerminationType, allocationID string) ReleaseAppAllocationEvent
func (ReleaseAppAllocationEvent) GetApplicationID ¶
func (re ReleaseAppAllocationEvent) GetApplicationID() string
func (ReleaseAppAllocationEvent) GetArgs ¶
func (re ReleaseAppAllocationEvent) GetArgs() []interface{}
func (ReleaseAppAllocationEvent) GetEvent ¶
func (re ReleaseAppAllocationEvent) GetEvent() string
type ResumingApplicationEvent ¶
type ResumingApplicationEvent struct {
// contains filtered or unexported fields
}
------------------------ Resuming application ------------------------
func NewResumingApplicationEvent ¶
func NewResumingApplicationEvent(appID string) ResumingApplicationEvent
func (ResumingApplicationEvent) GetApplicationID ¶
func (re ResumingApplicationEvent) GetApplicationID() string
func (ResumingApplicationEvent) GetArgs ¶
func (re ResumingApplicationEvent) GetArgs() []interface{}
func (ResumingApplicationEvent) GetEvent ¶
func (re ResumingApplicationEvent) GetEvent() string
type RunApplicationEvent ¶
type RunApplicationEvent struct {
// contains filtered or unexported fields
}
------------------------ Run application ------------------------
func NewRunApplicationEvent ¶
func NewRunApplicationEvent(appID string) RunApplicationEvent
func (RunApplicationEvent) GetApplicationID ¶
func (re RunApplicationEvent) GetApplicationID() string
func (RunApplicationEvent) GetArgs ¶
func (re RunApplicationEvent) GetArgs() []interface{}
func (RunApplicationEvent) GetEvent ¶
func (re RunApplicationEvent) GetEvent() string
type SchedulerNodeEventType ¶ added in v1.1.0
type SchedulerNodeEventType int
const ( NodeAccepted SchedulerNodeEventType = iota NodeRejected )
func (SchedulerNodeEventType) String ¶ added in v1.1.0
func (ae SchedulerNodeEventType) String() string
type SchedulingPolicyParameters ¶ added in v1.5.0
type SchedulingPolicyParameters struct {
// contains filtered or unexported fields
}
func GetSchedulingPolicyParam ¶ added in v1.5.0
func GetSchedulingPolicyParam(pod *v1.Pod) *SchedulingPolicyParameters
func NewSchedulingPolicyParameters ¶ added in v1.5.0
func NewSchedulingPolicyParameters(placeholderTimeout int64, gangSchedulingStyle string) *SchedulingPolicyParameters
func (*SchedulingPolicyParameters) GetGangSchedulingStyle ¶ added in v1.5.0
func (spp *SchedulingPolicyParameters) GetGangSchedulingStyle() string
func (*SchedulingPolicyParameters) GetPlaceholderTimeout ¶ added in v1.5.0
func (spp *SchedulingPolicyParameters) GetPlaceholderTimeout() int64
type SimpleApplicationEvent ¶
type SimpleApplicationEvent struct {
// contains filtered or unexported fields
}
------------------------ SimpleApplicationEvent simply moves application states ------------------------
func NewSimpleApplicationEvent ¶
func NewSimpleApplicationEvent(appID string, eventType ApplicationEventType) SimpleApplicationEvent
func (SimpleApplicationEvent) GetApplicationID ¶
func (st SimpleApplicationEvent) GetApplicationID() string
func (SimpleApplicationEvent) GetArgs ¶
func (st SimpleApplicationEvent) GetArgs() []interface{}
func (SimpleApplicationEvent) GetEvent ¶
func (st SimpleApplicationEvent) GetEvent() string
type SimpleTaskEvent ¶
type SimpleTaskEvent struct {
// contains filtered or unexported fields
}
------------------------ Simple task Event simply moves task to next state, it has no arguments provided ------------------------
func NewSimpleTaskEvent ¶
func NewSimpleTaskEvent(appID string, taskID string, taskType TaskEventType) SimpleTaskEvent
func (SimpleTaskEvent) GetApplicationID ¶
func (st SimpleTaskEvent) GetApplicationID() string
func (SimpleTaskEvent) GetArgs ¶
func (st SimpleTaskEvent) GetArgs() []interface{}
func (SimpleTaskEvent) GetEvent ¶
func (st SimpleTaskEvent) GetEvent() string
func (SimpleTaskEvent) GetTaskID ¶
func (st SimpleTaskEvent) GetTaskID() string
type SubmitApplicationEvent ¶
type SubmitApplicationEvent struct {
// contains filtered or unexported fields
}
------------------------ SubmitTask application ------------------------
func NewSubmitApplicationEvent ¶
func NewSubmitApplicationEvent(appID string) SubmitApplicationEvent
func (SubmitApplicationEvent) GetApplicationID ¶
func (se SubmitApplicationEvent) GetApplicationID() string
func (SubmitApplicationEvent) GetArgs ¶
func (se SubmitApplicationEvent) GetArgs() []interface{}
func (SubmitApplicationEvent) GetEvent ¶
func (se SubmitApplicationEvent) GetEvent() string
type SubmitTaskEvent ¶
type SubmitTaskEvent struct {
// contains filtered or unexported fields
}
------------------------ SubmitTask Event ------------------------
func NewSubmitTaskEvent ¶
func NewSubmitTaskEvent(appID string, taskID string) SubmitTaskEvent
func (SubmitTaskEvent) GetApplicationID ¶
func (st SubmitTaskEvent) GetApplicationID() string
func (SubmitTaskEvent) GetArgs ¶
func (st SubmitTaskEvent) GetArgs() []interface{}
func (SubmitTaskEvent) GetEvent ¶
func (st SubmitTaskEvent) GetEvent() string
func (SubmitTaskEvent) GetTaskID ¶
func (st SubmitTaskEvent) GetTaskID() string
type TStates ¶ added in v1.1.0
type TStates struct { New string Pending string Scheduling string Allocated string Rejected string Bound string Killing string Killed string Failed string Completed string Any []string // Any refers to all possible states Terminated []string // Rejected, Killed, Failed, Completed }
func TaskStates ¶ added in v1.1.0
func TaskStates() *TStates
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
func NewFromTaskMeta ¶
func NewFromTaskMeta(tid string, app *Application, ctx *Context, metadata TaskMetadata, originator bool) *Task
func NewTaskPlaceholder ¶
func (*Task) GetTaskPod ¶
func (*Task) GetTaskSchedulingState ¶ added in v1.4.0
func (task *Task) GetTaskSchedulingState() TaskSchedulingState
func (*Task) GetTaskState ¶
func (*Task) IsOriginator ¶ added in v1.1.0
func (*Task) IsPlaceholder ¶
func (*Task) MarkPreviouslyAllocated ¶ added in v1.5.0
func (*Task) SetTaskSchedulingState ¶ added in v1.4.0
func (task *Task) SetTaskSchedulingState(state TaskSchedulingState)
func (*Task) UpdatePodCondition ¶ added in v1.4.0
func (*Task) UpdateTaskPod ¶ added in v1.2.0
type TaskEventType ¶ added in v1.1.0
type TaskEventType int
---------------------------------------------- Task events ----------------------------------------------
const ( InitTask TaskEventType = iota SubmitTask TaskAllocated TaskRejected TaskBound CompleteTask TaskFail KillTask TaskKilled )
func (TaskEventType) String ¶ added in v1.1.0
func (ae TaskEventType) String() string
type TaskGroup ¶ added in v1.5.0
type TaskGroup struct { Name string MinMember int32 Labels map[string]string Annotations map[string]string MinResource map[string]resource.Quantity NodeSelector map[string]string Tolerations []v1.Toleration Affinity *v1.Affinity }
func FindAppTaskGroup ¶ added in v1.5.0
type TaskMetadata ¶ added in v1.5.0
type TaskSchedulingState ¶ added in v1.5.0
type TaskSchedulingState int8
const ( TaskSchedPending TaskSchedulingState = iota TaskSchedSkipped TaskSchedFailed TaskSchedAllocated )
func (TaskSchedulingState) String ¶ added in v1.5.0
func (tss TaskSchedulingState) String() string
type UpdateApplicationReservationEvent ¶
type UpdateApplicationReservationEvent struct {
// contains filtered or unexported fields
}
------------------------ Reservation Update Event ------------------------
func NewUpdateApplicationReservationEvent ¶
func NewUpdateApplicationReservationEvent(appID string) UpdateApplicationReservationEvent
func (UpdateApplicationReservationEvent) GetApplicationID ¶
func (ue UpdateApplicationReservationEvent) GetApplicationID() string
func (UpdateApplicationReservationEvent) GetArgs ¶
func (ue UpdateApplicationReservationEvent) GetArgs() []interface{}
func (UpdateApplicationReservationEvent) GetEvent ¶
func (ue UpdateApplicationReservationEvent) GetEvent() string