-
Notifications
You must be signed in to change notification settings - Fork 969
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
Conversation
sivanzcw
commented
Dec 29, 2019
- Add parameter for queue to support queue unReclaimable
Hey @sivanzcw, TravisBuddy Request Identifier: 6b574130-2a42-11ea-8495-6f9e5f4a4dcf |
pkg/apis/scheduling/types.go
Outdated
@@ -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 |
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.
let's use Reclaimable
directly :)
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.
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 { |
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.
that should be fine to check Reclaimable
directly.
Travis tests have failedHey @sivanzcw, 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"` |
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.
s/unreclaimable/reclaimable
pkg/apis/scheduling/types.go
Outdated
@@ -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 |
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.
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() { |
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.
if !q.Reclaimable() {
...
}
pkg/scheduler/api/queue_info.go
Outdated
@@ -56,3 +56,20 @@ func (q *QueueInfo) Clone() *QueueInfo { | |||
Queue: q.Queue, | |||
} | |||
} | |||
|
|||
// ReclaimAble return whether queue is reclaimAble | |||
func (q *QueueInfo) ReclaimAble() bool { |
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.
It's better to set default value in admission controller; so user can also check this value in cli :)
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.
Since there is no queue admission now, this may require another commit to handle queue validating and mutating.
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.
yes, that's ok to open another PR for that :)
Travis tests have failedHey @sivanzcw, TravisBuddy Request Identifier: d859e620-2d08-11ea-b5b0-b361e22ae1a5 |
/approve |
/lgtm |
[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 |
Hey @sivanzcw, TravisBuddy Request Identifier: 6f8a0da0-2d30-11ea-b5b0-b361e22ae1a5 |