SuperAPI AI Directory

ascend-envcheck

Deployment & operations

View repository

Updated 10-15 19:58

About this skill

Ascend Environment Check

Trigger Conditions

Activate this skill when the user raises the following needs:

  • Asks about cluster status / K8s cluster status
  • Performs environment check / Ascend environment check
  • Checks NPU device status
  • Verifies node label configuration

Important Prerequisites/Constraints

  • envCheck.sh Depends on kubectl(these dependencies are onthe machine where the script actually runsand must exist; some check content depends on the jq tool, which is not mandatory. If the jq tool is needed but not available, you may prompt the user to install it)
  • Execution on Windows systems is not supported.
  • Do not leak the user's password/private key content in the returned content; sensitive fields must be masked in logs.

Required Information

Must obtain the following from the user before execution:

  • Master IP: IP address of the K8s master node
  • Username: SSH login username (usually root)
  • Authentication Method(choose one):
    • Password: SSH login password
    • Key Path: SSH private key file path (e.g., ~/.ssh/id_rsa)

Connection Method

Method 1: Password Authentication

检查集群状态,IP 192.168.9.143,用户 root,密码 ***

Method 2: SSH Key Authentication

检查集群状态,IP 192.168.9.143,用户 root,密钥 ~/.ssh/id_rsa

The key method requires no password and is suitable for environments already configured with SSH key login.

Execution Method

  1. Connect to the master node via SSH (password or key)
  2. Upload scripts/envCheck.sh to the target host's /tmp/ directory, and append the current time to the filename, e.g., /tmp/envCheck_20260316_174737.sh
  3. Execute the script and output the execution result (without any modification or summarization)
  4. Summarize, explain, and format the results, and predict the operations that may be needed next
  5. After execution ends, delete the temporary script uploaded to the target host (ensure that only the corresponding script is safely deleted; no other files may be deleted)

Script Parameters

envCheck.sh Supports the following parameters:

用法: ./envCheck.sh [期望NPU卡数量] [产品类型] [-r|--resources]
Parameter Description Default Value
Expected NPU card count Expected number of NPU cards 16
Product type Product configuration type none
-r, --resources Enable memory and CPU resource check Disabled

Optional Product Types

Type Description
none Do not check labels (default)
full-910 Atlas 800 Training Server (NPU fully configured)
half-910 Atlas 800 Training Server (NPU half configured)
a2-pod Atlas 800T A2 / Atlas 900 A2 PoD
a3-superpod Atlas 900 A3 SuperPoD Super Node
a3-box8 A200T A3 Box8 Super Node Server
a2-infer Atlas 800I A2 Inference Server
a2-box A200I A2 Box Heterogeneous Component
a2-box16 Atlas 200T A2 Box16 Heterogeneous Subrack
train-card Training Server (Atlas 300T Training Card)
infer-card Inference Server (Atlas 300I Inference Card)
infer-series Atlas Inference Series Products
soc-core Atlas 200I SoC A1 Core Board

Execution Example

Password authentication:

检查集群状态,IP 192.168.9.143,用户 root,密码 ***

Key authentication:

检查集群状态,IP 192.168.9.143,用户 root,密钥 ~/.ssh/id_rsa

With script parameters:

检查集群状态,8卡 half-910 配置,检查资源

Output Requirements

First output the execution result of envCheck.sh directly as-is, including:

  • Output of all check items
  • Error messages (if any)
  • Final check result

Then summarize, explain, or format the output, as well as possible next steps.

Technical Implementation

Password Authentication Method

# 1. 上传脚本
sshpass -p '<password>' scp -o StrictHostKeyChecking=no \
  scripts/envCheck.sh <user>@<ip>:/tmp/envCheck.sh

# 2. 执行脚本
sshpass -p '<password>' ssh -o StrictHostKeyChecking=no \
  <user>@<ip> "chmod +x /tmp/envCheck.sh && bash /tmp/envCheck.sh <args>"

SSH Key Authentication Method

# 1. 上传脚本
scp -o StrictHostKeyChecking=no -i <key_path> \
  scripts/envCheck.sh <user>@<ip>:/tmp/envCheck.sh

# 2. 执行脚本
ssh -o StrictHostKeyChecking=no -i <key_path> \
  <user>@<ip> "chmod +x /tmp/envCheck.sh && bash /tmp/envCheck.sh <args>"

Dependencies

  • Local:
    • sshpass (required for password authentication)
    • ssh/scp (used for key authentication)
  • Remote: kubectl, jq (optional, some check items will degrade without jq)

Resources

scripts/

  • envCheck.sh - Main check script, checks K8s cluster, NPU devices, node labels, resource status, etc.