Commit Graph

10909 Commits

Author SHA1 Message Date
Fabiano Fidêncio
1d266352ea
Merge pull request #5902 from Bevisy/fix-too-many-git-file
tools: Add some new gitignore items
2022-12-15 11:29:32 +01:00
Steve Horsman
c6f1a1e42a
Merge pull request #5897 from BbolroC/runtime-payload-multiarch
CC: Enable multi-arch build for runtime-payload image
2022-12-15 10:01:25 +00:00
Zhongtao Hu
ca39a07a14 runtime-rs: enable start container from bundle
enable start container from bundle in this way

$ ls ./bundle
config.json  rootfs
$ sudo ctr run -d --runtime io.containerd.kata.v2 --config bundle/config.json test_kata

Fixes:#5872
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-12-15 17:28:13 +08:00
Peng Tao
ebb73df6bc
Merge pull request #5899 from Bevisy/fix-outdated-comments
shim: return hypervisor's pid not shim's pid
2022-12-15 14:55:54 +08:00
Peng Tao
7210905deb
Merge pull request #5712 from openanolis/chao/upcall
Dragonball: introduce upcall
2022-12-15 14:44:56 +08:00
Chao Wu
fad229b853
Merge pull request #5875 from Ji-Xinyou/xyji/refactor-shim-mgmt
refactor(shim-mgmt): move client side to libs
2022-12-15 10:59:45 +08:00
David Esparza
1dbd6c8057
Merge pull request #5735 from dborquez/kata-ctl-cli-list
kata-ctl: Add --list option
2022-12-14 15:03:21 -06:00
Fabiano Fidêncio
813f8b7e93
Merge pull request #5896 from fidencio/topic/CC-use-pre-built-containerd
versions: Use prebuilt containerd artefacts
2022-12-14 17:19:26 +01:00
Alex
b5cfd09583
kata-ctl: Fixed format for check release options
Fixed formatting for check release options

Fixes: #5345

Signed-off-by: Alex <alee23@bu.edu>
Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2022-12-14 09:42:57 -06:00
Georgina Kinge
0701e171e2 agent: removing sysinfo during merge
Removed the sysinfo that got left behind during merge

Signed-off-by: Georgina Kinge <georgina.kinge@ibm.com>
2022-12-14 15:36:13 +00:00
Georgina Kinge
332a425145 CCv0: Merge main into CCv0 branch
Merge remote-tracking branch 'upstream/main' into CCv0

Fixes: #5905
Signed-off-by: Georgina Kinge <georgina.kinge@ibm.com>
2022-12-14 14:55:23 +00:00
James O. D. Hunt
2e15af777c
Merge pull request #5786 from alexlee-23/main
kata-ctl: check: only-list-releases and include-all-releases options
2022-12-14 11:25:36 +00:00
Hyounggyu Choi
843b5afb3d CC: Enable multi-arch build for runtime-payload image
This is to enable quay.io/confidential-containers/runtime-payload for
s390x on top of amd64.

Fixes: #5894

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2022-12-14 11:38:27 +01:00
Ji-Xinyou
fbf294da3f refactor(shim-mgmt): move client side to libs
The client side is moved to libs. This is to solve the problem
that including clients will bring about messy dependencies.

Fixes: #5874
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
2022-12-14 17:42:25 +08:00
Fabiano Fidêncio
94ea07e42b versions: Use prebuilt containerd artefacts
In order to avoid building the containerd binaries on every single run
of our CI, let's simply rely on the fact that now we're releasing the
"same" artefacts containerd normally releases from our own fork.

See:
https://github.com/confidential-containers/containerd/releases/tag/v1.6.8.1

Fixes: #5895

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-14 10:11:48 +01:00
Peng Tao
856d4b7361
Merge pull request #5798 from pmores/qemu-support
basic framework for QEMU support in runtime-rs
2022-12-14 15:05:33 +08:00
Binbin Zhang
ae0dcacd4a tools: Add some new gitignore items
Add some new ignore items to avoid local builds that cause git to track a lot of files

Fixes: #5900

Signed-off-by: Binbin Zhang <binbin36520@gmail.com>
2022-12-14 11:38:23 +08:00
Binbin Zhang
99485d871c shim: return hypervisor's pid not shim's pid
update outdated code comments

Fixes: #3234

Signed-off-by: Binbin Zhang <binbin36520@gmail.com>
2022-12-14 11:16:11 +08:00
GabyCT
b637d12d19
Merge pull request #5884 from GabyCT/topic/fixbuildscript
tools: Fix indentation on build kernel script
2022-12-13 15:28:24 -06:00
Fabiano Fidêncio
c2d1ea770a
Merge pull request #5835 from fidencio/topic/CC-cache-rootfs
CC | Cache and use rootfs whenever it's possible
2022-12-13 20:50:48 +01:00
Chao Wu
bb4be2a666
Merge pull request #5690 from yipengyin/fix-virtiofsd
runtime-rs: fix standalone share fs
2022-12-14 00:16:10 +08:00
James Tumber
087515a46e agent: unset CC for cross-build
When `HOST_ARCH` != `ARCH` unset `CC`

Specifying a foreign CC is incompatible with building libgit2. Thus after the RUSTFLAGS linker
has been set we can safely unset CC to avoid passing this value through the build.

Fixes: #5890

Signed-off-by: James Tumber <james.tumber@ibm.com>
2022-12-13 15:30:06 +00:00
Pavel Mores
1f28ff6838 runtime-rs: add binary to exercise shim proper w/o containerd dependencies
After building the binary as usual with `cargo build` run it as follows.

It needs a configuration.toml in which only qemu keys `path`, `kernel`
and `initrd` will initially need to be set.  Point them to respective
files e.g. from a kata distribution tarball.

It also needs to be launched from an exported container bundle
directory.  One can be created by running

mkdir rootfs
podman export $(podman create busybox) | tar -C ./rootfs -xvf -
runc spec -b .

in a suitable directory.

Then launch the program like this:

KATA_CONF_FILE=/path/to/configuration-qemu.toml /path/to/shim-ctl

Fixes: #5817

Signed-off-by: Pavel Mores <pmores@redhat.com>
2022-12-13 14:55:21 +01:00
Pavel Mores
eb8c9d38ff runtime-rs: add launch of a simple qemu process to start_vm()
The point here is just to get a simplest Kata VM running.

Signed-off-by: Pavel Mores <pmores@redhat.com>
2022-12-13 14:54:26 +01:00
Pavel Mores
2f6d0d408b runtime-rs: support qemu in VirtContainer
Added registration of qemu config plugin and support for creating Qemu
Hypervisor instance.

Signed-off-by: Pavel Mores <pmores@redhat.com>
2022-12-13 14:54:26 +01:00
Pavel Mores
1413dfe91c runtime-rs: add basic empty boilerplate for qemu driver
This does almost literally nothing so far apart from getting and setting
HypervisorConfig.  It's mostly copied from/inspired by dragonball.

Signed-off-by: Pavel Mores <pmores@redhat.com>
2022-12-13 14:53:45 +01:00
Bin Liu
3952fedcd0
Merge pull request #5882 from bergwolf/github/oci-namespaces
runtime-rs: fix sandbox_pidns calculation and oci spec amending
2022-12-13 18:32:02 +08:00
Fabiano Fidêncio
f1381eb361
Merge pull request #4813 from ManaSugi/fix/add-selinux-agent
runtime,agent: Add SELinux support for containers inside the guest
2022-12-13 11:24:53 +01:00
Yuan-Zhuo
bf8848f926 agent: Eliminate unnecessary metrics
DEFAULT_REGISTRY pre-registers many metrics that we don't need or have duplicated.
This PR uses a custom register for metrics without interference and ensures that
the registration process is executed only once when the program is running.

