From 0735d6e804835617f01803aa1001335b03d4a68c Mon Sep 17 00:00:00 2001 From: "jiaxing.zhang" Date: Thu, 28 Nov 2019 19:19:46 +0800 Subject: [PATCH 1/2] fix some bugs --- script/install_megawise.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/script/install_megawise.sh b/script/install_megawise.sh index b31cb0b..092ca45 100755 --- a/script/install_megawise.sh +++ b/script/install_megawise.sh @@ -2,7 +2,7 @@ if [ $# -eq 1 ];then dir_location=$1 - megawise_tag=0.4.0 + megawise_tag=0.5.0 elif [ $# -eq 2 ];then dir_location=$1 megawise_tag=$2 @@ -42,12 +42,13 @@ if [ $MEGAWISE_CNT -ne 0 ];then fi mkdir ${dir_location}/conf -wget -P ${dir_location}/conf https://raw.githubusercontent.com/Infini-Analytics/infini/master/config/db/chewie_main.yaml +wget -P ${dir_location}/conf https://raw.githubusercontent.com/Infini-Analytics/infini/master/config/db/user_config.yaml wget -P ${dir_location}/conf https://raw.githubusercontent.com/Infini-Analytics/infini/master/config/db/etcd.yaml -wget -P ${dir_location}/conf https://raw.githubusercontent.com/Infini-Analytics/infini/master/config/db/megawise_config.yaml wget -P ${dir_location}/conf https://raw.githubusercontent.com/Infini-Analytics/infini/master/config/db/megawise_config_template.yaml -wget -P ${dir_location}/conf https://raw.githubusercontent.com/Infini-Analytics/infini/master/config/db/render_engine.yaml -wget -P ${dir_location}/conf https://raw.githubusercontent.com/Infini-Analytics/infini/master/config/db/scheduler_config_template.yaml +wget -P ${dir_location}/conf https://raw.githubusercontent.com/Infini-Analytics/infini/master/config/db/etcd_config_template.yaml +wget -P ${dir_location}/conf https://raw.githubusercontent.com/Infini-Analytics/infini/master/config/db/etcd_config.yaml + + if [ -f "/tmp/nyc_taxi_data.csv" ];then echo "Warning: /tmp/nyc_taxi_data.csv already exists, you can delete it." else @@ -61,16 +62,20 @@ echo " 4.megawise port MEGAWISE_PORT=5433" mkdir ${dir_location}/data mkdir ${dir_location}/server_data +mkdir ${dir_location}/logs docker run --gpus all --shm-size 4294967296 \ + -e USER=`id -u` -e GROUP=`id -g` \ -v ${dir_location}/conf:/megawise/conf \ -v ${dir_location}/data:/megawise/data \ + -v ${dir_location}/logs:/megawise/logs \ -v ${dir_location}/server_data:/megawise/server_data \ - -v $HOME/.nv:/home/megawise/.nv \ + -v /home/$USER/.nv:/home/megawise/.nv \ -v /tmp:/tmp \ -p 5433:5432 \ - -d \ ${megawise_image_id} +exit 0 + IS_RUN=$(docker ps | grep ${megawise_image_id} | wc -l) TRY_CNT=0 while [ $IS_RUN -eq 0 ];do @@ -88,7 +93,7 @@ echo "State: start megawise in docker successfully!" container_id=$(docker ps |grep ${megawise_image_id} |awk '{printf "%s\n",$1}') echo "State: copying example data into meagwise.......please wait....." -docker exec -u megawise -it ${container_id} /tmp/data_import.sh +docker exec -u `id -u` -it ${container_id} /tmp/data_import.sh if [ $? -ne 0 ]; then echo "Error: import test data failed, you do it by hand using data_import.sh!" exit 0 From 5ca3518164b40205629fa0c21cb22de396cd64b0 Mon Sep 17 00:00:00 2001 From: "jiaxing.zhang" Date: Thu, 28 Nov 2019 19:29:18 +0800 Subject: [PATCH 2/2] fix some bugs at install script --- script/install_megawise.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/install_megawise.sh b/script/install_megawise.sh index 092ca45..57f8563 100755 --- a/script/install_megawise.sh +++ b/script/install_megawise.sh @@ -47,6 +47,7 @@ wget -P ${dir_location}/conf https://raw.githubusercontent.com/Infini-Analytics/ wget -P ${dir_location}/conf https://raw.githubusercontent.com/Infini-Analytics/infini/master/config/db/megawise_config_template.yaml wget -P ${dir_location}/conf https://raw.githubusercontent.com/Infini-Analytics/infini/master/config/db/etcd_config_template.yaml wget -P ${dir_location}/conf https://raw.githubusercontent.com/Infini-Analytics/infini/master/config/db/etcd_config.yaml +wget -P ${dir_location}/conf https://raw.githubusercontent.com/Infini-Analytics/infini/master/config/db/megawise_config.yaml if [ -f "/tmp/nyc_taxi_data.csv" ];then @@ -71,11 +72,10 @@ docker run --gpus all --shm-size 4294967296 \ -v ${dir_location}/server_data:/megawise/server_data \ -v /home/$USER/.nv:/home/megawise/.nv \ -v /tmp:/tmp \ + -d \ -p 5433:5432 \ ${megawise_image_id} -exit 0 - IS_RUN=$(docker ps | grep ${megawise_image_id} | wc -l) TRY_CNT=0 while [ $IS_RUN -eq 0 ];do