From 7e81ab35d75ba742cd1a632a8b2901248140d046 Mon Sep 17 00:00:00 2001 From: Soumya Sinha <96619748+sousinha97@users.noreply.github.com> Date: Thu, 25 Jul 2024 09:40:30 +0000 Subject: [PATCH 01/20] phoronix suite commits --- phoronix/phoronix | 75 ++++++++ phoronix/run_phoronix.sh | 368 +++++++++++++++++---------------------- 2 files changed, 234 insertions(+), 209 deletions(-) create mode 100644 phoronix/phoronix diff --git a/phoronix/phoronix b/phoronix/phoronix new file mode 100644 index 0000000..f816a8e --- /dev/null +++ b/phoronix/phoronix @@ -0,0 +1,75 @@ +#!/bin/bash + +if [ $# -eq 0 ]; then + usage; +fi + +while [ $# -gt 0 ] +do + case $1 in + -h) + usage; + ;; + -t) + test_to_run=$2 + shift 2 + ;; + *) + usage; + ;; + esac +done + +# +# If no test to run designated, bail. +# +if [ $test_to_run == "none" ]; then + echo You need to designate a test to run. + usage +fi + + +if [ ! -d "./phoronix-test-suite" ]; then + git clone -b $GIT_VERSION --single-branch --depth 1 https://github.com/phoronix-test-suite/phoronix-test-suite + fi + echo 1 | ./phoronix-test-suite/phoronix-test-suite install $test_to_run + echo $test_index > /tmp/ph_opts + echo n >> /tmp/ph_opts + + # + # Run phoronix test + # + if [[ -f /tmp/results_${test_name}_${to_tuned_setting}.out ]]; then + rm /tmp/results_${test_name}_${to_tuned_setting}.out + fi + for iterations in 1 `seq 2 1 ${to_times_to_run}` + do + ./phoronix-test-suite/phoronix-test-suite run $test_to_run < /tmp/ph_opts >> /tmp/results_${test_name}_${to_tuned_setting}.out + done + # + # Archive up the results. + # + cd /tmp + RESULTSDIR=results_${test_name}_${to_tuned_setting}$(date "+%Y.%m.%d-%H.%M.%S") + mkdir -p ${RESULTSDIR}/${test_name}_results/results_phoronix + if [[ -f results_${test_name}_${to_tuned_setting} ]]; then + rm results_${test_name}_${to_tuned_setting} + fi + ln -s ${RESULTSDIR} results_${test_name}_${to_tuned_setting} + + cp results_${test_name}_*.out results_${test_name}_${to_tuned_setting}/phoronix_results/results_phoronix + ${curdir}/test_tools/move_data $curdir results_${test_name}_${to_tuned_setting}/phoronix_results/results_phoronix + cp /tmp/results_${test_name}_${to_tuned_setting}.out results_${test_name}_${to_tuned_setting}/phoronix_results/results_phoronix + pushd /tmp/results_${test_name}_${to_tuned_setting}/phoronix_results/results_phoronix > /dev/null + $run_dir/reduce_phoronix > results.csv + lines=`wc -l results.csv | cut -d' ' -f 1` + if [[ $lines == "1" ]]; then + echo Failed >> test_results_report + else + echo Ran >> test_results_report + fi + popd > /dev/null + find -L results_${test_name}_${to_tuned_setting} -type f | tar --transform 's/.*\///g' -cf results_pbench.tar --files-from=/dev/stdin + tar hcf results_${test_name}_${to_tuned_setting}.tar results_${test_name}_${to_tuned_setting} +fi +exit 0 \ No newline at end of file diff --git a/phoronix/run_phoronix.sh b/phoronix/run_phoronix.sh index d046834..2d54c1f 100755 --- a/phoronix/run_phoronix.sh +++ b/phoronix/run_phoronix.sh @@ -1,150 +1,94 @@ #!/bin/bash -# -# Copyright (C) 2022 David Valin dvalin@redhat.com -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -test_index="Test All Options" arguments="$@" -error_out() -{ - echo $1 - exit $2 - -} - -usage() -{ - echo "Usage:" - echo " --test_index: test index to run. Default is $test_index" - echo " --tools_git: Location to pick up the required tools git, default" - echo " https://github.com/redhat-performance/test_tools-wrappers" - echo " --usage: this usage message" - source test_tools/general_setup --usage -} - curdir=`pwd` if [[ $0 == "./"* ]]; then - chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'` - if [[ $chars == 1 ]]; then - run_dir=`pwd` - else - run_dir=`echo $0 | cut -d'/' -f 1-${chars} | cut -d'.' -f2-` - run_dir="${curdir}${run_dir}" - fi + chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'` + if [[ $chars == 1 ]]; then + run_dir=`pwd` + else + run_dir=`echo $0 | cut -d'/' -f 1-${chars} | cut -d'.' -f2-` + run_dir="${curdir}${run_dir}" + fi elif [[ $0 != "/"* ]]; then - dir=`echo $0 | rev | cut -d'/' -f2- | rev` - run_dir="${curdir}/${dir}" + dir=`echo $0 | rev | cut -d'/' -f2- | rev` + run_dir="${curdir}/${dir}" else - chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'` - run_dir=`echo $0 | cut -d'/' -f 1-${chars}` - if [[ $run_dir != "/"* ]]; then - run_dir=${curdir}/${run_dir} - fi + chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'` + run_dir=`echo $0 | cut -d'/' -f 1-${chars}` + if [[ $run_dir != "/"* ]]; then + run_dir=${curdir}/${run_dir} + fi fi + test_name="phoronix" GIT_VERSION="v10.8.1" if [ ! -f "/tmp/${test_name}.out" ]; then - command="${0} $@" - echo $command - $command &> /tmp/${test_name}.out - rtc=$? - if [[ -f /tmp/${test_name}.out ]]; then - cat /tmp/${test_name}.out - rm /tmp/${test_name}.out - fi - exit $rtc + command="${0} $@" + echo $command + $command &> /tmp/${test_name}.out + rtc=$? + if [[ -f /tmp/${test_name}.out ]]; then + cat /tmp/${test_name}.out + rm /tmp/${test_name}.out + fi + exit $rtc fi + # # Get the directory we are running out of. # tools_git=https://github.com/redhat-performance/test_tools-wrappers +usage() +{ + echo "Usage:" + echo " --test_index: test index to run. Default is $test_index" + echo " --tools_git: Location to pick up the required tools git, default" + echo " https://github.com/redhat-performance/test_tools-wrappers" + echo " --usage: this usage message" + echo " -t: test to run" + source test_tools/general_setup --usage +} + +error_out() +{ + echo $1 + exit $2 + +} # # Clone the repo that contains the common code and tools # -show_usage=0 found=0 +show_usage=0 for arg in "$@"; do - if [ $found -eq 1 ]; then - tools_git=$arg - break; - fi - if [[ $arg == "--tools_git" ]]; then - found=1 - fi - - # - # We do the usage check here, as we do not want to be calling - # the common parsers then checking for usage here. Doing so will - # result in the script exiting with out giving the test options. - # - if [[ $arg == "--usage" ]]; then - show_usage=1 - fi + if [ $found -eq 1 ]; then + tools_git=$arg + break; + fi + if [[ $arg == "--tools_git" ]]; then + found=1 + fi + if [[ $arg == "--usage" ]]; then + show_usage=1 + fi done -# -# Check to see if the test tools directory exists. If it does, we do not need to -# clone the repo. -# if [ ! -d "test_tools" ]; then git clone $tools_git test_tools if [ $? -ne 0 ]; then - error_out "Error pulling git $tools_git" 1 + echo pulling git $tools_git failed. + exit fi -else - echo Found an existing test_tools directory, using it. fi if [ $show_usage -eq 1 ]; then - usage $0 -fi - -test_tools/package_tool --update -test_tools/package_tool --packages php73-cli.x86_64,php73-common.x86_64,php73-xml.x86_64 -if [[ $? != "0" ]]; then - # - # Check to see if we need to remove the old php - # - test_tools/package_tool --is_installed php-cli.x86_64 - if [ $? -eq 0 ]; then - packages="php-cli.x86_64 php-common.x86_64 php-xml.x86_64" - # - # Remove and add the proper php - # - test_tools/package_tool --remove_packages $packages - if [ $? -ne 0 ]; then - error_out "Failed to remove $packages" 1 - fi - fi - test_tools/package_tool --packages php73-cli.x86_64,php73-common.x86_64,php73-xml.x86_64 - if [ $? -ne 0 ]; then - # - # Just to be difficult Amazon 2 uses even different packages. - # - test_tools/package_tool --packages git,php-cli,php-xml,php-json - if [ $? -ne 0 ]; then - error_out "Failed to install $packages" 1 - fi - fi + usage $0 fi # Variables set by general setup. @@ -165,16 +109,45 @@ fi ${curdir}/test_tools/gather_data ${curdir} source test_tools/general_setup "$@" +test_tools/package_tool --update +test_tools/package_tool --packages php73-cli.x86_64,php73-common.x86_64,php73-xml.x86_64 +if [[ $? != "0" ]]; then + # + # Check to see if we need to remove the old php + # + test_tools/package_tool --is_installed php-cli.x86_64 + if [ $? -eq 0 ]; then + packages="php-cli.x86_64 php-common.x86_64 php-xml.x86_64" + # + # Remove and add the proper php + # + test_tools/package_tool --remove_packages $packages + if [ $? -ne 0 ]; then + error_out "Failed to remove $packages" 1 + fi + fi + test_tools/package_tool --packages php73-cli.x86_64,php73-common.x86_64,php73-xml.x86_64 + if [ $? -ne 0 ]; then + # + # Just to be difficult Amazon 2 uses even different packages. + # + test_tools/package_tool --packages git,php-cli,php-xml,php-json + if [ $? -ne 0 ]; then + error_out "Failed to install $packages" 1 + fi + fi +fi + + ARGUMENT_LIST=( - "test_index" + "test_index" + "sub_test" ) NO_ARGUMENTS=( - "usage" + "usage" ) - -# read arguments opts=$(getopt \ --longoptions "$(printf "%s:," "${ARGUMENT_LIST[@]}")" \ --longoptions "$(printf "%s," "${NO_ARGUMENTS[@]}")" \ @@ -183,105 +156,82 @@ opts=$(getopt \ -- "$@" ) -# Report any errors -# if [ $? -ne 0 ]; then - error_out "Error with option parsing" 1 - exit + echo "Error with option parsing" + exit 1 fi -eval set --$opts - -while [[ $# -gt 0 ]]; do - case "$1" in - --test_index) - test_index=$2 - shift 2 - ;; - -h) - usage - ;; - --usage) - usage - exit - ;; - --) - break; - ;; - *) - echo option not found $1 - usage - exit - ;; - esac +eval set -- "$opts" + +while true; do + case "$1" in + --test_index) + test_index=$2 + shift 2 + ;; + --sub_test) + test=$2 + shift 2 + ;; + -h|--help) + usage + exit + ;; + --usage) + usage + exit + ;; + --) + shift + break + ;; + *) + echo "Unknown option: $1" + usage + exit 1 + ;; + esac done +if [[ $test == "none" ]]; then + echo You must designate a test + usage $0 +fi + +echo $to_pbench +echo $to_user if [ $to_pbench -eq 1 ]; then - source ~/.bashrc - move_back=0 - move_this=`ls /var/lib/pbench-agent/tools-*-default/*/perf` - if [ $? -eq 0 ]; then - move_back=1 - mv $move_this /tmp/perf - fi - echo $TOOLS_BIN/execute_via_pbench --cmd_executing "$0" $arguments --test $test_name --spacing 11 --pbench_stats $to_pstats - $TOOLS_BIN/execute_via_pbench --cmd_executing "$0" $arguments --test $test_name --spacing 11 --pbench_stats $to_pstats - if [ $move_back -eq 1 ]; then - mv /tmp/perf $move_this - fi + source ~/.bashrc + move_back=0 + move_this=`ls /var/lib/pbench-agent/tools-*-default/*/perf` + if [ $? -eq 0 ]; then + move_back=1 + mv $move_this /tmp/perf + fi + echo $TOOLS_BIN/execute_via_pbench --cmd_executing "$0" $arguments --test ${test_name}_${test} --spacing 11 --pbench_stats $to_pstats + $TOOLS_BIN/execute_via_pbench --cmd_executing "$0" $arguments --test ${test_name}_${test} --spacing 11 --pbench_stats $to_pstats + if [ $move_back -eq 1 ]; then + mv /tmp/perf $move_this + fi else - if [ $to_user == "ubuntu" ]; then - DEBIAN_FRONTEND=noninteractive apt-get install -y -q php-cli - DEBIAN_FRONTEND=noninteractive apt-get install -y -q php-xml - fi - cd $run_dir - # - # phoronix run parameters. - # - # Right now we only support stress-ng - # - if [ ! -d "./phoronix-test-suite" ]; then - git clone -b $GIT_VERSION --single-branch --depth 1 https://github.com/phoronix-test-suite/phoronix-test-suite - fi - echo 1 | ./phoronix-test-suite/phoronix-test-suite install stress-ng - echo $test_index > /tmp/ph_opts - echo n >> /tmp/ph_opts - - # - # Run phoronix test - # - if [[ -f /tmp/results_${test_name}_${to_tuned_setting}.out ]]; then - rm /tmp/results_${test_name}_${to_tuned_setting}.out - fi - for iterations in 1 `seq 2 1 ${to_times_to_run}` - do - ./phoronix-test-suite/phoronix-test-suite run stress-ng < /tmp/ph_opts >> /tmp/results_${test_name}_${to_tuned_setting}.out - done - # - # Archive up the results. - # - cd /tmp - RESULTSDIR=results_${test_name}_${to_tuned_setting}$(date "+%Y.%m.%d-%H.%M.%S") - mkdir -p ${RESULTSDIR}/${test_name}_results/results_phoronix - if [[ -f results_${test_name}_${to_tuned_setting} ]]; then - rm results_${test_name}_${to_tuned_setting} - fi - ln -s ${RESULTSDIR} results_${test_name}_${to_tuned_setting} + if [ $to_user == "ubuntu" ]; then + DEBIAN_FRONTEND=noninteractive apt-get install -y -q php-cli + DEBIAN_FRONTEND=noninteractive apt-get install -y -q php-xml + fi + cd $run_dir + # + # phoronix run parameters. + # + # Right now we only support stress-ng + # + if [[ $to_tuned_setting != "none" ]]; then + tuned_original=`tuned-adm active | cut -d' ' -f4` + tuned-adm profile $to_tuned_setting + fi + echo ./phoronix -t ${test} > run_this + chmod 755 run_this + ./run_this - cp results_${test_name}_*.out results_${test_name}_${to_tuned_setting}/phoronix_results/results_phoronix - ${curdir}/test_tools/move_data $curdir results_${test_name}_${to_tuned_setting}/phoronix_results/results_phoronix - cp /tmp/results_${test_name}_${to_tuned_setting}.out results_${test_name}_${to_tuned_setting}/phoronix_results/results_phoronix - pushd /tmp/results_${test_name}_${to_tuned_setting}/phoronix_results/results_phoronix > /dev/null - $run_dir/reduce_phoronix > results.csv - lines=`wc -l results.csv | cut -d' ' -f 1` - if [[ $lines == "1" ]]; then - echo Failed >> test_results_report - else - echo Ran >> test_results_report - fi - popd > /dev/null - find -L results_${test_name}_${to_tuned_setting} -type f | tar --transform 's/.*\///g' -cf results_pbench.tar --files-from=/dev/stdin - tar hcf results_${test_name}_${to_tuned_setting}.tar results_${test_name}_${to_tuned_setting} -fi -exit 0 + setenforce 1 +fi \ No newline at end of file From 0346e5087aad684665f65653eaf9d5d26ac146c4 Mon Sep 17 00:00:00 2001 From: Soumya Sinha <96619748+sousinha97@users.noreply.github.com> Date: Mon, 29 Jul 2024 03:45:13 +0000 Subject: [PATCH 02/20] test index --- phoronix/phoronix | 6 +++++- phoronix/run_phoronix.sh | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/phoronix/phoronix b/phoronix/phoronix index f816a8e..02715b7 100644 --- a/phoronix/phoronix +++ b/phoronix/phoronix @@ -14,6 +14,10 @@ do test_to_run=$2 shift 2 ;; + --test_index) + test_index=$2 + shift 2 + ;; *) usage; ;; @@ -44,7 +48,7 @@ if [ ! -d "./phoronix-test-suite" ]; then fi for iterations in 1 `seq 2 1 ${to_times_to_run}` do - ./phoronix-test-suite/phoronix-test-suite run $test_to_run < /tmp/ph_opts >> /tmp/results_${test_name}_${to_tuned_setting}.out + ./phoronix-test-suite/phoronix-test-suite default-run $test_to_run < /tmp/ph_opts >> /tmp/results_${test_name}_${to_tuned_setting}.out done # # Archive up the results. diff --git a/phoronix/run_phoronix.sh b/phoronix/run_phoronix.sh index 2d54c1f..8f7f1e6 100755 --- a/phoronix/run_phoronix.sh +++ b/phoronix/run_phoronix.sh @@ -229,9 +229,9 @@ else tuned_original=`tuned-adm active | cut -d' ' -f4` tuned-adm profile $to_tuned_setting fi - echo ./phoronix -t ${test} > run_this - chmod 755 run_this - ./run_this + echo ./phoronix -t ${test} --test_index ${test_index} > run_this + chmod 755 run_this + ./run_this setenforce 1 fi \ No newline at end of file From 05fbe658af10e139ac49d8fc758ef911bf903c2a Mon Sep 17 00:00:00 2001 From: Soumya Sinha <96619748+sousinha97@users.noreply.github.com> Date: Thu, 1 Aug 2024 14:15:54 +0530 Subject: [PATCH 03/20] Add files via upload --- reduce_phoronix | 18 ++++ run_phoronix.sh | 262 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 280 insertions(+) create mode 100644 reduce_phoronix create mode 100644 run_phoronix.sh diff --git a/reduce_phoronix b/reduce_phoronix new file mode 100644 index 0000000..81ade84 --- /dev/null +++ b/reduce_phoronix @@ -0,0 +1,18 @@ +#!/bin/bash +echo "reduce*****************************************" +egrep 'Test: |Average' results_phoronix_*.out | grep -v stress > tmpfile +echo "Test:BOPs" +toggle=0 +while IFS= read -r line +do + if [ $toggle -eq 0 ]; then + out=`echo $line | cut -d':' -f2 | sed "s/^ //g" | sed "s/\[1\;34m//g"` + printf "%s:" "$out" + toggle=1 + else + out=`echo $line | cut -d':' -f 2 | cut -d' ' -f 2 | sed "s/\[1\;34m//g"` + printf "%s\n" $out + toggle=0 + fi +done < "tmpfile" +rm tmpfile \ No newline at end of file diff --git a/run_phoronix.sh b/run_phoronix.sh new file mode 100644 index 0000000..f43d2f1 --- /dev/null +++ b/run_phoronix.sh @@ -0,0 +1,262 @@ +#!/bin/bash +arguments="$@" + +test_name="phoronix" +GIT_VERSION="v10.8.1" +curdir=`pwd` +if [[ $0 == "./"* ]]; then + chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'` + if [[ $chars == 1 ]]; then + run_dir=`pwd` + else + run_dir=`echo $0 | cut -d'/' -f 1-${chars} | cut -d'.' -f2-` + run_dir="${curdir}${run_dir}" + fi +elif [[ $0 != "/"* ]]; then + dir=`echo $0 | rev | cut -d'/' -f2- | rev` + run_dir="${curdir}/${dir}" +else + chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'` + run_dir=`echo $0 | cut -d'/' -f 1-${chars}` + if [[ $run_dir != "/"* ]]; then + run_dir=${curdir}/${run_dir} + fi +fi + + +if [ ! -f "/tmp/${test_name}.out" ]; then + command="${0} $@" + echo $command + $command &> /tmp/${test_name}.out + rtc=$? + if [[ -f /tmp/${test_name}.out ]]; then + cat /tmp/${test_name}.out + rm /tmp/${test_name}.out + fi + exit $rtc +fi + +tools_git=https://github.com/redhat-performance/test_tools-wrappers + +usage() +{ + echo "Usage:" + echo " --test_index: test index to run. Default is $test_index" + echo " --tools_git: Location to pick up the required tools git, default" + echo " https://github.com/redhat-performance/test_tools-wrappers" + echo " --usage: this usage message" + echo " -t: test to run" + source test_tools/general_setup --usage +} + +error_out() +{ + echo $1 + exit $2 + +} + +# +# Clone the repo that contains the common code and tools +# +found=0 +show_usage=0 +for arg in "$@"; do + if [ $found -eq 1 ]; then + tools_git=$arg + break; + fi + if [[ $arg == "--tools_git" ]]; then + found=1 + fi + if [[ $arg == "--usage" ]]; then + usage $0 + fi +done + +# +# Check to see if the test tools directory exists. If it does, we do not need to +# clone the repo. +# +if [ ! -d "test_tools" ]; then + git clone $tools_git + if [ $? -ne 0 ]; then + echo pulling git $tools_git failed. + exit + fi +fi + +if [ $show_usage -eq 1 ]; then + usage $0 +fi + + +# Variables set by general setup. +# +# TOOLS_BIN: points to the tool directory +# to_home_root: home directory +# to_configuration: configuration information +# to_times_to_run: number of times to run the test +# to_pbench: Run the test via pbench +# to_puser: User running pbench +# to_run_label: Label for the run +# to_user: User on the test system running the test +# to_sys_type: for results info, basically aws, azure or local +# to_sysname: name of the system +# to_tuned_setting: tuned setting +# +${curdir}/test_tools/gather_data ${curdir} +source test_tools/general_setup "$@" +test = "none" + +test_tools/package_tool --update +test_tools/package_tool --packages php73-cli.x86_64,php73-common.x86_64,php73-xml.x86_64 +if [[ $? != "0" ]]; then + # + # Check to see if we need to remove the old php + # + test_tools/package_tool --is_installed php-cli.x86_64 + if [ $? -eq 0 ]; then + packages="php-cli.x86_64 php-common.x86_64 php-xml.x86_64" + # + # Remove and add the proper php + # + test_tools/package_tool --remove_packages $packages + if [ $? -ne 0 ]; then + error_out "Failed to remove $packages" 1 + fi + fi + test_tools/package_tool --packages php73-cli.x86_64,php73-common.x86_64,php73-xml.x86_64 + if [ $? -ne 0 ]; then + # + # Just to be difficult Amazon 2 uses even different packages. + # + test_tools/package_tool --packages git,php-cli,php-xml,php-json + if [ $? -ne 0 ]; then + error_out "Failed to install $packages" 1 + fi + fi +fi + + +ARGUMENT_LIST=( + "test_index" + "sub_test" +) + +NO_ARGUMENTS=( + "usage" +) + +# read arguments +opts=$(getopt \ + --longoptions "$(printf "%s:," "${ARGUMENT_LIST[@]}")" \ + --longoptions "$(printf "%s," "${NO_ARGUMENTS[@]}")" \ + --name "$(basename "$0")" \ + --options "h" \ + -- "$@" +) + +if [ $? -ne 0 ]; then + echo "Error with option parsing" + exit 1 +fi + +eval set --$opts + +while true; do + case "$1" in + --test_index) + test_index=$2 + shift 2 + ;; + --sub_test) + test=$2 + shift 2 + ;; + -h|--help) + usage + exit + ;; + --usage) + usage + exit + ;; + --) + shift + break + ;; + *) + echo "Unknown option: $1" + usage + exit 1 + ;; + esac +done + +if [[ $test == "none" ]]; then + echo You must designate a test + usage $0 +fi + + +if [ $to_pbench -eq 1 ]; then + source ~/.bashrc + move_back=0 + move_this=`ls /var/lib/pbench-agent/tools-*-default/*/perf` + if [ $? -eq 0 ]; then + move_back=1 + mv $move_this /tmp/perf + fi + echo $TOOLS_BIN/execute_via_pbench --cmd_executing "$0" $arguments --test ${test_name}_${test} --spacing 11 --pbench_stats $to_pstats + $TOOLS_BIN/execute_via_pbench --cmd_executing "$0" $arguments --test ${test_name}_${test} --spacing 11 --pbench_stats $to_pstats + if [ $move_back -eq 1 ]; then + mv /tmp/perf $move_this + fi + exit +fi +if [ $to_user == "ubuntu" ]; then + DEBIAN_FRONTEND=noninteractive apt-get install -y -q php-cli + DEBIAN_FRONTEND=noninteractive apt-get install -y -q php-xml +fi + +cd $run_dir +if [[ $to_tuned_setting != "none" ]]; then + tuned_original=`tuned-adm active | cut -d' ' -f4` + tuned-adm profile $to_tuned_setting +fi + +if [ ! -d i"./phoronix-test-suite" ]; then + git clone -b $GIT_VERSION --single-branch --depth 1 https://github.com/phoronix-test-suite/phoronix-test-suite +fi +echo 1 | ./phoronix-test-suite/phoronix-test-suite install $test + +echo 22 > /tmp/ph_opts +echo n >> /tmp/ph_opts + +# +# Run phoronix test +# + +if [[ -f /tmp/results_${test_name}_${test}_${to_tuned_setting}.out ]]; then + rm /tmp/results_${test_name}_${test}_${to_tuned_setting}.out +fi + +for iterations in 1 `seq 2 1 ${to_times_to_run}` +do + ./phoronix-test-suite/phoronix-test-suite default-run $test < /tmp/ph_opts >> /tmp/results_${test_name}_${test}_${to_tuned_setting}.out +done +# +# Archive up the results. +# +cd /tmp +RESULTSDIR=results_${test_name}_${test}_${to_tuned_setting}$(date "+%Y.%m.%d-%H.%M.%S") +mkdir -p ${RESULTSDIR}/${test_name}_${test}_results/results_phoronix +rm results_${test_name}_${test}_${to_tuned_setting} +ln -s ${RESULTSDIR} results_${test_name}_${test}_${to_tuned_setting} + +cp results_${test_name}_${test}_*.out results_${test_name}_${test}_${to_tuned_setting}/phoronix_results/results_phoronix +pushd /tmp/results_${test_name}_${test}_${to_tuned_setting}/phoronix_results/results_phoronix +$run_dir/reduce_phoronix > results_phoronix_${test}.csv +popd +tar hcf results_${test_name}_${test}_${to_tuned_setting}.tar results_${test_name}_${test}_${to_tuned_setting} From 02a40e4e2cba92175d230046e0b78fef0d470f4d Mon Sep 17 00:00:00 2001 From: sousinha1997 Date: Mon, 7 Oct 2024 07:54:22 +0530 Subject: [PATCH 04/20] PTS --- phoronix/run_phoronix.sh | 365 ++++++++++++++++++++++----------------- 1 file changed, 208 insertions(+), 157 deletions(-) diff --git a/phoronix/run_phoronix.sh b/phoronix/run_phoronix.sh index 8f7f1e6..893b0c5 100755 --- a/phoronix/run_phoronix.sh +++ b/phoronix/run_phoronix.sh @@ -1,94 +1,127 @@ #!/bin/bash +# +# Copyright (C) 2022 David Valin dvalin@redhat.com +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +test_name="phoronix" +GIT_VERSION="v10.8.1" +test_index="Test All Options" +rtc=0 arguments="$@" +# +# Get the directory we are running out of. +# curdir=`pwd` if [[ $0 == "./"* ]]; then - chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'` - if [[ $chars == 1 ]]; then - run_dir=`pwd` - else - run_dir=`echo $0 | cut -d'/' -f 1-${chars} | cut -d'.' -f2-` - run_dir="${curdir}${run_dir}" - fi + chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'` + if [[ $chars == 1 ]]; then + run_dir=`pwd` + else + run_dir=`echo $0 | cut -d'/' -f 1-${chars} | cut -d'.' -f2-` + run_dir="${curdir}${run_dir}" + fi elif [[ $0 != "/"* ]]; then - dir=`echo $0 | rev | cut -d'/' -f2- | rev` - run_dir="${curdir}/${dir}" + dir=`echo $0 | rev | cut -d'/' -f2- | rev` + run_dir="${curdir}/${dir}" else - chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'` - run_dir=`echo $0 | cut -d'/' -f 1-${chars}` - if [[ $run_dir != "/"* ]]; then - run_dir=${curdir}/${run_dir} - fi + chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'` + run_dir=`echo $0 | cut -d'/' -f 1-${chars}` + if [[ $run_dir != "/"* ]]; then + run_dir=${curdir}/${run_dir} + fi fi -test_name="phoronix" -GIT_VERSION="v10.8.1" if [ ! -f "/tmp/${test_name}.out" ]; then - command="${0} $@" - echo $command - $command &> /tmp/${test_name}.out - rtc=$? - if [[ -f /tmp/${test_name}.out ]]; then - cat /tmp/${test_name}.out - rm /tmp/${test_name}.out - fi - exit $rtc + command="${0} $@" + echo $command + $command &> /tmp/${test_name}.out + rtc=$? + if [[ -f /tmp/${test_name}.out ]]; then + cat /tmp/${test_name}.out + rm /tmp/${test_name}.out + fi + exit $rtc fi - # -# Get the directory we are running out of. +# Clone the repo that contains the common code and tools # tools_git=https://github.com/redhat-performance/test_tools-wrappers -usage() -{ - echo "Usage:" - echo " --test_index: test index to run. Default is $test_index" - echo " --tools_git: Location to pick up the required tools git, default" - echo " https://github.com/redhat-performance/test_tools-wrappers" - echo " --usage: this usage message" - echo " -t: test to run" - source test_tools/general_setup --usage -} error_out() { - echo $1 - exit $2 + echo $1 + exit $2 } -# -# Clone the repo that contains the common code and tools -# -found=0 +usage() +{ + echo " Usage:" + echo " --test_index: test index to run. Default is $test_index" + echo " --sub_test test running: Test we are to run. Supported tests are" + echo " cockroach, cassandra, couchdb and hbase" + echo " --tools_git: Location to pick up the required tools git, default" + echo " https://github.com/redhat-performance/test_tools-wrappers" + echo " --usage: this usage message" + test_tools/general_setup --usage + exit +} + show_usage=0 +found=0 for arg in "$@"; do - if [ $found -eq 1 ]; then - tools_git=$arg - break; - fi - if [[ $arg == "--tools_git" ]]; then - found=1 - fi - if [[ $arg == "--usage" ]]; then - show_usage=1 - fi + if [ $found -eq 1 ]; then + tools_git=$arg + break; + fi + if [[ $arg == "--tools_git" ]]; then + found=1 + fi + + # + # We do the usage check here, as we do not want to be calling + # the common parsers then checking for usage here. Doing so will + # result in the script exiting with out giving the test options. + # + if [[ $arg == "--usage" ]]; then + show_usage=1 + fi done +# +# Check to see if the test tools directory exists. If it does, we do not need to +# clone the repo. +# if [ ! -d "test_tools" ]; then git clone $tools_git test_tools if [ $? -ne 0 ]; then - echo pulling git $tools_git failed. + error_out "Error pulling git $tools_git" 1 exit fi +else + echo Found an existing test_tools directory, using it. fi if [ $show_usage -eq 1 ]; then - usage $0 + usage $0 fi # Variables set by general setup. @@ -109,45 +142,17 @@ fi ${curdir}/test_tools/gather_data ${curdir} source test_tools/general_setup "$@" -test_tools/package_tool --update -test_tools/package_tool --packages php73-cli.x86_64,php73-common.x86_64,php73-xml.x86_64 -if [[ $? != "0" ]]; then - # - # Check to see if we need to remove the old php - # - test_tools/package_tool --is_installed php-cli.x86_64 - if [ $? -eq 0 ]; then - packages="php-cli.x86_64 php-common.x86_64 php-xml.x86_64" - # - # Remove and add the proper php - # - test_tools/package_tool --remove_packages $packages - if [ $? -ne 0 ]; then - error_out "Failed to remove $packages" 1 - fi - fi - test_tools/package_tool --packages php73-cli.x86_64,php73-common.x86_64,php73-xml.x86_64 - if [ $? -ne 0 ]; then - # - # Just to be difficult Amazon 2 uses even different packages. - # - test_tools/package_tool --packages git,php-cli,php-xml,php-json - if [ $? -ne 0 ]; then - error_out "Failed to install $packages" 1 - fi - fi -fi - - ARGUMENT_LIST=( - "test_index" - "sub_test" + "test_index" + "sub_test" ) NO_ARGUMENTS=( - "usage" + "usage" ) + +# read arguments opts=$(getopt \ --longoptions "$(printf "%s:," "${ARGUMENT_LIST[@]}")" \ --longoptions "$(printf "%s," "${NO_ARGUMENTS[@]}")" \ @@ -156,82 +161,128 @@ opts=$(getopt \ -- "$@" ) +# Report any errors +# if [ $? -ne 0 ]; then - echo "Error with option parsing" - exit 1 + error_out "Error with option parsing" 1 + exit fi -eval set -- "$opts" - -while true; do - case "$1" in - --test_index) - test_index=$2 - shift 2 - ;; - --sub_test) - test=$2 - shift 2 - ;; - -h|--help) - usage - exit - ;; - --usage) - usage - exit - ;; - --) - shift - break - ;; - *) - echo "Unknown option: $1" - usage - exit 1 - ;; - esac +eval set --$opts + +while [[ $# -gt 0 ]]; do + case "$1" in + --test_index) + test_index=$2 + shift 2 + ;; + --sub_test) + sub_test=${2} + shift 2 + ;; + -h) + usage + ;; + --usage) + usage + exit + ;; + --) + break; + ;; + *) + echo option not found $1 + usage + exit + ;; + esac done -if [[ $test == "none" ]]; then - echo You must designate a test - usage $0 +if [[ $sub_test == "none" ]]; then + echo You must designate a test. + usage $0 fi -echo $to_pbench -echo $to_user - if [ $to_pbench -eq 1 ]; then - source ~/.bashrc - move_back=0 - move_this=`ls /var/lib/pbench-agent/tools-*-default/*/perf` - if [ $? -eq 0 ]; then - move_back=1 - mv $move_this /tmp/perf - fi - echo $TOOLS_BIN/execute_via_pbench --cmd_executing "$0" $arguments --test ${test_name}_${test} --spacing 11 --pbench_stats $to_pstats - $TOOLS_BIN/execute_via_pbench --cmd_executing "$0" $arguments --test ${test_name}_${test} --spacing 11 --pbench_stats $to_pstats - if [ $move_back -eq 1 ]; then - mv /tmp/perf $move_this - fi + source ~/.bashrc + move_back=0 + move_this=`ls /var/lib/pbench-agent/tools-*-default/*/perf` + if [ $? -eq 0 ]; then + move_back=1 + mv $move_this /tmp/perf + fi + echo $TOOLS_BIN/execute_via_pbench --cmd_executing "$0" $arguments --test $test_name_sub_test --spacing 11 --pbench_stats $to_pstats + $TOOLS_BIN/execute_via_pbench --cmd_executing "$0" $arguments --test $test_name_sub_test --spacing 11 --pbench_stats $to_pstats + if [ $move_back -eq 1 ]; then + mv /tmp/perf $move_this + fi + exit else - if [ $to_user == "ubuntu" ]; then - DEBIAN_FRONTEND=noninteractive apt-get install -y -q php-cli - DEBIAN_FRONTEND=noninteractive apt-get install -y -q php-xml - fi - cd $run_dir - # - # phoronix run parameters. - # - # Right now we only support stress-ng - # - if [[ $to_tuned_setting != "none" ]]; then - tuned_original=`tuned-adm active | cut -d' ' -f4` - tuned-adm profile $to_tuned_setting - fi - echo ./phoronix -t ${test} --test_index ${test_index} > run_this - chmod 755 run_this - ./run_this + if [ $to_user == "ubuntu" ]; then + DEBIAN_FRONTEND=noninteractive apt-get install -y -q php-cli + DEBIAN_FRONTEND=noninteractive apt-get install -y -q php-xml + fi + cd $run_dir + # + # phoronix run parameters. + # + # Right now we only support stress-ng + # + if [ ! -d "./phoronix-test-suite" ]; then + git clone -b $GIT_VERSION --single-branch --depth 1 https://github.com/phoronix-test-suite/phoronix-test-suite + fi + echo 1 | ./phoronix-test-suite/phoronix-test-suite install ${sub_test} + echo $test_index > /tmp/ph_opts + echo n >> /tmp/ph_opts + + # + # Run phoronix test + # + if [[ -f /tmp/results_${test_name}_${sub_test}_${to_tuned_setting}.out ]]; then + rm /tmp/results_${test_name}_${sub_test}_${to_tuned_setting}.out + fi + for iterations in 1 `seq 2 1 ${to_times_to_run}` + do + ./phoronix-test-suite/phoronix-test-suite run ${sub_test} < /tmp/ph_opts >> /tmp/results_${test_name}_${sub_test}_${to_tuned_setting}.out + done + # + # Archive up the results. + # + results_file=results_phoronix_${sub_test}.csv - setenforce 1 -fi \ No newline at end of file + cd /tmp + RESULTSDIR=results_${test_name}_${sub_test}_${to_tuned_setting}$(date "+%Y.%m.%d-%H.%M.%S") + mkdir -p ${RESULTSDIR}/${test_name}_${sub_test}_results/results_phoronix + if [[ -f results_${test_name}_${sub_test}_${to_tuned_setting} ]]; then + rm results_${test_name}_${sub_test}_${to_tuned_setting} + fi + ln -s ${RESULTSDIR} results_${test_name}_${sub_test}_${to_tuned_setting} + + cp results_${test_name}_${sub_test}_*.out results_${test_name}_${sub_test}_${to_tuned_setting}/phoronix_results/results_phoronix + ${curdir}/test_tools/move_data $curdir results_${test_name}_${sub_test}_${to_tuned_setting}/phoronix_results/results_phoronix + cp /tmp/results_${test_name}_${sub_test}_${to_tuned_setting}.out results_${test_name}_${sub_test}_${to_tuned_setting}/phoronix_results/results_phoronix + pushd /tmp/results_${test_name}_${sub_test}_${to_tuned_setting}/phoronix_results/results_phoronix > /dev/null + $TOOLS_BIN/test_header_info --front_matter --results_file ${results_file} --host $to_configuration --sys_type $to_sys_type --tuned $to_tuned_setting --results_version $GIT_VERSION --test_name phoronix_${sub_test} + # + # We place the results first in results_check.csv so we can check to make sure + # the tests actually ran. After the check, we will add the run info to results.csv. + # + $run_dir/reduce_phoronix > results_check.csv + lines=`wc -l results_check.csv | cut -d' ' -f 1` + if [[ $lines == "1" ]]; then + # + # We failed, report and do not remove the results_check.csv file. + # + echo Failed >> test_results_report + rtc=1 + else + echo Ran >> test_results_report + cat results_check.csv >> ${results_file} + rm results_check.csv + fi + popd > /dev/null + find -L $RESULTSDIR -type f | tar --transform 's/.*\///g' -cf results_pbench.tar --files-from=/dev/stdin + ${curdir}/test_tools/save_results --curdir $curdir --home_root $to_home_root --copy_dir $RESULTSDIR --test_name $test_name --tuned_setting=$to_tuned_setting --version $version none --user $to_user + +fi +exit $rtc From eea2eb3138c3f8b060130d90542913f2e7d7dd93 Mon Sep 17 00:00:00 2001 From: sousinha1997 Date: Mon, 7 Oct 2024 08:28:32 +0530 Subject: [PATCH 05/20] resolve --- phoronix/phoronix | 79 ------------ phoronix/reduce_phoronix | 0 phoronix/run_phoronix.sh | 0 reduce_phoronix | 18 --- run_phoronix.sh | 262 --------------------------------------- 5 files changed, 359 deletions(-) delete mode 100644 phoronix/phoronix mode change 100755 => 100644 phoronix/reduce_phoronix mode change 100755 => 100644 phoronix/run_phoronix.sh delete mode 100644 reduce_phoronix delete mode 100644 run_phoronix.sh diff --git a/phoronix/phoronix b/phoronix/phoronix deleted file mode 100644 index 02715b7..0000000 --- a/phoronix/phoronix +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash - -if [ $# -eq 0 ]; then - usage; -fi - -while [ $# -gt 0 ] -do - case $1 in - -h) - usage; - ;; - -t) - test_to_run=$2 - shift 2 - ;; - --test_index) - test_index=$2 - shift 2 - ;; - *) - usage; - ;; - esac -done - -# -# If no test to run designated, bail. -# -if [ $test_to_run == "none" ]; then - echo You need to designate a test to run. - usage -fi - - -if [ ! -d "./phoronix-test-suite" ]; then - git clone -b $GIT_VERSION --single-branch --depth 1 https://github.com/phoronix-test-suite/phoronix-test-suite - fi - echo 1 | ./phoronix-test-suite/phoronix-test-suite install $test_to_run - echo $test_index > /tmp/ph_opts - echo n >> /tmp/ph_opts - - # - # Run phoronix test - # - if [[ -f /tmp/results_${test_name}_${to_tuned_setting}.out ]]; then - rm /tmp/results_${test_name}_${to_tuned_setting}.out - fi - for iterations in 1 `seq 2 1 ${to_times_to_run}` - do - ./phoronix-test-suite/phoronix-test-suite default-run $test_to_run < /tmp/ph_opts >> /tmp/results_${test_name}_${to_tuned_setting}.out - done - # - # Archive up the results. - # - cd /tmp - RESULTSDIR=results_${test_name}_${to_tuned_setting}$(date "+%Y.%m.%d-%H.%M.%S") - mkdir -p ${RESULTSDIR}/${test_name}_results/results_phoronix - if [[ -f results_${test_name}_${to_tuned_setting} ]]; then - rm results_${test_name}_${to_tuned_setting} - fi - ln -s ${RESULTSDIR} results_${test_name}_${to_tuned_setting} - - cp results_${test_name}_*.out results_${test_name}_${to_tuned_setting}/phoronix_results/results_phoronix - ${curdir}/test_tools/move_data $curdir results_${test_name}_${to_tuned_setting}/phoronix_results/results_phoronix - cp /tmp/results_${test_name}_${to_tuned_setting}.out results_${test_name}_${to_tuned_setting}/phoronix_results/results_phoronix - pushd /tmp/results_${test_name}_${to_tuned_setting}/phoronix_results/results_phoronix > /dev/null - $run_dir/reduce_phoronix > results.csv - lines=`wc -l results.csv | cut -d' ' -f 1` - if [[ $lines == "1" ]]; then - echo Failed >> test_results_report - else - echo Ran >> test_results_report - fi - popd > /dev/null - find -L results_${test_name}_${to_tuned_setting} -type f | tar --transform 's/.*\///g' -cf results_pbench.tar --files-from=/dev/stdin - tar hcf results_${test_name}_${to_tuned_setting}.tar results_${test_name}_${to_tuned_setting} -fi -exit 0 \ No newline at end of file diff --git a/phoronix/reduce_phoronix b/phoronix/reduce_phoronix old mode 100755 new mode 100644 diff --git a/phoronix/run_phoronix.sh b/phoronix/run_phoronix.sh old mode 100755 new mode 100644 diff --git a/reduce_phoronix b/reduce_phoronix deleted file mode 100644 index 81ade84..0000000 --- a/reduce_phoronix +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -echo "reduce*****************************************" -egrep 'Test: |Average' results_phoronix_*.out | grep -v stress > tmpfile -echo "Test:BOPs" -toggle=0 -while IFS= read -r line -do - if [ $toggle -eq 0 ]; then - out=`echo $line | cut -d':' -f2 | sed "s/^ //g" | sed "s/\[1\;34m//g"` - printf "%s:" "$out" - toggle=1 - else - out=`echo $line | cut -d':' -f 2 | cut -d' ' -f 2 | sed "s/\[1\;34m//g"` - printf "%s\n" $out - toggle=0 - fi -done < "tmpfile" -rm tmpfile \ No newline at end of file diff --git a/run_phoronix.sh b/run_phoronix.sh deleted file mode 100644 index f43d2f1..0000000 --- a/run_phoronix.sh +++ /dev/null @@ -1,262 +0,0 @@ -#!/bin/bash -arguments="$@" - -test_name="phoronix" -GIT_VERSION="v10.8.1" -curdir=`pwd` -if [[ $0 == "./"* ]]; then - chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'` - if [[ $chars == 1 ]]; then - run_dir=`pwd` - else - run_dir=`echo $0 | cut -d'/' -f 1-${chars} | cut -d'.' -f2-` - run_dir="${curdir}${run_dir}" - fi -elif [[ $0 != "/"* ]]; then - dir=`echo $0 | rev | cut -d'/' -f2- | rev` - run_dir="${curdir}/${dir}" -else - chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'` - run_dir=`echo $0 | cut -d'/' -f 1-${chars}` - if [[ $run_dir != "/"* ]]; then - run_dir=${curdir}/${run_dir} - fi -fi - - -if [ ! -f "/tmp/${test_name}.out" ]; then - command="${0} $@" - echo $command - $command &> /tmp/${test_name}.out - rtc=$? - if [[ -f /tmp/${test_name}.out ]]; then - cat /tmp/${test_name}.out - rm /tmp/${test_name}.out - fi - exit $rtc -fi - -tools_git=https://github.com/redhat-performance/test_tools-wrappers - -usage() -{ - echo "Usage:" - echo " --test_index: test index to run. Default is $test_index" - echo " --tools_git: Location to pick up the required tools git, default" - echo " https://github.com/redhat-performance/test_tools-wrappers" - echo " --usage: this usage message" - echo " -t: test to run" - source test_tools/general_setup --usage -} - -error_out() -{ - echo $1 - exit $2 - -} - -# -# Clone the repo that contains the common code and tools -# -found=0 -show_usage=0 -for arg in "$@"; do - if [ $found -eq 1 ]; then - tools_git=$arg - break; - fi - if [[ $arg == "--tools_git" ]]; then - found=1 - fi - if [[ $arg == "--usage" ]]; then - usage $0 - fi -done - -# -# Check to see if the test tools directory exists. If it does, we do not need to -# clone the repo. -# -if [ ! -d "test_tools" ]; then - git clone $tools_git - if [ $? -ne 0 ]; then - echo pulling git $tools_git failed. - exit - fi -fi - -if [ $show_usage -eq 1 ]; then - usage $0 -fi - - -# Variables set by general setup. -# -# TOOLS_BIN: points to the tool directory -# to_home_root: home directory -# to_configuration: configuration information -# to_times_to_run: number of times to run the test -# to_pbench: Run the test via pbench -# to_puser: User running pbench -# to_run_label: Label for the run -# to_user: User on the test system running the test -# to_sys_type: for results info, basically aws, azure or local -# to_sysname: name of the system -# to_tuned_setting: tuned setting -# -${curdir}/test_tools/gather_data ${curdir} -source test_tools/general_setup "$@" -test = "none" - -test_tools/package_tool --update -test_tools/package_tool --packages php73-cli.x86_64,php73-common.x86_64,php73-xml.x86_64 -if [[ $? != "0" ]]; then - # - # Check to see if we need to remove the old php - # - test_tools/package_tool --is_installed php-cli.x86_64 - if [ $? -eq 0 ]; then - packages="php-cli.x86_64 php-common.x86_64 php-xml.x86_64" - # - # Remove and add the proper php - # - test_tools/package_tool --remove_packages $packages - if [ $? -ne 0 ]; then - error_out "Failed to remove $packages" 1 - fi - fi - test_tools/package_tool --packages php73-cli.x86_64,php73-common.x86_64,php73-xml.x86_64 - if [ $? -ne 0 ]; then - # - # Just to be difficult Amazon 2 uses even different packages. - # - test_tools/package_tool --packages git,php-cli,php-xml,php-json - if [ $? -ne 0 ]; then - error_out "Failed to install $packages" 1 - fi - fi -fi - - -ARGUMENT_LIST=( - "test_index" - "sub_test" -) - -NO_ARGUMENTS=( - "usage" -) - -# read arguments -opts=$(getopt \ - --longoptions "$(printf "%s:," "${ARGUMENT_LIST[@]}")" \ - --longoptions "$(printf "%s," "${NO_ARGUMENTS[@]}")" \ - --name "$(basename "$0")" \ - --options "h" \ - -- "$@" -) - -if [ $? -ne 0 ]; then - echo "Error with option parsing" - exit 1 -fi - -eval set --$opts - -while true; do - case "$1" in - --test_index) - test_index=$2 - shift 2 - ;; - --sub_test) - test=$2 - shift 2 - ;; - -h|--help) - usage - exit - ;; - --usage) - usage - exit - ;; - --) - shift - break - ;; - *) - echo "Unknown option: $1" - usage - exit 1 - ;; - esac -done - -if [[ $test == "none" ]]; then - echo You must designate a test - usage $0 -fi - - -if [ $to_pbench -eq 1 ]; then - source ~/.bashrc - move_back=0 - move_this=`ls /var/lib/pbench-agent/tools-*-default/*/perf` - if [ $? -eq 0 ]; then - move_back=1 - mv $move_this /tmp/perf - fi - echo $TOOLS_BIN/execute_via_pbench --cmd_executing "$0" $arguments --test ${test_name}_${test} --spacing 11 --pbench_stats $to_pstats - $TOOLS_BIN/execute_via_pbench --cmd_executing "$0" $arguments --test ${test_name}_${test} --spacing 11 --pbench_stats $to_pstats - if [ $move_back -eq 1 ]; then - mv /tmp/perf $move_this - fi - exit -fi -if [ $to_user == "ubuntu" ]; then - DEBIAN_FRONTEND=noninteractive apt-get install -y -q php-cli - DEBIAN_FRONTEND=noninteractive apt-get install -y -q php-xml -fi - -cd $run_dir -if [[ $to_tuned_setting != "none" ]]; then - tuned_original=`tuned-adm active | cut -d' ' -f4` - tuned-adm profile $to_tuned_setting -fi - -if [ ! -d i"./phoronix-test-suite" ]; then - git clone -b $GIT_VERSION --single-branch --depth 1 https://github.com/phoronix-test-suite/phoronix-test-suite -fi -echo 1 | ./phoronix-test-suite/phoronix-test-suite install $test - -echo 22 > /tmp/ph_opts -echo n >> /tmp/ph_opts - -# -# Run phoronix test -# - -if [[ -f /tmp/results_${test_name}_${test}_${to_tuned_setting}.out ]]; then - rm /tmp/results_${test_name}_${test}_${to_tuned_setting}.out -fi - -for iterations in 1 `seq 2 1 ${to_times_to_run}` -do - ./phoronix-test-suite/phoronix-test-suite default-run $test < /tmp/ph_opts >> /tmp/results_${test_name}_${test}_${to_tuned_setting}.out -done -# -# Archive up the results. -# -cd /tmp -RESULTSDIR=results_${test_name}_${test}_${to_tuned_setting}$(date "+%Y.%m.%d-%H.%M.%S") -mkdir -p ${RESULTSDIR}/${test_name}_${test}_results/results_phoronix -rm results_${test_name}_${test}_${to_tuned_setting} -ln -s ${RESULTSDIR} results_${test_name}_${test}_${to_tuned_setting} - -cp results_${test_name}_${test}_*.out results_${test_name}_${test}_${to_tuned_setting}/phoronix_results/results_phoronix -pushd /tmp/results_${test_name}_${test}_${to_tuned_setting}/phoronix_results/results_phoronix -$run_dir/reduce_phoronix > results_phoronix_${test}.csv -popd -tar hcf results_${test_name}_${test}_${to_tuned_setting}.tar results_${test_name}_${test}_${to_tuned_setting} From b0bc1f8076f78b6ddf40331b50a11c4fcc57d668 Mon Sep 17 00:00:00 2001 From: sousinha1997 Date: Mon, 7 Oct 2024 08:50:32 +0530 Subject: [PATCH 06/20] resolve --- phoronix/run_phoronix.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/phoronix/run_phoronix.sh b/phoronix/run_phoronix.sh index 893b0c5..1a89125 100644 --- a/phoronix/run_phoronix.sh +++ b/phoronix/run_phoronix.sh @@ -232,8 +232,13 @@ else git clone -b $GIT_VERSION --single-branch --depth 1 https://github.com/phoronix-test-suite/phoronix-test-suite fi echo 1 | ./phoronix-test-suite/phoronix-test-suite install ${sub_test} - echo $test_index > /tmp/ph_opts - echo n >> /tmp/ph_opts + + if [[ ${sub_test} == "cockroach" ]]; then + echo $test_index > /tmp/ph_opts + echo $test_index > /tmp/ph_opts + echo n >> /tmp/ph_opts + fi + # # Run phoronix test From b5cfc2d48c22f9e959c6ad0223935f8222f3cf5d Mon Sep 17 00:00:00 2001 From: Soumya Sinha <96619748+sousinha97@users.noreply.github.com> Date: Mon, 7 Oct 2024 09:11:37 +0530 Subject: [PATCH 07/20] Update run_phoronix.sh --- phoronix/run_phoronix.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phoronix/run_phoronix.sh b/phoronix/run_phoronix.sh index 1a89125..a925c01 100644 --- a/phoronix/run_phoronix.sh +++ b/phoronix/run_phoronix.sh @@ -235,7 +235,7 @@ else if [[ ${sub_test} == "cockroach" ]]; then echo $test_index > /tmp/ph_opts - echo $test_index > /tmp/ph_opts + echo $test_index >> /tmp/ph_opts echo n >> /tmp/ph_opts fi From 1834d19910edc454de83ca84fcba050b2dad600e Mon Sep 17 00:00:00 2001 From: sousinha1997 Date: Mon, 7 Oct 2024 13:38:46 +0530 Subject: [PATCH 08/20] cockroach retrive result added --- phoronix/reduce_phoronix | 97 +++++++++++++++++++++++++++++++++------- phoronix/run_phoronix.sh | 10 ++--- 2 files changed, 86 insertions(+), 21 deletions(-) diff --git a/phoronix/reduce_phoronix b/phoronix/reduce_phoronix index 5663407..e87a584 100644 --- a/phoronix/reduce_phoronix +++ b/phoronix/reduce_phoronix @@ -1,17 +1,82 @@ #!/bin/bash -egrep 'Test: |Average' results_phoronix_tuned_*.out | grep -v stress > tmpfile -echo "Test:BOPs" -toggle=0 -while IFS= read -r line -do - if [ $toggle -eq 0 ]; then - out=`echo $line | cut -d':' -f2 | sed "s/^ //g" | sed "s/\[1\;34m//g"` - printf "%s:" "$out" - toggle=1 - else - out=`echo $line | cut -d':' -f 2 | cut -d' ' -f 2 | sed "s/\[1\;34m//g"` - printf "%s\n" $out - toggle=0 - fi -done < "tmpfile" -rm tmpfile + +usage() { + echo "HOST NAME or IP REQUIRED!! - see usage below" + echo "Usage:" + echo " ./reduce_phoronix --sub_test " + echo "Options:" + echo " -h Show help" + echo " --sub_test Specify the test to run" + echo " --tmp_file Specify output temp file" + exit 1 +} + +# Check if an argument is passed +if [ $# -eq 0 ]; then + usage +fi + +# Initialize variables +test_running="none" +tmp_file="none" +# Process command line arguments +while [ $# -gt 0 ]; do + case $1 in + -h) + usage + ;; + --sub_test) + test_running=$2 + shift 2 + ;; + --tmp_file) + tmp_file=$2 + shift 2 + ;; + *) + usage + ;; + esac +done + +# Check if a test to run is designated +if [ "$test_running" == "none" ]; then + echo "You need to designate a test to run." + usage +fi +if [ "$tmp_file" == "none" ]; then + echo "You need a file to output to" + usage +fi + +if [[ "$test_running" == "cockroach" ]]; then + echo "Workload:Concurrency:Average:Deviation" > "$tmp_file" + # Read and process the results file + while IFS= read -r line; do + # Check for lines containing workload and concurrency + if [[ $line == *Workload* ]]; then + # Extract Workload and Concurrency + workload=$(echo "$line" | awk -F ': ' '{print $2}' | awk -F ' - ' '{print $1}') + concurrency=$(echo "$line" | awk -F ': ' '{print $3}' | tr -d ':') + fi + + # Check for average + if [[ $line == *Average* ]]; then + # Extract Average + average=$(echo "$line" | awk -F ': ' '{print $2}' | awk '{print $1}') + fi + + # Check for deviation + if [[ $line == *Deviation* ]]; then + # Extract Deviation + deviation=$(echo "$line" | awk -F ': ' '{print $2}' | tr -d '%') + + # Append the extracted information to the output file + echo "$workload:$concurrency:$average:$deviation" >> "$tmp_file" + fi + rm tmp_file + done < /tmp/results_phoronix_"$test_running"_tuned_*.out +else + echo "Unsupported test: $test_running" + exit 1 +fi \ No newline at end of file diff --git a/phoronix/run_phoronix.sh b/phoronix/run_phoronix.sh index 1a89125..b621a0e 100644 --- a/phoronix/run_phoronix.sh +++ b/phoronix/run_phoronix.sh @@ -272,18 +272,18 @@ else # We place the results first in results_check.csv so we can check to make sure # the tests actually ran. After the check, we will add the run info to results.csv. # - $run_dir/reduce_phoronix > results_check.csv - lines=`wc -l results_check.csv | cut -d' ' -f 1` + $run_dir/reduce_phoronix --sub_test {sub_test} --tmp_file results_{sub_test}_check.csv + lines=`wc -l results_{sub_test}_check.csv | cut -d' ' -f 1` if [[ $lines == "1" ]]; then # - # We failed, report and do not remove the results_check.csv file. + # We failed, report and do not remove the results_{sub_test}_check.csv file. # echo Failed >> test_results_report rtc=1 else echo Ran >> test_results_report - cat results_check.csv >> ${results_file} - rm results_check.csv + cat results_{sub_test}_check.csv >> ${results_file} + rm results_{sub_test}_check.csv fi popd > /dev/null find -L $RESULTSDIR -type f | tar --transform 's/.*\///g' -cf results_pbench.tar --files-from=/dev/stdin From ee40aa06505e5b26b4b502cc4ef958bbec1c5e5e Mon Sep 17 00:00:00 2001 From: sousinha1997 Date: Mon, 7 Oct 2024 13:42:17 +0530 Subject: [PATCH 09/20] usage update --- phoronix/reduce_phoronix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/phoronix/reduce_phoronix b/phoronix/reduce_phoronix index e87a584..a439c0f 100644 --- a/phoronix/reduce_phoronix +++ b/phoronix/reduce_phoronix @@ -1,9 +1,8 @@ #!/bin/bash usage() { - echo "HOST NAME or IP REQUIRED!! - see usage below" echo "Usage:" - echo " ./reduce_phoronix --sub_test " + echo " ./reduce_phoronix --sub_test --tmp_name " echo "Options:" echo " -h Show help" echo " --sub_test Specify the test to run" From a0626ff6f597a162601a258c027196792a79defa Mon Sep 17 00:00:00 2001 From: sousinha1997 Date: Mon, 7 Oct 2024 15:59:36 +0530 Subject: [PATCH 10/20] redis push --- phoronix/reduce_phoronix | 29 +++++++++++++++++++++++------ phoronix/run_phoronix.sh | 5 ++++- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/phoronix/reduce_phoronix b/phoronix/reduce_phoronix index a439c0f..61491f6 100644 --- a/phoronix/reduce_phoronix +++ b/phoronix/reduce_phoronix @@ -58,22 +58,39 @@ if [[ "$test_running" == "cockroach" ]]; then workload=$(echo "$line" | awk -F ': ' '{print $2}' | awk -F ' - ' '{print $1}') concurrency=$(echo "$line" | awk -F ': ' '{print $3}' | tr -d ':') fi - - # Check for average if [[ $line == *Average* ]]; then # Extract Average average=$(echo "$line" | awk -F ': ' '{print $2}' | awk '{print $1}') fi - - # Check for deviation if [[ $line == *Deviation* ]]; then # Extract Deviation deviation=$(echo "$line" | awk -F ': ' '{print $2}' | tr -d '%') - # Append the extracted information to the output file echo "$workload:$concurrency:$average:$deviation" >> "$tmp_file" fi - rm tmp_file + rm "$tmp_file" + done < /tmp/results_phoronix_"$test_running"_tuned_*.out +elif [[ "$test_running" == "redis" ]]; then + echo "Test:ParallelConnections:Average:Deviation" > "$tmp_file" + # Read and process the results file + while IFS= read -r line; do + # Check for lines containing Test and Parallel Connections + if [[ $line == *"Test:"* && $line == *"Parallel Connections:"* ]]; then + # Extract Test and Parallel Connections + test=$(echo "$line" | awk -F 'Test: ' '{print $2}' | awk -F ' - ' '{print $1}') + parallel_connections=$(echo "$line" | awk -F ': ' '{print $3}' | tr -d ':') + fi + if [[ $line == *"Average:"* ]]; then + # Extract Average + average=$(echo "$line" | awk -F ': ' '{print $2}' | awk '{print $1}') + fi + if [[ $line == *"Deviation:"* ]]; then + # Extract Deviation + deviation=$(echo "$line" | awk -F ': ' '{print $2}' | tr -d '%') + # Append the extracted information to the output file + echo "$test:$parallel_connections:$average:$deviation" >> "$tmp_file" + fi + rm "$tmp_file" done < /tmp/results_phoronix_"$test_running"_tuned_*.out else echo "Unsupported test: $test_running" diff --git a/phoronix/run_phoronix.sh b/phoronix/run_phoronix.sh index c28872b..910611f 100644 --- a/phoronix/run_phoronix.sh +++ b/phoronix/run_phoronix.sh @@ -233,10 +233,13 @@ else fi echo 1 | ./phoronix-test-suite/phoronix-test-suite install ${sub_test} - if [[ ${sub_test} == "cockroach" ]]; then + if [[ ${sub_test} == "cockroach" || ${sub_test} == "redis" ]]; then echo $test_index > /tmp/ph_opts echo $test_index >> /tmp/ph_opts echo n >> /tmp/ph_opts + else + echo "Unsupported test: ${sub_test}" + exit 1 fi From 67890dd9c058f1ab4b049e5c5e275a79b827884a Mon Sep 17 00:00:00 2001 From: sousinha1997 Date: Thu, 12 Dec 2024 17:19:13 +0530 Subject: [PATCH 11/20] review push _ stress-ng addition --- phoronix/reduce_phoronix | 119 ++++++++++++++++++++++++--------------- phoronix/run_phoronix.sh | 30 +++++++++- 2 files changed, 100 insertions(+), 49 deletions(-) diff --git a/phoronix/reduce_phoronix b/phoronix/reduce_phoronix index 61491f6..6937c0d 100644 --- a/phoronix/reduce_phoronix +++ b/phoronix/reduce_phoronix @@ -2,53 +2,15 @@ usage() { echo "Usage:" - echo " ./reduce_phoronix --sub_test --tmp_name " + echo " ./reduce_phoronix --sub_test --tmp_name " echo "Options:" echo " -h Show help" - echo " --sub_test Specify the test to run" + echo " --sub_test Specify the test data to reduce" echo " --tmp_file Specify output temp file" exit 1 } -# Check if an argument is passed -if [ $# -eq 0 ]; then - usage -fi - -# Initialize variables -test_running="none" -tmp_file="none" -# Process command line arguments -while [ $# -gt 0 ]; do - case $1 in - -h) - usage - ;; - --sub_test) - test_running=$2 - shift 2 - ;; - --tmp_file) - tmp_file=$2 - shift 2 - ;; - *) - usage - ;; - esac -done - -# Check if a test to run is designated -if [ "$test_running" == "none" ]; then - echo "You need to designate a test to run." - usage -fi -if [ "$tmp_file" == "none" ]; then - echo "You need a file to output to" - usage -fi - -if [[ "$test_running" == "cockroach" ]]; then +reduce_cockroach() { echo "Workload:Concurrency:Average:Deviation" > "$tmp_file" # Read and process the results file while IFS= read -r line; do @@ -69,8 +31,10 @@ if [[ "$test_running" == "cockroach" ]]; then echo "$workload:$concurrency:$average:$deviation" >> "$tmp_file" fi rm "$tmp_file" - done < /tmp/results_phoronix_"$test_running"_tuned_*.out -elif [[ "$test_running" == "redis" ]]; then + done < /tmp/results_phoronix_"$test_ran"_tuned_*.out +} + +reduce_redis() { echo "Test:ParallelConnections:Average:Deviation" > "$tmp_file" # Read and process the results file while IFS= read -r line; do @@ -91,8 +55,71 @@ elif [[ "$test_running" == "redis" ]]; then echo "$test:$parallel_connections:$average:$deviation" >> "$tmp_file" fi rm "$tmp_file" - done < /tmp/results_phoronix_"$test_running"_tuned_*.out + done < /tmp/results_phoronix_"$test_ran"_tuned_*.out +} + +reduce_stress_ng() { + egrep 'Test: |Average' results_phoronix_*.out | grep -v stress > tmpfile + echo "Test:BOPs" + toggle=0 + while IFS= read -r line + do + if [ $toggle -eq 0 ]; then + out=`echo $line | cut -d':' -f2 | sed "s/^ //g" | sed "s/\[1\;34m//g"` + printf "%s:" "$out" + toggle=1 + else + out=`echo $line | cut -d':' -f 2 | cut -d' ' -f 2 | sed "s/\[1\;34m//g"` + printf "%s\n" $out + toggle=0 + fi + done < "tmpfile" + rm tmpfile +} +# Check if an argument is passed +if [ $# -eq 0 ]; then + usage +fi + +# Initialize variables +test_ran="none" +tmp_file="none" +# Process command line arguments +while [ $# -gt 0 ]; do + case $1 in + -h) + usage + ;; + --sub_test) + test_ran=$2 + shift 2 + ;; + --tmp_file) + tmp_file=$2 + shift 2 + ;; + *) + usage + ;; + esac +done + +# Check if a test data to reduce is designated +if [ "$test_ran" == "none" ]; then + echo "You need to designate a test to reduce." + usage +fi +if [ "$tmp_file" == "none" ]; then + echo "You need a file to output to" + usage +fi + +if [[ "$test_ran" == "cockroach" ]]; then + reduce_cockroach +elif [[ "$test_ran" == "redis" ]]; then + reduce_redis +elif [[ "$test_ran" == "stress-ng"]]; then + reduce_stress_ng else - echo "Unsupported test: $test_running" - exit 1 + echo "Unsupported test: $test_ran fi \ No newline at end of file diff --git a/phoronix/run_phoronix.sh b/phoronix/run_phoronix.sh index 910611f..ca6d266 100644 --- a/phoronix/run_phoronix.sh +++ b/phoronix/run_phoronix.sh @@ -82,7 +82,7 @@ usage() echo " https://github.com/redhat-performance/test_tools-wrappers" echo " --usage: this usage message" test_tools/general_setup --usage - exit + exit 1 } show_usage=0 @@ -165,7 +165,6 @@ opts=$(getopt \ # if [ $? -ne 0 ]; then error_out "Error with option parsing" 1 - exit fi eval set --$opts @@ -233,10 +232,35 @@ else fi echo 1 | ./phoronix-test-suite/phoronix-test-suite install ${sub_test} - if [[ ${sub_test} == "cockroach" || ${sub_test} == "redis" ]]; then + if [[ ${sub_test} == "cockroach" ]]; then + echo $test_index > /tmp/ph_opts + echo $test_index >> /tmp/ph_opts + echo n >> /tmp/ph_opts + elif [[ ${sub_test} == "redis" ]]; then echo $test_index > /tmp/ph_opts echo $test_index >> /tmp/ph_opts echo n >> /tmp/ph_opts + elif [[ ${sub_test} == "stress-ng" ]]; then + echo $test_index > /tmp/ph_opts + echo n >> /tmp/ph_opts + elif [[ ${sub_test} == "phpbench" ]]; then + echo n > /tmp/ph_opts + elif [[ ${sub_test} == "cassandra" ]]; then + echo n > /tmp/ph_opts + elif [[ ${sub_test} == "apache" ]]; then + echo $test_index >> /tmp/ph_opts + echo n >> /tmp/ph_opts + elif [[ ${sub_test} == "apache-iotdb" ]]; then + echo $test_index >> /tmp/ph_opts + echo $test_index >> /tmp/ph_opts + echo $test_index >> /tmp/ph_opts + echo $test_index >> /tmp/ph_opts + echo n >> /tmp/ph_opts + elif [[ ${sub_test} == "hbase" ]]; then + echo $test_index >> /tmp/ph_opts + echo $test_index >> /tmp/ph_opts + echo $test_index >> /tmp/ph_opts + echo n >> /tmp/ph_opts else echo "Unsupported test: ${sub_test}" exit 1 From f51bf4f92345229c341a7f42962870a856e78e55 Mon Sep 17 00:00:00 2001 From: sousinha1997 Date: Thu, 12 Dec 2024 18:24:39 +0530 Subject: [PATCH 12/20] refactor --- phoronix/reduce_phoronix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/phoronix/reduce_phoronix b/phoronix/reduce_phoronix index 6937c0d..f026674 100644 --- a/phoronix/reduce_phoronix +++ b/phoronix/reduce_phoronix @@ -10,6 +10,10 @@ usage() { exit 1 } +# Initialize variables +test_ran="none" +tmp_file="none" + reduce_cockroach() { echo "Workload:Concurrency:Average:Deviation" > "$tmp_file" # Read and process the results file @@ -81,9 +85,7 @@ if [ $# -eq 0 ]; then usage fi -# Initialize variables -test_ran="none" -tmp_file="none" + # Process command line arguments while [ $# -gt 0 ]; do case $1 in @@ -121,5 +123,6 @@ elif [[ "$test_ran" == "redis" ]]; then elif [[ "$test_ran" == "stress-ng"]]; then reduce_stress_ng else - echo "Unsupported test: $test_ran + echo "Unsupported test: $test_ran" + exit 1 fi \ No newline at end of file From 4d65241f36abcdfea9c12bf8c72b56df19e0d257 Mon Sep 17 00:00:00 2001 From: Soumya Sinha <96619748+sousinha97@users.noreply.github.com> Date: Thu, 12 Dec 2024 18:44:43 +0530 Subject: [PATCH 13/20] Update run_phoronix.sh --- phoronix/run_phoronix.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phoronix/run_phoronix.sh b/phoronix/run_phoronix.sh index ca6d266..cd1835c 100644 --- a/phoronix/run_phoronix.sh +++ b/phoronix/run_phoronix.sh @@ -248,16 +248,16 @@ else elif [[ ${sub_test} == "cassandra" ]]; then echo n > /tmp/ph_opts elif [[ ${sub_test} == "apache" ]]; then - echo $test_index >> /tmp/ph_opts + echo $test_index > /tmp/ph_opts echo n >> /tmp/ph_opts elif [[ ${sub_test} == "apache-iotdb" ]]; then - echo $test_index >> /tmp/ph_opts + echo $test_index > /tmp/ph_opts echo $test_index >> /tmp/ph_opts echo $test_index >> /tmp/ph_opts echo $test_index >> /tmp/ph_opts echo n >> /tmp/ph_opts elif [[ ${sub_test} == "hbase" ]]; then - echo $test_index >> /tmp/ph_opts + echo $test_index > /tmp/ph_opts echo $test_index >> /tmp/ph_opts echo $test_index >> /tmp/ph_opts echo n >> /tmp/ph_opts From fe771457f7e3fcde4c1d9154192f758a860b4218 Mon Sep 17 00:00:00 2001 From: sousinha1997 Date: Mon, 6 Jan 2025 05:48:18 +0530 Subject: [PATCH 14/20] refactor --- phoronix/run_phoronix.sh | 74 ++++++++++++++++++++++++++++------------ 1 file changed, 53 insertions(+), 21 deletions(-) diff --git a/phoronix/run_phoronix.sh b/phoronix/run_phoronix.sh index ca6d266..e7fe3c8 100644 --- a/phoronix/run_phoronix.sh +++ b/phoronix/run_phoronix.sh @@ -197,6 +197,51 @@ while [[ $# -gt 0 ]]; do esac done +index_cockroach(){ + echo $test_index > /tmp/ph_opts + echo $test_index >> /tmp/ph_opts + echo n >> /tmp/ph_opts +} + +index_redis(){ + echo $test_index > /tmp/ph_opts + echo $test_index >> /tmp/ph_opts + echo n >> /tmp/ph_opts +} + +index_stress_ng(){ + echo $test_index > /tmp/ph_opts + echo n >> /tmp/ph_opts +} + +index_phpbench(){ + echo n >> /tmp/ph_opts +} + +index_cassandra(){ + echo n >> /tmp/ph_opts +} + +index_apache(){ + echo $test_index > /tmp/ph_opts + echo n >> /tmp/ph_opts +} + +index_apache_iotdb(){ + echo $test_index > /tmp/ph_opts + echo $test_index >> /tmp/ph_opts + echo $test_index >> /tmp/ph_opts + echo $test_index >> /tmp/ph_opts + echo n >> /tmp/ph_opts +} + +index_hbase(){ + echo $test_index > /tmp/ph_opts + echo $test_index >> /tmp/ph_opts + echo $test_index >> /tmp/ph_opts + echo n >> /tmp/ph_opts +} + if [[ $sub_test == "none" ]]; then echo You must designate a test. usage $0 @@ -233,34 +278,21 @@ else echo 1 | ./phoronix-test-suite/phoronix-test-suite install ${sub_test} if [[ ${sub_test} == "cockroach" ]]; then - echo $test_index > /tmp/ph_opts - echo $test_index >> /tmp/ph_opts - echo n >> /tmp/ph_opts + index_cockroach elif [[ ${sub_test} == "redis" ]]; then - echo $test_index > /tmp/ph_opts - echo $test_index >> /tmp/ph_opts - echo n >> /tmp/ph_opts + index_redis elif [[ ${sub_test} == "stress-ng" ]]; then - echo $test_index > /tmp/ph_opts - echo n >> /tmp/ph_opts + index_stress_ng elif [[ ${sub_test} == "phpbench" ]]; then - echo n > /tmp/ph_opts + index_phpbench elif [[ ${sub_test} == "cassandra" ]]; then - echo n > /tmp/ph_opts + index_cassandra elif [[ ${sub_test} == "apache" ]]; then - echo $test_index >> /tmp/ph_opts - echo n >> /tmp/ph_opts + index_apache elif [[ ${sub_test} == "apache-iotdb" ]]; then - echo $test_index >> /tmp/ph_opts - echo $test_index >> /tmp/ph_opts - echo $test_index >> /tmp/ph_opts - echo $test_index >> /tmp/ph_opts - echo n >> /tmp/ph_opts + index_apache_iotdb elif [[ ${sub_test} == "hbase" ]]; then - echo $test_index >> /tmp/ph_opts - echo $test_index >> /tmp/ph_opts - echo $test_index >> /tmp/ph_opts - echo n >> /tmp/ph_opts + index_hbase else echo "Unsupported test: ${sub_test}" exit 1 From a4c1bee0d51fa27ef2c0e63b54ac4fb062bd05df Mon Sep 17 00:00:00 2001 From: sousinha1997 Date: Mon, 6 Jan 2025 13:08:40 +0530 Subject: [PATCH 15/20] stress ng fix --- phoronix/reduce_phoronix | 45 ++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/phoronix/reduce_phoronix b/phoronix/reduce_phoronix index f026674..3913231 100644 --- a/phoronix/reduce_phoronix +++ b/phoronix/reduce_phoronix @@ -34,7 +34,6 @@ reduce_cockroach() { # Append the extracted information to the output file echo "$workload:$concurrency:$average:$deviation" >> "$tmp_file" fi - rm "$tmp_file" done < /tmp/results_phoronix_"$test_ran"_tuned_*.out } @@ -58,27 +57,29 @@ reduce_redis() { # Append the extracted information to the output file echo "$test:$parallel_connections:$average:$deviation" >> "$tmp_file" fi - rm "$tmp_file" done < /tmp/results_phoronix_"$test_ran"_tuned_*.out } reduce_stress_ng() { - egrep 'Test: |Average' results_phoronix_*.out | grep -v stress > tmpfile - echo "Test:BOPs" - toggle=0 - while IFS= read -r line - do - if [ $toggle -eq 0 ]; then - out=`echo $line | cut -d':' -f2 | sed "s/^ //g" | sed "s/\[1\;34m//g"` - printf "%s:" "$out" - toggle=1 - else - out=`echo $line | cut -d':' -f 2 | cut -d' ' -f 2 | sed "s/\[1\;34m//g"` - printf "%s\n" $out - toggle=0 - fi - done < "tmpfile" - rm tmpfile + echo "Test:Average:Deviation" > "$tmp_file" + # Read and process the results file + while IFS= read -r line; do + # Check for lines containing Test and CPU Stress + if [[ $line == *"Test:"* ]]; then + # Extract Test name (after "Test: " and before the colon) + test=$(echo "$line" | awk -F 'Test: ' '{print $2}' | awk -F ':' '{print $1}') + fi + if [[ $line == *"Average:"* ]]; then + # Extract Average value + average=$(echo "$line" | awk -F 'Average: ' '{print $2}' | awk '{print $1}') + fi + if [[ $line == *"Deviation:"* ]]; then + # Extract Deviation value + deviation=$(echo "$line" | awk -F 'Deviation: ' '{print $2}' | tr -d '%') + # Append the extracted information to the output file + echo "$test:$average:$deviation" >> "$tmp_file" + fi + done < /tmp/results_phoronix_"$test_ran"_tuned_*.out } # Check if an argument is passed if [ $# -eq 0 ]; then @@ -116,13 +117,13 @@ if [ "$tmp_file" == "none" ]; then usage fi -if [[ "$test_ran" == "cockroach" ]]; then +if [[ ${test_ran} == "cockroach" ]]; then reduce_cockroach -elif [[ "$test_ran" == "redis" ]]; then +elif [[ ${test_ran} == "redis" ]]; then reduce_redis -elif [[ "$test_ran" == "stress-ng"]]; then +elif [[ ${test_ran} == "stress-ng" ]]; then reduce_stress_ng else - echo "Unsupported test: $test_ran" + echo "Unsupported test: ${test_ran}" exit 1 fi \ No newline at end of file From 71080a0b020d71a4a551e579cee8270705f31258 Mon Sep 17 00:00:00 2001 From: sousinha1997 Date: Mon, 6 Jan 2025 15:43:11 +0530 Subject: [PATCH 16/20] iotdb, phpbench --- phoronix/reduce_phoronix | 89 +++++++++++++++++++++++++++++++++++++++- phoronix/run_phoronix.sh | 12 ++---- 2 files changed, 92 insertions(+), 9 deletions(-) diff --git a/phoronix/reduce_phoronix b/phoronix/reduce_phoronix index 3913231..cd6df95 100644 --- a/phoronix/reduce_phoronix +++ b/phoronix/reduce_phoronix @@ -37,6 +37,23 @@ reduce_cockroach() { done < /tmp/results_phoronix_"$test_ran"_tuned_*.out } +reduce_phpbench() { + echo "Average:Deviation" > "$tmp_file" + # Read and process the results file + while IFS= read -r line; do + if [[ $line == *"Average:"* ]]; then + # Extract Average value + average=$(echo "$line" | awk -F 'Average: ' '{print $2}' | awk '{print $1}') + fi + if [[ $line == *"Deviation:"* ]]; then + # Extract Deviation value + deviation=$(echo "$line" | awk -F 'Deviation: ' '{print $2}' | tr -d '%') + # Append the extracted information to the output file + echo "$average:$deviation" >> "$tmp_file" + fi + done < /tmp/results_phoronix_"$test_ran"_tuned_*.out +} + reduce_redis() { echo "Test:ParallelConnections:Average:Deviation" > "$tmp_file" # Read and process the results file @@ -60,11 +77,75 @@ reduce_redis() { done < /tmp/results_phoronix_"$test_ran"_tuned_*.out } +reduce_cassandra() { + echo "Test:Average:Deviation" > "$tmp_file" + # Read and process the results file + while IFS= read -r line; do + # Check for lines containing Test + if [[ $line == *"Test:"* ]]; then + # Extract Test name (after "Test: " and before the colon) + test=$(echo "$line" | awk -F 'Test: ' '{print $2}' | awk -F ':' '{print $1}') + fi + if [[ $line == *"Average:"* ]]; then + # Extract Average value + average=$(echo "$line" | awk -F 'Average: ' '{print $2}' | awk '{print $1}') + fi + if [[ $line == *"Deviation:"* ]]; then + # Extract Deviation value + deviation=$(echo "$line" | awk -F 'Deviation: ' '{print $2}' | tr -d '%') + # Append the extracted information to the output file + echo "$test:$average:$deviation" >> "$tmp_file" + fi + done < /tmp/results_phoronix_"$test_ran"_tuned_*.out +} + +reduce_apache-iotdb() { + # Header for CSV file + echo "device_count:batch_size:sensor_count:client_number:point_sec:latency" > "$tmp_file" + + # Initialize variables to store values for each test configuration + device_count="" + batch_size="" + sensor_count="" + client_number="" + point_sec="" + latency="" + # Iterate through the test output file (replace this with the actual test output file) + while IFS= read -r line; do + # Extract the configuration line (e.g., Device Count: 100 - Batch Size Per Write: 1 - Sensor Count: 200 - Client Number: 100) + if [[ "$line" =~ \[\Device\ Count:\ ([0-9]+).*Batch\ Size\ Per\ Write:\ ([0-9]+).*Sensor\ Count:\ ([0-9]+).*Client\ Number:\ ([0-9]+)] ]]; then + # Save the configuration + device_count="${BASH_REMATCH[1]}" + batch_size="${BASH_REMATCH[2]}" + sensor_count="${BASH_REMATCH[3]}" + client_number="${BASH_REMATCH[4]}" + fi + # Extract points/sec (e.g., Average: 139645 point/sec) + if [[ "$line" =~ Average:\ ([0-9]+)\ point/sec ]]; then + point_sec="${BASH_REMATCH[1]}" + fi + # Extract latency (e.g., Average Latency: 117.59) + if [[ "$line" =~ Average\ Latency:\ ([0-9]+\.[0-9]+) ]]; then + latency="${BASH_REMATCH[1]}" + fi + # After reading the point_sec and latency for a test configuration, append it to the output CSV + if [[ -n "$device_count" && -n "$batch_size" && -n "$sensor_count" && -n "$client_number" ]]; then + echo "$device_count:$batch_size:$sensor_count:$client_number:${point_sec:-}:$latency" >> "$tmp_file" + device_count="" + batch_size="" + sensor_count="" + client_number="" + point_sec="" + latency="" + fi + done < /tmp/results_phoronix_"$test_ran"_tuned_*.out +} + reduce_stress_ng() { echo "Test:Average:Deviation" > "$tmp_file" # Read and process the results file while IFS= read -r line; do - # Check for lines containing Test and CPU Stress + # Check for lines containing Test if [[ $line == *"Test:"* ]]; then # Extract Test name (after "Test: " and before the colon) test=$(echo "$line" | awk -F 'Test: ' '{print $2}' | awk -F ':' '{print $1}') @@ -123,6 +204,12 @@ elif [[ ${test_ran} == "redis" ]]; then reduce_redis elif [[ ${test_ran} == "stress-ng" ]]; then reduce_stress_ng +elif [[ ${test_ran} == "phpbench" ]]; then + reduce_phpbench +elif [[ ${test_ran} == "cassandra" ]]; then + reduce_cassandra +elif [[ ${test_ran} == "apache-iotdb" ]]; then + reduce_apache-iotdb else echo "Unsupported test: ${test_ran}" exit 1 diff --git a/phoronix/run_phoronix.sh b/phoronix/run_phoronix.sh index e7fe3c8..33440ba 100644 --- a/phoronix/run_phoronix.sh +++ b/phoronix/run_phoronix.sh @@ -287,12 +287,8 @@ else index_phpbench elif [[ ${sub_test} == "cassandra" ]]; then index_cassandra - elif [[ ${sub_test} == "apache" ]]; then - index_apache elif [[ ${sub_test} == "apache-iotdb" ]]; then index_apache_iotdb - elif [[ ${sub_test} == "hbase" ]]; then - index_hbase else echo "Unsupported test: ${sub_test}" exit 1 @@ -331,8 +327,8 @@ else # We place the results first in results_check.csv so we can check to make sure # the tests actually ran. After the check, we will add the run info to results.csv. # - $run_dir/reduce_phoronix --sub_test {sub_test} --tmp_file results_{sub_test}_check.csv - lines=`wc -l results_{sub_test}_check.csv | cut -d' ' -f 1` + $run_dir/reduce_phoronix --sub_test ${sub_test} --tmp_file results_${sub_test}_check.csv + lines=`wc -l results_${sub_test}_check.csv | cut -d' ' -f 1` if [[ $lines == "1" ]]; then # # We failed, report and do not remove the results_{sub_test}_check.csv file. @@ -341,8 +337,8 @@ else rtc=1 else echo Ran >> test_results_report - cat results_{sub_test}_check.csv >> ${results_file} - rm results_{sub_test}_check.csv + cat results_${sub_test}_check.csv >> ${results_file} + rm results_${sub_test}_check.csv fi popd > /dev/null find -L $RESULTSDIR -type f | tar --transform 's/.*\///g' -cf results_pbench.tar --files-from=/dev/stdin From afff79e96214ea7def5f2038ae00f235114fcea8 Mon Sep 17 00:00:00 2001 From: sousinha1997 Date: Mon, 6 Jan 2025 17:56:02 +0530 Subject: [PATCH 17/20] nginx add --- phoronix/reduce_phoronix | 25 +++++++++++++++++++++++++ phoronix/run_phoronix.sh | 11 +++-------- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/phoronix/reduce_phoronix b/phoronix/reduce_phoronix index cd6df95..395664a 100644 --- a/phoronix/reduce_phoronix +++ b/phoronix/reduce_phoronix @@ -141,6 +141,27 @@ reduce_apache-iotdb() { done < /tmp/results_phoronix_"$test_ran"_tuned_*.out } +reduce_nginx(){ + echo "Connections:RPS" > "$tmp_file" + while IFS= read -r line; do + # Check for lines containing Connections + if [[ $line == *"Connections:"* ]]; then + # Extract Test name (after "Connections: " and before the colon) + connection=$(echo "$line" | awk -F 'Connections: ' '{print $2}' | awk -F ':' '{print $1}') + fi + if [[ $line == *"Average:"* ]]; then + # Extract Average value + average=$(echo "$line" | awk -F 'Average: ' '{print $2}' | awk '{print $1}') + fi + if [[ $line == *"Deviation:"* ]]; then + # Extract Deviation value + deviation=$(echo "$line" | awk -F 'Deviation: ' '{print $2}' | tr -d '%') + # Append the extracted information to the output file + echo "$connection:$average:$deviation" >> "$tmp_file" + fi + done < /tmp/results_phoronix_"$test_ran"_tuned_*.out +} + reduce_stress_ng() { echo "Test:Average:Deviation" > "$tmp_file" # Read and process the results file @@ -162,6 +183,8 @@ reduce_stress_ng() { fi done < /tmp/results_phoronix_"$test_ran"_tuned_*.out } + + # Check if an argument is passed if [ $# -eq 0 ]; then usage @@ -210,6 +233,8 @@ elif [[ ${test_ran} == "cassandra" ]]; then reduce_cassandra elif [[ ${test_ran} == "apache-iotdb" ]]; then reduce_apache-iotdb +elif [[ ${test_ran} == "nginx" ]]; then + reduce_nginx else echo "Unsupported test: ${test_ran}" exit 1 diff --git a/phoronix/run_phoronix.sh b/phoronix/run_phoronix.sh index 33440ba..ee767fc 100644 --- a/phoronix/run_phoronix.sh +++ b/phoronix/run_phoronix.sh @@ -222,11 +222,6 @@ index_cassandra(){ echo n >> /tmp/ph_opts } -index_apache(){ - echo $test_index > /tmp/ph_opts - echo n >> /tmp/ph_opts -} - index_apache_iotdb(){ echo $test_index > /tmp/ph_opts echo $test_index >> /tmp/ph_opts @@ -235,10 +230,8 @@ index_apache_iotdb(){ echo n >> /tmp/ph_opts } -index_hbase(){ +index_nginx(){ echo $test_index > /tmp/ph_opts - echo $test_index >> /tmp/ph_opts - echo $test_index >> /tmp/ph_opts echo n >> /tmp/ph_opts } @@ -289,6 +282,8 @@ else index_cassandra elif [[ ${sub_test} == "apache-iotdb" ]]; then index_apache_iotdb + elif [[ ${sub_test} == "nginx" ]]; then + index_nginx else echo "Unsupported test: ${sub_test}" exit 1 From 70a752f48fa10c1358644fe5c3c4f5746026cbdb Mon Sep 17 00:00:00 2001 From: sousinha1997 Date: Mon, 6 Jan 2025 18:13:58 +0530 Subject: [PATCH 18/20] sqlite add --- phoronix/reduce_phoronix | 23 +++++++++++++++++++++++ phoronix/run_phoronix.sh | 7 +++++++ 2 files changed, 30 insertions(+) diff --git a/phoronix/reduce_phoronix b/phoronix/reduce_phoronix index 395664a..bb762e0 100644 --- a/phoronix/reduce_phoronix +++ b/phoronix/reduce_phoronix @@ -184,6 +184,27 @@ reduce_stress_ng() { done < /tmp/results_phoronix_"$test_ran"_tuned_*.out } +reduce_sqlite() { + echo "Threads:Average:Deviation" > "$tmp_file" + # Read and process the results file + while IFS= read -r line; do + # Check for lines containing Threads + if [[ $line == *"Threads / Copies:"* ]]; then + # Extract Test name (after "Test: " and before the colon) + test=$(echo "$line" | awk -F 'Threads / Copies: ' '{print $2}' | awk -F ':' '{print $1}') + fi + if [[ $line == *"Average:"* ]]; then + # Extract Average value + average=$(echo "$line" | awk -F 'Average: ' '{print $2}' | awk '{print $1}') + fi + if [[ $line == *"Deviation:"* ]]; then + # Extract Deviation value + deviation=$(echo "$line" | awk -F 'Deviation: ' '{print $2}' | tr -d '%') + # Append the extracted information to the output file + echo "$threads:$average:$deviation" >> "$tmp_file" + fi + done < /tmp/results_phoronix_"$test_ran"_tuned_*.out +} # Check if an argument is passed if [ $# -eq 0 ]; then @@ -235,6 +256,8 @@ elif [[ ${test_ran} == "apache-iotdb" ]]; then reduce_apache-iotdb elif [[ ${test_ran} == "nginx" ]]; then reduce_nginx +elif [[ ${test_ran} == "sqlite" ]]; then + reduce_sqlite else echo "Unsupported test: ${test_ran}" exit 1 diff --git a/phoronix/run_phoronix.sh b/phoronix/run_phoronix.sh index ee767fc..1cc3140 100644 --- a/phoronix/run_phoronix.sh +++ b/phoronix/run_phoronix.sh @@ -235,6 +235,11 @@ index_nginx(){ echo n >> /tmp/ph_opts } +index_sqlite(){ + echo $test_index > /tmp/ph_opts + echo n >> /tmp/ph_opts +} + if [[ $sub_test == "none" ]]; then echo You must designate a test. usage $0 @@ -284,6 +289,8 @@ else index_apache_iotdb elif [[ ${sub_test} == "nginx" ]]; then index_nginx + elif [[ ${sub_test} == "sqlite" ]]; then + index_sqlite else echo "Unsupported test: ${sub_test}" exit 1 From ee3ee6685314a2a54217ddb0fee4acba482f60b1 Mon Sep 17 00:00:00 2001 From: sousinha1997 Date: Mon, 6 Jan 2025 18:37:45 +0530 Subject: [PATCH 19/20] openssl add --- phoronix/reduce_phoronix | 24 ++++++++++++++++++++++++ phoronix/run_phoronix.sh | 7 +++++++ 2 files changed, 31 insertions(+) diff --git a/phoronix/reduce_phoronix b/phoronix/reduce_phoronix index bb762e0..f356c06 100644 --- a/phoronix/reduce_phoronix +++ b/phoronix/reduce_phoronix @@ -206,6 +206,28 @@ reduce_sqlite() { done < /tmp/results_phoronix_"$test_ran"_tuned_*.out } +reduce_openssl() { + echo "Algorithm:BPS:Deviation" > "$tmp_file" + # Read and process the results file + while IFS= read -r line; do + # Check for lines containing Threads + if [[ $line == *"Algorithm:"* ]]; then + # Extract Algorithm name (after "Algorithm: " and before the colon) + algorithm=$(echo "$line" | awk -F 'Algorithm: ' '{print $2}' | awk -F ':' '{print $1}') + fi + if [[ $line == *"Average:"* ]]; then + # Extract Average value + average=$(echo "$line" | awk -F 'Average: ' '{print $2}' | awk '{print $1}') + fi + if [[ $line == *"Deviation:"* ]]; then + # Extract Deviation value + deviation=$(echo "$line" | awk -F 'Deviation: ' '{print $2}' | tr -d '%') + # Append the extracted information to the output file + echo "$algorithm:$average:$deviation" >> "$tmp_file" + fi + done < /tmp/results_phoronix_"$test_ran"_tuned_*.out +} + # Check if an argument is passed if [ $# -eq 0 ]; then usage @@ -258,6 +280,8 @@ elif [[ ${test_ran} == "nginx" ]]; then reduce_nginx elif [[ ${test_ran} == "sqlite" ]]; then reduce_sqlite +elif [[ ${test_ran} == "openssl" ]]; then + reduce_openssl else echo "Unsupported test: ${test_ran}" exit 1 diff --git a/phoronix/run_phoronix.sh b/phoronix/run_phoronix.sh index 1cc3140..c22ff1f 100644 --- a/phoronix/run_phoronix.sh +++ b/phoronix/run_phoronix.sh @@ -240,6 +240,11 @@ index_sqlite(){ echo n >> /tmp/ph_opts } +index_openssl(){ + echo $test_index > /tmp/ph_opts + echo n >> /tmp/ph_opts +} + if [[ $sub_test == "none" ]]; then echo You must designate a test. usage $0 @@ -291,6 +296,8 @@ else index_nginx elif [[ ${sub_test} == "sqlite" ]]; then index_sqlite + elif [[ ${sub_test} == "openssl" ]]; then + index_openssl else echo "Unsupported test: ${sub_test}" exit 1 From e81032fec4f536b4d5384c7e21f03c8891f80924 Mon Sep 17 00:00:00 2001 From: sousinha1997 Date: Wed, 5 Feb 2025 14:44:10 +0530 Subject: [PATCH 20/20] new changes override --- phoronix/run_phoronix.sh | 226 +++++++++++++++++++-------------------- phoronix/test_index.yaml | 33 ++++++ 2 files changed, 141 insertions(+), 118 deletions(-) create mode 100644 phoronix/test_index.yaml diff --git a/phoronix/run_phoronix.sh b/phoronix/run_phoronix.sh index c22ff1f..92940ef 100644 --- a/phoronix/run_phoronix.sh +++ b/phoronix/run_phoronix.sh @@ -18,7 +18,7 @@ test_name="phoronix" GIT_VERSION="v10.8.1" -test_index="Test All Options" +yaml_file="test_index.yaml" rtc=0 arguments="$@" @@ -78,6 +78,7 @@ usage() echo " --test_index: test index to run. Default is $test_index" echo " --sub_test test running: Test we are to run. Supported tests are" echo " cockroach, cassandra, couchdb and hbase" + echo " --test_option_override |" echo " --tools_git: Location to pick up the required tools git, default" echo " https://github.com/redhat-performance/test_tools-wrappers" echo " --usage: this usage message" @@ -143,8 +144,9 @@ ${curdir}/test_tools/gather_data ${curdir} source test_tools/general_setup "$@" ARGUMENT_LIST=( - "test_index" - "sub_test" + "test_index" + "sub_test" + "test_option_override" ) NO_ARGUMENTS=( @@ -170,84 +172,95 @@ fi eval set --$opts while [[ $# -gt 0 ]]; do - case "$1" in - --test_index) - test_index=$2 - shift 2 - ;; + case "$1" in + --test_index) + test_index=$2 + shift 2 + ;; --sub_test) sub_test=${2} shift 2 ;; + --test_option_override) + test_option_override=$2 + shift 2 + ;; -h) - usage - ;; - --usage) - usage + usage + ;; + --usage) + usage exit ;; - --) - break; - ;; - *) - echo option not found $1 - usage - exit - ;; - esac + --) + break; + ;; + *) + echo option not found $1 + usage + exit + ;; + esac done -index_cockroach(){ - echo $test_index > /tmp/ph_opts - echo $test_index >> /tmp/ph_opts - echo n >> /tmp/ph_opts -} - -index_redis(){ - echo $test_index > /tmp/ph_opts - echo $test_index >> /tmp/ph_opts - echo n >> /tmp/ph_opts -} - -index_stress_ng(){ - echo $test_index > /tmp/ph_opts - echo n >> /tmp/ph_opts -} - -index_phpbench(){ - echo n >> /tmp/ph_opts -} - -index_cassandra(){ - echo n >> /tmp/ph_opts -} - -index_apache_iotdb(){ - echo $test_index > /tmp/ph_opts - echo $test_index >> /tmp/ph_opts - echo $test_index >> /tmp/ph_opts - echo $test_index >> /tmp/ph_opts - echo n >> /tmp/ph_opts -} - -index_nginx(){ - echo $test_index > /tmp/ph_opts - echo n >> /tmp/ph_opts -} +parse_yaml() { + local yaml_file=$1 + local subtest=$2 + local option=$3 -index_sqlite(){ - echo $test_index > /tmp/ph_opts - echo n >> /tmp/ph_opts + # Use yq to extract the value from the YAML file + yq eval ".subtests.$subtest.options.$option" "$yaml_file" } -index_openssl(){ - echo $test_index > /tmp/ph_opts - echo n >> /tmp/ph_opts +generate_ph_opts() { + + local subtest=$1 + local override_options=$2 + + declare -A options + + # ParoIe the YAML file to get the default options + local default_keys=$(yq eval ".subtests.$subtest.options | keys | .[] | select(test(\"^default_\"))" "$yaml_file") + mapfile -t ordered_keys <<< "$default_keys" + + # Parse default options and store in options associative array + for key in "${ordered_keys[@]}"; do + # Extract parameter name by removing 'default_' prefix + local param=${key#default_} + # Get the default value from YAML + options[$param]=$(parse_yaml "$yaml_file" "$subtest" "$key") + done + + #empty the file + > /tmp/ph_opts + + # Process overrides, if any + if [[ -n "$override_options" ]]; then + IFS='|' read -r -a overrides <<< "$override_options" + for override in "${overrides[@]}"; do + echo ${override} + IFS='=' read -r key values <<< "$override" + if [[ -n "${options[$key]}" ]]; then + options[$key]=$values + else + echo "Unknown option: $key" + exit 1 + fi + done + fi + + #Add in correct order + for key in "${ordered_keys[@]}"; do + param=${key#default_} + echo "${options[$param]}" >> /tmp/ph_opts + done + + echo "n" >> /tmp/ph_opts } if [[ $sub_test == "none" ]]; then - echo You must designate a test. - usage $0 + echo You must designate a test. + usage $0 fi if [ $to_pbench -eq 1 ]; then @@ -265,59 +278,36 @@ if [ $to_pbench -eq 1 ]; then fi exit else - if [ $to_user == "ubuntu" ]; then - DEBIAN_FRONTEND=noninteractive apt-get install -y -q php-cli - DEBIAN_FRONTEND=noninteractive apt-get install -y -q php-xml - fi - cd $run_dir - # - # phoronix run parameters. - # - # Right now we only support stress-ng - # - if [ ! -d "./phoronix-test-suite" ]; then - git clone -b $GIT_VERSION --single-branch --depth 1 https://github.com/phoronix-test-suite/phoronix-test-suite - fi - echo 1 | ./phoronix-test-suite/phoronix-test-suite install ${sub_test} - - if [[ ${sub_test} == "cockroach" ]]; then - index_cockroach - elif [[ ${sub_test} == "redis" ]]; then - index_redis - elif [[ ${sub_test} == "stress-ng" ]]; then - index_stress_ng - elif [[ ${sub_test} == "phpbench" ]]; then - index_phpbench - elif [[ ${sub_test} == "cassandra" ]]; then - index_cassandra - elif [[ ${sub_test} == "apache-iotdb" ]]; then - index_apache_iotdb - elif [[ ${sub_test} == "nginx" ]]; then - index_nginx - elif [[ ${sub_test} == "sqlite" ]]; then - index_sqlite - elif [[ ${sub_test} == "openssl" ]]; then - index_openssl - else - echo "Unsupported test: ${sub_test}" - exit 1 - fi - + if [ $to_user == "ubuntu" ]; then + DEBIAN_FRONTEND=noninteractive apt-get install -y -q php-cli + DEBIAN_FRONTEND=noninteractive apt-get install -y -q php-xml + fi + cd $run_dir + # + # phoronix run parameters. + # + # Right now we only support stress-ng + # + if [ ! -d "./phoronix-test-suite" ]; then + git clone -b $GIT_VERSION --single-branch --depth 1 https://github.com/phoronix-test-suite/phoronix-test-suite + fi + echo 1 | ./phoronix-test-suite/phoronix-test-suite install ${sub_test} + # + # Run phoronix test + # + if [[ -f /tmp/results_${test_name}_${sub_test}_${to_tuned_setting}.out ]]; then + rm /tmp/results_${test_name}_${sub_test}_${to_tuned_setting}.out + fi - # - # Run phoronix test - # - if [[ -f /tmp/results_${test_name}_${sub_test}_${to_tuned_setting}.out ]]; then - rm /tmp/results_${test_name}_${sub_test}_${to_tuned_setting}.out - fi - for iterations in 1 `seq 2 1 ${to_times_to_run}` - do - ./phoronix-test-suite/phoronix-test-suite run ${sub_test} < /tmp/ph_opts >> /tmp/results_${test_name}_${sub_test}_${to_tuned_setting}.out - done - # - # Archive up the results. - # - results_file=results_phoronix_${sub_test}.csv + generate_ph_opts ${sub_test} ${test_option_override} + for iterations in 1 `seq 2 1 ${to_times_to_run}` + do + ./phoronix-test-suite/phoronix-test-suite run ${sub_test} < /tmp/ph_opts >> /tmp/results_${test_name}_${sub_test}_${to_tuned_setting}.out + done + # + # Archive up the results. + # + results_file=results_phoronix_${sub_test}.csv cd /tmp RESULTSDIR=results_${test_name}_${sub_test}_${to_tuned_setting}$(date "+%Y.%m.%d-%H.%M.%S") diff --git a/phoronix/test_index.yaml b/phoronix/test_index.yaml new file mode 100644 index 0000000..e9e2011 --- /dev/null +++ b/phoronix/test_index.yaml @@ -0,0 +1,33 @@ +subtests: + openssl: + description: "OpenSSL" + options: + algorithm: + 1. "RSA4096" + 2. "SHA256" + 3. "SHA512" + 4. "AES-128-GCM" + 5. "AES-256-GCM" + 6. "ChaCha20" + 7. "ChaCha20-Poly1305" + 8. "Test All Options" + default_algorithm: "1" + + cockroach: + description: "CockroachDB" + options: + workload: + 1. "KV, 95% Reads" + 2. "KV, 50% Reads" + 3. "KV, 60% Reads" + 4. "KV, 10% Reads" + 5. "MoVR" + 6. "Test All Options" + concurrency: + 1. "128" + 2. "256" + 3. "512" + 4. "1024" + 5. "Test_All_Options" + default_workload: "1" + default_concurrency: "1" \ No newline at end of file