Commit Graph

72 Commits

Author SHA1 Message Date
Ukri Niemimuukko
ff2768e384 enable getPreferredAllocation
The option was left to false, this fixes it.

Signed-off-by: Ukri Niemimuukko <ukri.niemimuukko@intel.com>
2021-01-05 12:44:58 +02:00
Dmitry Rozhkov
49ba70744e api: improve code coverage 2020-12-30 12:09:00 +02:00
Ukri Niemimuukko
4c92093ca7 api: add PreferredAllocator interface
This adds a PreferredAllocator interface so that plugins can
optionally implement the API.

Signed-off-by: Ukri Niemimuukko <ukri.niemimuukko@intel.com>
2020-12-29 15:19:30 +02:00
Mikko Ylinen
3e7e818fb6
Merge pull request #518 from rojkov/full-operator-config-samples
operator: extend sample configs to include all possible specs
2020-12-21 20:53:21 +02:00
Dmitry Rozhkov
fdde9a8126 operator: extend sample configs to include all possible specs 2020-12-17 11:52:00 +02:00
Mikko Ylinen
d63037c2e1 Move to Admission v1 API
Update to controller-runtime v0.7.0 and Admission types to v1 with it.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2020-12-17 11:02:21 +02:00
Ed Bartosh
205722e53b topology: language cleanup
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2020-12-10 11:29:58 +02:00
Ed Bartosh
174643436a implement DSA plugin
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2020-12-03 17:24:48 +02:00
Dmitry Rozhkov
f0fa9df292 operator: prepare for publishing at operatorhub.io 2020-11-24 18:35:56 +02:00
Mikko Ylinen
d65cb902e6 sgx: move to RFC v4x device API
The SGX device nodes have changed from /dev/sgx/[enclave|provision]
to /dev/sgx_[enclave|provision] in v4x RFC patches according to the
LKML feedback.

This changes moves to use the new device nodes. Backwards compatibility
is provided by adding /dev/sgx directory mount to containers. This
assumes the cluster admin has installed the udev rules provided in the
README to make the old device nodes as symlinks to the new device nodes.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2020-11-18 21:17:28 +02:00
Dmitry Rozhkov
7e621f7905 upgrade controller-gen to v0.4.1
The new versions adds admissionReviewVersions annotation and makes it
mandatory.
2020-11-18 11:44:37 +02:00
Mikko Ylinen
5270dca027 sgx: add warnings to webhook
Warn users if sgx.intel.com/[enclave|provision] resources are
specified in the pod spec. Only sgx.intel.com/epc should be used
directly.

The warnings work only with kubernetes 1.19 and later.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2020-11-11 22:05:00 +02:00
Alexander D. Kanevskiy
75355c9937
Merge pull request #497 from bart0sh/PR0094-move-GetAPIVersion-out-of-NewPort
fpga: move GetAPIVersion call out of NewPort and NewFME
2020-11-11 12:09:13 +02:00
Ed Bartosh
2c73e2a0b3 fpga: move GetAPIVersion call out of NewPort and NewFME
This call is implemented by calling ioctl, which raises
"open /dev/intel-fpga-port.X: operation not permitted" error
when called inside unprivileged container.

This breaks FPGA plugin.

Calling this API from fpga_tool is still OK, so
moving calls there should fix the issue.

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2020-11-10 16:44:20 +02:00
Dmitry Rozhkov
5f0da56045 Upgrade to k8s v1.19.3 2020-11-10 16:09:20 +02:00
Ukri Niemimuukko
c935570bab operator: GPU-plugin initImage
This adds the initImage field to the custom resource definition
and takes it into use.

The fpga webhook image validation function is split off into a
separate file.

Signed-off-by: Ukri Niemimuukko <ukri.niemimuukko@intel.com>
2020-11-09 20:55:12 +02:00
Alexander Kanevskiy
d340ce45a7 Fix FPGA DFL Release/Assign ioctl numbers
Using now correct IOCTLs for upstream DFL drivers.
2020-10-26 13:57:28 +02:00
Mikko Ylinen
e054440a32 webhooks: move to admissionregistration.k8s.io/v1
With controller-gen 0.4.0, admissionregistration defaults to v1 API.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2020-10-14 14:48:40 +03:00
Mikko Ylinen
87312d3a44 sgx webhook: implement quote generation logic
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2020-10-12 10:07:28 +03:00
Mikko Ylinen
33a4f8f546 sgx: add SgxDevicePlugin CRD and admission webhook
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2020-09-10 15:31:26 +03:00
Mikko Ylinen
0574c42078 fpga: move getRequestedResources() to new package
The function will be re-used by other webhooks too so it's better
to move it to its own package.

The unit tests are taken from the original implementation with some
minor changes.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2020-09-10 15:31:26 +03:00
Mikko Ylinen
f4c33d198e patcher: move ENV validation away from getRequestedResources
This commit adds new function validateContainer() that runs the
same FPGA_* ENV validation checks as before in getRequestedResources().

