New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support label volcano.sh/task-priority #1896
support label volcano.sh/task-priority #1896
Conversation
Signed-off-by: bert.li <qiankun.li@qq.com>
I do not recommend using this method,for your scene in contrast it is better to use the dependsOn field.
I think this method is suitable for use in your company, not suitable for use in the community |
Signed-off-by: bert.li <qiankun.li@qq.com>
pkg/scheduler/api/job_info.go
Outdated
@@ -166,6 +166,12 @@ func NewTaskInfo(pod *v1.Pod) *TaskInfo { | |||
ti.Priority = *pod.Spec.Priority | |||
} | |||
|
|||
if taskPriority, ok := pod.Labels["volcano.sh/task-priority"]; ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a const for volcano.sh/task-priority
?
And it's better to get this info from annotation instead of labels; AFAIK, we did several check against annotations, e.g. reject updating task priority :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I have changed volcano.sh/task-priority
from label to annotation and use volcano.sh/task-priority
as a const
Signed-off-by: bert.li <qiankun.li@qq.com>
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: k82cn The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
a training job( such as tfjob/pytorchjob) always has many pods: one master and some workers. we need tell volcano that the priority of master pod is high than worker, so volcano can run master first and preempt master last.
we can set
pod.Priority
by create PriorityClass object in k8s, but it is troublesome for operator(such as tf-operator/pytorch-operator) to maintain the PriorityClass object.so it it simple to use pod Label
volcano.sh/task-priority
to mark the pod priority