Commit Graph

92 Commits

Author SHA1 Message Date
Tuomas Katila
c3a01b91ff cdi: restructure cdi support for more generic use
Pass the whole cdi.spec structure to DeviceInfo and use
cdiCache for interacting with the CDI files on the host.

Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
2024-09-04 13:56:22 +03:00
Ed Bartosh
e58369ed13 rename deprecated prestart to createRuntime
`prestart` hook is marked as deprecated in the OCI runtime spec:
https://github.com/opencontainers/runtime-spec/blob/main/config.md#posix-platform-hooks

Renamed `prestart` to the `createRuntime` as suggested in the spec.

Replaced `CDI hook` with `OCI hook` to be more clear. CDI is just a
way to update OCI config and theoretically there is no such thing as
CDI hook.
2024-05-22 19:54:53 +03:00
Ed Bartosh
1fa557e680 crihook: update documentation 2024-05-22 15:59:36 +03:00
Ed Bartosh
d245b2609d fpga: use CDI to run hooks 2024-05-22 14:56:58 +03:00
Ed Bartosh
988fbed528 deviceplugin: add DeviceInfo.hooks field 2024-05-22 13:13:38 +03:00
Tuomas Katila
26b8b9bd3d Update README kubectl applies for zsh support
Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
2022-12-29 12:25:29 +02:00
Mikko Ylinen
307e960871 docs: fix remaining review comments
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-09-06 14:28:25 +03:00
Mikko Ylinen
1b3accacc2 docs: rework development guide
Currently, each individual plugin README documents roughly the same
daily development steps to git clone, build, and deploy. Re-purpose
the plugin READMEs more towards cluster admin type of documentation
and start moving all development related documentation to DEVEL.md.

The same is true for e2e testing documentation which is scattered
in places where they don't belong to. Having all day-to-day
development Howtos is good to have in a centralized place.

Finally, the cleanup includes some harmonization to plugins'
table of contents which now follows the pattern:

