mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-11 04:42:16 +00:00
metrics: Increase containerd start timeout
- Move `kill_kata_components` from common.bash into the metrics code base as the only user of it - Increase the timeout on the start of containerd as the last 10 nightlies metric tests have failed with: ``` 223478 Killed sudo timeout -s SIGKILL "${TIMEOUT}" systemctl start containerd ``` Signed-off-by: stevenhorsman <steven@uk.ibm.com>
This commit is contained in:
parent
3fab7944a3
commit
658a5e032b
@ -298,23 +298,6 @@ function clean_env_ctr()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Kills running shim and hypervisor components
|
|
||||||
function kill_kata_components() {
|
|
||||||
local ATTEMPTS=2
|
|
||||||
local TIMEOUT="30s"
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
# Restarts a systemd service while ensuring the start-limit-burst is set to 0.
|
# Restarts a systemd service while ensuring the start-limit-burst is set to 0.
|
||||||
# Outputs warnings to stdio if something has gone wrong.
|
# Outputs warnings to stdio if something has gone wrong.
|
||||||
#
|
#
|
||||||
@ -601,7 +584,7 @@ function clone_cri_containerd() {
|
|||||||
# version: the version of the tarball that will be downloaded
|
# version: the version of the tarball that will be downloaded
|
||||||
# tarball-name: the name of the tarball that will be downloaded
|
# tarball-name: the name of the tarball that will be downloaded
|
||||||
function download_github_project_tarball() {
|
function download_github_project_tarball() {
|
||||||
project="${1}"
|
project="${1}"
|
||||||
version="${2}"
|
version="${2}"
|
||||||
tarball_name="${3}"
|
tarball_name="${3}"
|
||||||
|
|
||||||
@ -731,7 +714,7 @@ OOMScoreAdjust=-999
|
|||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# base_version: The version to be intalled in the ${major}.${minor} format
|
# base_version: The version to be intalled in the ${major}.${minor} format
|
||||||
|
@ -224,6 +224,23 @@ function kill_processes_before_start()
|
|||||||
kill_kata_components
|
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
|
# Generate a random name - generally used when creating containers, but can
|
||||||
# be used for any other appropriate purpose
|
# be used for any other appropriate purpose
|
||||||
function random_name()
|
function random_name()
|
||||||
@ -513,7 +530,7 @@ function get_current_kata_config_file() {
|
|||||||
current_config_file="${KATA_CONFIG_FNAME}"
|
current_config_file="${KATA_CONFIG_FNAME}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# This function checks if the current session is runnin as root,
|
# This function checks if the current session is runnin as root,
|
||||||
# if that is not the case, the function exits with an error message.
|
# if that is not the case, the function exits with an error message.
|
||||||
function check_if_root() {
|
function check_if_root() {
|
||||||
[ "$EUID" -ne 0 ] && die "Please run as root or use sudo."
|
[ "$EUID" -ne 0 ] && die "Please run as root or use sudo."
|
||||||
|
Loading…
Reference in New Issue
Block a user