Commit Graph

137 Commits

Author SHA1 Message Date
Tuomas Katila
c1e4d9e3ef images: set 0.29.0 tag for the release
Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
2023-12-19 14:39:08 +02:00
Mikko Ylinen
d7997800a9 logging: move away from klogr to ktesting/textlogger
klog has added ktesting/textlogger and is going to deprecate
klogr. The deprecation is going to trigger golangci-lint (staticcheck)
errors so rework the logging and move to ktesting/textlogger.

The commit also fixes the loglevel setting with operator.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2023-11-20 09:46:41 +02:00
Tuomas Katila
f9221c46fd operator: remove one-cr-per-kind limitation
Differentiate objects by adding cr names as suffixes
Drop kind book keeping and related functions from controllers

Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
2023-11-09 13:05:40 +02:00
Hyeongju Johannes Lee
5513302408 e2e,qat4: use 'dc' 'cy' and 'generic'
Strictly speaking, 'Gen4' and 'Gen2' are wrong expressions in this case,
because Gen4 resources are read as 'generic' in VMs. To prevent any
confusion, use just the names of the QAT services such as 'dc', 'cy' or
'generic'

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-09-21 13:08:09 -07:00
Hyeongju Johannes Lee
9ccdbf3e05 e2e: add labels for device, resource, mode, app
Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-09-21 13:03:50 -07:00
Hyeongju Lee
0d8c686a3d
Merge pull request #1489 from hj-johannes-lee/PR-2023-024
e2e,dsa,iaa: remove unnecessary layer ginkgo.Describe
2023-08-29 11:43:35 +03:00
Hyeongju Johannes Lee
766b25f0cf e2e: remove the unncessary layer 'ginkgo.Describe' for dsa & iaa
Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-08-24 11:57:18 +03:00
Mikko Ylinen
60530ecdcd go.mod: bump sigs.k8s.io/controller-runtime from 0.15.1 to 0.16.0
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2023-08-23 09:30:08 +03:00
Tuomas Katila
4212145126 e2e: gpu: add a basic tensorflow test
Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
2023-08-22 15:51:35 +03:00
hj-johannes-lee
51c0032437 e2e,gpu: divide single It() to have multiple layers
Structure is as follows:
Describe("GPU plugin")
  BeforeEach("deploys plugin")
  Context("When device resources are available")
    BeforeEach("checks if resources are available")
    It("runs a pod requesting resources")

Signed-off-by: hj-johannes-lee <hyeongju.lee@intel.com>
2023-08-15 12:01:18 +03:00
hj-johannes-lee
34742e3bc8 e2e,fpga: divide single It() to have multiple layers
Structure is as follows:
Describe("FPGA plugin")
  Context("af mode")
    BeforeEach("run device plugin")
    It("runs a pod requesting resources")
  Context("region mode")
    BeforeEach("run device plugin")
    It("runs a pod requesting resources")

Signed-off-by: hj-johannes-lee <hyeongju.lee@intel.com>
2023-08-15 12:01:16 +03:00
hj-johannes-lee
42a735bf0d e2e,gpu: add log printing when device mounts not found in a demo pod
Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-08-08 12:52:56 +03:00
Hyeongju Johannes Lee
32c7c370ef e2e: use utils.GetFormattedErrorAndLog for logging demo pods
this makes a demo pod's log get printed only when the pod
did not run sucessfully

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-08-08 12:52:55 +03:00
hj-johannes-lee
4b26ead3ac e2e: add func utils.GetFormattedErrorAndLog for logging failed pod
Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-08-07 14:48:13 +03:00
Hyeongju Johannes Lee
00c666ac57 e2e: rename err to errFailedToLocateRepoFile to prevent linter error
when err is declared and any parts below that declare again,
linter complains as follows:
shadow: declaration of err shadows declaration at line 51

so, we name the first declaration as errFailedToLocateRepoFile so
that other 'err's do not need to be named all in different names
or can be declared as 'err' without linter error.

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-08-07 14:43:16 +03:00
Tuomas Katila
d865a1b402 e2e/utils: Modify overlay customization
Instead creating another overlay, copy the existing overlay and modify it.
This helps with multi-level overlays with specific namespace selections.

Co-authored-by: Mikko Ylinen <mikko.ylinen@intel.com>
Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
2023-08-03 10:37:33 +03:00
Mikko Ylinen
899bd11d44 e2e: fix webhook TLS tests
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2023-08-01 09:28:15 +03:00
Hyeongju Johannes Lee
03fd3ebaa8 e2e,sgx: use sgx-sdk-demo app instead of busybox
Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-07-26 17:22:44 +03:00
Hyeongju Johannes Lee
56df81a53e e2e,sgx: fix linter error: shadow declaration of err
rename err as errPodNotRunning so it does not shadow the previous
declaration

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-07-26 01:10:08 +03:00
Hyeongju Johannes Lee
81b386400f e2e,sgx: divide single It() to have multiple layers
Structure is as follows:
Describe("SGX plugin")
  BeforeEach("deploys plugin")
  Context("When device resources are available")
    BeforeEach("checks if resources are available")
    It("runs a pod requesting resources")
  AfterEach("undeploys plugin")

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-07-26 01:09:58 +03:00
Hyeongju Johannes Lee
bec3dd0148 e2e: remove duplicate code of testing with operator
move duplicate code for testing plugins using operator to
operator module

replace the code for deploying operator webhook in operator module
with the code using utils.Kubectl to make simple for undeploying

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-07-25 17:45:30 +03:00
Mikko Ylinen
52d3d4abd1 operator: fix setting QAT provisioning config volumeMount
setInitContainer() adds "init-sriov-numvfs" to initContainers
but uses initcontainerName constant to search where to add
the QAT configMap volumeMount. Fix by moving all code to use
the const.

It was also noticed in the controller logs that setting Pod
Volumes is not idempotent but broken DaemonSet gets created:

""intel-device-plugins-manager: Reconciler error "err="DaemonSet.apps
\"intel-qat-plugin\" is invalid: spec.template.spec.volumes[6].name:
Duplicate value: \"qat-config\"" controller="qatdeviceplugin"
controllerGroup="deviceplugin.intel.com"

Finally, change 'qat-config' to 'intel-qat-config-volume' to
better describe that it's a volume.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2023-05-25 06:43:18 +03:00
Mikko Ylinen
c37ac008b5
Merge pull request #1411 from hj-johannes-lee/PR-2023-012
qat,e2e: fix e2e test for cy
2023-05-16 13:39:39 +03:00
Hyeongju Johannes Lee
5119cc5263 qat,e2e: fix e2e test for cy
runTests=4 is dsa test, and it does not run anything for now.
So, use runTests=1, which is symmetric test code.
In addition, make CpaSampleCode's params const and add comments
for the sample codes' param numbering.

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-05-16 02:41:13 -07:00
Mikko Ylinen
4d238959a8 envtest: disable controller metrics in tests
to mitigate spurious errors with:

E0515 15:28:06.626887 1995892 listener.go:48] "controller-runtime/metrics:
metrics server failed to listen. You may want to disable the metrics
server or use another port if it is due to conflicts" err="error lis
tening on :8080: listen tcp :8080: bind: address already in use"

disable metrics completely. Moreover, check for error value from
NewManager() before proceeding with the tests to avoid crashes.

This makes envtest more robust but the up()/down() logic needs
careful review to ensure there are no race conditions.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2023-05-16 07:07:37 +03:00
Mikko Ylinen
e428cd6c19 go.mod: update to k8s 1.27.1 and controller runtime 0.15.x
k8s 1.27.x triggers build errors on controller-runtime 0.14.x
so we will need to update to 0.15.x at the same time.

Changes include:

* k8s e2e framework moved to use Ginkgo context so we add
  test context to all our test nodes.
* adapt Ginkgo parameter modifications.
* adapt SGX admissionwebhook to InjectDecoder removal.
* adapt deviceplugins and FPGA CRDs to controller-runtime
  API changes.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2023-05-09 14:49:24 +03:00
Hyeongju Johannes Lee
64b3da9653 qat,e2e: add cpa-sample compress test for gen4
- add /usr/share/qat/calgary32 necessary for running dc test
to Dockerfile
- add e2e test for dc that runs cpa-sample with different
resource and command.
- remove openssl yaml file and use podSpec instead for cy test
- make a common func runCpaSampleCode for both cy and dc test
that have same process with a few differences

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-05-03 07:38:09 -07:00
Hyeongju Johannes Lee
a80744e4df qat,e2e: add dpdk crypto-perf test for gen4
In the e2e test running in CI/CD, crypto-perf cannot be run.
So, we do not make it run by default.

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-05-03 03:30:02 -07:00
Mikko Ylinen
3a4c0e574f sgx: stop using local source hooks for EPC registration
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2023-04-28 14:59:41 +03:00
Hyeongju Johannes Lee
fe8a196a8a e2e: update qat gen4 test case to deal with configMap
Add a process to create a configMap for cy service

