Skip to content
This repository has been archived by the owner on Nov 29, 2019. It is now read-only.

refresh the install script #18

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions script/install_megawise.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -42,12 +42,14 @@ 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
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
echo "Warning: /tmp/nyc_taxi_data.csv already exists, you can delete it."
else
Expand All @@ -61,14 +63,17 @@ 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 \
-d \
-p 5433:5432 \
-d \
${megawise_image_id}

IS_RUN=$(docker ps | grep ${megawise_image_id} | wc -l)
Expand All @@ -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
Expand Down