The restructuring is done in preparations for moving
getRequestedResources() to a separate package.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2020-09-10 15:31:26 +03:00
Dmitry Rozhkov
9bdf3a4def
Merge pull request #440 from mythi/ctrl-runtime-062
go.mod: update controller-runtime to v0.6.2
2020-09-03 12:02:06 +03:00
Alexander Kanevskiy
c74cb563dc Implemented SR-IOV Release/Assign ioctl
fpgatool now able to prepare FME via kernel ioctl to release and
assign ports for SR-IOV configurations.
2020-09-02 18:16:53 +03:00
Mikko Ylinen
76aa7b91f0 go.mod: update controller-runtime to v0.6.2
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2020-09-02 15:16:12 +03:00
Ed Bartosh
ab1612dd7d
Merge pull request #437 from rojkov/linter-checks
lint: enable exportloopref, prealloc and scopelint checks
2020-09-02 11:40:24 +03:00
Mikko Ylinen
d8cd5814d7 operator: regenerate CRDs and small webhook/controller updates
this commits also changes validatePluginImage() to allow
image version as a parameter so that it can be used by by
other webooks too.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2020-08-31 11:29:04 +03:00
Dmitry Rozhkov
71075d4478 lint: enable exportloopref, prealloc and scopelint checks 2020-08-31 11:10:51 +03:00
Dmitry Rozhkov
be713f1c8b lint: enable errcheck 2020-08-28 16:14:14 +03:00
Dmitry Rozhkov
7ff08ee874 linter: enable staticcheck 2020-08-25 09:54:59 +03:00
Mikko Ylinen
cd068c797a ci: update tool versions
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2020-08-21 17:04:04 +03:00
Dmitry Rozhkov
200e2f8181 operator: add simple FPGA operator combined with FPGA webhook 2020-08-18 17:32:23 +03:00
Dmitry Rozhkov
a62c6f7d5e fpga webhook: reimplement to use kubebuilder framework
Simplify upgrade procedure to newer versions of kubernetes by relying on the
kubebuilder framework rather than using codegen directly.

Closes #377
2020-08-17 12:09:03 +03:00
Dmitry Rozhkov
d27b12a925 operator: fix crash when assigning to nil map 2020-06-26 12:35:25 +03:00
Dmitry Rozhkov
6b2fa0a264 operator: initial version with gpu and qat controllers 2020-06-25 13:48:41 +03:00
Dmitry Rozhkov
6f59b868d5 convert syscall.Errno to conventional error 2020-06-18 16:52:18 +03:00
Dmitry Rozhkov
73aea0aa1b linter: enable gosec check 2020-06-11 17:56:24 +03:00
Dmitry Rozhkov
70f862f2aa add golangci linter
In this initial commit the following checks are disabled due to
excessive amount of changes required:
- dupl (duplicate code)
- funlen (function length)
- goerr113 (errors handling expressions)
- gomnd (magic numbers)
- gosec (security)
- nakedret (naked returns)
- wsl (forces to use empty lines)
- errcheck (checking for unchecked errors)
- staticcheck (static analysis)
2020-06-08 14:01:13 +03:00
Dmitry Rozhkov
c63dbf61b8 fpgawebhook: move to v2 API of fpga.intel.com group 2020-05-04 15:43:20 +03:00
Dmitry Rozhkov
99fcb69d33 fpga: compress fpga AF resource names 2020-04-29 11:59:50 +03:00
Dmitry Rozhkov
6c2eacfae5 webhook: remove mode of operation
fpga: make AFU resource name 63 char long

webhook: drop mode from README

webhook: extend mappings description

webhook: tighten CRD definitions

webhook: drop mapping to non-existing afuId

explicitly state mappings names can be in any format

use consistent terminology across fpga webhook and plugin
2020-04-22 13:55:43 +03:00
Mikko Ylinen
96d9e642e1
Merge pull request #365 from rojkov/release-0.18
move to Kubernetes v1.18.2 API
2020-04-17 14:11:54 +03:00
Dmitry Rozhkov
8fc187f4d8 move to k8s v1.18.2 release
Also fix the plugins and e2e tests
2020-04-17 12:40:18 +03:00
Ukri Niemimuukko
39c934b22f topology: avoid unnecessary warning prints
Doing strings.Split with a non-empty separator against a potentially
empty string (hint.NUMAs) may return an empty string in a slice of
size one, which then doesn't parse nicely with ParseInt and results
in a repeating warning.

It is better to check for hint.NUMAs emptiness before trying to
split it.

Signed-off-by: Ukri Niemimuukko <ukri.niemimuukko@intel.com>
2020-04-16 19:11:39 +03:00
Dmitry Rozhkov
6f3302f21d dpapi: update error message 2020-03-30 15:06:06 +03:00
Dmitry Rozhkov
1f807efbc6 deviceplugins: increase unit test coverage 2020-03-30 14:59:05 +03:00
Dmitry Rozhkov
3ff989e4b0 Add interface ContainerPreStarter optionally implemented by device plugins 2020-03-30 14:59:05 +03:00
Mikko Ylinen
d3f6401335
Merge pull request #339 from bart0sh/PR0076-test-coverage-bitstream
fpga bitstream module: increase test coverage
2020-03-25 14:32:46 +02:00
Graham Whaley
e96688bb18 pkg/debug: drop the local debug pkg
Now we have moved all components to use klog for debug
output, we can drop the local debug pkg.

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2020-03-24 16:27:24 +00:00
Ed Bartosh
f31946bb98 bitstream: increased test coverage 2020-03-20 11:18:05 +02:00