Commit Graph

13481 Commits

Author SHA1 Message Date
dependabot[bot]
391bc35805 build(deps): bump the go_modules group across 5 directories with 8 updates
Bumps the go_modules group with 2 updates in the /src/runtime directory: [github.com/containerd/containerd](https://github.com/containerd/containerd) and [github.com/containers/podman/v4](https://github.com/containers/podman).
Bumps the go_modules group with 4 updates in the /src/tools/csi-kata-directvolume directory: [golang.org/x/sys](https://github.com/golang/sys), google.golang.org/protobuf, [golang.org/x/net](https://github.com/golang/net) and [google.golang.org/grpc](https://github.com/grpc/grpc-go).
Bumps the go_modules group with 2 updates in the /src/tools/log-parser directory: [golang.org/x/sys](https://github.com/golang/sys) and gopkg.in/yaml.v3.
Bumps the go_modules group with 2 updates in the /tests directory: [golang.org/x/sys](https://github.com/golang/sys) and gopkg.in/yaml.v3.
Bumps the go_modules group with 2 updates in the /tools/testing/kata-webhook directory: [golang.org/x/sys](https://github.com/golang/sys) and [golang.org/x/net](https://github.com/golang/net).


Updates `github.com/containerd/containerd` from 1.7.2 to 1.7.11
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.7.2...v1.7.11)

Updates `github.com/containers/podman/v4` from 4.2.0 to 4.9.4
- [Release notes](https://github.com/containers/podman/releases)
- [Changelog](https://github.com/containers/podman/blob/v4.9.4/RELEASE_NOTES.md)
- [Commits](https://github.com/containers/podman/compare/v4.2.0...v4.9.4)

Updates `google.golang.org/protobuf` from 1.29.1 to 1.33.0

Updates `github.com/cyphar/filepath-securejoin` from 0.2.3 to 0.2.4
- [Release notes](https://github.com/cyphar/filepath-securejoin/releases)
- [Commits](https://github.com/cyphar/filepath-securejoin/compare/v0.2.3...v0.2.4)

Updates `golang.org/x/sys` from 0.15.0 to 0.19.0
- [Commits](https://github.com/golang/sys/compare/v0.15.0...v0.19.0)

Updates `google.golang.org/protobuf` from 1.31.0 to 1.33.0

Updates `golang.org/x/net` from 0.19.0 to 0.23.0
- [Commits](https://github.com/golang/net/compare/v0.19.0...v0.23.0)

Updates `google.golang.org/grpc` from 1.59.0 to 1.63.2
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.59.0...v1.63.2)

Updates `golang.org/x/sys` from 0.0.0-20191026070338-33540a1f6037 to 0.1.0
- [Commits](https://github.com/golang/sys/compare/v0.15.0...v0.19.0)

Updates `gopkg.in/yaml.v3` from 3.0.0-20200313102051-9f266ea9e77c to 3.0.0

Updates `golang.org/x/sys` from 0.0.0-20220429233432-b5fbb4746d32 to 0.19.0
- [Commits](https://github.com/golang/sys/compare/v0.15.0...v0.19.0)

Updates `gopkg.in/yaml.v3` from 3.0.0-20210107192922-496545a6307b to 3.0.0

Updates `golang.org/x/sys` from 0.15.0 to 0.19.0
- [Commits](https://github.com/golang/sys/compare/v0.15.0...v0.19.0)

Updates `golang.org/x/net` from 0.19.0 to 0.23.0
- [Commits](https://github.com/golang/net/compare/v0.19.0...v0.23.0)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd
  dependency-type: direct:production
  dependency-group: go_modules
- dependency-name: github.com/containers/podman/v4
  dependency-type: direct:production
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-type: direct:production
  dependency-group: go_modules
- dependency-name: github.com/cyphar/filepath-securejoin
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/sys
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  dependency-group: go_modules
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  dependency-group: go_modules
- dependency-name: golang.org/x/sys
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: gopkg.in/yaml.v3
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/sys
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: gopkg.in/yaml.v3
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/sys
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-type: indirect
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-30 09:46:13 +01:00
Wainer Moschetta
eae429a39b
Merge pull request #9552 from wainersm/kata_cc_dev
runtime: new qemu-coco-dev configuration
2024-04-30 05:21:49 -03:00
Zvonko Kaiser
28078ded84
Merge pull request #9570 from stevenhorsman/dependabot-commit-check-skip
workflow: static-checks: Skip commit checks for dependabout
2024-04-29 23:00:35 +02:00
Pavel Mores
1dd06cf40d
Merge pull request #9551 from pmores/support-iommu
runtime-rs: support IOMMU in qemu VMs
2024-04-29 15:26:11 +02:00
stevenhorsman
0bec8721cc workflow: Skip commit checks for dependabout
Dependabot doesn't follow all our commit format guidelines,
so add a check and skip these if the author is `dependabot[bot]`

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-04-29 13:45:51 +01:00
Wainer dos Santos Moschetta
631f6f6ed6 gha: switch CoCo tests on non-TEE to use qemu-coco-dev
With the addition of the 'qemu-coco-dev' runtimeClass we no longer need
to run CoCo tests on non-TEE environments with 'qemu'. As a result the
tests also no longer need to set the "io.katacontainers.config.hypervisor.image"
annotation to pods.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-04-29 05:45:11 -03:00
Wainer dos Santos Moschetta
c6708726ff kata-deploy: install the new kata-qemu-coco-dev runtimeclass
Created the runtimeclasses/kata-qemu-coco-dev.yaml file and updated the list
of SHIMS.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-04-29 05:45:11 -03:00
Wainer dos Santos Moschetta
42fb5d7760 runtime: new qemu-coco-dev configuration
Created a new configuration to configure Kata for CoCo without requiring TEE
hardware so to allow developers implement/test/debug platform agnostic code
on their workstations. It will also ease testing of CoCo features on CI with
non-TEE supported VMs.

This is based off qemu configuration. The following differences applied:
 - switched to confidential guest image/initrd
 - switched to confidential kernel
 - switched to 9p shared_fs

Fixes #9487
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-04-29 05:45:10 -03:00
Fabiano Fidêncio
7b039eb1b9
Merge pull request #9559 from fidencio/topic/remove-opa-stuff
rootfs: Stop building and shipping OPA
2024-04-28 12:52:07 +02:00
Fabiano Fidêncio
fe21d7a58b
rootfs: Stop building and shipping OPA
Since OPA binary was replaced by the regorus crate, we can finally stop
building and shipping the binary.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-04-26 18:51:28 +02:00
Fabiano Fidêncio
7dd2fde22d
Revert "rootfs: Make OPA build working in docker for s390x and ppc64le"
This reverts commit d523e865c0, as we will
not depend on the OPA binary anymore.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-04-26 18:51:27 +02:00
Hyounggyu Choi
62bad976e0
Merge pull request #9562 from BbolroC/bump-golang
build: Update golang version to 1.22.2
2024-04-26 17:58:04 +02:00
Steve Horsman
34a1cdc5c7
Merge pull request #9528 from cncal/patch-1
doc: fix missing document link
2024-04-26 15:22:15 +01:00
Hyounggyu Choi
80cb4a6c18 build: Update golang version to 1.22.2
As we have an issue with a golang version for `run-cri-containerd`,
it is required to bump the language.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-04-26 15:50:29 +02:00
Pavel Mores
908ec31d9b runtime-rs: fix iommu_platform support for qemu vhost-user-fs device
iommu_platform support was already added on initial DeviceVhostUserFs
introduction, however it incorrectly enabled iommu_platform also on
non-CCW (e.g. PCI) systems.

Signed-off-by: Pavel Mores <pmores@redhat.com>
2024-04-26 14:48:00 +02:00
Pavel Mores
174fc8f44b runtime-rs: support iommu_platform for qemu virtio-net device
Note that it's only supported on CCW systems.

Signed-off-by: Pavel Mores <pmores@redhat.com>
2024-04-26 14:48:00 +02:00
Pavel Mores
0d038f20cc runtime-rs: support iommu_platform for qemu virtio-serial device
iommu_platform is only turned on for CCW systems.

PartialEq is added to VirtioBusType to enable the '==' operator.

Signed-off-by: Pavel Mores <pmores@redhat.com>
2024-04-26 14:48:00 +02:00
Pavel Mores
66a2dc48ae runtime-rs: support iommu_platform for qemu vhost-vsock device
iommu_platform addition is controlled solely by the configuration file.

Signed-off-by: Pavel Mores <pmores@redhat.com>
2024-04-26 14:48:00 +02:00
Pavel Mores
d1e6f9cc4e runtime-rs: add IOMMU to qemu VM if configured
The adding itself is done by a new function add_iommu() that conforms with
the add_*() convention.  Note though that this function is called
internally, by the QemuCmdLine constructor, simply because there's nothing
to trigger its invocation from QemuInner (unlike the other add_*()
functions so far).

Signed-off-by: Pavel Mores <pmores@redhat.com>
2024-04-26 14:48:00 +02:00
Pavel Mores
0859f47a17 runtime-rs: add representation of '-device intel-iommu' to qemu-rs
Following the golang shim example, the values are hardcoded.

Signed-off-by: Pavel Mores <pmores@redhat.com>
2024-04-26 14:47:51 +02:00
Pavel Mores
702bf0d35e runtime-rs: support qemu machine's 'kernel_irqchip' param
We will want to set kernel_irqchip when enabling IOMMU and this commit
adds the requisite support.

Signed-off-by: Pavel Mores <pmores@redhat.com>
2024-04-26 14:42:54 +02:00
Alex Lyn
f72c6ba814
Merge pull request #9519 from emanuellima1/impl-rtc
runtime-rs: Add RTC to QEMU cmdline
2024-04-26 17:44:47 +08:00
Dan Mihai
b42ddaf15f
Merge pull request #9530 from microsoft/saulparedes/improve_caching
genpolicy: changing caching so the tool can run concurrently with itself
2024-04-25 13:06:23 -07:00
David Esparza
ae317a319f
Merge pull request #9549 from JakubLedworowski/fix-tarball-dockerfile
build: Fix tarball not building correctly in docker
2024-04-25 09:40:20 -06:00
James O. D. Hunt
5bd614530f
Merge pull request #9525 from jodh-intel/gha-k8s-ch-dm
gha: Enable k8s tests for cloud hypervisor with devicemapper
2024-04-25 09:28:09 +01:00
Fabiano Fidêncio
b4360e7e37
Merge pull request #9510 from microsoft/danmihai1/regorus-policy2
agent: use regorus instead of opa
2024-04-24 21:40:29 +02:00
James O. D. Hunt
ff7349b6f0 gha: Enable k8s tests for cloud hypervisor with devicemapper
Enable the k8s tests for cloud hypervisor with devicemapper.

Fixes: #9221.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Co-authored-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-04-24 16:32:51 +01:00
Dan Mihai
2400a4d249
Merge pull request #9428 from arc9693/archana1/genplicyfixes
genpolicy: implement default methods for K8sResource trait
2024-04-24 08:04:19 -07:00
Dan Mihai
ff385eac41 agent: remove unnecessary comment
Remove reminder to initialize Policy earlier, because currently there
are no plans to initialize earlier.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-24 14:53:51 +00:00
Jakub Ledworowski
73366da9f9 build: Fix tarball not building correctly in docker
When docker is installed on the host system using script from https://get.docker.com/ it automatically creates a docker group with gid=999.
Then during docker build process of tarball, eg. make qemu-tdx-experimental-tarball docker is also installed inside the image with the same
script, which also automatically adds docker group with gid=999.
Then, the build tries to add a new group docker_on_host with gid=999, which already exists, which breaks the build.

Signed-off-by: Jakub Ledworowski <jakub.ledworowski@intel.com>
2024-04-24 15:35:36 +02:00
Calvin Liu
56a73ee704 doc: fix missing document link
Document section hardware-requirements locates to /README.md for now.

Signed-off-by: Calvin Liu <flycalvin@qq.com>
2024-04-24 17:34:30 +08:00
Fabiano Fidêncio
4e35f11a3d
Merge pull request #9535 from fidencio/topic/fix-crio-debug-drop-in
kata-deploy: Stop append `log_level = "debug"` for CRI-O
2024-04-24 10:03:36 +02:00
Dan Mihai
89c85dfe84
Merge pull request #9432 from UiPath/fix-clh-wait
clh: isClhRunning waits for full timeout when clh exits
2024-04-23 13:02:45 -07:00
Hyounggyu Choi
608df9b7df
Merge pull request #9494 from BbolroC/guest-pull-gha-s390x
CC: Enable guest-pull tests on non-TEE for s390x
2024-04-23 21:22:37 +02:00
Dan Mihai
e5c3f5fa9b tests: no generated policy for untested platforms
Avoid auto-generating Policy on platforms that haven't been tested
yet with auto-generated Policy.

Support for auto-generated Policy on these additional platforms is
coming up in future PRs, so the tests being fixed here were
prematurely enabled.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-23 16:07:03 +00:00
Emanuel Lima
2bc5e3c6e2 runtime-rs: Add RTC to QEMU cmdline
Add RTC by hardcoding the ooptions base=utc,driftfix=slew,clock=host

Signed-off-by: Emanuel Lima <emlima@redhat.com>
2024-04-23 10:46:30 -03:00
Fabiano Fidêncio
d190c9d4d9
kata-deploy: Stop append log_level = "debug" for CRI-O
This should only be done once, and if CRI-O restarts, there's a big
chance kata-deploy will also restart and the user would end up with a
file that looks like:
```
[crio]
log_level = "debug"
[crio]
log_level = "debug"
[crio]
log_level = "debug"
...
```

And that would simply cause CRI-O to not start.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-04-23 14:51:35 +02:00
Greg Kurz
42a79801f3
Merge pull request #9524 from littlejawa/fix_createruntime_hook_not_called
runtime: Call CreateRuntime hooks at container creation time
2024-04-23 13:43:36 +02:00
Fupan Li
469c4e4f44
Merge pull request #9335 from Tim-Zhang/fix-passfd-fifo-open
passfd-io: fix FIFO opening and vsock handling
2024-04-23 09:04:45 +08:00
Alex Lyn
bc2cf95e7a
Merge pull request #9517 from amshinde/update-storage-source-pciblock
runtime-rs: Update storage source for pci block devices
2024-04-23 07:32:36 +08:00
Dan Mihai
5d31eb4847 agent: use regorus 0.1.4
Use regorus 0.1.4 from crates.io, instead of its source code
repository.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-22 23:21:17 +00:00
Dan Mihai
ed6412b63c tests: k8s: reduce the policy tests output noise
Hide some of the kubectl output, to reduce the size and redundancy of
this output.

Fixes: #9388

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-22 19:59:33 +00:00
Dan Mihai
df23eb09a6 agent: use regorus instead of opa
Implement Agent Policy using the regorus crate instead of the OPA
daemon.

The OPA daemon will be removed from the Guest rootfs in a future PR.

Fixes: #9388

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-22 19:58:30 +00:00
Dan Mihai
58e608d61a tests: remove k8s-policy-set-keys.bats
Remove k8s-policy-set-keys.bats in preparation for using the regorus
crate instead of the OPA daemon for evaluating the Agent Policy. This
test depended on sending HTTP requests to OPA.

Fixes: #9388

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-22 19:49:38 +00:00
Dan Mihai
b509c1beee agent: lock anyhow version to 1.0.58
Lock anyhow version to 1.0.58 because:

- Versions between 1.0.59 - 1.0.76 have not been tested yet using
  Kata CI. However, those versions pass "make test" for the
  Kata Agent.

- Versions 1.0.77 or newer fail during "make test" - see
  https://github.com/kata-containers/kata-containers/issues/9538.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-22 19:49:15 +00:00
Archana Shinde
cc6b671101 runtime-rs: Update storage source for pci block devices
In case of block devices using virtio-block, we need to pass the
pci-path as the storage source field to the agent.
Current the virt-path is being passed which works just for mmio block
devices.
In the future when support is added for scsi, block-ccw and pmem
devices, the storage source would need to be handled accordingly.

Fixes: #9034

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2024-04-22 11:36:58 -07:00
Hyounggyu Choi
f10744df99 CC: Enable guest-pull tests on non-TEE for s390x
This commit is to add a new CI job to run-k8s-tests-on-zvsi.yaml.
Why the job is not configured in run-kata-coco-tests.yaml by having it
integrated with `run-k8s-tests-coco-nontee` is:

- It uses k3s instead of AKS
- It runs on a self-hosted runner

These differences make the integrated job not easy to read and maintain
when it comes to incorporating other platforms in the near future.

Fixes: #9467

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-04-22 17:15:20 +02:00
Greg Kurz
6ca0f09710
Merge pull request #9518 from microsoft/danmihai1/agent-cargo-lock
agent: update cargo.lock
2024-04-22 13:36:06 +02:00
Tim Zhang
aeba483ec8 agent: avoid fd leakage of passfd-io
In do_create_container and do_exec_process, we should create the proc_io first,
in case there's some error occur below, thus we can make sure
the io stream closed when error occur.

Signed-off-by: Tim Zhang <tim@hyper.sh>
Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2024-04-22 17:39:33 +08:00
Tim Zhang
8441187d5e runtime-rs: fix FIFO handling
Fixes: #9334

In linux, when a FIFO is opened and there are no writers, the reader
will continuously receive the HUP event. This can be problematic.
To avoid this problem, we open stdin in write mode and keep the stdin-writer

We need to open the stdout/stderr as the read mode and keep the open endpoint
until the process is delete. otherwise,
the process would exit before the containerd side open and read
the stdout fifo, thus runD would write all of the stdout contents into
the stdout fifo and then closed the write endpoint. Then, containerd
open the stdout fifo and try to read, since the write side had closed,
thus containerd would block on the read forever.
Here we keep the stdout/stderr read endpoint File in the common_process,
which would be destroied when containerd send the delete rpc call,
at this time the containerd had waited the stdout read return, thus it
can make sure the contents in the stdout/stderr fifo wouldn't be lost.

Signed-off-by: Tim Zhang <tim@hyper.sh>
Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2024-04-22 17:39:33 +08:00