Commit Graph

15536 Commits

Author SHA1 Message Date
Ryan Savino
1dbe3fb8bc tests: fix confidential ssh Dockerfile
Need to set correct permissions for ssh directories and files

Fixes: #11005

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2025-03-10 18:31:05 -05:00
Steve Horsman
730e007abd
Merge pull request #11000 from microsoft/danmihai1/print-exec-output2
tests: k8s: log kubectl exec ouput
2025-03-10 09:31:41 +00:00
Fupan Li
df9c6ae9d7
Merge pull request #10998 from teawater/ma_config
runtime-rs: Add mem-agent config to clh and qemu config file
2025-03-10 16:23:20 +08:00
Dan Mihai
509e6da965 tests: k8s-env.bats: log exec output
Log the "kubectl exec" ouput, just in case it helps investigate sporadic
test errors like:

https://github.com/kata-containers/kata-containers/actions/runs/13724022494/job/38387329321?pr=10973

not ok 1 Environment variables
(in test file k8s-env.bats, line 37)
 `grep "HOST_IP=\([0-9]\+\(\.\|$\)\)\{4\}"' failed

It appears that the first exec from this test case produced the expected
output:

MY_POD_NAME=test-env

but the second exec produced something else - that will be logged after
this change.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2025-03-07 19:37:20 +00:00
Dan Mihai
95d47e4d05 tests: k8s-configmap.bats: log exec output
Log the "kubectl exec" ouput, just in case it helps investigate sporadic
test errors like:

https://github.com/kata-containers/kata-containers/actions/runs/13724022494/job/38387329268?pr=10973

not ok 1 ConfigMap for a pod
(in test file k8s-configmap.bats, line 44)
`kubectl exec $pod_name -- "${exec_command[@]}" | grep "KUBE_CONFIG_2=value-2"' failed

It appears that the first exec from this test case produced the expected
output:

KUBE_CONFIG_1=value-1

but the second exec produced something else - that will be logged after
this change.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2025-03-07 19:35:45 +00:00
Dan Mihai
caee12c796 tests: k8s: add function to log exec output
grep_pod_exec_output invokes "kubectl exec", logs its output, and checks
that a grep pattern is present in the output.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2025-03-07 19:34:57 +00:00
Steve Horsman
014ff8476a
Merge pull request #10992 from microsoft/danmihai1/git-helper
gha: always delete workspace on rebase error
2025-03-07 14:26:00 +00:00
Steve Horsman
cb682ef3c8
Merge pull request #10987 from RuoqingHe/enable-docker-on-riscv
kata-deploy: Use docker.io for all architectures
2025-03-07 11:14:19 +00:00
Xuewei Niu
0671252466
Merge pull request #10760 from lifupan/route_flags_suport 2025-03-07 18:18:01 +08:00
Hui Zhu
691430ca95 runtime-rs: Add mem-agent config to clh and qemu config file
Add mem-agent config to clh and qemu config file.

Fixes: #10996

Signed-off-by: Hui Zhu <teawater@antgroup.com>
2025-03-07 15:54:59 +08:00
Fupan Li
9a4c0a5c5c agent: add the route flags support when adding routes
Get the route entry's flags passed from host and
set it in the add route request.

Fixes: #7934

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2025-03-07 09:56:08 +08:00
Fupan Li
d929bc0224 agent: refactor the code of update routes/interfaces
We can use the netlink update method to add a route or an interface
address. There is no need to delete it first and then add it. This can
save two system commissions.

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2025-03-07 09:56:08 +08:00
Fupan Li
aad915a7a1 agent: upgrade the netlink related crates
Upgrade rtnetlink and related crates to support
route flags.

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2025-03-07 09:56:08 +08:00
Fupan Li
0995c6528e runtime-rs: add the route flags support
Get the route entry's flags from the host and
pass it into kata-agent to add route entries
with flags support.

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2025-03-07 09:56:08 +08:00
Fupan Li
cda6d0e36c runtime-rs: upgrade the netlink related crates
Upgrade netlink-packet-route and rtnetlink to support
route flags.

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2025-03-07 09:56:08 +08:00
Fupan Li
1ade2a874f runtime: add the flags support to the route setting
We should support the flags when add the route from
host to guest. Otherwise, some route would be set
failed.

Fixes: #7934

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2025-03-07 09:56:08 +08:00
Dan Mihai
7b63f256e5 gha: fix git-helper issues reported by shellcheck
./tests/git-helper.sh:20:5: note: Prefer [[ ]] over [ ] for tests in Bash/Ksh. [SC2292]
./tests/git-helper.sh:22:26: note: Double quote to prevent globbing and word splitting. [SC2086]
./tests/git-helper.sh:23:7: note: Prefer [[ ]] over [ ] for tests in Bash/Ksh. [SC2292]

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2025-03-06 20:28:41 +00:00
Dan Mihai
04adcdace6 gha: always delete workspace on rebase error
The workplace was already being deleted on non-x86_64 platforms, but
x86_64 can be affected by the same problem too. That might have been
the case with the SNP and TDX test runs from:

https://github.com/kata-containers/kata-containers/actions/runs/13687511270/job/38313758751?pr=10973
https://github.com/kata-containers/kata-containers/actions/runs/13687511270/job/38313760086?pr=10973

Rebase worked fine for the same patch/PR on other platforms.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2025-03-06 20:24:09 +00:00
Ruoqing He
3a8131349e kata-deploy: Use docker.io for all archietcutres
Switch to `docker.io` provided by Ubuntu sources. It is not necessary
for us to install docker through `get-docker.sh`.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-07 02:22:31 +08:00
RuoqingHe
8ef8109b2f
Merge pull request #10985 from RuoqingHe/remove-s390x-conditional-compilation
runtime-rs: Remove s390x conditional compilation
2025-03-06 23:13:11 +08:00
Pavel Mores
133528a63c runtime-rs: remove snp_certs_path support
SNP certs were apparently obsoleted by AMD.

Signed-off-by: Pavel Mores <pmores@redhat.com>
2025-03-06 15:53:24 +01:00
Xuewei Niu
644af52968
Merge pull request #10876 from lifupan/fupan_containerd
ci: cri-containerd: upgrade the LTS / Active versions for containerd
2025-03-06 17:08:40 +08:00
Hyounggyu Choi
bf41618a84
Merge pull request #10862 from BbolroC/enable-ibm-se-for-qemu-runtime-rs
runtime-rs: Enable IBM SE for QEMU
2025-03-06 05:38:13 +01:00
Ruoqing He
ed6f57f8f6 runtime-rs: Restrict cloud-hypervisor feature
Cloud-Hypervisor currently only supports `x86_64` and `aarch64`, this
features should not be avaiable even if other architectures explicitly
requires it.

