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

podresources APIs: concrete resources apis: implement GetAllocatableResources #95734

Merged

Conversation

ffromani
Copy link
Contributor

@ffromani ffromani commented Oct 20, 2020

What type of PR is this?

/kind feature

What this PR does / why we need it:
Implement the GetAllocatableResources endpoint proposed in https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2043-pod-resource-concrete-assigments

Which issue(s) this PR fixes:
Fixes # N/A

Special notes for your reviewer:
This PR depends on the changes implemented in #93243
Replaces #94478

The original plan is to also implement the Watch endpoint, also replacing and #94612, but this needs to be postponed to 1.21 for capacity reasons.
KEP amendment PR: kubernetes/enhancements#2125

Does this PR introduce a user-facing change?:

Implement the GetAvailableResources in the podresources API.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

- [KEP]:  https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2043-pod-resource-concrete-assigments

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 20, 2020
@k8s-ci-robot
Copy link
Contributor

@fromanirh: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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 needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 20, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @fromanirh. 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Oct 20, 2020
@ffromani
Copy link
Contributor Author

/sig node

@k8s-ci-robot k8s-ci-robot added sig/node Categorizes an issue or PR as relevant to SIG Node. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 20, 2020
@k8s-ci-robot k8s-ci-robot added area/kubelet area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Oct 20, 2020
@ffromani ffromani force-pushed the podresources-concrete-resources-apis branch from 56dcb6b to 78cd196 Compare October 20, 2020 19:14
@ffromani ffromani changed the title WIP: podresources APIs: concrete resources apis podresources APIs: concrete resources apis Oct 20, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 20, 2020
@ffromani
Copy link
Contributor Author

this PR is now reviewable! please note it depends on the changes made in #93243 (hence 7aaef8a is duplicated here)

The Watch() implementation is missing as we are still tuning the implementation and fixing the e2e tests. Please let me know (@RenaudWasTaken and anyone which wants to review!) if is better to add the Watch implementation here, as I plan to do, or better a separate PR. Please note that PR would depend on #93243 and on this one, which can make the review awkward - this is the reason why I'm inclined to add the missing changes here.

@SergeyKanzhelev
Copy link
Member

/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 Oct 20, 2020
@fejta-bot
Copy link

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

It's legal for device plugins to not expose topology informations.
Previously, the code was just skipping these devices.
Review highlighted is better to report them anyway and let the
client application decide if they still want somehow to track them
or skip them entirely.

Signed-off-by: Francesco Romani <fromani@redhat.com>
From kubernetes#96553
we are reminded we need to handle the case on which
a device plugin reports nil Topology, which is legal.
Add unit test to ensure this case is handled.

Signed-off-by: Francesco Romani <fromani@redhat.com>
Add test to reflect the correct behaviour according to
review comments.

Most notably, we should consider that -as the device plugin API
allows to express- a device ID can have multiple "NUMA" node IDs.
(example: AMD Rome).
More details:
kubernetes#95734 (comment)

Signed-off-by: Francesco Romani <fromani@redhat.com>
Add feature gate to disable the GetAllocatableResources API.
The feature gate isd alpha stage, disabled by default.

Add e2e test to demonstrate the behaviour with feature gate disabled.

Signed-off-by: Francesco Romani <fromani@redhat.com>
Before the addition of GetAllocatableResources, the
podresources API had just one endpoint `List()`, thus we could just
account for the total of the calls to have a good pulse of the API usage.
Now that we extend the API with more endpoints
(`GetAlloctableResources`), in order to improve the observability we add
per-endpoint counters, in addition to the existing counter of the total
API calls.

Signed-off-by: Francesco Romani <fromani@redhat.com>
@annajung
Copy link

annajung commented Mar 9, 2021

Hi @fromanirh, a friendly reminder that the code freeze for 1.21 is today.
Please make sure to resolve the conflicting file and get the necessary reviews for this to merge by EOD PST.

@ffromani ffromani force-pushed the podresources-concrete-resources-apis branch from ad74ff9 to 1e7bb20 Compare March 9, 2021 15:40
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 9, 2021
@ffromani
Copy link
Contributor Author

ffromani commented Mar 9, 2021

rebased to fix the conflict. No code changes besides the confict fix itself.

@klueska
Copy link
Contributor

klueska commented Mar 9, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 9, 2021
@ffromani
Copy link
Contributor Author

ffromani commented Mar 9, 2021

/test pull-kubernetes-e2e-kind

@ffromani
Copy link
Contributor Author

ffromani commented Mar 9, 2021

/test pull-kubernetes-integration

@ffromani
Copy link
Contributor Author

ffromani commented Mar 9, 2021

/test pull-kubernetes-e2e-azure-disk-windows
/test pull-kubernetes-e2e-azure-file-windows

@ffromani
Copy link
Contributor Author

ffromani commented Mar 9, 2021

/retest

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Mar 9, 2021

@fromanirh: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-kubernetes-e2e-gce-device-plugin-gpu 701b859a4002547c0f2cc566b403013b528c76d6 link /test pull-kubernetes-e2e-gce-device-plugin-gpu
pull-kubernetes-e2e-azure-file-windows-containerd 6239c1acb8c9b45bbd9404018d8203a8ec244e4f link /test pull-kubernetes-e2e-azure-file-windows-containerd
pull-kubernetes-e2e-azure-file-windows 1e7bb20 link /test pull-kubernetes-e2e-azure-file-windows

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

Copy link
Member

@derekwaynecarr derekwaynecarr left a comment

Choose a reason for hiding this comment

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

thank you for making the terminology updates.

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 9, 2021
@dchen1107
Copy link
Member

/lgtm
/approve based on Kevin's review since I only reviewed API changes.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AlexeyPerevalov, dchen1107, derekwaynecarr, fromanirh, klueska, RenaudWasTaken

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

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. area/kubelet area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Development

Successfully merging this pull request may close these issues.

None yet