This is an automated email from the ASF dual-hosted git repository.

gehafearless pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git


The following commit(s) were added to refs/heads/master by this push:
     new 597cc38f0 fix(shell): allow bench to be launched for the directory 
packaged by pack_tools on production environment (#1896)
597cc38f0 is described below

commit 597cc38f0a778737e1e3097844db08d50203b2ad
Author: Dan Wang <[email protected]>
AuthorDate: Mon Feb 5 14:15:25 2024 +0800

    fix(shell): allow bench to be launched for the directory packaged by 
pack_tools on production environment (#1896)
    
    #1895
    
    Error occurred that config file was not found while launching Pegasus
    bench. The reason is that the tools is packaged by pack_tools for
    production environment, where build/latest/output could not be found
    since it is only used for local test environment.
---
 run.sh | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/run.sh b/run.sh
index 96d4d6418..f7c7870f5 100755
--- a/run.sh
+++ b/run.sh
@@ -1591,9 +1591,19 @@ function run_bench()
         shift
     done
     cd ${ROOT}
-    cp ${BUILD_LATEST_DIR}/output/bin/pegasus_bench/config.ini 
./config-bench.ini
+    if [ -f ${ROOT}/bin/pegasus_bench/pegasus_bench ]; then
+        # The pegasus_bench was packaged by pack_tools, to be used on 
production environment.
+        ln -s -f ${ROOT}/bin/pegasus_bench/pegasus_bench
+        cp -a ${ROOT}/bin/pegasus_bench/config.ini ./config-bench.ini
+    elif [ -f ${BUILD_LATEST_DIR}/output/bin/pegasus_bench/pegasus_bench ]; 
then
+        # The pegasus_bench was built locally, to be used for test on 
development environment.
+        ln -s -f ${BUILD_LATEST_DIR}/output/bin/pegasus_bench/pegasus_bench
+        cp -a ${BUILD_LATEST_DIR}/output/bin/pegasus_bench/config.ini 
./config-bench.ini
+    else
+        echo "ERROR: pegasus_bench could not be found"
+        exit 1
+    fi
     fill_bench_config
-    ln -s -f ${BUILD_LATEST_DIR}/output/bin/pegasus_bench/pegasus_bench
     ./pegasus_bench ./config-bench.ini
     rm -f ./config-bench.ini
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to