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

Extend the PodResources API to include resources allocated by DRA #115847

Merged

Conversation

moshe010
Copy link
Contributor

@moshe010 moshe010 commented Feb 17, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

It extend the kubelet PodResources API List() method to return Dynamic Resources and it add Get() to query specific pod

Which issue(s) this PR fixes:

KEP: kubernetes/enhancements#3695

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Extended the kubelet's PodResources API to include resources allocated in `ResourceClaims` via `DynamicResourceAllocation`. Additionally, added a new `Get()` method to query a specific pod for its resources.

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

- [KEP]:  https://github.com/kubernetes/enhancements/pull/3738

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 17, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @moshe010. 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-priority Indicates a PR lacks a `priority/foo` label and requires one. area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 17, 2023
@moshe010 moshe010 marked this pull request as draft February 17, 2023 02:17
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 17, 2023
@moshe010
Copy link
Contributor Author

/assign @ffromani @swatisehgal @bart0sh @klueska

I need to add unit tests and e2e tests. I would appreciate reviews to make sure we are aligned

Copy link
Contributor

@ffromani ffromani left a comment

Choose a reason for hiding this comment

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

We need to distinguish two topics here.

  1. adding checkpoint to DRA. I'm still learning my way into DRA so I can't say. I'd defer comments to DRA developers (which are already tagged) and trust their judgement. IF DRA would benefit from adding checkpoint, I'd do in a separate PR, but really, I trust their call here.
  2. podresources API proper. Pretty much straightforward, the direction seems good with only minor things spotted so far

I'm aware podresources e2e tests need some work and I'm on it in the coming days/weeks, it will be needed to re-graduate the feature to GA on it, which is one of my goals for 1.27/28

pkg/kubelet/cm/dra/manager.go Outdated Show resolved Hide resolved
pkg/kubelet/cm/dra/state/state_checkpoint.go Outdated Show resolved Hide resolved
pkg/kubelet/apis/podresources/server_v1.go Outdated Show resolved Hide resolved
pkg/kubelet/cm/fake_container_manager.go Show resolved Hide resolved
pkg/kubelet/server/server.go Outdated Show resolved Hide resolved
@bart0sh bart0sh added this to Waiting on Author in SIG Node PR Triage Feb 19, 2023
@bart0sh bart0sh moved this from Waiting on Author to Triage in SIG Node PR Triage Feb 19, 2023
@bart0sh
Copy link
Contributor

bart0sh commented Feb 19, 2023

/triage accepted
/priority important-soon
/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. triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 19, 2023
@SergeyKanzhelev SergeyKanzhelev moved this from Needs Reviewer to Needs Approver in SIG Node PR Triage Mar 14, 2023
Copy link
Contributor

@ffromani ffromani left a comment

Choose a reason for hiding this comment

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

/lgtm

final LGTM call is @klueska 's

needs approval for the feature gate part

Devices: []*podresourcesapi.ContainerDevices{},
CpuIds: cpus,
Memory: memory,
DynamicResources: draDevs,
Copy link
Contributor

Choose a reason for hiding this comment

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

can be postponed.

@@ -515,11 +753,54 @@ func equalListResponse(respA, respB *podresourcesapi.ListPodResourcesResponse) b
if !equalContainerDevices(cntA.Devices, cntB.Devices) {
return false
}

if !euqalDynamicResources(cntA.DynamicResources, cntB.DynamicResources) {
Copy link
Contributor

Choose a reason for hiding this comment

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

let's fix the typo (cosmetic only, because the typo is used consistently!) before beta. Not blocking now.

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

LGTM label has been added.

Git tree hash: 89ea6386ced8e5f5c4a101d7f00b21d338565bcf

@ffromani
Copy link
Contributor

/hold

because:

/lgtm

final LGTM call is @klueska 's

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 14, 2023
@ffromani
Copy link
Contributor

/retest

@ffromani
Copy link
Contributor

/test pull-kubernetes-unit

unrelated failure

@klueska
Copy link
Contributor

klueska commented Mar 14, 2023

Thanks for all your hard work on this @moshe010
/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

@klueska: /release-note-edit must be used with a release note block.

In response to this:

/release-note-edit

release-note
We extend the kubelet's PodResources API to include resources allocated in `ResourceClaims` via `DynamicResourceAllocation`. Additionally, we add a new `Get()` method to query a specific pod for its resources rather than forcing users to rely solely on the existing `List()` method which returns resources for all pods.

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

@klueska: /release-note-edit must be used with a release note block.

In response to this:

/release-note-edit

We extend the kubelet's PodResources API to include resources allocated in `ResourceClaims` via `DynamicResourceAllocation`. Additionally, we add a new `Get()` method to query a specific pod for its resources rather than forci

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

@klueska: /release-note-edit must be used with a release note block.

In response to this:

/release-note-edit

We extend the kubelet's PodResources API to include resources allocated in `ResourceClaims` via `DynamicResourceAllocation`. Additionally, we add a new `Get()` method to query a specific pod for its resources rather than forci

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.

@klueska
Copy link
Contributor

klueska commented Mar 14, 2023

/assign dchen1107 derekwaynecarr
For feature gate approval

@ffromani
Copy link
Contributor

/hold cancel

Kevin reviewed

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 14, 2023
@dims
Copy link
Member

dims commented Mar 14, 2023

/approve

new alpha feature gates look good to me!

@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 14, 2023
@dchen1107
Copy link
Member

/approve the feature gate

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dchen1107, dims, klueska, moshe010

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

@k8s-ci-robot k8s-ci-robot merged commit 28fa3cb into kubernetes:master Mar 14, 2023
SIG Node PR Triage automation moved this from Needs Approver to Done Mar 14, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.27 milestone Mar 14, 2023
@moshe010
Copy link
Contributor Author

follow-up PR #116742 to address the no-blocking issues

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 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/node Categorizes an issue or PR as relevant to SIG Node. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

10 participants