Commit Graph

492 Commits

Author SHA1 Message Date
Zvonko Kaiser
0d786577c6
Merge pull request #10867 from zvonkok/qemu-snp-tdx-experimental
gpu: QEMU SNP+TDX experimental updates
2025-02-19 08:26:37 -05: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
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
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
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
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
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
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
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
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
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
Zvonko Kaiser
28b57627bd release: Bump version to 3.12.0
Bump VERSION and helm-chart versions

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-12-16 18:41:51 +00:00
Fabiano Fidêncio
111082db07
kata-deploy: Add support to multi-installation
This is super useful for development / debugging scenarios, mainly when
dealing with limited hardware availability, as this change allows
multiple people to develop into one single machine, while still using
kata-deploy.

Fixes: #10546

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-12-05 17:42:53 +01:00
Fabiano Fidêncio
0033a0c23a
kata-deploy: Adjust paths for qemu-coco-dev as well
I missed that when working on the INSTALL_PREFIX feature, so adding it
now.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-12-05 17:42:53 +01:00
Fabiano Fidêncio
62b3a07e2f
kata-deploy: helm: Add overlooked INSTALLATION_PREFIX env var
At the same time that INSTALLATION_PREFIX was added, I was working on
the helm changes to properly do the cleanup / deletion when it's
removed.  However, I missed adding the INSTALLATION_PREFIX env var
there. which I'm doing now.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-12-05 17:42:53 +01:00
Aurélien Bombo
fb87bf221f ci: Implement build step for CSI driver
This fully implements the compilation step for csi-kata-directvolume.
This component can now be built by the CI running:

 $ cd tools/packaging/kata-deploy/local-build
 $ make csi-kata-directvolume-tarball

A couple notes:

 * When installing the binary, we rename it from directvolplugin to
   csi-kata-directvolume on the fly to make it more readable.
 * We add go to the tools builder Dockerfile to support building this
   tool.
 * I've noticed the file install_libseccomp.sh gets created by the build
   process so I've added it to a .gitignore.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2024-12-03 14:43:36 -06:00
Zvonko Kaiser
20442c0eae ci: Fix variant for confidential targets
The default initrd confidential target will have a
variant=confidential we need to accomodate this
and make sure we also accomodate aaa-xxx-confidential targets.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-12-02 14:21:03 +00:00
Fabiano Fidêncio
ca2098f828
build: Allow dummy builds (for when adding a new target)
This will help us to simply allow a new dummy build whenever a new
component is added.

As long as the format `$(call DUMMY,$@)` is followed, we should be good
to go without taking the risk of breaking the CI.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-11-28 11:13:24 +01:00
Aurélien Bombo
16a91fccbe
Merge pull request #10561 from sprt/csi-driver-ci
coco: ci: Lay groundwork for compiling and publishing CSI driver image [1/x]
2024-11-27 10:26:45 -06:00
Fabiano Fidêncio
500508a592 kata-deploy: Use drop-in files whenever it's possible
This will make our lives considerably easier when it comes to cleaning
up content added, while it's also a groundwork needed for having
multiple installations running in parallel.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-11-27 12:27:08 +01:00
Fabiano Fidêncio
6f70ab9169 kata-deploy: Adapt how the containerd version is checked for k0s
Let's actually mount the whole /etc/k0s as /etc/containerd, so we can
easily access the containerd configuration file which has the version in
it, allowing us to parse it instead of just making a guess based on
kubernetes distro being used.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-11-26 16:15:11 +01:00
Fabiano Fidêncio
f5a9aaa100 kata-deploy: Support containerd config version 3
On Ubuntu 24.04, with the distro default containerd, we're already
getting:
```
$ containerd config default | grep "version = "
version = 3
```

With that in mind, let's make sure that we're ready to support this from
the next release.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-11-26 14:01:50 +01:00
Aurélien Bombo
e43c59a2c6 ci: Add no-op step to compile CSI driver
This adds a no-op build step to compile the CSI driver. The actual compilation
will be implemented in an ulterior PR, so as to ensure we don't break the CI.

Addresses: #10560

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2024-11-21 16:06:55 -06:00
Zvonko Kaiser
0debf77770 gpu: NVIDIA gpu initrd/image build
With each release make sure we ship a GPU enabled rootfs/initrd

Fixes: #6554

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-11-21 18:57:23 +00:00
stevenhorsman
7a8ba14959 release: Bump version to 3.11.0
Bump `VERSION` and helm-chart versions

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-11-18 11:13:15 +00:00
Fabiano Fidêncio
a52ea32b05 build: kernel: Learn how to deal with release candidates
So far we were not prepared to deal with release candidates as those:
* Do not have a sha256sum in the sha256sums provided by the kernel cdn
* Come from a different URL (directly from Linus)
* Have a different suffix (.tar.gz, instead of .tar.xz)

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-11-05 12:26:02 +01:00
Fabiano Fidêncio
9f2d4b2956 build: kernel: Always pass the url to the builder
This doesn't change much on how we're doing things Today, but it
simplifies a lot cases that may be added later on (and will be) like
building -rc kernels.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-11-05 12:26:02 +01:00
Fabiano Fidêncio
cc4006297a build: kernel: Pass the yaml base path instead of the version path
By doing this we can ensure this can be re-used, if needed (and it'll be
needed), for also getting the URL.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-11-05 12:26:02 +01:00
Fabiano Fidêncio
7057ff1cd5 build: kernel: Always pass -f to the kernel builder
-f forces the (re)generaton of the config when doing the setup, which
helps a lot on local development whilst not causing any harm in the CI
builds.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-11-05 12:26:02 +01:00
Sumedh Alok Sharma
4b7aba5c57 agent-ctl: Add support to test kata-agent's container creation APIs.
This commit introduces changes to enable testing kata-agent's container
APIs of CreateContainer/StartContainer/RemoveContainer. The changeset
include:
- using confidential-containers image-rs crate to pull/unpack/mount a
container image. Currently supports only un-authenicated registry pull
- re-factor api handlers to reduce cmdline complexity and handle
request generation logic in tool
- introduce an OCI config template for container creation
- add test case

Fixes #9707

Signed-off-by: Sumedh Alok Sharma <sumsharma@microsoft.com>
2024-11-01 22:18:54 +05:30
Sumedh Alok Sharma
0adf7a66c3 ci: Use ubuntu for static building of kata tools.
This commit introduces changes to use ubuntu for statically
building kata tools. In the existing CI setup, the tools
currently build only for x86_64 architecture.

It also fixes the build error seen for agent-ctl PR#10395.

Fixes #10441

Signed-off-by: Sumedh Alok Sharma <sumsharma@microsoft.com>
2024-10-31 13:19:18 +05:30
Fabiano Fidêncio
f19c8cbd02
build: cache: Ensure shim-v2-root_hash.txt is in "${workdir}"
All the oras push logic happens from inside `${workdir}`, while the
root_hash.txt extraction and renaming was not taking this into
consideration.

This was not caught during the manually triggered runs as those do not
perform the oras push.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-10-28 15:17:16 +01:00
Fabiano Fidêncio
d537932e66
build: shim-v2: Ensure MEASURED_ROOTFS is exported
The approach taken for now is to export MEASURED_ROOTFS=yes on the
workflow files for the architectures using confidential stuff, and leave
the "normal" build without having it set (to avoid any change of
expectation on the current bevahiour).

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-10-28 12:43:53 +01:00
Fabiano Fidêncio
9c8b20b2bf
build: shim-v2: Rebuild if root_hashes do not match
Let's make sure we take the root_hashes into consideration to decide
whether the shim-v2 should or should not be used from the cached
artefacts.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-10-28 12:43:53 +01:00
Fabiano Fidêncio
9c84998de9
build: cache: Cache root_hash.txt used by the shim-v2
Let's cache the root_hash.txt from the confidential image so we can use
them later on to decide whether there was a rootfs change that would
require shim-v2 to be rebuilt.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-10-28 12:43:53 +01:00
Fabiano Fidêncio
d2d9792720
build: Don't leave cached component behind if it can't be used
Let's ensure we remove the component and any extra tarball provided by
ORAS in case the cached component cannot be used.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-10-28 12:43:53 +01:00
stevenhorsman
b22d4429fb release: Bump version to 3.10.1
Fix release to pick up #10463

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-10-25 17:16:09 +01:00
Greg Kurz
3037303e09 release: Bump VERSION to 3.10.0
Let's start the 3.10.0 release.

