gang_schedule

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendOwnerReference

func AppendOwnerReference(obj metav1.Object, newReference metav1.OwnerReference)

Types

type GangScheduler

type GangScheduler interface {
	// CreateGang creates a new gang entity to submit one scheduling process, with specified
	// minNumber and select batch of pods by single or multiple label selector. The
	// implementation should handle the relative relationship between job, pod and gang
	// entity.
	CreateGang(job metav1.Object, replicas map[apiv1.ReplicaType]*apiv1.ReplicaSpec, schedPolicy *apiv1.SchedulingPolicy) (runtime.Object, error)

	// BindPodToGang binds an object with named gang entity object.
	BindPodToGang(job metav1.Object, podSpec *corev1.PodTemplateSpec, gangEntity runtime.Object, rtype string) error

	// GetGang get gang entity instance from cluster by name and namespace.
	GetGang(name types.NamespacedName) (client.ObjectList, error)

	// DeleteGang deletes gang entity object from cluster and finish corresponding gang
	// scheduling process.
	DeleteGang(name types.NamespacedName) error

	// PluginName of gang scheduler implementation, user selectively enable gang-scheduling implementation
	// by specifying --gang-scheduler-name={PluginName} in startup flags.
	PluginName() string

	// SchedulerName is the name of scheduler to dispatch pod, pod.spec.schedulerName will be
	// overridden when pod binds to gang-scheduler in BindPodToGang.
	SchedulerName() string
}

GangScheduler describe a abstract gang scheduler to implement job gang scheduling, this interface discards the details of different scheduler implementations and call the intermediate object GangEntity, represented by runtime.Object.

type NewGangScheduler

type NewGangScheduler func(mgr controllerruntime.Manager) GangScheduler

NewGangScheduler receive a client as init parameter and return a new gang scheduler.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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