This is an automated email from the ASF dual-hosted git repository.
junchao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-resilientdb.git
The following commit(s) were added to refs/heads/master by this push:
new 3d2d9348 add custom path
3d2d9348 is described below
commit 3d2d93483617da7438a083b53428dbae3982129c
Author: junchao <[email protected]>
AuthorDate: Fri Jan 17 11:19:58 2025 -0700
add custom path
---
scripts/deploy/README.md | 5 +++++
scripts/deploy/performance/run_performance.sh | 7 ++++---
scripts/deploy/script/deploy.sh | 16 ++++++++--------
scripts/deploy/script/env.sh | 2 ++
4 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/scripts/deploy/README.md b/scripts/deploy/README.md
index 97b25b31..7abab0e7 100644
--- a/scripts/deploy/README.md
+++ b/scripts/deploy/README.md
@@ -63,3 +63,8 @@ Run the script:
./performance/pbft_performance.sh config/kv_performance_server.conf
Results will be saved locally and be shown on the screen as well.
+
+
+## Using non-ubuntu account ##
+The default path for the workspace to deploy the system is /home/ubuntu
+If you want to change the path, you can update ``script/env.sh``
diff --git a/scripts/deploy/performance/run_performance.sh
b/scripts/deploy/performance/run_performance.sh
index 12e357c7..7ef2b8a7 100755
--- a/scripts/deploy/performance/run_performance.sh
+++ b/scripts/deploy/performance/run_performance.sh
@@ -20,6 +20,7 @@
./script/deploy.sh $1
. ./script/load_config.sh $1
+. ./script/env.sh
server_name=`echo "$server" | awk -F':' '{print $NF}'`
server_bin=${server_name}
@@ -33,7 +34,7 @@ count=1
for ip in ${iplist[@]};
do
echo "server bin:"${server_bin}
-`ssh -i ${key} -n -o BatchMode=yes -o StrictHostKeyChecking=no ubuntu@${ip}
"killall -9 ${server_bin}"`
+`ssh -i ${key} -n -o BatchMode=yes -o StrictHostKeyChecking=no ${user}@${ip}
"killall -9 ${server_bin}"`
((count++))
done
@@ -46,8 +47,8 @@ idx=1
echo "getting results"
for ip in ${iplist[@]};
do
- echo "scp -i ${key} ubuntu@${ip}:/home/ubuntu/${server_bin}.log ./${ip}_log"
- `scp -i ${key}
ubuntu@${ip}:/home/ubuntu/resilientdb_app/${idx}/${server_bin}.log
result_${ip}_log`
+ echo "scp -i ${key} ${user}@${ip}:${home_path}/${server_bin}.log ./${ip}_log"
+ `scp -i ${key}
${user}@${ip}:${home_path}/resilientdb_app/${idx}/${server_bin}.log
result_${ip}_log`
((idx++))
done
diff --git a/scripts/deploy/script/deploy.sh b/scripts/deploy/script/deploy.sh
index 2ad3cefa..8bae565b 100755
--- a/scripts/deploy/script/deploy.sh
+++ b/scripts/deploy/script/deploy.sh
@@ -85,7 +85,7 @@ function run_cmd(){
idx=1
for ip in ${deploy_iplist[@]};
do
- ssh -i ${key} -n -o BatchMode=yes -o StrictHostKeyChecking=no
ubuntu@${ip} "cd ${main_folder}/$idx; $1" &
+ ssh -i ${key} -n -o BatchMode=yes -o StrictHostKeyChecking=no
${user}@${ip} "cd ${main_folder}/$idx; $1" &
((count++))
((idx++))
done
@@ -98,20 +98,20 @@ function run_cmd(){
function run_one_cmd(){
echo "run one:"$1
- ssh -i ${key} -n -o BatchMode=yes -o StrictHostKeyChecking=no ubuntu@${ip}
"$1"
+ ssh -i ${key} -n -o BatchMode=yes -o StrictHostKeyChecking=no ${user}@${ip}
"$1"
}
run_cmd "killall -9 ${server_bin}"
if [ $performance ];
then
-run_cmd "rm -rf /home/ubuntu/${main_folder}"
+run_cmd "rm -rf ${home_path}/${main_folder}"
fi
idx=1
for ip in ${deploy_iplist[@]};
do
- run_one_cmd "mkdir -p /home/ubuntu/${main_folder}/$idx" &
- folder="/home/ubuntu/${main_folder}/$idx"
+ run_one_cmd "mkdir -p ${home_path}/${main_folder}/$idx" &
+ folder="${home_path}/${main_folder}/$idx"
run_one_cmd "rm -rf ${folder}/${server_bin}; rm
${folder}/${server_bin}*.log; rm -rf ${folder}/server.config; rm -rf
${folder}/cert;"
((count++))
((idx++))
@@ -133,8 +133,8 @@ idx=1
count=0
for ip in ${deploy_iplist[@]};
do
- echo "scp -i ${key} -r ${bin_path} ${output_path}/server.config
${output_path}/cert ubuntu@${ip}:/home/ubuntu/${main_folder}/$idx"
- scp -i ${key} -r ${bin_path} ${output_path}/server.config
${output_path}/cert ubuntu@${ip}:/home/ubuntu/${main_folder}/$idx &
+ echo "scp -i ${key} -r ${bin_path} ${output_path}/server.config
${output_path}/cert ${user}@${ip}:${home_path}/${main_folder}/$idx"
+ scp -i ${key} -r ${bin_path} ${output_path}/server.config
${output_path}/cert ${user}@${ip}:${home_path}/${main_folder}/$idx &
((count++))
((idx++))
done
@@ -170,7 +170,7 @@ do
resp=""
while [ "$resp" = "" ]
do
- resp=`ssh -i ${key} -n -o BatchMode=yes -o StrictHostKeyChecking=no
ubuntu@${ip} "cd ${main_folder}/$idx; grep \"receive public
size:${#iplist[@]}\" ${server_bin}.log"`
+ resp=`ssh -i ${key} -n -o BatchMode=yes -o StrictHostKeyChecking=no
${user}@${ip} "cd ${main_folder}/$idx; grep \"receive public
size:${#iplist[@]}\" ${server_bin}.log"`
if [ "$resp" = "" ]; then
sleep 1
fi
diff --git a/scripts/deploy/script/env.sh b/scripts/deploy/script/env.sh
index fef33733..1eb613d3 100755
--- a/scripts/deploy/script/env.sh
+++ b/scripts/deploy/script/env.sh
@@ -19,6 +19,8 @@
set +e
CURRENT_PATH=$PWD
+user=ubuntu
+home_path=/home/ubuntu
i=0
while [ ! -f "WORKSPACE" ]