metrics: Enable kata runtime in K8s for FIO test.

This PR configures the corresponding kata runtime in K8s
based on the tested hypervisor.

This PR also enables FIO metrics test in the kata metrics-ci.

Fixes: #7665

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
This commit is contained in:
David Esparza 2023-08-16 16:30:24 -06:00
parent c358056a3f
commit fb571f8be9
No known key found for this signature in database
GPG Key ID: EABE0B1A98CC3B7A
6 changed files with 51 additions and 12 deletions

View File

@ -87,10 +87,8 @@ function run_test_tensorflow() {
function run_test_fio() { function run_test_fio() {
info "Running FIO test using ${KATA_HYPERVISOR} hypervisor" info "Running FIO test using ${KATA_HYPERVISOR} hypervisor"
# ToDo: remove the exit once the metrics workflow is stable
exit 0
bash storage/fio-k8s/fio-test-ci.sh bash tests/metrics/storage/fio-k8s/fio-test-ci.sh
} }
function run_test_iperf() { function run_test_iperf() {

View File

@ -24,5 +24,8 @@ test: build
run: build run: build
make -C $(MKFILE_DIR)/scripts/dax-compare-test/ run make -C $(MKFILE_DIR)/scripts/dax-compare-test/ run
test-ci: build test-qemu: build
make -C $(MKFILE_DIR)/cmd/fiotest/ runci make -C $(MKFILE_DIR)/cmd/fiotest/ run-qemu
test-clh: build
make -C $(MKFILE_DIR)/cmd/fiotest/ run-clh

View File

@ -20,5 +20,8 @@ gomod:
go mod edit -replace=github.com/kata-containers/kata-containers/tests/metrics/env=../../pkg/env go mod edit -replace=github.com/kata-containers/kata-containers/tests/metrics/env=../../pkg/env
go mod tidy go mod tidy
runci: build run-qemu: build
$(MKFILE_DIR)/fio-k8s --debug --fio.size 10M --output-dir test-results --test-name kata $(MKFILE_DIR)/../../configs/example-config/ $(MKFILE_DIR)/fio-k8s --debug --fio.size 10M --output-dir test-results --test-name kata --container-runtime kata-qemu $(MKFILE_DIR)/../../configs/example-config/
run-clh: build
$(MKFILE_DIR)/fio-k8s --debug --fio.size 10M --output-dir test-results --test-name kata --container-runtime kata-clh $(MKFILE_DIR)/../../configs/example-config/

View File

@ -0,0 +1,17 @@
## Copyright (c) 2021 Intel Corporation
#
## SPDX-License-Identifier: Apache-2.0
#
apiVersion: v1
kind: Pod
metadata:
name: iometrics
spec:
runtimeClassName: kata-clh
containers:
- args:
- sleep
- infinity
image: ubuntu:latest
name: iometrics
imagePullPolicy: Always

View File

@ -0,0 +1,17 @@
## Copyright (c) 2021 Intel Corporation
#
## SPDX-License-Identifier: Apache-2.0
#
apiVersion: v1
kind: Pod
metadata:
name: iometrics
spec:
runtimeClassName: kata-qemu
containers:
- args:
- sleep
- infinity
image: ubuntu:latest
name: iometrics
imagePullPolicy: Always

View File

@ -18,11 +18,12 @@ function main() {
check_processes check_processes
init_env init_env
export KUBECONFIG="$HOME/.kube/config"
pushd "${FIO_PATH}" pushd "${FIO_PATH}"
echo "INFO: Running K8S FIO test" [ -z "${KATA_HYPERVISOR}" ] && die "Hypervisor ID is missing."
make test-ci [ "${KATA_HYPERVISOR}" != "qemu" ] && [ "${KATA_HYPERVISOR}" != "clh" ] && die "Hypervisor not recognized: ${KATA_HYPERVISOR}"
echo "INFO: Running K8S FIO test using ${KATA_HYPERVISOR} hypervisor"
make "test-${KATA_HYPERVISOR}"
popd popd
test_result_file="${FIO_PATH}/cmd/fiotest/test-results/kata/randrw-sync.job/output.json" test_result_file="${FIO_PATH}/cmd/fiotest/test-results/kata/randrw-sync.job/output.json"
@ -30,7 +31,7 @@ function main() {
metrics_json_init metrics_json_init
local read_io=$(cat $test_result_file | grep io_bytes | head -1 | sed 's/[[:blank:]]//g' | cut -f2 -d ':' | cut -f1 -d ',') local read_io=$(cat $test_result_file | grep io_bytes | head -1 | sed 's/[[:blank:]]//g' | cut -f2 -d ':' | cut -f1 -d ',')
local read_bw=$(cat $test_result_file | grep bw_bytes | head -1 | sed 's/[[:blank:]]//g' | cut -f2 -d ':' | cut -f1 -d ',') local read_bw=$(cat $test_result_file | grep bw_bytes | head -1 | sed 's/[[:blank:]]//g' | cut -f2 -d ':' | cut -f1 -d ',')
local read_90_percentile=$(cat $test_result_file | grep 90.000000 | head -1 | sed 's/[[:blank:]]//g' | cut -f2 -d ':' | cut -f1 -d ',') local read_90_percentile=$(cat $test_result_file | grep 90.000000 | head -1 | sed 's/[[:blank:]]//g' | cut -f2 -d ':' | cut -f1 -d ',')
local read_95_percentile=$(cat $test_result_file | grep 95.000000 | head -1 | sed 's/[[:blank:]]//g' | cut -f2 -d ':' | cut -f1 -d ',') local read_95_percentile=$(cat $test_result_file | grep 95.000000 | head -1 | sed 's/[[:blank:]]//g' | cut -f2 -d ':' | cut -f1 -d ',')
local write_io=$(cat $test_result_file | grep io_bytes | head -2 | tail -1 | sed 's/[[:blank:]]//g' | cut -f2 -d ':' | cut -f1 -d ',') local write_io=$(cat $test_result_file | grep io_bytes | head -2 | tail -1 | sed 's/[[:blank:]]//g' | cut -f2 -d ':' | cut -f1 -d ',')
local write_bw=$(cat $test_result_file | grep bw_bytes | head -2 | tail -1 | sed 's/[[:blank:]]//g' | cut -f2 -d ':' | cut -f1 -d ',') local write_bw=$(cat $test_result_file | grep bw_bytes | head -2 | tail -1 | sed 's/[[:blank:]]//g' | cut -f2 -d ':' | cut -f1 -d ',')