volcano icon indicating copy to clipboard operation
volcano copied to clipboard

Fix Issue 2262: add priority capability for reclaim action

Open lowang-bh opened this issue 2 years ago • 23 comments

Fixes #2262

  1. priority plugin support reclaimable switch and add UT about priority plugin
  2. priority plugin docs

Note: reclaimableFn usually is used in reclaim action to reclaim a queue's deserved resource when cluster has not enough resource to allocate new coming tasks in this queue. So please be carefully to set enableReclaimable to true in priority plugin, in case that a queue's resource owned by high priority jobs can not be released. And enableReclaimable is disabled by default for compatibility

lowang-bh avatar Mar 09 '24 05:03 lowang-bh

/assign @Monokaix @william-wang

lowang-bh avatar Mar 10 '24 02:03 lowang-bh

If other queue's jobs all have higher priority,current queue can not reclaim their resources, reclaim will not happen, is this reasonable?

Monokaix avatar Mar 11 '24 02:03 Monokaix

If other queue's jobs all have higher priority,current queue can not reclaim their resources, reclaim will not happen, is this reasonable?

We just support this feature and close it by default。 How to use it is depended on the cluster admin.

One solutions is to limit the higher priority jobs used resource not exceed queue's deserved in application layer.

lowang-bh avatar Mar 11 '24 02:03 lowang-bh

If other queue's jobs all have higher priority,current queue can not reclaim their resources, reclaim will not happen, is this reasonable?

We just support this feature and close it by default。 How to use it is depended on the cluster admin.

One solutions is to limit the higher priority jobs used resource not exceed queue's deserved in application layer.

But this seems places high demands on administrators and limits the job priority of the queue, we'd better add a desige doc and give some user-guide.

Monokaix avatar Mar 11 '24 06:03 Monokaix

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please assign william-wang You can assign the PR to them by writing /assign @william-wang in a comment when ready.

The full list of commands accepted by this bot can be found 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 avatar Mar 11 '24 09:03 volcano-sh-bot

we'd better add a desige doc and give some user-guide.

@Monokaix docs is added.
cc @wangyang0616 @hwdef please help to review. thanks.

lowang-bh avatar Mar 31 '24 07:03 lowang-bh

/close

lowang-bh avatar Apr 01 '24 08:04 lowang-bh

@lowang-bh: Closed this PR.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

volcano-sh-bot avatar Apr 01 '24 08:04 volcano-sh-bot

/reopen

lowang-bh avatar Apr 01 '24 08:04 lowang-bh

@lowang-bh: Reopened this PR.

In response to this:

/reopen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

volcano-sh-bot avatar Apr 01 '24 08:04 volcano-sh-bot

/assign @william-wang

lowang-bh avatar Apr 07 '24 09:04 lowang-bh

New changes are detected. LGTM label has been removed.

volcano-sh-bot avatar Apr 13 '24 02:04 volcano-sh-bot

It conflicts with the existing allocation logic between queues. When we allocate tasks, we do not consider the priority of jobs between queues, but only consider the priority at the queue level.

Monokaix avatar Apr 22 '24 06:04 Monokaix

I think there may be a bug in Reclaimable in session_plugins.go, for this configmap

    tiers:
    - plugins:
      - name: priority
      - name: proportion

as reclaim enabled in priority plugin, let us image that theres some victims return from priority, but if no victims return from proportion plugin , Reclaimable function will return no victims, and reclaim not work any more, put proportion in front of priority can fix this, but it may be a bug? @hwdef

zhoushuke avatar Apr 26 '24 03:04 zhoushuke

I think there may be a bug in Reclaimable in session_plugins.go, for this configmap

    tiers:
    - plugins:
      - name: priority
      - name: proportion

as reclaim enabled in priority plugin, let us image that theres some victims return from priority, but if no victims return from proportion plugin , Reclaimable function will return no victims, and reclaim not work any more, put proportion in front of priority can fix this, but it may be a bug? @hwdef

That is a problem of your config. You'd better to put plugins about resource in a same tier, but a tier different from gang/priority, eg:

