Skip to content

Commit

Permalink
Merge pull request #947 from FederatedAI/feature-2.2.0-delete-echo
Browse files Browse the repository at this point in the history
delete extra echo info
  • Loading branch information
robbie228 authored Oct 31, 2024
2 parents 530bc34 + 5f8435b commit 0d57f67
Showing 1 changed file with 2 additions and 28 deletions.
30 changes: 2 additions & 28 deletions docker-deploy/docker_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,42 +18,34 @@ cd $BASEDIR
WORKINGDIR=$(pwd)

# fetch fate-python image
echo "fetch fate-python image"
source ${WORKINGDIR}/.env
source ${WORKINGDIR}/parties.conf
echo "finished"
cd ${WORKINGDIR}

Deploy() {
if [ "$1" = "" ]; then
echo "3"
echo "No party id was provided, please check your arguments "
exit 1
fi

while [ "$1" != "" ]; do
echo "4"
case $1 in
splitting_proxy)
shift
echo "1"
DeployPartyInternal $@
break
;;
all)
echo "2"
for party in ${party_list[*]}; do
if [ "$2" != "" ]; then
case $2 in
--training)
echo "training"
DeployPartyInternal $party
if [ "${exchangeip}" != "" ]; then
DeployPartyInternal exchange
fi
;;
--serving)
echo "serving"
DeployPartyServing $party
;;
esac
Expand All @@ -68,22 +60,18 @@ Deploy() {
break
;;
*)
echo "5"
if [ "$2" != "" ]; then
case $2 in
--training)
echo "6"
DeployPartyInternal $1
break
;;
--serving)
echo "7"
DeployPartyServing $1
break
;;
esac
else
echo "87"
DeployPartyInternal $1
DeployPartyServing $1
fi
Expand Down Expand Up @@ -124,7 +112,6 @@ Delete() {
}

DeployPartyInternal() {
echo "$1"
target_party_id=$1
# should not use localhost at any case
target_party_ip="127.0.0.1"
Expand All @@ -142,12 +129,10 @@ DeployPartyInternal() {
if [ "$target_party_id" = "exchange" ]; then
target_party_ip=${exchangeip}
elif [ "$2" != "" ]; then
echo "$2"
target_party_ip="$2"
else
for ((i = 0; i < ${#party_list[*]}; i++)); do
if [ "${party_list[$i]}" = "$target_party_id" ]; then
echo "$target_party_id"
target_party_ip=${party_ip_list[$i]}
fi
done
Expand All @@ -157,18 +142,15 @@ DeployPartyInternal() {
echo "Unable to find Party: $target_party_id, please check you input."
return 1
fi
echo "233"
if [ "$3" != "" ]; then
echo "$2"
user=$3
fi
echo "handleLocally confs"

handleLocally confs
echo "handleLocally confs finished"
if [ "$local_flag" == "true" ]; then
return 0
fi
echo "scp -P ${SSH_PORT} ${WORKINGDIR}/outputs/confs-$target_party_id.tar $user@$target_party_ip:~/"

scp -P ${SSH_PORT} ${WORKINGDIR}/outputs/confs-$target_party_id.tar $user@$target_party_ip:~/
#rm -f ${WORKINGDIR}/outputs/confs-$target_party_id.tar
echo "$target_party_ip training cluster copy is ok!"
Expand All @@ -194,7 +176,6 @@ eeooff
}

DeployPartyServing() {
echo "$1"
target_party_id=$1
# should not use localhost at any case
target_party_serving_ip="127.0.0.1"
Expand Down Expand Up @@ -327,16 +308,10 @@ handleLocally() {
for ip in $(hostname -I); do
if [ "$target_party_ip" == "$ip" ]; then
mkdir -p $dir
echo "344444"
tar -xf ${WORKINGDIR}/outputs/${type}-${target_party_id}.tar -C $dir
echo "${dir}/${type}-${target_party_id}"
cd ${dir}/${type}-${target_party_id}
echo "docker-compose down"
docker-compose down
echo "docker-compose down finished"
echo "docker-compose up"
docker-compose up -d
echo "docker-compose up finished"
local_flag="true"
return 0
fi
Expand All @@ -353,7 +328,6 @@ main() {
shift
Delete $@
else
echo "deploy"
Deploy "$@"
fi

Expand Down

0 comments on commit 0d57f67

Please sign in to comment.