mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-28 11:44:38 +00:00
metrics: Add check containers are up in tensorflow script
This PR adds the check containers are up function from common in tensorflow script. Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
This commit is contained in:
parent
f700f9b0ba
commit
36337ee146
@ -186,17 +186,7 @@ function main() {
|
||||
check_containers_are_up "${NUM_CONTAINERS}"
|
||||
|
||||
# Check that the requested number of containers are running
|
||||
local timeout_launch="10"
|
||||
check_containers_are_up "${NUM_CONTAINERS}" & pid=$!
|
||||
(sleep "${timeout_launch}" && kill -HUP "${pid}") 2>/dev/null & pid_tout=$!
|
||||
|
||||
if wait "${pid}" 2>/dev/null; then
|
||||
pkill -HUP -P "${pid_tout}"
|
||||
wait "${pid_tout}"
|
||||
else
|
||||
warn "Time out exceeded"
|
||||
return 1
|
||||
fi
|
||||
check_containers_are_running "${NUM_CONTAINERS}"
|
||||
|
||||
# Get the initial number of pids in a single container before the workload starts
|
||||
INITIAL_NUM_PIDS=$(sudo -E "${CTR_EXE}" t metrics "${containers[-1]}" | grep pids.current | grep pids.current | xargs | cut -d ' ' -f 2)
|
||||
|
Loading…
Reference in New Issue
Block a user