19645 Commits

Author SHA1 Message Date
Aurélien Bombo
ac37ddf56c Merge pull request #13356 from kata-containers/sprt/fix-aks-preview
ci: pin aks-preview version
2026-07-13 13:52:20 -05:00
Aurélien Bombo
6a36a10b7a ci: pin aks-preview version
The latest version is failing to install with the below error, so pin to
the last known good version.

  WARNING: No stable version of 'aks-preview' to install. Preview versions allowed.
  ERROR: The checksum of the extension does not match the expected value. Use --debug for more information.

Evidence this version fixes the issue locally:

  $ az extension list-versions --name aks-preview --output table | tail -2
  True          False           True (upgrade available)  aks-preview  True       21.0.0b8
  True          False           False                     aks-preview  True       21.0.0b9 (max compatible version)
  $ az extension add --name aks-preview --version 21.0.0b9
  No stable version of 'aks-preview' to install. Preview versions allowed.
  The checksum of the extension does not match the expected value. Use --debug for more information.
  $ az extension remove --name aks-preview
  The extension aks-preview is not installed. Please install the extension via `az extension add -n aks-preview`.
  $ az extension add --name aks-preview --version 21.0.0b8
  No stable version of 'aks-preview' to install. Preview versions allowed.
  The installed extension 'aks-preview' is in preview.
  $

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2026-07-13 12:27:28 -05:00
Hyounggyu Choi
48477f5b7b Merge pull request #13344 from stevenhorsman/crate-bumps-jul-26-round-3
Crate bumps jul 26 round 3
2026-07-13 12:24:45 +02:00
Fabiano Fidêncio
6168d1b1f3 Merge pull request #13326 from kata-containers/topic/composable-nvidia-gpu-nvrc
guest-extensions: Bring on NVRC support
2026-07-12 18:15:56 +02:00
Fabiano Fidêncio
de775d9c88 docs: promote composable VM images proposal to a design document
The proposal told us to move it under docs/design/ once it was accepted
and implemented.  The systemd base landed on main and the NVIDIA split
(nvidia base + gpu extension) is what this series wires up, so it's no
longer a proposal - promote it to docs/design/composable-vm-images.md,
flip the status accordingly and repoint the in-tree references (agent,
osbuilder and kata-deploy) at the new path.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2026-07-10 21:39:05 +02:00
Fabiano Fidêncio
186e6907b2 kata-sys-util: surface createContainer hook failures on /dev/kmsg
createContainer hooks run in the forked container child, where kata-agent's
async slog drain (its background thread) does not exist, so `error!` from a
failing hook is silently dropped and the failure leaves no trace at all.

Mirror hook failures to /dev/kmsg, the one log sink that survives the fork
and reaches the guest console, so a hook that can't be found or exits
non-zero is at least visible when debugging. Failures only.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
Assisted-by: Cursor <cursoragent@cursor.com>
2026-07-10 21:39:05 +02:00
Fabiano Fidêncio
a86aa076b0 kata-sys-util: run OCI hooks by their absolute path
Hooks were spawned by PATH-searching `args[0]`. After `env_clear()` a bare
argv[0] only resolves against the compiled-in default PATH (/bin:/usr/bin),
so a hook binary living elsewhere - e.g. a composable-image extension under
/run/kata-extensions/<name>/bin - failed to start with ENOENT.

Execute the hook's `path` instead (an absolute path, already validated in
`new`), passing `args` as argv with argv[0] = args[0]. This matches OCI
runtime-spec semantics and lets hooks run from any location.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
Assisted-by: Cursor <cursoragent@cursor.com>
2026-07-10 21:39:05 +02:00
Fabiano Fidêncio
ca9be43851 build: wire nvidia-gpu base/extension into CI and packaging
Add the rootfs-image-nvidia-{base,gpu-extension} build targets to the
local-build Makefile and the nvgpu bundle.

Build the base/extension rootfs images in the amd64/arm64 static tarball
workflows, and point the runtime-rs NVIDIA shim components at the
composable base + gpu extension (+ coco extension for the confidential
classes). The Go shim components keep the monolithic nvidia-gpu /
nvidia-gpu-confidential images.

Ship cryptsetup in the CoCo guest-components extension (and bundle
libnvat's non-glibc dependency closure next to the nvidia attester): the
chiseled nvidia base image carries only veritysetup, so the coco-extension
manifest's usr/sbin PATH entry needs a cryptsetup to resolve for NVIDIA
confidential encrypted-storage.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
Assisted-by: Cursor <cursoragent@cursor.com>
2026-07-10 21:39:05 +02:00
Fabiano Fidêncio
3b686971ce config: boot composable nvidia base image + gpu/coco extensions
Flip the runtime-rs NVIDIA GPU configs (plain/tdx/snp) from the monolithic
image to the driver-agnostic nvidia base boot image plus a cold-plugged,
driver-versioned gpu extension mounted at /run/kata-extensions/gpu.
Confidential runtime-rs configs additionally cold-plug the CoCo
guest-components extension and enforce the nvidia base dm-verity hash.

The Go runtime keeps booting the monolithic nvidia-gpu / nvidia-gpu-confidential
images, mirroring the CoCo split where runtime-rs is the first-class citizen and
Go stays on the monolithic layout.

Add the IMAGE{NAME,PATH}_NV_{BASE,EXTENSION} and NVIDIAGPUEXTENSIONVERITYPARAMS
make vars (runtime-rs only), and read the nvidia base + gpu-extension root
hashes into runtime-rs's shim-v2 opts while the Go opts keep reading the
monolithic nvidia-gpu / nvidia-gpu-confidential hashes.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
Assisted-by: Cursor <cursoragent@cursor.com>
2026-07-10 21:39:05 +02:00
Fabiano Fidêncio
8f4db8a23f build: split NVIDIA rootfs into nvidia base image + gpu extension
Carve the monolithic NVIDIA GPU rootfs into a driver-agnostic
nvidia base image (NVRC init + agent + base libs + in-tree modules)
and a driver-versioned gpu extension (GPU userspace, configs, firmware,
NVIDIA modules) laid out for /run/kata-extensions/gpu. Both halves are
produced from the same chiseled tree via a partition-after step, so
the monolith build stays byte-identical and continues to ship.

The shared stage-one (driver install) is reused across the monolith,
base and extension variants; nvidia base is cached without the driver/ctk
versions so one base image can back multiple driver extensions.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
Assisted-by: Cursor <cursoragent@cursor.com>
2026-07-10 21:39:05 +02:00
Fabiano Fidêncio
a2c15d74b8 busybox: build config from a fragment instead of a frozen .config
We've been carrying a full, 1200+ line busybox .config for the NVIDIA
images.  That's a pain to review and to keep in sync with a busybox
bump, as basically every default that changes upstream ends up as noise
in our file.

Switch to shipping only the handful of options we actually care about in
a small fragment and let busybox's own Kconfig fill in the rest at build
time: start from allnoconfig, drop the baseline entries for whatever the
fragment overrides (Kconfig keeps the first value it reads), append the
fragment and run silentoldconfig.  This reproduces the exact same
.config we had frozen, module loading included, so there's no functional
change here.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2026-07-10 21:39:05 +02:00
Fabiano Fidêncio
b5ea7c7f3e versions: bump NVRC to v0.1.5
NVRC v0.1.5 carries the guest-side extension mounting that the composable
NVIDIA GPU images will rely on.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
Assisted-by: Cursor <cursoragent@cursor.com>
2026-07-10 21:39:05 +02:00
Fabiano Fidêncio
2273e33011 kernel: drop MLX/InfiniBand from the NVIDIA GPU kernel config
The InfiniBand and Mellanox mlx5 options used to be carried (as modules)
in the NVIDIA GPU config fragments. They're now enabled built-in by the
common mlx5.conf fragment, which every kernel build already picks up, so
keeping them here is redundant - and the =m entries here only end up
fighting the built-in =y ones from the common fragment.

Drop the HGX/DGX block from both the x86_64 and arm64 GPU fragments and
bump kata_config_version so the kernel is rebuilt.

Assisted-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2026-07-10 21:39:05 +02:00
stevenhorsman
168c4a3b6f deps: bump anyhow 1.0.102 → 1.0.103
Fixes RUSTSEC-2026-0190 — unsoundness in anyhow::Error::downcast_mut()
in versions < 1.0.103.

We do not call anyhow::Error::downcast_mut() anywhere in the codebase,
so we are not directly exploiting the unsound path, but the bump is
applied to eliminate the advisory from cargo-audit output.

Ref: https://osv.dev/RUSTSEC-2026-0190

Generated-by: IBM Bob
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2026-07-10 10:31:56 -07:00
stevenhorsman
7598cc0b00 deps: bump crossbeam-epoch 0.9.18 → 0.9.20
Fixes RUSTSEC-2026-0204 — unsoundness in crossbeam-epoch < 0.9.20.
crossbeam-epoch is a transitive dependency pulled in via:
  crossbeam 0.8.4 → ttrpc 0.8.6

No direct dependency changes are needed; pinning the resolved version
in Cargo.lock is sufficient to ensure the fixed crate is used.

Ref: https://osv.dev/RUSTSEC-2026-0204

Generated-by: IBM Bob
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2026-07-10 10:31:56 -07:00
stevenhorsman
297f74795d kata-ctl: bump quick-xml 0.28.2 → 0.41.0
Fixes RUSTSEC-2026-0194 and RUSTSEC-2026-0195 reported against
quick-xml < 0.37.2.  The quick-xml se::to_string API used by kata-ctl's
log-parser is unchanged between 0.28 and 0.41, so no call-site edits
are needed.

Ref: https://osv.dev/RUSTSEC-2026-0194
Ref: https://osv.dev/RUSTSEC-2026-0195

Generated-by: IBM Bob
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2026-07-10 10:31:56 -07:00
stevenhorsman
0c1728ad1e deps: bump rstest 0.18.0 → 0.26.1
Bump workspace rstest to 0.26.1 and migrate local pins in
kata-types and kata-ctl to workspace = true. No macro API
changes required across this range.

Generated-by: IBM Bob
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2026-07-10 10:31:56 -07:00
stevenhorsman
9867e61d38 deps: bump awaitgroup 0.6.0 → 0.7.0
Add awaitgroup to workspace dependencies at 0.7.0 and switch both
rustjail and virt_container from local pins to workspace = true.
No API changes required — WaitGroup::new(), .worker() and .wait()
are unchanged across this range.

Generated-by: IBM Bob
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2026-07-10 10:31:55 -07:00
stevenhorsman
22fa14f860 deps: bump sha2 0.10.8/0.10.9 → 0.11.0
Bump workspace sha2 to 0.11.0 and migrate the local pins in
src/agent/Cargo.toml and src/libs/kata-types/Cargo.toml to
workspace = true. No API changes required — the Digest trait
interface is unchanged across this range.

Generated-by: IBM Bob
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2026-07-10 10:31:55 -07:00
stevenhorsman
beeb27c6d1 deps: bump sysinfo 0.34.2 → 0.39.5 in kata-types
Add sysinfo to the workspace dependencies at 0.39.5 and switch
kata-types from its local pin to workspace = true. No API changes
required — System::new_all() is stable across this range.

sysinfo 0.39.5 requires rustc >= 1.95. Update the workspace
rust-version to match the toolchain already set in rust-toolchain.toml.

Generated-by: IBM Bob
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2026-07-10 10:22:40 -07:00
stevenhorsman
aa968e743f deps: bump base64 0.13.0 → 0.22 in kata-types
Remove the local 0.13.0 pin and defer to the workspace version (0.22).
Migrate all callsites from the deprecated free-function API to the
engine-based API introduced in 0.20:

  base64::encode(x)                         -> STANDARD.encode(x)
  base64::decode(x)                         -> STANDARD.decode(x)
  base64::encode_config(x, STANDARD)        -> STANDARD.encode(x)
  base64::decode_config(x, STANDARD)        -> STANDARD.decode(x)
  base64::encode_config(x, URL_SAFE)        -> URL_SAFE.encode(x)

Add `use base64::Engine as _` to bring the trait methods into scope in
initdata.rs and mount.rs.

Generated-by: IBM Bob
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2026-07-10 10:22:40 -07:00
Steve Horsman
4adabbd28a Merge pull request #13336 from stevenhorsman/versions/golang/1.25.12
versions: bump golang to 1.25.12
2026-07-10 18:21:05 +01:00
Steve Horsman
abb109cb5a Merge pull request #13305 from stevenhorsman/versions/rust-1.95-bump
versions: rust 1.95 bump
2026-07-10 18:18:59 +01:00
Steve Horsman
71796fc4f1 Merge pull request #12982 from fidencio/topic/trustee-helm-chart
tests: switch CoCo KBS/Trustee deployment from kustomize to Helm
2026-07-10 10:01:26 +01:00
Fabiano Fidêncio
de1e5bbde1 tests: deploy CoCo Trustee via Helm on all platforms
Replace the kustomize-based Trustee deployment with the upstream Trustee
Helm chart (deployment/helm-chart) for every platform, including TDX and
s390x, which the previous iteration still left on kustomize. The chart
deploys KBS, AS and RVPS as three separate images, so versions.yaml pins
image_kbs/image_as/image_rvps (from the upstream staged-images registry)
alongside the trustee revision, and bumps trustee to a build that carries
the IBM SE material mounting support and the SHA-512 report-data change.
guest-components is bumped in lockstep so IBM SE attestation agrees on the
SHA-512 runtime-data digest.

KBS runs with authorization_mode = "AuthenticatedAuthorization", so admin
requests from kbs-client carry the bearer token minted by the chart's
bootstrap job instead of relying on an anonymous, allow-all admin API. As
reused CI runners may still carry a kbs-client from an older Trustee that
predates the --admin-token-file flag, the client is rebuilt from the pinned
sources unless the installed one already understands it.

On the Intel TDX CI runner only the Attestation Service reaches the public
Intel DCAP collateral endpoint, so it is the sole component that needs the
corporate proxy. We set https_proxy on the AS alone: the KBS <-> AS <-> RVPS
traffic is plain HTTP/gRPC and in-cluster, and routing it through the proxy
breaks those connections. The Intel DCAP and NVIDIA verifiers are configured
by the chart out of the box, so TDX and SNP need no extra verifier knobs.

For IBM SE (s390x) the SE verifier now runs inside the gRPC Attestation
Service, so the SE materials are mounted on the AS Pod (not KBS) through the
chart's as.ibmse.* knobs, which create a node-local PV/PVC. The AS runs as a
non-root user with CAP_DAC_OVERRIDE dropped, hence fsGroup=1000 and a
group-readable hdr.bin so it can read the mounted materials.

The chart's default CPU requests reserve more of the small single-node CI
runners than the old single-Pod deployment did, starving test workloads that
ask for a couple of Guaranteed CPUs. Trustee requests are shrunk (limits kept
generous) so those Pods schedule again.

Debug logging is enabled on all components (log_level=debug) to ease
triaging attestation / resource-retrieval failures in CI, and the release is
rolled out with 'helm upgrade --install' so re-runs on long-lived CI
clusters reconcile in place.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
Assisted-by: Cursor <cursoragent@cursor.com>
2026-07-09 18:40:01 +02:00
Dan Mihai
ab07cd6e38 Merge pull request #13275 from WaterWhisperer/fix/runtime-rs-clh-config-source
runtime-rs: substitute CLH config source placeholder
2026-07-09 09:05:40 -07:00
stevenhorsman
9c167b339b versions: bump golang to 1.25.12
Bump the go version to fix GO-2026-5856 (CVE-2026-42505).

Generated-By: IBM Bob
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2026-07-09 13:40:17 +01:00
Fabiano Fidêncio
e6442b9a02 Merge pull request #13335 from fidencio/topic/re-add-nvidia-gpu-snp-ci
Revert "tests: temporarily disable nvidia-gpu-snp* tests"
2026-07-09 12:19:43 +02:00
Fabiano Fidêncio
fa4153d50c Revert "tests: temporarily disable nvidia-gpu-snp* tests"
This reverts commit 527a323478, as the
machine is up again.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2026-07-09 12:05:35 +02:00
stevenhorsman
25bdd661c5 runtime-rs: cargo fmts
Some are format expectation changes in 1.95, but
I think some are just missing fmts that our CI doesn't
check.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2026-07-09 10:28:35 +01:00
stevenhorsman
7ede239bd0 agent: resolve useless_conversion warning for Rust 1.95
Remove redundant `.into_iter()` call on `zip()` argument in
`multi_layer_erofs.rs`, as flagged by the new
`clippy::useless_conversion` lint in Rust 1.95.

Generated-by: IBM Bob
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2026-07-09 10:26:42 +01:00
stevenhorsman
67413c399f dragonball: resolve manual_checked_ops warning in mem-agent for Rust 1.95
Replace manual `if us != 0` guard before integer division with
`checked_div` as flagged by the new `clippy::manual_checked_ops` lint
in Rust 1.95.

Generated-by: IBM Bob
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2026-07-09 10:26:42 +01:00
stevenhorsman
4e68168fcf libs: resolve manual_checked_ops warning in mem-agent for Rust 1.95
Replace manual `if us != 0` guard before integer division with
`checked_div` as flagged by the new `clippy::manual_checked_ops` lint
in Rust 1.95.

Generated-by: IBM Bob
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2026-07-09 10:26:42 +01:00
stevenhorsman
d9388fe681 runtime-rs: resolve useless_conversion warnings for Rust 1.95
Remove redundant `.into_iter()` call in `Vec::from_iter()` argument in
dragonball and firecracker's `inner_hypervisor.rs`, as flagged by the new
`clippy::useless_conversion` lint in Rust 1.95.

Generated-by: IBM Bob
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2026-07-09 10:26:42 +01:00
stevenhorsman
401cb58f03 packaging: resolve collapsible_match warnings for Rust 1.95
Rust 1.95's clippy introduces new `collapsible_match` lints for `if`
blocks nested inside match arms that can be expressed as match guards.

Generated-by: IBM Bob
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2026-07-09 10:26:42 +01:00
stevenhorsman
b8a0fbca46 runtime-rs: resolve collapsible_match warnings for Rust 1.95
Rust 1.95's clippy introduces new `collapsible_match` lints for `if`
blocks nested inside match arms that can be expressed as match guards.

Generated-by: IBM Bob
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2026-07-09 10:26:42 +01:00
stevenhorsman
6bb713f614 libs: resolve collapsible_match warnings for Rust 1.95
Rust 1.95's clippy introduces new `collapsible_match` lints for `if`
blocks nested inside match arms that can be expressed as match guards.

Generated-by: IBM Bob
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2026-07-09 10:26:42 +01:00
stevenhorsman
b027554e57 versions: Bump rust to 1.95
When 1.97 has been released, in compliance with our toolchain guidance
we should bump to rust 1.95

Assisted-by: IBM Bob
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2026-07-09 10:26:42 +01:00
WaterWhisperer
89354c4441 runtime-rs: substitute CLH config source placeholder
The CLH runtime-rs config template uses @CONFIG_CLH_IN@ in its
source-file comment, but CONFIG_CLH_IN was missing from the generated
template variables.

Add it to USER_VARS so the generated config records the template path
instead of keeping the literal placeholder.

Fixes: #12941

Signed-off-by: WaterWhisperer <waterwhisperer24@qq.com>
2026-07-08 19:03:34 -05:00
Dan Mihai
221b9cbe5b Merge pull request #13327 from ihanzh/fix-genpolicy-dot-slash-layer-paths
genpolicy: normalize layer tar paths
2026-07-08 10:15:01 -07:00
Fabiano Fidêncio
5147c014df Merge pull request #13212 from zachspar/spar/kata-deploy-daemonset-labels-and-affinity
kata-deploy: add podLabels, podAnnotations and affinity to DaemonSet
2026-07-08 16:58:17 +02:00
Zvonko Kaiser
7e10ce3b15 Merge pull request #13139 from kata-containers/topic/docker-plus-nvidia
docker: nvidia: Make nvidia-gpu stuff also work with docker
2026-07-08 10:52:49 -04:00
Fabiano Fidêncio
7053d70acf tests: retry pod removal before forcing in TestKilledVmmCleanup
TestKilledVmmCleanup SIGKILLs the VMM and then removes the pod.  After a
hard VMM kill the shim exits promptly (which the test asserts), so the
container's TaskExit event may not have reached containerd before the
shim was gone, leaving CRI's view of the container as "running" and
making a plain `crictl rmp` fail with "container is still running, to
stop first".

Retry the normal removal a few times to give the event time to arrive,
and only fall back to `crictl rmp -f` if it keeps failing -- which is how
a crashed sandbox is recovered in practice (kubelet GC / manual force
removal).  The essential guarantee, that no shim process is leaked after
the VMM is killed, is unchanged.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2026-07-08 13:12:19 +02:00
Fabiano Fidêncio
d3291b8778 runtime: publish TaskExit before sandbox teardown
Docker and containerd rely on the TaskExit event and a prompt Wait RPC,
not just the eventual sandbox teardown.  With the original ordering the
shim tore the sandbox down (Stop/Delete the guest) *before* publishing
the container exit, so for a slow guest shutdown -- e.g. the nvidia-gpu
config with an 8GB /dev/shm memory-backend on a constrained CI runner --
containerd could SIGKILL the shim before the exit was published.  The
`docker run --rm` removal then races the dead-shim cleanup and fails,
even though the container itself exited 0.

Publish the container exit (c.exitCh) and the TaskExit event *before*
the sandbox teardown, and run the teardown without holding s.mu so
concurrent Delete()/Shutdown() RPCs are not blocked.

To keep the guarantees the previous ordering provided:

  * teardownWg lets Shutdown() wait for an in-flight teardown to finish,
    so the sandbox run directory (watched by kata-monitor) and the CRI
    state are gone before the shim exits -- without holding s.mu across
    the slow guest shutdown; and
  * teardownOnce serialises wait()'s teardown with watchSandbox()'s
    killed-VMM teardown so the (not internally synchronized)
    Sandbox.Stop/Delete never run concurrently.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2026-07-08 13:12:19 +02:00
Fabiano Fidêncio
80e3b07194 runtime: don't block shim cleanup on a dead agent
For `docker run --rm`, containerd invokes the shim `delete` binary
(cleanupAfterDeadShim) once the container task exits.  Kata's Cleanup
path re-loads the sandbox and calls StopContainer/DeleteContainer/Stop,
each of which lazily connects to the guest agent over vsock.

When the sandbox was already torn down by the main shim (the common
case for a short-lived `docker run --rm`), the VM -- and its agent --
are gone, so that vsock connect blocks until containerd's delete
timeout SIGKILLs the binary.  The removal then fails and `docker run
--rm` returns non-zero even though the container itself exited 0.

Detect the already-dead hypervisor (its pidfile is gone / the pid no
longer maps to a live process) at the start of CleanupContainer and
mark the agent dead.  Subsequent agent RPCs then fail fast with "Dead
agent" and the force path performs only host-side cleanup, so the
delete binary returns promptly instead of hanging.

The legitimate "shim crashed but VM still alive" cleanup is unaffected:
the hypervisor is still running, so the agent is not marked dead and
the normal agent-based teardown proceeds.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2026-07-08 13:12:19 +02:00
Fabiano Fidêncio
2fe3dacb41 runtime-rs/qemu: reserve a memory hotplug region for virtio-mem
virtio-mem is enabled on s390x, where memory hotplug goes through a
virtio-mem-ccw device set up during VM initialization.  That device --
and the later resize -- require a memory hotplug region (a non-zero
maxmem/slots on the QEMU command line).

The runtime-rs command line generator, however, zeroes maxmem/slots
whenever the guest uses the shared /dev/shm memory-backend with a
non-nvdimm rootfs (the s390x case: virtio-blk-ccw rootfs).  With no
hotplug region reserved, two things broke on s390x:

  * setup_virtio_mem failed VM start with "the configuration is not
    prepared for memory devices, consider specifying the maxmem option";
  * with virtio-mem unavailable, memory resize fell back to pc-dimm,
    which is not a valid device model on s390x, breaking
    TestContainerMemoryUpdate:
      'pc-dimm' is not a valid device model name

Keep the hotplug region when virtio-mem is enabled, mirroring the Go
runtime which reserves maxmem and hotplugs via virtio-mem-ccw on s390x.
This lets setup_virtio_mem succeed at boot and makes memory resize use
virtio-mem instead of pc-dimm.

Also guard setup_virtio_mem behind QemuCmdLine::has_memory_hotplug_region()
as a defensive fallback: if some configuration still ends up without a
hotplug region, skip virtio-mem setup (like static-sizing arches such as
arm64) rather than failing VM start.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2026-07-08 13:12:19 +02:00
Fabiano Fidêncio
be5d7794d5 tests: add debug logs to docker tests
Let's ensure we have more debug logs to go through in case of failures.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
Assisted-by: OpenAI Codex <codex@openai.com>
2026-07-08 13:12:19 +02:00
Fabiano Fidêncio
9634c3e5bc tests: add qemu-nvidia-gpu runtimes to CI matrix
Extend basic-ci-amd64 VMM matrix coverage to include qemu-nvidia-gpu and
qemu-nvidia-gpu-runtime-rs so this branch is validated in CI.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
Assisted-by: OpenAI Codex <codex@openai.com>
2026-07-08 13:12:19 +02:00
Fabiano Fidêncio
92da7974f5 runtime: fall back to CDI annotations when kubelet socket is absent
NVIDIA GPU configs default pod_resource_api_sock to the kubelet Pod
Resources API path. On non-Kubernetes hosts that path is usually missing;
use CDI sandbox annotations for cold-plug instead of failing kubelet lookup.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
Assisted-by: OpenAI Codex <codex@openai.com>
2026-07-08 13:12:19 +02:00
Fabiano Fidêncio
478970131c runtime-rs: tag standalone containers as single_container
The container create flow forced every non-pod-container to the
"pod_sandbox" type. Standalone engines (Docker/nerdctl/podman) surface
as SingleContainer, so they were mislabeled as pod sandboxes.

The agent skips CDI device injection when the container type is
"pod_sandbox", so the NVIDIA CDI edits carried in the "cdi.k8s.io/*"
annotations were never applied and the GPU userspace (e.g. nvidia-smi)
was missing in the guest. Emit the actual container type instead, which
matches the Go runtime and lets the agent inject CDI devices for the
single-container flow.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
Assisted-by: Cursor <noreply@cursor.com>
2026-07-08 13:12:19 +02:00