Commit Graph

14950 Commits

Author SHA1 Message Date
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
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
Fabiano Fidêncio
ef29824db9
runtime: Don't do measured rootfs for "vanilla" kernel
We may decide to add this later on, but for now this is only targetting
TEEs and the confidential image / initrd.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-10-28 12:43:53 +01:00
Fabiano Fidêncio
a65946bcb0
workflows: build: Ensure rootfs is present for shim-v2 build
Let's ensure that we get the already built rootfs tarball from previous
steps of the action at the time we're building the shim-v2.

The reason we do that is because the rootfs binary tarballs has a
root_hash.txt file that contains the information needed the shim-v2
build scripts to add the measured rootfs arguments to the shim-v2
configuration files.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-10-28 12:43:53 +01:00
Fabiano Fidêncio
6ea0369878
workflows: build: Ensure rootfs is built before shim-v2
As the rootfs will have what we need to add as part of the shim-v2
configuration files for measured rootfs, we **must** ensure this is
built **before** shim-v2.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-10-28 12:43:53 +01:00
Fabiano Fidêncio
13ea082531
workflows: Build rootfs after its deps are built
By doing this we can just re-use the dependencies already built, saving
us a reasonable amount of time.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-10-28 12:43:53 +01:00
Fabiano Fidêncio
eb07a809ce
tests: Add a helper script to use prebuild components
This is a helper script that does basically what's already being done by
the s390x CI, which is:
* Move a folder with the components that we were stored / downloaded
  during the GHA execution to the expected `build` location
* Get rid of the dependencies for a specific asset, as the dependencies
  are already pulled in from previous GHA steps

For now this script is only being added but not yet executed anywhere,
and that will come as the next step in this series.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-10-28 12:43:52 +01:00
Fabiano Fidêncio
c2b18f9660
workflows: Store rootfs dependencies
So far we haven't been storing the rootfs dependencies as part of our
workflows, but we better do it to re-use them as part of the rootfs
build.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-10-28 12:43:52 +01:00
Steve Horsman
b5f503b0b5
Merge pull request #10471 from fidencio/topic/possibly-fix-release-workflow
workflows: Possibly fix the release workflow
2024-10-28 11:38:33 +00:00
Konstantin Khlebnikov
ee50582848 runtime: log vm start error before cleanup
Return of proper error to the initiator is not guaranteed.
Method StopVM could kill shim process together with VM pieces.

Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
2024-10-28 11:21:21 +01:00
Fabiano Fidêncio
a8fad6893a workflows: Possibly fix the release workflow
The only reason we had this one passing for amd64 is because the check
was done using the wrong variable (`matrix.stage`, while in the other
workflows the variable used is `inputs.stage`).

The commit that broke the release process is 67a8665f51, which
blindly copy & pasted the logic from the matrix assets.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-10-28 11:15:53 +01:00
Steve Horsman
ad5749fd6b
Merge pull request #10467 from stevenhorsman/release-3.10.1
release: Bump version to 3.10.1
2024-10-25 20:19:23 +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
Steve Horsman
19ac0b24f1
Merge pull request #10463 from skaegi/rustjail_filemode_perm_fix
agent: Correct rustjail device filemode permission typo
2024-10-25 14:27:50 +01:00
Fabiano Fidêncio
cc815957c0
Merge pull request #10461 from kata-containers/topic/workflows-follow-up-on-manually-triggered-job
workflows: devel: Follow-up on the manually triggered jobs
2024-10-25 08:31:14 +02:00
Simon Kaegi
322846b36f agent: Correct rustjail device filemode permission typo
Corrects device filemode permissions typo/regression in rustjail to `666` instead of `066`.
`666` is the standard and expected value for these devices in containers.

Fixes: #10454

Signed-off-by: Simon Kaegi <simon.kaegi@gmail.com>
2024-10-24 16:46:40 -04:00
GabyCT
a9af46ccd2
Merge pull request #10452 from GabyCT/topic/katadoctemp
tests: Add trap statement in kata doc script
2024-10-24 13:21:11 -06:00
Gabriela Cervantes
a3ef8c0a16 tests: Increase time to run stressng k8s tests
This PR increase the time to run the stressng k8s tests for the
CoCo stability CI.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-10-24 16:34:17 +00:00
Fabiano Fidêncio
475ad3e06b
workflows: devel: Allow running more than one at once
More than one developer can and should be able to run this workflow at
the same time, without cancelling the job started by another developer.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-10-24 15:38:35 +02:00
Fabiano Fidêncio
8f634ceb6b
workflows: devel: Adjust the pr-number
Let's use "dev" instead of "manually-triggered" as it avoids the name
being too long, which results in failures to create AKS clusters.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-10-24 15:38:31 +02:00
GabyCT
41d1178e4a
Merge pull request #10438 from GabyCT/topic/fixspellreadme
docs: Fix misspelling in CI documentation
2024-10-23 13:34:52 -06:00
Steve Horsman
c5c389f473
Merge pull request #10449 from kata-containers/topic/add-workflows-specifically-for-testing
Add a specific workflow for testing the CI, without messing up with the "nightly" weather
2024-10-23 19:03:49 +01:00
Gabriela Cervantes
093a6fd542 tests: Add trap statement in kata doc script
This PR adds the trap statement into the kata doc
script to clean up properly the temporary files.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-10-23 15:56:58 +00:00
Gabriela Cervantes
701891312e docs: Fix misspelling in CI documentation
This PR fixes a misspelling in CI documentation readme.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-10-23 15:42:08 +00:00
Fabiano Fidêncio
829415dfda workflows: Remove the possibility to manually trigger the nightly CI
As a new workflow was added for the cases where developers want to test
their changes in the workflow itself, let's make sure we stop allowing
manual triggers on this workflow, which can lead to a polluted /
misleading weather of the CI.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-10-23 13:19:45 +02:00
Fabiano Fidêncio
cc093cdfdb workflows: Add a manually trigger "devel" workflow for the CI
This workflow is intended to replace the `workflow_dispatch` trigger
currently present as part of the `ci-nightly.yaml`.

The reasoning behind having this done in this way is because of our good
and old GHA behaviour for `pull_request_target`, which requires a PR to
be merged in order to check the changes in the workflow itself, which
leads to:
* when a change in a workflow is done, developers (should) do:
  * push their branch to the kata-containers repo
  * manually trigger the "nightly" CI in order to ensure the changes
    don't break anything
    * this can result in the "nightly" CI weather being polluted
      * we don't have the guarantee / assurance about the last n nightly
	runs anymore

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-10-23 13:14:50 +02:00
Greg Kurz
378f454fb9
Merge pull request #10208 from wtootw/main
runtime: Failed to clean up resources when QEMU is terminated
2024-10-23 12:11:57 +02:00
Fabiano Fidêncio
ca416d8837
Merge pull request #10446 from kata-containers/topic/re-work-shim-v2-build-as-part-of-the-ci-and-release
workflows: Ensure shim-v2 is built as the last asset
2024-10-23 09:27:29 +02:00
Fabiano Fidêncio
c082b99652
Merge pull request #10439 from microsoft/mahuber/azl-cfg-var
tools: Change PACKAGES var for cbl-mariner
2024-10-23 08:39:49 +02:00
Manuel Huber
a730cef9cf tools: Change PACKAGES var for cbl-mariner
Change the PACKAGES variable for the cbl-mariner rootfs-builder
to use the kata-packages-uvm meta package from
packages.microsoft.com to define the set of packages to be
contained in the UVM.
This aligns the UVM build for the Azure Linux distribution
with the UVM build done for the Kata Containers offering on
Azure Kubernetes Services (AKS).

Signed-off-by: Manuel Huber <mahuber@microsoft.com>
2024-10-22 23:11:42 +00:00
Fabiano Fidêncio
67a8665f51 workflows: Ensure shim-v2 is built as the last asset
By doing this we can ensure that whenever the rootfs changes, we'll be
able to get the new root_hash.txt and use it.

This is the very first step to bring the measured rootfs tests back.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-10-22 14:56:37 +02:00
Greg Kurz
3de6d09a86
Merge pull request #10443 from gkurz/release-3.10.0
release: Bump VERSION to 3.10.0
2024-10-22 14:46:30 +02: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
wangyaqi54
cf4b81344d runtime: Failed to clean up resources when QEMU is terminated by signal 15
When QEMU is terminated by signal 15, it deletes the PidFile.
Upon detecting that QEMU has exited, the shim executes the stopVM function.
If the PidFile is not found, the PID is set to 0.
Subsequently, the shim executes `kill -9 0`, which terminates the current process group.
This prevents any further logic from being executed, resulting in resources not being cleaned up.

Signed-off-by: wangyaqi54 <wangyaqi54@jd.com>
2024-10-22 17:04:46 +08:00
Fabiano Fidêncio
4c34cfb0ab
Merge pull request #10420 from pmores/add-support-for-virtio-scsi
runtime-rs: support virtio-scsi device in qemu-rs
2024-10-22 11:00:33 +02:00
Pavel Mores
8cdd968092 runtime-rs: support virtio-scsi device in qemu-rs
Semantics are lifted straight out of the go runtime for compatibility.
We introduce DeviceVirtioScsi to represent a virtio-scsi device and
instantiate it if block device driver in the configuration file is set
to virtio-scsi.  We also introduce ObjectIoThread which is instantiated
if the configuration file additionally enables iothreads.

Signed-off-by: Pavel Mores <pmores@redhat.com>
2024-10-22 08:55:54 +02:00