Fixes: #5255

Signed-off-by: Yuan-Zhuo <yuanzhuo0118@outlook.com>
2022-12-13 16:18:33 +08:00
Fupan Li
015674df16
Merge pull request #5873 from justxuewei/fix/umount2
kata-sys-util: fix issues where umount2 couldn't get the correct path
2022-12-13 15:52:32 +08:00
Chao Wu
a81ced0e3f upcall: add upcall into kernel build script
In order to let upcall being used by Kata Container, we need to add
those patches into kernel build script.

Currently, only when experimental (-e) and hypervisor type dragonball
(-t dragonball) are both enabled, that the upcall patches will be
applied to build a 5.10 guest kernel.

example commands: sh ./build-kernel.sh -e -t dragonball -d setup

fixes: #5642

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-12-13 15:44:55 +08:00
Chao Wu
f5c34ed088 Dragonball: introduce upcall
Upcall is a direct communication tool between VMM and guest developed
upon vsock. The server side of the upcall is a driver in guest kernel
(kernel patches are needed for this feature) and it'll start to serve
the requests after the kernel starts. And the client side is in
Dragonball VMM , it'll be a thread that communicates with vsock through
uds.

We want to keep the lightweight of the VM through the implementation of
the upcall, through which we could achieve vCPU hotplug, virtio-mmio
hotplug without implementing complex and heavy virtualization features
such as ACPI virtualization.

fixes: #5642

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-12-13 15:44:47 +08:00
Bin Liu
03b6124fc6
Merge pull request #5848 from Yuan-Zhuo/drop-cgmr-option
agent: Drop the Option for LinuxContainer.cgroup_manager
2022-12-13 12:09:39 +08:00
Guoqiang Ding
f8a48ab41d docs: add hint of probing loop module
If `loop` module is not probed, it causes error like "losetup: cannot find an unused loop device".

Fixes: #5887
Signed-off-by: Guoqiang Ding <dgq8211@gmail.com>
2022-12-13 11:33:42 +08:00
Alex
8dbfc3dc82 kata-ctl: Fixed format for check release options
Fixed formatting for check release options

Fixes: #5345

Signed-off-by: Alex <alee23@bu.edu>
2022-12-13 03:10:19 +00:00
Bin Liu
add2486259
Merge pull request #5853 from jongwu/test_kata3.0_arm
dragonball: enable kata3.0/dragonball CI on Arm
2022-12-13 11:05:17 +08:00
Alex
f3091a9da4 kata-ctl: Add kata-ctl check release options
This pull request adds kata-ctl check only-list-releases and include-all-releases

Fixes: #5345

Signed-off-by: Alex <alee23@bu.edu>
2022-12-13 03:04:30 +00:00
Fabiano Fidêncio
aef3e5184b kata-deploy-binaries: Use cached shim-v2 when possible
As done for different components, let's also use a cached version of the
shim-v2 whenever it's possible.

Fixes: #5838

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-12 20:07:32 +01:00
Fabiano Fidêncio
5d6ca191ce
Merge pull request #5886 from fidencio/topic/CC-fix-pushing-the-shim-v2-build-image-to-quay
actions: Fix pushing the shim-v2 build image to quay.io
2022-12-12 19:32:33 +01:00
Gabriela Cervantes
de69f9c832 cache_components: Add the ability to cache the shim-v2
In order to cache the shim-v2 we're considering the the cached component
can be used if:
* There were no changes in the runtime directory
* There were no changes in the golang version used
* There were no changes in the rust version used
  * We don't build the rust agent, but better be prepared for the future
* There were no changes in the following files that are provided by the
  rootfs builds:
  * root_hash_vanilla.txt
  * root_hash_tdx.txt

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-12 19:12:26 +01:00
Fabiano Fidêncio
d9dd1ac9ec kata-deploy-binaries: Use cached rootfs when possible
As done for different components, let's also use a cached version of
the rootfs whenever it's possible.