* [Introduction](#introduction)
(* [Modes and Configuration Options](#modes-and-configuration-options))
* [Installation](#installation)
    (* [Prerequisites](#prerequisites))
    * [Pre-built Images](#pre-built-images)
    * [Verify Plugin Registration](#verify-plugin-registration)
* [Testing and Demos](#testing-and-demos)
    * ...

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-08-31 20:00:15 +03:00
Mikko Ylinen
a74774f939 docs: update cert-manager installation instructions
The webhooks' default deployments depend on cert-manager. Our existing
documentation points to a specific cert-manager version giving users
the impression that it should be used. However, that is not the case.

Update the documentation so that we just point to cert-manager
installation page. With this, we don't have to hard-code to any
specific version.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-02-16 11:26:37 +02:00
Ed Bartosh
55f3e17dd0 add 'annotations' parameter to the NewDeviceInfo API
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2022-02-07 15:15:30 +02:00
Ed Bartosh
cec004c398 lint: enable wsl check
Fixes: #392

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2021-12-17 11:48:48 +02:00
Hyeongju Johannes Lee
8fc5df7e37 Add govet-fieldalignment
Add govet-fieldalignment to .golangci.yml
Fix errors that come from adding govet-fieldalignment
- by reordering the fields of structs
- by putting nolint:govet annotations

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2021-09-20 20:59:04 +03:00
Li Ning
dcc12d9089 documentation: remove deprecated toc section in README
The 'Verify node kubelet config' content was removed in 6b208f8.

Signed-off-by: Li Ning <ning.a.li@transwarp.io>
2021-09-07 19:38:41 +08:00
Hyeongju Johannes Lee
4bc70ac544 Add goerr113 linter check
Add goerr113 lintercheck
Fix the usage of fmt.Errorf() by wrapping errors
Fix the usage of errors.New()
2021-09-03 11:02:14 +03:00
Ed Bartosh
8a54a9ba64 webhook: document mappings deployment
Fixes: #580

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2021-07-26 14:23:10 +03:00
Mikko Ylinen
facb4214a2 tree-wide: drop deprecated io/ioutil
Go 1.16 release notes announced the deprecation of io/ioutil [1]. It's easy
for us to move to use what is was recommended so just do it.

[1] https://golang.org/doc/go1.16#ioutil

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2021-06-02 13:41:15 +03:00
Ed Bartosh
08c2094329 update to cert-manager v1.3.1
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2021-04-22 14:45:39 +03:00
Mikko Ylinen
f8c20905aa update to cert-manager v1.2.0
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2021-02-12 15:39:07 +02:00
DougTW
467d4082d3 fpga_plugin-readme; changed one instance of master to main. Related to PR 499.
Signed-off-by: DougTW <doug.martin@intel.com>
2021-02-08 18:14:34 -08:00
Mikko Ylinen
0892a34705 move to k8s.io v1.20.x and klog/v2 v2.4.0
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2021-01-21 15:34:39 +02:00
Ed Bartosh
6b208f8acf documentation: remove kubelet configuration check
Removed device plugin socket check from the documentation as
device plugin support is enabled by default in Kubelet.

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2021-01-12 13:00:20 +02:00
Ed Bartosh
680da54fd9 fpga: improve port init
Used generic newPort API instead of device-specific
newDflPort and newIntelFpgaPort.

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2020-11-01 01:47:49 +02:00
Ed Bartosh
243870a707 fpga: reimplement device discovering
Reimplemented discovering of the FPGA devices using
APIs from pkg/fpga/intel_fpga_linux. The APis are also
used in the fpga_tool utility.

The API is more advanced and supports SR-IOV among other
things.

Fixes: #372

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2020-10-26 21:45:52 +02:00
Mikko Ylinen
4e5eae62c4 update to cert-manager v1.0.3
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2020-10-16 22:37:57 +03:00
Kevin Putnam
1d149ffee6 Documentation: Fixes broken links and standardizes headers.
Signed-off-by: Kevin Putnam <kevin.putnam@intel.com>
2020-09-22 08:32:21 -07:00
Dmitry Rozhkov
1b82ab9df6 sync README.md files with the current state of the code
Closes #356
2020-09-16 10:54:39 +03:00
Dmitry Rozhkov
71075d4478 lint: enable exportloopref, prealloc and scopelint checks 2020-08-31 11:10:51 +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
e87d94d4fb fpga: finalize plugin kustomization
closes #318
2020-07-01 11:57:45 +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
aabc45cbb5 gpu: increase code coverage for unit tests 2020-05-19 16:14:40 +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
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
Ed Bartosh
2ec6677ab0 fpga tests cleanup
- used t.Run api for better visibility
- used ioutil.TempDir to create temporary directories

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2020-03-31 14:36:15 +03:00
Graham Whaley
71d08224ee fpga: move to using klog for logs and debug
Move all the fpga components to using klog for logging
and debug. This includes replacing our homebrew 'fatal()'
with klog.Error().

Modify the deployment files to move from `-debug` to
`-v`, and set their default level to '1' (Info), rather
than full debug mode ('4').

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2020-03-24 14:31:53 +00:00
Ed Bartosh
cf731f3c18 fpga plugin: increase test coverage 2020-03-24 15:46:39 +02:00
Ed Bartosh
29be713a96 fpga_plugin: use time.Ticker instead of time.Sleep
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2020-03-24 13:32:35 +02:00
Mikko Ylinen
332fbdc35c
Merge pull request #300 from askervin/55B_fpga_kustomization
fpga plugin kustomization, stage 2
2020-02-24 22:20:27 +02:00
Antti Kervinen
5fe8174077 fpga_plugin: add kustomization files
- Add script/fpga-plugin-prepare-for-kustomization.sh, creates contents
  for the secret needed by the fpga plugin webhook.
- Single-command fpga plugin + webhook deployment for both modes:
  - `kubectl create -k deployments/fpga_plugin/overlays/af`
  - `kubectl create -k deployments/fpga_plugin/overlays/region`
- Change intel-fpga-plugin image CMD to ENTRYPOINT.
2020-02-24 16:32:26 +02:00
Ed Bartosh
ca5d144e8e
Merge pull request #296 from mythi/gomod
fpga_plugin: drop dependency to k8s.io/kubernetes
2020-02-24 14:10:12 +02:00
Ed Bartosh
13836c2d09
Merge pull request #299 from mythi/gitclone
READMEs: use git clone to get the code
2020-02-24 12:42:32 +02:00
Mikko Ylinen
61c135d1d6 fpga_plugin: drop dependency to k8s.io/kubernetes
This commit drops fpga_plugin dependency to k8s.io/kubernetes which
was used to get GetHostname(). After this change, the plugin node
name can be set using new -node-name parameter. The default value for
is read from NODE_NAME environment variable.

If the node annotation override check fails, we continue with the default
mode parameter and do not exist like we did previously.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2020-02-21 18:48:30 +02:00
Mikko Ylinen
f145541caf READMEs: use git clone to get the code
go get'ing does not work due to our k8s.io/kubernetes dependency
so guide users to use git clone to get the code.

Fixes: #290

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2020-02-20 08:04:07 +02:00
Antti Kervinen
d04aa77ac5 fpga_plugin: orchestration/orchestrated fixed in READMEs
Not touching "orchestration programmed". Fixing only instances where
this refers directly to the mode recognized by the webhook-deploy.sh
script.

Signed-off-by: Antti Kervinen <antti.kervinen@intel.com>
2020-02-17 16:32:54 +02:00
Ed Bartosh
1f4928790f Implement function for DeviceInfo creation
- Made DeviceInfo fields private
- Implement NewDeviceInfo constructor
2020-02-07 15:26:37 +02:00
Graham Whaley
27bc562478 fpga plugin: docs: Clean up and expand README
Expand and re-arrange the README. Add some details about what the
plugin and other FPGA components provide.

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2020-01-30 16:19:19 +00:00
Graham Whaley
958ab2aa7e fpga: docs: Add diagrams for FPGA modes
Add draw.io and their generated PNG files for both
orchestrated and preprogrammed FPGA modes. These will
then be used in the documentation.

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2020-01-27 14:55:15 +00:00