Skip to content

Commit f5d3029

Browse files
xqvvuc121914yu
authored andcommitted
build: integrate OpenSandbox as Agent Execution Sandbox
# Conflicts: # deploy/args.json # deploy/dev/docker-compose.cn.yml # deploy/dev/docker-compose.yml # deploy/docker/cn/docker-compose.milvus.yml # deploy/docker/cn/docker-compose.oceanbase.yml # deploy/docker/cn/docker-compose.pg.yml # deploy/docker/cn/docker-compose.seekdb.yml # deploy/docker/cn/docker-compose.zilliz.yml # deploy/docker/global/docker-compose.milvus.yml # deploy/docker/global/docker-compose.oceanbase.yml # deploy/docker/global/docker-compose.pg.yml # deploy/docker/global/docker-compose.seekdb.yml # deploy/docker/global/docker-compose.ziliiz.yml # deploy/templates/docker-compose.prod.yml # document/public/deploy/docker/cn/docker-compose.milvus.yml # document/public/deploy/docker/cn/docker-compose.oceanbase.yml # document/public/deploy/docker/cn/docker-compose.pg.yml # document/public/deploy/docker/cn/docker-compose.seekdb.yml # document/public/deploy/docker/cn/docker-compose.zilliz.yml # document/public/deploy/docker/global/docker-compose.milvus.yml # document/public/deploy/docker/global/docker-compose.oceanbase.yml # document/public/deploy/docker/global/docker-compose.pg.yml # document/public/deploy/docker/global/docker-compose.seekdb.yml # document/public/deploy/docker/global/docker-compose.ziliiz.yml
1 parent 4b7ca8f commit f5d3029

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+6577
-7
lines changed

deploy/args.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
"milvus-etcd": "v3.5.5",
1515
"milvus-standalone": "v2.4.3",
1616
"oceanbase": "4.3.5-lts",
17-
"seekdb": "1.0.1.0-100000392025122619"
17+
"seekdb": "1.0.1.0-100000392025122619",
18+
"opensandbox-server": "v0.1.7",
19+
"opensandbox-execd": "v1.0.7",
20+
"opensandbox-egress": "v1.0.1"
1821
},
1922
"images": {
2023
"cn": {
@@ -32,7 +35,10 @@
3235
"milvus-etcd": "quay.io/coreos/etcd",
3336
"milvus-standalone": "milvusdb/milvus",
3437
"oceanbase": "oceanbase/oceanbase-ce",
35-
"seekdb": "oceanbase/seekdb"
38+
"seekdb": "oceanbase/seekdb",
39+
"opensandbox-server": "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server",
40+
"opensandbox-execd": "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd",
41+
"opensandbox-egress": "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress"
3642
},
3743
"global": {
3844
"fastgpt": "ghcr.io/labring/fastgpt",
@@ -49,7 +55,10 @@
4955
"milvus-etcd": "quay.io/coreos/etcd",
5056
"milvus-standalone": "milvusdb/milvus",
5157
"oceanbase": "oceanbase/oceanbase-ce",
52-
"seekdb": "oceanbase/seekdb"
58+
"seekdb": "oceanbase/seekdb",
59+
"opensandbox-server": "opensandbox/server",
60+
"opensandbox-execd": "opensandbox/execd",
61+
"opensandbox-egress": "opensandbox/egress"
5362
}
5463
}
5564
}

deploy/docker/cn/docker-compose.milvus.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,41 @@ services:
183183
timeout: 20s
184184
retries: 3
185185

186+
opensandbox-server:
187+
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server:v0.1.7
188+
container_name: opensandbox-server
189+
restart: always
190+
networks:
191+
- fastgpt
192+
extra_hosts:
193+
- 'host.docker.internal:host-gateway' # Enable access to host machine
194+
volumes:
195+
- /var/run/docker.sock:/var/run/docker.sock
196+
configs:
197+
- source: opensandbox-config
198+
target: /etc/opensandbox/config.toml
199+
environment:
200+
- SANDBOX_CONFIG_PATH=/etc/opensandbox/config.toml
201+
healthcheck:
202+
test: ['CMD', 'curl', '-f', 'http://localhost:8090/health']
203+
interval: 10s
204+
timeout: 5s
205+
retries: 5
206+
186207
fastgpt:
187208
container_name: fastgpt
188209
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.14.8 # git
189210
ports:
190211
- 3000:3000
191212
networks:
192213
- fastgpt
214+
extra_hosts:
215+
- 'host.docker.internal:host-gateway' # Enable access to host machine
193216
depends_on:
194217
- mongo
195218
- sandbox
196219
- vectorDB
220+
- opensandbox-server
197221
restart: always
198222
environment:
199223
<<: [*x-share-db-config, *x-vec-config, *x-log-config]
@@ -215,6 +239,8 @@ services:
215239
PLUGIN_TOKEN: *x-plugin-auth-token
216240
# sandbox 地址
217241
CODE_SANDBOX_URL: http://sandbox:3000
242+
# opensandbox server 地址
243+
OPENSANDBOX_SERVER_URL: http://opensandbox-server:8090
218244
# AI Proxy 的地址,如果配了该地址,优先使用
219245
AIPROXY_API_ENDPOINT: http://aiproxy:3000
220246
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
@@ -335,3 +361,28 @@ networks:
335361
aiproxy:
336362
vector:
337363

364+
configs:
365+
# opensandbox config
366+
opensandbox-config:
367+
content: |
368+
[server]
369+
host = "0.0.0.0"
370+
port = 8090
371+
log_level = "INFO"
372+
373+
[runtime]
374+
type = "docker"
375+
execd_image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.7"
376+
377+
[egress]
378+
image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.0.1"
379+
380+
[docker]
381+
network_mode = "bridge"
382+
host_ip = "host.docker.internal"
383+
drop_capabilities = ["AUDIT_WRITE", "MKNOD", "NET_ADMIN", "NET_RAW", "SYS_ADMIN", "SYS_MODULE", "SYS_PTRACE", "SYS_TIME", "SYS_TTY_CONFIG"]
384+
no_new_privileges = true
385+
pids_limit = 512
386+
387+
[ingress]
388+
mode = "direct"

deploy/docker/cn/docker-compose.oceanbase.yml

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,17 +160,41 @@ services:
160160
timeout: 20s
161161
retries: 3
162162

163+
opensandbox-server:
164+
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server:v0.1.7
165+
container_name: opensandbox-server
166+
restart: always
167+
networks:
168+
- fastgpt
169+
extra_hosts:
170+
- 'host.docker.internal:host-gateway' # Enable access to host machine
171+
volumes:
172+
- /var/run/docker.sock:/var/run/docker.sock
173+
configs:
174+
- source: opensandbox-config
175+
target: /etc/opensandbox/config.toml
176+
environment:
177+
- SANDBOX_CONFIG_PATH=/etc/opensandbox/config.toml
178+
healthcheck:
179+
test: ['CMD', 'curl', '-f', 'http://localhost:8090/health']
180+
interval: 10s
181+
timeout: 5s
182+
retries: 5
183+
163184
fastgpt:
164185
container_name: fastgpt
165186
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.14.8 # git
166187
ports:
167188
- 3000:3000
168189
networks:
169190
- fastgpt
191+
extra_hosts:
192+
- 'host.docker.internal:host-gateway' # Enable access to host machine
170193
depends_on:
171194
- mongo
172195
- sandbox
173196
- vectorDB
197+
- opensandbox-server
174198
restart: always
175199
environment:
176200
<<: [*x-share-db-config, *x-vec-config, *x-log-config]
@@ -192,6 +216,8 @@ services:
192216
PLUGIN_TOKEN: *x-plugin-auth-token
193217
# sandbox 地址
194218
CODE_SANDBOX_URL: http://sandbox:3000
219+
# opensandbox server 地址
220+
OPENSANDBOX_SERVER_URL: http://opensandbox-server:8090
195221
# AI Proxy 的地址,如果配了该地址,优先使用
196222
AIPROXY_API_ENDPOINT: http://aiproxy:3000
197223
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
@@ -316,4 +342,28 @@ configs:
316342
name: init_sql
317343
content: |
318344
ALTER SYSTEM SET ob_vector_memory_limit_percentage = 30;
319-
345+
# opensandbox config
346+
opensandbox-config:
347+
content: |
348+
[server]
349+
host = "0.0.0.0"
350+
port = 8090
351+
log_level = "INFO"
352+
353+
[runtime]
354+
type = "docker"
355+
execd_image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.7"
356+
357+
[egress]
358+
image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.0.1"
359+
360+
[docker]
361+
network_mode = "bridge"
362+
host_ip = "host.docker.internal"
363+
drop_capabilities = ["AUDIT_WRITE", "MKNOD", "NET_ADMIN", "NET_RAW", "SYS_ADMIN", "SYS_MODULE", "SYS_PTRACE", "SYS_TIME", "SYS_TTY_CONFIG"]
364+
no_new_privileges = true
365+
pids_limit = 512
366+
367+
[ingress]
368+
mode = "direct"
369+

deploy/docker/cn/docker-compose.pg.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,41 @@ services:
141141
timeout: 20s
142142
retries: 3
143143

