Files
xc_validation_strategy_vllm…/README.md
2026-07-24 18:49:27 +08:00

50 lines
1.5 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
用于停止 `zhoukaile` 账号验证任务的 ModelHub XC 策略服务。
服务启动后会调用:
```text
PUT /api/async/task/stop-create-contest-task
{"taskIds": [任务 ID, ...]}
```
停止请求完成后,进程继续运行,以便平台通过健康检查和状态接口读取执行结果。
## 必填配置
在策略构建/运行环境中配置机密环境变量:
```text
XC_TOKEN=<zhoukaile 的 xc-Token>
```
令牌不写入仓库。可选配置如下:
| 变量 | 默认值 | 说明 |
| --- | --- | --- |
| `TASK_IDS` | 内置的 21 个历史任务 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` 启动。策略构建时请设置 `XC_TOKEN` 为机密变量;构建成功后启动实例即可执行停止操作。
本地验证:
```bash
export XC_TOKEN='***'
python main.py
curl http://127.0.0.1:8080/health
curl http://127.0.0.1:8080/status
```