diff --git a/.env.example b/.env.example index 01939bb533..0485ab82f9 100644 --- a/.env.example +++ b/.env.example @@ -101,7 +101,7 @@ EXA_BASE_URL=https://api.exa.ai # BOXD_API_KEY=your-boxd-api-key # BytePlus veFaaS cloud sandbox credentials — required only when using VeFaaSSandboxProvider. -# Learn more: https://www.byteplus.com/en/product/vefaas +# Learn more: https://www.byteplus.com/en/product/vefaas?utm_campaign=deer_flow&utm_content=deer_flow&utm_medium=devrel&utm_source=OWO&utm_term=deer_flow # BYTEPLUS_ACCESS_KEY_ID=your-byteplus-access-key-id # BYTEPLUS_SECRET_ACCESS_KEY=your-byteplus-secret-access-key # BYTEPLUS_VEFAAS_SANDBOX_APP_ID=your-vefaas-sandbox-app-id diff --git a/README_zh.md b/README_zh.md index 3968476689..f42b1b0b55 100644 --- a/README_zh.md +++ b/README_zh.md @@ -419,7 +419,7 @@ DeerFlow 支持多种沙箱模式。 - **本地工作区**(通过工作区文件工具访问已配置的挂载) - **Docker 执行**(在隔离的 Docker 容器里运行 sandbox 代码) - **Docker + Kubernetes 执行**(通过 provisioner 服务在 Kubernetes Pod 中运行 sandbox 代码) -- **BytePlus veFaaS 云端沙箱**(基于 [BytePlus veFaaS](https://www.byteplus.com/en/product/vefaas) Serverless AIO 沙箱,支持推测预热、空闲暂停/自动唤醒、线程级快照、镜像预热与可选 TOS 挂载,详见 [veFaaS Sandbox Provider](backend/packages/harness/deerflow/community/vefaas_sandbox/README.md)) +- **BytePlus veFaaS 云端沙箱**(基于 [BytePlus veFaaS](https://www.byteplus.com/en/product/vefaas?utm_campaign=deer_flow&utm_content=deer_flow&utm_medium=devrel&utm_source=OWO&utm_term=deer_flow) Serverless AIO 沙箱,支持推测预热、空闲暂停/自动唤醒、线程级快照、镜像预热与可选 TOS 挂载,详见 [veFaaS Sandbox Provider](backend/packages/harness/deerflow/community/vefaas_sandbox/README.md)) Docker 开发时,服务启动行为会遵循 `config.yaml` 里的 sandbox 模式。在 Local / Docker 模式下,不会启动 `provisioner`。 diff --git a/backend/docs/CONFIGURATION.md b/backend/docs/CONFIGURATION.md index 103226fb14..a858338752 100644 --- a/backend/docs/CONFIGURATION.md +++ b/backend/docs/CONFIGURATION.md @@ -1890,6 +1890,45 @@ hibernation wake on the call. Downloads are restricted to `/mnt/user-data` and capped while streaming. Like the other remote providers, `replicas` is a per-Gateway-process soft cap. +**BytePlus veFaaS Cloud Sandbox** (runs each thread sandbox in a serverless [BytePlus veFaaS](https://www.byteplus.com/en/product/vefaas?utm_campaign=deer_flow&utm_content=deer_flow&utm_medium=devrel&utm_source=OWO&utm_term=deer_flow) AIO sandbox; see the [veFaaS documentation](https://docs.byteplus.com/en/docs/vefaas/what-is-vefaas?utm_campaign=deer_flow&utm_content=deer_flow&utm_medium=devrel&utm_source=OWO&utm_term=deer_flow)): + +```yaml +sandbox: + use: deerflow.community.vefaas_sandbox:VeFaaSSandboxProvider + # prewarm: true # optional: overlap sandbox creation with the first model turn + vefaas: + region: ap-southeast-1 + endpoint: https://vefaas.ap-southeast-1.byteplusapi.com + function_id: $BYTEPLUS_VEFAAS_SANDBOX_APP_ID + sandbox_base_url: $BYTEPLUS_VEFAAS_SANDBOX_BASE_URL + access_key_env: BYTEPLUS_ACCESS_KEY_ID + secret_key_env: BYTEPLUS_SECRET_ACCESS_KEY + cpu_milli: 1000 + memory_mb: 2048 + timeout_minutes: 60 + # pause_on_idle: true # optional: pause idle sandboxes and auto-resume + # snapshot_on_idle: true # optional: thread-scoped snapshots with retention pruning + # snapshot_retention_days: 7 + # max_snapshots_per_sandbox: 3 + # precache_images: + # - cr-ap-southeast-1.cr.bytepluses.com/namespace/all-in-one-sandbox:latest + # precache_on_startup: true + tos_mount: + enabled: false + bucket: $BYTEPLUS_TOS_BUCKET + prefix: deerflow-user-data + replicas: 3 + idle_timeout: 600 + # ownership: # required when more than one gateway shares a veFaaS app + # type: redis +``` + +No extra Python SDK is needed — `VeFaaSSandboxProvider` talks to the veFaaS +OpenAPI (`Version=2024-06-06`, SigV4) over `httpx` and reuses `agent-sandbox` +for the AIO data plane. See the +[veFaaS sandbox provider README](../packages/harness/deerflow/community/vefaas_sandbox/README.md) +for the complete option reference, snapshot retention guidance, and TOS mount details. + Choose between local execution or Docker-based isolation: **Option 1: Local Sandbox** (default, simpler setup): diff --git a/backend/packages/harness/deerflow/community/vefaas_sandbox/README.md b/backend/packages/harness/deerflow/community/vefaas_sandbox/README.md index a4af2dad7e..5ce4ad6d45 100644 --- a/backend/packages/harness/deerflow/community/vefaas_sandbox/README.md +++ b/backend/packages/harness/deerflow/community/vefaas_sandbox/README.md @@ -1,6 +1,6 @@ # BytePlus veFaaS Cloud Sandbox Provider (`deerflow/community/vefaas_sandbox/`) -Runs each DeerFlow thread sandbox on **[BytePlus Function Service (veFaaS) Cloud Sandbox](https://www.byteplus.com/en/product/vefaas)** using the All-in-One Sandbox (`all-in-one-sandbox`) image (see the [veFaaS documentation](https://docs.byteplus.com/en/docs/vefaas/what-is-vefaas)). +Runs each DeerFlow thread sandbox on **[BytePlus Function Service (veFaaS) Cloud Sandbox](https://www.byteplus.com/en/product/vefaas?utm_campaign=deer_flow&utm_content=deer_flow&utm_medium=devrel&utm_source=OWO&utm_term=deer_flow)** using the All-in-One Sandbox (`all-in-one-sandbox`) image (see the [veFaaS documentation](https://docs.byteplus.com/en/docs/vefaas/what-is-vefaas?utm_campaign=deer_flow&utm_content=deer_flow&utm_medium=devrel&utm_source=OWO&utm_term=deer_flow)). - **Control plane**: BytePlus veFaaS OpenAPI (`Version=2024-06-06`, SigV4 HMAC-SHA256) over `httpx` — no extra cloud SDK dependency required. - **Data plane**: Reuses DeerFlow's `AioSandbox` HTTP client via the Sandbox App's unified access domain (`X-Faas-Instance-Name: `) or a `{sandbox_id}` URL template. diff --git a/docs/guide/sandbox.md b/docs/guide/sandbox.md index 2e96914115..f52f0025a6 100644 --- a/docs/guide/sandbox.md +++ b/docs/guide/sandbox.md @@ -115,14 +115,14 @@ generated outputs back to thread storage with the same alias and path checks. See its [configuration](../../backend/docs/CONFIGURATION.md#sandbox). The optional [BytePlus veFaaS Cloud Sandbox provider](../../backend/packages/harness/deerflow/community/vefaas_sandbox/README.md) -runs each user/thread scope in a serverless [BytePlus veFaaS](https://www.byteplus.com/en/product/vefaas) +runs each user/thread scope in a serverless [BytePlus veFaaS](https://www.byteplus.com/en/product/vefaas?utm_campaign=deer_flow&utm_content=deer_flow&utm_medium=devrel&utm_source=OWO&utm_term=deer_flow) AIO sandbox over the veFaaS OpenAPI (`Version=2024-06-06`, SigV4) with no extra cloud SDK dependency. It supports per-agent skill isolation, optional thread-scoped TOS mounts or automatic output mirroring on release, speculative `sandbox.prewarm`, opt-in idle pause/resume, thread-scoped snapshots with retention pruning, and asynchronous image precaching. Multi-worker gateways sharing one veFaaS sandbox application should enable `sandbox.ownership.type: redis`. -See the [veFaaS documentation](https://docs.byteplus.com/en/docs/vefaas/what-is-vefaas) +See the [veFaaS documentation](https://docs.byteplus.com/en/docs/vefaas/what-is-vefaas?utm_campaign=deer_flow&utm_content=deer_flow&utm_medium=devrel&utm_source=OWO&utm_term=deer_flow) and [provider README](../../backend/packages/harness/deerflow/community/vefaas_sandbox/README.md) for setup and snapshot retention guidance. diff --git a/frontend/src/components/landing/sections/sandbox-section.tsx b/frontend/src/components/landing/sections/sandbox-section.tsx index bb450e1514..ecc16f5731 100644 --- a/frontend/src/components/landing/sections/sandbox-section.tsx +++ b/frontend/src/components/landing/sections/sandbox-section.tsx @@ -103,7 +103,7 @@ export function SandboxSection({ className }: { className?: string }) { For serverless cloud deployments without managing Docker or Kubernetes, run the same AIO Sandbox on{" "} diff --git a/frontend/src/content/en/application/deployment-guide.mdx b/frontend/src/content/en/application/deployment-guide.mdx index 80a832967e..4e0b1bc240 100644 --- a/frontend/src/content/en/application/deployment-guide.mdx +++ b/frontend/src/content/en/application/deployment-guide.mdx @@ -119,6 +119,7 @@ For production, use a named volume or a Persistent Volume Claim (PVC) instead of | `LocalSandboxProvider` | Single-user, trusted local workflows | | `AioSandboxProvider` (Docker) | Multi-user, moderate isolation requirement | | `E2BSandboxProvider` (e2b cloud) | Hosted/serverless, no Docker/K8s ops, instant Jupyter | +| `VeFaaSSandboxProvider` ([BytePlus veFaaS](https://www.byteplus.com/en/product/vefaas?utm_campaign=deer_flow&utm_content=deer_flow&utm_medium=devrel&utm_source=OWO&utm_term=deer_flow)) | Serverless AIO cloud sandbox with prewarm, pause/resume, snapshots, and TOS mounts | | `AioSandboxProvider` + K8s Provisioner | Production, strong isolation, multi-user | For any deployment with more than one concurrent user, use a container-based sandbox to prevent users from interfering with each other's execution environments. diff --git a/frontend/src/content/en/harness/sandbox.mdx b/frontend/src/content/en/harness/sandbox.mdx index 5e8cb4612d..4f3cf0c74b 100644 --- a/frontend/src/content/en/harness/sandbox.mdx +++ b/frontend/src/content/en/harness/sandbox.mdx @@ -120,7 +120,7 @@ Get an API key at [e2b.dev/dashboard](https://e2b.dev/dashboard) and either set ### BytePlus veFaaS Cloud Sandbox -Commands run in serverless [BytePlus Function Service (veFaaS)](https://www.byteplus.com/en/product/vefaas) cloud sandboxes running the `all-in-one-sandbox` image (see the [veFaaS documentation](https://docs.byteplus.com/en/docs/vefaas/what-is-vefaas)). DeerFlow manages the sandbox lifecycle over the veFaaS OpenAPI (`Version=2024-06-06`, SigV4) with no extra cloud SDK dependency and reuses the `AioSandbox` HTTP data plane. +Commands run in serverless [BytePlus Function Service (veFaaS)](https://www.byteplus.com/en/product/vefaas?utm_campaign=deer_flow&utm_content=deer_flow&utm_medium=devrel&utm_source=OWO&utm_term=deer_flow) cloud sandboxes running the `all-in-one-sandbox` image (see the [veFaaS documentation](https://docs.byteplus.com/en/docs/vefaas/what-is-vefaas?utm_campaign=deer_flow&utm_content=deer_flow&utm_medium=devrel&utm_source=OWO&utm_term=deer_flow)). DeerFlow manages the sandbox lifecycle over the veFaaS OpenAPI (`Version=2024-06-06`, SigV4) with no extra cloud SDK dependency and reuses the `AioSandbox` HTTP data plane. - **Best for**: serverless production deployments, multi-tenant cloud workloads, teams wanting fast cold-start mitigation (**speculative prewarm**, **image precaching**, **pause/resume**), and persistent workspaces via **thread-scoped snapshots** or optional **TOS object storage mounts**. - **Trade-off**: requires a BytePlus veFaaS Sandbox Application and SigV4 access keys. Multi-worker gateways sharing one veFaaS app require `ownership.type: redis`. diff --git a/frontend/src/content/zh/application/configuration.mdx b/frontend/src/content/zh/application/configuration.mdx index b17e995415..5e0ddde28e 100644 --- a/frontend/src/content/zh/application/configuration.mdx +++ b/frontend/src/content/zh/application/configuration.mdx @@ -195,6 +195,8 @@ sandbox: # idle_timeout: 600 ``` +无服务器云端沙箱支持 [BytePlus veFaaS](https://www.byteplus.com/en/product/vefaas?utm_campaign=deer_flow&utm_content=deer_flow&utm_medium=devrel&utm_source=OWO&utm_term=deer_flow)(支持推测预热、空闲暂停/唤醒、快照、镜像预热与 TOS 挂载),完整配置见[沙箱指南](/docs/harness/sandbox)。 + ### 工具 参见[工具](/docs/harness/tools)页面了解完整的工具配置参考。快速参考: diff --git a/frontend/src/content/zh/application/deployment-guide.mdx b/frontend/src/content/zh/application/deployment-guide.mdx index f3b2ca3e8a..21a0aace72 100644 --- a/frontend/src/content/zh/application/deployment-guide.mdx +++ b/frontend/src/content/zh/application/deployment-guide.mdx @@ -115,6 +115,7 @@ BETTER_AUTH_SECRET=your-secret-here-min-32-chars | `LocalSandboxProvider` | 单用户、受信任的本地工作流 | | `AioSandboxProvider`(Docker) | 多用户、中等隔离需求 | | `E2BSandboxProvider`(e2b 云) | 托管/Serverless、无需运维 Docker/K8s、开箱即用 Jupyter | +| `VeFaaSSandboxProvider`([BytePlus veFaaS 云](https://www.byteplus.com/en/product/vefaas?utm_campaign=deer_flow&utm_content=deer_flow&utm_medium=devrel&utm_source=OWO&utm_term=deer_flow)) | Serverless AIO 云端沙箱,支持预热、空闲暂停/唤醒、快照与 TOS 挂载 | | `AioSandboxProvider` + K8s Provisioner | 生产环境、强隔离、多用户 | 对于有多个并发用户的任何部署,使用基于容器的沙箱,防止用户之间的执行环境相互干扰。 diff --git a/frontend/src/content/zh/harness/sandbox.mdx b/frontend/src/content/zh/harness/sandbox.mdx index 275ca53df3..eb2994b078 100644 --- a/frontend/src/content/zh/harness/sandbox.mdx +++ b/frontend/src/content/zh/harness/sandbox.mdx @@ -111,7 +111,7 @@ sandbox: ### BytePlus veFaaS 云端沙箱 -命令在 [BytePlus 函数服务(veFaaS)](https://www.byteplus.com/en/product/vefaas) Serverless 云端沙箱中运行,使用 `all-in-one-sandbox` 镜像(参见 [veFaaS 文档](https://docs.byteplus.com/en/docs/vefaas/what-is-vefaas))。DeerFlow 直接基于 `httpx` 通过 veFaaS OpenAPI(`Version=2024-06-06`,SigV4 签名)管理控制面,无需额外安装云厂商 SDK,数据面复用 `AioSandbox` 客户端。 +命令在 [BytePlus 函数服务(veFaaS)](https://www.byteplus.com/en/product/vefaas?utm_campaign=deer_flow&utm_content=deer_flow&utm_medium=devrel&utm_source=OWO&utm_term=deer_flow) Serverless 云端沙箱中运行,使用 `all-in-one-sandbox` 镜像(参见 [veFaaS 文档](https://docs.byteplus.com/en/docs/vefaas/what-is-vefaas?utm_campaign=deer_flow&utm_content=deer_flow&utm_medium=devrel&utm_source=OWO&utm_term=deer_flow))。DeerFlow 直接基于 `httpx` 通过 veFaaS OpenAPI(`Version=2024-06-06`,SigV4 签名)管理控制面,无需额外安装云厂商 SDK,数据面复用 `AioSandbox` 客户端。 - **适合**:Serverless 生产部署、多租户云端工作负载、希望降低冷启动耗时(支持**推测预热 `prewarm`**、**镜像预热 `precache_images`**、**空闲暂停/自动唤醒 `pause_on_idle`**),以及需要通过**线程级快照 `snapshot_on_idle`** 或 **TOS 对象存储挂载**持久化工作区的团队。 - **取舍**:需要准备 BytePlus veFaaS 沙箱应用与 SigV4 访问密钥;多 Worker Gateway 共享同一个 veFaaS 应用时必须启用 `ownership.type: redis`。