Commit eb378e06 by DigHuang Committed by GitHub

chore(deploy): upgrade OpenSandbox images and integrate agent-sandbox-proxy (#7294)

* chore(deploy): upgrade opensandbox images and integrate agent-sandbox-proxy

* fix(deploy): expose agent sandbox proxy on port 3006

* fix(deploy): connect host-network plugin directly to MongoDB
parent a7394b73
......@@ -9,6 +9,7 @@
# - fastgpt-mcp-server: 3003
# - fastgpt-plugin: 3004(host network,由 PORT 指定)
# - fastgpt-volume-manager: 3005
# - fastgpt-agent-sandbox-proxy: 3006
# - opensandbox-server: 8090
# - fastgpt-aiproxy: 3010
# - fastgpt-aiproxy-pg: 5432
......@@ -17,11 +18,13 @@
# - 配置 opensandbox-config 的 host_ip 为宿主机 LAN IP,如 192.168.1.100
# plugin auth token
x-plugin-auth-token: &x-plugin-auth-token 'token'
x-plugin-auth-token: &x-plugin-auth-token 'fastgpt-plugin-dev-token-12345678'
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# volume manager auth token
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# agent sandbox proxy auth token
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -50,8 +53,8 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-pg,fastgpt-mcp-server,opensandbox-server,fastgpt-volume-manager,host.docker.internal,*.orb.internal,*.orb.local
no_proxy: localhost,127.0.0.1,::1,fastgpt,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-pg,fastgpt-mcp-server,opensandbox-server,fastgpt-volume-manager,host.docker.internal,*.orb.internal,*.orb.local
NO_PROXY: localhost,127.0.0.1,::1,fastgpt,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-pg,fastgpt-mcp-server,opensandbox-server,fastgpt-volume-manager,host.docker.internal,*.orb.internal,*.orb.local
no_proxy: localhost,127.0.0.1,::1,fastgpt,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-pg,fastgpt-mcp-server,opensandbox-server,fastgpt-volume-manager,host.docker.internal,*.orb.internal,*.orb.local
services:
# Vector DB
......@@ -254,7 +257,7 @@ services:
AUTH_TOKEN: *x-plugin-auth-token
PORT: 3004
FASTGPT_BASE_URL: http://127.0.0.1:3000
MONGODB_URI: mongodb://myusername:mypassword@127.0.0.1:27017/fastgpt?authSource=admin
MONGODB_URI: mongodb://myusername:mypassword@127.0.0.1:27017/fastgpt?authSource=admin&directConnection=true
REDIS_URL: redis://default:mypassword@127.0.0.1:6379
STORAGE_S3_ENDPOINT: http://127.0.0.1:9000
# 工具网络请求,最大请求和响应体
......@@ -276,7 +279,7 @@ services:
# runtime=docker 模式需要挂载 Docker socket
# 配置 docker.host_ip 为宿主机 LAN IP(容器内访问宿主机服务用)
opensandbox-server:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/opensandbox-server:v0.1.9
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server:v0.2.1
container_name: fastgpt-opensandbox-server
restart: always
ports:
......@@ -294,21 +297,50 @@ services:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:8090/health']
test:
[
'CMD',
'python3',
'-c',
"import urllib.request; urllib.request.urlopen('http://localhost:8090/health').read()"
]
interval: 10s
timeout: 5s
retries: 5
# 浏览器与 OpenSandbox 之间的 WebSocket 鉴权代理
fastgpt-agent-sandbox-proxy:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox-proxy:v0.2.0
container_name: fastgpt-agent-sandbox-proxy
restart: always
ports:
- 3006:1006
networks:
- fastgpt
extra_hosts:
- 'host.docker.internal:host-gateway'
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://host.docker.internal:3000
AGENT_SANDBOX_PROXY_REWRITE_HOST: opensandbox-server
RUST_LOG: info,fastgpt_agent_sandbox_proxy
depends_on:
opensandbox-server:
condition: service_healthy
# Pre-pull only: not started by `docker compose up` (uses profile `prepull`).
opensandbox-agent-sandbox-image:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.2.0
profiles:
- prepull
opensandbox-execd-image:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/opensandbox-execd:v1.0.7
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/opensandbox-egress:v1.0.3
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4
profiles:
- prepull
# 卷管理微服务:负责幂等创建/删除 Docker named volume 或 k8s PVC
......@@ -408,13 +440,14 @@ configs:
host = "0.0.0.0"
port = 8090
log_level = "INFO"
api_key = "my_secure_sandbox_key_123"
[runtime]
type = "docker"
execd_image = "registry.cn-hangzhou.aliyuncs.com/fastgpt/opensandbox-execd:v1.0.7"
execd_image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21"
[egress]
image = "registry.cn-hangzhou.aliyuncs.com/fastgpt/opensandbox-egress:v1.0.3"
image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
......
......@@ -9,6 +9,7 @@
# - fastgpt-mcp-server: 3003
# - fastgpt-plugin: 3004(host network,由 PORT 指定)
# - fastgpt-volume-manager: 3005
# - fastgpt-agent-sandbox-proxy: 3006
# - opensandbox-server: 8090
# - fastgpt-aiproxy: 3010
# - fastgpt-aiproxy-pg: 5432
......@@ -17,11 +18,13 @@
# - 配置 opensandbox-config 的 host_ip 为宿主机 LAN IP,如 192.168.1.100
# plugin auth token
x-plugin-auth-token: &x-plugin-auth-token 'token'
x-plugin-auth-token: &x-plugin-auth-token 'fastgpt-plugin-dev-token-12345678'
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# volume manager auth token
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# agent sandbox proxy auth token
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -50,8 +53,8 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-pg,fastgpt-mcp-server,opensandbox-server,fastgpt-volume-manager,host.docker.internal,*.orb.internal,*.orb.local
no_proxy: localhost,127.0.0.1,::1,fastgpt,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-pg,fastgpt-mcp-server,opensandbox-server,fastgpt-volume-manager,host.docker.internal,*.orb.internal,*.orb.local
NO_PROXY: localhost,127.0.0.1,::1,fastgpt,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-pg,fastgpt-mcp-server,opensandbox-server,fastgpt-volume-manager,host.docker.internal,*.orb.internal,*.orb.local
no_proxy: localhost,127.0.0.1,::1,fastgpt,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-pg,fastgpt-mcp-server,opensandbox-server,fastgpt-volume-manager,host.docker.internal,*.orb.internal,*.orb.local
services:
# Vector DB
......@@ -254,7 +257,7 @@ services:
AUTH_TOKEN: *x-plugin-auth-token
PORT: 3004
FASTGPT_BASE_URL: http://127.0.0.1:3000
MONGODB_URI: mongodb://myusername:mypassword@127.0.0.1:27017/fastgpt?authSource=admin
MONGODB_URI: mongodb://myusername:mypassword@127.0.0.1:27017/fastgpt?authSource=admin&directConnection=true
REDIS_URL: redis://default:mypassword@127.0.0.1:6379
STORAGE_S3_ENDPOINT: http://127.0.0.1:9000
# 工具网络请求,最大请求和响应体
......@@ -276,7 +279,7 @@ services:
# runtime=docker 模式需要挂载 Docker socket
# 配置 docker.host_ip 为宿主机 LAN IP(容器内访问宿主机服务用)
opensandbox-server:
image: opensandbox/server:v0.1.9
image: opensandbox/server:v0.2.1
container_name: fastgpt-opensandbox-server
restart: always
ports:
......@@ -294,21 +297,50 @@ services:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:8090/health']
test:
[
'CMD',
'python3',
'-c',
"import urllib.request; urllib.request.urlopen('http://localhost:8090/health').read()"
]
interval: 10s
timeout: 5s
retries: 5
# 浏览器与 OpenSandbox 之间的 WebSocket 鉴权代理
fastgpt-agent-sandbox-proxy:
image: ghcr.io/labring/fastgpt-agent-sandbox-proxy:v0.2.0
container_name: fastgpt-agent-sandbox-proxy
restart: always
ports:
- 3006:1006
networks:
- fastgpt
extra_hosts:
- 'host.docker.internal:host-gateway'
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://host.docker.internal:3000
AGENT_SANDBOX_PROXY_REWRITE_HOST: opensandbox-server
RUST_LOG: info,fastgpt_agent_sandbox_proxy
depends_on:
opensandbox-server:
condition: service_healthy
# Pre-pull only: not started by `docker compose up` (uses profile `prepull`).
opensandbox-agent-sandbox-image:
image: ghcr.io/labring/fastgpt-agent-sandbox:v0.2.0
profiles:
- prepull
opensandbox-execd-image:
image: opensandbox/execd:v1.0.7
image: opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: opensandbox/egress:v1.0.3
image: opensandbox/egress:v1.1.4
profiles:
- prepull
# 卷管理微服务:负责幂等创建/删除 Docker named volume 或 k8s PVC
......@@ -408,13 +440,14 @@ configs:
host = "0.0.0.0"
port = 8090
log_level = "INFO"
api_key = "my_secure_sandbox_key_123"
[runtime]
type = "docker"
execd_image = "opensandbox/execd:v1.0.7"
execd_image = "opensandbox/execd:v1.0.21"
[egress]
image = "opensandbox/egress:v1.0.3"
image = "opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
......
......@@ -144,7 +144,7 @@ The following table lists the configurable parameters of the chart and their def
|-----------|-------------|---------|
| `server.enabled` | Enable server deployment | `true` |
| `server.image.repository` | Server image repository | `opensandbox/server` |
| `server.image.tag` | Server image tag | `v0.1.0` |
| `server.image.tag` | Server image tag | `v0.2.1` |
| `server.image.pullPolicy` | Image pull policy | `Never` |
| `server.replicas` | Number of server replicas | `1` |
| `server.resources.limits.cpu` | CPU limit | `1` |
......@@ -156,7 +156,7 @@ The following table lists the configurable parameters of the chart and their def
| `server.config.server.logLevel` | Log level (INFO/DEBUG/WARNING/ERROR) | `INFO` |
| `server.config.server.apiKey` | Optional API key for authentication | `""` |
| `server.config.runtime.type` | Runtime type (kubernetes/docker) | `kubernetes` |
| `server.config.runtime.execdImage` | execd image for non-pool mode | `opensandbox/execd:v1.0.5` |
| `server.config.runtime.execdImage` | execd image for non-pool mode | `opensandbox/execd:v1.0.21` |
| `server.config.kubernetes.workloadProvider` | Workload provider type | `batchsandbox` |
| `server.service.type` | Service type (ClusterIP/NodePort/LoadBalancer) | `ClusterIP` |
| `server.service.port` | Service port | `8080` |
......
......@@ -188,7 +188,7 @@ kubectl get pods -l batchsandbox=basic-batch-sandbox -n opensandbox
# ❌ Does not support custom entrypoint
initContainers:
- name: execd-installer
image: opensandbox/execd:v1.0.5
image: opensandbox/execd:v1.0.21
containers:
- name: sandbox-container
command: ["/opt/opensandbox/bin/bootstrap.sh", "nginx", "-g", "daemon off;"]
......@@ -216,7 +216,7 @@ spec:
shareProcessNamespace: true # Required by task-executor
initContainers:
- name: execd-installer
image: opensandbox/execd:v1.0.5
image: opensandbox/execd:v1.0.21
containers:
- name: sandbox-container
command: ["/opt/opensandbox/bin/bootstrap.sh", "sleep", "infinity"]
......
......@@ -70,7 +70,7 @@ spec:
# ❌ 不需要:纯 kubectl 批量任务(RL 训练、压力测试等)
initContainers:
- name: execd-installer
image: opensandbox/execd:v1.0.5
image: opensandbox/execd:v1.0.21
imagePullPolicy: IfNotPresent
command: ["/bin/sh", "-c"]
args:
......
......@@ -9,7 +9,7 @@ spec:
# Init container: 安装execd
initContainers:
- name: execd-installer
image: opensandbox/execd:v1.0.5
image: opensandbox/execd:v1.0.21
command: ["/bin/sh", "-c"]
args:
- |
......
......@@ -11,7 +11,7 @@ spec:
# Init container: 安装execd
initContainers:
- name: execd-installer
image: opensandbox/execd:v1.0.5
image: opensandbox/execd:v1.0.21
command: ["/bin/sh", "-c"]
args:
- |
......
......@@ -37,7 +37,7 @@ cd scripts
IMAGE_REPO=myregistry.com/controller \
IMAGE_TAG=v1.0.0 \
SERVER_IMAGE_REPO=myregistry.com/server \
SERVER_IMAGE_TAG=v0.1.0 \
SERVER_IMAGE_TAG=v0.2.1 \
./install.sh
```
......@@ -101,9 +101,9 @@ cd scripts
**Prerequisites:**
- Required Docker images must be loaded:
- opensandbox/controller:dev
- opensandbox/server:v0.1.0
- opensandbox/server:v0.2.1
- opensandbox/task-executor:dev
- opensandbox/execd:v1.0.5
- opensandbox/execd:v1.0.21
- nginx:latest
- Python SDK installed (using uv)
- Cluster has sufficient resources to run test Pods
......
......@@ -71,7 +71,7 @@ pools:
shareProcessNamespace: true
initContainers:
- name: execd-installer
image: opensandbox/execd:v1.0.5
image: opensandbox/execd:v1.0.21
imagePullPolicy: Never
command: ["/bin/sh", "-c"]
args:
......
......@@ -106,7 +106,7 @@ server:
# Server image configuration
image:
repository: opensandbox/server
tag: "v0.1.9"
tag: "v0.2.1"
pullPolicy: Never
# Number of replicas
......@@ -177,7 +177,7 @@ server:
runtime:
type: "kubernetes"
execdImage: "opensandbox/execd:v1.0.5"
execdImage: "opensandbox/execd:v1.0.21"
kubernetes:
# workloadProvider: batchsandbox (use Pool) or agent-sandbox
......@@ -360,7 +360,7 @@ pools:
# Init Container: Install execd (required for SDK scenario)
initContainers:
- name: execd-installer
image: opensandbox/execd:v1.0.5
image: opensandbox/execd:v1.0.21
imagePullPolicy: Never
command: ["/bin/sh", "-c"]
args:
......
......@@ -144,7 +144,8 @@ const loadVectorConfigs = async () => {
};
/**
* @typedef {{ tag: String, image: {cn: String, global: String} }} ArgItemType
* @typedef {string} ServiceKey
* @typedef {{ tag: string, image: {cn: string, global: string} }} ArgItemType
*/
/**
* 读取指定部署版本的镜像参数。
......@@ -153,11 +154,11 @@ const loadVectorConfigs = async () => {
* 分支的迭代镜像意外覆盖。
*
* @param {string} version
* @returns {Record<Services, ArgItemType>}
* @returns {Record<ServiceKey, ArgItemType>}
*/
const loadArgs = (version) => {
/**
* @type {{tags: Record<Services, string>, images: Record<Services, Record<string, string>>}}
* @type {{tags: Record<ServiceKey, string>, images: Record<string, Record<ServiceKey, string>>}}
*/
const obj = JSON.parse(
fs.readFileSync(path.join(process.cwd(), 'version', version, 'args.json'))
......@@ -184,7 +185,7 @@ const loadArgs = (version) => {
* @param {string} source
* @param {RegionEnum} region
* @param {string | undefined} vec
* @param {Record<Services, ArgItemType>} args
* @param {Record<ServiceKey, ArgItemType>} args
* @param {Record<string, { filename: string, db: string, config: string, extra: string, extraBlock: string, depends: string }>} vectors
* @param {string} context
* @returns {string}
......
......@@ -9,6 +9,7 @@
# - fastgpt-mcp-server: 3003
# - fastgpt-plugin: 3004(host network,由 PORT 指定)
# - fastgpt-volume-manager: 3005
# - fastgpt-agent-sandbox-proxy: 3006
# - opensandbox-server: 8090
# - fastgpt-aiproxy: 3010
# - fastgpt-aiproxy-pg: 5432
......@@ -17,11 +18,13 @@
# - 配置 opensandbox-config 的 host_ip 为宿主机 LAN IP,如 192.168.1.100
# plugin auth token
x-plugin-auth-token: &x-plugin-auth-token 'token'
x-plugin-auth-token: &x-plugin-auth-token 'fastgpt-plugin-dev-token-12345678'
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# volume manager auth token
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# agent sandbox proxy auth token
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -50,8 +53,8 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-pg,fastgpt-mcp-server,opensandbox-server,fastgpt-volume-manager,host.docker.internal,*.orb.internal,*.orb.local
no_proxy: localhost,127.0.0.1,::1,fastgpt,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-pg,fastgpt-mcp-server,opensandbox-server,fastgpt-volume-manager,host.docker.internal,*.orb.internal,*.orb.local
NO_PROXY: localhost,127.0.0.1,::1,fastgpt,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-pg,fastgpt-mcp-server,opensandbox-server,fastgpt-volume-manager,host.docker.internal,*.orb.internal,*.orb.local
no_proxy: localhost,127.0.0.1,::1,fastgpt,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-pg,fastgpt-mcp-server,opensandbox-server,fastgpt-volume-manager,host.docker.internal,*.orb.internal,*.orb.local
services:
# Vector DB
......@@ -254,7 +257,7 @@ services:
AUTH_TOKEN: *x-plugin-auth-token
PORT: 3004
FASTGPT_BASE_URL: http://127.0.0.1:3000
MONGODB_URI: mongodb://myusername:mypassword@127.0.0.1:27017/fastgpt?authSource=admin
MONGODB_URI: mongodb://myusername:mypassword@127.0.0.1:27017/fastgpt?authSource=admin&directConnection=true
REDIS_URL: redis://default:mypassword@127.0.0.1:6379
STORAGE_S3_ENDPOINT: http://127.0.0.1:9000
# 工具网络请求,最大请求和响应体
......@@ -294,10 +297,39 @@ services:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:8090/health']
test:
[
'CMD',
'python3',
'-c',
"import urllib.request; urllib.request.urlopen('http://localhost:8090/health').read()"
]
interval: 10s
timeout: 5s
retries: 5
# 浏览器与 OpenSandbox 之间的 WebSocket 鉴权代理
fastgpt-agent-sandbox-proxy:
image: ${{agent-sandbox-proxy.image}}:${{agent-sandbox-proxy.tag}}
container_name: fastgpt-agent-sandbox-proxy
restart: always
ports:
- 3006:1006
networks:
- fastgpt
extra_hosts:
- 'host.docker.internal:host-gateway'
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://host.docker.internal:3000
AGENT_SANDBOX_PROXY_REWRITE_HOST: opensandbox-server
RUST_LOG: info,fastgpt_agent_sandbox_proxy
depends_on:
opensandbox-server:
condition: service_healthy
# Pre-pull only: not started by `docker compose up` (uses profile `prepull`).
opensandbox-agent-sandbox-image:
image: ${{agent-sandbox-image.image}}:${{agent-sandbox-image.tag}}
......@@ -408,6 +440,7 @@ configs:
host = "0.0.0.0"
port = 8090
log_level = "INFO"
api_key = "my_secure_sandbox_key_123"
[runtime]
type = "docker"
......
......@@ -7,9 +7,10 @@
"volume-manager": "v0.2.0",
"agent-sandbox-image": "v0.2.0",
"opensandbox-server": "v0.1.9",
"opensandbox-execd": "v1.0.7",
"opensandbox-egress": "v1.0.3",
"agent-sandbox-proxy": "v0.2.0",
"opensandbox-server": "v0.2.1",
"opensandbox-execd": "v1.0.21",
"opensandbox-egress": "v1.1.4",
"aiproxy": "v0.6.5",
"aiproxy-pg": "0.8.0-pg15",
......@@ -32,9 +33,10 @@
"fastgpt-mcp_server": "registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server",
"volume-manager": "registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-volume-manager",
"agent-sandbox-image": "registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox",
"opensandbox-server": "registry.cn-hangzhou.aliyuncs.com/fastgpt/opensandbox-server",
"opensandbox-execd": "registry.cn-hangzhou.aliyuncs.com/fastgpt/opensandbox-execd",
"opensandbox-egress": "registry.cn-hangzhou.aliyuncs.com/fastgpt/opensandbox-egress",
"agent-sandbox-proxy": "registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox-proxy",
"opensandbox-server": "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server",
"opensandbox-execd": "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd",
"opensandbox-egress": "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress",
"aiproxy": "registry.cn-hangzhou.aliyuncs.com/labring/aiproxy",
"aiproxy-pg": "registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector",
"mongo": "registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo",
......@@ -54,6 +56,7 @@
"fastgpt-mcp_server": "ghcr.io/labring/fastgpt-mcp_server",
"volume-manager": "ghcr.io/labring/fastgpt-agent-volume-manager",
"agent-sandbox-image": "ghcr.io/labring/fastgpt-agent-sandbox",
"agent-sandbox-proxy": "ghcr.io/labring/fastgpt-agent-sandbox-proxy",
"opensandbox-server": "opensandbox/server",
"opensandbox-execd": "opensandbox/execd",
"opensandbox-egress": "opensandbox/egress",
......
......@@ -20,10 +20,10 @@ Use [opensandbox.yml](/deploy/sandbox_deploy/opensandbox.yml) as a reference. Ad
The sample uses China Mainland image registries. For deployments outside China Mainland, replace them with:
- `opensandbox/server:v0.1.9`
- `opensandbox/server:v0.2.1`
- `ghcr.io/labring/fastgpt-agent-sandbox:v0.2.0`
- `opensandbox/execd:v1.0.6`
- `opensandbox/egress:v1.0.1`
- `opensandbox/execd:v1.0.21`
- `opensandbox/egress:v1.1.4`
- `ghcr.io/labring/fastgpt-agent-volume-manager:v0.2.0`
## 2. Update OpenSandbox variables
......@@ -85,7 +85,7 @@ docker compose exec fastgpt-opensandbox-server python -c "import urllib.request;
docker compose exec fastgpt-volume-manager node -e "fetch('http://localhost:3000/health').then(async r => { console.log(await r.text()); if (!r.ok) process.exit(1); })"
```
OpenSandbox should return `OK`, and `fastgpt-volume-manager` should return a health JSON response. See [General Sandbox Configuration](./common) for Agent Sandbox Proxy verification.
OpenSandbox should return `{"status":"healthy"}`, and `fastgpt-volume-manager` should return a health JSON response. See [General Sandbox Configuration](./common) for Agent Sandbox Proxy verification.
4. Log in to FastGPT and open a scenario that supports Agent Sandbox, such as Agent V2 VM, Skill editing, or Skill debugging. Confirm that the sandbox can be created and that the file tree and terminal open normally.
......
......@@ -19,10 +19,10 @@ OpenSandbox 适合需要自托管 Agent/Skill 沙盒运行环境的场景。开
下面示例使用国内镜像源。海外部署可将镜像替换为:
- `opensandbox/server:v0.1.9`
- `opensandbox/server:v0.2.1`
- `ghcr.io/labring/fastgpt-agent-sandbox:v0.2.0`
- `opensandbox/execd:v1.0.6`
- `opensandbox/egress:v1.0.1`
- `opensandbox/execd:v1.0.21`
- `opensandbox/egress:v1.1.4`
- `ghcr.io/labring/fastgpt-agent-volume-manager:v0.2.0`
## 2. 修改 OpenSandbox 变量
......@@ -84,7 +84,7 @@ docker compose exec fastgpt-opensandbox-server python -c "import urllib.request;
docker compose exec fastgpt-volume-manager node -e "fetch('http://localhost:3000/health').then(async r => { console.log(await r.text()); if (!r.ok) process.exit(1); })"
```
正常情况下,OpenSandbox 的健康检查会返回 `OK`,`fastgpt-volume-manager` 会返回健康状态 JSON。Agent Sandbox Proxy 的验证方式见[沙盒通用配置](./common)。
正常情况下,OpenSandbox 的健康检查会返回 `{"status":"healthy"}`,`fastgpt-volume-manager` 会返回健康状态 JSON。Agent Sandbox Proxy 的验证方式见[沙盒通用配置](./common)。
4. 登录 FastGPT,打开支持 Agent Sandbox 的场景,例如 Agent V2 虚拟机、Skill 编辑或 Skill 调试,确认可以正常创建沙盒、打开文件树和终端。
......
......@@ -20,7 +20,7 @@ If Agent Sandbox is enabled, also add the following environment variables to `fa
# Shared with fastgpt-agent-sandbox-proxy. In production, replace it with a random secret longer than 32 characters.
AGENT_SANDBOX_PROXY_SECRET=replace_with_32_chars_random_secret
# Browser-accessible WebSocket URL for agent-sandbox-proxy. Use wss:// if it is proxied through an HTTPS domain.
AGENT_SANDBOX_PROXY_URL=ws://{{host}}:1006
AGENT_SANDBOX_PROXY_URL=ws://{{host}}:3006
```
### 2. Image Changes
......@@ -43,7 +43,7 @@ fastgpt-agent-sandbox-proxy:
container_name: fastgpt-agent-sandbox-proxy
restart: always
ports:
- 1006:1006
- 3006:1006
networks:
- fastgpt
environment:
......
......@@ -20,7 +20,7 @@ INVOKE_TOKEN_SECRET=32 位以上密钥,反向调用接口 jwt 密钥
# 与 fastgpt-agent-sandbox-proxy 共用,生产环境请改为 32 位以上随机密钥
AGENT_SANDBOX_PROXY_SECRET=replace_with_32_chars_random_secret
# 浏览器可访问的 agent-sandbox-proxy WebSocket 地址;如已通过 HTTPS 域名代理,请使用 wss://
AGENT_SANDBOX_PROXY_URL=ws://{{host}}:1006
AGENT_SANDBOX_PROXY_URL=ws://{{host}}:3006
```
### 2. 镜像变更
......@@ -43,7 +43,7 @@ fastgpt-agent-sandbox-proxy:
container_name: fastgpt-agent-sandbox-proxy
restart: always
ports:
- 1006:1006
- 3006:1006
networks:
- fastgpt
environment:
......
......@@ -151,8 +151,8 @@
"content/guide/workspace/team/team_roles_permissions.mdx": "2026-05-07T15:06:40+08:00",
"content/openapi/app.en.mdx": "2026-05-29T19:31:16+08:00",
"content/openapi/app.mdx": "2026-05-29T19:31:16+08:00",
"content/openapi/chat.en.mdx": "2026-06-23T13:54:06+08:00",
"content/openapi/chat.mdx": "2026-07-08T22:07:36+08:00",
"content/openapi/chat.en.mdx": "2026-07-08T22:37:19+08:00",
"content/openapi/chat.mdx": "2026-07-08T22:37:19+08:00",
"content/openapi/dataset.en.mdx": "2026-05-29T19:31:16+08:00",
"content/openapi/dataset.mdx": "2026-05-29T19:31:16+08:00",
"content/openapi/index.en.mdx": "2026-04-26T21:08:47+08:00",
......@@ -181,8 +181,8 @@
"content/self-host/config/remote-debug-suite.mdx": "2026-06-27T22:05:51+08:00",
"content/self-host/config/sandbox/common.en.mdx": "2026-07-02T15:38:53+08:00",
"content/self-host/config/sandbox/common.mdx": "2026-07-02T15:38:53+08:00",
"content/self-host/config/sandbox/opensandbox.en.mdx": "2026-07-02T15:38:53+08:00",
"content/self-host/config/sandbox/opensandbox.mdx": "2026-07-02T15:38:53+08:00",
"content/self-host/config/sandbox/opensandbox.en.mdx": "2026-07-13T12:11:12+08:00",
"content/self-host/config/sandbox/opensandbox.mdx": "2026-07-13T12:11:12+08:00",
"content/self-host/config/sandbox/sealosdevbox.en.mdx": "2026-06-30T14:56:33+08:00",
"content/self-host/config/sandbox/sealosdevbox.mdx": "2026-06-30T14:56:33+08:00",
"content/self-host/config/signoz.en.mdx": "2026-04-26T21:08:47+08:00",
......@@ -320,8 +320,8 @@
"content/self-host/upgrading/4-15/41507.mdx": "2026-06-30T17:31:43+08:00",
"content/self-host/upgrading/4-15/4151.en.mdx": "2026-07-07T21:14:28+08:00",
"content/self-host/upgrading/4-15/4151.mdx": "2026-07-07T21:14:28+08:00",
"content/self-host/upgrading/4-15/4152.en.mdx": "2026-07-08T21:29:17+08:00",
"content/self-host/upgrading/4-15/4152.mdx": "2026-07-08T21:29:17+08:00",
"content/self-host/upgrading/4-15/4152.en.mdx": "2026-07-08T22:37:19+08:00",
"content/self-host/upgrading/4-15/4152.mdx": "2026-07-08T22:37:19+08:00",
"content/self-host/upgrading/outdated/40.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/40.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/41.en.mdx": "2026-04-26T21:08:47+08:00",
......@@ -462,6 +462,6 @@
"content/self-host/upgrading/outdated/499.mdx": "2026-05-07T15:06:40+08:00",
"content/self-host/upgrading/upgrade-intruction.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/upgrade-intruction.mdx": "2026-04-26T21:08:47+08:00",
"content/toc.en.mdx": "2026-07-08T21:29:17+08:00",
"content/toc.en.mdx": "2026-07-08T22:37:19+08:00",
"content/toc.mdx": "2026-07-06T22:53:13+08:00"
}
\ No newline at end of file
# FastGPT Agent Sandbox Proxy standalone deployment.
# After starting this file, set FastGPT AGENT_SANDBOX_PROXY_URL to ws://<host>:1006 or your wss:// domain.
# After starting this file, set FastGPT AGENT_SANDBOX_PROXY_URL to ws://<host>:3006 or your wss:// domain.
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret "default_fastgpt_agent_sandbox_proxy_secret"
......
......@@ -17,7 +17,7 @@ x-no-proxy-config: &x-no-proxy-config
services:
fastgpt-opensandbox-server:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/opensandbox-server:v0.1.9
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server:v0.2.1
container_name: fastgpt-opensandbox-server
restart: always
networks:
......@@ -76,12 +76,12 @@ services:
- prepull
opensandbox-execd-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.6
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.0.1
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4
profiles:
- prepull
......@@ -96,10 +96,10 @@ configs:
[runtime]
type = "docker"
execd_image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.6"
execd_image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21"
[egress]
image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.0.1"
image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment