Files
new-pipeline/README.md
2026-07-27 17:29:26 +08:00

62 lines
1.9 KiB
Markdown
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.

# new-pipeline
将 Hugging Face 镜像中的 GGUF 模型筛选、查重后,提交到 ModelHub
执行适配验证。项目已按 ModelHub 智能体策略运行规范进行容器化。
## 运行方式
平台运行时必须提供:
- `STRATEGY_ID`:当前策略 ID提交任务时写入 `strategyId`
- `MODELHUB_USER_ACCOUNT`ModelHub 登录账号。
- `MODELHUB_USER_PASSWORD`ModelHub 登录密码。
可选变量:
- `PORT`:健康检查端口,默认 `8080`
- `PIPELINE_RUN_MODE``resume``fresh`,默认 `resume`
- `PIPELINE_START_STEP`:从第 14 步中的哪一步开始,默认 `1`
- `PIPELINE_FORCE_RERUN_STEPS`:强制重跑的步骤,例如 `1,2,3`
- `PIPELINE_RUN_INTERVAL_SECONDS`:成功完成后再次运行的间隔,默认 `3600`
- `PIPELINE_RETRY_INTERVAL_SECONDS`:发生未处理异常后的重试间隔,默认 `60`
本地运行:
```powershell
$env:STRATEGY_ID="your-strategy-id"
$env:MODELHUB_USER_ACCOUNT="your-account"
$env:MODELHUB_USER_PASSWORD="your-password"
python app.py
```
健康检查:
```text
GET http://127.0.0.1:8080/health
```
只要策略服务进程存活,该端点返回 HTTP 200。响应同时包含后台流水线的
运行状态,但不会返回账号、密码或令牌。
## Docker
```bash
docker build -t new-pipeline .
docker run --rm -p 8080:8080 \
-e STRATEGY_ID=your-strategy-id \
-e MODELHUB_USER_ACCOUNT=your-account \
-e MODELHUB_USER_PASSWORD=your-password \
new-pipeline
```
镜像监听 `8080` 端口,并处理 `SIGTERM`。收到停机信号后,后台等待和轮询
会立即停止;进行中的 HTTP 请求最长等待 20 秒,随后关闭会话并退出。
运行时产生的断点文件位于 `/app/pipeline_outputs`。如需跨 Pod 保留断点,
应为该目录挂载持久卷。
平台的 CPU/内存 requests 与 limits 由部署配置设置,不在 Dockerfile 中声明:
- requests`100m CPU / 256 Mi`
- limits`1 CPU / 512 Mi`