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

Modify GetTopologyHints() for per-resource hints in the TopologyManager #1131

Conversation

klueska
Copy link
Contributor

@klueska klueska commented Jul 9, 2019

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.

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.
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 9, 2019
@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/node Categorizes an issue or PR as relevant to SIG Node. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 9, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: klueska
To complete the pull request process, please assign dchen1107
You can assign the PR to them by writing /assign @dchen1107 in a comment when ready.

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

@klueska
Copy link
Contributor Author

klueska commented Jul 9, 2019

@k8s-ci-robot
Copy link
Contributor

@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:

/cc @lmdaly @moshe010 @ConnorDoyle @derekwaynecarr @cbf123

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
Copy link

Choose a reason for hiding this comment

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

Seems reasonable to me.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 for me

Copy link
Member

Choose a reason for hiding this comment

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

+1

@lmdaly
Copy link
Contributor

lmdaly commented Jul 10, 2019

LGTM!

Are we planning on using the resource name in the pod spec as their name in the map?

@klueska
Copy link
Contributor Author

klueska commented Jul 10, 2019

That’s what I would expect, yes.

@klueska
Copy link
Contributor Author

klueska commented Jul 22, 2019

I now have a patch for this based on the current state of the outstanding PRs for the TopologyManager. I'm waiting to create a PR until the rest of the existing PRs merge to avoid having to rebase unnecessarily, multiple times.

They are the top 6 commits in:
https://github.com/klueska/kubernetes/commits/upstream-get-topology-hints-map

@klueska
Copy link
Contributor Author

klueska commented Jul 22, 2019

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 22, 2019
@klueska
Copy link
Contributor Author

klueska commented Jul 24, 2019

/assign @dchen1107 @derekwaynecarr

@klueska
Copy link
Contributor Author

klueska commented Aug 26, 2019

/assign @ConnorDoyle

@klueska
Copy link
Contributor Author

klueska commented Oct 3, 2019

Closing in favor of #1222 which also includes this change.

@klueska klueska closed this Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory ok-to-test Indicates a non-member PR verified by an org member that is safe to test. sig/node Categorizes an issue or PR as relevant to SIG Node. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants