1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00
Commit graph

276 commits

Author SHA1 Message Date
Carlos Eduardo Arango Gutierrez
62f4eddce6
Drop support for hooks
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
2024-11-04 14:50:07 +01:00
Evan Lezar
b6b1335ec1 Move testdata to root
Go mod automatically ignores the /testdata directory.
This change ensures that the rootfs for source/pci tests are not
included in the module definition.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
2024-10-21 20:01:10 +02:00
Kubernetes Prow Robot
353ad403d6
Merge pull request #1856 from ozhuraki/bonding-masters
source/network: Ignore bonding_masters interface during scanning
2024-09-18 19:16:44 +01:00
Kazuki Suda
7f6669eb92
source/system: Add reading product name information 2024-09-10 14:42:08 +09:00
Oleg Zhurakivskyy
21395cb5c3 source/network: Ignore bonding_masters interface during scanning
On Talos OS NFD logs constantly show errors related
to the network attributes of bonding_masters.

Closes: 1842

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2024-08-28 14:55:33 +03:00
TessaIO
316fe71918 fix: take into consideration possibility of having empty line in swap file
Signed-off-by: TessaIO <ahmedgrati1999@gmail.com>
2024-07-11 22:02:39 +02:00
Markus Lehtonen
b5b701fbbf Simplify code
Drop unnecessry typedefs.
2024-07-09 09:05:33 +03:00
Kubernetes Prow Robot
4136a69545
Merge pull request #1715 from marquiz/devel/avx10-deprecate
source/cpu: disable AVX10 label
2024-05-24 04:53:59 -07:00
Markus Lehtonen
ece6076dd4 source/cpu: disable AVX10 label
Disable AVX10 as unnecessary as AVX10_LEVEL is better suited for
checking AVX10 compatibility. There is not yet any hardware with the
feature so disabling it shouldn't cause problems for users.
2024-05-24 13:50:46 +03:00
Markus Lehtonen
fa2f008d18 cpu: advertise AVX10 version
Add new cpuid label "feature.node.kubernetes.io/cpu-cpuid.AVX10_VERSION"
that advertises the supported version of AVX10 vector ISA.
Correspondingly, the patch adds AVX10_VERSION to the "cpu.cpuid" feature
for NodeFeatureRules to consume.