144+
opensandbox-server:
145+
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server:v0.1.7
146+
container_name: opensandbox-server
147+
restart: always
148+
networks:
149+
- fastgpt
150+
extra_hosts:
151+
- 'host.docker.internal:host-gateway' # Enable access to host machine
152+
volumes:
153+
- /var/run/docker.sock:/var/run/docker.sock
154+
configs:
155+
- source: opensandbox-config
156+
target: /etc/opensandbox/config.toml
157+
environment:
158+
- SANDBOX_CONFIG_PATH=/etc/opensandbox/config.toml
159+
healthcheck:
160+
test: ['CMD', 'curl', '-f', 'http://localhost:8090/health']
161+
interval: 10s
162+
timeout: 5s
163+
retries: 5
164+
144165
fastgpt:
145166
container_name: fastgpt
146167
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.14.8 # git
147168
ports:
148169
- 3000:3000
149170
networks:
150171
- fastgpt
172+
extra_hosts:
173+
- 'host.docker.internal:host-gateway' # Enable access to host machine
151174
depends_on:
152175
- mongo
153176
- sandbox
154177
- vectorDB
178+
- opensandbox-server
155179
restart: always
156180
environment:
157181
<<: [*x-share-db-config, *x-vec-config, *x-log-config]
@@ -173,6 +197,8 @@ services:
173197
PLUGIN_TOKEN: *x-plugin-auth-token
174198
# sandbox 地址
175199
CODE_SANDBOX_URL: http://sandbox:3000
200+
# opensandbox server 地址
201+
OPENSANDBOX_SERVER_URL: http://opensandbox-server:8090
176202
# AI Proxy 的地址,如果配了该地址,优先使用
177203
AIPROXY_API_ENDPOINT: http://aiproxy:3000
178204
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
@@ -293,3 +319,28 @@ networks:
293319
aiproxy:
294320
vector:
295321

322+
configs:
323+
# opensandbox config
324+
opensandbox-config:
325+
content: |
326+
[server]
327+
host = "0.0.0.0"
328+
port = 8090
329+
log_level = "INFO"
330+
331+
[runtime]
332+
type = "docker"
333+
execd_image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.7"
334+
335+
[egress]
336+
image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.0.1"
337+
338+
[docker]
339+
network_mode = "bridge"
340+
host_ip = "host.docker.internal"
341+
drop_capabilities = ["AUDIT_WRITE", "MKNOD", "NET_ADMIN", "NET_RAW", "SYS_ADMIN", "SYS_MODULE", "SYS_PTRACE", "SYS_TIME", "SYS_TTY_CONFIG"]
342+
no_new_privileges = true
343+
pids_limit = 512
344+
345+
[ingress]
346+
mode = "direct"

deploy/docker/cn/docker-compose.seekdb.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,41 @@ services:
147147
timeout: 20s
148148
retries: 3
149149

150+
opensandbox-server:
151+
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server:v0.1.7
152+
container_name: opensandbox-server
153+
restart: always
154+
networks:
155+
- fastgpt
156+
extra_hosts:
157+
- 'host.docker.internal:host-gateway' # Enable access to host machine
158+
volumes:
159+
- /var/run/docker.sock:/var/run/docker.sock
160+
configs:
161+
- source: opensandbox-config
162+
target: /etc/opensandbox/config.toml
163+
environment:
164+
- SANDBOX_CONFIG_PATH=/etc/opensandbox/config.toml
165+
healthcheck:
166+
test: ['CMD', 'curl', '-f', 'http://localhost:8090/health']
167+
interval: 10s
168+
timeout: 5s
169+
retries: 5
170+
150171
fastgpt:
151172
container_name: fastgpt
152173
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.14.8 # git
153174
ports:
154175
- 3000:3000
155176
networks:
156177
- fastgpt
178+
extra_hosts:
179+
- 'host.docker.internal:host-gateway' # Enable access to host machine
157180
depends_on:
158181
- mongo
159182
- sandbox
160183
- vectorDB
184+
- opensandbox-server
161185
restart: always
162186
environment:
163187
<<: [*x-share-db-config, *x-vec-config, *x-log-config]
@@ -179,6 +203,8 @@ services:
179203
PLUGIN_TOKEN: *x-plugin-auth-token
180204
# sandbox 地址
181205
CODE_SANDBOX_URL: http://sandbox:3000
206+
# opensandbox server 地址
207+
OPENSANDBOX_SERVER_URL: http://opensandbox-server:8090
182208
# AI Proxy 的地址,如果配了该地址,优先使用
183209
AIPROXY_API_ENDPOINT: http://aiproxy:3000
184210
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
@@ -299,3 +325,28 @@ networks:
299325
aiproxy:
300326
vector:
301327

328+
configs:
329+
# opensandbox config
330+
opensandbox-config:
331+
content: |
332+
[server]
333+
host = "0.0.0.0"
334+
port = 8090
335+
log_level = "INFO"
336+
337+
[runtime]
338+
type = "docker"
339+
execd_image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.7"
340+
341+
[egress]
342+
image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.0.1"
343+
344+
[docker]
345+
network_mode = "bridge"
346+
host_ip = "host.docker.internal"
347+
drop_capabilities = ["AUDIT_WRITE", "MKNOD", "NET_ADMIN", "NET_RAW", "SYS_ADMIN", "SYS_MODULE", "SYS_PTRACE", "SYS_TIME", "SYS_TTY_CONFIG"]
348+
no_new_privileges = true
349+
pids_limit = 512
350+
351+
[ingress]
352+
mode = "direct"

0 commit comments

Comments
 (0)