Commit Graph

8229 Commits

Author SHA1 Message Date
Fabiano Fidêncio
28c4c044e6 hypervisors: Confidential Guests do not support VCPUs hotplug
As confidential guests do not support VCPUs hotplug, let's set the
"DefaultMaxVCPUs" value to "NumVCPUs".

The reason to do this is to ensure that guests will be started with the
correct amount of VCPUs, without giving to the guest with all the
possible VCPUs the host could provide.

One clear side effect of this limitation is that workloads that would
require more VCPUs on their yaml definition will not run on this
scenario.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-25 16:49:21 +01:00
Fabiano Fidêncio
29ee870d20 clh: Add confidential_guest to the config file
ConfidentialGuest is an option already present and exposed for QEMU,
which is used for using Kata Containers together with different sorts of
Guest Protections, such as TDX and SEV for x86_64, PEF for ppc64le, and
SE for s390x.

Right now we error out in case confidential_guest is enabled, as we will
be implementing the needed blocks for this as part of this series.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-25 16:49:21 +01:00
Fabiano Fidêncio
9621c59691 clh: refactor image / initrd configuration set
This is a small code refactor removing a deadcode based the checks
already done in the generic hypervisor abstraction.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-25 16:49:21 +01:00
Fabiano Fidêncio
dcdc412e25 clh: use common kernel params from the hypervisor code
The hypervisor code already defines 3 common kernel root params for the
following cases:
* NVDIMM
* NVDIMM without DAX support
* Virtio Block

As parameters used for cloud-hypervisor have an overlap with the ones
provided by the NVDIMM case, let's take advantage of that.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-25 16:49:21 +01:00
Fabiano Fidêncio
4c164afbac versions: Update Cloud Hypervisor to 5343e09e7b8db
Let's bump the Cloud Hypervisor version to 5343e09e7b8db, as that brings
a few fixes we're interested in, such as:

* hypervisor, vmm: Handle TDX hypercalls with INVALID_OPERAND
  - https://github.com/cloud-hypervisor/cloud-hypervisor/pull/3723
    - This is needed for the TDX support on the cloud hypervisor driver,
      which is part of this very same series.

* openapi: Update the PciBdf types
  - https://github.com/cloud-hypervisor/cloud-hypervisor/pull/3748
    - This is needed due to a change in a DeviceNode field, which would
      cause a marshalling / demarshalling error when running with a
      version of cloud-hypervisor that includes the TDX fixes mentioned
      above.

* scripts: dev_cli: Don't quote $features_build
* scripts: dev_cli: Add --features option
  - https://github.com/cloud-hypervisor/cloud-hypervisor/pull/3773
    - This is needed due to changes in the scripts used to build Cloud
      Hypervisor, which are used as part of Kata Containers CIs and
      github actions.

      Due to this change, we're also adapting the build scripts as part
      of this very same commit.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-25 16:49:16 +01:00
Jakob Naucke
bbfe7d6591
Merge pull request #3599 from Jakob-Naucke/no-virtio-rng-ccw
virtcontainers: Do not add a virtio-rng-ccw device
2022-02-25 15:27:02 +01:00
Francesco Giudici
3da6006de4
Merge pull request #3751 from fgiudici/kata-monitor_issue3705
kata-monitor: fix collecting metrics for sandboxes not started through CRI
2022-02-25 14:53:12 +01:00
Chelsea Mafrica
6a11dbfa8a
Merge pull request #3762 from Amulyam24/fix-build
runtime: fix package declaration for ppc64le
2022-02-24 12:45:31 -08:00
Amulyam24
cb4230e60e runtime: fix package declaration for ppc64le
Incorrect package name causes build to fail. Fix it
in vm_ppc64le.go

Fixes: #3761

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2022-02-24 15:31:48 +05:30
Eric Ernst
c6cc038364
Merge pull request #3615 from sameo/topic/hypervisor
Make the hypervisor framework not Linux specific
2022-02-23 16:02:00 -08:00
GabyCT
7da7e0a8f5
Merge pull request #3724 from Jakob-Naucke/kata-deploy-s390x
kata-deploy: Simplify Dockerfile and support s390x
2022-02-23 11:38:01 -06:00
Francesco Giudici
fec26f8e51 kata-monitor: trivial: rename symbols & labels
We introduced collection of sandboxes metadata from the CRI that will be
attached to the sandbox metrics: this will allow to immediately match
sandboxes metrics with CRI workloads.
Rename the symbols from *Kube* to *CRI* as the metadata will be there
every time pods are created through CRI, also if kubernetes is not
installed (e.g., 'crictl runp').

Signed-off-by: Francesco Giudici <fgiudici@redhat.com>
2022-02-23 18:34:32 +01:00
Samuel Ortiz
9fd4e5514f runtime: Move the resourcecontrol package one layer up
And try to reduce the number of virtcontainers packages, step by step.

Signed-off-by: Samuel Ortiz <s.ortiz@apple.com>
2022-02-23 15:48:40 +01:00
Samuel Ortiz
823faee83a virtcontainers: Rename the cgroups package
To resourcecontrol, and make it consistent with the fact that cgroups
are a Linux implementation of the ResourceController interface.

Fixes: #3601

Signed-off-by: Samuel Ortiz <s.ortiz@apple.com>
2022-02-23 15:48:40 +01:00
Samuel Ortiz
0d1a7da682 virtcontainers: Rename and clean the cgroup interface
We call it a ResourceController, and we make it not so Linux specific.
Now the Linux implementations is the cgroups one.

Signed-off-by: Samuel Ortiz <s.ortiz@apple.com>
2022-02-23 15:48:40 +01:00
Samuel Ortiz
ad10e201e1 virtcontainers: cgroups: Move non Linux routine to utils.go
Have an OS agnostic file for sharing routines.

Signed-off-by: Samuel Ortiz <s.ortiz@apple.com>
2022-02-23 15:48:40 +01:00
Samuel Ortiz
d49d0b6f39 virtcontainers: cgroups: Define a cgroup interface
And move the current, Linux-specific implementation into
cgroups_linux.go

Signed-off-by: Samuel Ortiz <s.ortiz@apple.com>
2022-02-23 15:48:40 +01:00
Francesco Giudici
3ac52e8193 kata-monitor: fix updating sandbox cache at startup
We now rely on fs events only to update the sandbox cache. This is not
true anyway for sandboxes already present at kata-monitor startup: we
just retrieve the list and add them in the cache only when we get their
CRI metadata. If CRI metadata is not available we will never add them to
the sandbox cache.
Fix this by immediately adding the sandboxes we find at startup time to
the sandbox cache.

Fixes: #3705

Signed-off-by: Francesco Giudici <fgiudici@redhat.com>
2022-02-23 11:21:06 +01:00
Francesco Giudici
160bb62138 kata-monitor: bump version to 0.3.0
Since kata-monitor now:
- relies on fs events *only* to update the sandbox cache
- adds CRI meta-data as labels (CRI pod name, namespace and uid)
it deserves a version bump.

Note that while we could let kata-monitor match the runtime version,
kata-monitor will usually work flawlessy with different kata shim
releases: so it makes sense to keep kata-monitor version separated.

Signed-off-by: Francesco Giudici <fgiudici@redhat.com>
2022-02-23 11:17:02 +01:00
Fabiano Fidêncio
6a9e5f90f7
Merge pull request #3670 from sameo/topic/nerdctl
Support nerdctl OCI hooks
2022-02-22 23:03:33 +01:00
Fabiano Fidêncio
4729fd0fc2
Merge pull request #3736 from liubin/fix/3733-log-events-for-crio
shim: log events for CRI-O
2022-02-22 09:19:37 +01:00
bin
f6fc1621f7 shim: log events for CRI-O
CRI-O start shim process without setting TTRPC_ADDRESS,
that the forwarding events goroutine will get errors.

For CRI-O runtime, we can log the events to log file.

Fixes: #3733

