Commit Graph

14219 Commits

Author SHA1 Message Date
Alex Lyn
efb7390357 kata-sys-utils: align OCI Spec with oci-spec-rs
Do align oci spec and fix warnings to make clippy
happy.

Fixes #9766

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2024-07-24 14:38:48 +08:00
Alex Lyn
012029063c runtime-spec: Introduce runtime-spec for Container State
As part of aligning the Kata OCI Spec with oci-spec-rs,
the concept of "State" falls outside the scope of the OCI
Spec itself. While we'll retain the existing code for State
management for now, to improve code organizationand clarity,
we propose moving the State-related code from the oci/ dir
to a dedicated directory named runtime-spec/.
This separation will be completed in subsequent commits with
the removal of the oci/ directory.

Fixes #9766

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2024-07-24 14:38:30 +08:00
Zvonko Kaiser
a388d2b8d4
Merge pull request #9919 from zvonkok/ubuntu-dockerfile
gpu: rootfs ubuntu build expansion
2024-07-24 08:05:54 +02:00
ChengyuZhu6
2b44e9427c gha: Increase timeout to run CoCo tests
This PR increases the timeout for running the CoCo tests to avoid random failures.
These failures occur when the action `Run tests` times out after 30 minutes, causing the CI to fail.

Fixes: #10062

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-07-24 12:31:38 +08:00
GabyCT
b408cc1694
Merge pull request #10060 from GabyCT/topic/fgreptest
metrics: Update launch times to use grep -F
2024-07-23 17:23:14 -06:00
Gabriela Cervantes
0e5489797d docs: Update url links in kata nydus document
This PR updates the url links in the kata nydus document.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-07-23 17:49:12 +00:00
Gabriela Cervantes
3d17a7038a metrics: Update launch times to use grep -F
This PR updates the metrics launch times to use grep -F instead of
fgrep as this command has been deprecated.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-07-23 17:13:52 +00:00
Zvonko Kaiser
941577ab3b gpu: rootfs ubuntu build expansion
For the GPU build we need go/rust and some other helpers
to build the rootfs.

Always use versions.yaml for the correct and working Rust and golang
version

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-07-23 14:31:35 +00:00
Steve Horsman
d69950e5c6
Merge pull request #10053 from stevenhorsman/release-env-var
ci: cache: Pass through RELEASE env
2024-07-22 21:53:20 +01:00
Dan Mihai
f26d595e5d
Merge pull request #9910 from microsoft/saulparedes/set_policy_rego_via_env
tools: Allow setting policy rego file via
2024-07-22 11:00:30 -07:00
stevenhorsman
66f6ec2919 ci: cache: Pass through RELEASE env
In kata-deploy-binaries.sh we want to understand if we are running
as part of a release, so we need to pass through the RELEASE env
from the workflow, which I missed in
https://github.com/kata-containers/kata-containers/pull/9550

Fixes: #9921
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-07-22 16:39:35 +01:00
Zvonko Kaiser
5765b6e062
Merge pull request #9920 from zvonkok/initrd-builer
gpu: rootfs/initrd build init
2024-07-22 15:06:49 +02:00
Zvonko Kaiser
73bcb09232
Merge pull request #9968 from zvonkok/kernel-gpu-dragonball-6.1.x
dragonball: kernel gpu dragonball 6.1.x
2024-07-22 13:03:14 +02:00
Zvonko Kaiser
3029e6e849 gpu: rootfs/initrd build init
Initramfs expects /init, create symlink only if ${ROOTFS}/init does not exist
Init may be provided by other packages, e.g. systemd or GPU initrd/rootfs

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-07-22 10:19:05 +00:00
Saul Paredes
b7a184a0d8 rootfs: Allow AGENT_POLICY_FILE te be an absolute
path

Don't set AGENT_POLICY_FILE as $script_dir may change

Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
2024-07-21 14:57:41 -07:00
Alex Lyn
67466aa27f kata-types: do alignment of oci-spec for kata-types
Fixes #9766

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2024-07-21 22:54:43 +08:00
Hyounggyu Choi
c774cd6bb0
Merge pull request #10031 from ChengyuZhu6/fix-log-contain-tdx
tests: Fix missing log on TDX
2024-07-20 07:26:08 +02:00
ChengyuZhu6
6ea6e85f77 tests: Re-enable authenticated image tests on tdx
Try to re-enable authenticated image tests on tdx.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-07-20 12:10:02 +08:00
ChengyuZhu6
3476fb481e tests: Fix missing log on TDX
Currently, we have found that `assert_logs_contain` does not work on TDX.
We manually located the specific log, but it fails to get the log using `kubectl debug`. The error found in CI is:
```
warning: couldn't attach to pod/node-debugger-984fee00bd70.jf.intel.com-pdgsj,
falling back to streaming logs: error stream protocol error: unknown error
```

Upon debugging the TDX CI machine, we found an error in containerd:
```
Attach container from runtime service failed" err="rpc error: code = InvalidArgument desc = tty and stderr cannot both be true"
containerID="abc8c7a546c5fede4aae53a6ff2f4382ff35da331bfc5fd3843b0c8b231728bf"
```

We believe this is the root cause of the test failures in TDX CI.
Therefore, we need to ensure that tty and stderr are not set to true at same time.

Fixes: #10011

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
Signed-off-by: Wang, Arron <arron.wang@intel.com>
2024-07-20 12:10:01 +08:00
Steve Horsman
7dd560f07f
Merge pull request #9620 from l8huang/kernel
Add kernel config for NVIDIA DPU/ConnectX adapter
2024-07-19 23:16:51 +01:00
Dan Mihai
3127dbb3df
Merge pull request #10035 from microsoft/danmihai1/k8s-credentials-secrets
tests: k8s-credentials-secrets: policy for second pod
2024-07-19 12:44:21 -07:00
Saul Paredes
2681fc7eb0 genpolicy: Add support for envFrom
This change adds support for the `envFrom` field in the `Pod` resource

Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
2024-07-19 09:53:58 -07:00
GabyCT
be2d4719c2
Merge pull request #10040 from kata-containers/fix_blogbench_midvalues
metrics: update avg reference values for blogbench.
2024-07-19 09:51:29 -06:00
Zvonko Kaiser
8eaa2f0dc8 dragonball: Add GPU support
Build a GPU flavoured dragonball kernel

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-07-19 14:48:05 +00:00
Dan Mihai
44e443678d
Merge pull request #9835 from microsoft/saulparedes/test_policy_on_sev
gha: enable autogenerated policy testing on SEV and SEV-SNP
2024-07-19 07:46:01 -07:00
Greg Kurz
dc97f3f540
Merge pull request #10045 from lifupan/cleanup_container
runtime-rs: container: fix the issue of missing cleanup container
2024-07-19 16:36:04 +02:00
Alex Lyn
d0dc67bb96
Merge pull request #8597 from amshinde/vfio-hotplug-support
Implement hotplug support for physical endpoints
2024-07-19 13:41:11 +08:00
Lei Huang
20f6979d8f build: add kernel config for Nvidia DPU/ConnectX adapter
With Nvidia DPU or ConnectX network adapter, VF can do VFIO passthrough
to guest VM in `guest-kernel` mode. In the guest kernel, the adapter's
driver is required to claim the VFIO device and create network interface.

Signed-off-by: Lei Huang <leih@nvidia.com>
2024-07-18 22:29:16 -07:00
Fupan Li
8a2f7b7a8c container: fix the issue of missing cleanup container
When create container failed, it should cleanup the container
thus there's no device/resource left.

Fixes: #10044

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2024-07-19 11:02:55 +08:00
ms-mahuber
ddff762782 tools: Allow setting policy rego file via
environment variable

* Set policy file via env var

* Add restrictive policy file to kata-opa folder

* Change restrictive policy file name

* Change relative default path location

* Add license headers

Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
2024-07-18 15:05:45 -07:00
David Esparza
60f52a4b93
metrics: update avg reference values for blogbench.
This PR updates the Blogbench reference values for
read and write operations used in the CI check metrics
job.

This is due to the update to version 1.2 of blobench.

Fixes: #10039

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2024-07-18 15:47:14 -06:00
Greg Kurz
fc4357f642
Merge pull request #10034 from BbolroC/hide-repack_secure_image-from-test
tests: Call repack_secure_image() in set_metadata_annotation()
2024-07-18 23:03:41 +02:00
Aurélien Bombo
ab6f37aa52
Merge pull request #10022 from microsoft/danmihai1/probes-and-lifecycle
genpolicy: container.exec_commands args validation
2024-07-18 12:21:31 -07:00
Steve Horsman
256ab50f1a
Merge pull request #9959 from sprt/fix-ci-cleanup
ci: cleanup: Ignore nonexisting resources
2024-07-18 19:23:48 +01:00
David Esparza
1fdc5c1183
Merge pull request #10028 from amshinde/upgrade-blogbench-1.2
metric: Upgrade blogbench to 1.2
2024-07-18 11:30:17 -06:00
Hyounggyu Choi
a7e4d3b738 tests: Call repack_secure_image() in set_metadata_annotation()
It is not good practice to call repack_secure_image() from a bats file
because the test code might not consider cases where `qemu-se` is used
as `KATA_HYPERVISOR`.

