Skip to content

Commit

Permalink
ci: Enable Iperf bench
Browse files Browse the repository at this point in the history
Iperf runs on top of a K8s setup, for instance ci metrics
needs to clean the k8s setup, before start the test.

Fixes: kata-containers#4205

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
  • Loading branch information
dborquez committed Feb 15, 2022
1 parent 20f2700 commit 588b43c
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 18 deletions.
29 changes: 16 additions & 13 deletions .ci/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -359,26 +359,29 @@ gen_clean_arch() {
delete_containerd_cri_stale_resource
fi

# reset k8s service may impact metrics test on x86_64
[ $(uname -m) != "x86_64" -a "$(pgrep kubelet)" != "" ] && sudo sh -c 'kubeadm reset -f'
info "Remove installed kubernetes packages and configuration"
if [ "$ID" == ubuntu ]; then
sudo rm -rf /etc/systemd/system/kubelet.service.d
sudo systemctl daemon-reload
sudo apt-get autoremove -y kubeadm kubelet kubectl
fi

# Remove existing k8s related configurations and binaries.
sudo sh -c 'rm -rf /opt/cni/bin/*'
sudo sh -c 'rm -rf /etc/cni /etc/kubernetes/'
sudo sh -c 'rm -rf /var/lib/cni /var/lib/etcd /var/lib/kubelet'
sudo sh -c 'rm -rf /run/flannel'

if [[ $CI_JOB != "METRICS" ]]; then
#reset k8s service may impact metrics test on x86_64, so limit it to arm64
[ $(uname -m) == "aarch64" -a "$(pgrep kubelet)" != "" ] && sudo sh -c 'kubeadm reset -f'
info "Remove installed kubernetes packages and configuration"
if [ "$ID" == ubuntu ]; then
sudo rm -rf /etc/systemd/system/kubelet.service.d
sudo apt-get autoremove -y kubeadm kubelet kubectl \
$(dpkg -l | awk '{print $2}' | grep -E '^(containerd(.\io)?|docker(\.io|-ce(-cli)?))$')
sudo apt-get autoremove -y $(dpkg -l | awk '{print $2}' | grep -E '^(containerd(.\io)?|docker(\.io|-ce(-cli)?))$')
fi
# Remove existing k8s related configurations and binaries.
sudo sh -c 'rm -rf /opt/cni/bin/*'
sudo sh -c 'rm -rf /etc/cni /etc/kubernetes/'
sudo sh -c 'rm -rf /var/lib/cni /var/lib/etcd /var/lib/kubelet'
sudo sh -c 'rm -rf /run/flannel'

info "Clean up stale network interface"
cleanup_network_interface
fi

if [[ $CI_JOB != "METRICS" ]]; then
info "Remove Kata package repo registrations"
delete_kata_repo_registrations
fi
Expand Down
6 changes: 1 addition & 5 deletions .ci/run_metrics_PR_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ run() {
# Run the memory footprint test - the main test that
# KSM affects.
bash density/memory_usage.sh 20 300 auto

# And now ensure KSM is turned off for the rest of the tests
disable_ksm
fi
fi

Expand All @@ -64,9 +61,8 @@ run() {
# Run the time tests
bash time/launch_times.sh -i public.ecr.aws/ubuntu/ubuntu:latest -n 20

# Skip: Issue: https://github.com/kata-containers/tests/issues/3203
# Run the cpu statistics test
# bash network/cpu_statistics_iperf.sh
bash network/iperf3_kubernetes/k8s-network-metrics-iperf3.sh -b

popd
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,16 @@ checktype = "mean"
midval = 55700.0
minpercent = 10.0
maxpercent = 10.0

[[metric]]
name = "network-iperf3-bandwidth"
type = "json"
description = "measure container bandwidth using iperf3"
# Min and Max values to set a 'range' that
# the median of the CSV Results data must fall
# within (inclusive)
checkvar = ".\"network-iperf3-bandwidth\".Results | .[] | .bandwidth.Result"
checktype = "mean"
midval = 30811123135.60
minpercent = 10.0
maxpercent = 10.0
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,16 @@ checktype = "mean"
midval = 4139564.0
minpercent = 5.0
maxpercent = 5.0

[[metric]]
name = "network-iperf3-bandwidth"
type = "json"
description = "measure container bandwidth using iperf3"
# Min and Max values to set a 'range' that
# the median of the CSV Results data must fall
# within (inclusive)
checkvar = ".\"network-iperf3-bandwidth\".Results | .[] | .bandwidth.Result"
checktype = "mean"
midval = 30811123135.60
minpercent = 10.0
maxpercent = 10.0
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ EOF
}

function main() {
init_env

local OPTIND
while getopts ":abcjh:" opt
do
Expand Down

0 comments on commit 588b43c

Please sign in to comment.