Commit Graph

9892 Commits

Author SHA1 Message Date
Bin Liu
62cf6e6fc3 runtime-rs: remove meaningless comment
The comment for `generate_mount_path` function is a copy miss
and should be deleted.

Fixes: #5150

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-09-09 16:07:35 +08:00
Bin Liu
55f4f3a95b
Merge pull request #4897 from ManaSugi/runk/enable-seccomp
runk: Enable seccomp support by default
2022-09-09 14:11:35 +08:00
Wang, Arron
9373ec7d80 kernel: Integrate initramfs into Guest kernel
Integrate initramfs into guest kernel as one binary,
which will be measured by the firmware together.

Fixes: #5148

Signed-off-by: Wang, Arron <arron.wang@intel.com>
2022-09-09 13:35:37 +08:00
Yohei Ueda
5422a056f2
runtime: Copy shared files recursively
This patch enables recursive file copying
when filesystem sharing is not used.

Signed-off-by: Yohei Ueda <yohei@jp.ibm.com>
2022-09-09 11:22:26 +09:00
Yohei Ueda
de232b8030
agent: support copying of directories and symlinks
This patch allows copying of directories and symlinks when
static file copying is used between host and guest. This change is
necessary to support recursive file copying between shim and agent.

Signed-off-by: Yohei Ueda <yohei@jp.ibm.com>
2022-09-09 11:07:34 +09:00
Lei Li
c3e6b66051
runtime: Support privileged containers in peer pod VM
This patch fixes the issue of running containers
with privileged as true.

See the discussion at this URL for the details.
https://github.com/confidential-containers/cloud-api-adaptor/issues/111

Author:    Lei Li <cdlleili@cn.ibm.com>
Signed-off-by: Yohei Ueda <yohei@jp.ibm.com>
2022-09-09 11:07:34 +09:00
Yohei Ueda
f9278f22c3
runtime: Support the remote hypervisor type
This patch adds the support of the remote hypervisor type.
Shim opens a Unix domain socket specified in the config file,
and sends TTPRC requests to a external process to control
sandbox VMs.

Fixes #4482

Co-authored-by: Pradipta Banerjee <pradipta.banerjee@gmail.com>
Signed-off-by: Yohei Ueda <yohei@jp.ibm.com>
2022-09-09 11:07:28 +09:00
Manabu Sugimoto
bcf6bf843c runk: Enable seccomp support by default
Enable seccomp support in `runk` by default.
Due to this, `runk` is built with `gnu libc` by default
because the building `runk` with statically linked the `libseccomp`
and `musl` requires additional configurations.
Also, general container runtimes are built with `gnu libc` as
dynamically linked binaries by default.
The user can disable seccomp by `make SECCOMP=no`.

Fixes: #4896

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-09-09 10:55:16 +09:00
Yohei Ueda
150e8aba6d
runtime: Add hypervisor proto to support peer pod VMs
This patch adds a protobuf definiton of the remote hypervisor type.

Signed-off-by: Yohei Ueda <yohei@jp.ibm.com>
2022-09-09 10:18:23 +09:00
Fabiano Fidêncio
55c8c7226d
Merge pull request #5134 from Megan-Wright/CCv0
CCv0: Merge main into CCv0 branch
2022-09-08 19:35:45 +02:00
GabyCT
be462baa7e
Merge pull request #5103 from liubin/fix/5102-add-inline-virtiofs-config
config: add "inline-virtio-fs" as a "shared_fs" type
2022-09-08 10:33:20 -05:00
GabyCT
bcbce8317d
Merge pull request #5061 from liubin/fix/5022-runtime-rs-readme
runtime-rs: add README.md
2022-09-08 10:32:08 -05:00
Alex Carter
7849c7977c kata-deploy: add CC's kata-qemu-sev runtimeclass
After adding an SEV QEMU config file (#4850), need to configure containerd to select this when appropriate based on a new runtimeclass.

Adds to the configuration of containerd so the correct config is selected.

Fixes: #4851

Signed-Off-By: Alex Carter <alex.carter@ibm.com>
2022-09-08 15:19:45 +00:00
bin liu
2b1d058572 runtime-rs: fix host device check pattern
Host devices should start with `/dev/` but not `/dev`.

Fixes: #5145

Signed-off-by: bin liu <liubin0329@gmail.com>
2022-09-08 22:44:46 +08:00
Fabiano Fidêncio
61fd408594
Merge pull request #5096 from ryansavino/sev-kernel-build-fix-ccv0
kernel: fix kernel tarball name for SEV for CCv0
2022-09-08 11:43:09 +02:00
Bin Liu
85b49cee02 runtime-rs: add README.md
Add README.md for runtime-rs.

Fixes: #5022

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-09-08 16:03:45 +08:00
Bin Liu
7cfc357c6e
Merge pull request #5034 from ManaSugi/runk/refactor-container-builder
runk: Refactor container builder
2022-09-08 11:30:07 +08:00
Ji-Xinyou
5add50aea2 runtime-rs: timeout for shim management client
Let client side support timeout if the timeout value is set.
If timeout not set, execute directly.

Fixes: #5114
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
2022-09-08 11:11:33 +08:00
Bin Liu
36d805fab9 config: add "inline-virtio-fs" as a "shared_fs" type
"inline-virtio-fs" is newly supported by kata 3.0 as a "shared_fs" type,
it should be described in configuration file.

"inline-virtio-fs" is the same as "virtio-fs", but it is running in
the same process of shim, does not need an external virtiofsd process.

Fixes: #5102

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-09-08 11:05:01 +08:00
Fabiano Fidêncio
5793685a4b
Merge pull request #5095 from ryansavino/sev-kernel-build-fix
kernel: fix kernel tarball name for SEV
2022-09-07 17:50:17 +02:00
Fabiano Fidêncio
b11b6e3756
Merge pull request #5129 from fidencio/topic/cc-simplify-kata-deploy-cleanup
kata-deploy-cc: Simplify cleanup
2022-09-07 15:41:06 +02:00
Megan Wright
2e7e81b8d8 CCv0: Revert version of tokio in Cargo.lock file
Revert version of tokio back to 1.20.1

Signed-off-by: Megan Wright <megan.wright@ibm.com>
2022-09-07 11:38:14 +01:00
Megan Wright
9ad37bfd90 CCv0: Merge main into CCv0 branch
Merge remote-tracking branch 'upstream/main' into CCv0

Fixes: #5132
Signed-off-by: Megan Wright <megan.wright@ibm.com>
2022-09-07 09:44:08 +01:00
Bin Liu
5df6ff991d
Merge pull request #5116 from liubin/fix/5115-replace-tab-by-space
libs/kata-types: replace tabs by spaces in comments
2022-09-07 15:53:34 +08:00
Ji-Xinyou
9f13496e13 runtime-rs: shim management client
Add client side function(public), to establish http connections (PUT,
POST, GET) to the long standing shim mgmt server.

Fixes: #5114
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
2022-09-07 15:39:14 +08:00
Fabiano Fidêncio
e94d38c97b
Merge pull request #5058 from ryansavino/gperf-url-fix
gperf: point URL to mirror site
2022-09-07 09:25:13 +02:00
Bin Liu
aaf6d69089 runtime-rs: call TomlConfig's validate function after load
Call TomlConfig's validate function after it is loaded and
adjusted by annotations.

Fixes: #5112

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-09-07 11:34:08 +08:00
Bin Liu
fe55f6afd7
Merge pull request #5124 from amshinde/revert-arp-neighbour-api
Revert arp neighbour api
2022-09-07 11:14:53 +08:00
Ji-Xinyou
e891295e10 runtime-rs: shim management - agent-url
Add agent-url to its handler. The general framework of registering URL
handlers is done.

Fixes: #5114
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
2022-09-07 11:13:21 +08:00
Chelsea Mafrica
051dabb0fe
Merge pull request #5099 from liubin/fix/5098-add-default-config-for-runtime-rs
runtime-rs: add default agent/runtime/hypervisor for configuration
2022-09-06 17:49:42 -07:00
Archana Shinde
d23779ec9b Revert "agent: fix unittests for arp neighbors"
This reverts commit 81fe51ab0b.
2022-09-06 15:41:42 -07:00
Archana Shinde
d340564d61 Revert "agent: use rtnetlink's neighbours API to add neighbors"
This reverts commit 845c1c03cf.

Fixes: #5126
2022-09-06 15:41:42 -07:00
Archana Shinde
188d37badc kata-deploy: Add debug statement
Adding this so that we can see the status of running pods in
case of failure.

Fixes: #5126

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2022-09-06 15:41:14 -07:00
Fabiano Fidêncio
c17a6f1b53 kata-deploy-cc: Simplify cleanup
Let's remove the whole content from:
* /opt/confidential-containers/libexec
* /opt/confidential-containers/share

And then manually remove the binaries under bin directory` as the
pre-install hook will drop binaries there.

Finally, let's call a `rmdir -p /opt/confidential-containers/bin` which
should take care of the cleanup in case no pre-install hook is used, and
let's make sure we pass `--ignore-fail-on-non-empty` so we don't fail
when using a pre-install hook.

Fixes: #5128

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-09-07 00:05:45 +02:00
Fabiano Fidêncio
f5a6522398
Merge pull request #5121 from fidencio/topic/kata-deploy-fix-containerd-shim-v2-location
kata-deploy: Fix `containerd-shim-kata-v2` location
2022-09-06 19:28:00 +02:00
Ryan Savino
b948a8ffe6 kernel: fix kernel tarball name for SEV
'linux-' prefix needed for tarball name in SEV case. Output to same file name.

Fixes: #5094

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2022-09-06 11:04:29 -05:00
Ryan Savino
9cad7fb045 kernel: fix kernel tarball name for SEV
'linux-' prefix needed for tarball name in SEV case. Output to same file name.

Fixes: #5094

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2022-09-06 11:03:55 -05:00
Fabiano Fidêncio
124c0e7af4 kata-deploy: Fix containerd-shim-kata-v2 location
For Confidential Containers the file is present at
`/opt/confidential-containers` instead of `/opt/kata`.

Fixes: #5119

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-09-06 16:32:28 +02:00
Bin Liu
50f9126153 libs/kata-types: replace tabs by spaces in comments
Replace tabs by spaces in the comments of file
libs/kata-types/src/annotations/mod.rs.

Fixes: #5115

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-09-06 17:32:57 +08:00
Ji-Xinyou
59aeb776b0 runtime-rs: shim management
Add shim management http server and boot it as a light-weight thread
when the sandbox is created.

Fixes: #5114
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
2022-09-06 16:44:16 +08:00
Bin Liu
96c8be715b libs/kata-types: change return type of getting CPU period/quota
period should have a type of u64, and quota should be i64, the
function of getting CPU period and quota from annotations should
use the same data type as function return type.

Fixes: #5100

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-09-06 11:35:52 +08:00
Fabiano Fidêncio
3c7fe93997
Merge pull request #5045 from fidencio/topic/kata-deploy-misc-fixes
CC | kata-deploy: Misc fixes related to building the payload
2022-09-05 20:28:02 +02:00
Fabiano Fidêncio
01e29fc1fd kata-deploy-cc: Do a serial build of the payload
Every now and then we've been hitting issues with parallel builds.  in
order to not rely on lucky for the first release, let's do a serial
build of the payload image.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-09-05 18:20:24 +02:00
Fabiano Fidêncio
fb54dfd648 docs: How to generate the payload for the CC Operator
Let's add the documentation on how to generate the Kata Containers
payload, based in the CCv0 branch, that's consumed by the Confidential
Containers Operator.

Fixes: #5041

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-09-05 18:20:24 +02:00
Fabiano Fidêncio
012a76d098 kata-deploy: Rename image target to cc-payload
The `image` target is only used by and only present in the `CCv0`
branch, and it's name is misleading. :-)

Let's rename it (and the scripts used by it) to mention payload rather
than image, and to actually build the cc related tarballs instead of the
"vanilla" Kata Containers tarballs.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-09-05 16:21:17 +02:00
Fabiano Fidêncio
48c0cf5b5d kata-deploy: Adjust build & upload script
Let's adjust the `kata-deploy-build-and-upload-image.sh` to build the
image following the `kata-containers-${commit}` tag pattern, and to push
it to the quay.io/confidential-containers/runtime-payload repo.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-09-05 14:32:07 +02:00
Fabiano Fidêncio
518137f781 kata-deploy-cc: Try to remove /opt/confidential-containers
Let's try to remove the /opt/confidential-containers directory.  If it's
not empty, let's not bother force removing it, as the pre-install script
also drops files to the very same directory.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-09-05 14:29:57 +02:00
Fabiano Fidêncio
fb711e0e8e kata-deploy-cc: Improve shim backup / restore
We're currently backing up and restoring all the possible shim files,
but the default one ("containerd-shim-kata-v2").

Let's ensure this is also backed up and restored.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-09-05 14:29:57 +02:00
Fabiano Fidêncio
a43f95d01b kata-deploy: Rely on the configure config path
Instead of passing a `KATA_CONF_FILE` environament variable, let's rely
on the configured (in the container engine) config path, as both
containerd and CRI-O support it, and we're using this for both of them.

This is a "backport" of f7ccf92dc8, from
the original `kata-deploy.sh` to the one used for Confidential
Containers.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-09-05 14:29:57 +02:00
Fabiano Fidêncio
f684d00d50 kata-deploy-cc: Simplify the script
As containerd is the only supported container engine, let's simplify the
script and, at the same time, make it clear that other container engines
are not supported yet.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-09-05 14:29:57 +02:00