From 4ee73aef6fa0fd954c9c8710a327d12b555bb2c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B2=E9=B8=BF=E5=AE=87?= Date: Tue, 12 Nov 2024 11:44:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20Markdown=20=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 史鸿宇 --- ...50\347\275\262\346\214\207\345\215\227.md" | 93 ++++++++++++------- ...50\347\275\262\346\214\207\345\215\227.md" | 52 ++++++----- 2 files changed, 91 insertions(+), 54 deletions(-) diff --git "a/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\217\222\344\273\266\351\203\250\347\275\262\346\214\207\345\215\227/\346\231\272\350\203\275\350\257\212\346\226\255/\346\217\222\344\273\266\342\200\224\346\231\272\350\203\275\350\257\212\346\226\255\351\203\250\347\275\262\346\214\207\345\215\227.md" "b/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\217\222\344\273\266\351\203\250\347\275\262\346\214\207\345\215\227/\346\231\272\350\203\275\350\257\212\346\226\255/\346\217\222\344\273\266\342\200\224\346\231\272\350\203\275\350\257\212\346\226\255\351\203\250\347\275\262\346\214\207\345\215\227.md" index 16333958..733fea04 100644 --- "a/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\217\222\344\273\266\351\203\250\347\275\262\346\214\207\345\215\227/\346\231\272\350\203\275\350\257\212\346\226\255/\346\217\222\344\273\266\342\200\224\346\231\272\350\203\275\350\257\212\346\226\255\351\203\250\347\275\262\346\214\207\345\215\227.md" +++ "b/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\217\222\344\273\266\351\203\250\347\275\262\346\214\207\345\215\227/\346\231\272\350\203\275\350\257\212\346\226\255/\346\217\222\344\273\266\342\200\224\346\231\272\350\203\275\350\257\212\346\226\255\351\203\250\347\275\262\346\214\207\345\215\227.md" @@ -4,15 +4,13 @@ + 提前安装 [openEuler Copilot System 命令行(智能 Shell)客户端](../../../使用指南/命令行客户端/命令行助手使用指南.md) -+ 被诊断机器不能安装crictl和isula,只能有docker一个容器管理工具 ++ 被诊断机器不能安装 crictl 和 isula,只能有 docker 一个容器管理工具 -+ 在需要被诊断的机器上安装gala-gopher和gala-anteater ++ 在需要被诊断的机器上安装 gala-gopher 和 gala-anteater -## 部署gala-gopher +## 部署 gala-gopher -### 1. 手动部署 - -#### 1. 准备 BTF 文件 +### 1. 准备 BTF 文件 **如果Linux内核支持 BTF,则不需要准备 BTF 文件。**可以通过以下命令来查看Linux内核是否已经支持 BTF: @@ -24,33 +22,36 @@ cat /boot/config-$(uname -r) | grep CONFIG_DEBUG_INFO_BTF 如果内核不支持BTF,需要手动制作BTF文件。步骤如下: 1. 获取当前Linux内核版本的 vmlinux 文件 - + vmlinux 文件存放在 `kernel-debuginfo` 包里面,存放路径为 `/usr/lib/debug/lib/modules/$(uname -r)/vmlinux`。 - + 例如,对于 `kernel-debuginfo-5.10.0-136.65.0.145.oe2203sp1.aarch64`,对应的vmlinux路径为`/usr/lib/debug/lib/modules/5.10.0-136.65.0.145.oe2203sp1.aarch64/vmlinux`。 + 2. 制作 BTF 文件 + 基于获取到 vmlinux 文件来制作 BTF 文件。这一步可以在自己的环境里操作。首先,需要安装相关的依赖包: - + ```bash # 说明:dwarves 包中包含 pahole 命令,llvm 包中包含 llvm-objcopy 命令 yum install -y llvm dwarves ``` - + 执行下面的命令行,生成 BTF 文件。 - + ```bash kernel_version=4.19.90-2112.8.0.0131.oe1.aarch64 # 说明:这里需要替换成目标内核版本,可通过 uname -r 命令获取 pahole -J vmlinux llvm-objcopy --only-section=.BTF --set-section-flags .BTF=alloc,readonly --strip-all vmlinux ${kernel_version}.btf strip -x ${kernel_version}.btf ``` - + 生成的 BTF 文件名称为`.btf`格式,其中 ``为目标机器的内核版本,可通过 `uname -r` 命令获取。 -#### 2. 下载 gala-gopher 容器镜像 +### 2. 下载 gala-gopher 容器镜像 + +#### 在线下载 -**在线下载**(最新版本的容器镜像已归档到 https://hub.oepkgs.net/) -gala-gopher 容器镜像已归档到 https://hub.oepkgs.net/ 仓库中,可通过如下命令获取。 +gala-gopher 容器镜像已归档到 仓库中,可通过如下命令获取。 ```bash # 获取 aarch64 架构的镜像 @@ -59,7 +60,7 @@ docker pull hub.oepkgs.net/a-ops/gala-gopher-profiling-aarch64:latest docker pull hub.oepkgs.net/a-ops/gala-gopher-profiling-x86_64:latest ``` -**离线下载** +#### 离线下载 若无法通过在线下载的方式下载容器镜像,可联系我(何秀军 00465007)获取压缩包。 @@ -70,7 +71,7 @@ tar -zxvf gala-gopher-profiling-aarch64.tar.gz docker load < gala-gopher-profiling-aarch64.tar ``` -#### 3. 启动 gala-gopher 容器 +### 3. 启动 gala-gopher 容器 容器启动命令: @@ -80,34 +81,52 @@ docker run -d --name gala-gopher-profiling --privileged --pid=host --network=hos 启动配置参数说明: -- `-v /tmp/$(uname -r).btf:/opt/gala-gopher/btf/$(uname -r).btf` :如果内核支持 BTF,则删除该配置即可。如果内核不支持 BTF,则需要将前面准备好的 BTF 文件拷贝到目标机器上,并将 `/tmp/$(uname -r).btf` 替换为对应的路径。 -- `gala-gopher-profiling-aarch64-0426` :gala-gopher容器对应的tag,替换成实际下载的tag。 ++ `-v /tmp/$(uname -r).btf:/opt/gala-gopher/btf/$(uname -r).btf` :如果内核支持 BTF,则删除该配置即可。如果内核不支持 BTF,则需要将前面准备好的 BTF 文件拷贝到目标机器上,并将 `/tmp/$(uname -r).btf` 替换为对应的路径。 ++ `gala-gopher-profiling-aarch64-0426` :gala-gopher容器对应的tag,替换成实际下载的tag。 探针启动: + ++ `container_id` 为需要观测的容器 id ++ 分别启动 sli 和 container 探针 + ```bash -# container_id为需要观测的容器id -# 分别启动sli和container探针 curl -X PUT http://localhost:9999/sli -d json='{"cmd":{"check_cmd":""},"snoopers":{"container_id":[""]},"params":{"report_period":5},"state":"running"}' +``` + +```bash curl -X PUT http://localhost:9999/container -d json='{"cmd":{"check_cmd":""},"snoopers":{"container_id":[""]},"params":{"report_period":5},"state":"running"}' ``` + 探针关闭 + ```bash curl -X PUT http://localhost:9999/sli -d json='{"state": "stopped"}' +``` + +```bash curl -X PUT http://localhost:9999/container -d json='{"state": "stopped"}' ``` -## 部署gala-anteater + +## 部署 gala-anteater + 源码部署: + ```bash -# 请指定分支为930eulercopilot +# 请指定分支为 930eulercopilot git clone https://gitee.com/GS-Stephen_Curry/gala-anteater.git ``` -安装部署请参考https://gitee.com/openeuler/gala-anteater -(请留意python版本导致执行setup.sh install报错) + +安装部署请参考 +(请留意python版本导致执行setup.sh install报错) + 镜像部署: + ```bash docker pull hub.oepkgs.net/a-ops/gala-anteater:2.0.2 ``` -/etc/gala-anteater/config/gala-anteater.yaml中Kafka和Prometheus的server和port需要按照实际部署修改,model_topic、meta_topic、group_id自定义 + +`/etc/gala-anteater/config/gala-anteater.yaml` 中 Kafka 和 Prometheus 的 `server` 和 `port` 需要按照实际部署修改,`model_topic`、`meta_topic`、`group_id` 自定义 + ```yaml Kafka: server: "xxxx" @@ -125,20 +144,30 @@ Prometheus: port: "xxxx" steps: "5" ``` -gala-anteater中模型的训练依赖于gala-gopher采集的数据,因此请保证gala-gopher探针正常运行至少24小时,在运行gala-anteater。 -## 部署gala-ops + +gala-anteater 中模型的训练依赖于 gala-gopher 采集的数据,因此请保证 gala-gopher 探针正常运行至少24小时,在运行 gala-anteater。 + +## 部署 gala-ops + 每个中间件的大致介绍: + kafka : 一个数据库中间件, 分布式数据分流作用, 可以配置为当前的管理节点。 + prometheus:性能监控, 配置需要监控的生产节点 ip list。 -直接通过yum install安装kafka和prometheus,可参照安装脚本https://portrait.gitee.com/openeuler/gala-docs/blob/master/deploy/download_offline_res.sh# -只需要参照其中kafka和prometheus的安装即可 -## 部署euler-copilot-rca +直接通过yum install安装kafka和prometheus,可参照安装脚本 + +只需要参照其中 kafka 和 prometheus 的安装即可 + +## 部署 euler-copilot-rca + 镜像拉取 + ```bash docker pull hub.oepkgs.net/a-ops/euler-copilot-rca:0.9.1 ``` -+ 修改 config/config.json 文件,配置gala-gopher镜像的container_id以及ip,Kafka和Prometheus的ip和port(与上述gala-anteater配置保持一致) + ++ 修改 `config/config.json` 文件,配置 gala-gopher 镜像的 `container_id` 以及 `ip`,Kafka 和 Prometheus 的 `ip` 和 `port`(与上述 gala-anteater 配置保持一致) ```yaml "gopher_container_id": "xxxx", # gala-gopher的容器id diff --git "a/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\217\222\344\273\266\351\203\250\347\275\262\346\214\207\345\215\227/\346\231\272\350\203\275\350\260\203\344\274\230/\346\217\222\344\273\266\342\200\224\346\231\272\350\203\275\350\260\203\344\274\230\351\203\250\347\275\262\346\214\207\345\215\227.md" "b/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\217\222\344\273\266\351\203\250\347\275\262\346\214\207\345\215\227/\346\231\272\350\203\275\350\260\203\344\274\230/\346\217\222\344\273\266\342\200\224\346\231\272\350\203\275\350\260\203\344\274\230\351\203\250\347\275\262\346\214\207\345\215\227.md" index ed089233..4b6524d6 100644 --- "a/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\217\222\344\273\266\351\203\250\347\275\262\346\214\207\345\215\227/\346\231\272\350\203\275\350\260\203\344\274\230/\346\217\222\344\273\266\342\200\224\346\231\272\350\203\275\350\260\203\344\274\230\351\203\250\347\275\262\346\214\207\345\215\227.md" +++ "b/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\217\222\344\273\266\351\203\250\347\275\262\346\214\207\345\215\227/\346\231\272\350\203\275\350\260\203\344\274\230/\346\217\222\344\273\266\342\200\224\346\231\272\350\203\275\350\260\203\344\274\230\351\203\250\347\275\262\346\214\207\345\215\227.md" @@ -15,12 +15,13 @@ yum install -y sysstat perf + 被调优机器需要开启 SSH 22端口 ## 编辑配置文件 + 修改values.yaml文件的tune部分,将 `enable` 字段改为 `True` ,并配置大模型设置、 Embedding模型文件地址、以及需要调优的机器和对应机器上的 mysql 的账号名以及密码 ```bash vim /home/euler-copilot-framework/euler-copilot-helm/chart/agents/values.yaml - ``` +``` ```yaml tune: @@ -77,7 +78,9 @@ tune: ```bash helm install -n euler-copilot agents . ``` + 如果之前有执行过安装,则按下面指令更新插件服务 + ```bash helm upgrade-n euler-copilot agents . ``` @@ -89,24 +92,28 @@ kubectl delete pod framework-deploy-service-bb5b58678-jxzqr -n eulercopilot ``` ## 测试 -- 查看 tune 的 pod 状态 -```bash -NAME READY STATUS RESTARTS AGE -authhub-backend-deploy-authhub-64896f5cdc-m497f 2/2 Running 0 16d -authhub-web-deploy-authhub-7c48695966-h8d2p 1/1 Running 0 17d -pgsql-deploy-databases-86b4dc4899-ppltc 1/1 Running 0 17d -redis-deploy-databases-f8866b56-kj9jz 1/1 Running 0 17d -mysql-deploy-databases-57f5f94ccf-sbhzp 2/2 Running 0 17d -framework-deploy-service-bb5b58678-jxzqr 2/2 Running 0 16d -rag-deploy-service-5b7887644c-sm58z 2/2 Running 0 110m -vectorize-deploy-service-57f5f94ccf-sbhzp 2/2 Running 0 17d -web-deploy-service-74fbf7999f-r46rg 1/1 Running 0 2d -tune-deploy-agents-5d46bfdbd4-xph7b 1/1 Running 0 2d -``` -- pod启动失败排查办法 - - 检查 euler-copilot-tune 目录下的 openapi.yaml 中 `servers.url` 字段,确保调优服务的启动地址被正确设置 - - 检查 `$plugin_dir` 插件文件夹的路径是否配置正确,该变量位于 `euler-copilot-helm/chart/euler_copilot/values.yaml` 中的 `framework`模块,如果插件目录不存在,需新建该目录,并需要将该目录下的 euler-copilot-tune 文件夹放到 `$plugin_dir` 中。 - - 检查sglang的地址和key填写是否正确,该变量位于 `vim /home/euler-copilot-framework/euler-copilot-helm/chart/euler_copilot/values.yaml` + ++ 查看 tune 的 pod 状态 + + ```bash + NAME READY STATUS RESTARTS AGE + authhub-backend-deploy-authhub-64896f5cdc-m497f 2/2 Running 0 16d + authhub-web-deploy-authhub-7c48695966-h8d2p 1/1 Running 0 17d + pgsql-deploy-databases-86b4dc4899-ppltc 1/1 Running 0 17d + redis-deploy-databases-f8866b56-kj9jz 1/1 Running 0 17d + mysql-deploy-databases-57f5f94ccf-sbhzp 2/2 Running 0 17d + framework-deploy-service-bb5b58678-jxzqr 2/2 Running 0 16d + rag-deploy-service-5b7887644c-sm58z 2/2 Running 0 110m + vectorize-deploy-service-57f5f94ccf-sbhzp 2/2 Running 0 17d + web-deploy-service-74fbf7999f-r46rg 1/1 Running 0 2d + tune-deploy-agents-5d46bfdbd4-xph7b 1/1 Running 0 2d + ``` + ++ pod启动失败排查办法 + + 检查 euler-copilot-tune 目录下的 openapi.yaml 中 `servers.url` 字段,确保调优服务的启动地址被正确设置 + + 检查 `$plugin_dir` 插件文件夹的路径是否配置正确,该变量位于 `euler-copilot-helm/chart/euler_copilot/values.yaml` 中的 `framework`模块,如果插件目录不存在,需新建该目录,并需要将该目录下的 euler-copilot-tune 文件夹放到 `$plugin_dir` 中。 + + 检查sglang的地址和key填写是否正确,该变量位于 `vim /home/euler-copilot-framework/euler-copilot-helm/chart/euler_copilot/values.yaml` + ```yaml # 用于Function Call的模型 scheduler: @@ -118,6 +125,7 @@ tune-deploy-agents-5d46bfdbd4-xph7b 1/1 Running 0 2 key: "" # 数据库设置 ``` -- 命令行客户端使用智能调优 - - 具体使用可参考[openEuler Copilot System 命令行(智能插件:智能调优)](../../../使用指南/命令行客户端/智能调优.md) \ No newline at end of file + ++ 命令行客户端使用智能调优 + + 具体使用可参考 [openEuler Copilot System 命令行(智能插件:智能调优)](../../../使用指南/命令行客户端/智能调优.md) -- Gitee