Commit Graph

15792 Commits

Author SHA1 Message Date
Fabiano Fidêncio
e5cc9acab8
Merge pull request #11175 from kata-containers/dependabot/cargo/src/agent/crossbeam-channel-0.5.15
build(deps): bump crossbeam-channel from 0.5.14 to 0.5.15 in /src/agent
2025-04-29 14:13:25 +02:00
Fabiano Fidêncio
a9893e83b8
Merge pull request #11203 from stevenhorsman/high-severity-security-bumps-april-25
rust: High severity security bumps april 25
2025-04-29 14:10:05 +02:00
Steve Horsman
57527c1ce4
Merge pull request #11161 from kata-containers/dependabot/go_modules/src/runtime/golang.org/x/net-0.38.0
build(deps): bump golang.org/x/net from 0.33.0 to 0.38.0 in /src/runtime
2025-04-29 09:39:30 +01:00
stevenhorsman
c938c75af0 versions: kata-ctl: Bump rustls
Bump rustls version to > 0.21.11 to remediate
high severity CVE-2024-32650

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-04-28 14:55:59 +01:00
stevenhorsman
2ee7ef6aa3 versions: agent-ctl: Bump hashbrown
Bump hashbrown to >= 0.15.1 to remediate the high severity
security alert that was in v0.15.0

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-04-28 14:55:46 +01:00
stevenhorsman
e3d3a2843f versions: Bump mio to at least 0.8.11
Ensure that all the versions of mio we use are at
least 0.8.11 to remediate CVE-2024-27308

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-04-28 14:55:46 +01:00
stevenhorsman
973bd7c2b6 build(deps): bump golang.org/x/net from 0.33.0 to 0.38.0 in /src/runtime
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.33.0 to 0.38.0.
- [Commits](https://github.com/golang/net/compare/v0.33.0...v0.38.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-04-28 14:09:54 +01:00
Steve Horsman
9248634baa
Merge pull request #11098 from stevenhorsman/golang-1.23.7
versions: Bump golang version
2025-04-28 13:46:11 +01:00
Fabiano Fidêncio
ee344aa4e9
Merge pull request #11185 from fidencio/topic/reclaim-guest-freed-memory-backport-from-runtime-rs
runtime: clh: Add reclaim_guest_freed_memory [BACKPORT]
2025-04-28 12:32:33 +02:00
Steve Horsman
4f703e376b
Merge pull request #11201 from BbolroC/remove-non-tee-from-required-tests
ci: Remove run-k8s-tests-coco-nontee from required tests
2025-04-28 10:05:07 +01:00
Hyounggyu Choi
9fe70151f7 ci: Remove run-k8s-tests-coco-nontee from required tests
In #11044, `run-k8s-tests-coco-nontee` was set as requried by mistake.
This PR disables the test again.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2025-04-28 10:48:08 +02:00
Steve Horsman
83d31b142b
Merge pull request #11044 from Jakob-Naucke/basic-s390x-ci
ci: Extend basic s390x tests
2025-04-28 09:14:00 +01:00
Fupan Li
3457572130
Merge pull request #10579 from Apokleos/pcilibs-rs
kata-sys-utils: Introduce pcilibs for getting pci devices info
2025-04-27 16:39:40 +08:00
Alex Lyn
43b5a616f6
Merge pull request #11166 from Apokleos/memcfg-adjust
kata-types: Optimize memory adjuesting by only gathering memory info
2025-04-27 15:57:45 +08:00
Fabiano Fidêncio
b747f8380e clh: Rework CreateVM to reduce the amount of cycles
Otherwise the static checks will whip us as hard as possible.

Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
2025-04-25 21:30:47 +02:00
Champ-Goblem
9f76467cb7 runtime: clh: Add reclaim_guest_freed_memory [BACKPORT]
We're bringing to *Cloud Hypervisor only* the reclaim_guest_freed_memory
option already present in the runtime-rs.

This allows us to use virtio-balloon for the hypervisor to reclaim
memory freed by the guest.

The reason we're not touching other hypervisors is because we're very
much aware of avoiding to clutter the go code at this point, so we'll
leave it for whoever really needs this on other hypervisor (and trust
me, we really do need it for Cloud Hypervisor right now ;-)).

Signed-off-by: Champ-Goblem <cameron@northflank.com>
Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
2025-04-25 21:05:53 +02:00
Fabiano Fidêncio
1c72d22212
Merge pull request #11186 from fidencio/topic/kernel-add-taskstats-to-the-config
kernel: Add CONFIG_TASKSTATS (and related) configs
2025-04-25 15:28:04 +02:00
Steve Horsman
213f9ddd30
Merge pull request #11191 from fidencio/topic/release-3.16.0-bump
release: Bump version to 3.16.0
2025-04-25 09:04:31 +01:00
Fabiano Fidêncio
fc4e10b08d release: Bump version to 3.16.0
Bump VERSION and helm-chart versions

Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
2025-04-25 08:17:15 +02:00
Fabiano Fidêncio
b96685bf7a
Merge pull request #11153 from fidencio/topic/build-allow-choosing-which-runtime-will-be-built
build: Allow users to build the go, rust, or both runtimes
2025-04-25 08:13:07 +02:00
Fabiano Fidêncio
800c05fffe
Merge pull request #11189 from kata-containers/sprt/fix-create-cluster
temp: ci: Fix AKS cluster creation
2025-04-24 23:01:12 +02:00
Aurélien Bombo
1de466fe84 temp: ci: Fix AKS cluster creation
The AKS CLI recently introduced a regression that prevents using
aks-preview extensions (Azure/azure-cli#31345), and hence create
CI clusters.

To address this, we temporarily hardcode the last known good version of
aks-preview.

Note that I removed the comment about this being a Mariner requirement,
as aks-preview is also a requirement of AKS App Routing, which will
be introduced soon in #11164.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2025-04-24 15:06:14 -05:00
Dan Mihai
706c2e2d68
Merge pull request #11184 from microsoft/danmihai1/retry-genpolicy
ci: retry genpolicy execution
2025-04-24 08:01:22 -07:00
Champ-Goblem
cf4325b535 kernel: Add CONFIG_TASKSTATS (and related) configs
Knowing that the upstream project provides a "ready to use" version of
the kernel, it's good to include an easy way to users to monitor
performance, and that's what we're doing by enabling the TASKSTATS (and
related) kernel configs.

This has been present as part of older kernels, but I couldn't
reasonably find the reason why it's been dropped.

Signed-off-by: Champ-Goblem <cameron@northflank.com>
Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
2025-04-24 11:51:21 +02:00
Fabiano Fidêncio
7e9e9263d1 build: Allow users to build the go, rust, or both runtimes
Let's add a RUNTIME_CHOICE env var that can be passed to be build
scripts, which allows the user to select whether they bulld the go
runtime, the rust runtime, or both.

Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
2025-04-24 10:36:26 +02:00
Alex Lyn
8b49564c01
Merge pull request #10610 from Xynnn007/faet-initdata-rbd
Feat | Implement initdata for bare-metal/qemu hypervisor
2025-04-24 09:59:14 +08:00
Alex Lyn
e8f19609b9
Merge pull request #11150 from zvonkok/cdi-annotations
gpu: Fix CDI annotations
2025-04-24 09:58:16 +08:00
Dan Mihai
517d6201f5 ci: retry genpolicy execution
genpolicy is sending more HTTPS requests than other components during
CI so it's more likely to be affected by transient network errors
similar to:

ConnectError(
  "dns error",
  Custom {
     kind: Uncategorized,
     error: "failed to lookup address information: Try again",
  },
)

Note that genpolicy is not the only component hitting network errors
during CI. Recent example from a different component:

"Message:  failed to create containerd task: failed to create shim task:
 failed to async pull blob stream HTTP status server error (502 Bad Gateway)"

This CI change might help just with the genpolicy errors.

Fixes: #11182

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2025-04-23 21:38:12 +00:00
Zvonko Kaiser
3946435291 gpu: Handle VFIO devices with DevicePlugin and CDI
We can provide devices during cold-plug with CDI annotation on a Pod
level and add per container device information wit the device plugin.
Since the sandbox has already attached the VFIO device remove them
from consideration and just apply the inner runtime CDI annotation.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-04-23 21:02:06 +00:00
Zvonko Kaiser
486244b292 gpu: Remove unneeded parsing of CDI devices
The addition of CDI devices is now done for single_container
and pod_sandbox and pod_container before the devmanager creates
the deviceinfos no need for extra parsing.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-04-23 21:02:06 +00:00
Zvonko Kaiser
6713db8990 gpu: Add CDI parsing for Sandbox as well
Extend the CDI parsing for pod_sandbox as well, only single_container
was covered properly.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-04-23 21:02:06 +00:00
Zvonko Kaiser
97f4bcb456 gpu: Remove CDI annotations for outer runtime
After the outer runtime has processed the CDI annotation from the
spec we can delete them since they were converted into Linux
devices in the OCI spec.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-04-23 21:02:06 +00:00
Steve Horsman
6102976d2d
Merge pull request #11178 from stevenhorsman/gperf-mirror
versions: Switch gperf mirror
2025-04-23 20:21:42 +01:00
stevenhorsman
09052faaa0 versions: Switch gperf mirror
Every so often the main gnu site has an outage, so
we can't download gperf. GNU providesthe generic URL https://ftpmirror.gnu.org to
automatically choose a nearby and up-to-date mirror,
so switch to this to help avoid this problem

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-04-23 15:29:54 +01:00
stevenhorsman
ed56050a99 versions: Bump golangci-lint version
v1.60.0+ is needed for go 1.23 support, so
bump to the current latest 1.x version

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-04-23 12:37:48 +01:00
stevenhorsman
1c9d7ce0eb ci: cri-containerd: Remove source from install_go.sh
If the correct version of go is already installed then
install_go.sh runs `exit`. When calling this as source from
cri-containerd/gha-run.sh it means all dependencies after
are skipped, so remove this.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-04-23 12:37:48 +01:00
stevenhorsman
c37840ce80 versions: Bump golang version
Bump golang version to the latest minor 1.23.x release
now that 1.24 has been released and 1.22.x is no longer
stable and receiving security fixes

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-04-23 12:37:48 +01:00
dependabot[bot]
463fd4eda4
build(deps): bump crossbeam-channel from 0.5.14 to 0.5.15 in /src/agent
Bumps [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam) from 0.5.14 to 0.5.15.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-channel-0.5.14...crossbeam-channel-0.5.15)

