多客科技 发表于 2025-2-5 07:43

AI自动化框架-AIOpsLab

作者:微信文章
AIOpsLab 是一个全面的框架,旨在支持自主 AIOps 代理的设计、开发和评估。此外,它还用于构建可复现、标准化、互操作和可扩展的基准测试。AIOpsLab 可以部署微服务云环境、注入故障、生成工作负载并导出遥测数据,同时协调这些组件并提供与代理交互和评估的接口。此外,AIOpsLab 提供了一个内置的基准测试套件,其中包含一组问题,用于在交互环境中评估 AIOps 代理。该套件可以轻松扩展以满足用户的特定需求。整体结构图:


安装sudo apt install python3.11 python3.11-venv python3.11-dev python3-pip # poetry requires python >= 3.11快速开始a) Local simulated cluster

# Make sure current directory is set to AIOpsLab.kind create cluster --config kind-config.yaml如果在 MacOS(Apple Silicon)上安装速度非常慢,可以尝试检查 Docker Desktop 仪表板的设置并启用以下选项:- 使用 containerd 来拉取和存储镜像- 在 Apple Silicon 上使用 Rosetta 进行 x86/amd64 仿真完成集群创建后,继续进行下一个“更新 config.yml”步骤。b) Remote cluster

AIOpsLab 支持任何通过 kubectl 上下文设置的远程 Kubernetes 集群,无论是来自云提供商的集群还是自己构建的集群。我们有一些 Ansible 剧本,用于在像 CloudLab 这样的提供商和我们自己的机器上设置集群。请按照此 README 设置您自己的集群,然后继续进行下一个“更新 config.yaml”步骤。
Update config.yml

cdaiopslabcpconfig.yml.exampleconfig.yml
更新config.yml ,将 k8s_host 设置为集群控制平面节点的主机名。将 k8s_user 更新为您在控制平面节点上的用户名。如果使用的是 kind 集群,则 k8s_host 应该是 kind。如果在集群上运行 AIOpsLab,则 k8s_host 应该是 localhost。
Running agents

Human as the agent:
python3 cli.py(aiopslab) $ start misconfig_app_hotel_res-detection-1# or choose any problem you want to solve# ... wait for the setup ...(aiopslab) $ submit("Yes") # submit solution
Run GPT-4 baseline agent:
export OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>python3 clients/gpt.py # you can also change the problem to solve in the main() function
页: [1]
查看完整版本: AI自动化框架-AIOpsLab