api

package
v0.0.0-...-8a69621 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const SchedulerName = "coscheduling"

Variables

This section is empty.

Functions

func AllocatedStatus

func AllocatedStatus(status TaskStatus) bool

AllocatedStatus checks whether the tasks has AllocatedStatus

Types

type Job

type Job struct {
	UID JobID

	Name            string
	Namespace       string
	TaskStatusIndex map[TaskStatus]taskMap
	Tasks           taskMap

	MinAvailable int32

	CreationTimestamp metav1.Time
	PodGroup          *schedulingv1alpha1.PodGroup
}

func NewJob

func NewJob(uid JobID, tasks ...*Task) *Job

func (*Job) AddTask

func (job *Job) AddTask(task *Task)

func (*Job) DeleteTask

func (job *Job) DeleteTask(task *Task)

func (*Job) Ready

func (job *Job) Ready() bool

Ready returns whether job is ready for run

func (*Job) ReadyTaskNum

func (job *Job) ReadyTaskNum() int32

ReadyTaskNum returns the number of tasks that are ready.

func (*Job) SetPodGroup

func (job *Job) SetPodGroup(pg *schedulingv1alpha1.PodGroup)

SetPodGroup sets podGroup details to a job

func (Job) String

func (job Job) String() string

String returns a jobInfo object in string format

func (*Job) UnsetPodGroup

func (job *Job) UnsetPodGroup()

UnsetPodGroup removes podGroup details from a job

func (*Job) UpdateTaskStatus

func (job *Job) UpdateTaskStatus(task *Task, status TaskStatus)

func (*Job) ValidTaskNum

func (job *Job) ValidTaskNum() int32

ValidTaskNum returns the number of tasks that are valid

type JobID

type JobID types.UID

func GetJobID

func GetJobID(pod *v1.Pod) JobID

type Task

type Task struct {
	UID TaskID

	Job JobID

	Name      string
	Namespace string
	Status    TaskStatus
	NodeName  string

	Pod *v1.Pod
}

Task will have all info about the task.

func NewTask

func NewTask(pod *v1.Pod) *Task

func (Task) String

func (t Task) String() string

String returns the taskInfo details in a string

type TaskID

type TaskID types.UID

type TaskStatus

type TaskStatus int

TaskStatus defines the status of a task/pod.

const (
	// Pending means the task is pending in the apiserver.
	Pending TaskStatus = 1 << iota

	// Unschedulable means the pod is pending, but may be lack of resources
	Unschedulable

	// Bound means the task/Pod bounds to a host.
	Bound

	// Running means a task is running on the host.
	Running

	// Releasing means a task/pod is deleted.
	Releasing

	// Succeeded means that all containers in the pod have voluntarily terminated
	// with a container exit code of 0, and the system is not going to restart any of these containers.
	Succeeded

	// Failed means that all containers in the pod have terminated, and at least one container has
	// terminated in a failure (exited with a non-zero exit code or was stopped by the system).
	Failed

	// Unknown means the status of task/pod is unknown to the scheduler.
	Unknown
)

func (TaskStatus) String

func (ts TaskStatus) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL