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

385 commits

Author SHA1 Message Date
Alexander Kanevskiy
eb8fe6393a Update builder image to Go 1.13.12
Go versions after 1.13.7 contain fix for CVE-2020-7919
2020-07-10 14:24:01 +03:00
Kubernetes Prow Robot
c2503a20ab
Merge pull request #319 from marquiz/devel/v0.6.0
Use release v0.6.0 in deployment templates and README
2020-05-28 08:58:03 -07:00
Markus Lehtonen
5e62ced4d8 Use release v0.6.0 in deployment templates and README 2020-05-26 15:08:31 +03:00
Kubernetes Prow Robot
1b84e19024
Merge pull request #323 from marquiz/devel/docs
README: document E2E_TEST_CONFIG Makefile variable
2020-05-26 04:33:11 -07:00
Markus Lehtonen
32290ea8f8 README: document E2E_TEST_CONFIG Makefile variable 2020-05-25 10:38:54 +03:00
Kubernetes Prow Robot
59a88b07e1
Merge pull request #322 from adaptant-labs/cpuid-arm
cpu: Add support for ARM/Aarch32 cpuid
2020-05-24 23:35:11 -07:00
Kubernetes Prow Robot
fd1275a7e1
Merge pull request #317 from marquiz/devel/network
source/network: run discovery under /host-sys
2020-05-21 10:52:15 -07:00
Paul Mundt
4d5b5974df cpu: Add support for ARM/Aarch32 cpuid
This provides support for 32-bit ARM cpuid capabilities based on
the HWCAP flags, and enables the build of NFD on the 32-bit ARM
userland - notably, this also applies to ARM64 systems that are
running userspace in Aarch32 mode, which is where this problem
was first encountered.

Signed-off-by: Paul Mundt <paul.mundt@adaptant.io>
2020-05-21 19:42:44 +02:00
Markus Lehtonen
d216fca1c0 source/network: run discovery under host sysfs
Instead of relying on golang "net" package, use the configured host
sysfs for all discovery. No need to use hostNetwork after that so drop
it from the worker deployment templates.
2020-05-21 20:33:30 +03:00
Kubernetes Prow Robot
e9017bef06
Merge pull request #304 from marquiz/devel/config-reload
Rework config handling
2020-05-21 03:10:36 -07:00
Markus Lehtonen
2620e650bf README: document nfd-worker run-time re-configurability 2020-05-21 00:59:39 +03:00
Markus Lehtonen
9e813a559c nfd-worker: reload config on each re-discovery pass
Dumb re-read/re-parse of the configuration file on every round of
discoery. Probably not the most elegant solution to watch for config
file changes, but, it works and doesn't cost much overhead.
2020-05-21 00:59:39 +03:00
Markus Lehtonen
a2b9df5cd3 nfd-worker: rework configuration handling
Extend the FeatureSource interface with new methods for configuration
handling. This enables easier on-the fly reconfiguration of the
feature sources. Further, it simplifies adding config support to feature
sources in the future. Stub methods are added to sources that do not
currently have any configurability.

The patch fixes some (corner) cases with the overrides (--options)
handling, too:
- Overrides were not applied if config file was missing or its parsing
  failed
- Overrides for a certain source did not have effect if an empty config
  for the source was specified in the config file. This was caused by
  the first pass of parsing (config file) setting a nil pointer to the
  source-specific config, effectively detaching it from the main config.
  The second pass would then create a new instance of the source
  specific config, but, this was not visible in the feature source, of
  course.
2020-05-21 00:59:37 +03:00
Markus Lehtonen
c95ad3198c nfd-worker: refactor handling of enabled sources and labels
Make the list of enabled sources and the label whitelist regexp members
of the nfdWorker instance. Get rid of the not-that-well-defined
configureParameters() function.
2020-05-21 00:48:21 +03:00
Kubernetes Prow Robot
ad5eef1514
Merge pull request #307 from marquiz/devel/label-whitelist
nfd-worker: fix --label-whitelist
2020-05-20 13:54:20 -07:00
Markus Lehtonen
c24885840c Better document the --label-whitelist flag 2020-05-20 23:19:09 +03:00
Markus Lehtonen
818fc4cc70 nfd-worker: fix --label-whitelist
Unify handling of --label-whitelist in nfd-worker and nfd-master. That is,
in nfd-worker, apply the regexp filter on non-namespaced part of the
label name.

Brief history:
1. Originally the whitelist regexp was applied on the full namespaced
   label name (that would be e.g.
   'feature.node.kubernetes.io/cpu-cpuid.AVX' in the current nfd version)

2. Commit 81752b2d changed the behavior so that the regexp was applied
   on the non-namespaced part (that would be `cpu-cpuid.AVX`)

3. Commit 40918827 added support for custom label namespaces. With this
   change, the label whitelist handling diverged between nfd-worker and
   nfd-master. In nfd-master the whitelist regexp is always applied on
   the non-namespaced label name. However, in nfd-worker the whitelist
   handling is two-fold (and inconsistent): for labels in the standard
   nfd namespace regexp is applied on the non-namespaced part (e.g.
   `cpu-cpuid.AVX`, but, for labels in custom namespaces the regexp is
   applied on the full name (e.g. `example.com/my-feature`).

This patch changes nfd-worker to behave similarly to nfd-master. The
namespace part is now always omitted, which should be easier for the
users to comprehend.

Also, fixes a bug in the label name prefixing so that the name of the
feature source is not prefixed into labels with custom label namespace
(effectively mangling the intended namespace). For example, previously a
'example.com/feature' label from the 'custom' feature source would be
prefixed with the source name, mangling it to
'custom-example.com/feature'.
2020-05-20 23:07:13 +03:00
Kubernetes Prow Robot
e09db73614
Merge pull request #318 from marquiz/devel/sysfs
source: parametrise host directory paths
2020-05-20 13:04:20 -07:00
Markus Lehtonen
704c81a4d2 Make host mount prefix configurable in Makefile and Dockerfile
Introduce a new makefile variable and dockerfile build arg named
HOSTMOUNT_PREFIX for changing the prefix used for mounting host
directories inside the container. Adds a sed rule in Makefile to
generate deployment yamls accordingly.
2020-05-20 22:15:41 +03:00
Markus Lehtonen
67d7887949 source: perform all sysfs discovery under host sysfs
Be consistent and do all sysfs based feature discovery under the same
sysfs directory.
2020-05-20 22:15:41 +03:00
Markus Lehtonen
248859c64d source: parametrise host directory paths
Specify and handle system paths we use for discovery in a unified way.
2020-05-20 22:15:41 +03:00
Kubernetes Prow Robot
f65def9460
Merge pull request #315 from marquiz/devel/lint
Verify golangci-lint
2020-05-20 12:08:19 -07:00
Kubernetes Prow Robot
a8fc2c3531
Merge pull request #320 from Ethyling/fix-gofmt-usb
source/custom: minor change in usb rule for gofmt
2020-05-20 12:02:19 -07:00
Markus Lehtonen
a7dc63e091 travis: add ci-lint check
Build fails if lint does not pass muster.
2020-05-20 21:48:06 +03:00
Markus Lehtonen
640dc9fbf3 source: miscellaneous lint fixes 2020-05-20 21:48:06 +03:00
Markus Lehtonen
057f31d7e3 fsource/local: lint fixes 2020-05-20 21:48:06 +03:00
Markus Lehtonen
a65d05bd9c source/panic_fake: rename module to make lint happy 2020-05-20 21:48:06 +03:00
Markus Lehtonen
853609f721 nfd-master: lint fixes 2020-05-20 21:48:06 +03:00
Markus Lehtonen
80becea590 source/custom: make linter happy
Might not agree with all that naming arbitrariness but it's easier just
to bend over.
2020-05-20 21:48:06 +03:00
Markus Lehtonen
523aa894a3 pkg/cpuid: lint fixes 2020-05-20 21:48:06 +03:00
Markus Lehtonen
2f4e038f10 test/e2e: drop dot imports
Make linter happy.
2020-05-20 21:48:06 +03:00
Markus Lehtonen
73602e8f28 test/e2e: goling fixes 2020-05-20 21:48:06 +03:00
Markus Lehtonen
705d17b9f1 cmd: replace deprecated docopt.Parse with ParseArgs 2020-05-20 21:48:06 +03:00
Markus Lehtonen
c7b1d67b6b nfd-worker: drop deprecated grpc.WithTimeout 2020-05-20 21:48:06 +03:00
Markus Lehtonen
91f3ddcc45 nfd-worker: lint fixes 2020-05-20 21:48:06 +03:00
Markus Lehtonen
4e04d1d61c Makefile: add ci-lint target
Use golangci-lint to make use of a number of different linters.
2020-05-20 21:48:06 +03:00
Jordan Jacobelli
e3a9616c8b source/custom: minor change in usb rule for gofmt
Signed-off-by: Jordan Jacobelli <jordanjacobelli04@gmail.com>
2020-05-20 19:15:20 +02:00
Kubernetes Prow Robot
67b3da2f31
Merge pull request #314 from marquiz/devel/gofmt
Check gofmt
2020-05-20 09:42:19 -07:00
Kubernetes Prow Robot
48a558a16c
Merge pull request #312 from marquiz/devel/gomod
go.mod: tidy
2020-05-20 09:28:20 -07:00
Kubernetes Prow Robot
589b974985
Merge pull request #311 from marquiz/devel/ignores
Update gitignore and dockerignore
2020-05-20 08:40:18 -07:00
Kubernetes Prow Robot
b2d44d0f2a
Merge pull request #316 from marquiz/devel/docs-annotations
README: document node annotations
2020-05-20 08:36:19 -07:00
Kubernetes Prow Robot
1ba75bfd7c
Merge pull request #310 from adaptant-labs/usb-discovery
Add support for USB device discovery
2020-05-20 08:26:19 -07:00
Paul Mundt
c0ea69411b usb: Add support for USB device discovery
This builds on the PCI support to enable the discovery of USB devices.

This is primarily intended to be used for the discovery of Edge-based
heterogeneous accelerators that are connected via USB, such as the Coral
USB Accelerator and the Intel NCS2 - our main motivation for adding this
capability to NFD, and as part of our work in the SODALITE H2020
project.

USB devices may define their base class at either the device or
interface levels. In the case where no device class is set, the
per-device interfaces are enumerated instead. USB devices may
furthermore have multiple interfaces, which may or may not use the
identical class across each interface. We therefore report device
existence for each unique class definition to enable more fine-grained
labelling and node selection.

The default labelling format includes the class, vendor and device
(product) IDs, as follows:

	feature.node.kubernetes.io/usb-fe_1a6e_089a.present=true

As with PCI, a subset of device classes are whitelisted for matching.
By default, there are only a subset of device classes under which
accelerators tend to be mapped, which is used as the basis for
the whitelist. These are:

	- Video
	- Miscellaneous
	- Application Specific
	- Vendor Specific

For those interested in matching other classes, this may be extended
by using the UsbId rule provided through the custom source. A full
list of class codes is provided by the USB-IF at:

	https://www.usb.org/defined-class-codes

For the moment, owing to a lack of a demonstrable use case, neither
the subclass nor the protocol information are exposed. If this
becomes necessary, support for these attributes can be trivially
added.

Signed-off-by: Paul Mundt <paul.mundt@adaptant.io>
2020-05-20 16:18:39 +02:00
Markus Lehtonen
e8a15b59ab README: document node annotations
Shortly describe node annotations created/managed bu NFD.
2020-05-19 19:50:42 +03:00
Markus Lehtonen
3185393141 travis: verify gofmt 2020-05-19 14:29:55 +03:00
Markus Lehtonen
1a2f54367e source/cpu: mangle through gofmt 2020-05-19 14:28:07 +03:00
Markus Lehtonen
447eee261d Makefile: add gofmt and gofmt-verify targets
For re-formatting the code and checking that we comply.

Inspired by what we have in node-feature-discovery-operator.
2020-05-19 14:24:44 +03:00
Markus Lehtonen
6344656d54 go.mod: tidy 2020-05-19 11:05:02 +03:00
Markus Lehtonen
4c1a57f2fe dockerignore: tidy up and update
Drop outdated items and add example deployment yaml files.
2020-05-19 10:13:54 +03:00
Markus Lehtonen
e59d4e6018 gitignore: tidy up
Drop outdated patterns.
2020-05-19 10:12:13 +03:00