Documentation ¶
Index ¶
- Constants
- func New(arguments framework.Arguments) framework.Plugin
- type Bucket
- type JobManager
- func (jm *JobManager) AddTaskToBucket(bucketIndex int, taskName string, task *api.TaskInfo)
- func (jm *JobManager) ApplyTaskTopology(topo *TaskTopology)
- func (jm *JobManager) ConstructBucket(tasks map[api.TaskID]*api.TaskInfo)
- func (jm *JobManager) GetBucket(task *api.TaskInfo) *Bucket
- func (jm *JobManager) MarkOutOfBucket(uid types.UID)
- func (jm *JobManager) MarkTaskHasTopology(taskName string, topoType topologyType)
- func (jm *JobManager) NewBucket() *Bucket
- func (jm *JobManager) String() string
- func (jm *JobManager) TaskBound(task *api.TaskInfo)
- type TaskOrder
- type TaskTopology
Constants ¶
const ( // PluginName indicates name of volcano scheduler plugin PluginName = "task-topology" // PluginWeight is task-topology plugin weight in nodeOrderFn PluginWeight = "task-topology.weight" // JobAffinityKey is the key to read in task-topology arguments from job annotations JobAffinityKey = "volcano.sh/task-topology" // OutOfBucket indicates task is outside of any bucket OutOfBucket = -1 // JobAffinityAnnotations is the key to read in task-topology affinity arguments from podgroup annotations JobAffinityAnnotations = "volcano.sh/task-topology-affinity" // JobAntiAffinityAnnotations is the key to read in task-topology anti-affinity arguments from podgroup annotations JobAntiAffinityAnnotations = "volcano.sh/task-topology-anti-affinity" // TaskOrderAnnotations is the key to read in task-topology task order arguments from podgroup annotations TaskOrderAnnotations = "volcano.sh/task-topology-task-order" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
Bucket is struct used to classify tasks by affinity and anti-affinity
func (*Bucket) CalcResReq ¶
CalcResReq calculates task resources request
type JobManager ¶
type JobManager struct {
// contains filtered or unexported fields
}
JobManager is struct used to save infos about affinity and buckets of a job
func NewJobManager ¶
func NewJobManager(jobID api.JobID) *JobManager
NewJobManager creates a new job manager for job
func (*JobManager) AddTaskToBucket ¶
func (jm *JobManager) AddTaskToBucket(bucketIndex int, taskName string, task *api.TaskInfo)
AddTaskToBucket adds task into bucket
func (*JobManager) ApplyTaskTopology ¶
func (jm *JobManager) ApplyTaskTopology(topo *TaskTopology)
ApplyTaskTopology transforms taskTopology to matrix affinity: [[a, b], [c]] interAffinity:
a b c a - x - b x - - c - - - selfAffinity: a b c - - x
func (*JobManager) ConstructBucket ¶
func (jm *JobManager) ConstructBucket(tasks map[api.TaskID]*api.TaskInfo)
ConstructBucket builds bucket for tasks
func (*JobManager) GetBucket ¶
func (jm *JobManager) GetBucket(task *api.TaskInfo) *Bucket
GetBucket get bucket inside which task has been
func (*JobManager) MarkOutOfBucket ¶
func (jm *JobManager) MarkOutOfBucket(uid types.UID)
MarkOutOfBucket indicates task is outside of any bucket
func (*JobManager) MarkTaskHasTopology ¶
func (jm *JobManager) MarkTaskHasTopology(taskName string, topoType topologyType)
MarkTaskHasTopology indicates task has topology settings
func (*JobManager) NewBucket ¶
func (jm *JobManager) NewBucket() *Bucket
NewBucket creates a new bucket
func (*JobManager) String ¶
func (jm *JobManager) String() string
func (*JobManager) TaskBound ¶
func (jm *JobManager) TaskBound(task *api.TaskInfo)
TaskBound binds task to bucket
type TaskOrder ¶
type TaskOrder struct {
// contains filtered or unexported fields
}
TaskOrder is struct used to save task order
type TaskTopology ¶
type TaskTopology struct { Affinity [][]string `json:"affinity,omitempty"` AntiAffinity [][]string `json:"antiAffinity,omitempty"` TaskOrder []string `json:"taskOrder,omitempty"` }
TaskTopology is struct used to save affinity infos of a job read from job plugin or annotations