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

YUNIKORN-2175 Add queue headRoom for Rest API querying and improve logs #727

Closed
wants to merge 4 commits into from

Conversation

zhuqi-lucas
Copy link
Contributor

@zhuqi-lucas zhuqi-lucas commented Nov 22, 2023

What is this PR for?

  1. We should support query headroom using rest API.

  2. And from the logs, i can't find any info about the headroom value, when application request can't meet the headroom.

Application **** does not fit into *** queue\" timestampNano:1700625301297929026 referenceID:\"******\" resource:{resources:{key:\"ephemeral-storage\" value:{}} resources:{key:\"memory\" value:{value:24000000000}} resources:{key:\"pods\" value:{value:1}} resources:{key:\"vcore\" value:{value:13000}}}"} 

We need to add more logs about this case!

What type of PR is it?

  • - Bug Fix
  • - Improvement
  • - Feature
  • - Documentation
  • - Hot Fix
  • - Refactoring

Todos

  • - Task

What is the Jira issue?

How should this be tested?

Screenshots (if appropriate)

Questions:

  • - The licenses files need update.
  • - There is breaking changes for older versions.
  • - It needs documentation.

Copy link

codecov bot commented Nov 22, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (dff8feb) 77.87% compared to head (2f61827) 77.82%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #727      +/-   ##
==========================================
- Coverage   77.87%   77.82%   -0.05%     
==========================================
  Files          80       80              
  Lines       13344    13400      +56     
==========================================
+ Hits        10391    10429      +38     
- Misses       2630     2647      +17     
- Partials      323      324       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@manirajv06 manirajv06 left a comment

Choose a reason for hiding this comment

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

Can you add tests to cover this change?

@zhuqi-lucas zhuqi-lucas changed the title YUNIKORN-2175 Add queue headRoom for Rest API querying YUNIKORN-2175 Add queue headRoom for Rest API querying and improve logs Nov 22, 2023
@zhuqi-lucas
Copy link
Contributor Author

Thank you @manirajv06 for review, add more logs improvement, and also added test cases!

@zhuqi-lucas zhuqi-lucas requested a review from pbacsko November 22, 2023 11:48
@@ -33,6 +33,7 @@ type PartitionQueueDAOInfo struct {
GuaranteedResource map[string]int64 `json:"guaranteedResource,omitempty"`
AllocatedResource map[string]int64 `json:"allocatedResource,omitempty"`
PreemptingResource map[string]int64 `json:"preemptingResource,omitempty"`
HeadRoom map[string]int64 `json:"headroom,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not tested whether this value appears properly after a web service call. It's not just this field, but quite a few inside PartitionQueueDAOInfo. There's a test case TestGetPartitionQueuesHandler which should be improved to see if values from the schedulerContext are mapped back properly. This can be done in a follow-up JIRA.

Copy link
Contributor

Choose a reason for hiding this comment

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

Created https://issues.apache.org/jira/browse/YUNIKORN-2179 so that we can proceed with this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch @pbacsko !

Copy link
Contributor

@pbacsko pbacsko left a comment

Choose a reason for hiding this comment

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

+1

if !evt.eventSystem.IsEventTrackingEnabled() || !evt.limiter.Allow() {
return
}
message := fmt.Sprintf("Application %s does not fit into %s queue", request.GetApplicationID(), evt.app.queuePath)
message := fmt.Sprintf("Application %s does not fit into %s queue, request resoure %s can't fit headroom %s", request.GetApplicationID(), evt.app.queuePath, request.GetAllocatedResource().String(), headroom.String())
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor nit no.1: calling String() is not needed, fmt.Sprintf() can recognize the Stringer interface.
Minor nit no.2: slight rewording: "Application %s does not fit into %s queue (request resoure %s, headroom %s)". The proposed message sounds like two separate problems.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, addressed in latest PR.

Copy link
Contributor

@pbacsko pbacsko left a comment

Choose a reason for hiding this comment

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

Two minor comment

@zhuqi-lucas zhuqi-lucas requested a review from pbacsko November 23, 2023 13:32
Copy link
Contributor

@pbacsko pbacsko left a comment

Choose a reason for hiding this comment

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

+1

@pbacsko pbacsko closed this in a9dcab4 Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants