1
0
mirror of https://github.com/kata-containers/kata-containers.git synced 2025-05-09 17:07:33 +00:00
Commit Graph

1683 Commits

Author SHA1 Message Date
Steve Horsman
e6a78e64e6
Merge pull request from stevenhorsman/coco-tests-required
ci: Add coco required tests
2025-03-13 15:10:22 +00:00
mchtech
0e61eb215d tools: initialize unbound variables in rootfs.sh
Initialize unbound variables in rootfs.sh for RHEL series OS.

Signed-off-by: mchtech <michu_an@126.com>
2025-03-13 22:57:43 +08:00
Ruoqing He
3c8a8ca9c2 kernel: Enable riscv kernel build
Modify `build-kernel.sh` to enable building of riscv64 kernel.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-13 13:43:29 +08:00
Ruoqing He
e316f633d8 kernel: Bump kata_config_version
Bump kata_config_version since riscv kernel build is introduced.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-13 13:43:29 +08:00
Ruoqing He
31446b8be8 kernel: Skip ACPI common fragment for riscv
ACPI is not yet ratified and is still frequently evolving, disable
acpi.conf for riscv architecture.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-13 13:43:29 +08:00
Ruoqing He
ebd1214b2e kernel: Introduce riscv mmu fragment conf
Memory hotplug and related features is required, enable them in
`mmu.conf`.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-13 13:43:29 +08:00
Ruoqing He
734f5d07a9 kernel: Introduce riscv pci fragment conf
AIA (Advanced Interrupt Architecture) is available and enabled by
default after v6.10 kernel, provide pci.conf to make proper use of IMSIC
of AIA.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-13 13:43:29 +08:00
Ruoqing He
19d78ca844 kernel: Introduce riscv base fragment conf
Create `riscv` folder for riscv64 architecture to be inferred while
constructing kernel configuration, and introduce `base.conf` which
builds 64-bit kernel and with KVM built-in to kernel.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-13 13:43:29 +08:00
Steve Horsman
cb682ef3c8
Merge pull request from RuoqingHe/enable-docker-on-riscv
kata-deploy: Use docker.io for all architectures
2025-03-07 11:14:19 +00:00
Ruoqing He
3a8131349e kata-deploy: Use docker.io for all archietcutres
Switch to `docker.io` provided by Ubuntu sources. It is not necessary
for us to install docker through `get-docker.sh`.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-07 02:22:31 +08:00
stevenhorsman
a40d5d3daa ci: Add arm64 K8s tests as required
This is based on the request from @fidencio, who
is one of the maintainers
2025-03-06 14:39:04 +00:00
stevenhorsman
f45b398170 ci: Add coco required tests
Add the zvsi and nontee coco tests to the required jobs list

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-03-06 14:38:52 +00:00
Hyounggyu Choi
bf41618a84
Merge pull request from BbolroC/enable-ibm-se-for-qemu-runtime-rs
runtime-rs: Enable IBM SE for QEMU
2025-03-06 05:38:13 +01:00
Hyounggyu Choi
4ea7d274c4 runtime-rs: Add new runtimeClass qemu-se-runtime-rs
When `KATA_HYPERVISOR` is set to `qemu-se-runtime-rs`,
a configuration file is properly referenced and a runtime class
should be created via kata-deploy.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2025-03-05 13:50:38 +01:00
stevenhorsman
e33ad56cf4 kernel: bump kata_config_version
Bump kernel version as the build-kernel script
was updated (even if there was no functional change).

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-03-04 09:39:10 +00:00
stevenhorsman
67bfd4793e shellcheck: Fix shellcheck SC2242
> Can only exit with status 0-255. Other data should be written to stdout/stderr.

Switch exit -1 to exit 1

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-03-04 09:39:01 +00:00
stevenhorsman
ed8347c868 shellcheck: Fix shellcheck SC2070
> -n doesn't work with unquoted arguments. Quote or use [[ ]]

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-03-04 09:35:46 +00:00
stevenhorsman
dbba6b056b shellcheck: Fix shellcheck SC2148
> Tips depend on target shell and yours is unknown. Add a shebang.

Add
```
#!/usr/bin/env bash
```

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-03-04 09:35:46 +00:00
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
stevenhorsman
58672068ff shellcheck: Fix shellcheck SC2145
> Argument mixes string and array. Use * or separate argument.

- Swap echos for printfs and improve formatting
- Replace $@ with $*
- Split arrays into separate arguments

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-03-04 09:35:46 +00:00
stevenhorsman
bc2d7d9e1e osbuilder: Skip shellcheck on test_images.sh
I'm not sure if we use test_images anywhere, so before
we invest the time to fix the 120 shellcheck errors and warnings
we should decide if we want to keep it. See 

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-03-04 09:35:46 +00:00
Zvonko Kaiser
eb2f75ee61 gpu: fix init symlinks
With the recent changes we need to make sure NVRC is symlinked
for init and sbin/init

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-03-03 17:21:59 +00:00
Zvonko Kaiser
3f13023f5f
Merge pull request from zvonkok/module-signing
gpu: add module signing
2025-03-01 09:51:24 -05:00
Zvonko Kaiser
d971e13446 gpu: Update rootfs.sh
Only source NV scripts if variant starts with "nvidia-gpu"

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-03-01 02:08:29 +00:00
Zvonko Kaiser
94579517d4 shellcheck: Update nvidia_rootfs.sh
With the new rules we need more updates.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-02-28 16:36:05 +00:00
Zvonko Kaiser
af1d6c2407 shecllcheck: Update nvidia_chroot.sh
Make shellcheck happy with the new rules new updates
needed

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-02-28 16:27:51 +00:00
Fabiano Fidêncio
c95f9885ea kata-deploy: k0s: Fix drop-in path
The drop-in path should be /etc/containerd (from the containers'
perspective), which mounts to the host path /etc/k0s/containerd.d.

With what we had we ended up dropping the file under the
/etc/k0s/containerd.d/containerd.d/, which is wrong.

This is a regression introduce by: 94b3348d3c

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-02-28 16:32:00 +01:00
Zvonko Kaiser
c4e4e14b32 kernel: bump kata_config_version
Mandatory update to have a unique kernel version name

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-02-28 15:18:15 +00:00
Stéphane Talbot
f2ba224e6c kata-deploy: Update kata-deploy to support microk8s
Change kata-deploy script and Helm chart in order to be able to use kata-deploy on a microk8s cluster deployed with snap.

Fixes: 

Signed-off-by: Stephane Talbot <Stephane.Talbot@univ-savoie.fr>
2025-02-28 10:10:29 +01:00
Zvonko Kaiser
4dadd07699 gpu: Update rootfs.sh
Pass-through KBUILD_SIGN_PIN to the rootfs build

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-02-28 01:31:35 +00:00
Zvonko Kaiser
5ab3192c51 gpu: Update nvidia_rootfs.sh
We need to handle KBUILD_SIGN_PIN so that the kbuild
can decrypte the signing key

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-02-28 01:31:35 +00:00
Zvonko Kaiser
493ba63c77 gpu: Provide KBUILD_SIGN_PIN to the build.sh
At the proper step pass-through the var KBUILD_SIGN_PIN
so that the kernel_headers step has the PIN for encrypting
the signing key.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-02-28 01:31:35 +00:00
Zvonko Kaiser
0309b70522 gpu: Pass-through KBUILD_SIGN_PIN
In kata-deploy-binaries.sh we need to pass-through the var
KBUILD_SIGN_PIN to the other static builder scripts.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-02-28 01:31:35 +00:00
Zvonko Kaiser
9602ba6ccc gpu: Add proper KBUILD_SIGN_PIN to entry script
Update kata-deploy-binaries-in-docker.sh to read the
env variable KBUILD_SIGN_PIN that either can be set via
GHA or other means.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-02-28 01:31:35 +00:00
Zvonko Kaiser
39d3b7fb90 gpu: Update NVIDIA chroot script
We need to place the signing key and cert at the right place
and hide the KBUILD_SIGN_PIN from echo'ing or xtrace

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-02-28 01:31:35 +00:00
Zvonko Kaiser
d815fb6f46 gpu: Update kernel-headers
Use the kernel-headers as the extra_tarball to move the encrypted key
and cert from stage to stage

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-02-28 01:31:35 +00:00
Zvonko Kaiser
c2cb89532b gpu: Add the proper handling in build-kernel.sh
If KBUILD_SIGN_PIN is provided we can encrypt the signing key
for out-of-tree builds and second round jobs in GHA

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-02-28 01:31:35 +00:00
Zvonko Kaiser
bc8360e8a9 gpu: Add proper config for module signing
We want to enable module signing in Kata and Coco

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-02-28 01:31:34 +00:00
Ryan Savino
a00a7c500a build: initrd rootfs init symlink directly to systemd when no AGENT_INIT
In some cases, /init is not following two levels of symlinks
i.e. /init to /sbin/init to /lib/systemd/systemd
Setting /init directly to /lib/systemd/systemd when AGENT_INIT is not mandated

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2025-02-26 14:23:56 -06:00
Fabiano Fidêncio
a7d33cc0cb build: Ensure MEASURED_ROOTFS is only used for images
We never ever tested MEASURED_ROOTFS with initrd, and I sincerely do not
know why we've been setting that to "yes" in the initrd cases.

Let's drop it, as it may be causing issues with the jobs that rely on
the rootfs-initrd-confidential.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-02-21 15:32:20 -06:00
Dan Mihai
b90c537f79
Merge pull request from mythi/build-fixes
minor build fixes
2025-02-21 09:54:55 -08:00
Hyounggyu Choi
1a9dabd433 shim-v2: Remove MEASURED_ROOTFS assignment for s390x
As a follow-up for , we do not need to set MEASURED_ROOTFS to no
on s390x explicitly. The GHA workflow already exports this variable.
This commit removes the redundant assignment.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2025-02-20 10:43:36 +01:00
Zvonko Kaiser
f0eef73a89 gpu: Add no_patches.txt for TDX flavour
As alwasy if we do not have any patches create the no_patches.txt
for the specific tag gpu_tdx_...

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-02-19 14:59:04 +00:00
Zvonko Kaiser
0d786577c6
Merge pull request from zvonkok/qemu-snp-tdx-experimental
gpu: QEMU SNP+TDX experimental updates
2025-02-19 08:26:37 -05:00
Mikko Ylinen
926119040c packaging: make install_oras.sh to run curl without sudo
sudo hides the environment variables that are sometimes
useful with the builds (for example: proxy settings).

While install_oras.sh could run completely without sudo in
the container it's COPY'd to, make minimal changes to it
to keep it functional outside the container too while still
addressing the problem of 'sudo curl' not working with proxy
env variables.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2025-02-19 09:34:13 +02:00
Hyounggyu Choi
4646058c0c example: Use multi-arch image for test-deploy-kata-qemu.yaml
An image `registry.k8s.io/hpa-example` only supports amd64.
Let's use a multi-arch image `quay.io/prometheus/prometheus`
for the QEMU example instead.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2025-02-18 14:23:09 +01:00
Anastassios Nanos
c7347cb76d release: Bump version to 3.14.0
Bump VERSION and helm-chart versions

Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
2025-02-17 16:47:24 +00:00
Fabiano Fidêncio
1381cab6f0 build: Fix rootfs cache logic
We've been appending to the wrong variable for quite some time, it
seems, leading to not actually regenerating the rootfs when needed.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-02-17 13:55:36 +01:00
Simon Kaegi
f5edbfd696 kernel: support loop device in v6.8+ kernels
Set CONFIG_BLK_DEV_WRITE_MOUNTED=y to restore previous kernel behaviour.

Kernel v6.8+ will by default block buffer writes to block devices mounted by filesystems.
This unfortunately is what we need to use mounted loop devices needed by some teams
to build OSIs and as an overlay backing store.

More info on this config item [here](https://cateee.net/lkddb/web-lkddb/BLK_DEV_WRITE_MOUNTED.html)

Fixes: 

Signed-off-by: Simon Kaegi <simon.kaegi@gmail.com>
2025-02-17 13:47:35 +01:00
Anastassios Nanos
b13db29aaa packaging(release): Properly handle version tag for the release bundle
The tags created automatically for published Github releases
are probably not annotated, so by simply running `git describe` we are
not getting the correct tag. Use a `git describe --tags` to allow git
to look at all tags, not just annotated ones.

Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
2025-02-14 12:41:08 +00:00
Zvonko Kaiser
2d8531cd20 gpu: Add TDX experimental target for GPUs
We have custom branches on coco/qemu to support GPUs
in TDX and SNP add experimental target.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-02-11 17:32:31 +00:00
Zvonko Kaiser
e4679055c6 gpu: qemu-snp-experimental no patches
The branch has all the needed cherry-picks

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-02-11 17:32:31 +00:00
Fabiano Fidêncio
75ac09baba packaging: Move builds to Ubuntu 22.04
As Ubuntu 20.04 will reach its EOL in April.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-02-10 21:25:43 +01:00
Zvonko Kaiser
62a975603e
Merge pull request from stevenhorsman/rust-1.80.0-bump
Rust 1.80.0 bump
2025-02-06 14:49:23 -05:00
Hyounggyu Choi
48c5b1fb55
Merge pull request from BbolroC/make-measured-rootfs-configurable
local-build: Do not build measured rootfs on s390x
2025-02-06 16:07:15 +01:00
Hyounggyu Choi
27ce3eef12 local-build: Do not use measured rootfs on s390x
IBM SE ensures to make initrd measured by genprotimg and verified by ultravisor.
Let's not build the measured rootf on s390x.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2025-02-06 10:12:55 +01: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
stevenhorsman
4c006c707a build: Fix powerpc64le target_arch
Starting with version 1.80, the Rust linter does not accept an invalid
value for `target_arch` in configuration checks:

```
   Compiling kata-sys-util v0.1.0 (/home/ddd/Work/kata/kata-containers/src/libs/kata-sys-util)
error: unexpected `cfg` condition value: `powerpc64le`

  --> /home/ddd/Work/kata/kata-containers/src/libs/kata-sys-util/src/protection.rs:17:34
   |
17 | #[cfg(any(target_arch = "s390x", target_arch = "powerpc64le"))]
   |                                  ^^^^^^^^^^^^^^-------------
   |                                                |
   |                                                help: there is a expected value with a similar name: `"powerpc64"`
   |
   = note: expected values for `target_arch` are: `aarch64`, `arm`, `arm64ec`, `avr`, `bpf`, `csky`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips32r6`, `mips64`, `mips64r6`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, and `x86_64`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: `-D unexpected-cfgs` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(unexpected_cfgs)]`
```

According [to GitHub user @Urgau][explain], this is a new warning
introduced in Rust 1.80, but the problem exists before. The correct
architecture name should be `powerpc64`, and the differentiation
between `powerpc64le` and `powerpc64` should use the `target_endian =
"little"` check.

[explain]:  (comment)

Fixes: 

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
[emlima: fix some more occurences and typos]
Signed-off-by: Emanuel Lima <emlima@redhat.com>
[stevenhorsman: fix some more occurences and typos]
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-02-05 14:20:47 +00:00
Zvonko Kaiser
eeacd8fd74 gpu: Adapt rootfs build for multi-arch
Add aarch64 and x86_64 handling. Especially build the Rust
dependency with the correct rust musl target.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-02-04 16:44:21 +00:00
Zvonko Kaiser
122ad95da6
Merge pull request from ryansavino/snp-upstream-host-kernel-support
snp: update kata to use latest upstream packages for snp
2025-02-03 11:20:59 -05:00
stevenhorsman
1cf1a332a5 packaging: virtiofsd: Allow building a specific commit
 added support for building a specific commit,
but due to the clone only having `--depth=1`, we can only
reset to a commit if it's the latest on the `main` branch,
otherwise we will get:
```
+ git clone --depth 1 --branch main https://gitlab.com/virtio-fs/virtiofsd virtiofsd
Cloning into 'virtiofsd'...
warning: redirecting to https://gitlab.com/virtio-fs/virtiofsd.git/
+ pushd virtiofsd
+ git reset --hard cecc61bca981ab42aae6ec490dfd59965e79025e
...
fatal: Could not parse object 'cecc61bca981ab42aae6ec490dfd59965e79025e'.
```

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-01-31 11:24:23 +00:00
Ryan Savino
af235fc576 Revert "builds: ovmf: Workaround Zeex repo becoming private"
This reverts commit aff3d98ddd.
2025-01-28 18:09:40 -06:00
Fabiano Fidêncio
5e00a24145
Merge pull request from zvonkok/pass-through-stack
gpu: Add driver version selection
2025-01-28 16:24:16 +01:00
Zvonko Kaiser
9f2799ba4f
Merge pull request from JakubLedworowski/add-xattr-to-confidential-kernel
kernel: Add CONFIG_TMPFS_XATTR to tdx.conf
2025-01-27 13:47:08 -05:00
Zvonko Kaiser
d2528ef84f gpu: Initialize unbound variables rootfs.sh
Since we're importing some build script for nvidia and we're
setting set -u we have some unbound variables in rootfs.sh
add initialization for those.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-01-27 18:37:21 +00:00
Zvonko Kaiser
cd7001612a gpu: rootfs adjust for AGENT_INIT=no
Since we're defaulting to AGENT_INIT=no for all the initrd/images
adapt the NV build to properly get kata-agent installed.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-01-27 17:56:21 +00:00
Zvonko Kaiser
10974b7bec gpu: AGENT_INIT=no
We're setting globally for each initrd and image AGENT_INIT=no

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-01-27 17:56:21 +00:00
Zvonko Kaiser
98e0dc1676 gpu: Add set -u to scripts
Make the scripts more robust by failing on unset varaibles

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-01-27 17:56:21 +00:00
Zvonko Kaiser
f153229865 gpu: Add driver version selection
Besides latest and lts options add an option to specify
the exact driver version.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-01-27 17:56:21 +00:00
Fabiano Fidêncio
84b0ca1b18 versions: Bump Ubuntu rootfs / initrd versions
While I wish we could be bumping to the very same version everywhere,
it's not possible and it's been quite a ride to get a combination of
things that work.

Let me try to describe my approach here:
* Do *NOT* stay on 20.04
  * This version will be EOL'ed by April
  * This version has a very old version of systemd that causes a bug
    when trying to online the cpusets for guests using systemd as
    init, causing then a breakage on the qemu-coco-non-tee and TDX
    non-attestation set of tests

