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

Advertise TopologyManger policy and scope as Attributes in NRT api v1alpha2 #1054

Merged
merged 3 commits into from
Feb 15, 2023

Conversation

PiotrProkop
Copy link
Contributor

We want to advertise TopologyManager policy and scope as top level attributes in noderesourcetopology-api v1alpha2.
Based on this PR kubernetes-sigs/scheduler-plugins#488.

@netlify
Copy link

netlify bot commented Feb 9, 2023

Deploy Preview for kubernetes-sigs-nfd ready!

Name Link
🔨 Latest commit f76fc5b
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-nfd/deploys/63ec977c18ee1d0008a28b99
😎 Deploy Preview https://deploy-preview-1054--kubernetes-sigs-nfd.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@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 Feb 9, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @PiotrProkop. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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 the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 9, 2023
@PiotrProkop
Copy link
Contributor Author

I'll add unit tests for this tomorrow. @ffromani @swatisehgal please review.

@ffromani
Copy link
Contributor

ffromani commented Feb 9, 2023

/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 Feb 9, 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.

thanks for the quick PR! looks straightforward, suggest possible improvements inside.

cmd/nfd-topology-updater/main.go Outdated Show resolved Hide resolved
@@ -63,3 +70,16 @@ func detectPolicyContainerScope(policy string) v1alpha2.TopologyManagerPolicy {
return v1alpha2.None
}
}

func DetectTopologyAttributes(policy string, scope string) v1alpha2.AttributeList {
Copy link
Contributor

Choose a reason for hiding this comment

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

codewise this is fine, but in the near future I'd love to deprecate pkg/topologypolicy and adding code here goes against this direction. So I'd move this code in pkg/nfd-topology-updater (possibly in nfd-topolog-updater.go) as private function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will do.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks! if you move, please also rename this function! The code is just fine, but it is not detecting, rather constructing/creating

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved and changed, and got rid of AttributeName type alias which was unused :)

@swatisehgal
Copy link
Contributor

/cc

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.

looks fine. I'd like to see some form of test coverage (probably integration/e2e) before LGTM

tmScope string
}

func newStaticNodeInfo(policy, scope string) *staticNodeInfo {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit/nonblocking: I'd just return a struct (not a pointer to a struct) and trust the compiler.
In general, returning pointers may allow faster copying of objects (but it should actually be measured) but also contributes to the GC pressure (which, OTOH, should also be measured).
What I'm trying to say is that returning pointers is not necessarily the faster option,

Copy link
Contributor

Choose a reason for hiding this comment

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

note: I'd NOT resubmit just for this.

Copy link
Contributor Author

@PiotrProkop PiotrProkop Feb 10, 2023

Choose a reason for hiding this comment

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

I want to add tests, so I'll change it when I submit them.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 10, 2023
@PiotrProkop
Copy link
Contributor Author

@ffromani I had to change the way how we load Kubelet config when read from file to make e2e test working, previously we were just reading config from file and unamarshalling it to struct. This approach didn't fill out default values but were skipping it based on omitempty tag. In e2e tests we are reading Kubelet config via http, which is serving Kubeletconfig with all values filled 😄

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
very nice work @PiotrProkop !

test/e2e/utils/noderesourcetopology.go Show resolved Hide resolved
pkg/utils/kubeconf/kubelet_config_file.go Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 10, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: cf5ca6af5a40979ec18eeb7c6c25c66044a32135

@PiotrProkop
Copy link
Contributor Author

/assign @marquiz for final approval

@marquiz
Copy link
Contributor

marquiz commented Feb 10, 2023

Thanks @PiotrProkop for the PR. I'll check this next week

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

@marquiz marquiz left a comment

Choose a reason for hiding this comment

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

Thanks @PiotrProkop, looks good to me now

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: marquiz, PiotrProkop

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 15, 2023
@PiotrProkop
Copy link
Contributor Author

@ffromani can you LGTM once more? I had to fix a small nit.

@ffromani
Copy link
Contributor

/lgtm

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

LGTM label has been added.

Git tree hash: 53ec60386c31adafa4e240cd9c1ffeaa60a3a18f

@k8s-ci-robot k8s-ci-robot merged commit 38cc370 into kubernetes-sigs:master Feb 15, 2023
@marquiz marquiz mentioned this pull request Apr 12, 2023
24 tasks
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants