mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-27 20:42:33 +08:00
(improvement)(chat) optimize start stop build scripts and the runtime dir does not exist move all to runtime (#209)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user