Commit Graph

13813 Commits

Author SHA1 Message Date
Alex Lyn
946f0bdfff
Merge pull request #9609 from fidencio/topic/skip-pull-image-tests-on-tees
tests: pull-image: Don't run on TEEs
2024-05-09 08:22:55 +08:00
GabyCT
3b8a910393
Merge pull request #9596 from lifupan/main
db: fix the issue of failed to init pci root bus
2024-05-08 13:14:20 -06:00
Gabriela Cervantes
2fb406ed3a metrics: Fix random write value for FIO
This PR fixes the random write value for FIO for qemu by decreasing it
to avoid the random failures of the GHA CI.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-05-08 18:54:41 +00:00
Fabiano Fidêncio
142342012c
tests: pull-image: Don't run on TEEs
Let's skip those tests on TEEs as we've been facing a reasonable amount
of issues, most likely on the containerd side, related to pulling the
image on the guest.

Once we're able to fix the issues on containerd, we can get back and
re-enable those by reverting this commit.

The decision of disabling the tests for TEEs is because the machines may
end up in a state where human intervention is necessary to get them back
to a functional state, and that's really not optimal for our CI.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-08 18:40:22 +02:00
Fabiano Fidêncio
c0bf9e9bc6
Merge pull request #9607 from fidencio/topic/tdx-depend-on-distro-host-stack-part-I
ci: Stop building TDX specific QEMU and OVMF
2024-05-08 15:53:15 +02:00
Zvonko Kaiser
fb0b821771 kernel: Add caching of kernel-headers
Fixes: #9481

We need to cache the kernel-headers for the NVIDIA GPU initrd/image build.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-08 11:30:39 +00:00
Fabiano Fidêncio
12dc9f83df
ci: Stop building TDX specific QEMU and OVMF
This is the first step of the work to start relying on the artefacts
coming from the distros (CentOS 9 Stream, and Ubuntu) themselves.

Let's have this first one merged, as this will not run the CI due to the
changes being on the yaml itself, and then follow-up with the changes
needed on other parts of the project (kata-deploy, runtime, etc).

Fixes: #9590 -- part I

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-08 11:39:32 +02:00
Alex Lyn
875e6e3815
Merge pull request #9601 from cncal/fix_redundant_log
qemu: the error is logged only when it occurs
2024-05-08 08:59:01 +08:00
GabyCT
22087f9db9
Merge pull request #9598 from lifupan/main_shim
runtime-rs: fix the issue of the leak of dead shim
2024-05-07 10:14:11 -06:00
GabyCT
a564422b7b
Merge pull request #9582 from cncal/main
build: fix the confusing build message if yq doesn't exist in GOPATH/bin
2024-05-07 09:34:27 -06:00
Fabiano Fidêncio
cd84414c63
Merge pull request #9600 from GabyCT/topic/deleteoci
versions: Remove oci information from versions file
2024-05-07 13:15:35 +02:00
Fabiano Fidêncio
ddf6b367c7
Merge pull request #9568 from kata-containers/dependabot/go_modules/src/runtime/go_modules-22ef55fa20
build(deps): bump the go_modules group across 5 directories with 8 updates
2024-05-07 13:14:48 +02:00
Steve Horsman
e967db60ab
Merge pull request #9592 from sprt/mariner-before-ch39
tests: adapt Mariner CI to unblock CH v39 upgrade
2024-05-07 11:52:55 +01:00
cncal
15d511af97 qemu: the error is logged only when it occurs
Everytime I create contianer on arm64 machine, containerd/kata logs a redundant warning
as follows:
``` shell
time="2024-05-07" level=warning msg="<nil>" arch=arm64 name=containerd-shim-v2
pid=xxx sandbox=fdd1f05 source=virtcontainers/hypervisor
```
I added an error statement so that the error would be logged when it occurs.

Signed-off-by: cncal <flycalvin@qq.com>
2024-05-07 14:28:04 +08:00
Gabriela Cervantes
aecede11fc versions: Remove oci information from versions file
This PR removes oci information from versions file as this is not
longer being used in kata containers repository.

Fixes #9599

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-05-06 20:14:00 +00:00
Gabriela Cervantes
b54dc26073 gha: Enable uninstall kbs client function for coco gha workflow
This PR enables the uninstall kbs client function for coco gha tdx
workflow.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-05-06 15:55:24 +00:00
Gabriela Cervantes
aaf9b54d97 gha: Add support to install KBS to k8s TDX GHA workflow
This PR adds support to install KBS to k8s TDX GHA workflow in
order to run confidential attestation tests.

Fixes #9451

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-05-06 15:42:17 +00:00
Gabriela Cervantes
506e17a60d tests: Add k8s negative policy test
This PR adds a k8s negative policy test to the confidential attestation
bats test.

Fixes #9437

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-05-06 15:28:54 +00:00
Fupan Li
3694f3d9fe runtime-rs: fix the issue of the leak of dead shim
We should init and asign the runtime instance to runtime
handler, otherwise, if the pause container failed to start,
which means the runtime instance failed to start, then the
following delete & shutdown request wouldn't be run, thus
the dead shim would be left.

Fixes: #9597

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2024-05-06 17:31:31 +08:00
Fupan Li
26bee78e8d db: fix the issue of failed to init pci root bus
dragonball reserves 2048G of mmio space for the pci root bus by default
on physical addresses greater than 4G. However, for some machines with
smaller physical address widths, such as 39-bit wide physical addresses,
dragonball reserves the mmio space when initializing the memory. It is
less than 2048G, so this commit dynamically calculates and allocates the
mmio size of each pci root bus.

Fixes: #9509

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2024-05-06 11:34:18 +08:00
Aurélien Bombo
0cc2b07a8c tests: adapt Mariner CI to unblock CH v39 upgrade
The CH v39 upgrade in #9575 is currently blocked because of a bug in the
Mariner host kernel. To address this, we temporarily tweak the Mariner
CI to use an Ubuntu host and the Kata guest kernel, while retaining the
Mariner initrd. This is tracked in #9594.

Importantly, this allows us to preserve CI for genpolicy. We had to
tweak the default rules.rego however, as the OCI version is now
different in the Ubuntu host. This is tracked in #9593.

This change has been tested together with CH v39 in #9588.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2024-05-03 16:29:12 +00:00
cncal
48d873b52b build: fix the confusing build message if yq doesn't exist in GOPATH/bin
The build message shows that yq was not found when I tried to build
runtime binaries, but I've actually installed yq by yum install.

Signed-off-by: cncal <flycalvin@qq.com>
2024-05-03 08:34:45 +08:00
cncal
9caa7beb1f runtime: make kata-runtime check error more understandable
If device /dev/kvm does not exist, kata-runtime check would fail with
an ambiguous error messae 'no such file or directory'. I added a little
more details to make it understandable and it will belike:

```
ERRO[0000] cannot open kvm device: no such file or directory  arch=arm64 check-type=full device=/dev/kvm name=kata-runtime pid=2849085 source=runtime
ERRO[0000] no such file or directory                          arch=arm64 name=kata-runtime pid=2849085 source=runtime
no such file or directory
```

Signed-off-by: cncal <flycalvin@qq.com>
2024-05-03 08:29:08 +08:00
Zvonko Kaiser
e5e0983b56
Merge pull request #9476 from zvonkok/nvidia-config-tomls
config: Add NVIDIA GPU SNP, TDX configuration files
2024-05-02 10:27:10 +02:00
Fabiano Fidêncio
f04a7a55ed
Merge pull request #9563 from fidencio/topic/agent-use-policy-by-default
build: Build the shipped agent with policy enabled
2024-05-01 12:22:05 +02:00
Fabiano Fidêncio
33a8701904
Merge pull request #9573 from littlejawa/kata_deploy_crio_conf
kata-deploy: configure debugging for crio
2024-05-01 12:19:10 +02:00
Julien Ropé
c2aed995b7 kata-deploy: configure debugging for crio
Fix the configuration for crio's log_level

Fixes: #9556

Signed-off-by: Julien Ropé <jrope@redhat.com>
2024-04-30 17:48:43 +02:00
stevenhorsman
3c2232d898 runtime: fix testVersionString logic
- The testVersionString logic use regex to check that the ociVersion is
displayed correctly, but with the new go module that version has a
`+` in, so we need to quote this to escape special characters

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-04-30 10:54:49 +01:00
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
d3b300ff95
build: tests: Remove agent-opa
Now that the `kata-agent` is being built with policy support, let's stop
building the `kata-opa-agent`, reducing the amount of things we need to
test and maintain.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-04-28 12:52:54 +02:00
Fabiano Fidêncio
b1710ee2c0
build: Build the shipped agent with policy enabled
Now that the OPA binary is not required anymore, let's start shipping
the agent with the policy enabled by default.

The agent *without* policy enabled has 30MB, while it's 34MB *with* the
policy enabled.

This 4MB (~10%) increase is, IMHO, worth it in order to reduce the
amount of components we have to maintain and test, including the
possibility to also reduce the amount of possible rootfs / initrd
images.

Whoever wants to use the agent without policy enabled can simply do that
by building their own agent. :-)

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-04-28 12:52:54 +02: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