Extract host-guest benchmark CI script

This commit is contained in:
Yuke Peng 2024-09-26 15:48:51 +08:00 committed by Tate, Hongliang Tian
parent 5564adee74
commit 0620ec58e4
2 changed files with 11 additions and 3 deletions

View File

@ -84,7 +84,7 @@ run_benchmark() {
;; ;;
"host_guest") "host_guest")
echo "Running benchmark ${benchmark} on host and guest..." echo "Running benchmark ${benchmark} on host and guest..."
bash "${BENCHMARK_DIR}/${benchmark_root}/bench_runner.sh" \ bash "${BENCHMARK_DIR}/common/host_guest_bench_runner.sh" \
"${BENCHMARK_DIR}/${benchmark}" \ "${BENCHMARK_DIR}/${benchmark}" \
"${asterinas_cmd}" \ "${asterinas_cmd}" \
"${linux_cmd}" \ "${linux_cmd}" \

View File

@ -14,8 +14,16 @@ LINUX_OUTPUT=$5
BENCHMARK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)/../" BENCHMARK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)/../"
source "${BENCHMARK_DIR}/common/prepare_host.sh" source "${BENCHMARK_DIR}/common/prepare_host.sh"
# Persist iperf3 port if [[ "$BENCHMARK_PATH" =~ "iperf" ]]; then
export IPERF_PORT=5201 # Persist Iperf port
export IPERF_PORT=5201
elif [[ "$BENCHMARK_PATH" =~ "nginx" ]]; then
# Persist Nginx port
export NGINX_PORT=8080
elif [[ "$BENCHMARK_PATH" =~ "redis" ]]; then
# Persist Redis port
export REDIS_PORT=6379
fi
# Function to run the benchmark # Function to run the benchmark
# Parameters: # Parameters: