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

fromanirh
Copy link
Contributor

@fromanirh fromanirh 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 do-not-merge/work-in-progress kind/feature kind/api-change size/XXL needs-sig labels Oct 20, 2020
@k8s-ci-robot
Copy link
Contributor

@k8s-ci-robot k8s-ci-robot commented Oct 20, 2020

@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 cncf-cla: yes labels Oct 20, 2020
@k8s-ci-robot
Copy link
Contributor

@k8s-ci-robot k8s-ci-robot commented Oct 20, 2020

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 needs-priority labels Oct 20, 2020
@fromanirh
Copy link
Contributor Author

@fromanirh fromanirh commented Oct 20, 2020

/sig node

@k8s-ci-robot k8s-ci-robot added sig/node and removed needs-sig labels Oct 20, 2020
@k8s-ci-robot k8s-ci-robot requested review from dims and feiskyer Oct 20, 2020
@k8s-ci-robot k8s-ci-robot added area/kubelet area/test sig/testing labels Oct 20, 2020
@fromanirh fromanirh force-pushed the podresources-concrete-resources-apis branch from 56dcb6b to 78cd196 Compare Oct 20, 2020
@fromanirh fromanirh 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 label Oct 20, 2020
@fromanirh
Copy link
Contributor Author

@fromanirh fromanirh commented Oct 20, 2020

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

@SergeyKanzhelev SergeyKanzhelev commented Oct 20, 2020

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test and removed needs-ok-to-test labels Oct 20, 2020
@fejta-bot
Copy link

@fejta-bot fejta-bot commented Oct 20, 2020

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.

fromanirh added 4 commits Mar 9, 2021
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
Member

@annajung 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.

@fromanirh fromanirh force-pushed the podresources-concrete-resources-apis branch from ad74ff9 to 1e7bb20 Compare Mar 9, 2021
@k8s-ci-robot k8s-ci-robot removed the lgtm label Mar 9, 2021
@fromanirh
Copy link
Contributor Author

@fromanirh fromanirh commented Mar 9, 2021

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

@klueska
Copy link
Contributor

@klueska klueska commented Mar 9, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label Mar 9, 2021
@fromanirh
Copy link
Contributor Author

@fromanirh fromanirh commented Mar 9, 2021

/test pull-kubernetes-e2e-kind

@fromanirh
Copy link
Contributor Author

@fromanirh fromanirh commented Mar 9, 2021

/test pull-kubernetes-integration

@fromanirh
Copy link
Contributor Author

@fromanirh fromanirh commented Mar 9, 2021

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

@fromanirh
Copy link
Contributor Author

@fromanirh fromanirh commented Mar 9, 2021

/retest

@k8s-ci-robot
Copy link
Contributor

@k8s-ci-robot 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

thank you for making the terminology updates.

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the approved label Mar 9, 2021
@dchen1107
Copy link
Member

@dchen1107 dchen1107 commented Mar 9, 2021

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

@k8s-ci-robot
Copy link
Contributor

@k8s-ci-robot k8s-ci-robot commented Mar 9, 2021

[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

@ehashman ehashman moved this from Needs Reviewer to Done in SIG Node PR Triage Mar 9, 2021
@k8s-ci-robot k8s-ci-robot merged commit 770a950 into kubernetes:master Mar 9, 2021
17 of 18 checks passed
@fromanirh fromanirh deleted the podresources-concrete-resources-apis branch Mar 9, 2021
fromanirh added a commit to fromanirh/node-feature-discovery that referenced this issue Mar 23, 2021
now that kubernetes/kubernetes#95734 was merged,
we should track u/s kubernetes again. Track current tip up until we get
a tag (ora a release) which surely contains the above PR.

Signed-off-by: Francesco Romani <fromani@redhat.com>
fromanirh added a commit to fromanirh/node-feature-discovery that referenced this issue Mar 24, 2021
now that kubernetes/kubernetes#95734 was merged,
we should track u/s kubernetes again. Track current tip up until we get
a tag (ora a release) which surely contains the above PR.

Signed-off-by: Francesco Romani <fromani@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved area/kubelet area/test cncf-cla: yes kind/api-change kind/feature lgtm needs-priority needs-triage ok-to-test release-note sig/instrumentation sig/node sig/testing size/XXL
Development

Successfully merging this pull request may close these issues.

None yet