添加长期存储,流式检查
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Has been cancelled

This commit is contained in:
2026-04-17 01:26:05 +08:00
parent 602d551fd1
commit 404efde282
37 changed files with 794 additions and 2095 deletions

View File

@@ -81,11 +81,11 @@ check_config() {
check_fail "ZHIPUAI_API_KEY 未配置或格式错误"
fi
# 检查 VLLM_LOCAL_KEY
if grep -q "^VLLM_LOCAL_KEY=" "$PROJECT_DIR/.env" 2>/dev/null; then
check_pass "VLLM_LOCAL_KEY 已配置"
# 检查 LLAMACPP_API_KEY
if grep -q "^LLAMACPP_API_KEY=" "$PROJECT_DIR/.env" 2>/dev/null; then
check_pass "LLAMACPP_API_KEY 已配置"
else
check_warn "VLLM_LOCAL_KEY 未配置(如不使用本地模型可忽略)"
check_warn "LLAMACPP_API_KEY 未配置(如不使用本地模型可忽略)"
fi
# 检查 DB_URI (远程服务器)
@@ -147,8 +147,7 @@ check_config() {
# 测试 PostgreSQL 连接
if command -v psql &> /dev/null; then
# 注意:这里假设密码为 mysecretpassword如果不同需调整或从 env 读取
if PGPASSWORD=mysecretpassword psql -h 115.190.121.151 -U postgres -d langgraph_db -c "SELECT 1;" &> /dev/null; then
if PGPASSWORD=huang1998 psql -h 115.190.121.151 -U postgres -d langgraph_db -c "SELECT 1;" &> /dev/null; then
check_pass "PostgreSQL 远程连接正常 (115.190.121.151:5432)"
else
check_fail "PostgreSQL 远程连接失败"
@@ -306,11 +305,11 @@ start_frontend() {
set +a
export PYTHONPATH="$PROJECT_DIR"
streamlit run frontend/frontend.py &
streamlit run frontend/frontend_main.py &
FRONTEND_PID=$!
echo -e "${GREEN}✓ 前端服务已启动 (PID: $FRONTEND_PID)${NC}"
echo -e "${GREEN}✓ 访问地址:${NC}"
echo -e " 本地开发: http://localhost:8501"
echo -e " 本地开发: http://127.0.0.1:8501"
}
# =============================================================================
@@ -333,7 +332,7 @@ docker_up() {
echo -e "\n${GREEN}✓ Docker Compose 服务已启动${NC}"
echo -e "${BLUE}📊 查看服务状态:${NC} docker compose ps"
echo -e "${BLUE}📝 查看日志:${NC} docker compose logs -f"
echo -e "${BLUE}🌐 访问应用:${NC} http://localhost:8501"
echo -e "${BLUE}🌐 访问应用:${NC} http://127.0.0.1:8501"
}
docker_down() {
@@ -395,6 +394,7 @@ case "${1:-help}" in
check_llamacpp || start_llamacpp
check_embedding || start_embedding
start_backend
sleep 3
start_frontend
echo -e "\n${GREEN}所有服务正在运行,按 Ctrl+C 停止 Python 服务${NC}"
echo -e "${YELLOW}注意Docker 容器会在后台继续运行${NC}"