node-feature-discovery icon indicating copy to clipboard operation
node-feature-discovery copied to clipboard

feat: add ability to export features for static node

Open vsoch opened this issue 5 months ago • 3 comments

Problem: We want to statically export NFD features for HPC. Solution: Add an nfd export features mode that allows for generation and export of static feature labels.

For the HPC use case, we want to be able to export static features, either to the screen (for inspection) or a file (for saving and use with a scheduler, or other compatibility checking algorithm). Adding support for this is fairly easy - we need to just add the subcommand. The usage is simple and intuitive:

# Export labels to the terminal for inspection
nfd export features

# Save to a file path
nfd export features --path features.json

The flag is also useful for cases beyond HPC when a quick inspection is desired. There are ways this could be extended (requesting specific groups or filters) but I think it's better to start simple.

This is a follow up of https://github.com/kubernetes-sigs/node-feature-discovery/pull/2170. If you'd like tests added, I did an attempt and it looks like the features aren't exposed in the test environment - we would need a mock. Please point me to an example for how to do that. Thanks!

vsoch avatar Jun 25 '25 15:06 vsoch

Hi @vsoch. 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 avatar Jun 25 '25 15:06 k8s-ci-robot

Deploy Preview for kubernetes-sigs-nfd ready!

Name Link
Latest commit 70131d2a9768db1c51971002fbe37666f7b5b781
Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-nfd/deploys/68b1d6a8a03a950008efa1ce
Deploy Preview https://deploy-preview-2183--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 project configuration.

netlify[bot] avatar Jun 25 '25 15:06 netlify[bot]

That's a nice functionality, not only for non-k8s use cases, but also for taking a snapshot of the node's state from the perspective of enabled features.

mfranczy avatar Jun 30 '25 11:06 mfranczy

/lgtm

ChaoyiHuang avatar Jul 18 '25 00:07 ChaoyiHuang

Ping @adrianchiris @zvonkok @ArangoGutierrez @marquiz we've gone through several rounds of review and have LGTM from the compatibility working group. Can any of you review this?

vsoch avatar Jul 23 '25 23:07 vsoch

/ok-to-test

ArangoGutierrez avatar Jul 24 '25 09:07 ArangoGutierrez

/test pull-node-feature-discovery-build-image-cross-generic

fmuyassarov avatar Jul 30 '25 19:07 fmuyassarov

/lgtm

fmuyassarov avatar Aug 29 '25 12:08 fmuyassarov

LGTM label has been added.

Git tree hash: 3550e71026ecb04e82ea603e382e519aa2204a5e

k8s-ci-robot avatar Aug 29 '25 12:08 k8s-ci-robot

/test pull-node-feature-discovery-verify-master

ArangoGutierrez avatar Aug 29 '25 16:08 ArangoGutierrez

@vsoch please check the failing test, PR is now approved

ArangoGutierrez avatar Aug 29 '25 16:08 ArangoGutierrez

LGTM label has been added.

Git tree hash: ab5182d1cfd0b36399167cdd4c2d287d278fe909

k8s-ci-robot avatar Aug 29 '25 17:08 k8s-ci-robot

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ArangoGutierrez, mfranczy, vsoch

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:
  • ~~OWNERS~~ [ArangoGutierrez]

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 avatar Aug 29 '25 17:08 k8s-ci-robot

Thanks to all! :tada:

vsoch avatar Aug 30 '25 02:08 vsoch