Files
xc_validation_strategy_vllm…/README.md
2026-07-26 00:02:46 +08:00

45 lines
1.6 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.

# xc_validation_strategy_vllm_stop
用于停止 `l112233` 账号当前状态为 `waiting` 的验证任务的 ModelHub XC 策略服务。
服务启动后会调用:
```text
PUT /api/async/task/stop-create-contest-task
{"taskIds": [任务 ID, ...]}
```
停止请求完成后,进程继续运行,以便平台通过健康检查和状态接口读取执行结果。
## 任务清单
策略内置了 2026-07-25 通过 `l112233` 账号查询得到的 99 个 `waiting` 任务 ID。总历史任务数为 518但已完成与失败任务不会写入该清单也不会被停止。
可选配置如下:
| 变量 | 默认值 | 说明 |
| --- | --- | --- |
| `TASK_IDS` | 内置的 99 个 waiting 任务 ID | 可选的逗号分隔任务 ID设置后完全替换内置清单。 |
| `BASE_URL` | `https://modelhub.org.cn` | ModelHub 服务地址。 |
| `BATCH_SIZE` | `50` | 每个停止请求包含的任务数。 |
| `MAX_RETRIES` | `3` | 单批任务的最大请求次数。 |
| `REQUEST_TIMEOUT` | `30` | 单次请求超时(秒)。 |
| `PORT` | `8080` | HTTP 服务端口。 |
## 平台运行接口
- `GET /health`:存活探针,成功返回 `{"status":"ok"}`
- `GET /status`:返回执行阶段、成功/失败数量、失败的任务 ID 与错误信息。
## 运行与构建
仓库根目录的 `Dockerfile` 使用平台 Python 基础镜像,暴露 `8080` 端口并以 `python main.py` 启动。构建成功后,策略会将内置任务 ID 按批调用停止接口。
本地验证:
```bash
python main.py
curl http://127.0.0.1:8080/health
curl http://127.0.0.1:8080/status
```