1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-15 17:50:49 +00:00
Commit graph

39 commits

Author SHA1 Message Date
Mikko Ylinen
52a14675ae go.mod: update to klauspost/cpuid/v2@v2.0.11
The new version adds Control-flow Enforcement Technology (CET)
bits detection.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-02-08 11:24:00 +02:00
Markus Lehtonen
d1bd603052 go.mod: bump kubernetes to v1.23.1
Update k/k to the latest release and sync all related dependencies.

Align e2e-tests with changes in the k8s e2e test framework.
2022-01-12 16:43:21 +02:00
Markus Lehtonen
c3e2315834 pkg/apis/nfd: specify CRD for custom labeling rules
Add a cluster-scoped Custom Resource Definition for specifying labeling
rules. Nodes (node features, node objects) are cluster-level objects and
thus the natural and encouraged setup is to only have one NFD deployment
per cluster - the set of underlying features of the node stays the same
independent of how many parallel NFD deployments you have. Our extension
points (hooks, feature files and now CRs) can be be used by multiple
actors (depending on us) simultaneously. Having the CRD cluster-scoped
hopefully drives deployments in this direction. It also should make
deployment of vendor-specific labeling rules easy as there is no need to
worry about the namespace.

This patch virtually replicates the source.custom.FeatureSpec in a CRD
API (located in the pkg/apis/nfd/v1alpha1 package) with the notable
exception that "MatchOn" legacy rules are not supported. Legacy rules
are left out in order to keep the CRD simple and clean.

The duplicate functionality in source/custom will be dropped by upcoming
patches.

This patch utilizes controller-gen (from sigs.k8s.io/controller-tools)
for generating the CRD and deepcopy methods. Code can be (re-)generated
with "make generate". Install controller-gen with:

  go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.7.0

Update kustomize and helm deployments to deploy the CRD.
2021-11-17 13:40:23 +02:00
Markus Lehtonen
d4d9a03732 grpc: extend the API to send raw features
Enable transmitting the discovered "raw" features over the gRPC API.

Extend pkg/api/feature with protobuf and gRPC code. In this, utilize
go-to-protobuf from k8s code-generator for auto-generating the gRPC
interface from golang code. The tool can be Installed with:

  go install k8s.io/code-generator/cmd/go-to-protobuf@v0.20.7

The auto-generated code is (re-)generated/updated with "make apigen".
2021-11-16 17:32:28 +02:00
Swati Sehgal
b444ef95a8 NFD-Topology-Updater: Bump NRT API to version v0.0.12
The NodeResourceTopology API has been made cluster
scoped as in the current context a CR corresponds to
a Node and since Node is a cluster scoped resource it
makes sense to make NRT cluster scoped as well.

Ref: https://github.com/k8stopologyawareschedwg/noderesourcetopology-api/pull/18
Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
2021-11-16 13:28:23 +00:00
Markus Lehtonen
9d1eea243b Bump to golang v1.17 2021-10-21 14:16:55 +03:00
Swati Sehgal
a311719d1e topologyupdater: Updates based on latest changes made to CRD API
There have been recent changes made to the noderesourcetopology API
storing the proto file generated using go-to-protobuf tool and
this code inports the proto generated in the API in the topology-updater.proto
The PRs corresponding to the changes are as follows:
https://github.com/k8stopologyawareschedwg/noderesourcetopology-api/pull/9
https://github.com/k8stopologyawareschedwg/noderesourcetopology-api/pull/13

Commands used to generate topology-updater.pb.go file:

go install github.com/golang/protobuf/protoc-gen-go@v1.4.3
go mod vendor
protoc --go_opt=paths=source_relative  --go_out=plugins=grpc:. pkg/topologyupdater/topology-updater.proto -I. -Ivendor

As part of implmentation of this patch, reserved (non-allocatable) CPUs
are evaluated by performing a difference between all the CPUs on a system
(determined by using ghw) and allocatable CPUs (determined by querying
GetAllocatableResources podResource API endpoint).

When aggregator creates the NUMA zones, it will skip the zone creation if
there are no allocatable resources. In this update we creates those missing
zone with zero allocatable/available resources so we won't have holes in the
array of reported zones.

Co-Authored-by: Talor Itzhak <titzhak@redhat.com>
Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
2021-09-21 10:48:10 +01:00
Francesco Romani
b4c92e4eed topologyupdater: Bootstrap nfd-topology-updater in NFD
- This patch allows to expose Resource Hardware Topology information
  through CRDs in Node Feature Discovery.
