Commit Graph

9612 Commits

Author SHA1 Message Date
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
Fabiano Fidêncio
1f610ea5cc packaging: Improve qemu build image handling
Let's create the QEMU build image based on the version of QEMU used, so
if we happen to have a parallel build we ensure different images are
being used.

Also, let's ensure the image gets remove after the build.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-09-05 09:47:59 +02:00
Fabiano Fidêncio
abe89586c6 qemu: Keep passing BUILD_SUFFIX
In the commit 54d6d01754 we ended up
removing the BUILD_SUFFIX argument passed to QEMU as it only seemed to
be used to generate the HYPERVISOR_NAME and PKGVERSION, which were added
as arguments to the dockerfile.

However, it turns out BUILD_SUFFIX is used by the `qemu-build-post.sh`
script, so it can rename the QEMU binary accordingly.

Let's just bring it back.

Fixes: #5078

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
(cherry picked from commit 373dac2dbb)
2022-09-05 09:39:39 +02:00
Ryan Savino
a8feee68a8 qemu: create no_patches.txt file for SPR-BKC-QEMU-v2.5
Patches failing without the no_patches.txt file for SPR-BKC-QEMU-v2.5.

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
(cherry picked from commit 59e3850bfd)
2022-09-05 09:39:25 +02:00
Ryan Savino
a2d9633dad qemu: fix tdx qemu tarball directories
Dockerfile cannot decipher multiple conditional statements in the main RUN call.
Cannot segregate statements in Dockerfile with '{}' braces without wrapping entire statement in 'bash -c' statement.
Dockerfile does not support setting variables by bash command.
Must set HYPERVISOR_NAME and PKGVERSION from parent script: build-base-qemu.sh

Fixes: #5078

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
(cherry picked from commit 54d6d01754)
2022-09-05 09:39:03 +02:00
Fabiano Fidêncio
b6873f9581 kata-deploy: Add td-shim as part of the cc-tarball
4cf502fb20 added the ability to build
TD-Shim, but forgot to have it added as part of the cc-tarball target.

Fixes: #5042

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-09-05 08:39:37 +02:00
Fabiano Fidêncio
b9c0f7fb09
Merge pull request #5056 from GeorginaKin/CCv0
CCv0: Merge main into CCv0 branch
2022-09-02 13:40:23 +02:00
Fabiano Fidêncio
981c0b1646
Merge pull request #5013 from ryansavino/add-sev-config
config: Added SEV config
2022-09-02 11:36:45 +02:00
Ryan Savino
656d72bd74 config: Added SEV config
Added default sev kata config template.
Added required default variables in Makefile.

Fixes #5012
Fixes #5008

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2022-09-01 09:40:14 -05:00
Georgina Kinge
683755483b runtime: Remove duplicate fields
Remove duplicate fields produced from bad merge

Signed-off-by: Georgina Kinge <georgina.kinge@ibm.com>
2022-08-31 16:55:37 +01:00
Georgina Kinge
e46364ad98 vendor: regenerating vendor files
Fix vendor files after conflicts

Signed-off-by: Georgina Kinge <georgina.kinge@ibm.com>
2022-08-31 15:23:15 +01:00
Georgina Kinge
9931d4cbf0 CCv0: Merge main into CCv0 branch
Merge remote-tracking branch 'upstream/main' into CCv0

Fixes: #5054
Signed-off-by: Georgina Kinge <georgina.kinge@ibm.com>
2022-08-31 15:01:40 +01:00
Fabiano Fidêncio
20b999c479
Merge pull request #4967 from arronwy/generate_root_hash
CC | image-build: generate root hash as an separate partition for rootfs
2022-08-31 13:18:39 +02:00
Fabiano Fidêncio
08d230c940
Merge pull request #5046 from fidencio/topic/fix-regression-on-building-tdx-kernel
kernel: Re-work get_tee_kernel()
2022-08-31 13:16:26 +02:00
Greg Kurz
380af44043
Merge pull request #5036 from jpecholt/whitelist-cleanup
kernel: Whitelist cleanup
2022-08-31 11:08:32 +02:00
Fabiano Fidêncio
a1fdc08275 kernel: Re-work get_tee_kernel()
00aadfe20a introduced a regression on
`make cc-tdx-kernel-tarball` as we stopped passing all the needed
information to the `build-kernel.sh` script, leading to requiring `yq`
installed in the container used to build the kernel.

This commit partially reverts the faulty one, rewritting it in a way the
old behaviour is brought back, without changing the behaviour that was
added by the faulty commit.

Fixes: #5043

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-08-31 10:08:12 +02:00
Peng Tao
f1276180b1
Merge pull request #4996 from liubin/fix/4995-delete-socket-option-for-shim
runtime-rs: delete socket from shim command-line options
2022-08-31 14:16:56 +08:00
Bin Liu
515bdcb138
Merge pull request #4900 from wllenyj/dragonball-ut
Built-in Sandbox: add more unit tests for dragonball.
2022-08-31 14:00:07 +08:00
Fabiano Fidêncio
2e77eb4bdb
Merge pull request #5021 from fidencio/topic/add-https_proxy-to-the-agent-config
CC | docs: Add https_proxy to confidential agent config
2022-08-30 19:36:24 +02:00
Joana Pecholt
a6581734c2 kernel: Whitelist cleanup
This removes two options that are not needed (any longer). These
are not set for any kernel so they do not need to be ignored either.

Fixes #5035

Signed-off-by: Joana Pecholt <joana.pecholt@aisec.fraunhofer.de>
2022-08-30 13:24:12 +02:00
Fabiano Fidêncio
1b92a946d6
Merge pull request #4987 from ryansavino/initrd-fixes-for-ubuntu-systemd
Initrd fixes for ubuntu systemd
2022-08-30 09:16:43 +02:00
GabyCT
630eada0d3
Merge pull request #4956 from shippomx/main
kernel: Add CONFIG_CGROUP_HUGETLB=y as part of the cgroup fragments
2022-08-29 14:31:46 -05:00
GabyCT
3426da66df
Merge pull request #4951 from wainersm/fix_kata-deploy-ci
Fix kata-deploy to work on CI context
2022-08-29 14:30:59 -05:00
Wainer Moschetta
cd5be6d55a
Merge pull request #4775 from bookinabox/auto-backport
github-actions: Auto-backporting
2022-08-29 14:08:12 -03:00
Fabiano Fidêncio
512a92a543 docs: Add https_proxy to confidential agent config
The agent configuration file, which is part of the docs, is used by the
confidential containers CIs and, right now, cannot be run behind a
firewall, which is exactly how the TDX CIs are reunning, as https_proxy
is not set there.

Fixes: #5020
Depends-on: github.com/kata-containers/tests#5080

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-08-29 19:04:48 +02:00
Bin Liu
11383c2c0e
Merge pull request #4797 from openanolis/runtime-rs-coresched
runtime-rs: add support for core scheduling
2022-08-29 14:28:30 +08:00
Bin Liu
25f54bb999
Merge pull request #4942 from ManaSugi/fix/use-versions-yaml-for-libseccomp
ci: Use versions.yaml for the libseccomp
2022-08-29 11:22:35 +08:00
Archana Shinde
c174eb809e
Merge pull request #4983 from ManaSugi/runk/add-init-msg
runk: Add cli message for init command
2022-08-27 00:15:25 +05:30
Ryan Savino
dc32c4622f osbuilder: fix ubuntu initrd /dev/ttyS0 hang
Guest log is showing a hang on systemd getty start.
Adding symlink for /dev/ttyS0 resolves issue.

Fixes: #4932

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2022-08-26 04:59:36 -05:00
Ryan Savino
cc5f91dac7 osbuilder: add systemd symlinks for kata-agent
AGENT_INIT=no (systemd) add symlinks for kata-agent service.

Fixes: #4932

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2022-08-26 04:59:36 -05:00
Fupan Li
63959b0be6
Merge pull request #5011 from liubin/fix/4962-add-logs
agent: add some logs for mount operation
2022-08-26 17:12:15 +08:00
Fabiano Fidêncio
e528b63f4f
Merge pull request #4984 from fidencio/topic/cc-add-runtime-configuration-for-clh-plus-tdx
CC | Build and ship CLH TDX (and all the needed artefacts)
2022-08-26 08:19:30 +02:00
Bin Liu
c08a8631e0 agent: add some logs for mount operation
Somewhere is lack of log info, add more details about
the storage and log when error will help understand
what happened.

Fixes: #4962

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-08-26 14:09:56 +08:00
Archana Shinde
7d52934ec1
Merge pull request #4798 from amshinde/use-iouring-qemu
Use iouring for qemu block devices
2022-08-26 04:00:24 +05:30
Fabiano Fidêncio
c362257142 kata-deploy-cc: Add CLH support to be used with TDX
As the previous commit added a new runtime class to be used with TDX,
let's make sure this gets shipped and configured as part of the
kata-deploy-cc script, which is used by the Confidential Containers
Operator.

This commit also cleans up all the extra artefacts that will be
installed in order to run the CLH TDX workloads.

Fixes: #4833
Depends-on: github.com/kata-containers/tests#5070

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-08-25 23:42:03 +02:00
Fabiano Fidêncio
0f4b5c08fe runtime: Add configuration file for CLH TDX
Let's add a new configuration file for using a cloud hypervisor (and all
the needed artefacts) that are TDX capable.

This PR extends the Makefile in order to provide variables to be set
during the build time that are needed for the proper configuration of
the VMM, such as:
* Specific kernel parameters to be used with TDX
* Specific kernel features to be used when using TDX
* Artefacts path for the artefacts built to be used with TDX
  * Kernel
  * TD-Shim

The reason we don't hack into the current Cloud Hypervisor configuration
file is because we want to ship both configurations, with for the
non-TEE use case and one for the TDX use case.

It's important to note that the Cloud Hypervisor used upstream is
already built with TDX support.

Fixes: #4831

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-08-25 23:42:03 +02:00
Fabiano Fidêncio
433ee7c92a
Merge pull request #5002 from fidencio/topic/cc-backport-4999
CC | kernel: Ignore CONFIG_SPECULATION_MITIGATIONS for older kernels
2022-08-25 20:28:27 +02:00
Wainer Moschetta
cbe5e324ae
Merge pull request #4815 from bookinabox/improve-agent-errors
logging: Replace nix::Error::EINVAL with more descriptive msgs
2022-08-25 14:27:56 -03:00
Fabiano Fidêncio
1eea3d9920
Merge pull request #4965 from ryansavino/kata-deploy-threading-fix
kata-deploy: fix threading conflicts
2022-08-25 19:11:52 +02:00
Fabiano Fidêncio
4d1c0a3235 kernel: Ignore CONFIG_SPECULATION_MITIGATIONS for older kernels
TDX kernel is based on a kernel version which doesn't have the
CONFIG_SPECULATION_MITIGATIONS option.

Having this in the allow list for missing configs avoids a breakage in
the TDX CI.

Fixes: #4998

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-08-25 17:45:30 +02:00
Fabiano Fidêncio
70cd4f1320
Merge pull request #4999 from fidencio/topic/ignore-CONFIG_SPECULATION_MITIGATIONS-for-older-kernels
kernel: Ignore CONFIG_SPECULATION_MITIGATIONS for older kernels
2022-08-25 17:43:57 +02:00
Fabiano Fidêncio
20129dea87
Merge pull request #4986 from fidencio/topic/cc-drop-force_tdx_guest-kernel-parameter
CC | config: Drop `force_tdx_guest` unneeded parameter
2022-08-25 14:23:14 +02:00
Fabiano Fidêncio
6125587750
Merge pull request #4997 from fidencio/topic/cc-backport-fixes-for-cloud-hypervisor-plus-tdx
CC | Backport fixes for Cloud Hypervisor + TDX
2022-08-25 12:14:22 +02:00