Commit Graph

88 Commits

Author SHA1 Message Date
stevenhorsman
c5ff513e0b shellcheck: Fix shellcheck SC2068
> Double quote array expansions to avoid re-splitting elements

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-03-04 09:35:46 +00:00
Fabiano Fidêncio
76df852f33 packaging: agent: Add rust version to the builder image name
As we want to make sure a new builder image is generated if the rust
version is bumped.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-02-06 08:53:51 +00:00
Ruoqing He
7e76ef587a virtiofsd: Enable build for RISC-V
With this change, `virtiofsd` (gnu target) could be built and then to be
used with other components.

Depends: #10741
Fixes: #10739

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-01-21 18:05:37 +08:00
Zvonko Kaiser
07d2b00863 qemu: Fix aarch64 build
Building static binaries for aarch64 requires disabling PIE
We get an GOT overflow and the OS libraries are only build with fpic
and not with fPIC which enables unlimited sized GOT tables.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-12-18 03:26:14 +00:00
Zvonko Kaiser
cc9ecedaea qemu: Bump version, new options, add no_patches
We want to have the latest QEMU version available
which is as of this writing v9.1.2

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>

qemu: Add new options for 9.1.2

We need to fence specific options depending on the version
and disable ones that are not needed anymore

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>

qemu: Add no_patches.txt

Since we do not have any patches for this version
let's create the appropriate files.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-12-11 16:32:39 +00:00
Zvonko Kaiser
c82db45eaa qemu: Disable pmem
We're disabling pmem support, it is heavilly broken with
Ubuntu's static build of QEMU and not needed

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-12-11 16:32:19 +00:00
Zhiwei Huang
d455883b46 tools: Support for building qemu with linux aio
The kata containers hypervisior qemu configuration supports setting
block_device_aio="native", but the kata static build of qemu does
not add the linux aio feature.

The libaio-dev library is a necessary dependency for building qemu
with linux aio.

Fixes: #10130

Signed-off-by: Zhiwei Huang <ai.william@outlook.com>
2024-08-06 14:30:45 +08:00
Fabiano Fidêncio
b7051890af
Merge pull request #9722 from zvonkok/busybox-build
deploy: Add busybox target
2024-07-17 13:47:15 +02:00
Zvonko Kaiser
b1909e940e deploy: Add busybox target
For a minimal initrd/image build we may want to leverage busybox.
This is part number two of the NVIDIA initrd/image build

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-06-18 15:31:00 +00:00
Ryan Savino
0430794952 qemu: upgrade to 8.2.4
There is a known issue in qemu 7.2.0 that causes kernel-hashes to fail the verification of the launch binaries for the SEV legacy use case.

Upgraded to qemu 8.2.4.
new available features disabled.

Fixes: #9148

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2024-06-13 10:19:42 -05:00
Beraldo Leal
c99ba42d62 deps: bumping yq to v4.40.7
Since yq frequently updates, let's upgrade to a version from February to
bypass potential issues with versions 4.41-4.43 for now. We can always
upgrade to the newest version if necessary.

Fixes #9354
Depends-on:github.com/kata-containers/tests#5818

Signed-off-by: Beraldo Leal <bleal@redhat.com>
2024-05-31 13:28:34 -04:00
Zvonko Kaiser
063db516f2 ci: Remove all git config safe.directory
Now with the sudo less build we should be good
to remove those hacks.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-30 15:12:28 +00:00
Zvonko Kaiser
02a7f8c852 ci: Fix tools builder images
We weren't considering changes of the tools script dir
adding a fourth hash to accomodate this

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-30 08:10:42 +00:00
Hyounggyu Choi
e075150fbe CI: Use --abbrev=9 explicitly for abbreviated commit hash
A length of the result of `git log -1 --pretty=format:%h` could vary
over different CI systems, highly likely messing up their caching
mechanisms.

This commit is to use an option `--abbrev=9` to standardize the length
to 9 characters for CI.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-05-15 14:22:07 +02:00
Chelsea Mafrica
4e3deb5a3b tools: Fix path for installing yq in packaging script
The lib.sh script uses the right directory but the wrong path for the
script that installs yq; fix it.

Fixes #9165

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2024-03-25 15:09:52 -07:00
Niteesh Dubey
0538bbfc49 packaging: qemu-snp-experimental: support host kernel with gmem
This is required to allow creation of SNP coco on host kernel
(e.g. https://github.com/AMDESE/linux ,branch:snp-host-latest)
supporting guest private memory for SNP using gmem.

Note: This qemu does not work if the host kernel does not support
gmem/UPM.

Fixes: #9092

Signed-off-by: Niteesh Dubey <niteesh@us.ibm.com>
2024-02-15 16:33:46 +00:00
ChengyuZhu6
70a84eca9e packaging: allow to pull and unpack pause image
For Confidential containers stack, the pause image is managed by host side,
then it may configure a malicious pause image, we need package
a pause image inside the rootfs and don't the pause image from host.

But the installation of skopeo is not included in 20.04 release, so we
can not directly install skopeo in rootfs and pull pause image.

So I plan to let the task as a static build stuff, which would not be influenced
by the system version in rootfs. And the pause image will be part of the Kata Containers rootfs
that's used by the Confidential Containers usecase. This commit enables the component to be built
both locally and in our CI environment with the command: make pause-image-tarball.

Fixes: #9032

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
Co-authored-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Co-authored-by: Wang, Arron <arron.wang@intel.com>
Co-authored-by: stevenhorsman <steven@uk.ibm.com>
Co-authored-by: Jakob Naucke <jakob.naucke@ibm.com>
2024-02-08 11:23:23 +08:00
Hyounggyu Choi
2e1d770fcf packaging: Track files correctly when naming builder image for agent
The necessary files for the agent builder image can be found in
`tools/packaging/static-build/agent`,
`ci/install_libseccomp.sh` and
`tools/packaging/kata-deploy/local-build/kata-deploy-copy-libseccomp-installer.sh`.
Identifying the correct files addresses the previously misreferenced path
used to name the builder image.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-01-31 10:49:20 +01:00
Fabiano Fidêncio
644abde35c
packaging: coco-guest-components: Allow building the project
The Confidential Containers guest-components will, in the very short
future, be part of the Kata Containers rootfs that's used by the
Confidential Containers usecase.

This commit introduces the ability to, standalone, build the component
locally and as part of our CI, and this can be done by calling:
`make coco-guest-components-tarball`

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Signed-off-by: Linda Yu <linda.yu@intel.com>
Co-authored-by: stevenhorsman <steven@uk.ibm.com>
Co-authored-by: Jakob Naucke <jakob.naucke@ibm.com>
Co-authored-by: Wang, Arron <arron.wang@intel.com>
Co-authored-by: zhouliang121 <liang.a.zhou@linux.alibaba.com>
Co-authored-by: Alex Carter <alex.carter@ibm.com>
Co-authored-by: Suraj Deshmukh <suraj.deshmukh@microsoft.com>
Co-authored-by: Xynnn007 <xynnn@linux.alibaba.com>
2024-01-26 19:36:01 +01:00
Fabiano Fidêncio
a7c68225aa
Merge pull request #8916 from fidencio/topic/packaging-reuse-already-built-agent
packaging:  Don't always build the kata-agent
2024-01-26 12:00:55 +01:00
Fabiano Fidêncio
1039641ab8
packaging: agent: Add the arch to the builder container
This has been missed during reviews and is already a problem as we're
trying to build the agent outside of the rootfs for other architectures
than x86_64.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-25 14:11:14 +01:00
Fabiano Fidêncio
58874f9c3e
packaging: tools: Add the arch to the builder container
This has been missed during reviews and will become a problem when the
tools start to be built in different architectures.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-25 14:10:22 +01:00
Zvonko Kaiser
19ecdbca3b qemu: enable TPM
Several use-cases need a vTPM lets enable it for QEMU, a follow up patch will introduce the runtime config.

Fixes: #8902

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-01-24 17:49:08 +00:00
Fabiano Fidêncio
cf4835e3ae
packaging: qemu: Simplify "--disable-virtiofsd" logic
As all the supported architectures are disabling the virtiofsd build,
there's no need to keep the switch statement there.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-09 14:35:45 -03:00
Greg Kurz
6236fa4617 release: Drop build_hub helper
Not used anymore.

Signed-off-by: Greg Kurz <groug@kaod.org>
2023-10-31 15:28:57 +01:00
Greg Kurz
b83a7149ee release: Introduce helper to get GitHub CLI
If gh isn't installed already, download it from GitHub.

Signed-off-by: Greg Kurz <groug@kaod.org>
2023-10-31 15:09:24 +01:00
Fabiano Fidêncio
fbc8f8f466 scripts: Use install_yq from the kata-containers repo
As the file is already part of the kata-containers repo, and the tests
repo is about to become read-only, we're good to drop the tests
references from here and use everything coming from the
`kata-containers` repo instead.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-10-11 12:52:55 +02:00
Fabiano Fidêncio
45c1188839 packaging: Add get_agent_image_name()
This will be used for building the kata-agent.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-10-03 14:17:38 +02:00
Fabiano Fidêncio
4d08ec29bc packaging: Add get_tools_image_name()
This will be used for building all the (rust) components from src/tools.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-09-27 18:48:35 +02:00
Fabiano Fidêncio
98097c96de packaging: Use git abbreviated hash
This will make it easier to build images that rely on several
directories hashes.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-09-27 18:48:30 +02:00
Jianyong Wu
2fc5f0e2e0 kata-depoly: prepare env for cross build in lib.sh
We leverage three env, TARGET_ARCH means the buid target tuple;
ARCH nearly the same meaning with TARGET_ARCH but has been widely
used in kata; CROSS_BUILD means if you want to do cross compile.

Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2023-08-01 22:10:46 +02:00
Hyounggyu Choi
43e73bdef7 packaging: make BUILDER_REGISTRY configurable
This PR is to make an environment variable `BUILDER_REGISTRY` configurable
so that those who want to use their own registry for build can set up
the registry.

Fixes: #6988
Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2023-05-30 14:40:02 +02:00
Amulyam24
c5a59caca1 ppc64le: switch virtiofsd from C to rust version
We have been using the C version of virtiofsd on ppc64le. Now that the issue with
rust virtiofsd have been fixed, let's switch to it.

Fixes: #4259

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2023-05-16 14:46:19 +02:00
Fabiano Fidêncio
800fb49da1 packaging: Add get_ovmf_image_name() helper
As we'll be using this from different places in the near future, let's
create a helper function as part of the libs.sh.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-04-11 15:23:42 +02:00
Fabiano Fidêncio
3018c9ad51 versions: Update QEMU TDX version
Let's update the QEMU TDX version to what's the latest tested release of
the Intel TDX tools with Kata Containers.

In order to do such update, we had to relax the checks on the QEMU
version for some of the configuration options, as those were removed
right after the window was open for the 7.1.0 development (thus the
7.0.50 check).

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-04-11 15:17:04 +02:00
Fabiano Fidêncio
fbf891fdff packaging: Adapt get_last_modification()
The function is returning "" when called from the script used to cache
the artefacts and one difference noted between this version and the
already working one from the CCv0 is that we make sure to `pushd
${repo_root_dir}` in the CCv0 version.

Let's give it a try here and see if it solves the issue.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-03-17 16:27:34 +01:00
Fabiano Fidêncio
194d5dc8a6 tools: Add support for caching VirtioFS artefacts
Let's add support for caching VirtioFS artefacts that are generated using
the kata-deploy local-build scripts.

Right now those are not used, but we'll switch to using them very soon
as part of upcoming changes of how we build the components we test in
our CI.

Fixes: #6480

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-03-17 11:43:01 +01:00
Fabiano Fidêncio
a34272cf20 tools: Add support for caching shim v2 artefacts
Let's add support for caching shim v2 artefacts that are generated using
the kata-deploy local-build scripts.

Right now those are not used, but we'll switch to using them very soon
as part of upcoming changes of how we build the components we test in
our CI.

Fixes: #6480

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-03-17 11:43:01 +01:00
Fabiano Fidêncio
e90891059b tools: Add support for caching QEMU artefacts
Let's add support for caching QEMU artefacts that are generated using
the kata-deploy local-build scripts.

Right now those are not used, but we'll switch to using them very soon
as part of upcoming changes of how we build the components we test in
our CI.

Fixes: #6480

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-03-17 11:43:01 +01:00
Fabiano Fidêncio
cb4cbe2958 tools: Add support for caching Kernel artefacts
Let's add support for caching Kernel artefacts that are generated using
the kata-deploy local-build scripts.

Right now those are not used, but we'll switch to using them very soon
as part of upcoming changes of how we build the components we test in
our CI.

Fixes: #6480

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-03-17 11:43:01 +01:00
Fabiano Fidêncio
43ce3f7588 packaging: Simplify get_last_modification()
There's no need to pass repo_root_dir to get_last_modification() as the
variable used everywhere is exported from that very same file.

Fixes: #6431

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-03-08 21:22:03 +01:00
Fabiano Fidêncio
33c5c49719 packaging: Move repo_root_dir to lib.sh
This is used in several parts of the code, and can have a single
declaration as part of the `lib.sh` file, which is already imported by
all the places where it's used.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-03-08 21:10:53 +01:00
Fabiano Fidêncio
869827d77f packaging: Add push_to_registry()
This function will push a specific tag to a registry, whenever the
PUSH_TO_REGISTRY environment variable is set, otherwise it's a no-op.

This will be used in the future to avoid replicating that logic in every
builder used by the kata-deploy scripts.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-02-17 11:30:21 +01:00
Fabiano Fidêncio
e69a6f5749 packaging: Add get_last_modification()
Let's add a function to get the hash of the last commit modifying a
specific file.

This will help to avoid writing `git rev-list ...` into every single
build script used by the kata-deploy.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-02-17 10:39:33 +01:00
Fabiano Fidêncio
6c05e5c67a packaging: Add and export BUILDER_REGISTRY
BUILD_REGISTRY, which points to quay.io/kata-containers/builder, will be
used for storing the builder images used to build the artefacts via the
kata-deploy scripts.

The plan is to tag, whenever it's possible and makes sense, images like:
* ${BUILDER_REGISTRY}:${component}-${unique_identifier}

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-02-17 10:39:33 +01:00
Fabiano Fidêncio
676d028504 versions: Bump QEMU to v7.2.0
As QEMU released its v7.2.0 version in December last year, last do the
bump on our side.

A few configuration options have been removed between the v6.2.0 (the
version we currently use) and v7.2.0, so those have also been dropped
from our configure-hypervison.sh script (for this specific version).

Also, we're explicitly setting --disable-virtiofsd for the platforms
that we're testing using the rust version.
See: a8d6abe129/docs/about/deprecated.rst (virtiofsd)

Fixes: #6102

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-18 13:11:12 +01:00
Bin Liu
adb33a4121 packaging: fix typo in configure-hypervisor.sh
`powwer` is a typo of `power`, and many spaces should
be replaced by tabs for indent.

Fixes: #5160

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-09-14 11:38:01 +08:00
Archana Shinde
2488a0f6c0
Merge pull request #4439 from amshinde/update-kernel-to-5.15.46
versions: Update kernel to latest LTS version 5.15.48
2022-06-24 11:03:32 -07:00
Archana Shinde
93874cb3bb packaging: Restrict kernel patches applied to top-level dir
The apply_patches.sh script applies all patches in the patches
directory,  as well as subdirectories. This means if there is a sub-dir
called "experimental" under a major kernel version directory,
experimental patches would be applied to the default kernel supported by
Kata.
We did not come accross this issue earlier as typically the experimental
kernel version was different from the default kernel.
With both the default kernel and the arm-experimental kernel having the
same major kernel version (5.15.x) at this time, trying to update the
kernel patch version revealed that arm-experimental patches were being
applied to the default kernel.

Restricting the patches to be applied to the top level directory will
solve the issue. The apply_patches script should ignore any
sub-directories meant for experimental patches.

Fixes #4520

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2022-06-23 10:43:52 -07:00
Fabiano Fidêncio
1ef0b7ded0 runtime: Switch to using the rust version of virtiofsd (all but power)
So far this has been done for x86_64.  Now that the support for building
and testing has been added for all arches, let's do the second part of
the switch.

We're still not done yet for powerpc, as some a virtifosd crash on the
rust version has been found by the maintainer.

Fixes: #4258, #4260

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-13 10:41:26 +02:00