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

Change the error message. #2773

Merged
merged 1 commit into from Apr 18, 2023
Merged

Conversation

gj199575
Copy link
Contributor

@gj199575 gj199575 commented Apr 11, 2023

this MR is the relization of this issue : #2774
when pod is unscheduled, make the error message similar  to kube-scheduler。

test message
the default scheduler error message is "0/2 nodes are available: 2 Insufficient cpu."

before this MR
volcano error message is "all nodes are unavailable: 2/2 nodes node(s) resource fit failed."

after this MR
volcano error message is "all nodes are unavailable: 2/2 nodes Insufficient cpu."

And in the future。 I will continue to make volcano error event or something which is showed to user is more similar to k8s default scheduler

@volcano-sh-bot
Copy link
Contributor

Welcome @gj199575! It looks like this is your first PR to volcano-sh/volcano 🎉

@volcano-sh-bot volcano-sh-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 11, 2023
@wangyang0616
Copy link
Member

Hello, you are very welcome to participate in community contributions.

From your description, you can see the events and error log information that will continue to be output by Volcano.

I think it would be better to create an issue and classify similar PRs in a unified way.
Thanks!

@@ -98,8 +98,8 @@ func (alloc *Action) Execute(ssn *framework.Session) {
allNodes := ssn.NodeList
predicateFn := func(task *api.TaskInfo, node *api.NodeInfo) error {
// Check for Resource Predicate
if !task.InitResreq.LessEqual(node.FutureIdle(), api.Zero) {
return api.NewFitError(task, node, api.NodeResourceFitFailed)
if reason := task.InitResreq.LessEqualResource(node.FutureIdle(), api.Zero); len(reason) != 0 {
Copy link
Member

Choose a reason for hiding this comment

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

Why add a new function here? If a return value is added on the basis of the original function, it indicates whether the resource information of the error is acceptable.

In addition, there are many places where lessEqual is called. Do other places need to be modified or modified iteratively?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why add a new function here?
Because the purpose of this PR is to make volcano event belong to a unscheduled pod , is more similar to kube-scheduler 。
So I do not need to change many codes。
And the LessEqual function is used by many places , if I change LessEqual function , it is a huge project。
So I choose a better way to solve my problem ,and do not change volcano a lot。

Copy link
Member

Choose a reason for hiding this comment

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

If you are worried that the impact of the modification is too large, you can add a new function, but the return value of the new function is recommended to return two (bool, string), the first parameter indicates the result, and the second parameter indicates msg, in the return value character Whether the string is empty indicates the result of the judgment value, which feels inappropriate

@gj199575
Copy link
Contributor Author

Hello, you are very welcome to participate in community contributions.

From your description, you can see the events and error log information that will continue to be output by Volcano.

I think it would be better to create an issue and classify similar PRs in a unified way. Thanks!

ok, I will create a issue

@wangyang0616
Copy link
Member

Please refer to the prompt information DCO to repair CI

@gj199575 gj199575 force-pushed the fix_errorMsg branch 2 times, most recently from aee5781 to 3c35cfc Compare April 12, 2023 03:47
@volcano-sh-bot volcano-sh-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 12, 2023
@gj199575
Copy link
Contributor Author

Please refer to the prompt information DCO to repair CI

ok

@gj199575 gj199575 force-pushed the fix_errorMsg branch 5 times, most recently from dd17d67 to be8cff3 Compare April 17, 2023 12:47
@gj199575 gj199575 closed this Apr 17, 2023
@gj199575 gj199575 reopened this Apr 17, 2023
@gj199575
Copy link
Contributor Author

/assign @jiangkaihua

@wangyang0616
Copy link
Member

/priority important-soon

@volcano-sh-bot volcano-sh-bot added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Apr 18, 2023
@@ -98,8 +98,8 @@ func (alloc *Action) Execute(ssn *framework.Session) {
allNodes := ssn.NodeList
predicateFn := func(task *api.TaskInfo, node *api.NodeInfo) error {
// Check for Resource Predicate
if !task.InitResreq.LessEqual(node.FutureIdle(), api.Zero) {
return api.NewFitError(task, node, api.NodeResourceFitFailed)
if ok, reason := task.InitResreq.CheckResource(node.FutureIdle(), api.Zero); !ok {
Copy link
Member

Choose a reason for hiding this comment

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

@gj199575 LessEqual is an imporment foundamental function. What's the difference between the CheckResource and LessEqual, and why we have to add this new function, Would you provide detail reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, LessEqual is used by many place, And the new function CheckResource is ready to slove the problem in #2774. But it is the same as LessEqual in code。
And after I solve #2774
I will continue change to merge LessEqual and CheckResource to a function 。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gj199575 LessEqual is an imporment foundamental function. What's the difference between the CheckResource and LessEqual, and why we have to add this new function, Would you provide detail reason?

And it is a huge project if I change LessEqual function .So I supply a new function LessEqualWithReason 。 And I will merge LEssEqual and LessEqualWithReason to a funtion 。

Copy link
Member

@william-wang william-wang left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@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 Apr 18, 2023
when pod is unscheduled, make the error message similar  to kube-scheduler。

Signed-off-by: gj199575 <409237405@qq.com>
@volcano-sh-bot volcano-sh-bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 18, 2023
Copy link
Member

@william-wang william-wang left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 18, 2023
@volcano-sh-bot
Copy link
Contributor

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

@volcano-sh-bot volcano-sh-bot merged commit d4458ff into volcano-sh:master Apr 18, 2023
13 checks passed
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. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants