Commit Graph

14219 Commits

Author SHA1 Message Date
GabyCT
3827b5f9f2
Merge pull request #9982 from ChengyuZhu6/fix-ci
tests: Delete test scripts forcely
2024-07-10 17:00:41 -06:00
Wainer Moschetta
deb4627558
Merge pull request #9975 from niteeshkd/nd_snp_attestation
gha: enable SNP attestation
2024-07-10 18:59:05 -03:00
GabyCT
c40b3b4ce7
Merge pull request #9992 from sprt/fix-nydus
ci: fix run-nydus tests
2024-07-10 13:56:16 -06:00
David Esparza
be9385342e
Merge pull request #9990 from GabyCT/topic/tdxtimeout
gha: Increase timeout to run CoCo TDX tests
2024-07-10 13:21:23 -06:00
Silenio Quarti
8260ce8d15 runtime: Initialize SharedFS for remote hypervisor
Sets SharedFS config to NoSharedFS for remote hypervisor in order to start the file watcher which syncs files from the host to the guest VMs. 

Signed-off-by: Silenio Quarti <silenio_quarti@ca.ibm.com>
2024-07-10 14:31:25 -03:00
Aurélien Bombo
25e0e2fb35 ci: fix run-nydus tests
GH-9973 introduced:

 * New function get_kata_memory_and_vcpus() in
   tests/metrics/lib/common.bash.
 * A call to get_kata_memory_and_vcpus() from extract_kata_env(), which
   is defined in tests/common.bash.

Because the nydus test only sources tests/common.bash, it can't find
get_kata_memory_and_vcpus() and errors out.

We fix this by moving the get_kata_memory_and_vcpus() call from
tests/common.bash to tests/metrics/lib/json.bash so that it doesn't
impact the nydus test.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2024-07-10 17:19:08 +00:00
Gabriela Cervantes
b6b8524ab7 gha: Increase timeout to run CoCo TDX tests
This PR increases the timeout to run the CoCo TDX tests in order
to avoid the random failures on TDX saying that
The action 'Run tests' has timed out after 30 minutes and making
the GHA job fail.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-07-10 16:06:07 +00:00
Niteesh Dubey
e8a3f8571e docs: update for SNP attestation
This updates how-to document for SNP attestation.

Signed-off-by: Niteesh Dubey <niteesh@us.ibm.com>
2024-07-10 15:06:55 +00:00
Niteesh Dubey
ff04154fdb gha: enable SNP attestation
This removes the code to skip the SNP attestation.

Signed-off-by: Niteesh Dubey <niteesh@us.ibm.com>
2024-07-10 15:06:55 +00:00
Hyounggyu Choi
d94b285189 tests: Enable k8s-confidential-attestation.bats for s390x
For running a KBS with `se-verifier` in service,
specific credentials need to be configured.
(See https://github.com/confidential-containers/trustee/tree/main/attestation-service/verifier/src/se for details.)

This commit introduces two procedures to support IBM SE attestation:

- Prepare required files and directory structure
- Set necessary environment variables for KBS deployment
- Repackage a secure image once the KBS service address is determined

These changes enable `k8s-confidential-attestation.bats` for s390x.

Fixes: #9933

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-07-10 16:18:37 +02:00
Hyounggyu Choi
5d0f74cd70 local-build: Extract build_secure_image() as a separate library
Currently, all functions in `build_se_image.sh` are dedicated to
publishing a payload image. However, `build_secure_image()` is now
also used for repackaging a secure image when a kernel parameter
is reconfigured. This reconfiguration is necessary because the KBS
service address is determined after the initial secure image build.

This commit extracts `build_secure_image()` from `build_se_image.sh`
and creates a separate library, which can be loaded by bats-core.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-07-10 16:18:37 +02:00
Hyounggyu Choi
bf2f0ea2ca tests: Change a location for creating key.bin
The current KBS deployment creates a file `key.bin` assuming that
`kustomization.yaml` is located in `overlays/`.

However, this does not hold true when the kustomize config is enabled
for multiple architectures. In such cases, the configuration file
should be located in `overlays/$(uname -m)`.
This commit changes the location for file creation.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-07-10 16:18:37 +02:00
Hyounggyu Choi
4025ef7193 versions: Bump trustee to multi-arch deployment for KBS
As part of the enablement for s390x, KBS should support multi-arch deployment.
This commit updates the version of coco-trustee to a commit where the support
is implemented.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-07-10 16:18:37 +02:00
Hyounggyu Choi
856a1f72c6 packaging: Set ATTESTER to se-attester for guest components on s390x
This commit allows the guest-components builder to only build se-attester on s390x.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-07-10 16:18:37 +02:00
Xuewei Niu
7f71eac6de
Merge pull request #9868 from l8huang/dan
runtime: implement DAN in Go kata-runtime
2024-07-10 19:09:46 +08:00
Alex Lyn
dafff26f01
Merge pull request #9814 from Apokleos/bugfix-pcipath
runtime-rs: bugfix for root bus slot allocation
2024-07-10 16:19:06 +08:00
Steve Horsman
aa487307e8
Merge pull request #9962 from GabyCT/topic/removecif
scripts: Eliminate CI variable as it is not longer used
2024-07-10 09:02:33 +01:00
Steve Horsman
78bbc51ff0
Merge pull request #9806 from niteeshkd/nd_snp_certs
runtime: pass certificates to get extended attestation report for SNP coco
2024-07-10 08:57:45 +01:00
Steve Horsman
29413021e5
Merge pull request #9981 from stevenhorsman/run-k8s-tests-on-zvsi-inherit-secrets
gha: make run-k8s-tests-on-zvsi inherit secrets
2024-07-10 08:49:11 +01:00
Lei Huang
171d298dea runtime: implement DAN in Go kata-runtime
The DAN feature has already been implemented in kata-runtime-rs, and
this commit brings the same capability to the Go kata-runtime.

Fixes: #9758

Signed-off-by: Lei Huang <leih@nvidia.com>
2024-07-10 00:22:30 -07:00
ChengyuZhu6
489afffd8c tests:gha: delete namespace before resetting namespace
Delete the kata-containers-k8s-tests namespace before resetting the namespace
to ensure that no deployments or services are restarting and creating pods in the default namespace.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
Signed-off-by: Wang, Arron <arron.wang@intel.com>
2024-07-10 12:08:28 +08:00
ChengyuZhu6
e874c8fa2e tests: Delete test scripts forcely
Delete test scripts forcely in `Delete kata-deploy` step before
deleting all kata pods.

Fixes: #9980

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-07-10 12:08:28 +08:00
Alex Lyn
806e959b01 runtime-rs: bugfix for device slot allocation failed in dragonball
In dragonball Vfio device passthrough scenarois, the first passthrough
device will be allocated slot 0 which is occupied by root device.
It will cause error, looks like as below:
```
...
6: failed to add VFIO passthrough device: NoResource\n
7: no resource available for VFIO device"): unknown
...
```
To address such problem, we adopt another method with no pre-allocated
guest device id and just let dragonball auto allocate guest device id
and return it to runtime. With this idea, add_device will return value
Result<DeviceType> and apply the change to related code.

Fixes #9813

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2024-07-10 10:59:57 +08:00
Alex Lyn
27947cbb0b dragonball: make add vfio device return guest device id
Fixes #9813

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2024-07-10 10:59:51 +08:00
Alex Lyn
fa4af09658
Merge pull request #9985 from GabyCT/topic/fixcrites
cri-containerd: Remove use_devmapper variable for cri-containerd tests
2024-07-10 10:13:27 +08:00
Alex Lyn
e4997760f1
Merge pull request #9987 from kata-containers/remove_double_process_check_from_memory_usage_test
metrics: Remove duplicate check of processes from memory test.
2024-07-10 10:12:18 +08:00
David Esparza
09f523c815
Merge pull request #9973 from kata-containers/add_memory_and_vcpus_info_to_results
Add memory and vcpus info to metrics results
2024-07-09 18:05:07 -06:00
David Esparza
e77d44614b
metrics: Remove duplicate check of processes from memory test.
This PR removes the common_init function call from the memory
usage script to eliminate duplicate checking that is also done
from the init_env function.

It also eliminates duplicaction of nested conditionals.

Fixes: #9984

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2024-07-09 12:34:51 -06:00
Gabriela Cervantes
7061272b4e kernel: bump kata config version
This PR bumps the kata config version as the kernel scripts were
modified.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-07-09 20:04:24 +02:00
Gabriela Cervantes
de848c1458 packaging: Remove CI variable from build kernel script
This PR removes the CI variable from build kernel script which
is not longer supported it as this was part of the jenkins
environment.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-07-09 20:04:24 +02:00
Gabriela Cervantes
28601b51d2 tools: Remove CI variable in kata deploy in docker script
This PR removes the CI variable in kata deploy in docker script
which was supported it in jenkins environment which is not
longer being supported it.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-07-09 20:04:24 +02:00
Gabriela Cervantes
f2b8c6619d makefile: Remove CI variable from local build makefile
This PR removes the CI variable from the local build makefile as
this was part of the jenkins environment which is not longer supported
it.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-07-09 20:04:24 +02:00
Gabriela Cervantes
4161fa3792 tools: Remove CI variable in test images script for osbuilder
This PR removes the CI variable in test images script for osbuilder
as this was part of the jenkins environment which is not longer supported
it.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-07-09 20:04:24 +02:00
Greg Kurz
7506d1ec29 tools: Remove CI variable in test config osbuilder script
This PR removes the CI variable in test config osbuilder script
which was supported on the jenkins environment which is not
longer supported it.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
[greg: squash all fixes into a single patch]
Signed-off-by: Greg Kurz <groug@kaod.org>
2024-07-09 20:03:08 +02:00
Niteesh Dubey
647dad2a00 gha: skip SNP attestation test
Skip the SNP attestation test for now.

Signed-off-by: Niteesh Dubey <niteesh@us.ibm.com>
2024-07-09 17:16:07 +00:00
Niteesh Dubey
e7b4e5e386 gha: add SNP attestation test
This tests the attestation of SNP guest.

Signed-off-by: Niteesh Dubey <niteesh@us.ibm.com>
2024-07-09 17:14:26 +00:00
Gabriela Cervantes
1a1e62b968 cri-containerd: Remove use_devmapper variable for cri-containerd tests
This PR removes the use_devmapper variable which was part of the jenkins
environment flags which is not longer support it or available for the
cri-containerd tests.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-07-09 17:09:55 +00:00
GabyCT
eb0bc5007c
Merge pull request #9976 from sprt/fix-cri-containerd
tests: cri-containerd: Ensure Docker isn't present
2024-07-09 11:02:20 -06:00
David Esparza
04df85a44f
metrics: Add num_vcpus and free_mem to metrics results template.
This PR retrieves the free memory and the vcpus count from
a kata container and includes them to the json results file of
any metric.

Additionally this PR parses the requested vcpus quantity and the
requested amount memory from kata configuration file and includes
this pair of values into the json results file of any metric.

Finally, the file system defined in the kata configuration file
is included in the results template.

Fixes: #9972

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2024-07-09 10:29:29 -06:00
David Esparza
a554541495
metrics: Improvement to the description of certain functions.
This PR rephrased the description and usage of certain functions
as such as:
- set_kata_configuration_performance
- set_kata_config_file
- get_current_kata_config_file
- check_if_root
- check_ctr_images

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2024-07-09 10:29:29 -06:00
stevenhorsman
c7cf26fa32 gha: make run-k8s-tests-on-zvsi inherit secrets
run-k8s-tests-on-zvsi runs the coco tests and we've added new
secrets to provide credentials for the authenticated image testing,
so we need to let the zvsi job inherit these from the caller workflow
like the rest of the coco tests

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-07-09 15:29:48 +01:00
Hyounggyu Choi
37b907dfbc
Merge pull request #9859 from BbolroC/set-ocispec-for-vfio-ap
tests: Extend vfio-ap hotplug test to use a zcrypttest tool
2024-07-09 14:03:45 +02:00
Steve Horsman
ff498c55d1
Merge pull request #9719 from fitzthum/sealed-secret
Support Confidential Sealed Secrets (as env vars)
2024-07-09 09:43:51 +01:00
Niteesh Dubey
529660fafb runtime: pass certificates for SNP coco
This will be used to get extended attestation report.

Fixes: #9805

Signed-off-by: Niteesh Dubey <niteesh@us.ibm.com>
2024-07-09 03:46:00 +00:00
Tim Zhang
704da86e9b CI: Add tests for stdio
Add tests for stdio

Signed-off-by: Tim Zhang <tim@hyper.sh>
2024-07-09 11:44:40 +08:00
Tim Zhang
8801554889 runtime-rs: Fix ctr exec stuck problem
Fixes: #9532

Instead of call agent.close_stdin in close_io, we call agent.write_stdin
with 0 len data when the stdin pipe ends.

Signed-off-by: Tim Zhang <tim@hyper.sh>
2024-07-09 11:44:36 +08:00
Tobin Feldman-Fitzthum
1c2d69ded7 tests: add test for sealed env secrets
The sealed secret test depends on the KBS to provide
the unsealed value of a vault secret.

This secret is provisioned to an environment variable.

Signed-off-by: Tobin Feldman-Fitzthum <tobin@ibm.com>
2024-07-08 17:41:20 -05:00
Linda Yu
b4d61f887b agent: unittest for sealed secret as env in kata
To test unsealing secrets stored in environment variables,
we create a simple test server that takes the place of
the CDH. We start this server and then use it to
unseal a test secret.

Signed-off-by: Tobin Feldman-Fitzthum <tobin@ibm.com>
Signed-off-by: Linda Yu <linda.yu@intel.com>
2024-07-08 17:32:45 -05:00
Linda Yu
6003608fe6 agent: support sealed secret as env in kata
When sealed-secret is enabled, the Kata Agent
intercepts environment variables containing
sealed secrets and uses the CDH to unseal
the value.

Signed-off-by: Tobin Feldman-Fitzthum <tobin@ibm.com>
Signed-off-by: Linda Yu <linda.yu@intel.com>
2024-07-08 17:31:33 -05:00
Gabriela Cervantes
cf2d5ff4c1 scrips: Fix indentation in QAT run script
This PR fixes the indentation of the QAT run script.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-07-08 20:23:50 +00:00