-
Notifications
You must be signed in to change notification settings - Fork 993
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
remove node out of sync state #2998
Conversation
@@ -99,8 +99,8 @@ func (alloc *Action) Execute(ssn *framework.Session) { | |||
allNodes := ssn.NodeList | |||
predicateFn := func(task *api.TaskInfo, node *api.NodeInfo) ([]*api.Status, error) { | |||
// Check for Resource Predicate | |||
if ok, reason := task.InitResreq.LessEqualWithReason(node.FutureIdle(), api.Zero); !ok { | |||
return nil, api.NewFitError(task, node, reason) | |||
if ok, resource := task.InitResreq.LessEqualWithResource(node.FutureIdle(), api.Zero); !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.
@Monokaix Hi, I'm kindly asking about the reason or meaning of this PR. After going through all the modifications, I've not getting the meaningful points. It may be better to add descriptions for all PRs.
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.
Sorry for delay, I have added the related issue.
@@ -418,10 +418,10 @@ func (r *Resource) LessEqualWithReason(rr *Resource, defaultValue DimensionDefau | |||
} | |||
|
|||
if !lessEqualFunc(r.MilliCPU, rr.MilliCPU, minResource) { | |||
return false, "Insufficient cpu" |
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.
Suggest not add any prefix for the resource for this is only a common used tool function. The prefix may narrow the usage.
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.
The origin prefix is reason, which is also not common, LessEqual
func has many usage, it will cause a big change if we change this func directly.
cbe8d0a
to
b354161
Compare
0482641
to
f54816d
Compare
pkg/scheduler/api/resource_info.go
Outdated
// @param defaultValue "default value for resource dimension not defined in ScalarResources. Its value can only be one of 'Zero' and 'Infinity'" | ||
// this function is the same as LessEqual , and it will be merged to LessEqual in the future | ||
func (r *Resource) LessEqualWithReason(rr *Resource, defaultValue DimensionDefaultValue) (bool, string) { | ||
func (r *Resource) LessEqualWithResources(rr *Resource, defaultValue DimensionDefaultValue) (bool, []string) { |
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 change LessEqualWithResources
to LessEqualWithResourceName
pkg/scheduler/api/node_info.go
Outdated
func (ni *NodeInfo) allocateIdleResource(ti *TaskInfo) error { | ||
if ti.Resreq.LessEqual(ni.Idle, Zero) { | ||
func (ni *NodeInfo) allocateIdleResource(ti *TaskInfo) { | ||
ok, resources := ti.Resreq.LessEqualWithResources(ni.Idle, Zero) |
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.
LessEqualWithResources
is similar with lessEqual
and will be merged to lessEqual
in the future. So here we'd better use LessEqual
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.
here we want to know what resources are not enough, so LessEqualWithResources
is used now.
@@ -372,30 +368,30 @@ func (ni *NodeInfo) setNode(node *v1.Node) { | |||
for _, ti := range ni.Tasks { | |||
switch ti.Status { | |||
case Releasing: | |||
ni.Idle.sub(ti.Resreq) // sub without assertion | |||
ni.allocateIdleResource(ti) |
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.
sugguest use common function sub
.
ni.Releasing.Add(ti.Resreq) | ||
ni.Used.Add(ti.Resreq) | ||
ni.addResource(ti.Pod) | ||
case Pipelined: | ||
ni.Pipelined.Add(ti.Resreq) | ||
default: | ||
ni.Idle.sub(ti.Resreq) // sub without assertion | ||
ni.allocateIdleResource(ti) |
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.
same as above
7a73bfc
to
1628980
Compare
Signed-off-by: Xuzheng Chang <changxuzheng@huawei.com>
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: william-wang 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 |
Fix #2999
Lost of GPUs
problem has not been resolved completely #1818