Coding

huawei-cloud-sac-yolo

Try it

"Deploy YOLO training platform on Huawei Cloud with GPU ECS via Terraform. Use when building or managing a YOLO GPU training environment. Trigger: deploy YOLO, YOLO training, GPU training, 部署YOLO, YOLO训练, GPU训练, 视觉模型训练"

What it does

"Deploy YOLO training platform on Huawei Cloud with GPU ECS via Terraform. Use when building or managing a YOLO GPU training environment. Trigger: deploy YOLO, YOLO training, GPU training, 部署YOLO, YOLO训练, GPU训练, 视觉模型训练"

The skill document

Huawei Cloud YOLO Training Platform

Overview

Deploy the "Quickly Build YOLO Visual Model Training Platform" solution end-to-end on Huawei Cloud. The platform provides GPU-accelerated ECS for YOLO model training, with full infrastructure provisioning via Terraform.

Architecture: ECS (GPU, P2s/Pi2) and VPC and Subnet and Security Group (ICMP/SSH/HTTP) and EIP (300 Mbit/s) and EVS (100 GB system + 500 GB data) and CBR (backup vault + policy). Cloud-init installs Docker and launches the YOLO container on GPU.

Tool chain: Playwright CLI (solution info extraction) + Python 3.8+ (helper scripts) + Terraform 1.15.4+ (declarative deployment). No KooCLI — all resource operations through Terraform.

Prerequisites

  • Python 3.8+, Playwright CLI, Terraform 1.15.4+ — see CLI Installation Guide
  • Huawei Cloud AK/SK via environment variables (HW_ACCESS_KEY, HW_SECRET_KEY); if not set, prompt user to manually edit terraform.auto.tfvars.json to fill in AK/SK
  • IAM user with sufficient permissions or rf_admin_trust agency — see IAM Policies

Security

  • 🚫 Never expose AK/SK in conversation or output
  • 🚫 Never ask user to type AK/SK in chat
  • ✅ Prefer IAM users over primary account
  • ✅ Modification ops (apply, destroy) require explicit user confirmation

Core Commands

Placeholder values (see Parameters for per-OS resolution):

PlaceholderLinux / macOSWindows
``python3python
``./scripts./scripts
``/tmp$env:TEMP
# 1. Extract solution info
 /extract_sac_deploy_info.py \
  --url "https://www.huaweicloud.com/solution/implementations/quickly-build-a-yolo-training-platform.html" \
  --out /sac_selected.json

# 2. Download and normalize template
 /download_tf_template_file.py \
  --url "https://documentation-samples.obs.cn-north-4.myhuaweicloud.com/solution-as-code-publicbucket/solution-as-code-moudle/quickly-build-a-yolo-training-platform/quickly-build-a-yolo-training-platform.tf" \
  --out-dir /yolo-workdir

 /normalize_tf_providers.py /yolo-workdir \
  --region "cn-north-4"

# 3. List variables for review
 /list_tf_variables.py /yolo-workdir

# 4. Deploy
terraform init
terraform plan
# ⛔ STOP — Review the plan output above. Do NOT auto-apply.
# Confirm with the user (AskUserQuestion or equivalent) before proceeding.
# Only after explicit user confirmation:
terraform apply

# 5. Add YOLO UI security group rule
# Prompt user to manually add an ingress rule for TCP port 8001
# via Huawei Cloud console (VPC > Security Groups > Add Rule).
# Use restricted CIDR — do NOT open to all addresses.
# Wait for user confirmation before continuing.

# 6. Verify
terraform state list
terraform output -json

# 7. Cleanup
terraform destroy

Workflow

1. Extract solution info

 /extract_sac_deploy_info.py \
  --url "" \
  --out /sac_selected.json

After extraction, display the results to the user:

  • Solution name: title field from output JSON
  • Estimated price: estimated_price_text field
  • Deploy links: list each text and url from deploy_links array
  • If title or estimated_price_text is empty, warn the user and suggest manual verification on the solution page

2. Download and normalize template

 /download_tf_template_file.py \
  --url "" \
  --out-dir /yolo-workdir

 /normalize_tf_providers.py /yolo-workdir \
  --region "cn-north-4"

normalize_tf_providers.py writes terraform.auto.tfvars.json (including region and other parameters). If environment variables HW_ACCESS_KEY/HW_SECRET_KEY are not set, AK/SK fields are left empty. Prompt the user to manually edit the file to fill in AK/SK, then continue to the next step.

3. Confirm variables

 /list_tf_variables.py /yolo-workdir

Review with user. Block apply if sensitive variables are empty/weak.

4. Deploy

STOP — Before running terraform apply, review the terraform plan output and confirm with the user (AskUserQuestion or equivalent). Do NOT auto-apply. Only proceed after explicit user confirmation.

5. Add YOLO UI security group rule

The Terraform template does not include an ingress rule for TCP port 8001, which is required for the YOLO training platform web UI. After deployment, prompt the user to manually add an ingress rule for TCP port 8001 via Huawei Cloud console (VPC > Security Groups > Add Rule). Use your own IP or a restricted CIDR — do NOT open to all addresses.

6. Verify

See Verification Method and Acceptance Criteria.

7. Cleanup

Parameters

ParameterRequiredDefaultConstraint
regionYescn-north-4Only supported region
AK/SKYesEnv vars HW_ACCESS_KEY/HW_SECRET_KEY; if absent, prompt user to edit tfvars.json
ecs_passwordYes8-26 chars, mixed case + digit + special
ecs_flavorNop2s.2xlarge.8
system_disk_sizeNo10040-1024 GB
data_disk_sizeNo50040-1024 GB
bandwidth_sizeNo3001-300 Mbit/s
charging_unitNomonthmonth or year
charging_periodNo1

Post-Deploy Output

  • terraform output -json — includes access_instructions with YOLO platform URL
  • YOLO UI: http://:8001 (allow ~10 min for cloud-init)
  • Verify: ssh root@ "docker ps" and ssh root@ "nvidia-smi"

Output Format

terraform output -json returns JSON with the following key fields:

{
  "access_instructions": { "value": "http://:8001" },
  "ecs_eip":             { "value": "" },
  "ecs_id":              { "value": "" },
  "vpc_id":              { "value": "" }
}

All script outputs are in JSON format: extract_sac_deploy_info.py outputs solution info JSON, list_tf_variables.py outputs variable list JSON.

Verification

Verify deployment results step by step:

  1. Template extraction — Check /sac_selected.json contains solution_name, price fields
  2. Template download — Confirm .tf files exist under /yolo-workdir and terraform validate passes
  3. Variable confirmation — Sensitive variables (AK/SK, password) are not empty in list_tf_variables.py output
  4. Deploymentterraform plan shows no errors; user confirmed deployment; after apply, terraform state list shows all expected resources
  5. Service reachability — Wait 10-15 min for cloud-init, then curl -s http://:8001 returns 200
  6. GPUssh root@ "nvidia-smi" shows GPU device, ssh root@ "docker ps" shows YOLO container running

See Verification Method and Acceptance Criteria for details.

Best Practices

  • Always terraform plan before apply
  • Start with charging_unit=month; switch to year after validation
  • Allow 10-15 min post-deploy for cloud-init
  • Monitor GPU via nvidia-smi; adjust ecs_flavor if underutilized

Reference Documents

DocumentDescription
CLI Installation GuideInstall Python, Playwright CLI, Terraform
IAM PoliciesPermissions, agency setup, failure handling
Verification MethodStep-by-step verification per workflow step
Acceptance CriteriaFull deployment acceptance checklist
Related CommandsTerraform, scripts, remote access reference

Notes

  • Only cn-north-4 region supported
  • terraform.auto.tfvars.json is sensitive — never commit to VCS
  • normalize_tf_providers.py writes region to tfvars; AK/SK left empty if env vars not set, user must fill manually
  • Tool chain: Playwright CLI + Python + Terraform — no KooCLI

Related skills

"Deploy Dify - an open-source LLM app development platform on Huawei Cloud with ECS via Terraform. Use when the user wants to deploy Dify (or an LLM application development platform) on Huawei Cloud and directly implement it with a Terraform/SAC template. Trigger: Dify 一键部署, Dify development, Agentic workflow, build AI App"

Deploy NewAPI LLM Gateway on Huawei Cloud via Terraform. Use when deploying a unified LLM API gateway for multi-model management, load balancing, and key rotation. Trigger: deploy NewAPI, NewAPI gateway, LLM gateway, 部署NewAPI, NewAPI网关, LLM网关

by huaweicloud-skills-team

Generate Huawei Cloud Terraform configurations and execute deployment with user-guided approval. Use this skill when users want to create Huawei Cloud infras...

1 installs

Manage Huawei Cloud ModelArts training jobs and related resources through full lifecycle operations via hcloud CLI. Covers 52 API interfaces across 8 functional domains: training job management, algorithm management, training job tags, training experiments, training job events, model import, auto search (hyperparameter tuning), and training image save. All write operations require user confirmation before execution. Triggers include: "ModelArts training", "训练作业", "模型训练", "创建训练作业", "查询训练作业", "停止训练作业", "删除训练作业", "算法管理", "超参配置", "training job", "training management", "create training", "ModelArts 训练", "训练实验", "自动搜索", "超参调优".

1 installs

Provides guidance for Huawei Cloud KooCLI command-line tool operations. Covers KooCLI installation, IAM authentication configuration, access credential confi...

by huaweicloud-skills-team1 installs

Invoke this skill to capture poor experiences and distill them into high-value requirements (Voice of Developer). Use when user encounters any Huawei Cloud related issues, like user expresses dissatisfaction, encounters errors, or wants to report issues/suggestions.Triggers include: "体验差","反馈问题","反馈建议","这个有bug","拒绝了请求","报告问题","反馈体验","report a problem","report a suggestion","bug report","poor experience","voice of developer"

by huaweicloud-skills-team

More from huaweicloud-skills-team

Browse all skills

Manage Huawei Ascend NPUs with natural language commands that translate to npu-smi, locally or over SSH.

by huaweicloud-skills-team7 installs

Deploy and test LLM, VL, Embedding, and Rerank models on Huawei Cloud Ascend 910B DevServer with single- or dual-node topologies.

by huaweicloud-skills-team7 installs

Read-only queries against Huawei Cloud resources for inventory, verification, and parameter discovery.

by huaweicloud-skills-team6 installs

Query Huawei Cloud IAM resources (users, groups, policies, agencies, AK/SK, MFA, security settings) read-only via local Python SDK.

by huaweicloud-skills-team6 installs