Skip to content
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

Merged
merged 3 commits into from Dec 13, 2021

Conversation

qiankunli
Copy link
Contributor

@qiankunli qiankunli commented Dec 8, 2021

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

Signed-off-by: bert.li <qiankun.li@qq.com>
@volcano-sh-bot volcano-sh-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 8, 2021
@Thor-wl Thor-wl requested review from eggiter, hwdef, jasonliu747, k82cn, william-wang and xiaoanyunfei and removed request for merryzhou December 8, 2021 08:35
@hwdef
Copy link
Member

hwdef commented Dec 8, 2021

I do not recommend using this method,for your scene in contrast it is better to use the dependsOn field.
I think there are two shortcomings in the way you proposed:

  • Users need to check the document to know how to use it.(But you did not provide documentation)
  • Even if there is this field, is it good to put it in the label? I think it might be better to put it in the comments.

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>
@@ -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 {
Copy link
Member

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 :)

Copy link
Contributor Author

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>
@k82cn
Copy link
Member

k82cn commented Dec 13, 2021

/lgtm
/approve

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 13, 2021
@volcano-sh-bot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 13, 2021
@volcano-sh-bot volcano-sh-bot merged commit 7cf5f68 into volcano-sh:master Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants