Commit Graph

19024 Commits

Author SHA1 Message Date
stevenhorsman
3466f888db agent-ctl: Move into root workspace
- Add agent-ctl to be a workspace member to simplify the
dependency management.
- Also add a test target as we've been running it in static-checks
without it doing anything

Assisted-by: IBM Bob
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2026-05-18 09:47:15 +01:00
Markus Rudy
5474f68168 Merge pull request #12970 from burgerdev/genpolicy-build-test-binaries
genpolicy: include test binaries in make target build
2026-05-18 09:22:11 +02:00
Alex Lyn
34dc055da3 Merge pull request #12932 from RainaYL/rainax/tdshim_pr
dragonball: Allow guest VM to load tdshim firmware for booting
2026-05-18 10:43:22 +08:00
Alex Lyn
3345a370d2 Merge pull request #13051 from burgerdev/dont-modify-initdata
runtime-rs: don't modify initdata from annotation
2026-05-18 09:41:47 +08:00
Fabiano Fidêncio
1aaa6f4848 Merge pull request #13054 from manuelh-dev/mahuber/require-nv-ci
Revert "gatekeeper: Unrequire NVIDIA GPU test"
2026-05-17 22:01:14 +02:00
Steve Horsman
59b27c4645 Merge pull request #13057 from microsoft/danmihai1/deploy-check-hypervisor-name
gha: k8s: reject unsupported KATA_HYPERVISOR values
2026-05-17 18:43:49 +01:00
Steve Horsman
81d9629a1a Merge pull request #13058 from microsoft/danmihai1/git-remote-show-origin
tests: export target_branch="${branch}"
2026-05-17 18:39:12 +01:00
Fabiano Fidêncio
96286e289a Merge pull request #13061 from burgerdev/proper-temp-dirs
runtime-rs: use proper temp dirs in initdata tests
2026-05-17 17:17:50 +02:00
Markus Rudy
38948f31a7 genpolicy: include test binaries in make target build
genpolicy supports building and testing on Darwin, both for Kata
developers as well as for users of the tool. In CI, we're currently only
testing the binary build on darwin, the test is only executed on Linux.
Since we aim to support development on darwin, including test execution,
we need to prevent regressions such as [1]. This commit adds the test
binaries to the `make build` target, such that they are covered by
`ci/darwin-tests.sh`.

In order to avoid unnecessary recompilation between the build and test
target, we align the `--release` handling between the two.

[1]: 639ff3578d

Signed-off-by: Markus Rudy <mr@edgeless.systems>
2026-05-16 20:47:12 +02:00
Markus Rudy
4d0f32ce41 runtime-rs: use proper temp dirs in initdata tests
The test currently uses a static directory at `/tmp/initimg_test`. This
introduces non-determinism into the unit test:

* Files that already exist in that dir might alter test results.
* If the directory is owned by root, the test will fail due to
  permissions.

Switch to using the tempfile crate instead.

Fixes: #13053

Signed-off-by: Markus Rudy <mr@edgeless.systems>
2026-05-16 20:39:13 +02:00
Markus Rudy
4971445f67 runtime-rs: don't modify initdata from annotation
The initdata is currently being decoded, and then re-encoded with the
to_string function. This will usually not preserve the original initdata
document, and thus the initdata hash will differ between the annotation
and the block device.

This commit changes the logic to only decode the base64, but keep the
initdata document intact. Since the error message is now nested, adjust
the tests to look for the expected error in the chain.

Fixes: #12951

Signed-off-by: Markus Rudy <mr@edgeless.systems>
2026-05-16 20:26:22 +02:00
Dan Mihai
ddc36060d2 gha: k8s: reject unsupported KATA_HYPERVISOR values
Exit early with an error message instead of starting kata-deploy if
the value of KATA_HYPERVISOR is not expected during CI.

For example: "cloud-hypervisor" was renamed recently to
"clh-runtime-rs" and user scripts depending on the old name were
getting tangled in kata-deploy instead of just rejecting the old
value quickly.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2026-05-16 01:04:31 +00:00
Dan Mihai
b85fc8ed13 tests: export target_branch="${branch}"
Avoid running "git remote show origin" repeatedly when common.bash
gets sourced multiple times and target_branch was not specified by
the caller.

Repeated "git remote show origin" calls inflicted the additional
overhead of authenticating and communicating with the remote git
repository.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2026-05-16 00:59:44 +00:00
Manuel Huber
275a63b266 Revert "gatekeeper: Unrequire NVIDIA GPU test"
This reverts commit edfb6f5716.

The NVIDIA non-TEE CI job has passed again over the last 5 nightly
runs after merging PRs #13007 and #13020.

