tasktopology

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
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

func New

func New(arguments framework.Arguments) framework.Plugin

New function returns taskTopologyPlugin object

Types

type Bucket

type Bucket struct {
	// contains filtered or unexported fields
}

Bucket is struct used to classify tasks by affinity and anti-affinity

func NewBucket

func NewBucket() *Bucket

NewBucket create a new empty bucket

func (*Bucket) AddTask

func (b *Bucket) AddTask(taskName string, task *api.TaskInfo)

AddTask adds task into bucket

func (*Bucket) CalcResReq

func (b *Bucket) CalcResReq(req *api.Resource, action reqAction)

CalcResReq calculates task resources request

func (*Bucket) TaskBound

func (b *Bucket) TaskBound(task *api.TaskInfo)

TaskBound binds task to bucket

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

func (*TaskOrder) Len

func (p *TaskOrder) Len() int

func (*TaskOrder) Less

func (p *TaskOrder) Less(l, r int) bool

func (*TaskOrder) Swap

func (p *TaskOrder) Swap(l, r int)

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

Jump to

Keyboard shortcuts

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