Signed-off-by: bin <bin@hyper.sh>
2022-02-22 11:02:50 +08:00
Julio Montes
753d639bb3
Merge pull request #3741 from GabyCT/topic/updatecontributing
docs: Update contributing link
2022-02-21 14:03:48 -06:00
Gabriela Cervantes
1d68a08f4b docs: Update contributing link
This PR updates the contributing documentation link to the
one that is using kata 2.0

Fixes #3740

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-02-21 17:01:09 +00:00
Fabiano Fidêncio
e604f83c40
Merge pull request #3735 from fidencio/wip/kata-deploy-use-kata-with-qemu-as-the-default-shim-v2-binary
kata-deploy: Use (kata with) qemu as the default shim-v2 binary
2022-02-21 14:52:55 +01:00
Fabiano Fidêncio
1e9f3c856d
Merge pull request #3553 from fgiudici/kata-monitor_cachefix
kata-monitor: simplify sandbox cache management and attach kubernetes POD metadata to metrics
2022-02-21 13:17:22 +01:00
Peng Tao
031da99914
Merge pull request #3687 from luodw/nydus-clh
nydus: add lazyload support for kata with clh
2022-02-21 19:31:45 +08:00
Jakob Naucke
9123fc098d
kata-deploy: Simplify Dockerfile and support s390x
The kata-deploy Dockerfile is based on CentOS 7, which has no s390x
support. Add an `IMAGE` argument to specify the registry, which still
defaults to CentOS, but e.g. ClefOS can be selected instead.

Other x86_64 assumptions are also removed. Other general simplicifations
are made.

This does not address the more general issue of #3723 -- what we're
doing here does not seem to be working with systemd >= something between
235-237.

Fixes: #3722
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2022-02-21 11:06:54 +01:00
James O. D. Hunt
67c3195c9c
Merge pull request #3721 from Amulyam24/kernel-fix
kernel: remove SYS_SUPPORTS_HUGETLBFS from powerpc fragments
2022-02-21 09:10:21 +00:00
Fabiano Fidêncio
11220f052f kata-deploy: Use (kata with) qemu as the default shim-v2 binary
When using kata-deploy, no `containerd-shim-kata-v2` binary is deployed,
but we do deploy a `kata` runtime class, which seems very much
incosistent.

As the default configuration for kata-containers points to QEMU, let's
also use kata with QEMU as the default shim-v2 binary.

Fixes: #3228, #3734

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-21 10:03:47 +01:00
luodaowen.backend
3175aad5ba virtiofs-nydus: add lazyload support for kata with clh
As kata with qemu has supported lazyload, so this pr aims to
bring lazyload ability to kata with clh.

Fixes #3654

Signed-off-by: luodaowen.backend <luodaowen.backend@bytedance.com>
2022-02-19 21:55:31 +08:00
James O. D. Hunt
a671b455a2
Merge pull request #3691 from Jakob-Naucke/fix-apply-patches
packaging: Use `patch` for applying patches
2022-02-18 15:51:05 +00:00
Archana Shinde
7db9bef72c
Merge pull request #3718 from Kvasscn/kata_dev_fix_utils_assert_msg
virtcontainers: Remove duplicated assert messages in utils test code
2022-02-18 06:07:16 -08:00
Amulyam24
8cc1b18636 kernel: remove SYS_SUPPORTS_HUGETLBFS from powerpc fragments
The name of SYS_SUPPORTS_HUGETLBFS has been changed to
ARCH_SUPPORTS_HUGETLBFS which is being selected on default
by another kernel config.
More info- 855f9a8e87
Change applicable from v5.13.

Fixes: #3720

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2022-02-18 18:06:50 +05:30
Jakob Naucke
5c9d2b413f
packaging: Use patch for applying patches
`tools/packaging/scripts/apply_patches.sh` uses `git apply $patch`, but
this will not apply to subdirectories. If one wanted to apply with
`git apply`, they'd have to run it with `--directory=...`
_relative to the Git tree's root_ (absolute will not work!). I suggest
we just use `patch`, which will do what we expected `git apply` would
do.

