Skip to content

Commit

Permalink
deploy: fix some bug and improve services.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
jarviszeng-zjc committed Oct 26, 2019
1 parent 73ffa76 commit 2ad44cc
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 46 deletions.
5 changes: 3 additions & 2 deletions cluster-deploy/scripts/compile_and_packaging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ mv eggroll-conf-1.1.tar.gz ${packages_dir}/
cd ${eggroll_source_code_dir}
cd framework/egg/target
tar czf eggroll-egg-1.1.tar.gz eggroll-egg-1.1.jar lib/
mv eggroll-egg-1.1.jar ${packages_dir}/
mv eggroll-egg-1.1.tar.gz ${packages_dir}/

cd ${eggroll_source_code_dir}
cd framework/meta-service/target
Expand Down Expand Up @@ -145,7 +145,8 @@ get_module_package ${source_code_dir} "python" miniconda3-fate-${python_version}
get_module_package ${source_code_dir} "jdk" jdk-${jdk_version}-linux-x64.tar.gz
get_module_package ${source_code_dir} "mysql" mysql-${mysql_version}-linux-glibc2.12-x86_64.tar.xz
get_module_package ${source_code_dir} "redis" redis-${redis_version}.tar.gz
get_module_package ${source_code_dir} "storage-service-cxx third-party" third_party_eggrollv1.tar.gz
echo "[INFO] Package base module done"
echo "[INFO] Package fate done"
echo "[INFO] A total of `ls ${packages_dir} | wc -l` packages:"
echo "[INFO] A total of `ls ${packages_dir} | wc -l | awk '{print $1}'` packages:"
ls -lrt ${packages_dir}
7 changes: 3 additions & 4 deletions cluster-deploy/scripts/deploy/eggroll/services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ installdir=
export JAVA_HOME=
export PATH=$PATH:$JAVA_HOME/bin
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION='python'
export PYTHONPATH=$installdir/api
export PYTHONPATH=
modules=(meta-service egg roll storage-service-cxx)

if ! test -e $installdir/logs/storage-service-cxx;then
Expand Down Expand Up @@ -80,9 +80,9 @@ all() {
for module in "${modules[@]}"; do
main
echo
echo "--------------"
echo "[INFO] $module:${main_class}"
echo "[INFO] processing: ${module} ${action}"
echo "=================="
action
echo "--------------"
done
Expand All @@ -99,9 +99,9 @@ multiple() {
module=${!i//\//}
main
echo
echo "--------------"
echo "[INFO] $module:${main_class}"
echo "[INFO] processing: ${module} ${action}"
echo "=================="
action
echo "--------------"
done
Expand Down Expand Up @@ -140,7 +140,6 @@ start() {
$module/${target} -p $port -d ${dirdata} >/dev/null 2>/dev/null &
echo $!>${module}/${module}_pid
else
#java -cp "$installdir/${module}/conf/:packages/lib/*:packages/eggroll-${module}.jar" ${main_class} -c $installdir/${module}/conf/${module}.properties >/dev/null 2>/dev/null &
java -cp "$installdir/${module}/conf/:$installdir/${module}/lib/*:$installdir/${module}/eggroll-${module}.jar" ${main_class} -c $installdir/${module}/conf/${module}.properties >/dev/null 2>/dev/null &
echo $!>${module}/${module}_pid
fi
Expand Down
3 changes: 3 additions & 0 deletions cluster-deploy/scripts/deploy/fate_base/redis/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ install () {
cd ${deploy_dir}/${module_name}/redis-${redis_version}
make
cp -r ${deploy_packages_dir}/config/${module_name}/conf/* ${deploy_dir}/${module_name}/redis-${redis_version}
sh service.sh stop
mkdir bin
cp ./src/redis-server ./bin
cp ./src/redis-cli ./bin
Expand All @@ -72,6 +73,8 @@ install () {
}

init(){
cd ${deploy_dir}/${module_name}/redis-${redis_version}
sh service.sh restart
return 0
}

Expand Down
64 changes: 24 additions & 40 deletions cluster-deploy/scripts/deploy/services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,47 +16,39 @@
# limitations under the License.
#

modules=(federation proxy fateboard)
modules=(meta-service egg storage-service-cxx roll federation proxy fate_flow fateboard)
eggroll_modules=(meta-service egg storage-service-cxx roll)

cwd=`pwd`

main() {
module=$1
action=$2
echo "--------------"
echo "[INFO] processing: ${module}"
if [[ ${eggroll_modules[@]/${module}/} != ${eggroll_modules[@]} ]];then
cd ./eggroll/
bash services.sh ${module} ${action}
elif [[ "${module}" == "fate_flow" ]];then
cd ./python/fate_flow
bash service.sh ${action}
else
cd ${module}
bash service.sh ${action}
fi
echo "--------------"
echo
}

all() {
echo "[INFO] processing all modules"
echo "=================="
echo
for module in "${modules[@]}"; do
echo
echo "[INFO] processing: ${module}"
echo "--------------"
cd ${module}
bash service.sh $2
cd ${cwd}
echo "=================="
main ${module} $2
done
}

current() {
echo "[INFO] processing current active modules"
echo "=================="

action=${@: -1}

for module in "${modules[@]}"; do
echo
echo $module
echo "----------------"
cd ${module}
echo ""
`bash service.sh status >> /dev/null`
state=$?
if [[ ${state} -eq 1 ]]; then
echo "[INFO] processing ${module} ${action}"
bash service.sh ${action}
else
echo "[INFO] ${module} not running"
fi
cd ${cwd}
done
}

usage() {
Expand All @@ -67,24 +59,16 @@ multiple() {
total=$#
action=${!total}
for (( i=1; i<total; i++)); do
cd ${cwd}
module=${!i}
echo
echo "[INFO] processing: ${module} ${action}"
echo "=================="
cd ${module}
bash service.sh ${action}
cd -
echo "--------------"
main ${module} ${2}
done
}

case "$1" in
all)
all $@
;;
current)
current $@
;;
usage)
usage
;;
Expand Down

0 comments on commit 2ad44cc

Please sign in to comment.