-
Notifications
You must be signed in to change notification settings - Fork 247
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
topology-updater:compute pod set fingerprint #1049
topology-updater:compute pod set fingerprint #1049
Conversation
|
✅ Deploy Preview for kubernetes-sigs-nfd ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Welcome @jlojosnegros! |
Hi @jlojosnegros. 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 Once the patch is verified, the new status will be reflected by the 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. |
/cc |
/ok-to-test |
dd36774
to
6877401
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the PR! initial review.
Do we have plans to add integration/e2e tests?
@@ -172,7 +172,7 @@ func (w *nfdTopologyUpdater) Stop() { | |||
} | |||
} | |||
|
|||
func (w *nfdTopologyUpdater) updateNodeResourceTopology(zoneInfo v1alpha1.ZoneList) error { | |||
func (w *nfdTopologyUpdater) updateNodeResourceTopology(zoneInfo v1alpha1.ZoneList, annotations map[string]string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we shoudl evaluate here to wrap the args in a struct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed it to use ScanResponse
I could have created a new struct including all the params ( right now only ZoneList) but as this is a "private" method that is called only once it does not seems worthy.
} | ||
|
||
// NewPodResourcesScanner creates a new ResourcesScanner instance | ||
func NewPodResourcesScanner(namespace string, podResourceClient podresourcesapi.PodResourcesListerClient, kubeApihelper apihelper.APIHelpers) (ResourcesScanner, error) { | ||
func NewPodResourcesScanner(namespace string, podResourceClient podresourcesapi.PodResourcesListerClient, kubeApihelper apihelper.APIHelpers, podFingerprint bool) (ResourcesScanner, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also here we should consider to move args in a struct, but this can be deferred in a later PR
28a6141
to
abab034
Compare
fcb05bb
to
f941cd7
Compare
I think we should create a seperate PR that upgrades NRT api to |
good point! I'm fine with both approaches (and yes your suggestion is cleaner indeed) |
I just feel like we can easily miss important things we need to do with an upgrade like advertising Policies and Scope with Attributes 😄 |
Yes, thinking about it you're right. Let's split the update to its own PR |
Let's split this PR and create a new one only for NRT API update to |
var status podfingerprint.Status | ||
podFingerprintSign, err := computePodFingerprint(respPodResources, &status) | ||
if err != nil { | ||
klog.Errorf("podFingerprint: Unable to compute fingerprint %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we in this case remove the existing pod fingerprint attribute?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we in this case remove the existing pod fingerprint attribute?
I for myself I'm fine both ways. From the scheduler plugin perspective, clients consuming this attribute must tolerate either attribute disappearing (a previous update added, a later update removes) values and obsolete values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we are computing the ScanResponse. Podfingerprint attribute will not be added to the ScanResponse in case of an error.
Removing the existing attribute in the NTR should be done in the nfd-topology-updater's updateNodeResourceTopology
function, when updating the attribute list.
That can be done but will go agains this (#1049 (comment)) and will require some changes in the updateAttribute
function.
I understood that those changes will wait for the new utility functions in @ffromani 's PR
1bec609
to
d7106dd
Compare
d7106dd
to
f09aafb
Compare
for k, v := range check { | ||
ret = append(ret, v1alpha2.AttributeInfo{Name: k, Value: v}) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general I'd have squashed the fixing commit here. Codewise looks reasonnable.
f09aafb
to
f720f60
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
LGTM label has been added. Git tree hash: f46014c9128494f91dde8889772ada0f4f27f3c4
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this @jlojosnegros. I think the code is basically ready to be merged (I had one nit about the cmdline flag description).
However, I probably forgot to ask this before, but we need to update the documentation (docs/reference/topology-updater-commandline-reference.md
) to describe the new command line flag.
Also, could you add support for the new flag in the help chart:
- add smth like
topologyUpdater.podSetFingerprint
intodeployment/helm/node-feature-discovery/values.yaml
- use it in
deployment/helm/node-feature-discovery/templates/topologyupdater.yaml
- document the new helm parameter in
docs/deployment/helm.md
/test pull-node-feature-discovery-build-image-cross-generic |
We are gonna add new data to Scan response so better introduce a new ScanResponse struct as Scan return value to make it easier.
f720f60
to
7c39b10
Compare
deployment/helm/node-feature-discovery/templates/topologyupdater.yaml
Outdated
Show resolved
Hide resolved
Add an option to compute the fingerprint of the current pod set on each node. Report this new fingerprint using an attribute in NRT object.
7c39b10
to
b650150
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
updates to docs and helm chart seem good
LGTM label has been added. Git tree hash: 3a4c5d93b06792657da6f0b572eb7aa16ffb34ce
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jlojosnegros for the quick update. Looks good to me now 👍 If something's missing let's fix it in subsequent PRs
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ArangoGutierrez, jlojosnegros, marquiz 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 |
Add an option to compute the fingerprint of the current pod set on each node.
Report this new fingerprint using an attribute in new released
v1alpha2
NRT object.needs: #1053
address: #1048
see: this issue for more info about new NRT api version