Signed-off-by: Greg Kurz <groug@kaod.org>
2024-10-22 11:28:15 +02:00
Magnus Kulke
9a33a3413b
Merge pull request #10433 from mkulke/mkulke/add-provenance-attestation-for-agent-builds
ci: add provenance attestation for agent artifact
2024-10-18 15:00:18 +02:00
Magnus Kulke
b93f5390ce ci: add provenance attestation for agent artifact
This adds provenance attestation logic for agent binaries that are
published to an oci registry via ORAS.

As a downstream consumer of the kata-agent binary the Peerpod project
needs to verify that the artifact has been built on kata's CI.

To create an attestation we need to know the exact digest of the oci
artifact, at the point when the artifact was pushed.

Therefore we record the full oci image as returned by oras push.

The pushing and tagging logic has been slightly reworked to make this
task less repetetive.

The oras cli accepts multiple tags separated by comma on pushes, so a
push can be performed atomically instead of iterating through tags and
pushing each individually. This removes the risk of partially successful
push operations (think: rate limits on the oci registry).

So far the provenance creation has been only enabled for agent builds on
amd64 and xs390x.

Signed-off-by: Magnus Kulke <magnuskulke@microsoft.com>
2024-10-18 10:24:00 +02:00
Dan Mihai
3622b5e8b4 ci: static_sandbox_resource_mgmt for cbl-mariner
Use the configuration used by AKS (static_sandbox_resource_mgmt=true)
for CI testing on Mariner hosts.

Hopefully pod startup will become more predictable on these hosts -
e.g., by avoiding the occasional hotplug timeouts described by #10413.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-10-10 22:17:39 +00:00
Fabiano Fidêncio
652ba30d4a
build: mariner: Remove the ability to build the marine initrd
As mariner has switched to using an image instead of an initrd, let's
just drop the abiliy to build the initrd and avoid keeping something in
the tree that won't be used.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-10-09 21:42:55 +02:00
Dan Mihai
63c1f81c23 local-build: add rootfs-image-mariner
Kata CI will start testing the new rootfs-image-mariner instead of the
older rootfs-initrd-mariner image.

The "official" AKS images are moving from a rootfs-initrd-mariner
format to the rootfs-image-mariner format. Making the same change in
Kata CI is useful to keep this testing in sync with the AKS settings.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-10-08 17:15:56 +00:00
Aurélien Bombo
78c63c7951 kata-deploy: clean up and fix docs for k0s
* Clarifies instructions for k0s.
* Adds kata-deploy step for each cluster type.
* Removes the old kata-deploy-stable step for vanilla k8s.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2024-09-20 11:59:40 -05:00
Emanuel Lima
a6ee15c5c7
release: Bump VERSION to 3.9.0
Starting the v3.9.0 release

Signed-off-by: Emanuel Lima <emlima@redhat.com>
2024-09-19 10:14:55 -03:00
stevenhorsman
1abeffdac6 kata-deploy: Switch Kubernetes URL
The payload build is failing with:
```
ERROR: failed to solve: process "/bin/sh -c apk --no-cache add bash curl &&
ARCH=$(uname -m) &&
if [ \"${ARCH}\" = \"x86_64\" ]; then ARCH=amd64; fi &&
if [ \"${ARCH}\" = \"aarch64\" ]; then ARCH=arm64; fi &&
DEBIAN_ARCH=${ARCH} &&
if [ \"${DEBIAN_ARCH}\" = \"ppc64le\" ]; then DEBIAN_ARCH=ppc64el; fi &&
curl -fL --progress-bar -o /usr/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/ \
$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${ARCH}/kubectl &&
chmod +x /usr/bin/kubectl &&
curl -fL --progress-bar -o /usr/bin/jq https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-${DEBIAN_ARCH} &&
chmod +x /usr/bin/jq &&
mkdir -p ${DESTINATION} &&
tar xvf ${WORKDIR}/${KATA_ARTIFACTS} -C ${DESTINATION} &&
rm -f ${WORKDIR}/${KATA_ARTIFACTS} &&
apk del curl &&
apk --no-cache add py3-pip &&
pip install --no-cache-dir yq==3.2.3" did not complete successfully: exit code: 22
```

Looking into this, the problem is that
https://storage.googleapis.com/kubernetes-release/release/v1.31.1/bin/linux/amd64/kubectl
doesn't exist. The [kubectl install doc](https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#install-kubectl-on-linux)
recommends the `dl.k8s.io` site, so let's switch to this.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-09-17 15:35:42 +01:00