Signed-off-by: Manuel Huber <manuelh@nvidia.com>
2026-05-15 15:20:12 -07:00
Fabiano Fidêncio
8e1d73a4b5 Merge pull request #13052 from burgerdev/abort-later
agent: wait for logs before aborting
2026-05-15 23:58:26 +02:00
Dan Mihai
0f3df5d1e4 Merge pull request #13025 from manuelh-dev/mahuber/img-pull-policy
tests: generate guest-pull image pull agent security policies
2026-05-15 14:09:00 -07:00
Fabiano Fidêncio
ae1f67a4f3 Merge pull request #13040 from fidencio/topic/runtime-rs-ephemeral-storage
runtime-rs: ephemeral storage port
2026-05-15 18:24:27 +02:00
Markus Rudy
32f2c5c2e4 agent: wait for logs before aborting
If the policy loading encounters an error, we `abort(3)` the agent for
safety. Since abort causes the process to stop immediately, the async
logs might not be flushed yet, and thus won't make it to the runtime,
hiding the reason for the abort. Wait a bit before aborting so that the
logs are fully written.

Fixes: #13031

Signed-off-by: Markus Rudy <mr@edgeless.systems>
2026-05-15 12:36:29 +02:00
manuelh-dev
48671ad525 Merge pull request #13046 from fitzthum/bump-coco-0210
Bump guest components and Trustee for CoCo v0.21.0
2026-05-14 14:59:50 -07:00
Fabiano Fidêncio
33de5a6c22 runtime-rs: refactor handler_volumes to use VolumeContext
Group the shared-context parameters (share_fs, device_manager, sid,
agent, emptydir_mode) into a VolumeContext struct so handler_volumes
stays within clippy's argument count limit and avoids -D warnings
breakage in CI.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
Assisted-by: Cursor <cursoragent@cursor.com>
2026-05-14 22:56:11 +02:00
Fabiano Fidêncio
c19bdbf23b tests: nvidia-nim: use trusted storage templates for runtime-rs
Now that runtime-rs supports block-encrypted emptyDir volumes, remove
the no-trusted-storage workaround templates and the is_runtime_rs
branching in the NIM test. Runtime-rs now uses the same TEE templates
as the Go runtime with emptyDir + PVC at 48Gi memory, instead of the
128Gi workaround that compensated for lacking trusted storage.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
Assisted-by: Cursor <cursoragent@cursor.com>
2026-05-14 22:56:11 +02:00
Fabiano Fidêncio
54aaa1ea2a tests: enable trusted ephemeral storage for runtime-rs
Remove the runtime-rs skip from the trusted ephemeral data storage
test now that runtime-rs implements block-encrypted emptyDir volumes.

Also remove the genpolicy drop-in that disabled encrypted_emptydir
for runtime-rs and the corresponding copy logic in tests_common.sh.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
Assisted-by: Cursor <cursoragent@cursor.com>
2026-05-14 22:56:11 +02:00
Fabiano Fidêncio
aa7392b1b9 runtime-rs: add emptydir_mode to config templates
Add the emptydir_mode configuration option to all runtime-rs config
template files. CoCo configs (snp, tdx, se, coco-dev, nvidia-gpu-snp,
nvidia-gpu-tdx) default to block-encrypted via @DEFEMPTYDIRMODE_COCO@,
while non-CoCo configs (qemu, nvidia-gpu, fc) default to shared-fs
via @DEFEMPTYDIRMODE@.

Also add DEFEMPTYDIRMODE and DEFEMPTYDIRMODE_COCO variables to the
runtime-rs Makefile for template substitution.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
Assisted-by: Cursor <cursoragent@cursor.com>
2026-05-14 22:56:11 +02:00
Fabiano Fidêncio
5e2ca6d6ee runtime-rs: skip local type conversion for block-encrypted emptyDirs
When emptydir_mode is "block-encrypted", host emptyDir paths must
remain as "bind" mounts so the EncryptedEmptyDirVolume handler can
intercept them in the volume dispatch chain.  Previously,
update_ephemeral_storage_type() would unconditionally convert them
to "local" type, causing them to be handled as plain local volumes
instead.

Add the emptydir_mode parameter to update_ephemeral_storage_type()
and its call chain (amend_spec in container.rs) and skip the
host-emptyDir-to-local conversion when the mode is block-encrypted.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
Assisted-by: Cursor <cursoragent@cursor.com>
2026-05-14 22:56:11 +02:00
Fabiano Fidêncio
d3a9669be5 runtime-rs: implement EncryptedEmptyDirVolume
Add the core volume handler for block-encrypted emptyDir support
in runtime-rs, bringing it to parity with the Go runtime (PR #10559).

When emptydir_mode is set to "block-encrypted", host emptyDir bind
mounts are intercepted and handled as follows:

  1. A sparse disk image (disk.img) is created inside the emptyDir
     folder, sized to match the host filesystem capacity.
  2. A mountInfo.json is written under the kata direct-volume root
     with volume_type "blk", fs_type "ext4", and metadata
     encryptionKey=ephemeral.
  3. The disk image is plugged into the guest VM as a virtio-blk
     device via the hypervisor device manager.
  4. An agent::Storage is built with driver_options containing
     encryption_key=ephemeral and shared=true, so the kata-agent
     delegates formatting and encryption to CDH using LUKS2.

The volume is registered in the dispatch chain before the regular
block-volume check, and ephemeral disk metadata is tracked for
sandbox-level cleanup at teardown.

Also re-exports EMPTYDIR_MODE_* constants from kata-types::config
so downstream crates can reference them.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
Assisted-by: Cursor <cursoragent@cursor.com>
2026-05-14 22:56:11 +02:00
Tobin Feldman-Fitzthum
1cfed3c20b release: update guest-components for release
Pick up the latest version of guest-components.

Signed-off-by: Tobin Feldman-Fitzthum <tfeldmanfitz@nvidia.com>
2026-05-14 09:40:06 -07:00
Tobin Feldman-Fitzthum
79ea56f24e versions: bump Trustee version for release
Pick up the latest versions of Trustee.

Signed-off-by: Tobin Feldman-Fitzthum <tfeldmanfitz@nvidia.com>
2026-05-14 09:37:06 -07:00
Fabiano Fidêncio
0b1e103886 runtime-rs: agent: add shared field to Storage struct
The proto Storage message already has a "shared" field (field 8),
but the runtime-rs agent crate's internal Storage struct was
missing it, so it was never forwarded to the kata-agent.

Add the field to the Rust struct and its From<Storage> translation,
and update all explicit struct initialisers across the resource
crate to include shared: false so the build stays clean.

This is needed for trusted ephemeral data storage, where the
agent uses the shared flag to avoid premature cleanup of volumes
that are shared across containers in a pod.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
Assisted-by: Cursor <cursoragent@cursor.com>
2026-05-14 15:42:20 +02:00
Fabiano Fidêncio
00d4ee2344 kata-types: add direct-volume write/remove helpers
Add add_volume_mount_info(), is_volume_mounted(), and
remove_volume_path() to the mount module. These mirror the Go
helpers (AddMountInfo, IsVolumeMounted, Remove) in
src/runtime/pkg/direct-volume/utils.go and are needed by the
upcoming EncryptedEmptyDirVolume to write and clean up
mountInfo.json metadata for block-encrypted emptyDir volumes.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
Assisted-by: Cursor <cursoragent@cursor.com>
2026-05-14 15:42:20 +02:00
Steve Horsman
557fb5187b Merge pull request #12853 from kata-containers/dependabot/go_modules/src/runtime/github.com/sirupsen/logrus-1.9.4
build(deps): bump github.com/sirupsen/logrus from 1.9.3 to 1.9.4 in /src/runtime
2026-05-14 13:56:10 +01:00
Steve Horsman
aade0f5fbe Merge pull request #12854 from kata-containers/dependabot/go_modules/tools/testing/kata-webhook/github.com/sirupsen/logrus-1.9.4
build(deps): bump github.com/sirupsen/logrus from 1.9.3 to 1.9.4 in /tools/testing/kata-webhook
2026-05-14 13:55:44 +01:00
Fabiano Fidêncio
b4a9d3256b kata-types: add emptydir_mode configuration option
Add the emptydir_mode field to the Runtime configuration struct,
allowing runtime-rs to read the emptyDir handling mode from the
TOML config file. This is groundwork for trusted ephemeral data
storage support in runtime-rs (parity with the Go runtime).

Two modes are supported:
  - shared-fs (default): share emptyDir via virtio-fs/9p.
  - block-encrypted: plug a block device encrypted in-guest via
    CDH/LUKS2.

Empty values default to "shared-fs"; unknown values are rejected
during validation.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
Assisted-by: Cursor <cursoragent@cursor.com>
2026-05-14 11:29:40 +02:00
Fabiano Fidêncio
c8f6f17269 Merge pull request #13027 from PiotrProkop/fix-loop-blockfile-sandbox-cgroup
runtime: allow loopback devices when sandbox_cgroup_only is enabled
2026-05-14 11:18:45 +02:00
Fabiano Fidêncio
44b356c654 Merge pull request #13033 from microsoft/saul/static_maxvcpus
runtime-rs: static resources: always set maxvcpus equal to vcpus
2026-05-14 11:16:35 +02:00
Fabiano Fidêncio
9af625d3f1 Merge pull request #13006 from manuelh-dev/mahuber/cdh-upgrade
rootfs: cdh: Update CDH to new version
2026-05-14 10:09:18 +02:00
Xiaofan Xxf
88d892a77f dragonball: Allow guest VM to load tdshim firmware for booting
Added a firmware module to dbs_boot crate, and guest VM is allowed
to load tdshim into memory, which serves as a prerequisite for
booting TDX VM. And other sections (including kernel payload and
cmdline) are also loaded into correct guest physical addresses
according to the design of tdshim layout.

Signed-off-by: Xiaofan Xxf <xiaofan.xxf@antgroup.com>
2026-05-14 10:04:39 +08:00
Saul Paredes
d930fc42b8 runtime-rs: static resources: always set maxvcpus equal to vcpus
based on current runtime-go behaviour introduced in https://github.com/kata-containers/kata-containers/pull/9195

When using static resources, always set maxvcpus value equal to the vcpus value.
This is because the static resources case does not support dynamic CPU hotplugging,
and therefore the maximum number of vCPUs should be limited to the number of vCPUs.
Booting with a high number of max vCPUs is a bit slower compared to a lower number.

Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
2026-05-13 13:21:56 -07:00
Manuel Huber
ed4233bf91 rootfs: cdh: Update CDH to new version
Update CDH to a newer version and:
- adjust the NVIDIA root filesystem build to reflect the change from
  using libcryptsetup to using the cryptsetup binary.
- adjust image-pull test cases to conduct parallel write operations
  on the /dev/trusted_store backed guest image pull location since
  issue #12721 has been solved on CDH side.

Fixes #12721

Signed-off-by: Manuel Huber <manuelh@nvidia.com>
2026-05-13 20:20:45 +02:00
Wainer Moschetta
54674d4a90 Merge pull request #12797 from ldoktor/ci-docs
ci.ocp: Remove workaround and update docs
2026-05-13 14:52:27 -03:00
Lukáš Doktor
5322c5d228 ci.ocp: Remove workaround which force-skipped nydus
the f27def1a5b resolved the setup issue,
we can start using the defaults again.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
2026-05-13 12:58:53 -03:00
Lukáš Doktor
7a4a2cbab5 ci.ocp: Update links to pipeline results
we expanded the test matrix, update the links in docs to simplify
finding the results.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
2026-05-13 12:58:53 -03:00
Steve Horsman
6d5d2a1c20 Merge pull request #13037 from pavithiran34/pavi_fix_CVE-2026-7246
fix: add click 8.3.3 to docs requirements
2026-05-13 15:27:30 +01:00
Fabiano Fidêncio
edf5a968d9 Merge pull request #13034 from Amulyam24/static-check-runners
gha: move static checks to self hosted runners for ppc64le
2026-05-13 15:49:37 +02:00
Amulyam24
631dc72ceb gha: move static checks to self hosted runners for ppc64le
Move build checks to self hosted runners for Power.

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2026-05-13 11:07:52 +01:00
pavithiran34
83ea8e0915 fix: add click 8.3.3 to docs requirements
- Added click==8.3.3 to docs/requirements.txt
- Click 8.3.3 is the latest version for Python >=3.10
- Required for mkdocs toolchain compatibility and resolves vulnerability in indirect dependencies
- Ref : CVE-2026-7246

Signed-off-by: pavithiran34 <pavithiran.p@ibm.com>
2026-05-13 10:11:58 +01:00
dependabot[bot]
408e15641c build(deps): bump github.com/sirupsen/logrus in /src/runtime
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.9.3 to 1.9.4.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.9.3...v1.9.4)

---
updated-dependencies:
- dependency-name: github.com/sirupsen/logrus
  dependency-version: 1.9.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-13 06:11:21 +00:00
dependabot[bot]
18a13773da build(deps): bump github.com/sirupsen/logrus
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.9.3 to 1.9.4.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.9.3...v1.9.4)

---
updated-dependencies:
- dependency-name: github.com/sirupsen/logrus
  dependency-version: 1.9.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-13 06:11:16 +00:00
Greg Kurz
d2dc0a923c Merge pull request #13030 from stevenhorsman/go-1.25.10-bump
Go 1.25.10 bump
2026-05-13 08:09:51 +02:00
Aurélien Bombo
dcafae9645 Merge pull request #13032 from kata-containers/sprt/fix-virtiofsd-args
runtime-rs: align virtiofsd args on runtime-go
2026-05-12 19:55:54 -05:00
Dan Mihai
3799473041 Merge pull request #13010 from microsoft/danmihai1/label-references
genpolicy: support env variable values sourced from metadata.labels values
2026-05-12 15:41:11 -07:00