mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-28 16:27:50 +00:00
metrics: Use check containers are up in tensorflow script
This PR uses the check containers are up from the common script in the tensorflow script. Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
This commit is contained in:
parent
1c84680d8c
commit
9d57a1fab4
@ -150,17 +150,6 @@ EOF
|
|||||||
metrics_json_end_array "Results"
|
metrics_json_end_array "Results"
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_containers_are_up() {
|
|
||||||
local containers_launched=0
|
|
||||||
for i in $(seq "${TIMEOUT}") ; do
|
|
||||||
info "Verify that the containers are running"
|
|
||||||
containers_launched="$(sudo ${CTR_EXE} t list | grep -c "RUNNING")"
|
|
||||||
[ "${containers_launched}" -eq "${NUM_CONTAINERS}" ] && break
|
|
||||||
sleep 1
|
|
||||||
[ "${i}" == "${TIMEOUT}" ] && return 1
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
# Verify enough arguments
|
# Verify enough arguments
|
||||||
if [ "$#" -lt 2 ]; then
|
if [ "$#" -lt 2 ]; then
|
||||||
@ -195,11 +184,11 @@ function main() {
|
|||||||
metrics_json_start_array
|
metrics_json_start_array
|
||||||
|
|
||||||
# Check that the requested number of containers are running
|
# Check that the requested number of containers are running
|
||||||
check_containers_are_up
|
check_containers_are_up "${NUM_CONTAINERS}"
|
||||||
|
|
||||||
# Check that the requested number of containers are running
|
# Check that the requested number of containers are running
|
||||||
local timeout_launch="10"
|
local timeout_launch="10"
|
||||||
check_containers_are_up & pid=$!
|
check_containers_are_up "${NUM_CONTAINERS}" & pid=$!
|
||||||
(sleep "${timeout_launch}" && kill -HUP "${pid}") 2>/dev/null & pid_tout=$!
|
(sleep "${timeout_launch}" && kill -HUP "${pid}") 2>/dev/null & pid_tout=$!
|
||||||
|
|
||||||
if wait "${pid}" 2>/dev/null; then
|
if wait "${pid}" 2>/dev/null; then
|
||||||
|
Loading…
Reference in New Issue
Block a user