- In order to do this we introduce another software component called
  nfd-topology-updater in addition to the already existing software
  components nfd-master and nfd-worker.
- nfd-master was enhanced to communicate with nfd-topology-updater
  over gRPC followed by creation of CRs corresponding to the nodes
  in the cluster exposing resource hardware topology information
  of that node.
- Pin kubernetes dependency to one that include pod resource implementation
- This code is responsible for obtaining hardware information from the system
  as well as pod resource information from the Pod Resource API in order to
  determine the allocatable resource information for each NUMA zone. This
  information along with Costs for NUMA zones (obtained by reading NUMA distances)
  is gathered by nfd-topology-updater running on all the nodes
  of the cluster and propagate NUMA zone costs to master in order to populate
  that information in the CRs corresponding to the nodes.
- We use GHW facilities for obtaining system information like CPUs, topology,
  NUMA distances etc.
- This also includes updates made to Makefile and Dockerfile and Manifests for
  deploying nfd-topology-updater.
- This patch includes unit tests
- As part of the Topology Aware Scheduling work, this patch captures
  the configured Topology manager scope in addition to the Topology manager policy.
  Based on the value of both attribues a single string will be populated to the CRD.
  The string value will be on of the following {SingleNUMANodeContainerLevel,
  SingleNUMANodePodLevel, BestEffort, Restricted, None}

Co-Authored-by: Artyom Lukianov <alukiano@redhat.com>
Co-Authored-by: Francesco Romani <fromani@redhat.com>
Co-Authored-by: Talor Itzhak <titzhak@redhat.com>
Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
2021-09-21 10:47:39 +01:00
Francesco Romani
00cc07da76 topologyupdater: gRPC API definition
Setup the topologyupdater API for gRPC communication of
nfd-topology-updater with master

We generate pb.go file to reflect latest dependency changes
using github.com/golang/protobuf/protoc-gen-go and generate
grpc files via:
`protoc pkg/topologyupdater/topology-updater.proto --go_out=plugins=grpc:.`

Please refer to: https://github.com/k8stopologyawareschedwg/noderesourcetopology-api/blob/master/pkg/apis/topology/v1alpha1/types.go

Co-Authored-by: Artyom Lukianov <alukiano@redhat.com>
Co-Authored-by: Francesco Romani <fromani@redhat.com>
Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
2021-09-21 10:47:39 +01:00
Markus Lehtonen
321d07e338 go.mod: update golang.org/x/net 2021-08-12 10:54:58 +03:00
Markus Lehtonen
136e262799 go.mod: update kubernetes to v1.22.0
Update k/k to v1.22.0 and sync all related dependencies with it.
2021-08-12 10:28:57 +03:00
Carlos Eduardo Arango Gutierrez
824d0d9b29
Merge branch 'master' into devel/makefile-apigen 2021-08-04 11:04:41 -05:00
Mikko Ylinen
c64493cae4 go.mod: update to klauspost/cpuid/v2@v2.0.9
The new version adds AVX512-FP16 (half precision floating-point)
support available on Sapphire Rapids.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2021-08-02 13:49:25 +03:00
Markus Lehtonen
69f89b249c go.mod: update dependencies 2021-07-07 16:01:10 +03:00
Markus Lehtonen
ad7df36a08 go.mod: update dependencies 2021-07-06 14:40:29 +03:00
Markus Lehtonen
44a385aff5 go.mod: update kubernetes to v1.21.2 2021-07-06 14:02:04 +03:00
Markus Lehtonen
307299f932 go.mod: update and tidy some non-k8s dependencies 2021-03-30 21:51:10 +03:00
Markus Lehtonen
7236759047 go.mod: update k8s to v1.20.5 2021-03-30 21:51:01 +03:00
Carlos Eduardo Arango Gutierrez
11c21a1277
bump to go 1.16
Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
2021-03-24 10:00:36 -05:00
Markus Lehtonen
3ffb7b8fc5 nfd-master: switch to klog 2021-02-25 07:50:37 +02:00
Markus Lehtonen
3fd61eacdb nfd-worker: switch to flag in command line parsing 2021-02-24 12:06:16 +02:00
Kubernetes Prow Robot
a8c7135eda
Merge pull request #432 from marquiz/devel/config-watch
nfd-worker: use fsnotify for watching for config file changes
2021-02-11 02:14:15 -08:00
Carlos Eduardo Arango Gutierrez
89e6a9104f
Update gogo/protobuf and golang.org/x/text
Why:

- CVE-2020-28851
- CVE-2021-3121

Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
2021-02-10 16:13:51 -05:00
Markus Lehtonen
b6ff514853 nfd-worker: use fsnotify for watching for config file changes
Add support for detecting configuration file changes via file system
notifications (fsnotify). Watches are added for the whole directory
chain (up to root directory) so that all changes (even directory
renames) affecting the given configuration file path are captured.

Previously dynamic (re-)configuration of nfd-worker was implemented by
(re-)reading the configuration file on every labeling pass. This was
simple and effective, even if a bit wasteful. However, it didn't provide
asynchronous configuration updates that will be required for e.g.
controlling the "sleep-interval" parameter dynamically which will be
implemented by later patches.
2021-02-10 22:09:27 +02:00
Mikko Ylinen
07bc50d5a8 go.mod: update to klauspost/cpuid/v2@v2.02
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2020-12-15 15:56:15 +02:00
Mikko Ylinen
94f49b9418 go.mod: update klauspost/cpuid
The latest changes in klauspost/cpuid add detection for Sapphire Rapids
new instructions.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2020-11-30 19:04:41 +02:00
Markus Lehtonen
95ff300d74 nfd-master: patch node object instead of rewriting it
When updating node labels and annotations use JSON patches instead of
doing a read-modify-write on the whole node object. Patching is already
being used in managing extended resources so some of the existing code
was re-usable.

This patch should mitigate the problem of node update failures caused by
race conditions (a change in the node object between our read and write)
resulting e.g. in errors/restarts in nfd worker pods.
2020-11-24 12:45:06 +02:00
Carlos Eduardo Arango Gutierrez
c4515b94ab
Go 1.15
this patch bumps both the Dockerfile and go.mod go version to 1.15

Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
2020-11-18 09:38:13 -05:00
Artyom Lukianov
6172c648e2 Update k8s dependencies to 1.19.4
Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
2020-11-18 13:09:13 +02:00
Kubernetes Prow Robot
8cb09630d4
Merge pull request #329 from ArangoGutierrez/4.6-CVE-2020-14040
Update go dep golang.org/x/text
2020-08-30 23:46:20 -07:00
Carlos Eduardo Arango Gutierrez
aa7e0e1dc9
Update go dep golang.org/x/text
Update go dep golang.org/x/text

    CVE-2020-14040

golang.org/x/text: possibility to trigger an infinite loop in
encoding/unicode could lead to crash
Reported on Bug 1853652

Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
2020-08-28 10:27:14 -05:00
Carlos Eduardo Arango Gutierrez
b852e5cce5
Update go to 1.14.7
Bumb golang version to 1.14.7

Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
2020-08-28 08:39:23 -05:00
Markus Lehtonen
6344656d54 go.mod: tidy 2020-05-19 11:05:02 +03:00
Markus Lehtonen
409dc11389 Switch to sigs.k8s.io/yaml
Replace github.com/ghodss/yaml.
2020-04-23 16:54:14 +03:00
Carlos Eduardo Arango Gutierrez
3e1e1a944b
Update go version to 1.13.5
Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
2020-02-05 16:15:44 -05:00
Markus Lehtonen
974310251c test/e2e: adapt new wireframe to nfd context
Adapt the end-to-end test wireframe (copied from Kubernetes in the
previous commit) to node-feature-discovery.
2020-02-05 19:35:41 +02:00
Markus Lehtonen
2ad4ab708c go.mod: update kubernetes and its deps to v1.17.2 2020-02-05 17:01:53 +02:00
Antti Kervinen
d3d13347f8 vendor: update klauspost/cpuid
Update cpuid from v1.2.2 to v1.2.3. Brings in SGX improvements and
CPUID leaf 7 feature detection (VBMI2, VPOPCNTDQ, GFNI, VAES,
AVX512BITALG, VPCLMULQDQ, AVX512BF16, AVX512VP2INTERSECT). Blacklist
cpuid-SGX* (issue #130).

Signed-off-by: Antti Kervinen <antti.kervinen@intel.com>
2020-01-29 14:51:44 +02:00
Markus Lehtonen
67ddd87c41 Switch to using go modules
Update go version in Docker build image to v1.12.
2019-11-20 18:38:42 +02:00