-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Modify GetTopologyHints() for per-resource hints in the TopologyManager #1131
Modify GetTopologyHints() for per-resource hints in the TopologyManager #1131
Conversation
At present, there is no way for a hint provider to return distinct hints for different resource types via a call to `GetTopologyHints()`. This means that hint providers that govern multiple resource types (e.g. the devicemanager) must do some sort of "pre-merge" on the hints it generates for each resource type before passing them back to the `TopologyManager`. This seems counter-intuitive, since there is no practical reason that a "pre-merge" should be necessary -- it just happens to be necessary because of the way the current interface is designed. It would be better to allow a hint provider to pass back raw hints for each resource type, and allow the `TopologyManager` to merge them using a single unified strategy. This patch makes a simple change to the `GetTopologyHints()` interface to allow this to occur. Moreover, this change allows the `TopologyManager` to recognize which resource type a set of hints originated from, should this information become useful in the future.
Hi @klueska. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: klueska The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@klueska: GitHub didn't allow me to request PR reviews from the following users: cbf123, lmdaly, moshe010. Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
// resource types that it governs; otherwise returns `nil` to indicate "don't | ||
// care". Hints for different resource types are indexed by their name in the | ||
// returned map. | ||
GetTopologyHints(pod v1.Pod, containerName string) map[string][]TopologyHint |
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.
Seems reasonable to me.
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.
+1 for me
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.
+1
LGTM! Are we planning on using the resource name in the pod spec as their name in the map? |
That’s what I would expect, yes. |
I now have a patch for this based on the current state of the outstanding PRs for the They are the top 6 commits in: |
/ok-to-test |
/assign @dchen1107 @derekwaynecarr |
/assign @ConnorDoyle |
Closing in favor of #1222 which also includes this change. |
At present, there is no way for a hint provider to return distinct hints
for different resource types via a call to
GetTopologyHints()
. Thismeans that hint providers that govern multiple resource types (e.g. the
devicemanager) must do some sort of "pre-merge" on the hints it
generates for each resource type before passing them back to the
TopologyManager
.This seems counter-intuitive, since there is no practical reason that a
"pre-merge" should be necessary -- it just happens to be necessary
because of the way the current interface is designed.
It would be better to allow a hint provider to pass back raw hints for
each resource type, and allow the
TopologyManager
to merge them usinga single unified strategy.
This patch makes a simple change to the
GetTopologyHints()
interfaceto allow this to occur.
Moreover, this change allows the
TopologyManager
to recognize whichresource type a set of hints originated from, should this information
become useful in the future.