scene-digit-human/auto_deploy_dight_human.sh
2024-12-09 08:51:09 +08:00

29 lines
1.1 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 定义logs文件夹的名称
LOG_DIR="logs"
cd /data/redserver/red-agent-service/scene-digit-human
export HAIRUO_ENV=prod
# 检查logs文件夹是否存在
if [ ! -d "$LOG_DIR" ]; then
# 如果logs文件夹不存在则创建它
echo "Creating logs directory..."
mkdir "$LOG_DIR"
fi
# 设置conda环境名
conda_env_name="agent-common"
echo "staring upload_api..."
# 使用命令替换和if语句来检查conda环境中是否存在
if conda env list | grep -q "$conda_env_name"; then
# 如果存在,则先杀掉进程
ps -ef | grep upload_api | grep -v grep | awk '{print $2}'| xargs kill -9 2>/dev/null || true
python /data/config-manager/generate_service_configs.py --service_config_info_path configs/config-vars.yml --config_path configs/cfg.yml
conda run -n "$conda_env_name" gunicorn main:app -n digithuiman_api -c digithuman.conf.py --daemon
echo "Conda environment name is set to: $conda_env_name"
echo "Gunicorn started in the background in $conda_env_name environment."
else
# 如果不存在,则打印找不到
echo "can not find : $conda_env_name"
fi