Fixes: #5433

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-12 18:03:01 +01:00
Fabiano Fidêncio
60f0fc996e actions: Fix pushing the shim-v2 build image to quay.io
e1f075dc60 reworked the action so the
shim-v2 was split out of the matrix build.  With that done I ended up
not realising I'd need to log into the quay.io as one step of the
build-asset-cc-shim-v2 job.

Fixes: #5885

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-12 17:58:46 +01:00
Gabriela Cervantes
a577df8b71 tools: Fix indentation on build kernel script
This PR fixes the indentation on the build kernel script.

Fixes #5883

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-12-12 16:37:47 +00:00
Fabiano Fidêncio
4d835f6089 cache_components: Add the ability to cache the rootfs
This is the most complex part to cache, as the cached component can be
only used if:
* There were no changes in the agent
* There were no changes in the libs (used by the agent)
* There were no changes in the rootfs build scripts
* There is no change in the version of the following components:
  * attestation-agent (part of the rootfs)
  * gperf (used to build libseccomp)
  * libseccomp (used to build the agent)
  * pause image (part of the rootfs)
  * skopeo (part of the rootfs)
  * umoci (part of the rootfs)
  * rust (used to build the kata-containers and attestation agents)

We're relying on the last commit merged on places related to the rootfs
generation  and using that as the rootfs version and that should be good
enough for what we need.

Apart from everything already mentioned, we've also added the ability to
cache the `root_hash_vanilla.txt` and `root_hash_tdx.txt` files, as
those are needed for when building the shim-v2, in order to have
measured boot working there.

It's important to note that we've added the ability to cache *both*
files, and I've taken that path as the shim-v2 cache work (which will
come soon) relies on both files.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-12 16:07:45 +01:00
Fabiano Fidêncio
d3e0190786
Merge pull request #5876 from fidencio/topic/CC-rework-build-dependencies-so-measured-rootfs-can-be-used
Rework how we build the payload so measured boot can be used with the Operator
2022-12-12 16:03:45 +01:00
Fabiano Fidêncio
740387b569
Merge pull request #5829 from singhwang/main
fix kata deploy error after node reboot.
2022-12-12 14:20:14 +01:00
Fabiano Fidêncio
aa351bc989 kata-deploy-binaries: Print extra_opts when building shim-v2
This will help us, in the future, to debug any possible issue related to
the measured rootfs arguments passed to the shim during the build time.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-12 13:54:56 +01:00
Fabiano Fidêncio
e1f075dc60 actions: Consider root_hash_*.txt for the CC actions
The ability to do a measured boot has been overlooked when releasing the
payload consumed by the Confidential Containers project, and this
happened as we depend, at the shim-v2 build time, of a `root_hash_*.txt`
generated in the `tools/osbuilder/` directory, which is then used to add
a specific parameter to the `kernel_params` in the Kata Containers
configuration files.

With everything said above, the best way we can ensure this is done is
by saving those files during the rootfs build, download them during the
shim-v2 build (which *must* happen only after the rootfs builds happen),
and correctly use them there.

Fixes: #5847

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-12 13:54:56 +01:00
Fabiano Fidêncio
788f1e6d61 config: Adjust TDXKERNELPARAMS for different VMMs
As Cloud Hypervisor and QEMU are using different rootfs images (the
former with `offline_fs_kbc` as aa_kbc, and the latter with `eaa_kbc`),
we need to differentiate the kernel parameters passed to each one of
those, as the `root_hash.txt` file used for measured boot will differ
according to the rootfs used.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-12 13:54:56 +01:00
Fabiano Fidêncio
24c7066425 config: Drop $(ROOTMEASURECONFIG) from SEV kernel param
This is not used at all, as SEV relies on an initrd instead of relying
on an image.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-12 13:54:56 +01:00