ModelArts Skill
Huawei Cloud ModelArts platform integration skill, featuring modular design, OBS as Notebook primary storage, and environment variable auto-authentication.
๐ Security Model (CRITICAL)
All credentials handled internally, never returned to LLM:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ LLM / AIAgents โ
โ โ NEVER sees: AK, SK, Security Token, raw credentials โ
โ โ
ONLY sees: Masked status, API results, resource IDs โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ (Safe data only)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ auth_manager.py (Secure Vault) โ
โ ๐ Credentials stored in memory only โ
โ โ
Only masked data exposed externally โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ (Secure session)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Module Functions (Secure SDK Wrapper) โ
โ Unified pattern: access.sdk().execute(api_func, ...) โ
โ Returns: Standard format API responses only โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Authentication Methods
| Mode | How It Works |
|------|-------------|
| Notebook Mode | Auto-detects ModelArts environment, zero configuration |
| Local Mode | Reads MODELARTS_AK/SK/PROJECT_ID/REGION environment variables |
๐ Module Routing
Use keywords to find the corresponding reference file for function index and locations.
| Keyword | Reference File |
|---------|----------------|---------------|--------|
| notebook, jupyter, image, obs, flavor, cluster, auth | references/notebook.md |
| pool, resource pool, dedicated pool, node, workload, os network, plugin | references/pool.md |
| node pool, nodepool, scale node, node group, plugin, config template | references/node_pool.md |
| train, training job, ่ฎญ็ปไปปๅก | references/train.md |
| infer1.0, inference, service, ๆง็ๆจ็ๆๅก,ๆง็ๅจ็บฟๆๅก | references/infer_v1.md |
| infer2.0, inference, service, ๆฐ็ๆจ็ๆๅก๏ผๅจ็บฟๆๅก,ๆฐ็ๅจ็บฟๆๅก | references/infer_v2.md |
| management, workspace, authmode, authorization, quota, tag, scheduled event | references/management.md |
| swr, image repo, ้ๅไปๅบ | references/swr.md |
| common, auth, api helper, format result, decorator | references/common.md |
๐ฆ Module Architecture
modelarts/
โโโ scripts/
โ โโโ common_module/ # ่ทจๆจกๅๅ
ฑไบซๅบ็ก่ฎพๆฝ
โ โ โโโ __init__.py
โ โ โโโ _bootstrap.py # ็ปไธๅผๅฏผ
โ โ โโโ auth.py # ่ฎค่ฏ็ฎก็
โ โ โโโ api_helper.py # API ่ฐ็จๅฐ่ฃ
โ โ โโโ result.py # ่ฟๅๆ ผๅผ็ปไธ
โ โ
โ โโโ notebook_module/ # Notebook & ้ๅ็ฎก็
โ โโโ pool_module/ # ่ตๆบๆฑ ็ฎก็
โ โโโ node_pool_module/ # ่็นๆฑ ็ฎก็
โ โโโ train_module/ # ่ฎญ็ปไปปๅก็ฎก็
โ โโโ infer_v1_module/ # ๆง็ๆจ็ๆๅก็ฎก็
โ โโโ infer_v2_module/ # ๆฐ็ๆจ็ๆๅก็ฎก็
โ โโโ management_module/ # ๅนณๅฐ็ฎก็: ๅทฅไฝ็ฉบ้ด/ๆๆ/้
้ข/ไบไปถ
โ โโโ swr_module/ # SWR ้ๅไปๅบ
โ โโโ __pycache__/
โ
โโโ references/
โโโ notebook.md
โโโ pool.md
โโโ node_pool.md
โโโ train.md
โโโ infer_v1.md
โโโ infer_v2.md
โโโ management.md
โโโ swr.md
โโโ common.md
โ Design Features
- Modular Design - One file per function, clean structure, easy to maintain
- OBS as Primary Storage - Notebook can use OBS buckets directly as root filesystem
- OBS Bucket Management - Built-in create/delete/list OBS bucket functions
- Environment Variable Auth - Zero configuration for local/CI environments
- Unified API Pattern - All functions use consistent calling pattern
- Clean Deliverables - No temp scripts, no debug code, no redundant files
- Node Pool Management - Independent node pool lifecycle management
- Plugin Management - Resource pool plugin listing and creation (ListPoolPlugins, CreatePoolPlugin)
- Node Configuration Template Query - Query node configuration template details (ShowNodeConfigTemplate)
- Common Infrastructure - Extracted shared infrastructure, improved code reuse
- Training Job Management - Full lifecycle: create/list/stop/delete training jobs
- Inference Service Management - Old v1 API: create/list/start/stop/update/delete inference services
- Workspace & Authorization - Workspace CRUD, auth mode, IAM authorization, quotas, scheduled events
- SWR Image Repository - Query training images from SWR
๐ฏ Quick Reference by Use Case
| What You Want To Do | Go To Module | |---------------------|-------------| | Start/Stop/Create/Delete Notebook | notebook_module | | Save Notebook to Image | notebook_module | | Attach/Detach OBS Storage | notebook_module | | Create/Delete OBS Buckets | notebook_module | | Create/Delete Dedicated Resource Pool | pool_module | | Batch Node Operations (Reboot/Delete/Lock/Resize) | pool_module | | Scale Node Pool Size | node_pool_module | | Create Additional Node Pools (different flavors) | node_pool_module | | List Resource Pool Plugins (ListPoolPlugins) | node_pool_module | | Create Plugin in Resource Pool (CreatePoolPlugin) | node_pool_module | | Query Node Configuration Template (ShowNodeConfigTemplate) | node_pool_module | | Create/Stop/Delete Training Job | train_module | | List Training Jobs (running/pending/completed) | train_module | | Create/Start/Stop/Delete Inference Service | infer_v1_module | | List/Get Inference Service Details | infer_v1_module | | List Models (custom/subscription) | infer_v1_module | | Create/Start/Stop/Delete Inference Service (ๆฐ็) | infer_v2_module | | List/Get Inference Service Details (ๆฐ็) | infer_v2_module | | Query Dedicated Pools & Flavors (ๆฐ็) | infer_v2_module | | Get Service Exec Login Info (ๆฐ็) | infer_v2_module | | Batch Delete Inference Services (ๆฐ็) | infer_v2_module | | Service Version Management (ๆฐ็) | infer_v2_module | | Service Events & Health Monitoring (ๆฐ็) | infer_v2_module | | Region Detection & Consistency (ๆฐ็) | infer_v2_module | | Create/Update/Delete Workspace | management_module | | Manage Authorization (add/delete/list) | management_module | | Query/Update Auth Mode | management_module | | List Quotas & Scheduled Events | management_module | | Query SWR Training Images | swr_module | | Infrastructure / Internal Tools | common_module |
Scan to contact