From 79177bb9cb652aa4097128e95e47a73e68f7fcf0 Mon Sep 17 00:00:00 2001 From: Gabriela Cervantes Date: Fri, 10 Nov 2023 20:32:29 +0000 Subject: [PATCH 1/3] tests: Enable stressng scalability test This PR enables the stressng scalability test for kata CI. Fixes #8420 Signed-off-by: Gabriela Cervantes --- tests/stability/gha-run.sh | 3 +++ tests/stability/stressng.sh | 1 + 2 files changed, 4 insertions(+) diff --git a/tests/stability/gha-run.sh b/tests/stability/gha-run.sh index 50561de33e..42b002c425 100755 --- a/tests/stability/gha-run.sh +++ b/tests/stability/gha-run.sh @@ -40,6 +40,9 @@ function run() { export ITERATIONS=2 MAX_CONTAINERS=20 bash "${stability_dir}/soak_parallel_rm.sh" + info "Running stressng scability test using ${KATA_HYPERVISOR} hypervisor" + bash "${stability_dir}/stressng.sh" + info "Running scability test using ${KATA_HYPERVISOR} hypervisor" bash "${stability_dir}/scability_test.sh" 15 60 diff --git a/tests/stability/stressng.sh b/tests/stability/stressng.sh index 9f95b8c68f..9d234d104e 100755 --- a/tests/stability/stressng.sh +++ b/tests/stability/stressng.sh @@ -5,6 +5,7 @@ # SPDX-License-Identifier: Apache-2.0 set -o pipefail +set -x # General env SCRIPT_PATH=$(dirname "$(readlink -f "$0")") From 4b7854b6689023d38c691080b5d67dc27b5658cf Mon Sep 17 00:00:00 2001 From: Gabriela Cervantes Date: Mon, 13 Nov 2023 15:34:08 +0000 Subject: [PATCH 2/3] stability: Add missing dependencies This PR adds missing dependencies to run stability tests. Signed-off-by: Gabriela Cervantes --- tests/stability/gha-run.sh | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/tests/stability/gha-run.sh b/tests/stability/gha-run.sh index 42b002c425..abebe4f5ac 100755 --- a/tests/stability/gha-run.sh +++ b/tests/stability/gha-run.sh @@ -18,6 +18,8 @@ function install_dependencies() { declare -a system_deps=( jq + curl + gnupg ) sudo apt-get update @@ -25,13 +27,22 @@ function install_dependencies() { ensure_yq - declare -a github_deps - github_deps[0]="cri_containerd:$(get_from_kata_deps "externals.containerd.${CONTAINERD_VERSION}")" + # Add Docker's official GPG key: + sudo apt-get update + sudo apt-get -y install ca-certificates + sudo install -m 0755 -d /etc/apt/keyrings + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg + sudo chmod a+r /etc/apt/keyrings/docker.gpg + + # Add the repository to Apt sources: + echo \ + "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ + "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ + sudo tee /etc/apt/sources.list.d/docker.list > /dev/null + sudo apt-get update + + sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin - for github_dep in "${github_deps[@]}"; do - IFS=":" read -r -a dep <<< "${github_dep}" - install_${dep[0]} "${dep[1]}" - done } function run() { From 9cc6908b0920a5812d740d9f28d4dfb3a52667ef Mon Sep 17 00:00:00 2001 From: Gabriela Cervantes Date: Mon, 13 Nov 2023 17:40:13 +0000 Subject: [PATCH 3/3] stability: Update stressng to run on the gha This PR updates the stressng test to run on the gha for kata CI. Signed-off-by: Gabriela Cervantes --- tests/stability/gha-run.sh | 18 +----------------- tests/stability/stressng.sh | 13 +------------ 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/tests/stability/gha-run.sh b/tests/stability/gha-run.sh index abebe4f5ac..23e495e444 100755 --- a/tests/stability/gha-run.sh +++ b/tests/stability/gha-run.sh @@ -26,23 +26,7 @@ function install_dependencies() { sudo apt-get -y install "${system_deps[@]}" ensure_yq - - # Add Docker's official GPG key: - sudo apt-get update - sudo apt-get -y install ca-certificates - sudo install -m 0755 -d /etc/apt/keyrings - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg - sudo chmod a+r /etc/apt/keyrings/docker.gpg - - # Add the repository to Apt sources: - echo \ - "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ - "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ - sudo tee /etc/apt/sources.list.d/docker.list > /dev/null - sudo apt-get update - - sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin - + install_docker } function run() { diff --git a/tests/stability/stressng.sh b/tests/stability/stressng.sh index 9d234d104e..cfd7ac71fc 100755 --- a/tests/stability/stressng.sh +++ b/tests/stability/stressng.sh @@ -5,7 +5,6 @@ # SPDX-License-Identifier: Apache-2.0 set -o pipefail -set -x # General env SCRIPT_PATH=$(dirname "$(readlink -f "$0")") @@ -34,16 +33,6 @@ function main() { MEMORY_CMD="stress-ng --cpu 2 --vm 4 -t 5m" sudo -E ctr t exec --exec-id "$(random_name)" "${CONTAINER_NAME}" sh -c "${MEMORY_CMD}" - # Run shared memory stressors - info "Running 8 shared memory stressors" - SHARED_CMD="stress-ng --shm 0" - sudo -E ctr t exec --exec-id "$(random_name)" "${CONTAINER_NAME}" sh -c "${SHARED_CMD}" - - # Run all stressors one by one on all CPUs - info "Running all stressors one by one" - STRESSORS_CMD="stress-ng --seq 0 -t 10 --tz -v" - sudo -E ctr t exec --exec-id "$(random_name)" "${CONTAINER_NAME}" sh -c "${STRESSORS_CMD}" - # Test floating point on CPU for 60 seconds info "Running floating tests on CPU" FLOAT_CMD="stress-ng --matrix 1 -t 1m" @@ -51,7 +40,7 @@ function main() { # Runs two instances of the CPU stressors, one instance of the matrix info "Running instances of the CPU stressors" - INSTANCE_CMD='stress-ng --cpu 2 --matrix 1 --mq 3 -t 5m' + INSTANCE_CMD='stress-ng --cpu 2 --matrix 1 --mq 3 -t 3m' sudo -E ctr t exec --exec-id "$(random_name)" "${CONTAINER_NAME}" sh -c "${INSTANCE_CMD}" clean_env_ctr