huawei-cloud-cloudrobo-infer
Manage CloudRobo inference services — deploy a model into a managed inference service, list/query deployed services and their logs, start/stop a running service, update or delete a service, and orchestrate the 'wait-deploy' convenience flow that polls a service until it finishes deploying. Inference services consume models produced by cloudrobo-train and are consumed by robo-dispatcher when dispatching embodied tasks. Triggers include: infer, inference, model deployment, deploy model, inference service, service deployment, start inference, stop inference, service logs, wait-deploy, model serving, 推理, 推理服务, 模型部署, 部署模型, 推理服务管理, 服务日志, 模型服务.
Windows / PowerShell: Examples use bash syntax. To run on Windows PowerShell:
- Flatten
\line continuations to a single line, or end lines with a backtick.- Set env vars with
$env:NAME="value"instead ofexport NAME="value".- Single-quoted JSON
'{"a":"b"}'works as-is.
Overview
The cloudrobo-infer skill manages the full lifecycle of CloudRobo inference services
(also called model-serving / inference-service): deploy a model (identified by model_id +
model_version_id passed as a --model-json JSON object) into a long-running service, then
operate it (start / stop / update / delete / logs), and use wait-deploy to poll until the
service status is no longer DEPLOYING (status != "DEPLOYING"), returning any other state
(e.g. RUNNING, FAILED, STOPPED).
wait-deployonly waits on theDEPLOYINGphase — it does NOT wait throughCREATING. Exact semantics: Wait-Deploy.
Applicable scenarios:
- Model deployment — Deploy a model as an inference service (create → wait-deploy)
- Wait-Deploy — Poll every 5s until status is no longer
DEPLOYING(600s default) - Service O&M — List deployed services, show detail, update config, start/stop
- Log diagnosis —
list-logswith millisecond time range and keyword filter - Cross-skill orchestration — Consume models exported by
cloudrobo-train; expose the service torobo-dispatcherfor embodied tasks (via the serviceid).
Out of Scope:
- Model training / dataset, robots, dispatch, and asset / compute pool / workspace
lifecycle are separate CloudRobo capabilities (train / dataset / robot / dispatch /
asset / resource / workspace). Route those requests through the matching Agent skill;
this skill only produces an inference service that dispatch consumes via its
id.
Architecture:
Agent / LLM
│
├── CLI → cloudrobo infer <command>
└── SDK → InferClient (Python)
│
▼
cloudrobo-service (REST API)
/v1/infer-services/*
All operations target the cloudrobo-service backend with a valid workspace_id
(the default workspace is used unless explicitly provided). Deploying a service consumes
compute (pool) resources — always confirm before starting a long-running service.
Prerequisites
- CLI installed, AK/SK configured, workspace resolved —
references/cli-installation-guide.md. - A valid
workspace_id(cloudrobo workspace current, orlist+use). - A deployable model:
model_id(=asset_id) +model_version_id(=latest_version_id):--model-json '{"model_id": "<asset_id>", "model_version_id": "<latest_version_id>"}'. The model must haveONLINE_DEPLOYMENTwithstatus: "ENABLE"inshow-asset;DRAFT/CREATINGmodels are rejected with 403. - A compute pool:
pool_type+flavor(cloudrobo resource list-pools --resource-type MODELARTS, onlystatus: "AVAILABLE"pools).--pool-id pool-<resource_id>is optional — pass it only for a dedicated pool. --stop-schedule-jsonis required by the backend:{"duration": <N>, "time_unit": "MINUTES"}.- Region:
cloudrobo(0.3.0) has no--cli-regioncommand-line option (the root command only accepts--verbose/-v; region is not a CLI flag). Set it withcloudrobo config set region <region>(persisted to~/.cloudrobo/config.yaml) — defaultcn-southwest-2. Never append--cli-regiontocloudrobocommands: an unknown option exits non-zero.--cli-regionbelongs tohcloud/KooCLI only, not here.
执行前置自检(Preflight — 每条命令前先做)
任一项失败立即输出中文提示并以非零码退出;禁止静默等待、禁止把空结果当成成功:
command -v cloudrobo >/dev/null 2>&1 || {
echo "未检测到 cloudrobo 命令:请先安装聚合客户端 CLI(pip install hw-cloudrobo-client),详见 references/cli-installation-guide.md。" >&2; exit 2; }
cloudrobo infer --help >/dev/null 2>&1 || {
echo "cloudrobo infer 子命令不可用:请安装或升级 hw-cloudrobo-client(聚合包,已含推理模块)后重试(cloudrobo --help 可确认已注册的命令)。" >&2; exit 2; }
cloudrobo asset --help >/dev/null 2>&1 || {
echo "cloudrobo asset 命令组不可用(报错形如 Error: No such command asset):说明只装了推理模块,模型资料解析无法进行。请改装聚合客户端 pip install hw-cloudrobo-client 后重试。" >&2; exit 2; }
- 凭证缺失不阻断上面的自检,但所有联网命令都会以 401 失败:先
export HUAWEI_CLOUD_AK=<ak> HUAWEI_CLOUD_SK=<sk>或cloudrobo config set ak <ak> sk <sk>,再重试。 scripts/test-cli-commands.sh自检更严:CLI、infer子命令、AK/SK 任一缺失即输出中文 提示并exit 2(没有凭证时它不会给出虚假通过)。- 查询类命令返回空列表属正常结果(0 条服务),不等同于失败;命令报错则必须如实上报。
Workflow
Natural-Language-First Principle
Every workflow below starts from a user intent (1-2 sentences), not from manual CLI/SDK orchestration. The skill then drives the matching command chain and reports state feedback (status changes, polling progress).
Model Deployment Workflow (interactive parameter resolution)
Scenario: "我想创建一个推理服务" / "Deploy model X as an inference service."
Core principle: query each required parameter → present options → let user choose → assemble full command → execute.
-
Resolve workspace —
cloudrobo workspace current.- Default workspace set → use its
workspace_idandasset_catalog_id. - Not set →
cloudrobo workspace list→ present names + IDs →cloudrobo workspace use --workspace-id <id>→ re-runcurrentto confirm.
- Default workspace set → use its
-
Ask model source & type — ask in this order:
- Source (where to search): embodiment plaza (具身广场), workspace assets (空间资产), or custom (自定义). The source decides the entire parameter policy below.
- Type (by
ext_metadata.model_type): perception (感知), vln (导航), vla (操作), planning (规划). - Vague request (e.g. "so101 相关的模型") → skip both and use
cloudrobo asset search-assetsby keyword. - Branch immediately to the Model Source → Parameter Policy
table before assembling
create.
-
Query models:
- Embodiment plaza:
cloudrobo asset list-publication-assets --type model --actions ONLINE_DEPLOYMENT --action-status ENABLE. - Workspace assets:
cloudrobo asset list-assets --catalog-id <asset_catalog_id> --type model(use--catalog-id, NOT--repository-id). - Keyword search:
cloudrobo asset search-assets --keyword "<keyword>" --type model. - Present matching models (name, asset_id, status, model_type) for selection.
- Embodiment plaza:
-
Resolve model version —
cloudrobo asset show-asset --asset-id <asset_id>.latest_version_id→model_version_idin--model-json.version_count > 1→cloudrobo asset list-versions --asset-id <id>→ let user choose.ONLINE_DEPLOYMENTmust beENABLE; modelstatusmust beRELEASE(or published), otherwise the platform returns 403.
-
Auto-discover deployment parameters — space asset / custom models ONLY. Embodiment plaza models: skip this step entirely and carry none of
--cmd/--image-swr-url/--envs-json/--skill-config-json/--service-invoke-json/--readiness-health-json/--model-ext-metadata/--model-json.mount_path— plaza models are pre-configured on the platform, and extra parameters risk a mismatched deployment.For space asset / custom models, discover from the model's algorithm asset and its config files (algorithm asset →
ext_metadata.command/engine.image_url/environment_variables/deployment_config;skill_config.jsonand r2c config via thedownload-urlAPI). Full discovery table,download-urlcode,strictfield and r2c fallback rules:references/service-config-catalog.md→ "Parameter Auto-Discovery Sources".Priority: config files > ext_metadata fields > ask user. Undiscoverable parameters are skipped silently (never block deployment). For "bare" models with no algorithm association, ask the user whether to supply optional parameters manually.
-
Resolve pool & flavor —
cloudrobo resource list-pools --resource-type MODELARTS.- Only
status: "AVAILABLE"pools are usable; present names, pool_type and flavors. resource_id→--pool-id pool-<resource_id>;pool_type→--pool-type(DEDICATED/SHARED). Omit--pool-idforSHAREDpools.- Flavors live under
config.flavorgrouped by hardware (CPU/GPU/ASCEND); let the user pick (e.g."1 * SNT9B2 | 24 vCPUs | 192 GiB").
- Only
-
Confirm parameters & deploy — present the
createcommand using the variant that matches the source from Step 2 (never mix variants):Variant A — embodiment plaza (required core parameters ONLY):
bash cloudrobo infer create --name <service-name> --flavor "<flavor>" --model-json '{"model_id": "<asset_id>", "model_version_id": "<latest_version_id>"}' --workspace-id <workspace_id> --pool-type <pool_type> --stop-schedule-json '{"duration": 60, "time_unit": "MINUTES"}' [--pool-id pool-<resource_id>] [--dry-run]Variant B — space asset / custom (core + auto-discovered params):
bash cloudrobo infer create --name <service-name> --flavor "<flavor>" --model-json '{"model_id": "<asset_id>", "model_version_id": "<latest_version_id>", "mount_path": "<mount_path>"}' --workspace-id <workspace_id> --pool-type <pool_type> --stop-schedule-json '{"duration": 60, "time_unit": "MINUTES"}' [--pool-id pool-<resource_id>] [--cmd "<command>"] [--image-swr-url "<image_url>"] [--envs-json '{"KEY":"VALUE"}'] [--skill-config-json '{"skills":[{"name":"...","prompt":"..."}],"strict":true}'] [--service-invoke-json '{"auth_type":"...","port":8080,"protocol":"HTTP"}'] [--readiness-health-json '{"path":"/ready","port":8080}'] [--model-ext-metadata '<r2c_config_file_content>'] [--dry-run]- Include only parameters actually discovered in Step 5;
--pool-idonly forDEDICATED. --envs-jsontakes a map ({"K":"V"}) — convert the asset's array form first.--skill-config-jsonskill items keep onlyname+prompt.- Run with
--dry-runfirst, confirm with the user, then re-run without--dry-run.
- Include only parameters actually discovered in Step 5;
-
Wait for deployment —
cloudrobo infer wait-deploy --service-id <sid>(polls every 5s untilstatus != "DEPLOYING", 600s default).- After
createthe service auto-entersCREATING→DEPLOYING. Do NOT callstart— it returns 400 "Status DEPLOYING does not support start".startonly restarts aSTOPPEDservice. - If
wait-deployreturns while stillCREATING, immediately re-invoke it.
- After
-
Report — output the service
id(the returned identifier; some docs call itservice_id), model name, flavor and final status. OnFAILED→list-logsfor diagnosis. Never auto-delete a failed service — present thedeletecommand and ask for explicit confirmation.
Asset note: model_id / version_id / flavor / pool_id must be resolved dynamically via the query commands above; never hardcode them. Always let the user choose from queried options.
Model Source → Parameter Policy (authoritative decision table)
This table is the single source of truth for which create parameters to carry, based on
the model source resolved in Step 2. cloudrobo-model-workflow Stage 3 references it to keep
both skills consistent. Resolve the source first, then apply exactly the matching column —
do not mix variants.
| Model source (from Step 2) | Search command (Step 3) | Auto-discovery (Step 5) | create parameters to carry |
|---|---|---|---|
| Embodiment plaza (具身广场) | cloudrobo asset list-publication-assets --type model --actions ONLINE_DEPLOYMENT --action-status ENABLE | SKIP entirely — model is pre-configured on platform | Required core only: --name, --flavor, --model-json (model_id+model_version_id), --workspace-id, --pool-type, --stop-schedule-json; --pool-id only for DEDICATED pool. Do NOT carry --cmd/--image-swr-url/--envs-json/--skill-config-json/--service-invoke-json/--readiness-health-json/--model-ext-metadata/--model-json.mount_path |
| Space asset / custom (空间资产/自定义) | cloudrobo asset list-assets --catalog-id <asset_catalog_id> --type model / cloudrobo asset search-assets --keyword ... | Run Step 5 fully — query algorithm asset (cmd/image/envs/mount_path/service-invoke/readiness-health) + download skill_config.json + r2c config | Required core plus every parameter actually discovered in Step 5; omit undiscovered ones silently |
| Unknown model id (user passed explicit id) | cloudrobo asset show-asset --asset-id <id> | Determine from show-asset: ONLINE_DEPLOYMENT action pointing to a platform algorithm → treat as space-asset path (run Step 5); self-contained/pre-configured config → core only | As per the resolved path |
Rationale: embodiment plaza models bundle their orchestration, image, envs, health probes, skills and r2c mapping on the platform. Re-supplying these in
createis redundant and risks an invalid/mismatched deployment (the "不该带的参数不要带" rule). Space asset / custom models have no bundled config, so their parameters must be discovered and passed explicitly.
Wait-Deploy Workflow (CLI convenience)
Scenario: "Wait for this inference service to finish deploying."
cloudrobo infer wait-deploy --service-id <sid> [--timeout 600]— client-side polling ofshowevery 5s untilstatus != "DEPLOYING"; returns any other state (RUNNING,FAILED,STOPPED). Timeout range 1–3600; on timeout it raisesRuntimeError→ JSON error +ClickException, non-zero exit.- Feedback — report the final status; on
FAILEDsuggestlist-logs.
wait-deploydoes NOT create the service — callcreatefirst, thenwait-deploy. Do NOT callstartaftercreate(auto-deploysCREATING → DEPLOYING → RUNNING);startis only for restarting aSTOPPEDservice.
Service O&M / Lookup Workflow
Scenario: "What inference services are running in my workspace?"
cloudrobo infer list --workspace-id <ws> [--status <status>] [--model-id <mid>] [--name <name>] [--model-name <mn>] [--model-version-id <mvid>] [--model-version-name <mvn>] [--user-name <un>] [--user-id <uid>]+ pagination (--limit/--offset) and sorting (--sort-key/--sort-dir).cloudrobo infer show --service-id <sid>for a full config snapshot.- Report status and key fields (model, flavor, status, pool).
Service Start/Stop Workflow
Scenario: "Stop the inference service behind this API." / "Bring it back up."
- Confirm the service via
show --service-id <sid>. cloudrobo infer stop --service-id <sid>orstart --service-id <sid>(mutating; confirm before executing).- Poll
showuntil the desired terminal state (STOPPED/RUNNING).
Log Diagnosis Workflow
Scenario: "Why is my deployed service failing? Show me its logs."
cloudrobo infer list-logs --service-id <sid> --start-time <ms> --end-time <ms>— both timestamps are milliseconds (13-digit). Optional:--keywords,--limit,--line-num,--is-count,--highlight,--is-desc.- Correlate log lines with
showstatus (e.g.CREATE_FAILED/START_FAILED). - Suggest remediation (pool capacity, model artifact, health-check config).
Service Update / Deletion Workflow
Scenario: "Reconfigure this service" / "Shut down and remove this service."
- Update —
cloudrobo infer update --service-id <sid> [--description <desc>] [--model-ext-metadata <json>] [--dry-run](mutating; confirm).updateonly supports--descriptionand--model-ext-metadata; changing image/flavor/model/pool/stop-schedule is not supported — usedelete+createto rebuild. - Delete —
cloudrobo infer delete --service-id <sid> [--dry-run](mutating; irreversible; confirm). It removes only the service, not the model asset — delete assets through the CloudRobo asset skill (cloudrobo asset delete-asset).
Combined Workflow A — Deploy a trained model (infer + train + asset)
Scenario: "I trained a VLA model; deploy it as an inference service."
- Resolve workspace (
cloudrobo workspace current). - Query the model (
cloudrobo asset list-assets --catalog-id <asset_catalog_id> --type model) →asset_id. cloudrobo asset show-asset --asset-id <asset_id>→latest_version_id; verifyONLINE_DEPLOYMENT=ENABLE.cloudrobo resource list-pools --resource-type MODELARTS→ user selectsresource_idandflavor.- A trained model is a space asset → Variant B of Step 7: run Step 5 auto-discovery and carry whatever was discovered.
cloudrobo infer create ...(Variant B) →cloudrobo infer wait-deploy --service-id <sid>(do NOT callstart— the service auto-deploys).- Report the service
idand status; the service is now consumable.
Core Commands
cloudrobo infer <command> [OPTIONS]
| Subcommand | Description | Key options |
|---|---|---|
create | Deploy a new inference service | --name, --flavor, --model-json, --workspace-id, --pool-type, --stop-schedule-json (required); --pool-id optional (dedicated pools only) |
wait-deploy | Poll until deployment completes | --service-id, --timeout |
list | List inference services | --workspace-id, --status, --limit, --offset |
show | Show service detail | --service-id |
start / stop | Start or stop a service | --service-id |
update | Update service config | --service-id, --description, --model-ext-metadata |
delete | Delete a service | --service-id |
list-logs | Query service logs | --service-id, --start-time (ms), --end-time (ms), --keywords |
SDK path: when CLI is inconvenient (dynamic JSON, cross-package queries), use
InferClient— one consolidated snippet for the five main calls (create/show/list/list-logs/wait-deploy) lives inreferences/service-config-catalog.md→ "InferClient Main-Chain Snippet". Parameter-resolution table and edge cases: same file → "Parameter Resolution & Confirmation", "Edge Cases". SDK exposes 9 methods, CLI exposes 9 commands (0 gaps);wait-deployis a client-side polling helper in both.Return identifier:
create/show/list/wait-deployidentify the service with theidfield (some API/SDK docs call itservice_id). Use that value as--service-idfor all downstream commands — there is no top-levelservice_idkey in create/show responses.
Parameter Confirmation
Resolve every value from query commands, present it to the user, then execute. Never hardcode
IDs or flavors; mutating commands (create / start / stop / update / delete) need an
explicit confirmation first.
| Parameter | Required | Resolution |
|---|---|---|
--workspace-id | create / list | cloudrobo workspace current (or list + use) |
--model-json | create | model_id from asset search, model_version_id = latest_version_id from show-asset |
--flavor | create | cloudrobo resource list-pools --resource-type MODELARTS → config.flavor |
--pool-type | create | SHARED / DEDICATED from the selected pool |
--pool-id | dedicated pool only | pool-<resource_id> from the selected pool |
--stop-schedule-json | create | {"duration": <N>, "time_unit": "MINUTES"} (backend-required) |
--service-id | show / start / stop / update / delete / logs / wait-deploy | id returned by create, show or list |
--dry-run | create / update / delete | add to preview parameter assembly; no resource is created or changed |
Reference Documents
- CLI Installation Guide — installation, AK/SK, region, workspace
- IAM Policies — least-privilege credential & access model
- Verification Method — verification levels and cases (negative cases are marked
EXPECT-FAIL) - Dataflow Diagram — Mermaid data flow diagrams
- Acceptance Criteria — acceptance criteria
- Service Config Reference — InferServiceDto fields, health checks, status, logs, parameter auto-discovery, InferClient main-chain snippet, parameter resolution, edge cases, coverage matrix
Edge Cases
See
references/service-config-catalog.md→ "Edge Cases" for the full table (missing model_id, invalid JSON, wrong timestamp unit, 403 permission deny, 500 internal error, missing stop-schedule, r2c config fallback, envs format mismatch, cross-skill invocation).
Verification Method
Specification compliance and functional smoke both run the same scripted suite:
bash scripts/test-cli-commands.sh
The script runs a one-time preflight (CLI present, infer registered, AK/SK present;
region is reported when configured, otherwise the client default applies), executes the
read-only and dry-run cases in one batch, scores negative cases as EXPECT-FAIL
(pass means a non-zero exit code), and exits non-zero when any case fails.
Test Cases
See templates/test-vars.json for the full case list (deployment, wait-deploy, lifecycle,
logs, safety). Cases marked "result": "SKIP" are mutating and never auto-run; cases marked
"negative": true must exit non-zero.
Verification Checklist
- After
create, service appears inlistwith correct status - After
wait-deploy, status is no longerDEPLOYING(or timeout/failure is reported with log guidance) - After
start/stop,showreflects the new status - After
delete,showreturns not-found list-logswith ms timestamps returns log lines; keyword filter works- Negative cases (
../service_id, malformed JSON, missing--name/--model-json) exit non-zero with the client-side error text (ClickMissing option ...) - Mutating operations (especially start) prompt for user confirmation
Best Practices
- Resolve each
createparameter via query commands, then let the user choose — never hardcode - Model source drives parameter policy: resolve the source (Step 2) first, then apply the Model Source → Parameter Policy table. Plaza models carry required core params only; space asset / custom models run Step 5 auto-discovery
- Model search:
cloudrobo asset list-publication-assets --actions ONLINE_DEPLOYMENT --action-status ENABLEfor deployable plaza models;cloudrobo asset list-assets --catalog-id <id>for workspace models;cloudrobo asset search-assets --keyword "<kw>"for fuzzy search --model-json'smodel_version_idmust belatest_version_idfromshow-asset, NOTactions[].algorithm.version_id- Always include
--stop-schedule-json '{"duration": N, "time_unit": "MINUTES"}'increate; omit--pool-idunless deploying to a dedicated pool - Use
wait-deployaftercreate(5s interval, 600s default). Do NOT callstartaftercreate— the service auto-deploys; re-invokewait-deployif it returns whileCREATING - Use
--dry-runoncreateto validate parameter assembly before submission - Report health-check pickup as part of deployment verification
- Use
list-logswith--keywordsto isolate errors fast; remember ms timestamps - Keep
internet_access_enableOFF unless the user explicitly needs outbound access - Mask sensitive envs/values; never echo credentials
- Combine with workspace (
cloudrobo workspace current) and asset skills to resolve context; combine with dispatch to execute embodied tasks
- Downloads
- Security audit
- Pass
- Last updated
- 2d ago
- Current version
- v1.0.5
- License
- MIT-0
