(improvement)(chat) optimize start stop build scripts and the runtime dir does not exist move all to runtime (#209)

This commit is contained in:
lexluo09
2023-10-13 16:32:59 +08:00
committed by GitHub
parent 9d1707eba1
commit 5583426115
3 changed files with 118 additions and 115 deletions

View File

@@ -1,14 +1,8 @@
#!/usr/bin/env bash
set -x
# pip path
pip_path=${PIP_PATH:-"pip3"}
sbinDir=$(cd "$(dirname "$0")"; pwd)
baseDir=$(cd "$sbinDir/.." && pwd -P)
runtimeDir=$baseDir/../runtime
buildDir=$baseDir/build
chmod +x supersonic-common.sh
source supersonic-common.sh
cd $baseDir
@@ -44,30 +38,7 @@ ${pip_path} install -r ${requirementPath}
echo "install python modules success"
#6. reset runtime
function setEnvToWeb {
model_name=$1
json='{"env": "'$model_name'"}'
echo $json > ${runtimeDir}/supersonic-${model_name}/webapp/supersonic.config.json
echo $json > ../../launchers/${model_name}/target/classes/webapp/supersonic.config.json
}
function moveToRuntime {
model_name=$1
tar -zxvf ${buildDir}/supersonic-${model_name}.tar.gz -C ${runtimeDir}
mv ${runtimeDir}/launchers-${model_name}-* ${runtimeDir}/supersonic-${model_name}
mkdir -p ${runtimeDir}/supersonic-${model_name}/webapp
cp -fr ${buildDir}/webapp/* ${runtimeDir}/supersonic-${model_name}/webapp
}
mkdir -p ${runtimeDir}
rm -fr $runtimeDir/*
moveToRuntime chat
moveToRuntime semantic
moveToRuntime standalone
setEnvToWeb chat
setEnvToWeb semantic
moveAllToRuntime
rm -fr ${buildDir}/webapp