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

Reclaim Enhancement: Add Reclaimable parameter for queue #651

Merged
merged 2 commits into from
Jan 2, 2020

Conversation

sivanzcw
Copy link
Contributor

  • Add parameter for queue to support queue unReclaimable

@volcano-sh-bot volcano-sh-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 29, 2019
@TravisBuddy
Copy link

Hey @sivanzcw,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: 6b574130-2a42-11ea-8495-6f9e5f4a4dcf

@@ -261,6 +261,8 @@ type QueueSpec struct {
Capability v1.ResourceList
// State controller the status of queue
State QueueState
// UnReclaimAble indicate whether the queue can be reclaimed by other queue
UnReclaimAble bool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's use Reclaimable directly :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you want to make it compatible with old versions.
make it a pointer type will be ok

@@ -142,6 +142,10 @@ func (alloc *reclaimAction) Execute(ssn *framework.Session) {
if j, found := ssn.Jobs[task.Job]; !found {
continue
} else if j.Queue != job.Queue {
q := ssn.Queues[j.Queue]
if q != nil && q.Queue != nil && true == q.Queue.Spec.UnReclaimAble {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that should be fine to check Reclaimable directly.

@TravisBuddy
Copy link

Travis tests have failed

Hey @sivanzcw,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: f9d7fc90-2b93-11ea-9b13-1f3f6380198b

@@ -262,6 +262,8 @@ type QueueSpec struct {
Capability v1.ResourceList `json:"capability,omitempty" protobuf:"bytes,2,opt,name=capability"`
// State controller the status of queue
State QueueState `json:"state,omitempty" protobuf:"bytes,3,opt,name=state"`
// ReclaimAble indicate whether the queue can be reclaimed by other queue
ReclaimAble *bool `json:"reclaimable,omitempty" protobuf:"bytes,4,opt,name=unreclaimable"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/unreclaimable/reclaimable

@@ -261,6 +261,8 @@ type QueueSpec struct {
Capability v1.ResourceList
// State controller the status of queue
State QueueState
// ReclaimAble indicate whether the queue can be reclaimed by other queue
ReclaimAble *bool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/ReclaimAble/Reclaimable/g

@@ -142,6 +142,10 @@ func (alloc *reclaimAction) Execute(ssn *framework.Session) {
if j, found := ssn.Jobs[task.Job]; !found {
continue
} else if j.Queue != job.Queue {
q := ssn.Queues[j.Queue]
if false == q.ReclaimAble() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if !q.Reclaimable() {
    ...
}

@@ -56,3 +56,20 @@ func (q *QueueInfo) Clone() *QueueInfo {
Queue: q.Queue,
}
}

// ReclaimAble return whether queue is reclaimAble
func (q *QueueInfo) ReclaimAble() bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to set default value in admission controller; so user can also check this value in cli :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there is no queue admission now, this may require another commit to handle queue validating and mutating.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that's ok to open another PR for that :)

@volcano-sh-bot volcano-sh-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 2, 2020
@sivanzcw sivanzcw changed the title Reclaim Enhancement: Add unreclaimable parameter for queue Reclaim Enhancement: Add Reclaimable parameter for queue Jan 2, 2020
@TravisBuddy
Copy link

Travis tests have failed

Hey @sivanzcw,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: d859e620-2d08-11ea-b5b0-b361e22ae1a5

@k82cn
Copy link
Member

k82cn commented Jan 2, 2020

/approve

@k82cn
Copy link
Member

k82cn commented Jan 2, 2020

/lgtm

@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: k82cn, sivanzcw

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 lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 2, 2020
@TravisBuddy
Copy link

Hey @sivanzcw,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: 6f8a0da0-2d30-11ea-b5b0-b361e22ae1a5

@volcano-sh-bot volcano-sh-bot merged commit 082af9d into volcano-sh:master Jan 2, 2020
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants