feat: add ability to export features for static node
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!
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.
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...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
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.
/lgtm
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?
/ok-to-test
/test pull-node-feature-discovery-build-image-cross-generic
/lgtm
LGTM label has been added.
/test pull-node-feature-discovery-verify-master
@vsoch please check the failing test, PR is now approved
LGTM label has been added.
[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
- ~~OWNERS~~ [ArangoGutierrez]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Thanks to all! :tada: