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/AI\345\256\271\345\231\250\346\240\210/\346\217\222\344\273\266\342\200\224AI\345\256\271\345\231\250\346\240\210\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/AI\345\256\271\345\231\250\346\240\210/\346\217\222\344\273\266\342\200\224AI\345\256\271\345\231\250\346\240\210\351\203\250\347\275\262\346\214\207\345\215\227.md" index 3d8943698907f3d368bac2462fb376eb254a351d..faef49e028ce1d637fd0a65b34d38aea89f8b80f 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/AI\345\256\271\345\231\250\346\240\210/\346\217\222\344\273\266\342\200\224AI\345\256\271\345\231\250\346\240\210\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/AI\345\256\271\345\231\250\346\240\210/\346\217\222\344\273\266\342\200\224AI\345\256\271\345\231\250\346\240\210\351\203\250\347\275\262\346\214\207\345\215\227.md" @@ -18,7 +18,7 @@ helm upgrade euler-copilot . + 检查 Compatibility-AI-Infra 目录下的 openapi.yaml 中 `servers.url` 字段,确保AI容器服务的启动地址被正确设置 -+ 获取 `$plugin_dir` 插件文件夹的路径,该变量位于 euler-copilot-helm/chart/euler_copilot/values.yaml 中的 `framework` 模块 ++ 获取 `$plugin_dir` 插件文件夹的路径,该变量位于 deploy/chart/euler_copilot/values.yaml 中的 `framework` 模块 + 如果插件目录不存在,需新建该目录 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 4b6524d60bb3625cf0564d3c1fcf3c4fa1d70bee..50a589da381c58012ae700031d7165301faa7361 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" @@ -20,7 +20,7 @@ yum install -y sysstat perf Embedding模型文件地址、以及需要调优的机器和对应机器上的 mysql 的账号名以及密码 ```bash -vim /home/euler-copilot-framework/euler-copilot-helm/chart/agents/values.yaml +vim /home/euler-copilot-framework/deploy/chart/agents/values.yaml ``` ```yaml @@ -111,8 +111,8 @@ kubectl delete pod framework-deploy-service-bb5b58678-jxzqr -n eulercopilot + 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` + + 检查 `$plugin_dir` 插件文件夹的路径是否配置正确,该变量位于 `deploy/chart/euler_copilot/values.yaml` 中的 `framework`模块,如果插件目录不存在,需新建该目录,并需要将该目录下的 euler-copilot-tune 文件夹放到 `$plugin_dir` 中。 + + 检查sglang的地址和key填写是否正确,该变量位于 `vim /home/euler-copilot-framework/deploy/chart/euler_copilot/values.yaml` ```yaml # 用于Function Call的模型 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 512770fe19d1d823d57637a33409547f6c8fd6ed..89f11b2b5da094f278824edec21878d4f5b8ccb6 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" @@ -217,17 +217,17 @@ openEuler Copilot System 是一款智能问答工具,使用 openEuler Copilot ```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/ + drwxr-xr-x 5 root root 4096 Aug 28 17:45 deploy/ ``` -- 查看euler-copilot-helm的目录 +- 查看deploy的目录 ```bash - tree euler-copilot-helm + tree deploy ``` ```bash - euler-copilot-helm/chart + deploy/chart ├── databases │   ├── Chart.yaml │   ├── configs @@ -254,7 +254,7 @@ openEuler Copilot System 是一款智能问答工具,使用 openEuler Copilot - 编辑 values.yaml ```bash - cd euler-copilot-helm/chart/databases + cd deploy/chart/databases ``` 仅需修改镜像tag为对应架构,其余可不进行修改 @@ -310,7 +310,7 @@ openEuler Copilot System 是一款智能问答工具,使用 openEuler Copilot - 编辑 values.yaml ```bash - cd euler-copilot-helm/chart/authhub + cd deploy/chart/authhub ``` 请结合 YAML 中的注释中的[必填]项进行修改 @@ -361,7 +361,7 @@ openEuler Copilot System 是一款智能问答工具,使用 openEuler Copilot - 应用名称:eulercopilot - 应用主页: - 应用回调地址: - - 应用创建好后会生成 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 为例,创建应用后在配置文件中添加配置 `deploy/chart/euler_copilot/values.yaml` 中添加配置 ![部署图](./pictures/创建应用成功界面.png) @@ -370,7 +370,7 @@ openEuler Copilot System 是一款智能问答工具,使用 openEuler Copilot - 编辑 values.yaml ```bash - cd euler-copilot-helm/chart/euler_copilot + cd deploy/chart/euler_copilot ``` 请结合 YAML 中的注释中的[必填]项进行修改 @@ -378,6 +378,7 @@ openEuler Copilot System 是一款智能问答工具,使用 openEuler Copilot ```bash vim values.yaml ``` + - 注意: 1. 查看系统架构,并修改values.yaml中的tag; 2. 修改values.yaml中的globals的domain为EulerCopilot域名,并配置大模型的相关信息 @@ -444,9 +445,11 @@ openEuler Copilot System 是一款智能问答工具,使用 openEuler Copilot ```bash k3s -v ``` + 6. 确认 values.yaml 中 framework 的 OIDC 设置是否正确配置,以确保身份验证和授权功能正常工作。 + ```bash - vim /home/euler-copilot-framework/euler-copilot-helm/chart/euler_copilot/values.yaml + vim /home/euler-copilot-framework/deploy/chart/euler_copilot/values.yaml ``` ## 验证安装 @@ -458,6 +461,7 @@ openEuler Copilot System 是一款智能问答工具,使用 openEuler Copilot ![Web登录界面](./pictures/WEB登录界面.png) ![Web 界面](./pictures/WEB界面.png) + ## 安装插件 详细信息请参考文档 [插件部署指南](./插件部署指南) @@ -468,9 +472,9 @@ openEuler Copilot System 是一款智能问答工具,使用 openEuler Copilot 1. 修改 values.yaml 的 pg 的镜像仓为 `pg-data` 2. 修改 values.yaml 的 rag 部分的字段 `knowledgebaseID: openEuler_2bb3029f` - 3. 将 `vim euler-copilot-helm/chart/databases/templates/pgsql/pgsql-deployment.yaml` 的 volumes 相关字段注释 - 4. 进入 `cd euler-copilot-helm/chart/databases`,执行更新服务 `helm upgrade -n euler-copilot databases .` - 5. 进入 `cd euler-copilot-helm/chart/euler_copilot`,执行更新服务 `helm upgrade -n euler-copilot service .` + 3. 将 `vim deploy/chart/databases/templates/pgsql/pgsql-deployment.yaml` 的 volumes 相关字段注释 + 4. 进入 `cd deploy/chart/databases`,执行更新服务 `helm upgrade -n euler-copilot databases .` + 5. 进入 `cd deploy/chart/euler_copilot`,执行更新服务 `helm upgrade -n euler-copilot service .` 6. 进入网页端进行 openEuler 专业知识领域的问答 ### 2. 构建项目专属知识领域智能问答 @@ -558,8 +562,8 @@ openEuler Copilot System 是一款智能问答工具,使用 openEuler Copilot 5. 按照如下方式配置文件,并更新服务。 - ```bash - vim euler-copilot-helm/chart/euler_copilot/values.yaml + ```bash + vim deploy/chart/euler_copilot/values.yaml ``` 修改如下部分 @@ -614,7 +618,9 @@ curl -k -X POST "http://localhost:8005/kb/get_answer" -H "Content-Type: applic ```text Error: INSTALLATI0N FAILED: Kubernetes cluster unreachable: Get "http:/localhost:880/version": dial tcp [:1:8089: connect: connection refused ``` + 或者 + ```text Error: UPGRADE FAILED: Kubernetes cluster unreachable: the server could not find the requested resource ``` @@ -673,7 +679,8 @@ curl http://localhost:30000/v1/chat/completions -H "Content-Type: application/ pip install Pydantic=1.10.13 ``` -### 6. 如何部署sglang? +### 6. 如何部署 sglang? + ```bash # 1. 激活 Conda 环境, 并激活 Python 3.10 的 Conda 环境。假设你的环境名为 `myenv`: conda activate myenv @@ -685,18 +692,23 @@ pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.4/ # 3. 启动服务器 python -m sglang.launch_server --served-model-name Qwen2.5-32B --model-path Qwen2.5-32B-Instruct-AWQ --host 0.0.0.0 --port 8001 --api-key sk-12345 --mem-fraction-static 0.5 --tp 8 ``` + - 验证安装 -```bash -pip show sglang -pip show flashinfer -``` + + ```bash + pip show sglang + pip show flashinfer + ``` + - 注意: -1. API Key:请确保 `--api-key` 参数中的 API 密钥是正确的 -2. 模型路径: 确保 `--model-path` 参数中的路径是正确的,并且模型文件存在于该路径下。 -3. CUDA 版本:确保你的系统上安装了 CUDA 12.1 和 PyTorch 2.4,因为 `flashinfer` 包依赖于这些特定版本。 -4. 线程池大小:根据你的GPU资源和预期负载调整线程池大小。如果你有 8 个 GPU,那么可以选择 --tp 8 来充分利用这些资源。 + + 1. API Key:请确保 `--api-key` 参数中的 API 密钥是正确的 + 2. 模型路径: 确保 `--model-path` 参数中的路径是正确的,并且模型文件存在于该路径下。 + 3. CUDA 版本:确保你的系统上安装了 CUDA 12.1 和 PyTorch 2.4,因为 `flashinfer` 包依赖于这些特定版本。 + 4. 线程池大小:根据你的GPU资源和预期负载调整线程池大小。如果你有 8 个 GPU,那么可以选择 --tp 8 来充分利用这些资源。 ### 7. 如何 curl embedding? + ```bash curl -k -X POST http://$IP:8001/embedding \ -H "Content-Type: application/json" \ @@ -705,6 +717,7 @@ curl -k -X POST http://$IP:8001/embedding \ ``` ### 8. 如何生成证书? + ```bash 下载地址: https://github.com/FiloSottile/mkcert/releases # 1. 下载 mkcert @@ -718,11 +731,11 @@ mkcert -install # mkcert 可直接接域名或 IP, 生成证书和秘钥 mkcert example.com -# 3. 将证书和秘钥拷贝到 /home/euler-copilot-framework_openeuler/euler-copilot-helm/chart_ssl/traefik-secret.yaml 中, 并执行下面命令使其生效。 +# 3. 将证书和秘钥拷贝到 /home/euler-copilot-framework_openeuler/deploy/chart_ssl/traefik-secret.yaml 中, 并执行下面命令使其生效。 kubectl apply -f traefik-secret.yaml ``` ### 8. Pod状态由runnning变为pending? 在Pod正常运行一段时间后,其状态从“Running”全部转变为 “Pending” 或 “Completed”, -可执行命令`df -h`,查看Pod所在宿主机的存储空间,确保可用空间不低于30%,以保证pod的正常运行。 \ No newline at end of file +可执行命令`df -h`,查看Pod所在宿主机的存储空间,确保可用空间不低于30%,以保证pod的正常运行。 diff --git "a/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\234\254\345\234\260\350\265\204\344\272\247\345\272\223\346\236\204\345\273\272\346\214\207\345\215\227.md" "b/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\234\254\345\234\260\350\265\204\344\272\247\345\272\223\346\236\204\345\273\272\346\214\207\345\215\227.md" index 32259fdba92e02f572f3269004fea825e0e95413..21873a3335df2e1ce11832ed0ae6f38dfa33093a 100644 --- "a/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\234\254\345\234\260\350\265\204\344\272\247\345\272\223\346\236\204\345\273\272\346\214\207\345\215\227.md" +++ "b/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\234\254\345\234\260\350\265\204\344\272\247\345\272\223\346\236\204\345\273\272\346\214\207\345\215\227.md" @@ -19,22 +19,22 @@ chmod -R 755 /home/docs ``` -将文件存放的源目录映射至 RAG 容器目标目录,源目录的配置在 中,下面是文件中具体配置映射源目录的配置方法: +将文件存放的源目录映射至 RAG 容器目标目录,源目录的配置在 中,下面是文件中具体配置映射源目录的配置方法: ![配置映射源目录](./pictures/本地资产库构建/配置映射源目录.png) -中间层的配置(链接源目录和目标目录的配置)在 中,下面是文件中具体映射中间层的配置方法: +中间层的配置(链接源目录和目标目录的配置)在 中,下面是文件中具体映射中间层的配置方法: ![配置映射中间层](./pictures/本地资产库构建/配置映射中间层.png) -目标目录的配置在 中,下面是文件中具体映射目标目录的配置方法: +目标目录的配置在 中,下面是文件中具体映射目标目录的配置方法: ![配置映射目标目录](./pictures/本地资产库构建/配置映射目标目录.png) - 更新 Copilot 服务: ```bash - root@openeuler:/home/EulerCopilot/euler-copilot-helm/chart# helm upgrade -n euler-copilot service . + root@openeuler:/home/EulerCopilot/deploy/chart# helm upgrade -n euler-copilot service . # 请注意:service是服务名,可根据实际修改 ``` @@ -121,7 +121,7 @@ python3 scripts/rag_kb_manager.pyc --method init_database_info --database_url p **注意:** -**{dabase_url}**为 k8s 集群内访问 postgres 服务的 url,请根据具体情况修改,一般为 **{postgres_servive_name}-{{ .Release.Name }}.\.svc.cluster.local** 格式,其中 **{postgres_servive_name}** 可以从 找到: +**{dabase_url}**为 k8s 集群内访问 postgres 服务的 url,请根据具体情况修改,一般为 **{postgres_servive_name}-{{ .Release.Name }}.\.svc.cluster.local** 格式,其中 **{postgres_servive_name}** 可以从 找到: ![k8s集群中postgres服务的名称](./pictures/本地资产库构建/k8s集群中postgres服务的名称.png) @@ -131,7 +131,7 @@ python3 scripts/rag_kb_manager.pyc --method init_database_info --database_url p helm install my-release-name --namespace my-namespace path/to/chart ``` -**database_port** 的信息可以在 中查看,以下为字段所在位置(一般为5432): +**database_port** 的信息可以在 中查看,以下为字段所在位置(一般为5432): ![postgres服务端口](./pictures/本地资产库构建/postgres服务端口.png) @@ -151,7 +151,7 @@ helm install my-release-name --namespace my-namespace path/to/chart python3 scripts/rag_kb_manager.pyc --method init_rag_info --rag_url http://{rag_url}:{rag_port} ``` -**{rag_url}** 为 0.0.0.0,**{rag_port}** 可以从 中获取(一般为8005): +**{rag_url}** 为 0.0.0.0,**{rag_port}** 可以从 中获取(一般为8005): ![rag_port](./pictures/本地资产库构建/rag_port.png) 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 f21e5d889b18413859fb55531f7bc381833e9100..83186358b104c8d51042db780d9850923db6e99c 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" @@ -71,7 +71,7 @@ git clone https://gitee.com/openeuler/euler-copilot-framework.git ```bash # 进入部署脚本目录 -cd /home/euler-copilot-framework/euler-copilot-helm/scripts && tree +cd /home/euler-copilot-framework/deploy/scripts && tree ``` ```bash @@ -103,17 +103,17 @@ cd /home/euler-copilot-framework/euler-copilot-helm/scripts && tree ```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/ + drwxr-xr-x 5 root root 4096 Aug 28 17:45 deploy/ ``` -- 查看euler-copilot-helm的目录 +- 查看deploy的目录 ```bash - tree euler-copilot-helm + tree deploy ``` ```bash - euler-copilot-helm/chart + deploy/chart ├── databases │   ├── Chart.yaml │   ├── configs @@ -140,7 +140,7 @@ cd /home/euler-copilot-framework/euler-copilot-helm/scripts && tree - 编辑 values.yaml ```bash - cd euler-copilot-helm/chart/databases + cd deploy/chart/databases ``` 仅需修改镜像tag为对应架构,其余可不进行修改 @@ -196,7 +196,7 @@ cd /home/euler-copilot-framework/euler-copilot-helm/scripts && tree - 编辑 values.yaml ```bash - cd euler-copilot-helm/chart/authhub + cd deploy/chart/authhub ``` 请结合 YAML 中的注释中的[必填]项进行修改 @@ -204,6 +204,7 @@ cd /home/euler-copilot-framework/euler-copilot-helm/scripts && tree ```bash vim values.yaml ``` + - 注意: 1. authHub 需要域名,可预先申请域名或在 'C:\Windows\System32\drivers\etc\hosts' 下配置。 authhub和euler-copilot必须是同一个根域名的两个子域名, 例如authhub.test.com和 @@ -246,7 +247,7 @@ cd /home/euler-copilot-framework/euler-copilot-helm/scripts && tree - 应用名称:eulercopilot - 应用主页: - 应用回调地址: - - 应用创建好后会生成 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 为例,创建应用后在配置文件中添加配置 `deploy/chart/euler_copilot/values.yaml` 中添加配置 ![部署图](./pictures/创建应用成功界面.png) @@ -255,7 +256,7 @@ cd /home/euler-copilot-framework/euler-copilot-helm/scripts && tree - 编辑 values.yaml ```bash - cd euler-copilot-helm/chart/euler_copilot + cd deploy/chart/euler_copilot ``` 请结合 YAML 中的注释中的[必填]项进行修改 @@ -263,6 +264,7 @@ cd /home/euler-copilot-framework/euler-copilot-helm/scripts && tree ```bash vim values.yaml ``` + - 注意: 1. 查看系统架构,并修改values.yaml中的tag; 2. 修改values.yaml中的globals的domain为EulerCopilot域名,并配置大模型的相关信息 @@ -270,7 +272,6 @@ cd /home/euler-copilot-framework/euler-copilot-helm/scripts && tree 4. 修改values.yaml中framework章节的web_url和oidc设置 5. 如果部署插件,则需要配置用于Function Call的模型,此时必须有GPU环境用于部署sglang,可参考附件 - - 安装 openEuler Copilot System ```bash @@ -331,9 +332,11 @@ cd /home/euler-copilot-framework/euler-copilot-helm/scripts && tree ```bash k3s -v ``` + 6. 确认 values.yaml 中 framework 的 OIDC 设置是否正确配置,以确保身份验证和授权功能正常工作。 + ```bash - vim /home/euler-copilot-framework/euler-copilot-helm/chart/euler_copilot/values.yaml + vim /home/euler-copilot-framework/deploy/chart/euler_copilot/values.yaml ``` ## 验证安装 @@ -355,9 +358,9 @@ cd /home/euler-copilot-framework/euler-copilot-helm/scripts && tree 1. 修改 values.yaml 的 pg 的镜像仓为 `pg-data` 2. 修改 values.yaml 的 rag 部分的字段 `knowledgebaseID: openEuler_2bb3029f` - 3. 将 `vim euler-copilot-helm/chart/databases/templates/pgsql/pgsql-deployment.yaml` 的 volumes 相关字段注释 - 4. 进入 `cd euler-copilot-helm/chart/databases`,执行更新服务 `helm upgrade -n euler-copilot databases .` - 5. 进入 `cd euler-copilot-helm/chart/euler_copilot`,执行更新服务 `helm upgrade -n euler-copilot service .` + 3. 将 `vim deploy/chart/databases/templates/pgsql/pgsql-deployment.yaml` 的 volumes 相关字段注释 + 4. 进入 `cd deploy/chart/databases`,执行更新服务 `helm upgrade -n euler-copilot databases .` + 5. 进入 `cd deploy/chart/euler_copilot`,执行更新服务 `helm upgrade -n euler-copilot service .` 6. 进入网页端进行 openEuler 专业知识领域的问答 ### 2. 构建项目专属知识领域智能问答 @@ -445,8 +448,8 @@ cd /home/euler-copilot-framework/euler-copilot-helm/scripts && tree 5. 按照如下方式配置文件,并更新服务。 - ```bash - vim euler-copilot-helm/chart/euler_copilot/values.yaml + ```bash + vim deploy/chart/euler_copilot/values.yaml ``` 修改如下部分 @@ -501,7 +504,9 @@ curl -k -X POST "http://localhost:8005/kb/get_answer" -H "Content-Type: applic ```text Error: INSTALLATI0N FAILED: Kubernetes cluster unreachable: Get "http:/localhost:880/version": dial tcp [:1:8089: connect: connection refused ``` + 或者 + ```text Error: UPGRADE FAILED: Kubernetes cluster unreachable: the server could not find the requested resource ``` @@ -560,7 +565,8 @@ curl http://localhost:30000/v1/chat/completions -H "Content-Type: application/ pip install Pydantic=1.10.13 ``` -### 6. 如何部署sglang? +### 6. 如何部署 sglang? + ```bash # 1. 激活 Conda 环境, 并激活 Python 3.10 的 Conda 环境。假设你的环境名为 `myenv`: conda activate myenv @@ -572,18 +578,23 @@ pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.4/ # 3. 启动服务器 python -m sglang.launch_server --served-model-name Qwen2.5-32B --model-path Qwen2.5-32B-Instruct-AWQ --host 0.0.0.0 --port 8001 --api-key sk-12345 --mem-fraction-static 0.5 --tp 8 ``` + - 验证安装 -```bash -pip show sglang -pip show flashinfer -``` + + ```bash + pip show sglang + pip show flashinfer + ``` + - 注意: -1. API Key:请确保 `--api-key` 参数中的 API 密钥是正确的 -2. 模型路径: 确保 `--model-path` 参数中的路径是正确的,并且模型文件存在于该路径下。 -3. CUDA 版本:确保你的系统上安装了 CUDA 12.1 和 PyTorch 2.4,因为 `flashinfer` 包依赖于这些特定版本。 -4. 线程池大小:根据你的GPU资源和预期负载调整线程池大小。如果你有 8 个 GPU,那么可以选择 --tp 8 来充分利用这些资源。 + + 1. API Key:请确保 `--api-key` 参数中的 API 密钥是正确的 + 2. 模型路径: 确保 `--model-path` 参数中的路径是正确的,并且模型文件存在于该路径下。 + 3. CUDA 版本:确保你的系统上安装了 CUDA 12.1 和 PyTorch 2.4,因为 `flashinfer` 包依赖于这些特定版本。 + 4. 线程池大小:根据你的GPU资源和预期负载调整线程池大小。如果你有 8 个 GPU,那么可以选择 --tp 8 来充分利用这些资源。 ### 7. 如何 curl embedding? + ```bash curl -k -X POST http://$IP:8001/embedding \ -H "Content-Type: application/json" \ @@ -604,11 +615,11 @@ wget https://github.com/FiloSottile/mkcert/releases/download/v1.4.4/mkcert-v1.4. mkcert -install # mkcert 可直接接域名或 IP, 生成证书和秘钥 mkcert example.com -# 3. 将证书和秘钥拷贝到 `/home/euler-copilot-framework_openeuler/euler-copilot-helm/chart_ssl/traefik-secret.yaml` 中, 并执行下面命令使其生效。 +# 3. 将证书和秘钥拷贝到 `/home/euler-copilot-framework_openeuler/deploy/chart_ssl/traefik-secret.yaml` 中, 并执行下面命令使其生效。 kubectl apply -f traefik-secret.yaml ``` ### 8. Pod状态由runnning变为pending? 在Pod正常运行一段时间后,其状态从“Running”全部转变为 “Pending” 或 “Completed”, -可执行命令`df -h`,查看Pod所在宿主机的存储空间,确保可用空间不低于30%,以保证pod的正常运行。 \ No newline at end of file +可执行命令`df -h`,查看Pod所在宿主机的存储空间,确保可用空间不低于30%,以保证pod的正常运行。