This commit moves the function call to set_metadata_annotation() if a key
includes `kernel_params` and `KATA_HYPERVISOR` is set to `qemu-se`, allowing
developers to focus on the test scenario itself.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-07-18 18:09:45 +02:00
Dan Mihai
035a42baa4 tests: k8s-credentials-secrets: policy for second pod
Add policy to pod-secret-env.yaml from k8s-credentials-secrets.bats.

Policy was already auto-generated for the other pod used by the same
test (pod-secret.yaml). pod-secret-env.yaml was inconsistent,
because it was taking advantage of the "allow all" policy built into
the Guest image. Sooner or later, CI Guests for CoCo will not get the
"allow all" policy built in anymore and pod-secret-env.yaml would
have stopped working then.

Note that pod-secret-env.yaml continues to use an "allow all" policy
after these changes. #10033 must be solved before a more restrictive
policy will be generated for pod-secret-env.yaml.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-07-18 15:03:57 +00:00
Hyounggyu Choi
d2ac01c862
Merge pull request #10032 from BbolroC/fix-image-authenticated-for-s390x
tests: Rebuild secure boot image for guest-pull-image-authenticated for IBM SE
2024-07-18 17:00:18 +02:00
Hyounggyu Choi
6e7ee4bdab tests: Rebuild secure image for guest-pull-image-authenticated on SE
Since #9904 was merged, newly introduced tests for `k8s-guest-pull-image-authenticated.bats`
have been failing on IBM SE (s390x). The agent fails to start because a kernel parameter
cannot pass to the guest VM via annotation. To fix this, the boot image must be rebuilt with
updated parameters.

This commit adds the rebuilding step in create_pod_yaml_with_private_image() for `qemu-se`.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-07-18 14:56:12 +02:00
Archana Shinde
1636c201f4 network: Implement network hotunplug for physical endpoints
Similar to HotAttach, the HotDetach method signature for network
endoints needs to be changed as well to allow for the method to make
use of device manager to manage the hot unplug of physical network
devices.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2024-07-17 16:42:41 -07:00
Archana Shinde
c6390f2a2a vfio: Introduce function to get vfio dev path
This function will be later used to get the vfio dev path.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2024-07-17 16:42:41 -07:00
Archana Shinde
1e304e6307 network: Implement hotplug for physical endpoints
Enable physical network interfaces to be hotplugged.
For this, we need to change the signature of the HotAttach method
to make use of Sandbox instead of Hypervisor. Similar approach was
followed for Attach method, but this change was overlooked for
HotAttach.
The signature change is required in order to make use of
device manager and receiver for physical network
enpoints.

Fixes: #8405

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2024-07-17 16:42:40 -07:00
Archana Shinde
2fef4bc844 vfio: use driver_override field for device binding.
The current implementation for device binding using driver bind/unbind
and new_id fails in the scenario when the physical device is not bound
to a driver before assigning it to vfio.
There exists and updated mechanism to accomplish the same that does not
have the same issue as above.
The driver_override field for a device allows us to specify the driver for a device
rather than relying on the bound driver to provide a positive match of the
device. It also has other advantages referenced here:
https://patchwork.kernel.org/project/linux-pci/patch/1396372540.476.160.camel@ul30vt.home/

So use the updated driver_override mechanism for binding/unbinding a
physical device/virtual function to vfio-pci.

Signed-off-by: liangxianlong <liang.xianlong@zte.com.cn>
Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2024-07-17 16:42:40 -07:00
GabyCT
6aff5f300a
Merge pull request #10021 from GabyCT/topic/fixarchdoc
docs: Update devmapper docs
2024-07-17 14:56:40 -06:00
Saul Paredes
57d2ded3e2 gha: enable autogenerated policy testing on
SEV-SNP

Enable autogenerated policy testing on SEV-SNP

Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
2024-07-17 13:32:06 -07:00
Archana Shinde
30e5e88ff1 metric: Upgrade blogbench to 1.2
Move to blogbench 1.2 version from 1.1.
This version includes an important fix for the read_score test
which was reported to be broken in the previous version.
It essentially fixes this issue here:
https://github.com/jedisct1/Blogbench/issues/4

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2024-07-17 11:32:09 -07:00
Steve Horsman
e5d5284761
Merge pull request #10026 from wainersm/release_370
release: Bump VERSION to 3.7.0
2024-07-17 18:43:51 +01:00
Wainer dos Santos Moschetta
6f7ab31860 release: Bump VERSION to 3.7.0
On preparation for the 3.7.0 release, bumped the version in VERSION file.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-07-17 14:19:44 -03:00
Saul Paredes
b3cc8b200f gha: enable autogenerated policy testing on SEV
Enable autogenerated policy testing on SEV

Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
2024-07-17 09:55:13 -07:00
Dan Mihai
f31c1b121e
Merge pull request #9812 from microsoft/saulparedes/test_policy_on_tdx
gha: enable policy testing on TDX
2024-07-17 08:47:44 -07:00