From 6caec4b72e04b74c9f127be538501085ecf25867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B2=E9=B8=BF=E5=AE=87?= Date: Wed, 23 Oct 2024 09:39:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=BC=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" | 50 +- ...50\347\275\262\346\214\207\345\215\227.md" | 22 +- ...50\347\275\262\346\214\207\345\215\227.md" | 436 ++++++++++-------- 3 files changed, 286 insertions(+), 222 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/\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/\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 f9d3c306..54e34be1 100644 --- "a/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\217\222\344\273\266/\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/\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,26 +4,38 @@ + 提前安装 [openEuler Copilot System 命令行(智能 Shell)客户端](../../../使用指南/命令行客户端/命令行助手使用指南.md) -+ 被诊断机器不能安装crictl和isula,只能有docker一个容器管理工具 ++ 被诊断机器不能安装 crictl 和 isula,只能有 docker 一个容器管理工具 -+ 在需要被诊断的机器上安装gala-gopher和gala-anteater ++ 在需要被诊断的机器上安装 gala-gopher 和 gala-anteater + +### gala-gopher + +x86_64 -**gala-gopher**: ```bash -# x86_64 docker pull hub.oepkgs.net/a-ops/gala-gopher-profiling-x86_64:latest +``` -# aarch64 +aarch64 + +```bash docker pull hub.oepkgs.net/a-ops/gala-gopher-profiling-aarch64:latest ``` -gala-gopher相关配置参考:https://gitee.com/openeuler/gala-gopher -**gala-anteater**源码拉取: + +gala-gopher 相关配置参考: + +### gala-anteater 源码拉取 + ```bash -# 请指定分支为930eulercopilot git clone https://gitee.com/GS-Stephen_Curry/gala-anteater.git ``` -安装部署请参考https://gitee.com/openeuler/gala-anteater -其中重点关注config/gala-anteater.yaml中Kafka和Prometheus的ip和port + ++ 请指定分支为 `930eulercopilot` + +安装部署请参考 + +其中重点关注 config/gala-anteater.yaml 中 Kafka 和 Prometheus 的 ip 和 port + ```yaml Kafka: server: "10.137.16.161" @@ -41,11 +53,16 @@ Prometheus: port: "9090" steps: "5" ``` -+ 安装 gala-ops + +### 安装 gala-ops + 每个中间件的大致介绍: -kafka : 一个数据库中间件, 分布式数据分流作用, 可以配置为当前的管理节点。 -prometheus:性能监控, 配置需要监控的生产节点 ip list。 + ++ kafka : 一个数据库中间件, 分布式数据分流作用, 可以配置为当前的管理节点。 ++ prometheus:性能监控, 配置需要监控的生产节点 ip list。 + 安装脚本参考 + ```bash download_kafka_tarball() { KAFKA_VERSION='kafka_2.13-2.8.2' @@ -70,10 +87,11 @@ download_prometheus() { fi } ``` -+ 修改 `euler-copilot-rca` 中config/config.json,配置gala-gopher镜像的container_id以及ip,Kafka和Prometheus的ip和port(需鱼上述gala-anteater配置保持一致) -```yaml -"gopher_container_id": "82f781b17e5c", ++ 修改 `euler-copilot-rca` 中 config/config.json,配置 gala-gopher 镜像的 container_id 以及 ip,Kafka 和 Prometheus 的 ip 和 port(需鱼上述 gala-anteater 配置保持一致) + +```json + "gopher_container_id": "82f781b17e5c", "remote_host": "116.63.144.61" }, "kafka": { diff --git "a/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\227\240\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\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\227\240\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\351\203\250\347\275\262\346\214\207\345\215\227.md" index 2c107946..f0b3ba34 100644 --- "a/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\227\240\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\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\227\240\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\351\203\250\347\275\262\346\214\207\345\215\227.md" @@ -219,7 +219,7 @@ cd /home/euler-copilot-framework ll ``` -``` +```bash total 28 drwxr-xr-x 3 root root 4096 Aug 28 17:45 docs/ drwxr-xr-x 5 root root 4096 Aug 28 17:45 euler-copilot-helm/ @@ -234,7 +234,7 @@ cd euler-copilot-helm/chart ll ``` -``` +```bash total 28 -rw-r--r-- 1 root root 135 Aug 28 17:45 Chart.yaml drwxr-xr-x 10 root root 4096 Aug 28 17:55 templates/ @@ -264,7 +264,7 @@ cd chart_ssl/ ll ``` -``` +```bash total 20 -rw-r--r-- 1 root root 250 Aug 28 17:45 traefik-config.yml -rw-r--r-- 1 root root 212 Aug 28 17:45 traefik-secret.yaml @@ -279,7 +279,7 @@ vim traefik-config.yml 修改部分示例: -``` +```yaml websecure: exposedPort: 8080 # 将此处的端口号修改为期望转发的HTTPS端口 ``` @@ -323,7 +323,7 @@ helm install -n euler-copilot service . kubectl -n euler-copilot get pods ``` -``` +```bash NAME READY STATUS RESTARTS AGE framework-deploy-service-bb5b58678-jxzqr 2/2 Running 0 16d mysql-deploy-service-c7857c7c9-wz9gn 1/1 Running 0 17d @@ -344,7 +344,7 @@ kubectl -n euler-copilot exec -it pgsql-deploy-service-86b4dc4899-ppltc -- bash psql -U postgres -d postgres ``` -``` +```sql psql (16.2 (Debian 16.2-1.pgdg120+2)) 输入 "help" 来获取帮助信息. postgres=# CREATE EXTENSION zhparser; @@ -524,7 +524,7 @@ mysql> exit; 修改如下部分 - ``` + ```yaml llm: # 开源大模型,OpenAI兼容接口 openai: @@ -542,7 +542,7 @@ NPU 环境部署可参考链接 [MindIE安装指南](https://www.hiascend.com/do ### 1. huggingface 使用报错? -``` +```text File "/usr/lib/python3.9/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( urllib3.exceptions.eanconectionError: : Failed to establish a new conmection: [Errno 101] Network is unreachable @@ -571,7 +571,7 @@ curl -k -X POST "http://localhost:8005/kb/get_answer" -H "Content-Type: applic ### 3. 执行 `helm upgrade` 报错? -``` +```text Error: INSTALLATI0N FAILED: Kubernetes cluster unreachable: Get "http:/localhost:880/version": dial tcp [:1:8089: connect: connection refused ``` @@ -583,7 +583,7 @@ export KUBECONFIG=/etc/rancher/k3s/k3s.yaml ### 4. 无法查看 Pod 日志? -``` +```text [root@localhost euler-copilot]# kubectl logs rag-deployservice65c75c48d8-44vcp-n euler-copilotDefaulted container "rag" out of: rag.rag-copy secret (init)Error from server: Get "https://172.21.31.11:10250/containerlogs/euler copilot/rag deploy"service 65c75c48d8-44vcp/rag": Forbidden ``` @@ -594,7 +594,7 @@ export KUBECONFIG=/etc/rancher/k3s/k3s.yaml cat /etc/systemd/system/k3s.service.env ``` -``` +```text http_proxy="http://172.21.60.51:3128" https_proxy="http://172.21.60.51:3128" no_proxy=172.21.31.10 # 代理中剔除本机IP diff --git "a/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\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/\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\351\203\250\347\275\262\346\214\207\345\215\227.md" index 0613d4e5..ad0b40ce 100644 --- "a/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\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/\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\351\203\250\347\275\262\346\214\207\345\215\227.md" @@ -73,6 +73,7 @@ git clone https://gitee.com/openeuler/euler-copilot-framework.git # 进入部署脚本目录 cd /home/euler-copilot-framework/euler-copilot-helm/scripts && tree ``` + ```bash . ├── check_env.sh @@ -80,7 +81,6 @@ cd /home/euler-copilot-framework/euler-copilot-helm/scripts && tree ├── get_log.sh ├── install_tools.sh └── prepare_docker.sh - ``` | 序号 | 步骤内容 | 相关指令 | 说明 | @@ -93,116 +93,151 @@ cd /home/euler-copilot-framework/euler-copilot-helm/scripts && tree ## 安装 您的环境现已就绪,接下来即可启动 openEuler Copilot System 的安装流程。 -```bash -# 下载目录以home为例,进入 openEuler Copilot System 仓库的Helm配置文件目录 -cd /home/euler-copilot-framework && ll -``` -```bash -total 28 -drwxr-xr-x 3 root root 4096 Aug 28 17:45 docs/ -drwxr-xr-x 5 root root 4096 Aug 28 17:45 euler-copilot-helm/ -``` -```bash -# 查看euler-copilot-helm的目录 -tree euler-copilot-helm -``` -```bash -euler-copilot-helm/chart -├── databases -│   ├── Chart.yaml -│   ├── configs -│   ├── templates -│   └── values.yaml -├── authhub -│   ├── Chart.yaml -│   ├── configs -│   ├── templates -│   └── values.yaml -└── euler_copilot - ├── Chart.yaml - ├── configs - ├── templates - │   ├── NOTES.txt - │   ├── rag - │   ├── vectorize - │   └── web - └── values.yaml -``` + +- 下载目录以home为例,进入 openEuler Copilot System 仓库的 Helm 配置文件目录 + + ```bash + cd /home/euler-copilot-framework && ll + ``` + + ```bash + total 28 + drwxr-xr-x 3 root root 4096 Aug 28 17:45 docs/ + drwxr-xr-x 5 root root 4096 Aug 28 17:45 euler-copilot-helm/ + ``` + +- 查看euler-copilot-helm的目录 + + ```bash + tree euler-copilot-helm + ``` + + ```bash + euler-copilot-helm/chart + ├── databases + │   ├── Chart.yaml + │   ├── configs + │   ├── templates + │   └── values.yaml + ├── authhub + │   ├── Chart.yaml + │   ├── configs + │   ├── templates + │   └── values.yaml + └── euler_copilot + ├── Chart.yaml + ├── configs + ├── templates + │   ├── NOTES.txt + │   ├── rag + │   ├── vectorize + │   └── web + └── values.yaml + ``` + ### 1. 安装数据库 -- 编辑values.yaml -```bash -cd euler-copilot-helm/chart/databases -``` -```bash -# 仅需修改镜像tag为对应架构,其余可不进行修改 -vim values.yaml -``` + +- 编辑 values.yaml + + ```bash + cd euler-copilot-helm/chart/databases + ``` + + 仅需修改镜像tag为对应架构,其余可不进行修改 + + ```bash + vim values.yaml + ``` + - 创建命名空间 -```bash -kubectl create namespace euler-copilot -``` -```bash -# 设置环境变量 -export KUBECONFIG=/etc/rancher/k3s/k3s.yaml -``` + + ```bash + kubectl create namespace euler-copilot + ``` + + 设置环境变量 + + ```bash + export KUBECONFIG=/etc/rancher/k3s/k3s.yaml + ``` + - 安装数据库 -```bash -helm install -n euler-copilot databases . -``` -- 查看pod状态 -```bash -kubectl -n euler-copilot get pods -``` -```bash -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 -``` -- 若服务器之前部署过mysql,则可预先清除下 pvc,再部署 databases。 -```bash -# 获取pvc -kubectl -n euler-copilot get pvc -``` -```bash -# 删除pvc -kubectl -n euler-copilot delete pvc mysql-pvc -``` + + ```bash + helm install -n euler-copilot databases . + ``` + +- 查看 pod 状态 + + ```bash + kubectl -n euler-copilot get pods + ``` + + ```bash + 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 + ``` + +- 若服务器之前部署过 mysql,则可预先清除下 pvc,再部署 databases。 + + ```bash + # 获取pvc + kubectl -n euler-copilot get pvc + ``` + + ```bash + # 删除pvc + kubectl -n euler-copilot delete pvc mysql-pvc + ``` ### 2. 安装鉴权平台Authhub -- 编辑values.yaml -```bash -cd euler-copilot-helm/chart/authhub -``` -```bash -# 请结合 YAML 中的注释中的[必填]项进行修改 -vim values.yaml -# 注意: -# - 1. authHub需要域名,可预先申请域名或在'C:\Windows\System32\drivers\etc\hosts'下配置。 -# authhub和euler-copilot必须是同一个根域名的两个子域名, 比如authhub.test.com和 -# eulercopilot.test.com -# - 2. 数据库的密码与databases的values.yaml一致 -``` -- 安装Authhub -```bash -helm install -n euler-copilot authhub . -# authhub默认账号administrator, 密码changeme -``` -- 查看pod状态 -```bash -kubectl -n euler-copilot get pods -``` -```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 -``` -- 登录 Authhub +- 编辑 values.yaml + + ```bash + cd euler-copilot-helm/chart/authhub + ``` + + 请结合 YAML 中的注释中的[必填]项进行修改 + + ```bash + vim values.yaml + ``` + + 注意: + + 1. authHub 需要域名,可预先申请域名或在 'C:\Windows\System32\drivers\etc\hosts' 下配置。 + authhub和euler-copilot必须是同一个根域名的两个子域名, 比如authhub.test.com和 + eulercopilot.test.com + 2. 数据库的密码与databases的values.yaml一致 + +- 安装 AuthHub + + ```bash + helm install -n euler-copilot authhub . + ``` + + AuthHub 默认账号 `administrator`, 密码 `changeme` + +- 查看 pod 状态 + + ```bash + kubectl -n euler-copilot get pods + ``` + + ```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 + ``` + +- 登录 AuthHub - authhub的域名以 为例,authhub的登录界面如下图所示: + AuthHub 的域名以 为例,AuthHub 的登录界面如下图所示: ![部署图](./pictures/authhub登录界面.png) @@ -211,88 +246,95 @@ mysql-deploy-databases-57f5f94ccf-sbhzp 2/2 Running 0 1 ![部署图](./pictures/创建应用界面.png) 点击创建应用,输入应用名称、应用主页和应用回调地址(登录后回调地址),参考如下: - 应用名称:eulercopilot - - 应用主页:https://eulercopilot.test.com - - 应用回调地址:https://eulercopilot.test.com/api/auth/login - - 应用创建好后会生成 Client ID 和 Client Secret,将生成的 Client ID 和 Client Secret 配置到应用里,以 eulercopilot 为例,创建应用后在配置文件中添加配置 `euler-copilot-helm/chart/euler_copilot/values.yaml`中添加配置 + - 应用主页: + - 应用回调地址: + - 应用创建好后会生成 Client ID 和 Client Secret,将生成的 Client ID 和 Client Secret 配置到应用里,以 eulercopilot 为例,创建应用后在配置文件中添加配置 `euler-copilot-helm/chart/euler_copilot/values.yaml` 中添加配置 ![部署图](./pictures/创建应用成功界面.png) - ### 2. 安装 openEuler Copilot System -- 编辑values.yaml -```bash -cd euler-copilot-helm/chart/euler_copilot -``` -```bash -# 请结合 YAML 中的注释中的[必填]项进行修改 -vim values.yaml -``` + +- 编辑 values.yaml + + ```bash + cd euler-copilot-helm/chart/euler_copilot + ``` + + 请结合 YAML 中的注释中的[必填]项进行修改 + + ```bash + vim values.yaml + ``` - 安装 openEuler Copilot System -```bash -helm install -n euler-copilot service . -``` + + ```bash + helm install -n euler-copilot service . + ``` - 查看 Pod 状态 -```bash -# 镜像拉取过程可能需要大约一分钟的时间,请耐心等待。部署成功后,所有 Pod 的状态应显示为 Running。 -kubectl -n euler-copilot get pods -``` -``` -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 -``` + ```bash + kubectl -n euler-copilot get pods + ``` -注意:如果 Pod 状态出现失败,建议按照以下步骤进行排查 + 镜像拉取过程可能需要大约一分钟的时间,请耐心等待。部署成功后,所有 Pod 的状态应显示为 Running。 -1. 查看 Kubernetes 集群的事件 (Events),以获取更多关于 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 + ``` - ```bash - kubectl -n euler-copilot get events - ``` + 注意:如果 Pod 状态出现失败,建议按照以下步骤进行排查 -2. 查看镜像拉取是否成功 + 1. 查看 Kubernetes 集群的事件 (Events),以获取更多关于 Pod 失败的上下文信息 - ```bash - k3s crictl images - ``` + ```bash + kubectl -n euler-copilot get events + ``` -3. 检查 RAG 的 Pod 日志,以确定是否有错误信息或异常行为。 + 2. 查看镜像拉取是否成功 - ```bash - kubectl logs rag-deploy-service-5b7887644c-sm58z -n euler-copilot - ``` + ```bash + k3s crictl images + ``` -4. 验证 Kubernetes 集群的资源状态,确保没有资源限制或配额问题导致 Pod 无法正常运行。 + 3. 检查 RAG 的 Pod 日志,以确定是否有错误信息或异常行为。 - ```bash - df -h - ``` + ```bash + kubectl logs rag-deploy-service-5b7887644c-sm58z -n euler-copilot + ``` -5. 如果未拉取成且镜像大小为0,请检查是否是 k3s 版本未满足要求,低于 v1.30.2 + 4. 验证 Kubernetes 集群的资源状态,确保没有资源限制或配额问题导致 Pod 无法正常运行。 - ```bash - k3s -v - ``` + ```bash + df -h + ``` + + 5. 如果未拉取成且镜像大小为0,请检查是否是 k3s 版本未满足要求,低于 v1.30.2 + + ```bash + k3s -v + ``` ## 验证安装 恭喜您,openEuler Copilot System 的部署已完成!现在,您可以开启智能问答的非凡体验之旅了。 -请在浏览器中输入 https://$(host_ip):8080 或 https://域名(其中port默认值为8080,若更改则需相应调整)访问 openEuler Copilot System 网页,并尝试进行问答体验。 +请在浏览器中输入 https://$(host_ip):8080 或 (其中 port 默认值为8080,若更改则需相应调整)访问 openEuler Copilot System 网页,并尝试进行问答体验。 ![Web 界面](./pictures/WEB界面.png) ## 安装插件 -详细信息请参考文档 [插件部署指南](https://gitee.com/openeuler/euler-copilot-framework/tree/master/docs/user-guide/%E9%83%A8%E7%BD%B2%E6%8C%87%E5%8D%97/%E6%8F%92%E4%BB%B6) + +详细信息请参考文档 [插件部署指南](./插件) ## 构建专有领域智能问答 @@ -306,7 +348,7 @@ web-deploy-service-74fbf7999f-r46rg 1/1 Running 0 2 ### 2. 构建项目专属知识领域智能问答 -详细信息请参考文档 [本地资产库构建指南](https://gitee.com/openeuler/euler-copilot-framework/blob/master/docs/部署指南/本地资产库构建指南.md) +详细信息请参考文档 [本地资产库构建指南](本地资产库构建指南.md) ## 附录 @@ -359,7 +401,7 @@ web-deploy-service-74fbf7999f-r46rg 1/1 Running 0 2 conda activate /root/py310 ``` -4. 创建新终端worker +4. 创建新终端 worker ```bash screen -S worker @@ -389,21 +431,21 @@ web-deploy-service-74fbf7999f-r46rg 1/1 Running 0 2 5. 按照如下方式配置文件,并更新服务。 -```bash -vim euler-copilot-helm/chart/values.yaml -``` + ```bash + vim euler-copilot-helm/chart/values.yaml + ``` -修改如下部分 + 修改如下部分 -``` -llm: - # 开源大模型,OpenAI兼容接口 - openai: - url: "http://$(IP):30000" - key: "sk-123456" - model: qwen1.5 - max_tokens: 8192 -``` + ```yaml + llm: + # 开源大模型,OpenAI兼容接口 + openai: + url: "http://$(IP):30000" + key: "sk-123456" + model: qwen1.5 + max_tokens: 8192 + ``` #### NPU 环境 @@ -413,7 +455,7 @@ NPU 环境部署可参考链接 [MindIE安装指南](https://www.hiascend.com/do ### 1. huggingface 使用报错? -``` +```text File "/usr/lib/python3.9/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( urllib3.exceptions.eanconectionError: : Failed to establish a new conmection: [Errno 101] Network is unreachable @@ -442,7 +484,7 @@ curl -k -X POST "http://localhost:8005/kb/get_answer" -H "Content-Type: applic ### 3. 执行 `helm upgrade` 报错? -``` +```text Error: INSTALLATI0N FAILED: Kubernetes cluster unreachable: Get "http:/localhost:880/version": dial tcp [:1:8089: connect: connection refused ``` @@ -454,7 +496,7 @@ export KUBECONFIG=/etc/rancher/k3s/k3s.yaml ### 4. 无法查看 Pod 日志? -``` +```text [root@localhost euler-copilot]# kubectl logs rag-deployservice65c75c48d8-44vcp-n euler-copilotDefaulted container "rag" out of: rag.rag-copy secret (init)Error from server: Get "https://172.21.31.11:10250/containerlogs/euler copilot/rag deploy"service 65c75c48d8-44vcp/rag": Forbidden ``` @@ -465,33 +507,37 @@ export KUBECONFIG=/etc/rancher/k3s/k3s.yaml cat /etc/systemd/system/k3s.service.env ``` -``` +```text http_proxy="http://172.21.60.51:3128" https_proxy="http://172.21.60.51:3128" no_proxy=172.21.31.10 # 代理中剔除本机IP ``` + ### 5. GPU环境部署大模型时出现无法流式回复? -在服务执行curl大模型失败,将 "stream": true,改为 "stream": false, 可以curl通 + +在服务执行 curl 大模型失败,将 `"stream": true` 改为 `"stream": false`, 可以 curl 通 + ```bash - curl http://localhost:30000/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer sk-123456" -d '{ - "model": "qwen1.5", - "messages": [ - { - "role": "system", - "content": "你是情感分析专家,你的任务是xxxx" - }, - { - "role": "user", - "content": "你好" - } - ], - "stream": true, - "n": 1, - "max_tokens": 32768 - }' +curl http://localhost:30000/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer sk-123456" -d '{ +"model": "qwen1.5", +"messages": [ +{ +"role": "system", +"content": "你是情感分析专家,你的任务是xxxx" +}, +{ +"role": "user", +"content": "你好" +} +], +"stream": true, +"n": 1, +"max_tokens": 32768 +}' ``` - 解决办法: + ```bash pip install Pydantic=1.10.13 -``` \ No newline at end of file +``` -- Gitee