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"