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

nfd-gc: Remove stale NRT objects #1700

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ozhuraki
Copy link
Contributor

@ozhuraki ozhuraki commented May 6, 2024

Remove stale NRT objects whose creator pod does not exist anymore.

Closes #1586

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ozhuraki
Once this PR has been reviewed and has the lgtm label, please assign marquiz for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 6, 2024
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 6, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @ozhuraki. 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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 6, 2024
Copy link

netlify bot commented May 6, 2024

Deploy Preview for kubernetes-sigs-nfd ready!

Name Link
🔨 Latest commit b5fee22
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-nfd/deploys/670eb02cb2c76d00083c3cb5
😎 Deploy Preview https://deploy-preview-1700--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 configuration.

@ArangoGutierrez
Copy link
Contributor

/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 May 8, 2024
pkg/nfd-gc/nfd-gc.go Outdated Show resolved Hide resolved
pkg/nfd-gc/nfd-gc.go Outdated Show resolved Hide resolved
pkg/nfd-gc/nfd-gc.go Outdated Show resolved Hide resolved
pkg/nfd-topology-updater/nfd-topology-updater.go Outdated Show resolved Hide resolved
@ozhuraki
Copy link
Contributor Author

@PiotrProkop @ArangoGutierrez

Thanks! Updated, please take a look

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 13, 2024
@ozhuraki
Copy link
Contributor Author

@PiotrProkop @ArangoGutierrez

Updated unit tests, please take a look

@PiotrProkop
Copy link
Contributor

@ozhuraki @ArangoGutierrez one question, if we upgrade NFD-gc on existing cluster with this feature, it would remove all NRTs in the cluster cause none of them, has the owner-pod labels? Is it acceptable? Even if NRTs would be recreated after some time automatically it can lead to some downtime for components leveraging NRTs like topo-aware-scheduler.
/cc @ffromani

@ozhuraki
Copy link
Contributor Author

@PiotrProkop
Thanks for the input. Yes, this would happen.

I updated it so that NRT is garbage collected only when it has label, please take a look.

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 @ozhuraki for the PR. A few comments from me below.

@PiotrProkop PTAL

pkg/nfd-gc/nfd-gc.go Outdated Show resolved Hide resolved
pkg/nfd-topology-updater/nfd-topology-updater.go Outdated Show resolved Hide resolved
pkg/nfd-topology-updater/nfd-topology-updater.go Outdated Show resolved Hide resolved
@ozhuraki
Copy link
Contributor Author

@marquiz
Thanks! Updated, please take a look

@ozhuraki ozhuraki requested a review from ArangoGutierrez July 4, 2024 10:43
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 for the update @ozhuraki. I identified a few possible race issues but those shouldn't be too hard to solve.

pkg/nfd-gc/nfd-gc.go Outdated Show resolved Hide resolved
pkg/nfd-topology-updater/nfd-topology-updater.go Outdated Show resolved Hide resolved
pkg/nfd-gc/nfd-gc.go Outdated Show resolved Hide resolved
pkg/nfd-gc/nfd-gc.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 26, 2024
Copy link

codecov bot commented Jul 26, 2024

Codecov Report

Attention: Patch coverage is 29.41176% with 12 lines in your changes missing coverage. Please review.

Project coverage is 39.52%. Comparing base (b9770b1) to head (665abb9).
Report is 142 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1700      +/-   ##
==========================================
- Coverage   39.84%   39.52%   -0.33%     
==========================================
  Files          80       80              
  Lines        6841     7170     +329     
==========================================
+ Hits         2726     2834     +108     
- Misses       3861     4075     +214     
- Partials      254      261       +7     
Files Coverage Δ
pkg/nfd-topology-updater/nfd-topology-updater.go 2.50% <0.00%> (-0.01%) ⬇️
pkg/nfd-gc/nfd-gc.go 32.69% <31.25%> (-0.17%) ⬇️

... and 14 files with indirect coverage changes

@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 Aug 26, 2024
@ozhuraki
Copy link
Contributor Author

@marquiz @PiotrProkop

Thanks for the help here and apologies, missed your comments.

Updated per your suggestion to solve the race and rebased, please take a look

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 27, 2024
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 23, 2024
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 24, 2024
pkg/nfd-topology-updater/nfd-topology-updater.go Outdated Show resolved Hide resolved
pkg/nfd-gc/nfd-gc.go Outdated Show resolved Hide resolved
pkg/nfd-gc/nfd-gc.go Show resolved Hide resolved
pkg/nfd-gc/nfd-gc.go Outdated Show resolved Hide resolved
Remove stale NRT objects whose creator pod does not exist anymore.

Signed-off-by: Oleg Zhurakivskyy <[email protected]>
@ozhuraki
Copy link
Contributor Author

@marquiz

Thanks for the useful input. Updated, please take a look

@ozhuraki ozhuraki requested a review from marquiz October 15, 2024 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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.

Improve nfd-gc on NodeResourceTopology objects
5 participants