FunASR/runtime/deploy_tools/install_docker.sh
Yabin Li 702ec03ad8
Dev new (#1065)
* add hotword for deploy_tools

* Support wfst decoder and contextual biasing (#1039)

* Support wfst decoder and contextual biasing

* Turn on fstbin compilation

---------

Co-authored-by: gongbo.gb <gongbo.gb@alibaba-inc.com>

* mv funasr/runtime runtime

* Fix crash caused by OOV in hotwords list

* funasr infer

* funasr infer

* funasr infer

* funasr infer

* funasr infer

* fix some bugs about fst hotword; support wfst for websocket server and clients; mv runtime out of funasr; modify relative docs

* del onnxruntime/include/gflags

* update tensor.h

* update run_server.sh

* update deploy tools

* update deploy tools

* update websocket-server

* update funasr-wss-server

* Remove self loop propagation

* Update websocket_protocol_zh.md

* Update websocket_protocol_zh.md

* update hotword protocol

* author zhaomingwork: change hotwords for h5 and java

* update hotword protocol

* catch exception for json_fst_hws

* update hotword on message

* update onnx benchmark for ngram&hotword

* update docs

* update funasr-wss-serve

* add NONE for LM_DIR

* update docs

* update run_server.sh

* add whats-new

* modify whats-new

* update whats-new

* update whats-new

* Support decoder option for beam searching

* update benchmark_onnx_cpp

* Support decoder option for websocket

* fix bug of CompileHotwordEmbedding

* update html client

* update docs

---------

Co-authored-by: gongbo.gb <35997837+aibulamusi@users.noreply.github.com>
Co-authored-by: gongbo.gb <gongbo.gb@alibaba-inc.com>
Co-authored-by: 游雁 <zhifu.gzf@alibaba-inc.com>
2023-11-07 18:34:29 +08:00

82 lines
2.5 KiB
Bash

# Set color
RED="\033[31;1m"
GREEN="\033[32;1m"
YELLOW="\033[33;1m"
BLUE="\033[34;1m"
CYAN="\033[36;1m"
PLAIN="\033[0m"
# Info messages
DONE="${GREEN}[DONE]${PLAIN}"
ERROR="${RED}[ERROR]${PLAIN}"
WARNING="${YELLOW}[WARNING]${PLAIN}"
# Font Format
BOLD="\033[1m"
UNDERLINE="\033[4m"
# Current folder
CUR_DIR=`pwd`
SUDO_CMD="sudo"
# OS
OSID=$(grep ^ID= /etc/os-release | cut -d= -f2)
OSVER=$(lsb_release -cs)
OSNUM=$(grep -oE "[0-9.]+" /etc/issue)
DOCKERINFO=$(${SUDO_CMD} docker info | wc -l)
DOCKERINFOLEN=`expr ${DOCKERINFO} + 0`
if [ $DOCKERINFOLEN -gt 30 ]; then
echo -e " ${YELLOW}Docker has installed.${PLAIN}"
else
lowercase_osid=$(echo ${OSID} | tr '[A-Z]' '[a-z]')
echo -e " ${YELLOW}Start install docker for ${lowercase_osid} ${PLAIN}"
DOCKER_INSTALL_CMD="curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun"
DOCKER_INSTALL_RUN_CMD=""
case "$lowercase_osid" in
ubuntu)
DOCKER_INSTALL_CMD="curl -fsSL https://test.docker.com -o test-docker.sh"
DOCKER_INSTALL_RUN_CMD="${SUDO_CMD} sh test-docker.sh"
;;
centos)
DOCKER_INSTALL_CMD="curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun"
;;
debian)
DOCKER_INSTALL_CMD="curl -fsSL https://get.docker.com -o get-docker.sh"
DOCKER_INSTALL_RUN_CMD="${SUDO_CMD} sh get-docker.sh"
;;
\"alios\")
DOCKER_INSTALL_CMD="curl -fsSL https://get.docker.com -o get-docker.sh"
DOCKER_INSTALL_RUN_CMD="${SUDO_CMD} sh get-docker.sh"
;;
\"alinux\")
DOCKER_INSTALL_CMD="${SUDO_CMD} yum -y install dnf"
DOCKER_INSTALL_RUN_CMD="${SUDO_CMD} dnf -y install docker"
;;
*)
echo -e " ${RED}$lowercase_osid is not supported.${PLAIN}"
;;
esac
echo -e " Get docker installer: ${GREEN}${DOCKER_INSTALL_CMD}${PLAIN}"
echo -e " Get docker run: ${GREEN}${DOCKER_INSTALL_RUN_CMD}${PLAIN}"
$DOCKER_INSTALL_CMD
if [ ! -z "$DOCKER_INSTALL_RUN_CMD" ]; then
$DOCKER_INSTALL_RUN_CMD
fi
$SUDO_CMD systemctl start docker
DOCKERINFO=$(${SUDO_CMD} docker info | wc -l)
DOCKERINFOLEN=`expr ${DOCKERINFO} + 0`
if [ $DOCKERINFOLEN -gt 30 ]; then
echo -e " ${GREEN}Docker install success, start docker server.${PLAIN}"
$SUDO_CMD systemctl start docker
else
echo -e " ${RED}Docker install failed!${PLAIN}"
exit 1
fi
fi