huawei-cloud-cce-env-assessment
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHuawei Cloud — CCE ENV Assessment Skill
华为云 — CCE 环境评估Skill
Overview
概述
Automatically collects evaluation metrics of the huawei cloud container environment, outputs metric scoring tables by dimension, and generates evaluation reports and improvement suggestions.
自动收集华为云容器环境的评估指标,按维度输出指标评分表,并生成评估报告与改进建议。
Prerequisites
前提条件
Prerequisite check: Huawei Cloud CLI (hcloud) >= 7.2.2 required Runto verify the version is >= 7.2.2, andhcloud versionto confirm a profile exists. If it is not installed or the version is too low, see references/koocli-installation-guide.md for the installation guide.hcloud configure list
bash
hcloud version
hcloud configure listPrerequisite check: Python >= 3.6 required Runto verify the version is >= 3.6.0 If it is not installed or the version is too low, The skill execution is interrupted proactively, and the user is prompted to install Python 3.6 or later. If the Python version is 3.6.x, run the following command to upgrade pip to the latest versionpython --versionpip3 install --user --upgrade 'pip<22'
前提条件检查:需安装华为云CLI(hcloud)>= 7.2.2 运行验证版本是否 >= 7.2.2,运行hcloud version确认配置文件已存在。 若未安装或版本过低,请查看 references/koocli-installation-guide.md 获取安装指南。hcloud configure list
bash
hcloud version
hcloud configure list前提条件检查:需安装Python >= 3.6 运行验证版本是否 >= 3.6.0 若未安装或版本过低,Skill会主动中断执行,并提示用户安装Python 3.6或更高版本。 若Python版本为3.6.x,请运行以下命令将pip升级至指定最新版本python --versionpip3 install --user --upgrade 'pip<22'
⚠️ Mandatory Execution Rules
⚠️ 强制执行规则
Rule 1: Step-by-step Confirmation
规则1:分步确认
After each step, you MUST:
- Print the completion status of the current step
- Show the output produced by that step
- Every Skill run starts from Step 1 — do NOT skip Step 1 and jump into later steps
- Strictly follow this Skill's rules and wait for user confirmation after every step
- Strictly follow the described flow; do not perform extra operations. If anything errors, return the error to the user as-is — do not try to fix it yourself
- All execution rules take precedence over efficiency
Do NOT chain multiple steps in a single run!
每完成一步后,必须执行以下操作:
- 打印当前步骤的完成状态
- 展示该步骤产生的输出内容
- 每次Skill运行都从步骤1开始——不得跳过步骤1直接进入后续步骤
- 严格遵循本Skill的规则,每一步后等待用户确认
- 严格按照描述的流程执行;不得执行额外操作。若出现错误,直接将错误返回给用户——不得自行尝试修复
- 所有执行规则优先于效率
禁止在单次运行中连续执行多个步骤!
Rule 2: Fixed Directories
规则2:固定目录
After each step, you MUST:
- Save all intermediate files under the directory
data/
每完成一步后,必须执行以下操作:
- 将所有中间文件保存至 目录下
data/
Rule 3: Permission Issues
规则3:权限问题
- When you hit a permission problem, try . If that does not resolve it, error out and abort the Skill flow
sudo
- 遇到权限问题时,尝试使用。若仍无法解决,则报错并终止Skill流程
sudo
Rule 4: Anti-skip Check
规则4:防跳过检查
Before executing each step, verify that its prerequisites are satisfied:
| Step | Prerequisite |
|---|---|
| Step 2: Environment check | Step 1 is complete; Huawei Cloud AK/SK have been obtained |
| Step 3: Container environment collection | Step 2 is complete with no errors; |
| Step 4: Metric scoring | Step 3 is complete; |
| Step 5: Report generation | Step 4 is complete; |
执行每一步前,验证其前提条件是否满足:
| 步骤 | 前提条件 |
|---|---|
| 步骤2:环境检查 | 步骤1已完成;已获取华为云AK/SK |
| 步骤3:容器环境收集 | 步骤2无错误完成; |
| 步骤4:指标评分 | 步骤3已完成;已生成 |
| 步骤5:报告生成 | 步骤4已完成;已生成 |
Rule 5: Information Collection Method
规则5:信息收集方式
- For every piece of information collected, prefer the Huawei Cloud KooCLI tool (commands)
hcloud
- 对于每一条收集的信息,优先使用华为云KooCLI工具(命令)
hcloud
Rule 6: Status Tracking
规则6:状态跟踪
📋 Cloud-Native Container Assessment — Status Board
├────────────────────────────────────────────┤
│ Step 1: Configuration [⏳ In progress]│
│ Step 2: Environment check [○ Pending] │
│ Step 3: Information collect [○ Pending] │
│ Step 4: Metric scoring [○ Pending] │
│ Step 5: Report generation [○ Pending] │
└────────────────────────────────────────────┘After each step, update the status board:
📋 Cloud-Native Container Assessment — Status Board
├────────────────────────────────────────────┤
│ Step 1: Configuration [✅ Done] │
│ Step 2: Environment check [✅ Done] │
│ Step 3: Information collect [✅ Done] │
│ Step 4: Metric scoring [✅ Done] │
│ Step 5: Report generation [⏳ In progress]│
└────────────────────────────────────────────┘📋 云原生容器评估 — 状态看板
├────────────────────────────────────────────┤
│ 步骤1:配置 [⏳ 进行中]│
│ 步骤2:环境检查 [○ 待执行] │
│ 步骤3:信息收集 [○ 待执行] │
│ 步骤4:指标评分 [○ 待执行] │
│ 步骤5:报告生成 [○ 待执行] │
└────────────────────────────────────────────┘每完成一步后,更新状态看板:
📋 云原生容器评估 — 状态看板
├────────────────────────────────────────────┤
│ 步骤1:配置 [✅ 已完成] │
│ 步骤2:环境检查 [✅ 已完成] │
│ 步骤3:信息收集 [✅ 已完成] │
│ 步骤4:指标评分 [✅ 已完成] │
│ 步骤5:报告生成 [⏳ 进行中]│
└────────────────────────────────────────────┘🔐 Permission Boundary
🔐 权限边界
The AI is allowed to:
AI允许执行的操作:
- Follow the SKILL steps exactly
- Invoke only the scripts specified in the SKILL
- Return errors as-is when problems occur
- 严格遵循SKILL步骤执行
- 仅调用SKILL中指定的脚本
- 出现问题时直接返回错误信息
The AI is forbidden to:
AI禁止执行的操作:
- Temporarily modify or bypass the workflow
- Switch to an alternative approach (e.g. fall back to Markdown when html fails)
- Modify any script or configuration without user consent
- Perform any operation not explicitly listed in the SKILL
- 临时修改或绕过工作流
- 切换到替代方案(例如当HTML生成失败时改用Markdown)
- 未经用户同意修改任何脚本或配置
- 执行SKILL中未明确列出的任何操作
Handling out-of-bounds operations
越界操作处理
Any out-of-bounds operation must stop immediately and wait for user confirmation. Continuing is forbidden.
任何越界操作必须立即停止,等待用户确认。禁止继续执行。
Core Workflows
核心工作流
Step 1: Configuration
步骤1:配置
Prompt the user for the environment configuration.
| Item | Description | Example |
|---|---|---|
| Huawei Cloud AK/SK | Access Key and Secret Key for Huawei Cloud API | AK/SK = HPUAN3EWCG... / 1Bt5sdDU.. |
| Region | Region where the container cluster lives | region = cn-north-4 |
| Cluster name | CCE cluster name (Step 1 only) | cce_name = dify-cce-cluster |
| Dockerfile source | Source code repository (containing the Dockerfile) | Dockerfile = https://github.com/langgenius/dify |
Once the user supplies the configuration, save the values into environment variables , , , , respectively.
HWC_AKHWC_SKCCE_RegionCCE_NAMEDockerfile_REPO_URLDiamond Gate 1: Get user confirmation before Step 2.
提示用户提供环境配置信息。
| 项 | 描述 | 示例 |
|---|---|---|
| 华为云AK/SK | 华为云API的访问密钥和密钥密码 | AK/SK = HPUAN3EWCG... / 1Bt5sdDU.. |
| 区域 | 容器集群所在的区域 | region = cn-north-4 |
| 集群名称 | CCE集群名称(仅步骤1需要) | cce_name = dify-cce-cluster |
| Dockerfile来源 | 包含Dockerfile的源代码仓库 | Dockerfile = https://github.com/langgenius/dify |
用户提供配置后,将值分别保存到环境变量 、、、、 中。
HWC_AKHWC_SKCCE_RegionCCE_NAMEDockerfile_REPO_URL关键节点1:进入步骤2前需获取用户确认。
Step 2: Environment Check
步骤2:环境检查
Using the configuration provided in Step 1, verify that the environment is reachable and that local runtime dependencies are present.
- Use with AK/SK to access the Huawei Cloud CCE environment and confirm it is reachable, If it is not installed or the version is too low, see references/koocli-installation-guide.md for the installation guide.
hcloud - Verify that the local Python environment is working correctly, Python version requirement is greater than 3.6, If the Python version is 3.6.x, run the following command to upgrade pip to the latest version
pip3 install --user --upgrade 'pip<22' - Check whether the Python dependency library is installed. Go to the references directory. If the Python version is 3.6.x, run the command . If the Python version is later than 3.7, Execute commands using a Python virtual environment
python3 -m pip install -r requirements.txt.pip3 install -r requirements.txt - Empty any historical files inside ; if
data/does not exist, create itdata/ - Empty any historical files inside ; if
artifacts/does not exist, create itartifacts/ - Once the checks complete, return the result to the user and wait for confirmation on whether to install dependencies or to continue
使用步骤1提供的配置,验证环境是否可达以及本地运行时依赖是否存在。
- 使用带有AK/SK的 访问华为云CCE环境,确认其是否可达。若未安装或版本过低,请查看 references/koocli-installation-guide.md 获取安装指南。
hcloud - 验证本地Python环境是否正常工作,Python版本要求大于3.6。若Python版本为3.6.x,请运行以下命令将pip升级至指定最新版本
pip3 install --user --upgrade 'pip<22' - 检查Python依赖库是否已安装。进入references目录,若Python版本为3.6.x,运行命令 ;若Python版本高于3.7,使用Python虚拟环境执行命令
python3 -m pip install -r requirements.txt。pip3 install -r requirements.txt - 清空 目录下的所有历史文件;若
data/不存在则创建该目录data/ - 清空 目录下的所有历史文件;若
artifacts/不存在则创建该目录artifacts/ - 检查完成后,将结果返回给用户,等待用户确认是否安装依赖或继续执行
Step 3: Container Environment Information Collection
步骤3:容器环境信息收集
For every metric listed in , collect the corresponding environment information.
references/cloud-native-checklist.xlsx- Every collection run MUST be driven by the actual metric items in and MUST invoke
references/cloud-native-checklist.xlsxto collect fresh data — do NOT reuse historical or cached datascripts/collect_all.py - Acceptance metric: the metric item being assessed
- Quantified target: the reference standard for that metric
- Acceptance method: how the environment information for that metric is collected
- During collection, if any required piece of information cannot be obtained, explore alternative ways to retrieve it and ask the user for confirmation
- Once collection is complete for every metric, fill the collection method (including, but not limited to, Python scripts and executed commands) and the collected data into , write the result to
templates/cloud-native-assessment-template.md, and show it to the userdata/cloud-native-collection.md
针对 中列出的每一项指标,收集对应的环境信息。
references/cloud-native-checklist.xlsx- 每次收集必须由 中的实际指标项驱动,且必须调用
references/cloud-native-checklist.xlsx收集新数据——不得复用历史或缓存数据scripts/collect_all.py - 验收指标:待评估的指标项
- 量化目标:该指标的参考标准
- 验收方法:该指标的环境信息收集方式
- 收集过程中,若无法获取所需信息,需探索替代获取方式并征求用户确认
- 完成所有指标的收集后,将收集方法(包括但不限于Python脚本和执行的命令)及收集到的数据填入 ,并将结果写入
templates/cloud-native-assessment-template.md展示给用户data/cloud-native-collection.md
Step 4: Metric Scoring
步骤4:指标评分
Based on the collection data in , score each metric:
data/cloud-native-collection.md- Compare the collected data against the quantified target to derive an acceptance verdict (Fully Satisfied / Mostly Satisfied / Partially Satisfied / Not Satisfied; metrics that cannot be compared are recorded as Not Satisfied; "Not Applicable" and "Not Evaluated" both roll up into Not Satisfied, and the basis field must state that the metric is N/A or Not Evaluated) and a scoring basis (describe based on the collected data — include the metric's environment information, the collection method used, and the reason for non-satisfaction)
- Convert the verdict to a score: Fully Satisfied = 3, Mostly Satisfied = 2, Partially Satisfied = 1, Not Satisfied = 0
- Invoke to produce a fresh scoring sheet, output as Excel containing the columns: number, cloud-native dimension, level, acceptance metric, quantified target, acceptance method, description, acceptance verdict, score, full score, scoring basis. Save to
scripts/score_and_excel.pyartifacts/cloud-native-summary.xlsx
基于 中的收集数据,对每个指标进行评分:
data/cloud-native-collection.md- 将收集的数据与量化目标对比,得出验收结论(完全符合/基本符合/部分符合/不符合;无法对比的指标记为不符合;“不适用”和“未评估”均归为不符合,且依据字段需注明该指标为N/A或未评估)和评分依据(基于收集的数据进行描述——包括指标的环境信息、使用的收集方法以及不符合的原因)
- 将结论转换为分数:完全符合=3分,基本符合=2分,部分符合=1分,不符合=0分
- 调用 生成全新的评分表,输出为Excel文件,包含列:序号、云原生维度、级别、验收指标、量化目标、验收方法、描述、验收结论、得分、满分、评分依据。保存至
scripts/score_and_excel.pyartifacts/cloud-native-summary.xlsx
Step 5: Report Generation
步骤5:报告生成
Using the contents of the scoring sheet , generate the final assessment report:
artifacts/cloud-native-summary.xlsx-
The final report usesas its base template
templates/report_template.md -
The report title is fixed as "Cloud-Native Assessment Report"
-
The report contains 4 chapters; Chapter 1 and Chapter 2 reuse the content ofdirectly
templates/report_template.md -
Chapter 3 of the final report is populated from the scoring sheet
artifacts/cloud-native-summary.xlsx -
Invokeagainst the
scripts/make_charts.pyproduced in Step 4 to generate a radar chart and a staircase chartcloud-native-summary.xlsxChart generation requirements:- Radar chart: group metrics by cloud-native dimension. The score for each dimension = (sum of that dimension's metric scores / sum of that dimension's full scores) × 5. The radar has exactly six dimensions: Service-orientation, Security, Automation, Elasticity, Observability, Resilience. If a metric belongs to multiple dimensions (e.g. metric #1 belongs to both Service-orientation and Automation), it contributes to the scoring of every dimension it belongs to.
- Staircase chart: overall score = (sum of all metric scores / sum of all full scores) × 5. Stage thresholds — score ≤ 1: Traditional; 1 < score ≤ 2: Basic Cloud; 2 < score ≤ 3: Service-Oriented; 3 < score ≤ 4: Automated; score > 4: Intelligent. The chart must visually render as stairs.
-
Place the generated radar chart into report section 3.3.3 and the staircase chart into 3.3.4
-
Replace Chapter 4 of the final report with the actual remediation recommendations
-
Based on the assessment results, output remediation recommendations by P0/P1/P2 priority:
- P0: Not Satisfied (0 pts) — mandatory items
- P1: Partially Satisfied (1 pt) — items to fix
- P2: Mostly Satisfied (2 pts) — recommended improvements
-
Invoketo generate the final report as a html, written to
scripts/make_report_html.pyartifacts/cloud-native-report.html
使用评分表 中的内容,生成最终评估报告:
artifacts/cloud-native-summary.xlsx-
最终报告以为基础模板
templates/report_template.md -
报告标题固定为“云原生评估报告”
-
报告包含4章;第1章和第2章直接复用中的内容
templates/report_template.md -
最终报告的第3章由评分表填充
artifacts/cloud-native-summary.xlsx -
针对步骤4生成的调用
cloud-native-summary.xlsx生成雷达图和阶梯图scripts/make_charts.py图表生成要求:- 雷达图:按云原生维度对指标分组。每个维度的得分=(该维度所有指标得分之和/该维度所有指标满分之和)×5。雷达图包含6个维度:服务化、安全性、自动化、弹性、可观测性、韧性。若指标属于多个维度(例如指标#1同时属于服务化和自动化),则对其所属的每个维度得分都有贡献。
- 阶梯图:总得分=(所有指标得分之和/所有指标满分之和)×5。阶段阈值——得分≤1:传统型;1<得分≤2:基础云化;2<得分≤3:服务化;3<得分≤4:自动化;得分>4:智能化。图表必须以阶梯形式可视化展示。
-
将生成的雷达图放入报告的3.3.3节,阶梯图放入3.3.4节
-
用实际的整改建议替换最终报告的第4章
-
根据评估结果,按P0/P1/P2优先级输出整改建议:
- P0:不符合(0分)——强制整改项
- P1:部分符合(1分)——需整改项
- P2:基本符合(2分)——推荐改进项
-
调用生成最终的HTML格式报告,写入
scripts/make_report_html.pyartifacts/cloud-native-report.html
Core Commands
核心命令
Get cluster ID and basic info
获取集群ID和基本信息
bash
hcloud cce ListClusters --cli-region=cn-north-4bash
hcloud cce ListClusters --cli-region=cn-north-4Get cluster kubeconfig certificate
获取集群kubeconfig证书
bash
hcloud cce CreateKubernetesClusterCert \
--cli-region=cn-north-4 \
--cluster_id=a5659ec8-55b5........ \
--duration=1bash
hcloud cce CreateKubernetesClusterCert \
--cli-region=cn-north-4 \
--cluster_id=a5659ec8-55b5........ \
--duration=1Get detailed cluster info
获取集群详细信息
bash
hcloud cce ListClusters --cli-region=cn-north-4bash
hcloud cce ListClusters --cli-region=cn-north-4Authentication parameters
认证参数
| Auth mode | Required | Optional |
|---|---|---|
| AKSK | | |
| Profile | | |
| 认证模式 | 必填项 | 可选项 |
|---|---|---|
| AKSK | | |
| 配置文件 | | |
Output Format
输出格式
- The final report is delivered as a html file
- The scoring sheet is delivered as an Excel file
- All output files are saved under the directory
artifacts/
- 最终报告以HTML文件形式交付
- 评分表以Excel文件形式交付
- 所有输出文件均保存至 目录下
artifacts/
Verification
验证
Post-install verification
安装后验证
- Version check: MUST return 7.2.2 or higher
hcloud version - Help check: MUST list the available services
hcloud --help
- 版本检查:必须返回7.2.2或更高版本
hcloud version - 帮助检查:必须列出可用服务
hcloud --help
Authentication verification
认证验证
- Profile check: MUST show the configured profile
hcloud configure list
- 配置文件检查:必须显示已配置的文件
hcloud configure list
Best Practices
最佳实践
- Evaluate and analyze the container environment running on Huawei Cloud.
- Harden the configuration of existing container clusters and modify the cluster configuration based on the optimization suggestions.
- 对运行在华为云上的容器环境进行评估分析。
- 根据优化建议加固现有容器集群的配置并修改集群设置。
References
参考资料
- — Final report template
report_template.md - — Description of assessment metrics
cloud-native-checklist.xlsx - — Python dependency library
requirements.txt
- — 最终报告模板
report_template.md - — 评估指标说明
cloud-native-checklist.xlsx - — Python依赖库
requirements.txt
Scripts
脚本
- — Main assessment script; integrates all collection modules
collect_all.py - — Chart generation script
make_charts.py - — Report generation script
make_report.py - — Scoring sheet generation script
score_and_excel.py
- — 主评估脚本;整合所有收集模块
collect_all.py - — 图表生成脚本
make_charts.py - — 报告生成脚本
make_report.py - — 评分表生成脚本
score_and_excel.py
Templates
模板
- — Final report template
report_template.md - — Data collection template
cloud-native-assessment-template.md
- — 最终报告模板
report_template.md - — 数据收集模板
cloud-native-assessment-template.md
Notes
注意事项
- Make sure the Huawei Cloud container environment is reachable
- Make sure the Huawei Cloud credentials are valid and not expired
- If the Huawei Cloud Koocli tool and Python environment cannot be automatically installed using the skill, it is recommended that users install them manually.
- Currently only public-network access to the container environment is supported
- Output may be truncated during execution; clearing historical data and re-running the Skill is recommended in that case
- 确保华为云容器环境可达
- 确保华为云凭证有效且未过期
- 若Skill无法自动安装华为云Koocli工具和Python环境,建议用户手动安装。
- 当前仅支持通过公网访问容器环境
- 执行过程中输出可能被截断;出现此情况时建议清空历史数据并重新运行Skill