From 2d6321b8c42bf100d89b384c8a417fcd6a615b08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BB=B4=E5=9F=BA=E9=B1=BC?= Date: Tue, 20 May 2025 15:06:40 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E6=8F=92=E4=BB=B6md?= =?UTF-8?q?=E4=B8=AD=E5=85=B3=E4=BA=8Einit=E5=91=BD=E4=BB=A4=E7=9A=84?= =?UTF-8?q?=E7=94=A8=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/anythingLLM/doc/readme.md | 21 ++- plugins/deepseek-r1/doc/readme.md | 25 +-- ...50\346\210\267\346\211\213\345\206\214.md" | 22 ++- plugins/kubernetes-1.31.1/doc/readme.md | 178 +++++++++--------- plugins/pytorch/doc/readme.md | 102 +++++----- plugins/tensorflow/doc/readme.md | 30 ++- 6 files changed, 191 insertions(+), 187 deletions(-) diff --git a/plugins/anythingLLM/doc/readme.md b/plugins/anythingLLM/doc/readme.md index ba8e224..ae4d86c 100644 --- a/plugins/anythingLLM/doc/readme.md +++ b/plugins/anythingLLM/doc/readme.md @@ -1,19 +1,24 @@ -# 使用 oeDeploy 部署AnythingLLM -1、下载 oedp 命令行工具,并用 yum 安装。如有更新的 oedp 版本,可以选择新版本。 - +# 使用 oeDeploy 部署 AnythingLLM +1. 下载 oedp 命令行工具,并用 yum 安装。如有更新的 oedp 版本,可以选择新版本。 ```bash - # x86_64: - # aarch64: + wget https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/noarch/oedp-1.1.0-3.oe2403sp2.noarch.rpm + yum install -y oedp-1.1.0-3.oe2403sp2.noarch.rpm ``` -3. 根据实际情况,修改 config.yaml。确保部署节点网络正常 +2. 获取并初始化`AnythingLLM`插件。 + ```shell + oedp repo update + oedp init anythingLLM + ``` + +3. 根据实际情况,修改 config.yaml。确保部署节点网络正常。 -4. 一键部署 +4. 一键部署: ````bash oedp run install -p angthingLLM # -p <插件目录> ```` -5. 一键卸载 +5. 一键卸载: ````bash oedp run uninstall -p angthingLLM # -p <插件目录> ```` diff --git a/plugins/deepseek-r1/doc/readme.md b/plugins/deepseek-r1/doc/readme.md index 6fbc3fd..20a0ded 100644 --- a/plugins/deepseek-r1/doc/readme.md +++ b/plugins/deepseek-r1/doc/readme.md @@ -1,27 +1,22 @@ # 使用oeDeploy工具快速部署DeepSeek-R1 -1. 准备一个openEuler环境(22.03-LTS-SPX、24.03-LTS-SPX),8B模型的建议规格大于8U16G +1. 准备一个openEuler 环境(22.03-LTS-SPX、24.03-LTS-SPX),8B 模型的建议规格大于 8U16G。 -2. 下载oedp命令行工具,并用yum安装 +2. 下载 oedp 命令行工具,并用 yum 安装。 ````bash - # x86_64: - wget https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/x86_64/Packages/oedp-1.0.0-20250208.x86_64.rpm - yum install -y oedp-1.0.0-20250208.x86_64.rpm - # aarch64: - wget https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/aarch64/Packages/oedp-1.0.0-20250208.aarch64.rpm - yum install -y oedp-1.0.0-20250208.aarch64.rpm + wget https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/noarch/oedp-1.1.0-3.oe2403sp2.noarch.rpm + yum install -y oedp-1.1.0-3.oe2403sp2.noarch.rpm ```` -3. 下载DeepSeek-R1部署插件,并解压到本地 +3. 获取并初始化`DeepSeek-R1`插件。 ````bash - wget https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/2025.0330/deepseek-r1.tar.gz - yum install -y tar - tar -zxvf deepseek-r1.tar.gz + oedp repo update + oedp init deepseek-r1 ```` -4. 根据实际情况修改deepseek-r1/config.yaml。用户可以直接使用这里的示例,不需要任何修改。 +4. 根据实际情况修改 deepseek-r1/config.yaml。用户可以直接使用这里的示例,不需要任何修改。 ````yaml all: @@ -58,12 +53,12 @@ ansible_ssh_common_args: '-o StrictHostKeyChecking=no' ```` -5. 一键触发DeepSeek-R1自动化部署,oeDeploy工具会下载所需的文件,自动安装部署,并完成对DeepSeek-R1的配置 +5. 一键触发DeepSeek-R1自动化部署,oeDeploy工具会下载所需的文件,自动安装部署,并完成对DeepSeek-R1的配置。 ````bash oedp run install -p deepseek-r1 # -p ```` -6. 在部署完成后的节点上,打开DeepSeek-R1交互终端,开始对话 +6. 在部署完成后的节点上,打开DeepSeek-R1交互终端,开始对话。 ````bash ollama run deepseek-r1:8b ```` diff --git "a/plugins/kuberay/doc/kuberay\351\203\250\347\275\262\347\224\250\346\210\267\346\211\213\345\206\214.md" "b/plugins/kuberay/doc/kuberay\351\203\250\347\275\262\347\224\250\346\210\267\346\211\213\345\206\214.md" index b885695..985e2b9 100644 --- "a/plugins/kuberay/doc/kuberay\351\203\250\347\275\262\347\224\250\346\210\267\346\211\213\345\206\214.md" +++ "b/plugins/kuberay/doc/kuberay\351\203\250\347\275\262\347\224\250\346\210\267\346\211\213\345\206\214.md" @@ -2,19 +2,27 @@ ## 1. 环境准备 -### 1.1. 部署 Kubernetes 集群 +### 1.1 部署 Kubernetes 集群 在目标集群机器上部署 Kubernetes 1.31.1,此处以 1 master + 2 worker 的标准 K8S 集群为例,其中 master 节点的 IP 为 192.168.1.101。可使用`kubernetes-1.31.1`插件进行自动化部署。 -### 1.2. 安装 Helm +### 1.2 安装 Helm 在 master 节点上安装 Helm,可使用`helm-3.9.0`插件进行自动化安装。 ## 2. 部署 KubeRay -### 2.1. 修改`config.yaml` +### 2.1 获取`kuberay`插件 -以下是`config.yaml`的示例,根据实际情况修改此文件: +使用以下命令,获取并初始化`kuberay`插件。 +```shell +oedp repo update +oedp init kuberay +``` + +### 2.2 修改`config.yaml` + +以下是`kuberay/config.yaml`的示例,根据实际情况修改此文件: ```yaml all: @@ -59,13 +67,13 @@ all: ``` -### 2.2. 执行自动化部署 +### 2.3 执行自动化部署 在插件目录下执行`oedp run install`,或在任意位置执行`oedp run install -p [插件目录]`,即可完成自动化部署 KubeRay。 ## 3. 查看 Dashboard -### 3.1. 查询对应端口 +### 3.1 查询对应端口 在 master 节点,使用`kubectl get svc -A`命令查看端口映射: ````bash @@ -77,7 +85,7 @@ kuberay ray-cluster-kuberay-head-svc NodePort 10.96.168.232 ```` 其中 8265 对应的端口,即为 Dashboard 的端口。 -### 3.2. 打开 Dashboard 页面 +### 3.2 打开 Dashboard 页面 使用 [http://ip:port/] 链接,即可打开 Dashboard 页面,查看 Ray Job / Serve / Cluster 及资源、日志等信息。其中 IP 为 master 节点 IP,port 为 3.1 中 8265 对应的端口。 diff --git a/plugins/kubernetes-1.31.1/doc/readme.md b/plugins/kubernetes-1.31.1/doc/readme.md index b692f09..b44cce5 100644 --- a/plugins/kubernetes-1.31.1/doc/readme.md +++ b/plugins/kubernetes-1.31.1/doc/readme.md @@ -1,110 +1,104 @@ # kubernetes-1.31.1 插件使用说明 -**本插件的kubernetes部署能力由 [@Ultraji](https://gitee.com/ultraji) 提供** +**本插件的 kubernetes 部署能力由 [@Ultraji](https://gitee.com/ultraji) 提供** ## kubernetes-1.31.1 一键部署操作示例 -准备若干节点(三层网络互通),OS 版本为 openEuler 24.03 或 22.03 的任意 LTS 版本,规格大于 2U4G。 - -在任意节点上,下载并安装 oeDeploy 的命令行工具`oedp (version >= 1.1.0-2)`。 - -````bash -wget https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/noarch/oedp-1.1.0-2.oe2403sp2.noarch.rpm -yum install -y oedp-1.1.0-2.oe2403sp2.noarch.rpm -```` - -获取`kubernetes-1.31.1`插件,并完成初始化。 - -```shell -wget https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/plugins/kubernetes-1.31.1.tar.gz -oedp init kubernetes-1.31.1.tar.gz -``` - -执行`info`命令以查看插件详细信息: - -```shell -oedp info -p kubernetes-1.31.1 -``` - -修改项目配置文件,根据实际情况配置节点信息: - -```shell -vim kubernetes-1.31.1/config.yaml -``` - -````yaml -all: - children: - masters: - hosts: - 192.168.10.1: - ansible_host: 192.168.10.1 - ansible_port: 22 - ansible_user: root - ansible_password: "xxxxxxxx" - architecture: amd64 # e.g. [ amd64, arm64 ] - oeversion: 24.03-LTS # e.g. [ 22.03-LTS, 24.03-LTS ] - runtime: docker # e.g. [ docker, containerd ] - workers: - hosts: - 192.168.10.2: - ansible_host: 192.168.10.2 - ansible_port: 22 - ansible_user: root - ansible_password: "xxxxxxxx" - architecture: amd64 - oeversion: 24.03-LTS - runtime: docker - 192.168.10.3: - ansible_host: 192.168.10.3 - ansible_port: 22 - ansible_user: root - ansible_password: "xxxxxxxx" - architecture: amd64 - oeversion: 24.03-LTS - runtime: docker - new-workers: # new-workers字段不可删除 - hosts: - vars: - ansible_ssh_common_args: '-o StrictHostKeyChecking=no' - - init_cluster_force: "true" # e.g. [ "true", "false" ] 强制初始化集群 - remove_master_no_schedule_taints: "true" - service_cidr: 10.96.0.0/16 # 服务网段 - pod_cidr: 10.244.0.0/16 # pod ip 网段 - certs_expired: 3650 # 证书过期时间 - # lb_kube_apiserver_ip: - lb_kube_apiserver_port: 8443 - has_deployed_containerd: "false" # e.g. [ "true", "false" ] 是否已有 containerd +1. 准备若干节点(三层网络互通),OS 版本为 openEuler 24.03 或 22.03 的任意 LTS 版本,规格大于 2U4G。 + +2. 在任意节点上,下载并安装 oeDeploy 的命令行工具`oedp (version >= 1.1.0-2)`。 + ````bash + wget https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/noarch/oedp-1.1.0-2.oe2403sp2.noarch.rpm + yum install -y oedp-1.1.0-3.oe2403sp2.noarch.rpm + ```` + +3. 获取并初始化`kubernetes-1.31.1`插件。 + ```shell + oedp repo update + oedp init kubernetes-1.31.1 + ``` + +4. 执行`info`命令以查看插件详细信息: + ```shell + oedp info -p kubernetes-1.31.1 + ``` + +5. 修改项目配置文件,根据实际情况配置节点信息: + ```shell + vim kubernetes-1.31.1/config.yaml + ``` + + ````yaml + all: + children: + masters: + hosts: + 192.168.10.1: + ansible_host: 192.168.10.1 + ansible_port: 22 + ansible_user: root + ansible_password: "xxxxxxxx" + architecture: amd64 # e.g. [ amd64, arm64 ] + oeversion: 24.03-LTS # e.g. [ 22.03-LTS, 24.03-LTS ] + runtime: docker # e.g. [ docker, containerd ] + workers: + hosts: + 192.168.10.2: + ansible_host: 192.168.10.2 + ansible_port: 22 + ansible_user: root + ansible_password: "xxxxxxxx" + architecture: amd64 + oeversion: 24.03-LTS + runtime: docker + 192.168.10.3: + ansible_host: 192.168.10.3 + ansible_port: 22 + ansible_user: root + ansible_password: "xxxxxxxx" + architecture: amd64 + oeversion: 24.03-LTS + runtime: docker + new-workers: # new-workers字段不可删除 + hosts: + vars: + ansible_ssh_common_args: '-o StrictHostKeyChecking=no' - # 以下参数需要与build过程中的host.ini保持一致,如果不涉及请忽视 - kubernetes_version: 1.31.1 - calico_version: 3.28.2 - pause_image: "registry.k8s.io/pause:3.10" - -```` - -执行以下命令以开始自动化部署: - -```shell -oedp run install -p kubernetes-1.31.1 -``` + init_cluster_force: "true" # e.g. [ "true", "false" ] 强制初始化集群 + remove_master_no_schedule_taints: "true" + service_cidr: 10.96.0.0/16 # 服务网段 + pod_cidr: 10.244.0.0/16 # pod ip 网段 + certs_expired: 3650 # 证书过期时间 + # lb_kube_apiserver_ip: + lb_kube_apiserver_port: 8443 + has_deployed_containerd: "false" # e.g. [ "true", "false" ] 是否已有 containerd + + # 以下参数需要与build过程中的host.ini保持一致,如果不涉及请忽视 + kubernetes_version: 1.31.1 + calico_version: 3.28.2 + pause_image: "registry.k8s.io/pause:3.10" + + ```` -执行以下命令以卸载kubernetes: +6. 执行以下命令以开始自动化部署: + ```shell + oedp run install -p kubernetes-1.31.1 + ``` -```shell -oedp run delete -p kubernetes-1.31.1 -``` +7. 执行以下命令以卸载kubernetes: + ```shell + oedp run uninstall -p kubernetes-1.31.1 + ``` -> -p 参数表示 oeDeploy 项目所在目录 + > -p 参数表示 oeDeploy 项目所在目录 ## 插件构建指导 1. 环境准备 -基于openEuler22.03/24.03的LTS版本,安装依赖软件`tar`、`docker`(version>20.xx) +基于 openEuler22.03 / 24.03 的 LTS 版本,安装依赖软件`tar`、`docker`(version > 20.xx) -> Tip: 较新的docker版本可以从上游社区获取。docker-25.0.3可以从openEuler24.09的repo中获取,临时修改yum源到openEuler24.09,安装新版本docker后恢复。 +> Tip: 较新的 docker 版本可以从上游社区获取。docker-25.0.3 可以从 openEuler24.09 的 repo 中获取,临时修改 yum 源到 openEuler24.09,安装新版本 docker 后恢复。 2. 构建执行 diff --git a/plugins/pytorch/doc/readme.md b/plugins/pytorch/doc/readme.md index fb413fc..76ab28d 100644 --- a/plugins/pytorch/doc/readme.md +++ b/plugins/pytorch/doc/readme.md @@ -1,27 +1,28 @@ # 使用 oeDeploy 基于 k8s 集群部署Pytorch - -1. 准备一个 k8s 集群 +1. 准备一个 k8s 集群。 2. 下载 oedp 命令行工具,并用 yum 安装。如有更新的 oedp 版本,可以选择新版本。 ````bash - # x86_64: - wget https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/x86_64/Packages/oedp-1.0.0-20250208.x86_64.rpm - yum install -y oedp-1.0.0-20250208.x86_64.rpm - # aarch64: - wget https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/aarch64/Packages/oedp-1.0.0-20250208.aarch64.rpm - yum install -y oedp-1.0.0-20250208.aarch64.rpm + wget https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/noarch/oedp-1.1.0-3.oe2403sp2.noarch.rpm + yum install -y oedp-1.1.0-3.oe2403sp2.noarch.rpm ```` -3. 根据实际情况,修改 config.yaml。请确保目标节点为 k8s 的 master 节点。`kubectl_apply`需要与 workspace 下的 playbook 对应。 +3. 获取并初始化`pytorch`插件。 + ```shell + oedp repo update + oedp init pytorch + ``` + +4. 根据实际情况,修改 config.yaml。请确保目标节点为 k8s 的 master 节点。`kubectl_apply`需要与 workspace 下的 playbook 对应。 -4. 一键部署 +5. 一键部署: ````bash oedp run install -p pytorch # -p <插件目录> ```` -5. 一键卸载 +6. 一键卸载: ````bash oedp run uninstall -p pytorch # -p <插件目录> ```` @@ -31,79 +32,82 @@ # demo ## demo 1: 部署并打印 PyTorch 信息 -- config.yaml - ````yaml - all: - hosts: - localhost: - ansible_connection: local - vars: - ansible_ssh_common_args: '-o StrictHostKeyChecking=no' - # ================ demo1: pytorch with http.server ===================== - kubectl_apply: pytorch-deployment.yaml - namespace: pytorch-namespace - replicas: 1 - containers: - http: - name: http-container - image: hub.oepkgs.net/oedeploy/pytorch/pytorch:latest # amd64 - # image: hub.oepkgs.net/oedeploy/pytorch/torchserve:latest-arm64 # arm64 - workspace_mount: /tmp - service: - port: 8080 - target_port: 8080 - node_port: 30699 - training: - epoch: 2 - ```` - -- 查看 pod +1. 根据实际情况,修改 config.yaml。以下为示例: + ````yaml + all: + hosts: + localhost: + ansible_connection: local + vars: + ansible_ssh_common_args: '-o StrictHostKeyChecking=no' + # ================ demo1: pytorch with http.server ===================== + kubectl_apply: pytorch-deployment.yaml + namespace: pytorch-namespace + replicas: 1 + containers: + http: + name: http-container + image: hub.oepkgs.net/oedeploy/pytorch/pytorch:latest # amd64 + # image: hub.oepkgs.net/oedeploy/pytorch/torchserve:latest-arm64 # arm64 + workspace_mount: /tmp + service: + port: 8080 + target_port: 8080 + node_port: 30699 + training: + epoch: 2 + ```` + +2. 执行一键部署 + ```shell + oedp run install -p pytorch + ``` + +3. 查看 pod ````bash kubectl get pods -n pytorch-namespace ```` - + 回显形如: ```` NAME READY STATUS RESTARTS AGE pytorch-deployment-db5d59bcb-ptqnp 1/1 Running 0 15m ```` -- 查看端口映射,并访问 - +4. 查看端口映射 ````bash kubectl get svc -n pytorch-namespace ```` - + 回显形如: ```` NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE pytorch-service NodePort 10.96.50.156 80:30699/TCP 15m ```` +5. 访问网页 ```` http://x.x.x.x:30699/ # master所在节点 ```` -- 进入容器 - +6. 进入容器 ````bash kubectl exec -n pytorch-namespace -it pytorch-deployment-db5d59bcb-ptqnp -- /bin/bash ```` -- 打印 PyTorch 信息 - +7. 打印 PyTorch 信息 ````bash python -c "import torch; print(torch.__version__); print(torch.tensor([1.0, 2.0, 3.0]) + torch.tensor([4.0, 5.0, 6.0]))" ```` ## demo 2: 基于 MNIST 数据集的轻量 CNN 模型训练 -- 基于 demo 1 已完成 PyTorch 部署 +1. 基于 demo 1 已完成 PyTorch 部署 -- 一键自动完成模型训练 +2. 一键自动完成模型训练 ````bash oedp run train -p pytorch # -p <插件目录> ```` - + 回显形如: ````bash ...... TASK [Display training output] ***************************************************************************************************************************************************************************************************************** diff --git a/plugins/tensorflow/doc/readme.md b/plugins/tensorflow/doc/readme.md index 70e9092..623ce42 100644 --- a/plugins/tensorflow/doc/readme.md +++ b/plugins/tensorflow/doc/readme.md @@ -1,30 +1,28 @@ -# 使用 oeDeploy 基于 k8s 集群部署TensorFlow +# 使用 oeDeploy 基于 k8s 集群部署 TensorFlow +1. 准备一个 k8s 集群。 - -1. 准备一个k8s集群 - -2. 下载oedp命令行工具,并用yum安装。如有更新的oedp版本,可以选择新版本。 +2. 下载 oedp 命令行工具,并用 yum 安装。如有更新的 oedp 版本,可以选择新版本。 ````bash - # x86_64: - wget https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/x86_64/Packages/oedp-1.0.0-20250208.x86_64.rpm - yum install -y oedp-1.0.0-20250208.x86_64.rpm - # aarch64: - wget https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/aarch64/Packages/oedp-1.0.0-20250208.aarch64.rpm - yum install -y oedp-1.0.0-20250208.aarch64.rpm + wget https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/noarch/oedp-1.1.0-3.oe2403sp2.noarch.rpm + yum install -y oedp-1.1.0-3.oe2403sp2.noarch.rpm ```` -3. 根据实际情况,修改config.yaml - 请确保目标节点为k8s的master节点 - `kubectl_apply`需要与workspace下的playbook对应。 +3. 获取并初始化`tensorflow`插件。 + ```shell + oedp repo update + oedp init tensorflow + ``` + +4. 根据实际情况,修改 config.yaml。请确保目标节点为 k8s 的 master 节点。`kubectl_apply`需要与 workspace 下的 playbook 对应。 -4. 一键部署 +5. 一键部署: ````bash oedp run install -p tensorflow # -p <插件目录> ```` -5. 一键卸载 +6. 一键卸载: ````bash oedp run uninstall -p tensorflow # -p <插件目录> ```` -- Gitee