---
updated-dependencies:
- dependency-name: crossbeam-channel
  dependency-version: 0.5.15
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-23 11:34:14 +00:00
Steve Horsman
1ffce3ff70
Merge pull request #11173 from stevenhorsman/update-before-install
workflows: Add apt update before install
2025-04-23 12:32:54 +01:00
stevenhorsman
ccfdf59607 workflows: Add apt update before install
Add apt/apt-get updates before we do
apt/apt-get installs to try and help with
issues where we fail to fetch packages

Co-authored-by: Fabiano Fidêncio <fidencio@northflank.com>
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-04-23 09:06:08 +01:00
Xynnn007
b1c72c7094 test: add integration test for initdata
This test we will test initdata in the following logic
1. Enable image signature verification via kernel commandline
2. Set Trustee address via initdata
3. Pull an image from a banned registry
4. Check if the pulling fails with log `image security validation
failed` the initdata works.

Note that if initdata does not work, the pod still fails to launch. But
the error information is `[CDH] [ERROR]: Get Resource failed` which
internally means that the KBS URL has not been set correctly.

This test now only runs on qemu-coco-dev+x86_64 and qemu-tdx

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
2025-04-23 15:55:04 +08:00
RuoqingHe
ef12dcd7da
Merge pull request #11158 from RuoqingHe/2025-04-15-fix-flag-calc
runtime-rs: Use bitwise or assign for bitflags
2025-04-23 15:20:33 +08:00
alex.lyn
9eb3fcb84b kata-types: Clean up noise caused by unformatted code
For a long time, there has been unformatted code in the kata-types
codebase, for example:
```
if qemu.memory_info.enable_guest_swap {
-                return Err(eother!(
-                    "Qemu hypervisor doesn't support enable_guest_swap"
-                ));
+                return Err(eother!("Qemu hypervisor doesn't support
enable_guest_swap"));
             }
...
-    }, device::DRIVER_NVDIMM_TYPE, eother, resolve_path
+    },
+    device::DRIVER_NVDIMM_TYPE,
+    eother, resolve_path,
-use std::collections::HashMap;
-use anyhow::{Result, anyhow};
+use anyhow::{anyhow, Result};
 use std::collections::hash_map::Entry;
+use std::collections::HashMap;
-/// DRIVER_VFIO_PCI_GK_TYPE is the device driver for vfio-pci 
+/// DRIVER_VFIO_PCI_GK_TYPE is the device driver for vfio-pci
```
This has brought unnecessary difficulties in version maintenance and
commit difficulties. This commit will address this issue.

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-04-23 09:40:07 +08:00
alex.lyn
97a1942f86 kata-types: Optimize memory adjuesting by only gathering memory info
The Coniguration initialization was observed to be significantly slow
due to the extensive system information gathering performed by
`sysinfo::System::new_all()`. This function collects data on CPU,
memory, disks, and network, most of which is unnecessary for Kata's
memory adjusting config phase, where only the total system memory is
required.

This commit optimizes the initialization process by implementing a more
targeted approach to retrieve only the total system memory. This avoids
the overhead of collecting a large amount of irrelevant data, resulting
in a noticeable performance improvement.

Fixes #11165

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-04-23 09:40:07 +08:00
alex.lyn
3e77377be0 kata-sys-utils: Add test cases for devices
In this, the crate mockall is introduced to help
mock get_all_devices.

Fixes #10556

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-04-23 09:32:04 +08:00
alex.lyn
f714b6c049 kata-sys-utils: Add test cases for pci manager
Fixes #10556

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-04-23 09:32:04 +08:00
alex.lyn
0cdc05ce0a kata-sys-utils: Introduce method to help handle proper BAR memory
We need more information (BAR memory and other future
ures...)for
PCI devices when vfio devices passed through.
So the method get_bars_max_addressable_memory is introduced for vfio
devices to deduce the memory_reserve and pref64_reserve for NVIDIA

devices. But it will be extended for other devices.

Fixes #10556

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-04-23 09:32:04 +08:00
alex.lyn
f5eaaa41d5 kata-sys-utils: Introduce pcilibs to help get pci device info
It's the basic framework for getting information of pci devices.
Currently, we focus on the PCI Max bar memory size, but it'll be
extended in the future.

Fixes #10556

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-04-23 09:32:04 +08:00
Ruoqing He
d7f4b6cbef runtime-rs: Use bitwise or assign for bitflags
Use `|=` instead of `+=` while calculating and iterating through a
vector of flags, which makes more sense and prevents situations like
duplicated flags in vector, which would cause problems.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-04-22 23:55:11 +00:00
Jakob Naucke
1c3b1f5adb ci: Extend basic s390x tests
Currently, s390x only tests cri-containerd. Partially converge to the
feature set of basic-ci-amd64:

- containerd-sandboxapi
- containerd-stability
- docker

with the appropriate hypervisors.
Do not run tests currently skipped on amd64, as well as

- agent-ctl, which we don't package for s390x
- nerdctl, does not package the `full` image for s390x
- nydus, does not package for s390x

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
Co-authored-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2025-04-22 21:34:02 +02:00