You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docker/provisioner/README.md
+21-4Lines changed: 21 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ The **Sandbox Provisioner** is a FastAPI service that dynamically manages sandbo
20
20
21
21
### How It Works
22
22
23
-
1.**Backend Request**: When the backend needs to execute code, it sends a `POST /api/sandboxes` request with a `sandbox_id`and `thread_id`.
23
+
1.**Backend Request**: When the backend needs to execute code, it sends a `POST /api/sandboxes` request with a `sandbox_id`, `thread_id`, and optional `user_id`.
24
24
25
25
2.**Pod Creation**: The provisioner creates a dedicated Pod in the `deer-flow` namespace with:
26
26
- The sandbox container image (all-in-one-sandbox)
@@ -70,10 +70,13 @@ Create a new sandbox Pod + Service.
70
70
```json
71
71
{
72
72
"sandbox_id": "abc-123",
73
-
"thread_id": "thread-456"
73
+
"thread_id": "thread-456",
74
+
"user_id": "user-789"
74
75
}
75
76
```
76
77
78
+
`user_id` is optional for backwards compatibility and defaults to `default`. When `USERDATA_PVC_NAME` is set, the provisioner uses it to isolate PVC-backed user-data directories.
79
+
77
80
**Response**:
78
81
```json
79
82
{
@@ -138,11 +141,25 @@ The provisioner is configured via environment variables (set in [docker-compose-
138
141
|`SKILLS_HOST_PATH`| - |**Host machine** path to skills directory (must be absolute) |
139
142
|`THREADS_HOST_PATH`| - |**Host machine** path to threads data directory (must be absolute) |
140
143
|`SKILLS_PVC_NAME`| empty (use hostPath) | PVC name for skills volume; when set, sandbox Pods use PVC instead of hostPath |
141
-
|`USERDATA_PVC_NAME`| empty (use hostPath) | PVC name for user-data volume; when set, uses PVC with `subPath: threads/{thread_id}/user-data`|
144
+
|`USERDATA_PVC_NAME`| empty (use hostPath) | PVC name for user-data volume; when set, uses PVC with `subPath: deer-flow/users/{user_id}/threads/{thread_id}/user-data`|
142
145
|`KUBECONFIG_PATH`|`/root/.kube/config`| Path to kubeconfig **inside** the provisioner container |
143
146
|`NODE_HOST`|`host.docker.internal`| Hostname that backend containers use to reach host NodePorts |
144
147
|`K8S_API_SERVER`| (from kubeconfig) | Override K8s API server URL (e.g., `https://host.docker.internal:26443`) |
145
148
149
+
### PVC User-Data Upgrade Note
150
+
151
+
Older provisioner versions mounted PVC user-data from `threads/{thread_id}/user-data`. The user-scoped layout mounts from `deer-flow/users/{user_id}/threads/{thread_id}/user-data`.
152
+
153
+
If an existing deployment already has PVC-backed user-data under the legacy layout, migrate the DeerFlow data directory before relying on the new PVC subPath. Mount the same PVC path that the gateway uses as its DeerFlow base directory, then run the existing user-isolation migration script:
This moves legacy `threads/{thread_id}/user-data` data under `users/<target-user-id>/threads/{thread_id}/user-data`, which matches the new provisioner PVC subPath when the gateway base directory is mounted at `deer-flow/` on the PVC. Use `default` as the target user only when the legacy data should remain in the default no-auth user namespace. Run the migration while no gateway or sandbox Pods are writing to those paths.
162
+
146
163
### Important: K8S_API_SERVER Override
147
164
148
165
If your kubeconfig uses `localhost`, `127.0.0.1`, or `0.0.0.0` as the API server address (common with OrbStack, minikube, kind), the provisioner **cannot** reach it from inside the Docker container.
0 commit comments