* Bump to 22.04 when possible
  * This was possible for the majority of the cases, but for the
    confidential initrd & confidential images for x86_64, the reason
    being failures on AMD SEV CI (which I didn't debug), and a kernel
    panic on the CentOS 9 Stream TDX machine
  * 22.04 is being used instead of 24.04 as multistrap is simply broken
    on Ubuntu 24.04, and I'd prefer to stay on an LTS release whenever
    it's possible

* Bump to 24.10 for x86_64 image confidential
  * This was done as we got everything working with 24.10 in the CI.
  * This requires using libtdx-attest from noble (Ubuntu 24.04), as
    Intel only releases their sgx stuff for LTS releases.

* Stick to 20.04 for x86_64 initrd confidential
  * 24.10 caused a panic on their CI
  * This is only being used by AMD so far, so they can decide when to
    bump, after doing the proper testing & debug that the bump will work
    as expected for them

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-01-27 15:08:20 +01:00
Carlos Segarra
b6e0effc06 tdx: bump version of libtdx-attest in rootfs-builder
Bump libtdx-attest to its 1.22 release.

Signed-off-by: Carlos Segarra <carlos@carlossegarra.com>
2025-01-27 15:08:20 +01:00
Fabiano Fidêncio
2b5dbfacb8 osbuilder: ubuntu: Try to install pyinstaller using --break-system-packages
We first try without passing the `--break-system-packages` argument, as
that's not supported on Ubuntu 22.04 or older, but that's required on
Ubuntu 24.04 or newer.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-01-27 15:08:20 +01:00
Fabiano Fidêncio
c54f78bc6b local-build: cache: Consider os name & version for image/initrd
Otherwise a bump in the os name and / or os version would lead to the CI
using a cached artefact.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-01-27 15:08:20 +01:00
Fabiano Fidêncio
4a66acc6f5 osbuilder: ubuntu: Abort if multistrap fails (but not on 20.04)
We have gotten Ubuntu 20.04 working pretty much "by luck", as multistrap
fails the deployment, and then a hacky function was introduced to add
the proper dbus links.  However, this does not scale at all, and we
should:
* Fail if multistrap fails
  * I won't do this for Ubuntu 20.04 as it's working for now and soon
    enough it'll be EOL
* Add better logging to ensure someone can know when multistrap fails

Below you can find the failure that we're hitting on Ubuntu 20.04:
```sh
Errors were encountered while processing:
 dbus
ERR: dpkg configure reported an error.
Native mode configuration reported an error!
I: Tidying up apt cache and list data.

Multistrap system reported 1 error in /rootfs/.
I: Tidying up apt cache and list data.
```

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-01-27 15:08:16 +01:00
Fabiano Fidêncio
585f82f730 osbuilder: ubuntu: Ensure OS_VERSION is passed & used
Right now we're hitting an interesting situation with osbuilder, where
regardless of what's being passed Ubuntu 20.04 (focal) is being used
when building the rootfs-image, as shown in the snippets of the logs
below:
```
ffidenci@tatu:~/src/upstream/kata-containers/kata-containers$ make rootfs-image-confidential-tarball
/home/ffidenci/src/upstream/kata-containers/kata-containers/tools/packaging/kata-deploy/local-build//kata-deploy-copy-libseccomp-installer.sh "agent"
make agent-tarball-build
...
make pause-image-tarball-build
...
make coco-guest-components-tarball-build
...
make kernel-confidential-tarball-build
...
make rootfs-image-confidential-tarball-build
make[1]: Entering directory '/home/ffidenci/src/upstream/kata-containers/kata-containers'
/home/ffidenci/src/upstream/kata-containers/kata-containers/tools/packaging/kata-deploy/local-build//kata-deploy-binaries-in-docker.sh  --build=rootfs-image-confidential
sha256:f16c57890b0e85f6e1bbe1957926822495063bc6082a83e6ab7f7f13cabeeb93
Build kata version 3.13.0: rootfs-image-confidential
INFO: DESTDIR /home/ffidenci/src/upstream/kata-containers/kata-containers/tools/packaging/kata-deploy/local-build/build/rootfs-image-confidential/destdir
INFO: Create image
build image
~/src/upstream/kata-containers/kata-containers/tools/osbuilder ~/src/upstream/kata-containers/kata-containers/tools/packaging/kata-deploy/local-build/build/rootfs-image-confidential/builddir
INFO: Build image
INFO: image os: ubuntu
INFO: image os version: latest
Creating rootfs for ubuntu
/home/ffidenci/src/upstream/kata-containers/kata-containers/tools/osbuilder/rootfs-builder/rootfs.sh -o 3.13.0-13f0807e9f5687d8e5e9a0f4a0a8bb57ca50d00c-dirty -r /home/ffidenci/src/upstream/kata-containers/kata-containers/tools/packaging/kata-deploy/local-build/build/rootfs-image-confidential/builddir/rootfs-image/ubuntu_rootfs ubuntu
INFO: rootfs_lib.sh file found. Loading content
~/src/upstream/kata-containers/kata-containers/tools/osbuilder/rootfs-builder/ubuntu ~/src/upstream/kata-containers/kata-containers/tools/osbuilder
~/src/upstream/kata-containers/kata-containers/tools/osbuilder

INFO: rootfs_lib.sh file found. Loading content
INFO: build directly

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [128 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [128 kB]
Get:4 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [4276 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease [128 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [11.3 MB]
Get:7 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [1297 kB]
Get:8 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [30.9 kB]
Get:9 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [4187 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal/restricted amd64 Packages [33.4 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages [1275 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [177 kB]
Get:13 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [4663 kB]
Get:14 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1589 kB]
Get:15 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [34.6 kB]
Get:16 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [4463 kB]
Get:17 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 Packages [55.2 kB]
Get:18 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [28.6 kB]
Fetched 34.1 MB in 5s (6284 kB/s)
...
```

The reason this is happening is due to a few issues in different places:
1. IMG_OS_VERSION, passed to osbuilder, is not used anywhere and
   OS_VERSION should be used instead. And we should break if OS_VERSION
   is not properly passed down
2. Using UBUNTU_CODENAME is simply wrong, as it'll use whatever comes as
   the base container from kata-deploy's local-build scripts, and it has
   just been working by luck

Note that at the same time this commit fixes the wrong behaviour, it
would break the rootfses build as they are, this we need to set the
versions.yaml to use 20.04 were it was already using 20.04 even without
us knowing.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-01-27 14:19:42 +01:00
Jakub Ledworowski
42531cf6c4 kernel: Add CONFIG_TMPFS_XATTR to confidential kernel
During pull inside the guest, overlayfs expects xattrs.

Fixes: [guest-components#876](https://github.com/confidential-containers/guest-components/issues/876)

Signed-off-by: Jakub Ledworowski <jakub.ledworowski@intel.com>
2025-01-27 07:07:54 +01:00
Steve Horsman
54e7e1fdc3
Merge pull request from kata-containers/dependabot/go_modules/src/runtime/go_modules-28d0d344dd
build(deps): bump the go_modules group across 3 directories with 1 update
2025-01-24 12:04:56 +00:00
Alex Lyn
ee635293c6
Merge pull request from RuoqingHe/virtiofsd-riscv64
virtiofsd: Enable build for RISC-V
2025-01-24 15:43:56 +08:00
Zvonko Kaiser
f5c509d58e
Merge pull request from kata-containers/topic/arm64-static-build-runner
workflows: Move arm static checks runner
2025-01-23 22:29:16 -05:00
Fabiano Fidêncio
4bc978416c
Merge pull request from fidencio/topic/test-cgroupsv2-on-guest
kernel: Ensure no cgroupsv1 is used
2025-01-23 21:26:49 +01:00
Aurélien Bombo
66d292bdb4
Merge pull request from microsoft/danmihai/minor-systemd-cleanup
rootfs: minor systemd file deletion cleanup
2025-01-23 11:29:25 -06:00
Fabiano Fidêncio
c653719270 kernel: Ensure no cgroupsv1 is used
Let's ensure that we're fully running the guest on cgroupsv2.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-01-23 17:25:56 +01:00
Fabiano Fidêncio
66d881a5da
Merge pull request from fidencio/topic/ensure-systemd-is-used-as-init-for-coco-cases
rootfs-confidential: Ensure systemd is used as init
2025-01-23 15:25:24 +01:00
stevenhorsman
3acce82c91 ci: Update gatekeeper tests for static workflow
The static-checks targets are `pull_request`, so
they can run the PR workflow version, so we want to
update the required-tests.yaml so that static-check
workflow changes do trigger static checks in order
to test them properly.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-01-23 14:23:09 +00:00
Fabiano Fidêncio
d5f907dcf1 rootfs-confidential: Ensure systemd is used as init
Let's make sure that we don't use Kata Containers' agent as init for the
Confidential related rootfses*, as we don't want to increase the agent's
complexity for no reason ... mainly when we can rely on a proper init
system.

*:
- images already used systemd as init
- initrds are now using systemd as init

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-01-23 12:04:13 +01:00
dependabot[bot]
d2cb14cdbc
build(deps): bump the go_modules group across 3 directories with 1 update
Bumps the go_modules group with 1 update in the /src/runtime directory: [golang.org/x/net](https://github.com/golang/net).
Bumps the go_modules group with 1 update in the /src/tools/csi-kata-directvolume directory: [golang.org/x/net](https://github.com/golang/net).
Bumps the go_modules group with 1 update in the /tools/testing/kata-webhook directory: [golang.org/x/net](https://github.com/golang/net).


Updates `golang.org/x/net` from 0.25.0 to 0.33.0
- [Commits](https://github.com/golang/net/compare/v0.25.0...v0.33.0)

Updates `golang.org/x/net` from 0.23.0 to 0.33.0
- [Commits](https://github.com/golang/net/compare/v0.25.0...v0.33.0)

Updates `golang.org/x/net` from 0.23.0 to 0.33.0
- [Commits](https://github.com/golang/net/compare/v0.25.0...v0.33.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-type: indirect
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-23 10:18:22 +00:00
Zvonko Kaiser
91c6d524f8 gpu: Fix arm64 kernel build
CONFIG_IOASID (not configurable) in newer kernels.
Removing it.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-01-22 18:15:57 +00:00
Fabiano Fidêncio
e71bc1f068
Merge pull request from zvonkok/gpu_kernel_dep
gpu: Add kernel dep for the non coco use-case
2025-01-22 12:53:39 +01:00
Greg Kurz
17d053f4bb
Merge pull request from teawater/balloon
Add reclaim_guest_freed_memory config to qemu and cloud-hypervisor
2025-01-22 10:57:13 +01:00
Aurélien Bombo
4e9d1363b3
Merge pull request from sprt/sprt/ci-gh-pr-number-coco
ci: Unify on `$GH_PR_NUMBER` environment variable
2025-01-21 15:07:24 -06:00
Zvonko Kaiser
4621f53e4a gpu: Add kernel dep for the non coco use-case
Add the kernel dependency to the non coco use-case
so that a rootfs build can be executed via GHA.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-01-21 16:18:14 +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: 
Fixes: 

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-01-21 18:05:37 +08:00
Hui Zhu
42f5ef9ff1 kernel: config: Add CONFIG_VIRTIO_BALLOON to virtio.conf
Add CONFIG_VIRTIO_BALLOON to virtio.conf to open virtio-balloon.

Fixes: 

Signed-off-by: Hui Zhu <teawater@antgroup.com>
2025-01-21 10:34:04 +08:00
Zvonko Kaiser
d7059e9024
Merge pull request from zvonkok/gpu-rootfs-fix
gpu: Fix rootfs build
2025-01-17 14:44:41 -05:00
Aurélien Bombo
0d70dc31c1 ci: Unify on $GH_PR_NUMBER environment variable
While working on , I realized that some parts of the codebase use
$GH_PR_NUMBER, while other parts use $PR_NUMBER.

Notably, in that PR, since I used $GH_PR_NUMBER for CoCo non-TEE tests
without realizing that TEE tests use $PR_NUMBER, the tests on that PR
fail on TEEs:

https://github.com/kata-containers/kata-containers/actions/runs/12818127344/job/35744760351?pr=10559#step:10:45

  ...
  44      error: error parsing STDIN: error converting YAML to JSON: yaml: line 90: mapping values are not allowed in this context
  ...
  135               image: ghcr.io/kata-containers/csi-kata-directvolume:
  ...

So let's unify on $GH_PR_NUMBER so that this issue doesn't repro in the
future: I replaced all instances of PR_NUMBER with GH_PR_NUMBER.

Note that since some test scripts also refer to that variable, the CI
for this PR will fail (would have also happened with the converse
substitution), hence I'm not adding the ok-to-test label and we should
force-merge this after review.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2025-01-17 10:53:08 -06:00
Fabiano Fidêncio
c018a1cc61
Merge pull request from RuoqingHe/update-virtiofsd-build-image
virtiofsd: Update ubuntu to 22.04 for gnu target
2025-01-16 20:51:10 +01:00
Ruoqing He
c70195d629 virtiofsd: Update ubuntu to 22.04 for gnu target
With ubuntu 20.04 image, virtiofsd gnu target couldn't be built due to
"unsupported ISA subset z" reported by "cc".

Updating to ubuntu 22.04 image addresses this problem.

Relates: 

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-01-16 17:27:38 +08:00
Zvonko Kaiser
f0bd83b073 gpu: Fix rootfs build
The pyinstaller is located per default under /usr/local/bin
some prior versions were installing it to ${HOME}.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-01-15 20:37:51 +00:00
Zvonko Kaiser
0b04f43ac6 release: Bump version to 3.13.0
Bump VERSION and helm-chart versions

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-01-15 16:13:22 +00:00
Fabiano Fidêncio
121ac0c5c0
Merge pull request from microsoft/danmihai1/mariner3-guest
image: bump mariner guest version to 3.0
2025-01-14 19:06:28 +01:00