integ/kubernetes/plugins/isolcpus-device-plugin/files
Manoel Benedito Neto c15e3e1a3a Fix lint errors identified by Zuul pylint job
This commit fixes lint errors identified by Zuul after stx-integ-pylint
job is executed.

Test Plan:
PASS: stx-integ-pylint job is executed successfully.
PASS: Run "yamllint ." command on integ repo base directory. Observe
      that no lint errors of line-length, truthy, indentation,
      new-line-at-end-of-file and document-start are listed.
PASS: build-pkgs -a -c

Closes-Bug: 2011632
Change-Id: I4d8229b5de8c9d88ff2aab6169521ab377b5866c
Signed-off-by: Manoel Benedito Neto <manoel.beneditoneto@windriver.com>
2023-03-15 12:07:17 +00:00
..
intel/intel-device-plugins-for-kubernetes/pkg add isolcpus device plugin for kubernetes 2021-04-01 11:10:09 -06:00
kubernetes/pkg/kubelet add isolcpus device plugin for kubernetes 2021-04-01 11:10:09 -06:00
vendor Fix lint errors identified by Zuul pylint job 2023-03-15 12:07:17 +00:00
LICENSE add isolcpus device plugin for kubernetes 2021-04-01 11:10:09 -06:00
README.md add isolcpus device plugin for kubernetes 2021-04-01 11:10:09 -06:00
go.mod add isolcpus device plugin for kubernetes 2021-04-01 11:10:09 -06:00
go.sum add isolcpus device plugin for kubernetes 2021-04-01 11:10:09 -06:00
isolcpu.go add isolcpus device plugin for kubernetes 2021-04-01 11:10:09 -06:00
isolcpu_plugin.conf add isolcpus device plugin for kubernetes 2021-04-01 11:10:09 -06:00
isolcpu_plugin.service add isolcpus device plugin for kubernetes 2021-04-01 11:10:09 -06:00

README.md

Isolated CPUs Device Plugin for Kubernetes

About

This code implements a Kubernetes device plugin. The plugin detects all CPUs specified via "isolcpus=X" in the kernel boot args, and exports them to Kubernetes as custom devices using the deviceplugin API.

It makes heavy use of the Intel device plugin manager from github.com/intel/intel-device-plugins-for-kubernetes and credit is due to them for making a useful helper. A good example of how to use that framework can be found at https://github.com/intel/intel-device-plugins-for-kubernetes/blob/master/cmd/gpu_plugin/gpu_plugin.go

Implementation Notes

There are currently problems with using go modules for the deviceplugin API...it leads to an "go: error loading module requirements" error when running "go build". Accordingly, it was necessary to copy a number of files from external packages. As part of this work I also updated the deviceplugin API files to the latest versions to pick up in-development upstream changes.

The "intel/intel-device-plugins-for-kubernetes" subdirectory corresponds to "github.com/intel/intel-device-plugins-for-kubernetes".

The "kubernetes" subdirectory corresponds to "k8s.io/kubernetes"

In an ideal world, these two subdirectories would not be needed, and instead we would simply include the following imports in isolcpu.go:

"github.com/intel/intel-device-plugins-for-kubernetes/pkg/debug"
dpapi "github.com/intel/intel-device-plugins-for-kubernetes/pkg/deviceplugin"
pluginapi "k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1beta1"
"k8s.io/kubernetes/pkg/kubelet/cm/cpuset"

This would also require updating the Intel package to pick up the latest deviceplugin API so that the topology field is properly represented.

Build Notes

In order to avoid the need for a network connection to download dependencies at build time, I've chosen to include all the dependencies in the "vendor" directory. This is auto-generated by running "go mod vendor". The binary is then built with "go build -mod=vendor".