Commit Graph

705 Commits

Author SHA1 Message Date
Archana Shinde
98bacb0efc release: Adapt kata-deploy for 3.0.2
kata-deploy files must be adapted to a new release.  The cases where it
happens are when the release goes from -> to:
* main -> stable:
  * kata-deploy-stable / kata-cleanup-stable: are removed

* stable -> stable:
  * kata-deploy / kata-cleanup: bump the release to the new one.

There are no changes when doing an alpha release, as the files on the
"main" branch always point to the "latest" and "stable" tags.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-02-15 10:56:42 -08:00
Archana Shinde
960f089d3c virtiofsd: fix the build on ppc64le
link-self-contained is not supported on ppc64le rust target.
Hence, do not pass it while building virtiofsd.

Fixes: #6195

Backport of #856ab66871

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-02-14 08:55:53 -08:00
Hyounggyu Choi
0623f1fe6b virtiofsd: Not use "link-self-contained=yes" on s390x
The compile option link-self-contained=yes asks rustc to use
C library startup object files that come with the compiler,
which are not available on the target s390x-unknown-linux-gnu.
A build does not contain any startup files leading to a
broken executable entry point (causing segmentation fault).

Fixes: #5522 for stable-3.0
Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
(cherry picked from commit 43fcb8fd09)
Signed-off-by: Greg Kurz <groug@kaod.org>
2023-02-04 11:17:26 +01:00
Hyounggyu Choi
5883dc1bd9 CI: Set docker version to v20.10 in ubuntu:20.04 for s390x|ppc64le
This is to make a docker version to v20.10 in docker upstream image ubuntu:20.04 for s390x and ppc64le.

Fixes: #6211 for stable-3.0
Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
(cherry picked from commit f49b89b632)
Signed-off-by: Greg Kurz <groug@kaod.org>
2023-02-04 11:16:11 +01:00
Fabiano Fidêncio
c712057ae7 release: Adapt kata-deploy for 3.0.1
kata-deploy files must be adapted to a new release.  The cases where it
happens are when the release goes from -> to:
* main -> stable:
  * kata-deploy-stable / kata-cleanup-stable: are removed

* stable -> stable:
  * kata-deploy / kata-cleanup: bump the release to the new one.

There are no changes when doing an alpha release, as the files on the
"main" branch always point to the "latest" and "stable" tags.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-19 16:05:12 +01:00
Bin Liu
0afcc57a92 package: add nydus to release artifacts
Install nydus related binaries under /opt/kata/libexec/

Fixes: #5726

Signed-off-by: Bin Liu <bin@hyper.sh>
(cherry picked from commit abb9ebeece)
2022-12-19 15:51:18 +01:00
Fabiano Fidêncio
bd797eddec kata-deploy: Fix the pod of kata deploy starts to occur an error
If a pod of kata is deployed on a machine, after the machine restarts, the pod status of kata-deploy will be CrashLoopBackOff.

Fixes: #5868
Signed-off-by: SinghWang <wangxin_0611@126.com>
2022-12-15 14:40:11 +08:00
Fabiano Fidêncio
2e49586445 virtiofsd: Build inside a container
When moving to building the CI artefacts using the kata-deploy scripts,
we've noticed that the build would fail on any machine where the tarball
wasn't officially provided.

This happens as rust is missing from the 1st layer container.  However,
it's a very common practice to leave the 1st layer container with the
minimum possible dependencies and install whatever is needed for
building a specific component in a 2nd layer container, which virtiofsd
never had.

In this commit we introduce the second layer containers (yes,
comtainers), one for building virtiofsd using musl, and one for building
virtiofsd using glibc.  The reason for taking this approach was to
actually simplify the scripts and avoid building the dependencies
(libseccomp, libcap-ng) using musl libc.

Fixes: #5425

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
(cherry picked from commit 7e5941c578)
2022-11-25 13:28:57 +01:00
Peng Tao
fb44305497 release: Adapt kata-deploy for 3.0.0
kata-deploy files must be adapted to a new release.  The cases where it
happens are when the release goes from -> to:
* main -> stable:
  * kata-deploy-stable / kata-cleanup-stable: are removed

* stable -> stable:
  * kata-deploy / kata-cleanup: bump the release to the new one.

There are no changes when doing an alpha release, as the files on the
"main" branch always point to the "latest" and "stable" tags.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2022-10-08 12:42:06 +00:00
Greg Kurz
babab160bc tools: release: fix bogus version check
Shell expands `*"rc"*` to the top-level `src` directory. This results
in comparing a version with a directory name. This doesn't make sense
and causes the script to choose the wrong branch of the `if`.

The intent of the check is actually to detect `rc` in the version.

Fixes: #5283
Signed-off-by: Greg Kurz <groug@kaod.org>
(cherry picked from commit 421729f991)
Signed-off-by: Greg Kurz <groug@kaod.org>
2022-09-29 14:56:52 +02:00
Gabriela Cervantes
af22e71375 osbuilder: Export directory variables for libseccomp
To avoid the random failures when we are building the rootfs as it seems
that it does not find the value for the libseccomp and gperf directory,
this PR export these variables.

Fixes #5232

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
(cherry picked from commit a4a23457ca)
Signed-off-by: Greg Kurz <groug@kaod.org>
2022-09-28 13:16:09 +02:00
Zhongtao Hu
c6b3dcb67d kata-deploy: support kata-deploy for runtime-rs
support kata-deploy for runtime-rs

Fixes:#5000
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-09-22 17:39:20 +08:00
Zhongtao Hu
a394761a5c kata-deploy: add installation for runtime-rs
setup the compile environment and installation path for the Rust runtime

Fixes:#5000
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-09-22 15:59:44 +08:00
Peng Tao
be242a3c3c release: Adapt kata-deploy for 3.0.0-rc0
kata-deploy files must be adapted to a new release.  The cases where it
happens are when the release goes from -> to:
* main -> stable:
  * kata-deploy-stable / kata-cleanup-stable: are removed

* stable -> stable:
  * kata-deploy / kata-cleanup: bump the release to the new one.

There are no changes when doing an alpha release, as the files on the
"main" branch always point to the "latest" and "stable" tags.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2022-09-16 03:53:43 +00: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
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
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
Fabiano Fidêncio
373dac2dbb 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>
2022-09-02 15:47:48 +02:00
Ryan Savino
59e3850bfd 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>
2022-09-01 21:07:30 -05:00
Ryan Savino
54d6d01754 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>
2022-09-01 20:36:28 -05: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
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
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
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
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
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
0a6f0174f5 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 10:51:13 +02:00
Ryan Savino
4ee2b99e1e kata-deploy: fix threading conflicts
Fix threading conflicts when kata-deploy 'make kata-tarball' is called.
Force the creation of rootfs tarballs to happen serially instead of in parallel.

Fixes: #4787

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2022-08-23 12:35:23 -05:00
Miao Xia
731d39df45 kernel: Add CONFIG_CGROUP_HUGETLB=y as part of the cgroup fragments
Kata guest os cgroup is not work properly kata guest kernel config option
CONFIG_CGROUP_HUGETLB is not set, leading to:

root@clr-b08d402cc29d44719bb582392b7b3466 ls /sys/fs/cgroup/hugetlb/
ls: cannot access '/sys/fs/cgroup/hugetlb/': No such file or directory

Fixes: #4953

Signed-off-by: Miao Xia <xia.miao1@zte.com.cn>
2022-08-23 12:31:13 +02:00
Ryan Savino
00aadfe20a kernel: SEV guest kernel upgrade to 5.19.2
kernel: Update SEV guest kernel to 5.19.2

Kernel 5.19.2 has all the needed patches for running SEV, thus let's update it and stop using the version coming from confidential-containers.

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2022-08-19 13:08:14 -05:00
Ryan Savino
0d9d8d63ea kernel: upgrade guest kernel support to 5.19.2
kernel: Upgrade guest kernel support to 5.19.2

Let's update to the latest 5.19.x released kernel.

CONFIG modifications necessary:
fragments/common/dax.conf - CONFIG_DEV_PAGEMAP_OPS no longer configurable:
https://www.kernelconfig.io/CONFIG_DEV_PAGEMAP_OPS?q=CONFIG_DEV_PAGEMAP_OPS&kernelversion=5.19.2
fragments/common/dax.conf - CONFIG_ND_BLK no longer supported:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f8669f1d6a86a6b17104ceca9340ded280307ac1
fragments/x86_64/base.conf - CONFIG_SPECULATION_MITIGATIONS is a dependency for CONFIG_RETPOLINE:
https://www.kernelconfig.io/config_retpoline?q=&kernelversion=5.19.2
fragments/s390/network.conf - removed from kernel since 5.9.9:
https://www.kernelconfig.io/CONFIG_PACK_STACK?q=CONFIG_PACK_STACK&kernelversion=5.19.2

Updated vmlinux path in build-kernel.sh for arch s390

Fixes #4860

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2022-08-19 13:08:13 -05:00
Manabu Sugimoto
92f7d6bf8f ci: Use versions.yaml for the libseccomp
It would be nice to use `versions.yaml` for the maintainability.
Previously, we have been specified the `libseccomp` and the `gperf` version
directly in this script without using the `versions.yaml` because the current
snap workflow is incomplete and fails.
This is because snap CI environment does not have kata-cotnainers repository
under ${GOPATH}. To avoid the failure, the `rootfs.sh` extracts the libseccomp
version and url in advance and pass them to the `install_libseccomp.sh` as
environment variables.

Fixes: #4941

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-08-19 09:05:08 +09:00
Wainer dos Santos Moschetta
f7d41e98cb kata-deploy: export CI in the build container
The clone_tests_repo() in ci/lib.sh relies on CI variable to decide
whether to checkout the tests repository or not. So it is required to
pass that variable down to the build container of kata-deploy, otherwise
it can fail on some scenarios.

Fixes #4949
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2022-08-17 10:42:49 -03:00
Wainer dos Santos Moschetta
4f90e3c87e kata-deploy: add dockerbuild/install_yq.sh to gitignore
The install_yq.sh is copied to tools/packaging/kata-deploy/local-build/dockerbuild
so that it is added in the kata-deploy build image. Let's tell git to
ignore that file.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2022-08-17 10:00:28 -03:00
Fabiano Fidêncio
1444d7ce42 packaging: Create no_patches.txt for the SPR-BKC-PC-v9.6.x
The file was added as part of the commit that tested this changes in the
CCv0 branch, but forgotten when re-writing it to the `main` branch.

Fixes: #4841

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-08-08 11:00:23 +02:00
Fabiano Fidêncio
578121124e
Merge pull request #4805 from fidencio/topic/bump-tdx-dependencies
Bump TDX dependencies (QEMU and Kernel)
2022-08-03 19:31:26 +02:00
Fabiano Fidêncio
8d1cb1d513 td-shim: Adjust final tarball location
Let's create the td-shim tarball in the directory where the script was
called from, instead of doing it in the $DESTDIR.

This aligns with the logic being used for creating / extracting the
tarball content, which is already in use by the kata-deploy local build
scripts.

Fixes: #4809

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-08-03 14:58:44 +02:00
Fabiano Fidêncio
62f05d4b48 ovmf: Adjust final tarball location
Let's create the OVMF tarball in the directory where the script was
called from, instead of doing it in the $DESTDIR.

This aligns with the logic being used for creating / extracting the
tarball content, which is already in use by the kata-deploy local build
scripts.

Fixes: #4808

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-08-03 14:58:29 +02:00
Fabiano Fidêncio
9972487f6e versions: Bump Kernel TDX version
The latest kernel with TDX support should be pulled from a different
repo (https://github.com/intel/linux-kernel-dcp, instead of
https://github.com/intel/tdx), and the latest version to be used is
SPR-BKC-PC-v9.6.

With the new version being used, let's make sure we enable the
INTEL_TDX_ATTESTATION config option, and all the dependencies needed to
do so.

Fixes: #4803

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-08-03 12:00:49 +02:00
Fabiano Fidêncio
c9358155a2 kernel: Sort the TDX configs alphabetically
Let's just re-order the TDX configs alphabetically. No new config has
been added or removed, thus no need to bump the kernel version.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-08-03 11:57:02 +02:00
Fabiano Fidêncio
c9b5bde30b versions: Track and build TDVF
TDVF is the firmware used by QEMU to start TDX capable VMs.  Let's start
tracking it as it'll become part of the Confidential Containers sooner
or later.

TDVF lives in the public https://github.com/tianocore/edk2-staging repo
and we're using as its version tags that are consumed internally at
Intel.

Fixes: #4624

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-08-02 09:51:47 +02:00
Fabiano Fidêncio
e6a5a5106d packaging: Generate a tarball as OVMF build result
Instead of having as a result the directory where OVMF artefacts where
installed, let's follow what we do with the other components and have a
tarball as a result of the OVMF build.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-08-02 09:48:59 +02:00
Fabiano Fidêncio
42eaf19b43 packaging: Simplify OVMF repo clone
Instead of cloning the repo, and then switching to a specific branch,
let's take advantage of `--branch` and directly clone the specific
branch / tag.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-08-02 09:48:59 +02:00
Fabiano Fidêncio
4d33b0541d packaging: Don't hardcode "edk2" as the cloned repo's dir.
As TDVF comes from a different repo, the edk2-staging one, we cannot
simply hardcode the name.  Instead, let's get the name of the directory
from name of the git repo.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-08-02 09:48:59 +02:00
Fabiano Fidêncio
b06bc82284 versions: Track and add support for building TD-shim
TD-shim is a simplified TDX virtual firmware, used by Cloud Hypervisor,
in order to create a TDX capable VM.

TD-shim is heavily under development, and is hosted as part of the
Confidential Containers project:
https://github.com/confidential-containers/td-shim

The version chosen for this commit, is a version that's being tested
inside Intel, but we, most likely, will need to change it before we have
it officially packaged as part of an official release.

Fixes: #4779

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-08-01 16:36:12 +02:00
Fabiano Fidêncio
54147db921
Merge pull request #4170 from Alex-Carter01/build-amdsev-ovmf
Add support AmdSev build of OVMF
2022-07-28 19:42:50 +02:00