Merged
feat(deploy): support systemd-managed orchestrator, default to containerized launcher #156
fly_1997Add on Sep 17
feat(deploy): support systemd-managed orchestrator, default to containerized launcher #156
Merged
Merged fromfly_1997/KASandboxsystemdintoopeneuler/KASandboxmaster
Total: 43 files changed+1518-159
| @@ -113,30 +113,29 @@ E2B Infra 是一个基于沙箱(Sandbox)的代码执行平台,支持在隔 | |||
| 113 | /root/e2b-deploy/ # 脚本工作目录 | 113 | /root/e2b-deploy/ # 脚本工作目录 |
| 114 | ├── build.sh # 主管理脚本 | 114 | ├── build.sh # 主管理脚本 |
| 115 | ├── deploy-worker.sh # K8S Worker 节点部署脚本 | 115 | ├── deploy-worker.sh # K8S Worker 节点部署脚本 |
| 116 | +├── deploy.sh # K8S 部署执行脚本 | ||
| 117 | +├── common.sh # 公共函数(日志输出等) | ||
| 118 | +├── install-nomad.sh # Nomad 安装脚本 | ||
| 119 | +├── install-consul.sh # Consul 安装脚本 | ||
| 120 | +├── uninstall-nomad.sh # Nomad 卸载脚本 | ||
| 121 | +├── start-server.sh # 服务端启动脚本 | ||
| 122 | +├── start-client.sh # 客户端启动脚本 | ||
| 123 | +├── init-client.sh # 客户端初始化脚本 | ||
| 124 | +├── run-nomad.sh # Nomad 运行脚本 | ||
| 125 | +├── run-consul.sh # Consul 运行脚本 | ||
| 126 | +├── deploy-e2b-plugin.sh # E2B 插件部署脚本 | ||
| 127 | +├── orchestrator-run.sh # orchestrator systemd wrapper | ||
| 128 | +├── e2b-orchestrator.service # orchestrator systemd unit | ||
| 116 | ├── template-ubuntu.py # Ubuntu 模板制作 | 129 | ├── template-ubuntu.py # Ubuntu 模板制作 |
| 117 | ├── create_sandbox.py # 沙箱创建工具 | 130 | ├── create_sandbox.py # 沙箱创建工具 |
| 118 | ├── create_template.py # 模板创建工具 | 131 | ├── create_template.py # 模板创建工具 |
| 119 | ├── build_prod.py # 生产镜像构建 | 132 | ├── build_prod.py # 生产镜像构建 |
| 120 | ├── test_build.sh # 测试用例 | 133 | ├── test_build.sh # 测试用例 |
| 121 | -└── dep/ # 依赖文件目录 | 134 | +├── .env # 环境变量配置 |
| 122 | - ├── .env # 环境变量配置 | 135 | +└── dep/ # 依赖资源目录(镜像包/证书/配置) |
| 123 | - ├── install-nomad.sh # Nomad 安装脚本 | ||
| 124 | - ├── install-consul.sh # Consul 安装脚本 | ||
| 125 | - ├── uninstall-nomad.sh # Nomad 卸载脚本 | ||
| 126 | - ├── start-server.sh # 服务端启动脚本 | ||
| 127 | - ├── start-client.sh # 客户端启动脚本 | ||
| 128 | - ├── init-client.sh # 客户端初始化脚本 | ||
| 129 | - ├── run-nomad.sh # Nomad 运行脚本 | ||
| 130 | - ├── run-consul.sh # Consul 运行脚本 | ||
| 131 | - ├── deploy.sh # 部署脚本 | ||
| 132 | - ├── deploy-e2b-plugin.sh # E2B 插件部署脚本 | ||
| 133 | - ├── nginx.conf # Nginx 配置 | ||
| 134 | ├── harbor.cnf # Harbor SSL 证书配置 | 136 | ├── harbor.cnf # Harbor SSL 证书配置 |
| 135 | - ├── daemon.json # Docker daemon 配置 | 137 | + ├── ingress-nginx.yaml # Ingress-NGINX 部署清单 |
| 136 | - ├── default.hcl # Nomad 默认配置 | 138 | + ├── wildcard-ingress.yaml # K8S 通配 Ingress 配置 |
| 137 | - ├── template-manager.hcl # Nomad Job 配置 | ||
| 138 | - ├── template-manager.yaml # K8S Deployment 配置 | ||
| 139 | - ├── wildcard-ingress.yaml # K8S Ingress 配置 | ||
| 140 | ├── openclaw.yaml # OpenClaw 部署配置 | 139 | ├── openclaw.yaml # OpenClaw 部署配置 |
| 141 | ├── *.tar / *.tar.gz # 离线镜像包 | 140 | ├── *.tar / *.tar.gz # 离线镜像包 |
| 142 | └── *.rpm # RPM 安装包 | 141 | └── *.rpm # RPM 安装包 |
| @@ -175,7 +174,7 @@ E2B Infra 是一个基于沙箱(Sandbox)的代码执行平台,支持在隔 | |||
| 175 | 174 | ||
| 176 | ## 4. 环境变量 | 175 | ## 4. 环境变量 |
| 177 | 176 | ||
| 178 | -配置文件:`dep/.env` | 177 | +配置文件:`.env`(deploy 工作目录根) |
| 179 | 178 | ||
| 180 | ### 4.1 核心变量 | 179 | ### 4.1 核心变量 |
| 181 | 180 | ||
| @@ -454,7 +453,7 @@ deploy-worker.sh worker1 worker2 ... | |||
| 454 | │ | 453 | │ |
| 455 | ▼ | 454 | ▼ |
| 456 | [6/6] 设置节点标签 | 455 | [6/6] 设置节点标签 |
| 457 | - ├── node-role.kubernetes.io/sandbox=true | 456 | + ├── node-role.kubernetes.io/sandbox=true # 仅 k8s/nomad;systemd 模式跳过(节点池走静态清单) |
| 458 | └── node-role.kubernetes.io/api= | 457 | └── node-role.kubernetes.io/api= |
| 459 | ``` | 458 | ``` |
| 460 | 459 | ||
| @@ -10,7 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | 开始使用前: | 11 | 开始使用前: |
| 12 | 12 | ||
| 13 | -1. 复制并填写部署环境配置:`dep/.env` | 13 | +1. 复制并填写部署环境配置:`.env` |
| 14 | 2. 按 `USAGE.md` 中的部署模式选择 Nomad 或 Kubernetes 流程 | 14 | 2. 按 `USAGE.md` 中的部署模式选择 Nomad 或 Kubernetes 流程 |
| 15 | 3. 不要将包含密码、Token 或 API Key 的本地配置提交到仓库 | 15 | 3. 不要将包含密码、Token 或 API Key 的本地配置提交到仓库 |
| 16 | 16 | ||
| @@ -21,14 +21,14 @@ | |||
| 21 | | `build.sh` | 主机依赖、服务和部署流程入口 | | 21 | | `build.sh` | 主机依赖、服务和部署流程入口 | |
| 22 | | `k8s-deploy.sh` | 使用 KubeKey 初始化 Kubernetes 集群 | | 22 | | `k8s-deploy.sh` | 使用 KubeKey 初始化 Kubernetes 集群 | |
| 23 | | `deploy-worker.sh` | 初始化 Kubernetes Worker 节点 | | 23 | | `deploy-worker.sh` | 初始化 Kubernetes Worker 节点 | |
| 24 | -| `dep/deploy.sh` | 部署 E2B 服务和 Helm Chart | | 24 | +| `deploy.sh` | 部署 E2B 服务和 Helm Chart | |
| 25 | | `build_prod.py` | 构建 E2B 沙箱模板 | | 25 | | `build_prod.py` | 构建 E2B 沙箱模板 | |
| 26 | | `create_sandbox.py` | 创建沙箱实例 | | 26 | | `create_sandbox.py` | 创建沙箱实例 | |
| 27 | | `create_template.py` | 创建模板 | | 27 | | `create_template.py` | 创建模板 | |
| 28 | 28 | ||
| 29 | ## 配置 | 29 | ## 配置 |
| 30 | 30 | ||
| 31 | -`dep/.env` 仅用于本地部署,不应提交。模板和变量说明见用户指南(`docs/zh/e2b_user_guide.md`)的配置章节。 | 31 | +`.env` 仅用于本地部署,不应提交。模板和变量说明见用户指南(`docs/zh/e2b_user_guide.md`)的配置章节。 |
| 32 | 32 | ||
| 33 | 常用的敏感配置包括: | 33 | 常用的敏感配置包括: |
| 34 | 34 | ||
| @@ -42,18 +42,25 @@ | |||
| 42 | 42 | ||
| 43 | ```text | 43 | ```text |
| 44 | deploy/ | 44 | deploy/ |
| 45 | -├── build.sh | 45 | +├── build.sh # 主管理脚本 |
| 46 | -├── k8s-deploy.sh | 46 | +├── deploy.sh # K8S 部署执行脚本 |
| 47 | -├── deploy-worker.sh | 47 | +├── k8s-deploy.sh # KubeKey 集群初始化 |
| 48 | +├── deploy-worker.sh # K8S Worker 节点部署 | ||
| 49 | +├── remote-worker-setup.sh # Worker 远程安装(分发至目标节点执行) | ||
| 50 | +├── common.sh # 公共函数(日志输出等) | ||
| 51 | +├── check-env.sh # 部署前环境检查 | ||
| 52 | +├── .env # 环境变量配置 | ||
| 53 | +├── e2b-orchestrator.service # orchestrator systemd unit | ||
| 54 | +├── orchestrator-run.sh # orchestrator systemd wrapper | ||
| 55 | +├── install-/run-/start-/init-/uninstall-*.sh # Nomad/Consul 生命周期脚本 | ||
| 48 | ├── build_prod.py | 56 | ├── build_prod.py |
| 49 | ├── create_sandbox.py | 57 | ├── create_sandbox.py |
| 50 | ├── create_template.py | 58 | ├── create_template.py |
| 51 | -└── dep/ | 59 | +├── nomad/ # Nomad Job 定义 |
| 52 | - ├── deploy.sh | 60 | +├── dockerfiles/ # 镜像构建 Dockerfile |
| 53 | - ├── values-template.yaml | 61 | +└── dep/ # 部署资源(镜像包/证书/Ingress 配置) |
| 54 | - ├── api.yaml | 62 | + ├── harbor.cnf |
| 55 | - ├── edge.yaml | 63 | + ├── ingress-nginx.yaml |
| 56 | - ├── template-manager.yaml | 64 | + ├── wildcard-ingress.yaml |
| 57 | - ├── webhook.yaml | 65 | + └── openclaw.yaml |
| 58 | - └── wildcard-ingress.yaml | ||
| 59 | ``` | 66 | ``` |
Mpackages/api/internal/clusters/discovery/local.go+7-3File content is under review, please try again later
Mpackages/api/internal/orchestrator/orchestrator.go+17-4File content is under review, please try again later
Apackages/api/internal/orchestrator/static_discovery.go+38-0File content is under review, please try again later
Apackages/api/internal/orchestrator/static_discovery_test.go+48-0File content is under review, please try again later
Mpackages/api/internal/sandbox/storage/populate_redis/main.go+19-10File content is under review, please try again later