Restrict `cloud-hypervisor` feature to only `x86_64` and `aarch64`.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-06 11:21:57 +08:00
Ruoqing He
6f894450fe runtime-rs: Drop s390x target predicates
Drop `target_arch = "s390x"` all over `runtime-rs`, it is strange to
have such predicates on features and code while we do not support it.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-06 11:20:28 +08:00
Xuewei Niu
a54eed6bab
Merge pull request #10975 from teawater/fix_log_level
runtime-rs: Fix log_level's comments in configuration-dragonball.toml.in
2025-03-06 10:05:09 +08:00
Alex Lyn
2619b57411
Merge pull request #10937 from Apokleos/bugfix-useless-annotation
kata-types: Fix bugs related to annotations in kata-types
2025-03-06 09:37:29 +08:00
Hyounggyu Choi
c3e3ef7b25
Merge pull request #10981 from BbolroC/remove-sclp-console-s390x
runtime: Remove console=ttysclp0 for s390x
2025-03-05 21:43:57 +01:00
Fabiano Fidêncio
80e95bd264
Merge pull request #10966 from kata-containers/topic/tests-bring-back-kata-deploy-tests
tests: Bring back kata-deploy tests
2025-03-05 21:11:21 +01:00
Zvonko Kaiser
ae63bbb824
Merge pull request #10982 from zvonkok/fix-zvonkos-fix
agent: fix permisssion according to runc
2025-03-05 15:08:48 -05:00
Fabiano Fidêncio
545780a83a shellcheck: tests: k8s: Fix gha-run.sh warnings
As we'll touch this file during this series, let's already make sure we
solve all the needed warnings.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-03-05 19:44:27 +01:00
Fabiano Fidêncio
50f765b19c shellcheck: tests: Fix gha-run-k8s-common.sh warnings
Let's fix all the warnings caught in this file, as we're already
touching it.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-03-05 19:44:27 +01:00
Fabiano Fidêncio
219db60071 tests: kata-deploy: microk8s: Re-work installation
So we can ensure that the user has enough permissions to access
microk8s.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-03-05 19:44:27 +01:00
Fabiano Fidêncio
c337a21a4e shellcheck: kata-deploy: Fix warnings
He were fixing the few warnings we found in the files present in the
functional tests for kata-deploy.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-03-05 19:44:27 +01:00
Fabiano Fidêncio
fd832d0feb tests: kata-deploy: Run installation with only one VMM
It doesn't make much sense to test different VMMs as that wouldn't
trigger a different code path.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-03-05 19:44:27 +01:00
Fabiano Fidêncio
14bf653c35 tests: kata-deploy: Re-add tests, now using github runners
As GitHub runners now support nested virt, we're don't depend on garm
for those anymore.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-03-05 19:44:27 +01:00
Zvonko Kaiser
3cea080185 agent: fix permisssion according to runc
The previous PR mistakenly set all perms to 0o666 we should follow
what runc does and fetch the permission from the guest aka host
if the file_mode == 0. If we do not find the device on the guest aka
host fallback to 0.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-03-05 17:33:40 +00:00
Fupan Li
7024d3c600 CI: cri-containerd: upgrade the LTS / Active versions for containerd
As we're testing against the LTS and the Active versions of
containers, let's upgrade the lts version from 1.6 to 1.7 and
active version from 1.7 to 2.0 to cover the sandboxapi tests.

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2025-03-05 23:09:24 +08:00
Hyounggyu Choi
624f7bfe0b runtime: Remove console=ttysclp0 for s390x
After the introduction of the following kernel parameters (see #6163):

```
CONFIG_SCLP_VT220_TTY=y
CONFIG_SCLP_VT220_CONSOLE=y
```

the system log for Kata components (e.g., the agent) no longer appeared
on the SCLP console (i.e., /dev/ttysclp0). Let's switch to the default
fallback console (likely /dev/console) for logging.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2025-03-05 15:06:08 +01:00
Zvonko Kaiser
a5629f9bfa
Merge pull request #10971 from zvonkok/host-guest-mapping
agent: Enable VFIO and initContainers
2025-03-05 08:58:45 -05:00
Fabiano Fidêncio
504d9e2b66
Merge pull request #10976 from zvonkok/fix-dev-permissions
agent: Fix default linux device permissions
2025-03-05 13:54:06 +01:00
Hyounggyu Choi
4ea7d274c4 runtime-rs: Add new runtimeClass qemu-se-runtime-rs
When `KATA_HYPERVISOR` is set to `qemu-se-runtime-rs`,
a configuration file is properly referenced and a runtime class
should be created via kata-deploy.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2025-03-05 13:50:38 +01:00
Hyounggyu Choi
2c72cf5891 runtime-rs: Add SE configuration
A configuration file, `configuration-qemu-se-runtime-rs.toml`,
is referenced when the `qemu-se-runtime-rs` runtime is configured.
This commit adds a template file and updates the Makefile configuration
accordingly.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2025-03-05 13:50:38 +01:00
Hyounggyu Choi
65021caca6
Merge pull request #10963 from RuoqingHe/remove-arch-predicates-in-runtime-rs
runtime-rs: Enable Dragonball only for x86_64 & aarch64
2025-03-05 09:10:33 +01:00
Zvonko Kaiser
c73ff7518e agent: Fix default linux device permissions
We had the default permissions set to 0o000 if the file_mode was not
present, for most container devices this is the wrong default. Since
those devices are meant also to be accessed by users and others add a
sane default of 0o666 to devices that do not have any permissions set.

Otherwise only root can acess those and we cannot run containers as a
user.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-03-05 02:22:24 +00:00
Zvonko Kaiser
4bb0eb4590
Merge pull request #10954 from kata-containers/topic/metrics-kata-deploy
Rework and fix metrics issues
2025-03-04 20:22:53 -05:00
Hui Zhu
c3c3f23b33 runtime-rs: Fix log_level's comments in configuration-dragonball.toml.in
Add double quotes to fix log_level's comments in
configuration-dragonball.toml.in.

Fixes: #10974

Signed-off-by: Hui Zhu <teawater@antgroup.com>
2025-03-05 09:21:08 +08:00
Dan Mihai
edf6af2a43
Merge pull request #10955 from microsoft/cameronbaird/hyp-loglevel-default-upstream
runtime: Properly set default hyp loglevel to 1
2025-03-04 16:44:08 -08:00
Cameron Baird
d48116114e runtime: Properly set default hyp loglevel to 1
Tweak default HypervisorLoglevel config option for clh to 1.

Signed-off-by: Cameron Baird <cameronbaird@microsoft.com>
2025-03-04 20:36:40 +00:00
Zvonko Kaiser
248d04c20c agent: Enable VFIO and initContainers
We had a static mapping of host guest PCI addresses, which prevented to
use VFIO devices in initContainers. We're tracking now the host-guest
mapping per container and removing this mapping if a container is
removed.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-03-04 19:53:52 +00:00