Install
openclaw skills install @erickeyhu-hug/huawei-cloud-modelarts-training-diagnosisHuawei Cloud ModelArts training job fault diagnosis skill. Uses hcloud CLI to call ModelArts training job log/event APIs, analyzes training job failures/timeouts/stuck jobs, locates customer training code issues, and provides diagnosis conclusions with fix suggestions and confidence levels. Scenarios: training job failure (status.phase=Failed), timeout (Timeout), abnormal (Abnormal), stuck jobs. Triggers: training job failure, training job timeout, training job stuck, ModelArts training diagnosis, 训练任务失败排查, 训练作业异常分析.
openclaw skills install @erickeyhu-hug/huawei-cloud-modelarts-training-diagnosisThis skill provides automated fault diagnosis for Huawei Cloud ModelArts training jobs. It calls ModelArts log and event APIs via hcloud CLI to collect runtime information, analyzes training job failures/timeouts/stuck jobs, and outputs diagnosis conclusions with fix suggestions and confidence levels.
User Input
↓
Phase 1: Task Discovery (ListTrainingJobs)
↓
Phase 2: Status Assessment (ShowTrainingJobDetails)
↓
[Early Exit if traceback found in status.task_statuses[].message]
↓ (if no traceback)
Phase 3: Information Collection
├─ Main Path: ListTrainingJobEvents, ListTrainingJobStages
└─ Extended Path: ShowTrainingJobLogsPreview, ShowObsUrlOfTrainingJobLogs
↓
Phase 4: Analysis (confidence-based inference)
↓
Phase 5: Output (diagnosis report + fix suggestions)
hcloud version should return version >= 7.2.2~/.hcloud/config.jsoncn-north-4project_id configured in profileskipSecureVerify=true (for WSL environment)Verification command:
hcloud configure list
This skill requires read-only permissions for ModelArts training APIs.
Required permissions: See references/iam-policies.md
Permission failure handling:
references/iam-policies.mdAll commands follow the standard hcloud format:
hcloud ModelArts <Operation> --param1=value1 --param2=value2 --cli-region=<region>
Key conventions:
ModelArts (PascalCase)ShowTrainingJobDetails)--cli-region=<value> (default: cn-north-4)--cli-output=json (for agent processing)--cli-query="<expression>" (to reduce output)Example:
hcloud ModelArts ShowTrainingJobDetails \
--cli-region=cn-north-4 \
--cli-output=json \
--training_job_id="<TRAINING_JOB_ID>"
This skill follows a 5-phase diagnosis workflow:
ListTrainingJobs to find ID + status.phaseShowTrainingJobDetails to get job statusstatus.phase: "Failed"/"Timeout"/"Abnormal" = real fault, "Running"/"Success" = false alarm, "Initializing" = pending observationstatus.task_statuses[].task_id for subsequent log APIsstatus.task_statuses[].message contains full Python traceback, diagnosis can be completed at HIGH confidence without calling Phase 3 APIsMain path (always run):
ShowTrainingJobDetails → status.phase, status.task_statuses[].message, status.task_statuses[].task_id, status.failureAnalysisResultListTrainingJobEvents(level=Error) → error event listListTrainingJobStages → check which stage is stuckExtended path (conditional):
4. ShowTrainingJobLogsPreview → preview logs (find traceback/error lines)
5. ShowObsUrlOfTrainingJobLogs → OBS full log download link (5min valid)
Detailed flow: See references/diagnosis-flow.md
ListTrainingJobs — Scan all abnormal training jobs
hcloud ModelArts ListTrainingJobs \
--cli-region=cn-north-4 \
--cli-output=json \
--cli-query="items[?status.phase=='Failed' || status.phase=='Timeout' || status.phase=='Abnormal'].{job_id: metadata.id, name: metadata.name, phase: status.phase}"
ShowTrainingJobDetails — Get job status + error info
hcloud ModelArts ShowTrainingJobDetails \
--cli-region=cn-north-4 \
--cli-output=json \
--training_job_id="<TRAINING_JOB_ID>"
Key response fields:
metadata.id, metadata.name — job identifierstatus.phase — job status ("Failed", "Running", "Success", etc.)status.task_statuses[].message — full Python traceback or error message (primary evidence)status.task_statuses[].exit_code — integer exit codestatus.task_statuses[].task_id — task ID for log APIsstatus.failureAnalysisResult.analysis_results[] — platform's automatic diagnosisListTrainingJobEvents — Get error events
hcloud ModelArts ListTrainingJobEvents \
--cli-region=cn-north-4 \
--cli-output=json \
--level=Error \
--limit=100 \
--training_job_id="<TRAINING_JOB_ID>"
ListTrainingJobStages — Check stage checkpoints
hcloud ModelArts ListTrainingJobStages \
--cli-region=cn-north-4 \
--cli-output=json \
--training_job_id="<TRAINING_JOB_ID>"
ShowTrainingJobLogsPreview — Preview logs (find traceback)
hcloud ModelArts ShowTrainingJobLogsPreview \
--cli-region=cn-north-4 \
--cli-output=json \
--training_job_id="<TRAINING_JOB_ID>" \
--task_id="<TASK_ID>"
ShowObsUrlOfTrainingJobLogs — Get OBS full log download link (5min valid)
hcloud ModelArts ShowObsUrlOfTrainingJobLogs \
--cli-region=cn-north-4 \
--cli-output=json \
--training_job_id="<TRAINING_JOB_ID>" \
--task_id="<TASK_ID>"
Complete command templates: See references/hcloud-command-templates.md
| Parameter | Required | Type | Description | Default |
|---|---|---|---|---|
training_job_id | Yes | String | Training job ID (e.g., from ListTrainingJobs) | None |
task_id | Conditional | String | Task ID within training job (from ShowTrainingJobDetails.status.task_statuses[].task_id) | None |
--cli-region | No | String | Huawei Cloud region | cn-north-4 |
--cli-output | No | String | Output format (json/table/tsv) | json |
--cli-query | No | String | JMESPath expression to filter output | None |
Notes:
task_id is required for log APIs, obtained from ShowTrainingJobDetails.status.task_statuses[].task_idcn-north-9, cn-east-3), but project_id must be configured for that regionThis skill outputs diagnosis reports in Markdown format.
## 诊断结论
| 项目 | 值 |
|------|-----|
| 任务 | `<metadata.name>` (`<metadata.id>`) |
| 当前状态 | `<status.phase>` |
| 故障级别 | Fault / Abnormal / 疑似异常 / 正常 |
## 根因
<一句话描述什么导致了作业失败>(置信度:HIGH/MEDIUM/LOW)
## 修复建议
### 方案 1
1. <step 1>
2. <step 2>
> 注意:以上操作涉及 [只读查询 / 需要用户确认后手动执行的变更]
## 后续步骤
[信息不足时] 当前信息不足以确定根因,建议补充以下信息:
- 调用 `<API>` 获取 `<field>`
- 或手动检查 `<environment/configuration>`
Strict constraint: Generate the report strictly following the template above. Keep analysis reasoning internal, not in the report.
status.task_statuses[].message contains full Python traceback with identifiable root cause, or status.failureAnalysisResult.analysis_results[].description provides explicit error description, or events contain clear errorstatus.task_statuses[].exit_code non-zero but message is empty/vagueDetailed confidence rules: See references/confidence-rules.md
This skill follows a 3-tier verification approach:
hcloud version
Success criteria: Returns version >= 7.2.2
hcloud configure list
Success criteria: Displays valid AK/SK configuration with region=cn-north-4
hcloud ModelArts ListTrainingJobs --cli-region=cn-north-4
Success criteria: Returns HTTP 200 and training job list
Detailed verification steps: See references/verification-method.md
ShowTrainingJobDetails returns full Python traceback in status.task_statuses[].message, skip Phase 3 APIs (ListTrainingJobEvents, ListTrainingJobStages, ShowTrainingJobLogsPreview, ShowObsUrlOfTrainingJobLogs)ShowObsUrlOfTrainingJobLogs and prompt user to download (5min valid link)cn-north-4project_id is configured for that regionhcloud configure init or explicitly pass --project_id if region profile lacks project_id| Document | File | Description |
|---|---|---|
| API Catalog | references/api-catalog.md | 6 training diagnosis APIs, status phases, response structure, event levels |
| Diagnosis Flow | references/diagnosis-flow.md | 5-phase diagnosis workflow in detail with early exit principle |
| Command Templates | references/hcloud-command-templates.md | Complete hcloud command templates for each API |
| Confidence Rules | references/confidence-rules.md | Confidence level definitions, evidence mapping, output contracts |
| CLI Installation Guide | references/cli-installation-guide.md | hcloud CLI installation, configuration, verification |
| IAM Policies | references/iam-policies.md | Required IAM permissions and policy JSON |
| Verification Method | references/verification-method.md | 3-tier verification steps |
| Acceptance Criteria | references/acceptance-criteria.md | Pass/fail criteria for skill testing |
status.task_statuses[].message may be empty for some failures; in such cases, Phase 3 APIs become necessary