`patch` is also added to build containers that require it.

Fixes: #3690
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2022-02-18 11:32:17 +01:00
Tim Zhang
12e83a99ed
Merge pull request #3699 from liubin/fix/3698-add-nydus-snapshotter-to-versions
versions: add nydus-snapshotter
2022-02-18 17:42:58 +08:00
Fabiano Fidêncio
5b3fb6f83d kernel: Build SGX as part of the vanilla kernel
Let's take advantage of the fact that we've bumped to our kernel version
ot the 5.15 LTS and enable SGX by default, as it's present there.

Fixes: #3692

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-18 10:41:08 +01:00
Fabiano Fidêncio
2c35d8cb8e workflows: Stop building the experimental kernel
Let's stop building the experimental kernel as, currently, we have
all the needed contents as part of the vanilla kernel.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-18 10:41:08 +01:00
Fabiano Fidêncio
32e7845d31 snap: Build vanilla kernel for all arches
There's no need to build an experimental kernel for x86_64 as all the
bits which were part of the experimental one (SGX only, really) are now
part of the vanilla one.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-18 10:41:08 +01:00
Samuel Ortiz
27de212fe1 runtime: Always add network endpoints from the pod netns
As the container runtime, we're never inspecting, adding or configuring
host networking endpoints.
Make sure we're always do that by wrapping addSingleEndpoint calls into
the pod network namespace.

Fixes #3661

Signed-off-by: Samuel Ortiz <s.ortiz@apple.com>
2022-02-18 10:37:07 +01:00
James O. D. Hunt
f324305004
Merge pull request #3710 from GabyCT/topic/ulimidoc
docs: Update limitations document
2022-02-18 09:20:09 +00:00
zhanghj
1cee0a9452 virtcontainers: Remove duplicated assert messages in utils test code
Remove duplicated strings in assert.Errorf() and assert.NoErrorf().

Fixes: #3714

Signed-off-by: zhanghj <zhanghj.lc@inspur.com>
2022-02-18 16:45:05 +08:00
Gabriela Cervantes
6c1d149a5d docs: Update limitations document
This PR updates the limitations document by removing the docker
references belonged to kata 1.x and add as a limitation the
docker and podman support for kata 2.0

Fixes #3709

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-02-17 21:15:56 +00:00
Julio Montes
0b31b7ccc2
Merge pull request #3707 from devimc/2022-02-16/qemu-tdx
packaging: support qemu-tdx
2022-02-17 12:20:05 -06:00
Julio Montes
7c4ee6ec48 packaging/qemu: create no_patches file for qemu-tdx
create no_patches.txt file for qemu-tdx, this way we can build it
using packaging scripts

Signed-off-by: Julio Montes <julio.montes@intel.com>
2022-02-17 09:17:57 -06:00
Julio Montes
d47c488b58 versions: add qemu tdx section
define qemu tdx version and repo url

fixes #3706

Signed-off-by: Julio Montes <julio.montes@intel.com>
2022-02-17 09:03:17 -06:00
Julio Montes
8d3ace4a7d
Merge pull request #3675 from jodh-intel/kata-manager-fix-install
Kata manager fix install
2022-02-17 08:00:23 -06:00
Samuel Ortiz
77c29bfd3b container: Remove VFIO lazy attach handling
With the recently added VFIO fixes and support, we should not need that
anymore.

Fixes #3108

Signed-off-by: Samuel Ortiz <s.ortiz@apple.com>
2022-02-17 08:39:44 +01:00
bin
7241d618f1 versions: add nydus-snapshotter
Add nydus-snapshotter to versions.yaml to
install nydus-snapshotter from its own
releases.

Fixes: #3698

Signed-off-by: bin <bin@hyper.sh>
2022-02-17 14:09:20 +08:00
Peng Tao
9e618f1fb2
Merge pull request #3684 from fidencio/kernel-lts-5.15.x
versions: Linux 5.15.x
2022-02-17 10:25:28 +08:00