โ† Back to skills
extension
Category: OtherAPI key required

Huawei Cloud ModelArts Skill

Huawei Cloud ModelArts platform integration. Modular design, OBS as primary storage support, environment variable authentication, includes pool plugin management and node configuration template queries.

personAuthor: user_980833a7hubcommunity

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

  1. Modular Design - One file per function, clean structure, easy to maintain
  2. OBS as Primary Storage - Notebook can use OBS buckets directly as root filesystem
  3. OBS Bucket Management - Built-in create/delete/list OBS bucket functions
  4. Environment Variable Auth - Zero configuration for local/CI environments
  5. Unified API Pattern - All functions use consistent calling pattern
  6. Clean Deliverables - No temp scripts, no debug code, no redundant files
  7. Node Pool Management - Independent node pool lifecycle management
  8. Plugin Management - Resource pool plugin listing and creation (ListPoolPlugins, CreatePoolPlugin)
  9. Node Configuration Template Query - Query node configuration template details (ShowNodeConfigTemplate)
  10. Common Infrastructure - Extracted shared infrastructure, improved code reuse
  11. Training Job Management - Full lifecycle: create/list/stop/delete training jobs
  12. Inference Service Management - Old v1 API: create/list/start/stop/update/delete inference services
  13. Workspace & Authorization - Workspace CRUD, auth mode, IAM authorization, quotas, scheduled events
  14. 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 |