feat(fish_api): SQLite 快照投递、日志与 watch 空闲告警

- 新增 SQLite:measure/health 快照、delivery_cursor 单消费者 pop;clear/start_fresh 可清空库
- biomass GET 仅返回约定 data 字段,X-Fish-Biomass-New 表示是否有新快照;poller 读响应头
- loguru 桥接 uvicorn,子进程 stdout 流式输出;format_json_pretty 与算法摘要日志
- measure/action watch 无新任务时限流 WARNING;watch_idle 共用逻辑
- 依赖 loguru;新增 db、logging_config、subprocess_run、watch_idle、启动脚本

FishMeasure: 更新 fish_video_weight_evaluation 与 predict_weigth_from_svo2;移除未用 refbox/segmentation 脚本
Made-with: Cursor
This commit is contained in:
zaiun xu
2026-04-09 11:54:30 +08:00
parent db181d4f84
commit 5e1b2117c1
29 changed files with 1464 additions and 1714 deletions

View File

@@ -1,20 +1,11 @@
#!/usr/bin/env bash
# 在「单一 Python 环境」下启动网关FishMeasure / FishAction 子进程默认使用同一解释器。
# 仓库根目录入口:与 fish_api/start.sh 等价
#
# conda activate fishserver
# export PUBLIC_BASE_URL=http://<本机对外IP>:8001 # 可选,填 video URL 前缀
# conda activate fishserver # 若不用 uv
# export PUBLIC_BASE_URL=http://<本机对外IP>:8001
# PORT=8001 bash scripts/run_fishserver.sh
#
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT/fish_api"
export PUBLIC_BASE_URL="${PUBLIC_BASE_URL:-http://127.0.0.1:8000}"
# 单一环境:勿设置 PYTHON_FISH_MEASURE / PYTHON_FISH_ACTION使用当前 uvicorn 的 Python
unset PYTHON_FISH_MEASURE PYTHON_FISH_ACTION 2>/dev/null || true
PORT="${PORT:-8000}"
HOST="${HOST:-0.0.0.0}"
exec uvicorn app.main:app --host "$HOST" --port "$PORT"
exec bash "$ROOT/fish_api/start.sh"