This makes cpu.cpuid on amd64 architecture a "multi-type" feature in
that it contains "flags" and potentially also "attributes" (the only
cpuid attribute so far is the AVX10_VERSION).
2024-05-24 13:48:20 +03:00
Kubernetes Prow Robot
814255b7f1
Merge pull request #1671 from marquiz/devel/nfd-api-multi-type-feature
apis/nfd: allow different types of features of the same name
2024-05-24 03:42:30 -07:00
Markus Lehtonen
bb565c0949 source: allow multi-type features
Allow multiple types of features (flags, attributes, instances) under
the same name.
2024-05-24 13:18:31 +03:00
Markus Lehtonen
ce66121d3c source/kernel: silence misleading error on selinux detection
Silence a irrelevant error that was printed in case /sys/fs/selinux/
directory exists but selinuxfs is not mounted (i.e. the dir is empty).
2024-05-02 11:07:23 +03:00
Markus Lehtonen
719c5186f6 api/nfd: use varargs in the NewInstanceFeatures helper
Make usage of this helper function more flexible.
2024-04-23 10:29:24 +03:00
Carlos Eduardo Arango Gutierrez
3434557d7c
Move NFD api to a separate go mod
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
2024-04-05 16:35:47 +02:00
Kubernetes Prow Robot
797fada92e
Merge pull request #1585 from kannon92/add-swap-support
add swap support in nfd
2024-03-18 04:19:48 -07:00
Markus Lehtonen
a562a6188a Update auto-generated code 2024-03-11 12:18:32 +02:00
Peng Wang
12ee13dabb fix hook issue 2024-03-05 04:13:08 +00:00
Kevin Hannon
187f65f94e Add swap support in nfd 2024-02-19 10:20:56 -05:00
Markus Lehtonen
36b4315173 source/cpu: fix build tags on rdt discovery
Our current code only builds/works on linux.
2024-02-19 16:40:18 +02:00
Kubernetes Prow Robot
2914bff8b3
Merge pull request #1574 from ozhuraki/system-vendor
source/system: Add reading vendor information
2024-02-19 06:17:27 -08:00
Oleg Zhurakivskyy
2f62aed06d source/system: Add reading vendor information
Add reading vendor information from /sys/devices/virtual/dmi/id/sys_vendor

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2024-02-19 15:40:31 +02:00
Markus Lehtonen
394144829d source/pci: add testdata for the unit tests
Add mock sysfs entries for testing PCI device discovery.
2024-02-15 23:29:34 +02:00
Markus Lehtonen
24a69b0989 source/pci: add unit test for the pci source
Test PCI feature discovery against a mocked sysfs.
2024-02-15 23:29:34 +02:00
Markus Lehtonen
32b1088f84 source/kernel: add unit tests for kernel version parsing 2024-02-15 14:44:18 +02:00
mantramantra12
ea4504a916
Prevent nfd-worker erroring when reading attributes from paravirtual devices (#1557)
* prevent erroring on paravirtual devices

* Use `errors.Is()` for error checking

Co-authored-by: Markus Lehtonen <markus.lehtonen@intel.com>

* add imports

---------

Co-authored-by: Markus Lehtonen <markus.lehtonen@intel.com>
2024-01-23 22:20:43 +01:00
Markus Lehtonen
57b7a3c6a8 Wrap nested errors 2024-01-22 22:45:15 +02:00
Kubernetes Prow Robot
2694448a7f
Merge pull request #1530 from marquiz/devel/rdt
source/cpu: drop deprecated cpu-rdt labels
2024-01-16 11:08:18 +01:00
Kubernetes Prow Robot
b72000b933
Merge pull request #1505 from AhmedGrati/chore-refactor-topology-discover
chore: combine cpu count and thread_siblings functions into discover topology function
2024-01-16 11:08:09 +01:00
Markus Lehtonen
887f208f5d source/network: discover speed of virtual network interfaces 2024-01-04 14:14:56 +02:00
Markus Lehtonen
cd18fe8970 source/cpu: drop deprecated cpu-rdt labels
Drop RDT labels that were deprecated in NFD v0.13. The RDT features
remain available for NodeFeatureRules to serve custom labeling.
2023-12-22 17:29:00 +02:00
Markus Lehtonen
97bf841140 apis/nfd: split rule processing into a separate package
This patch tidies up the nfdv1alpha1 API package by refactoring out the
implementation of (NodeFeature)Rule evaluation into a separate package.
2023-12-20 12:52:15 +02:00
AhmedGrati
f962698c14 chore: combine cpu count and thread_siblings functions into discover topology function
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-12-18 16:29:38 +01:00
Markus Lehtonen
a8092927fc source/custom: use internal api for config parsing
Change the custom feature source of nfd-worker to use the newly added
internal config API for its own configuration. It now uses the internal
types for json/yaml unmarshalling but converts them to external
nfdv1alpha1 API to do the actual rule matching as the internal API does
not duplicate that functionality.
2023-12-18 15:19:19 +02:00
Markus Lehtonen
185b406ee7 source/custom: add internal rule api
Add internal API for the nfd-worker custom feature source rule
configuration. This API has already diverged from the NFD
NodeFeatureRule API in that annotations, extended resources or taints
are not supported. This patch basically copies the Rule type (and it's
sub-types) from the nfdv1alpha1 package. It also adds conversion
functions from the internal rule API to the "external" nfdv1alpha1 API.
This is done to use the same rule matching functionality (from the
nfdv1alpha1 package).

One notable remark is that the feature source rule config supports some
custom formatting (short forms, multi-type fields) that relies on
special json/yaml unmarshalling functions that are better to nuke from
the nfdv1alpha1 package (in another patch). These (legacy) syntax
specialities are most probably used by nobody but let's keep them as
they're already there.  Unit tests to cover the custom json
unmarshalling are now added.
2023-12-18 15:19:19 +02:00
Kubernetes Prow Robot
3ea2a38d73
Merge pull request #1497 from AhmedGrati/feat-add-cpu-socket-number
feat: add cpu socket count in `cpu.topology`
2023-12-15 13:29:51 +01:00
AhmedGrati
ebb08369d3 feat: add cpu socket number in cpu.topology
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-12-15 11:04:42 +01:00
Markus Lehtonen
fe412a54b9 apis/nfd: add matchName field in feature matcher terms
Extend the format of feature matcher terms (the elements of the
arrayspecified under under matchFeatures field) with new matchName
field. The value of this field is an expression that is evaluated
against the names of feature elements instead of their values (values
are matched with the matchExpressions field, instead).

The matchName field is useful e.g. in template rules for creating
per-feature-element labels based on feature names (instead of values)
and in non-template rules for checking if (at least) one of certain
feature element names are present.

If both matchExpressions and matchName for certain feature matcher term
is specified, they both must match in order to get an overall match.
Also, in this case the list of matched features (used in templating) is
the union of the results from matchExpressions and matchName.

An example of creating an "avx512" label if any AVX512* CPUID feature is
present:

  - name: "avx wildcard rule"
    labels:
        avx512: "true"
    matchFeatures:
      - feature: cpu.cpuid
        matchName: {op: InRegexp, value: ["^AVX512"]}

An example of a template rule creating a dynamic set of labels  based on
the existence of certain kconfig options.

  - name: "kconfig template rule"
    labelsTemplate: |
      {{ range .kernel.config }}kconfig-{{ .Name }}={{ .Value }}
      {{ end }}
    matchFeatures:
      - feature: kernel.config
        matchName: {op: In, value: ["SWAP", "X86", "ARM"]}

NOTE: this patch changes the corner case of nil/null match expressions
with instance features (i.e. "matchExpressions: null"). Previously, we
returned all instances for templating but now a nil match expression is
not evaluated and no instances for templating are returned.
2023-12-15 11:32:23 +02:00
Markus Lehtonen
0bc1b6c28f apis/nfd: drop creation helper functions
Drop the creation helper functions as one step in an effort to tidy up
the api package. These functions were not much used outside unit tests
anyway, the static rules of the nfd-worker custom feature source being
the only exception (and if those happened to be invalid we'd catch that
e.g. in the e2e-tests).
2023-12-14 15:54:51 +02:00
Markus Lehtonen
cb0a46ec0e Use generics for maps and slices 2023-12-13 12:09:53 +02:00
AhmedGrati
6aa6590665 docs: add network.virtual in customization guide
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-11-09 16:44:30 +01:00
AhmedGrati
ae08e5998f feat: discover virtual network interfaces
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-11-05 19:46:33 +01:00
Markus Lehtonen
eebd246bd7 source/network: refactor readIfaceInfo
Make the function more generic and re-usable.
2023-11-03 13:51:17 +02:00
Markus Lehtonen
7d1df87305 source/custom: drop support for the legacy rule format 2023-10-05 16:15:37 +03:00
AhmedGrati
3130898d58 feat: support raw features
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-10-04 22:37:42 +01:00
AhmedGrati
6c895b496a feat: ignore hidden feature files
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-09-11 15:11:31 +01:00
Kubernetes Prow Robot
b7aa0b2273
Merge pull request #1351 from marquiz/devel/local-refactor
source/local: simplify feature file size checking
2023-09-08 07:10:17 -07:00
Markus Lehtonen
a5e78f0849 source/local: simplify feature file size checking 2023-09-08 15:05:31 +03:00
Markus Lehtonen
c126764d7a cpu: drop the deprecated sgx and se labels
Drop the deprecated cpu-sgx.enabled and cpu-se.enabled labels and the
corresponding "raw" features. These have been replaced by
cpu-security.sgx.enabled and cpu-security.se.enabled.
2023-09-08 14:28:04 +03:00
Markus Lehtonen
b1b3061738 sources/custom: convert static rules to new format
Also add a log message warning about legacy rule format.
2023-09-06 14:29:56 +03:00