tiers:
- plugins:
  - name: priority
    enableReclaimable: false
  - name: gang
    enablePreemptable: false
  - name: conformance
- plugins:
  - name: overcommit
  - name: drf
    enablePreemptable: false
  - name: predicates
  - name: proportion
  - name: nodeorder
  - name: binpack

lowang-bh avatar Apr 26 '24 05:04 lowang-bh

I think there may be a bug in Reclaimable in session_plugins.go, for this configmap

    tiers:
    - plugins:
      - name: priority
      - name: proportion

as reclaim enabled in priority plugin, let us image that theres some victims return from priority, but if no victims return from proportion plugin , Reclaimable function will return no victims, and reclaim not work any more, put proportion in front of priority can fix this, but it may be a bug? @hwdef

That is a problem of your config. You'd better to put plugins about resource in a same tier, but a tier different from gang/priority, eg:

tiers:
- plugins:
  - name: priority
    enableReclaimable: false
  - name: gang
    enablePreemptable: false
  - name: conformance
- plugins:
  - name: overcommit
  - name: drf
    enablePreemptable: false
  - name: predicates
  - name: proportion
  - name: nodeorder
  - name: binpack

ok, make sense

zhoushuke avatar Apr 26 '24 06:04 zhoushuke

@lowang-bh , there is another promble as following:

actions: "enqueue,allocate,backfill,preempt,reclaim"
tiers:
    - plugins:
      - name: priority
      - name: gang
        enablePreemptable: false
        enableJobStarving: false
        enableReclaimable: false
        enabledQueueScoreOrder: false
      - name: conformance
    - plugins:
      - name: predicates
      - name: proportion

gang enablePreemptable: false( make it true also don't work too), so it's cant do any preempt/reclaim, when a high priority job comes, if there no enough resource to meet gang constraint, I hope get resources by reclaim, but as not meet gang constraint, this job will pending, and reclaim action is just skip pending job, so reclaim not happend, no reclaim, no release resource to get job running, like deadlock, delete enqueue may work, but in my scene,enqueue is a must, and put reclaim in front of enqueue is not good ideal. and overcommit won't use for me. what better soluation to fix it?

zhoushuke avatar Apr 26 '24 08:04 zhoushuke

@zhoushuke There are two kind of evicts:

  1. evicts in same queue: this is for high priority job to evict low priority jobs when your queue's deserved resource is used up
  2. evicts between different queues: a queue's coming job to reclaim their queue's deserved resource from other overused queue. In this scene, the overused resources in other queues are borrowed from this queue, and resource should be give back when need.

If you have any problems about how to use volcano, please file a issue to describe it.

lowang-bh avatar Apr 27 '24 03:04 lowang-bh

I have some volcano practice and use it in a production to support about 30k~50k pods a day. I think you don't get my point, anyway, I will try to realize it by my own.

zhoushuke avatar Apr 27 '24 10:04 zhoushuke

enablePreemptable: false

So can you explain why set enablePreemptable: false of gang?

Monokaix avatar May 08 '24 02:05 Monokaix

If other queue's jobs all have higher priority,current queue can not reclaim their resources, reclaim will not happen, is this reasonable?

We just support this feature and close it by default。 How to use it is depended on the cluster admin.

One solutions is to limit the higher priority jobs used resource not exceed queue's deserved in application layer.

what about reclaim lower priority first, if no enough resourecs reclaimed then reclaim higher priority task?

Monokaix avatar Jul 17 '24 06:07 Monokaix

this job will pending, and reclaim action is just skip pending job

If you didn't use enqueue action, the default status will be pending and allocate action will change it to enqueue when there is no enqueue action configured. So you should put reclaim action after allocate.

lowang-bh avatar Aug 29 '24 02:08 lowang-bh

We should consider higher priority jobs in other queues can never be reclaimed if enabledReclaimable is enabled in Priority Plugin. The original design intention of reclaim should be to be able to reclaim jobs in other queues, without considering the priority, right?

JesseStutler avatar Sep 23 '24 07:09 JesseStutler