mirror of
				https://github.com/kata-containers/kata-containers.git
				synced 2025-10-30 08:52:39 +00:00 
			
		
		
		
	metrics: Enable launch tests time metrics
This PR enables the launch tests metrics for kata CI. Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
This commit is contained in:
		| @@ -5,7 +5,7 @@ | |||||||
| # This file contains baseline expectations | # This file contains baseline expectations | ||||||
| # for checked results by checkmetrics tool. | # for checked results by checkmetrics tool. | ||||||
| # | # | ||||||
| # values set specifically for packet.com c1.small worker. | # values set specifically for Equinix m3.small.x86. | ||||||
|  |  | ||||||
| [[metric]] | [[metric]] | ||||||
| name = "boot-times" | name = "boot-times" | ||||||
|   | |||||||
| @@ -8,7 +8,6 @@ | |||||||
| set -o errexit | set -o errexit | ||||||
| set -o nounset | set -o nounset | ||||||
| set -o pipefail | set -o pipefail | ||||||
| set -x |  | ||||||
|  |  | ||||||
| kata_tarball_dir="${2:-kata-artifacts}" | kata_tarball_dir="${2:-kata-artifacts}" | ||||||
| metrics_dir="$(dirname "$(readlink -f "$0")")" | metrics_dir="$(dirname "$(readlink -f "$0")")" | ||||||
| @@ -49,8 +48,6 @@ EOF | |||||||
| } | } | ||||||
|  |  | ||||||
| function install_kata() { | function install_kata() { | ||||||
| 	# ToDo: remove the exit once the metrics workflow is stable |  | ||||||
| 	exit 0 |  | ||||||
| 	local kata_tarball="kata-static.tar.xz" | 	local kata_tarball="kata-static.tar.xz" | ||||||
| 	declare -r katadir="/opt/kata" | 	declare -r katadir="/opt/kata" | ||||||
| 	declare -r destdir="/" | 	declare -r destdir="/" | ||||||
| @@ -70,6 +67,15 @@ function install_kata() { | |||||||
|  |  | ||||||
| 	check_containerd_config_for_kata | 	check_containerd_config_for_kata | ||||||
| 	restart_containerd_service | 	restart_containerd_service | ||||||
|  | 	install_checkmetrics | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function install_checkmetrics() { | ||||||
|  | 	# Ensure we have the latest checkmetrics | ||||||
|  | 	pushd "${checkmetrics_dir}" | ||||||
|  | 	make | ||||||
|  | 	sudo make install | ||||||
|  | 	popd | ||||||
| } | } | ||||||
|  |  | ||||||
| function check_containerd_config_for_kata() { | function check_containerd_config_for_kata() { | ||||||
| @@ -90,26 +96,17 @@ function check_containerd_config_for_kata() { | |||||||
|  |  | ||||||
| function check_metrics() { | function check_metrics() { | ||||||
| 	KATA_HYPERVISOR="${1}" | 	KATA_HYPERVISOR="${1}" | ||||||
| 	# Ensure we have the latest checkemtrics |  | ||||||
| 	pushd "${checkmetrics_dir}" |  | ||||||
| 	make |  | ||||||
| 	sudo make install |  | ||||||
| 	popd |  | ||||||
|  |  | ||||||
| 	local cm_base_file="${checkmetrics_config_dir}/checkmetrics-json-${KATA_HYPERVISOR}-kata-metric8.toml" | 	local cm_base_file="${checkmetrics_config_dir}/checkmetrics-json-${KATA_HYPERVISOR}-kata-metric8.toml" | ||||||
| 	checkmetrics --debug --percentage --basefile "${cm_base_file}" --metricsdir "${results_dir}" | 	checkmetrics --debug --percentage --basefile "${cm_base_file}" --metricsdir "${results_dir}" | ||||||
| 	cm_result=$? | 	cm_result=$? | ||||||
| 	if [ "${cm_result}" != 0 ]; then | 	if [ "${cm_result}" != 0 ]; then | ||||||
| 		info "run-metrics-ci: checkmetrics FAILED (${cm_result})" | 		die "run-metrics-ci: checkmetrics FAILED (${cm_result})" | ||||||
| 		exit "${cm_result}" |  | ||||||
| 	fi | 	fi | ||||||
| } | } | ||||||
|  |  | ||||||
| function run_test_launchtimes() { | function run_test_launchtimes() { | ||||||
| 	info "Running Launch Time test using ${KATA_HYPERVISOR} hypervisor" | 	info "Running Launch Time test using ${KATA_HYPERVISOR} hypervisor" | ||||||
|  |  | ||||||
| 	# ToDo: remove the exit once the metrics workflow is stable |  | ||||||
| 	exit 0 |  | ||||||
| 	create_symbolic_links | 	create_symbolic_links | ||||||
| 	bash tests/metrics/time/launch_times.sh -i public.ecr.aws/ubuntu/ubuntu:latest -n 20 | 	bash tests/metrics/time/launch_times.sh -i public.ecr.aws/ubuntu/ubuntu:latest -n 20 | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user