Enhance: localhost:9385 -> sandbox-executor-manager:9385 (#17414)

This commit is contained in:
Wang Qi
2026-07-27 15:20:09 +08:00
committed by GitHub
parent 3065a29935
commit cd846cc9d4
8 changed files with 22 additions and 22 deletions

View File

@@ -171,7 +171,7 @@ class SandboxProvider(ABC):
"type": "string",
"required": True,
"label": "API Endpoint",
"placeholder": "http://localhost:9385"
"placeholder": "http://sandbox-executor-manager:9385"
},
"timeout": {
"type": "integer",

View File

@@ -135,17 +135,17 @@ Wraps the existing executor_manager implementation. The implementation file is l
**Configuration**: Docker API endpoint, pool size, resource limits:
- `endpoint`: HTTP endpoint (default: "http://localhost:9385")
- `endpoint`: HTTP endpoint (default: "http://sandbox-executor-manager:9385")
- `timeout`: Request timeout in seconds (default: 30)
- `max_retries`: Maximum retry attempts (default: 3)
- `pool_size`: Container pool size (default: 10)
**Languages**:
**Languages**:
- Python
- Node.js
- JavaScript
**Security**:
**Security**:
- gVisor (runsc runtime)
- seccomp
- read-only filesystem
@@ -507,7 +507,7 @@ Each provider's configuration is stored as a **single JSON object** in the `valu
"name": "sandbox.self_managed",
"source": "variable",
"data_type": "json",
"value": "{\"endpoint\": \"http://localhost:9385\", \"pool_size\": 10, \"max_memory\": \"256m\", \"timeout\": 30}"
"value": "{\"endpoint\": \"http://sandbox-executor-manager:9385\", \"pool_size\": 10, \"max_memory\": \"256m\", \"timeout\": 30}"
}
```
@@ -606,7 +606,7 @@ class SelfManagedProvider(SandboxProvider):
"type": "string",
"required": True,
"label": "API Endpoint",
"placeholder": "http://localhost:9385"
"placeholder": "http://sandbox-executor-manager:9385"
},
"pool_size": {
"type": "integer",
@@ -1316,7 +1316,7 @@ Structured logging for all provider operations:
class TestSelfManagedProvider:
def test_initialize_with_config():
provider = SelfManagedProvider()
assert provider.initialize({"endpoint": "http://localhost:9385"})
assert provider.initialize({"endpoint": "http://sandbox-executor-manager:9385"})
def test_create_python_instance():
provider = SelfManagedProvider()
@@ -1538,7 +1538,7 @@ PROVIDER_CLASSES = {
"name": "sandbox.self_managed",
"source": "variable",
"data_type": "json",
"value": "{\"endpoint\": \"http://sandbox-internal:9385\", \"pool_size\": 20, \"max_memory\": \"512m\", \"timeout\": 60, \"enable_seccomp\": true, \"enable_ast_analysis\": true}"
"value": "{\"endpoint\": \"http://sandbox-executor-manager:9385\", \"pool_size\": 20, \"max_memory\": \"512m\", \"timeout\": 60, \"enable_seccomp\": true, \"enable_ast_analysis\": true}"
},
{
"name": "sandbox.aliyun_codeinterpreter",
@@ -1562,7 +1562,7 @@ PROVIDER_CLASSES = {
{
"provider_type": "self_managed",
"config": {
"endpoint": "http://sandbox-internal:9385",
"endpoint": "http://sandbox-executor-manager:9385",
"pool_size": 20,
"max_memory": "512m",
"timeout": 60,
@@ -1583,7 +1583,7 @@ PROVIDER_CLASSES = {
"data": {
"active": "self_managed",
"self_managed": {
"endpoint": "http://sandbox-internal:9385",
"endpoint": "http://sandbox-executor-manager:9385",
"pool_size": 20,
"max_memory": "512m",
"timeout": 60,

View File

@@ -24,7 +24,7 @@ from typing import Dict, Optional
import requests
from pydantic import BaseModel
API_URL = os.getenv("SANDBOX_API_URL", "http://localhost:9385/run")
API_URL = os.getenv("SANDBOX_API_URL", "http://sandbox-executor-manager:9385/run")
TIMEOUT = 15
MAX_WORKERS = 5

View File

@@ -117,7 +117,7 @@ class TestSelfManagedProvider:
"""Test provider initialization."""
provider = SelfManagedProvider()
assert provider.endpoint == "http://localhost:9385"
assert provider.endpoint == "http://sandbox-executor-manager:9385"
assert provider.timeout == 30
assert provider.max_retries == 3
assert provider.pool_size == 10
@@ -163,7 +163,7 @@ class TestSelfManagedProvider:
result = provider.initialize({})
assert result is True
assert provider.endpoint == "http://localhost:9385"
assert provider.endpoint == "http://sandbox-executor-manager:9385"
assert provider.timeout == 30
def test_create_instance_python(self):
@@ -176,7 +176,7 @@ class TestSelfManagedProvider:
assert instance.provider == "self_managed"
assert instance.status == "running"
assert instance.metadata["language"] == "python"
assert instance.metadata["endpoint"] == "http://localhost:9385"
assert instance.metadata["endpoint"] == "http://sandbox-executor-manager:9385"
assert len(instance.instance_id) > 0 # Verify instance_id exists
def test_create_instance_nodejs(self):
@@ -299,7 +299,7 @@ class TestSelfManagedProvider:
result = provider.health_check()
assert result is True
mock_get.assert_called_once_with("http://localhost:9385/healthz", timeout=5)
mock_get.assert_called_once_with("http://sandbox-executor-manager:9385/healthz", timeout=5)
@patch("requests.get")
def test_health_check_failure(self, mock_get):
@@ -329,7 +329,7 @@ class TestSelfManagedProvider:
assert "endpoint" in schema
assert schema["endpoint"]["type"] == "string"
assert schema["endpoint"]["required"] is True
assert schema["endpoint"]["default"] == "http://localhost:9385"
assert schema["endpoint"]["default"] == "http://sandbox-executor-manager:9385"
assert "timeout" in schema
assert schema["timeout"]["type"] == "integer"

View File

@@ -70,7 +70,7 @@
"name": "sandbox.self_managed",
"source": "variable",
"data_type": "json",
"value": "{\"endpoint\": \"http://localhost:9385\", \"timeout\": 30, \"max_retries\": 3, \"pool_size\": 10}"
"value": "{\"endpoint\": \"http://sandbox-executor-manager:9385\", \"timeout\": 30, \"max_retries\": 3, \"pool_size\": 10}"
},
{
"name": "sandbox.aliyun_codeinterpreter",
@@ -85,4 +85,4 @@
"value": "{}"
}
]
}
}

View File

@@ -35,7 +35,7 @@ func TestValidateSystemSettingValue(t *testing.T) {
{name: "bool accepts true", dataType: "bool", value: "true"},
{name: "bool accepts false", dataType: "bool", value: "false"},
{name: "bool rejects non bool", dataType: "bool", value: "yes", wantError: true},
{name: "json accepts object", dataType: "json", value: `{"endpoint":"http://localhost:9385"}`},
{name: "json accepts object", dataType: "json", value: `{"endpoint":"http://sandbox-executor-manager:9385"}`},
{name: "json rejects invalid", dataType: "json", value: "{", wantError: true},
{name: "unknown type rejects", dataType: "float", value: "1.2", wantError: true},
}

View File

@@ -75,7 +75,7 @@ import (
// selfManagedDefaultEndpoint is the canonical executor_manager
// endpoint baked into the Python side. Operators override via
// SANDBOX_EXECUTOR_MANAGER_URL.
const selfManagedDefaultEndpoint = "http://localhost:9385"
const selfManagedDefaultEndpoint = "http://sandbox-executor-manager:9385"
// SelfManagedProvider is the Go port of
// `agent/sandbox/providers/self_managed.py::SelfManagedProvider`.

View File

@@ -27,7 +27,7 @@ class SandboxProvider(ABC):
| Provider | File | Backend |
|----------|------|---------|
| `SelfManagedProvider` | `self_managed.py` | HTTP at `localhost:9385` (the `executor_manager`, which runs a Docker pool with gVisor) |
| `SelfManagedProvider` | `self_managed.py` | HTTP at `sandbox-executor-manager:9385` (the `executor_manager`, which runs a Docker pool with gVisor) |
| `AliyunCodeInterpreterProvider` | `aliyun_codeinterpreter.py` | Alibaba Cloud sandbox (uses `agentrun` SDK / Function Compute) |
| `E2BProvider` | `e2b.py` | e2b cloud sandbox (SaaS) |
@@ -94,7 +94,7 @@ Cons
Read the three provider implementations and write Go equivalents:
- `SelfManagedProvider` → Go HTTP client to `localhost:9385`
- `SelfManagedProvider` → Go HTTP client to `sandbox-executor-manager:9385`
(the executor_manager). Smallest of the three.
- `AliyunCodeInterpreterProvider` → Go reimplementation of the
`agentrun` SDK client. ~Vendor SDK surface to maintain.