Merged
feat(deploy): support systemd-managed orchestrator, default to containerized launcher #156
feat(deploy): support systemd-managed orchestrator, default to containerized launcher #156
Merged
fly_1997Add on Sep 17
Total: 43 files changed+1518-159
Mdeploy/.env+19-0File content is under review, please try again later
@@ -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=true456+ ├── 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`
142. 按 `USAGE.md` 中的部署模式选择 Nomad 或 Kubernetes 流程142. 按 `USAGE.md` 中的部署模式选择 Nomad 或 Kubernetes 流程
153. 不要将包含密码、Token 或 API Key 的本地配置提交到仓库153. 不要将包含密码、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```text43```text
44deploy/44deploy/
45-├── build.sh45+├── build.sh # 主管理脚本
46-├── k8s-deploy.sh46+├── deploy.sh # K8S 部署执行脚本
47-├── deploy-worker.sh47+├── 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.py56├── build_prod.py
49├── create_sandbox.py57├── create_sandbox.py
50├── create_template.py58├── create_template.py
51-└── dep/59+├── nomad/ # Nomad Job 定义
52- ├── deploy.sh60+├── dockerfiles/ # 镜像构建 Dockerfile
53- ├── values-template.yaml61+└── dep/ # 部署资源(镜像包/证书/Ingress 配置)
54- ├── api.yaml62+ ├── harbor.cnf
55- ├── edge.yaml63+ ├── ingress-nginx.yaml
56- ├── template-manager.yaml64+ ├── wildcard-ingress.yaml
57- ├── webhook.yaml65+ └── openclaw.yaml
58- └── wildcard-ingress.yaml
59```66```
Mdeploy/build.sh+151-51File content is under review, please try again later
Mdeploy/check-env.sh+8-6File content is under review, please try again later
Adeploy/common.sh+16-0File content is under review, please try again later
Rdeploy/dep/deploy-e2b-plugin.sh→deploy/deploy-e2b-plugin.sh+0-0
File renamed without changes.
Mdeploy/deploy-worker.sh+45-15File content is under review, please try again later
Rdeploy/dep/deploy.sh→deploy/deploy.sh+101-5File content is under review, please try again later
Adeploy/e2b-orchestrator.service+31-0File content is under review, please try again later
Rdeploy/dep/init-client.sh→deploy/init-client.sh+0-0
File renamed without changes.
Rdeploy/dep/install-consul.sh→deploy/install-consul.sh+0-0
File renamed without changes.
Rdeploy/dep/install-nomad.sh→deploy/install-nomad.sh+0-0
File renamed without changes.
Mdeploy/k8s-deploy.sh+5-0File content is under review, please try again later
Mdeploy/nomad/api.hcl+4-1File content is under review, please try again later
Mdeploy/nomad/edge.hcl+1-1File content is under review, please try again later
Adeploy/orchestrator-run.sh+89-0File content is under review, please try again later
Mdeploy/remote-worker-setup.sh+8-3File content is under review, please try again later
Rdeploy/dep/run-consul.sh→deploy/run-consul.sh+0-0
File renamed without changes.
Rdeploy/dep/run-nomad.sh→deploy/run-nomad.sh+0-0
File renamed without changes.
Rdeploy/dep/start-client.sh→deploy/start-client.sh+0-0
File renamed without changes.
Rdeploy/dep/start-server.sh→deploy/start-server.sh+0-0
File renamed without changes.
Rdeploy/dep/uninstall-consul.sh→deploy/uninstall-consul.sh+0-0
File renamed without changes.
Rdeploy/dep/uninstall-nomad.sh→deploy/uninstall-nomad.sh+0-0
File renamed without changes.
Mdocs/zh/e2b_user_guide.md+119-19File content is under review, please try again later
Mhelm/templates/api.yaml+18-0File content is under review, please try again later
Mhelm/templates/edge.yaml+6-0File content is under review, please try again later
Mhelm/templates/orchestrator.yaml+2-0File content is under review, please try again later
Mhelm/templates/postgres.yaml+3-1File content is under review, please try again later
Mhelm/templates/redis.yaml+2-0File content is under review, please try again later
Mhelm/templates/template-manager.yaml+7-0File content is under review, please try again later
Mhelm/values-template.yaml+17-2File content is under review, please try again later
Mpackages/api/internal/clusters/cluster.go+1-1File content is under review, please try again later
Mpackages/api/internal/clusters/discovery/local.go+7-3File content is under review, please try again later
Mpackages/api/internal/handlers/store.go+11-1File 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
Mpackages/shared/pkg/cache/redis.go+26-1File content is under review, please try again later
Mpackages/shared/pkg/clusters/discovery/k8s.go+0-1File content is under review, please try again later
Apackages/shared/pkg/clusters/discovery/static.go+341-0File content is under review, please try again later
Apackages/shared/pkg/clusters/discovery/static_test.go+318-0File content is under review, please try again later