Commit Graph

15288 Commits

Author SHA1 Message Date
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
ee1a17cffc build: kernel: Take kernel_url into consideration
Let's make sure the kernel_url is actually used whenever it's passed to
the function.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-11-05 12:26:02 +01:00
Fabiano Fidêncio
9a0b501042 build: kernel: Remove tee specific function
As, thankfully, we're relying on upstream kernels for TEEs.

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
Fabiano Fidêncio
910defc4cf
Merge pull request #10490 from fidencio/topic/fix-ovmf-build
builds: ovmf: Workaround Zeex repo becoming private
2024-11-05 12:25:00 +01:00
Fabiano Fidêncio
aff3d98ddd builds: ovmf: Workaround Zeex repo becoming private
Let's just do a simple `sed` and **not** use the repo that became
private.

This is not a backport of https://github.com/tianocore/edk2/pull/6402,
but it's a similar approach that allows us to proceed without the need
to pick up a newer version of edk2.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-11-05 11:25:54 +01:00
Dan Mihai
03bf4433d7
Merge pull request #10459 from stevenhorsman/update-bats
tests: k8s: Update bats
2024-11-04 12:26:58 -08:00
Aurélien Bombo
f639d3e87c
Merge pull request #10395 from Sumynwa/sumsharma/create_container
agent-ctl: Add support to test kata-agent's container creation APIs.
2024-11-04 14:09:12 -06:00
GabyCT
7f066be04e
Merge pull request #10485 from GabyCT/topic/fixghast
gha: Fix source for gha stability run script
2024-11-04 12:09:28 -06:00
Steve Horsman
a2b9527be3
Merge pull request #10481 from mkulke/mkulke/init-cdh-client-on-gcprocs-none
agent: perform attestation init w/o process launch
2024-11-04 17:27:45 +00:00
Gabriela Cervantes
fd4d0dd1ce gha: Fix source for gha stability run script
This PR fixes the source to avoid duplication specially in the common.sh
script and avoid failures saying that certain script is not in the directory.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-11-04 16:16:13 +00:00
Magnus Kulke
bf769851f8 agent: perform attestation init w/o process launch
This change is motivated by a problem in peerpod's podvms. In this setup
the lifecycle of guest components is managed by systemd. The current code
skips over init steps like setting the ocicrypt-rs env and initialization
of a CDH client in this case.

To address this the launch of the processes has been isolated into its
own fn.

Signed-off-by: Magnus Kulke <magnuskulke@microsoft.com>
2024-11-04 13:31:07 +01:00
Steve Horsman
4fd9df84e4
Merge pull request #10482 from GabyCT/topic/fixvirtdoc
docs: Update virtualization document
2024-11-04 11:51:09 +00:00
stevenhorsman
175ebfec7c Revert "k8s:kbs: Add trap statement to clean up tmp files"
This reverts commit 973b8a1d8f.

As @danmihai1 points out https://github.com/bats-core/bats-core/issues/364
states that using traps in bats is error prone, so this could be the cause
of the confidential test instability we've been seeing, like it was
in the static checks, so let's try and revert this.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-11-04 09:59:37 +00:00
stevenhorsman
75cb1f46b8 tests/k8s: Add skip is setup_common fails
At @danmihai1's suggestion add a die message in case
the call to setup_common fails, so we can see if in the test
output.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-11-04 09:59:33 +00:00
stevenhorsman
3f5bf9828b tests: k8s: Update bats
We've seen some issues with tests not being run in
some of the Coco CI jobs (Issue #10451) and in the
envrionments that are more stable we noticed that
they had a newer version of bats installed.

Try updating the version to 1.10+ and print out
the version for debug purposes

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-11-04 09:59:33 +00:00
Steve Horsman
06d2cc7239
Merge pull request #10453 from bpradipt/remote-annotation
runtime: Add GPU annotations for remote hypervisor
2024-11-04 09:10:06 +00:00
Zvonko Kaiser
3781526c94 gpu: Add VARIANT to the initrd and image build
We need to know if we're building a nvidia initrd or image
Additionally if we build a regular or confidential VARIANT

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-11-01 18:34:13 +00:00
Zvonko Kaiser
95b69c5732 build: initrd make it coherent to the image build
Add -f for moving the initrd to the correct file path

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-11-01 18:34:13 +00:00
Zvonko Kaiser
3c29c1707d image: Add suffix to image or initrd depending on the NVIDIA driver version
Fixes: #9478

We want to keep track of the driver versions build during initrd/image build so update the artifact_name after the fact.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-11-01 18:34:13 +00: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
Fabiano Fidêncio
2efcb442f4
Merge pull request #10442 from Sumynwa/sumsharma/tools_use_ubuntu_static_build
ci: Use ubuntu for static building of kata tools.
2024-11-01 16:04:31 +01:00
Gabriela Cervantes
1ca83f9d41 docs: Update virtualization document
This PR updates the virtualization document by removing a url link
which is not longer valid.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-10-31 17:28:02 +00:00
GabyCT
a3d594d526
Merge pull request #10480 from GabyCT/topic/fixstabilityrun
gha: Add missing steps in Kata stability workflow
2024-10-31 09:57:33 -06:00
Fabiano Fidêncio
e058b92350
Merge pull request #10425 from burgerdev/darwin
genpolicy: support darwin target
2024-10-31 12:16:44 +01:00
Markus Rudy
df5e6e65b5 protocols: only build RLimit impls on Linux
The current version of the oci-spec crate compiles RLimit structs only
for Linux and Solaris. Until this is fixed upstream, add compilation
conditions to the type converters for the affected structs.

Fixes: #10071

Signed-off-by: Markus Rudy <mr@edgeless.systems>
2024-10-31 09:50:36 +01:00
Markus Rudy
091a410b96 kata-sys-util: move json parsing to protocols crate
The parse_json_string function is specific to parsing capability strings
out of ttRPC proto definitions and does not benefit from being available
to other crates. Moving it into the protocols crate allows removing
kata-sys-util as a dependency, which in turn enables compiling the
library on darwin.

Fixes: #10071

Signed-off-by: Markus Rudy <mr@edgeless.systems>
2024-10-31 09:41:07 +01:00
Markus Rudy
8ab4bd2bfc kata-sys-util: remove obsolete cgroups dependency
The cgroups.rs source file was removed in
234d7bca04. With cgroups support handled
in runtime-rs, the cgroups dependency on kata-sys-util can be removed.

Signed-off-by: Markus Rudy <mr@edgeless.systems>
2024-10-31 09:41:07 +01:00
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
Gabriela Cervantes
c4089df9d2 gha: Add missing steps in Kata stability workflow
This PR adds missing steps in the gha run script for the kata stability
workflow.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-10-30 19:13:15 +00:00
Xuewei Niu
1a216fecdf
Merge pull request #10225 from Chasing1020/main
runtime-rs: Add basic boilerplate for remote hypervisor
2024-10-30 17:02:50 +08:00
Hyounggyu Choi
dca69296ae
Merge pull request #10476 from BbolroC/switch-to-kubeadm-s390x
gha: Switch KUBERNETES from k3s to kubeadm on s390x
2024-10-30 09:52:06 +01:00
GabyCT
9293931414
Merge pull request #10474 from GabyCT/topic/removeunvarb
packaging: Remove kernel config repo variable as it is unused
2024-10-29 12:52:07 -06:00
Gabriela Cervantes
69ee287e50 packaging: Remove kernel config repo variable as it is unused
This PR removes the kernel config repo variable at the build kernel
script as it is not used.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-10-29 17:09:52 +00:00
GabyCT
8539cd361a
Merge pull request #10462 from GabyCT/topic/increstress
tests: Increase time to run stressng k8s tests
2024-10-29 11:08:47 -06:00
Chasing1020
425f6ad4e6 runtime-rs: add oci spec for prepare_vm method
The cloud-api-adaptor needs to support different types of pod VM
instance.
We needs to pass some annotations like machine_type, default_vcpus and
default_memory to prepare the VMs.

Signed-off-by: Chasing1020 <643601464@qq.com>
2024-10-30 01:01:28 +08:00
Chasing1020
f1167645f3 runtime-rs: support for remote hypervisors type
This patch adds the support of the remote hypervisor type for runtime-rs.
The cloud-api-adaptor needs the annotations and network namespace path
to create the VMs.
The remote hypervisor opens a UNIX domain socket specified in the config
file, and sends ttrpc requests to a external process to control sandbox
VMs.

Fixes: #10350

Signed-off-by: Chasing1020 <643601464@qq.com>
2024-10-30 00:54:17 +08:00
Pradipta Banerjee
6f1ba007ed runtime: Add GPU annotations for remote hypervisor
Add GPU annotations for remote hypervisor to help
with the right instance selection based on number of GPUs
and model

Signed-off-by: Pradipta Banerjee <pradipta.banerjee@gmail.com>
2024-10-29 10:28:21 -04:00
Steve Horsman
68225b53ca
Merge pull request #10475 from stevenhorsman/revert-10452
Revert "tests: Add trap statement in kata doc script"
2024-10-29 13:58:00 +00:00
Hyounggyu Choi
aeef28eec2 gha: Switch to kubeadm for run-k8s-tests-on-zvsi
Last November, SUSE discontinued support for s390x, leaving k3s
on this platform stuck at k8s version 1.28, while upstream k8s
has since reached 1.31. Fortunately, kubeadm allows us to create
a 1.30 Kubernetes cluster on s390x.
This commit switches the KUBERNETES option from k3s to kubeadm
for s390x and removes a dedicated cluster creation step.
Now, cluster setup and teardown occur in ACTIONS_RUNNER_HOOK_JOB_{STARTED,COMPLETED}.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-10-29 14:27:32 +01:00
Hyounggyu Choi
238f67005f tests: Add kubeadm option for KUBERNETES in gha-run.sh
When creating a k8s cluster via kubeadm, the devmapper setup
for containerd requires a different configuration.
This commit introduces a new `kubeadm` option for the KUBERNETES
variable and adjusts the path to the containerd config file for
devmapper setup.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-10-29 14:19:42 +01:00
stevenhorsman
b1cffb4b09 Revert "tests: Add trap statement in kata doc script"
This reverts commit 093a6fd542.
as it is breaking the static checks

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-10-29 09:57:18 +00:00
Aurélien Bombo
eb04caaf8f
Merge pull request #10074 from koct9i/log-vm-start-error
runtime: log vm start error before cleanup
2024-10-28 14:39:00 -05:00
Fabiano Fidêncio
e675e233be
Merge pull request #10473 from fidencio/topic/build-cache-fix-shim-v2-root_hash.txt-location
build: cache: Ensure shim-v2-root_hash.txt is in "${workdir}"
2024-10-28 16:53:06 +01:00
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
Steve Horsman
51bc71b8d9
Merge pull request #10466 from kata-containers/topic/ensure-shim-v2-sets-the-measured-rootfs-parameters-to-the-config
re-enable measured rootfs build & tests
2024-10-28 13:11:50 +00:00
Fabiano Fidêncio
b70d7c1aac
tests: Enable measured rootfs tests for qemu-coco-dev
Then it's on pair with what's being tested with TEEs using a rootfs
image.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-10-28 12:43:54 +01:00
Fabiano Fidêncio
d23d057ac7
runtime: Enable measured rootfs for qemu-coco-dev
Let's make sure we are prepared to test this with non-TEE environments
as well.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-10-28 12:43:53 +01:00
Fabiano Fidêncio
7d202fc173
tests: Re-enable measured_rootfs test for TDX
As we're now building everything needed to test TDX with measured rootfs
support, let's bring this test back in (for TDX only, at least for now).

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-10-28 12:43:53 +01:00