Merge pull request #10954 from kata-containers/topic/metrics-kata-deploy

Rework and fix metrics issues
This commit is contained in:
Zvonko Kaiser
2025-03-04 20:22:53 -05:00
committed by GitHub
12 changed files with 105 additions and 70 deletions

View File

@@ -224,6 +224,23 @@ function kill_processes_before_start()
kill_kata_components
}
# Kills running shim and hypervisor components
function kill_kata_components() {
local ATTEMPTS=2
local TIMEOUT="300s"
local PID_NAMES=( "containerd-shim-kata-v2" "qemu-system-x86_64" "qemu-system-x86_64-tdx-experimental" "cloud-hypervisor" )
sudo systemctl stop containerd
# iterate over the list of kata components and stop them
for (( i=1; i<=ATTEMPTS; i++ )); do
for PID_NAME in "${PID_NAMES[@]}"; do
[[ ! -z "$(pidof ${PID_NAME})" ]] && sudo killall -w -s SIGKILL "${PID_NAME}" >/dev/null 2>&1 || true
done
sleep 1
done
sudo timeout -s SIGKILL "${TIMEOUT}" systemctl start containerd
}
# Generate a random name - generally used when creating containers, but can
# be used for any other appropriate purpose
function random_name()