34 lines
1.2 KiB
Python
34 lines
1.2 KiB
Python
#!/usr/bin/env python3
|
|
"""submit_sam_probe.py — 探测 sam 预置镜像 (torch/transformers/fastapi)"""
|
|
import json, sys, os
|
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
from mcp_call import MCP
|
|
|
|
def main():
|
|
cmd = open('/tmp/sam_probe_cmd.txt').read().strip()
|
|
mcp = MCP()
|
|
mcp.init()
|
|
args = {
|
|
"name": "jev-sam-img-probe",
|
|
"cluster_uid": "cls_NxkCmBta",
|
|
"org_symbol": "dcloud",
|
|
"image": "registry.d-robotics.cc/dcloud/sam:20260318-latest",
|
|
"sku_id": "6e6b40e5-75df-11f1-bb25-fa20203411cd",
|
|
"replicas": 1,
|
|
"mode": "single",
|
|
"queue": "que-1aebb78f87a1",
|
|
"resource_pool_type": "elastic",
|
|
"priority": "high",
|
|
"restart_policy": "Never",
|
|
"description": "探测 sam 预置镜像: torch/transformers/fastapi 可用性, 为 jev sidecar 推理镜像选型",
|
|
"command": cmd,
|
|
}
|
|
out = mcp.call("submit_training_task", args, timeout=180)
|
|
for c in (out if isinstance(out, list) else [out]):
|
|
if isinstance(c, dict) and c.get("type") == "text":
|
|
print(c.get("text", ""))
|
|
mcp.close()
|
|
|
|
if __name__ == "__main__":
|
|
main()
|