The structure of e2e test flows is as follows:
BeforeEach(createing a configMap)
JustBeforeEach(deploying QAT plugin)
Context(
 - BeforeEach(checks if resources are available)
 - It(runs a test pod)
[- It(runs another test pod)]*
)

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-04-27 13:08:47 -07:00
Hyeongju Johannes Lee
e3e6e215b7 e2e: fix AfterEach to be in the correct location
'AfterEach' was made to prevent the failure of a plugin pod that
occurs due to 'BeforeEach' that deploys a plugin pod. If it is
inside a 'Context' it will still occur the same problem. Since
current e2e tests have one 'Context' in general, problems were not
visible, but it still have problem in logic and would cause the
same problems if more 'Contexts' are made. So, this commit fixes
'AfterEach' to be in the correct location.

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-04-24 04:08:44 -07:00
Hyeongju Johannes Lee
f51382b517 e2e: ensure device plugin gets deleted before next one is deployed
Though namespace is deleted after each It(), it does not ensure
that it is deleted. Because of this reason, device plugin did not
get deleted before the next one is deployed. This can cause a
temporary crash of the new plugin and sometimes becomes the cause
of e2e test's failure. This commit fixes it by ensuring previous
device plugin gets deleted after each run.

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-03-29 01:45:46 -07:00
Mikko Ylinen
50a7a67406
Merge pull request #1339 from hj-johannes-lee/e2e-qat-gen4-to-be-part-of-dpdk
e2e, qat: make test for gen4 to be part of dpdk
2023-03-07 11:50:35 +02:00
Hyeongju Johannes Lee
612e4bff4e
e2e, qat: make test for gen4 to be part of dpdk
Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-03-06 14:36:46 +02:00
Mikko Ylinen
3dc815cda9 deployments: fix FPGA plugin namespace
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2023-02-21 21:15:06 +02:00
Mikko Ylinen
6a840b7b95
Merge pull request #1263 from hj-johannes-lee/e2e-segmentation
e2e: make tests divided into smaller parts (DLB, DSA, IAA, QAT)
2023-02-16 14:40:08 +02:00
Hyeongju Johannes Lee
3286baadb5
e2e, qat: divide single It() to have multiple layers
Structure is as follows:
Describe("QAT plugin")
  BeforeEach("deploys plugin")
    Context("When device resources are available")
      BeforeEach("checks if resources are available")
        It("runs a pod requesting resources")
        It("runs another pod requesting resources if there is")

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-02-16 13:35:28 +02:00
Hyeongju Johannes Lee
77ad32e008
e2e, iaa: divide single It() to have multiple layers
Structure is as follows:
Describe("IAA plugin")
  Describe("without using operator")
    BeforeEach("deploys plugin")
      Context("When device resources are available")
        BeforeEach("checks if resources are available")
          It("runs a pod requesting resources")
  Describe("with using operator")
    It("deploys with operator")

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-02-16 13:35:13 +02:00
Hyeongju Johannes Lee
fc0d0b5e0c
e2e, dsa: divide single It() to have multiple layers
Structure is as follows:
Describe("DSA plugin")
  Describe("without using operator")
    BeforeEach("deploys plugin")
      Context("When device resources are available")
        BeforeEach("checks if resources are available")
          It("runs a pod requesting resources")
  Describe("with using operator")
    It("deploys with operator")

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-02-16 13:35:13 +02:00
Hyeongju Johannes Lee
b111203392
e2e, dlb: divide single It() to have multiple layers
Structure is as follows:
Describe("DLB plugin")
  BeforeEach("deploys plugin")
    Context("When device resources are available")
      BeforeEach("checks if resources are available")
        It("runs a pod requesting resources")

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-02-16 13:35:12 +02:00
Oleg Zhurakivskyy
0828d4a2dd e2e: sgx: Add operator test
Closes #1273

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2023-02-15 16:47:26 +02:00
Oleg Zhurakivskyy
f8ea66563e e2e: Increase nfd timeout to 300 seconds
Apparently some of simulated CI nodes have out of sync boot configuration.

In order to be able to get the configuration in sync, the e2e NFD timeout
should be increased (it takes 250-260 seconds for NFD to get up with the right
boot parameters in the simulated environments).

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2023-01-30 17:17:55 +02:00
Mikko Ylinen
5de9b50f9e e2e: double NFD startup waiting time
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2023-01-12 08:07:53 +02:00
Mikko Ylinen
ee44c5c47e
Merge pull request #1271 from hj-johannes-lee/fix-typo-from-e2e
e2e: fix typos and minor grammar issues
2022-12-14 09:23:09 +02:00
Hyeongju Johannes Lee
838bc39bc7
e2e: fix typos and minor grammar issues
finnish -> finish
check -> check if

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2022-12-13 11:23:21 +02:00
Mikko Ylinen
10a26b8fd8
Merge pull request #1234 from hj-johannes-lee/qat-cfgServices
qat: add configuration of cfgServices to qat initcontainer
2022-12-13 08:26:13 +02:00
Hyeongju Johannes Lee
a6037eae3c
qat: add configuration of cfgServices to qat initcontainer
Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2022-12-12 21:48:21 +02:00
Mikko Ylinen
34d930a567 upgrade to k8s 1.26.0-rc.1 and controller-runtime@master
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-12-07 15:04:33 +02:00
Mikko Ylinen
afce0ed79c
Merge pull request #1196 from ozhuraki/e2e-operator
operator: Add e2e tests for DSA, IAA
2022-11-17 21:30:33 +02:00
Oleg Zhurakivskyy
ef7954c8e1 operator: Add e2e tests for DSA, IAA
Closes #1230

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2022-11-17 17:47:21 +02:00