exxec 0.3.2__tar.gz → 0.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {exxec-0.3.2 → exxec-0.3.4}/PKG-INFO +1 -1
- {exxec-0.3.2 → exxec-0.3.4}/pyproject.toml +1 -1
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/__init__.py +2 -1
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/acp_provider/provider.py +8 -2
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/daytona_provider/provider.py +6 -2
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/docker_provider/provider.py +9 -5
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/e2b_provider/provider.py +7 -3
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/local_provider/provider.py +6 -2
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/mock_provider/provider.py +6 -2
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/modal_provider/provider.py +7 -3
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/ssh_provider/provider.py +7 -3
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec_config/configs.py +77 -14
- {exxec-0.3.2 → exxec-0.3.4}/LICENSE +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/README.md +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/acp_provider/__init__.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/acp_provider/process_manager.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/base.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/beam_provider/__init__.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/beam_provider/helpers.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/beam_provider/process_manager.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/beam_provider/provider.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/daytona_provider/__init__.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/daytona_provider/helpers.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/daytona_provider/process_manager.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/daytona_provider/pty_manager.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/docker_provider/__init__.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/docker_provider/pty_manager.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/e2b_provider/__init__.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/e2b_provider/process_manager.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/e2b_provider/pty_manager.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/events.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/local_provider/__init__.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/local_provider/pty_manager.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/local_provider/utils.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/log.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/microsandbox_provider/__init__.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/microsandbox_provider/provider.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/mock_provider/__init__.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/mock_provider/process_manager.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/mock_provider/pty_manager.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/modal_provider/__init__.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/modal_provider/pty_manager.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/models.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/parse_output.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/pep723.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/process_manager.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/pty_manager.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/py.typed +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/pyodide_provider/__init__.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/pyodide_provider/filesystem.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/pyodide_provider/provider.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/pyodide_provider/pyodide_server.ts +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/remote_callable.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/srt_provider/__init__.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/srt_provider/config.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/srt_provider/provider.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/ssh_provider/__init__.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/ssh_provider/pty_manager.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/vercel_provider/__init__.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/vercel_provider/process_manager.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec/vercel_provider/provider.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec_config/__init__.py +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec_config/py.typed +0 -0
- {exxec-0.3.2 → exxec-0.3.4}/src/exxec_config/srt_sandbox_config.py +0 -0
|
@@ -31,11 +31,12 @@ from exxec.models import ExecutionResult, ServerInfo
|
|
|
31
31
|
from exxec.remote_callable import create_remote_callable, infer_package_dependencies
|
|
32
32
|
|
|
33
33
|
# from exxec.server import fastapi_tool_server
|
|
34
|
-
from exxec_config import ExecutionEnvironmentConfig
|
|
34
|
+
from exxec_config import ExecutionEnvironmentConfig
|
|
35
35
|
from exxec.ssh_provider import SshExecutionEnvironment, SshPtyManager
|
|
36
36
|
from exxec.pty_manager import BasePtyManager, PtyInfo, PtyManagerProtocol, PtySize
|
|
37
37
|
|
|
38
38
|
if TYPE_CHECKING:
|
|
39
|
+
from exxec_config import ExecutionEnvironmentStr
|
|
39
40
|
from contextlib import AbstractAsyncContextManager
|
|
40
41
|
|
|
41
42
|
from exxec.models import Language
|
|
@@ -211,7 +211,10 @@ class ACPExecutionEnvironment(ExecutionEnvironment):
|
|
|
211
211
|
effective_timeout = timeout if timeout is not None else self.default_command_timeout
|
|
212
212
|
# Wrap command with shell timeout if specified
|
|
213
213
|
if effective_timeout is not None:
|
|
214
|
-
command
|
|
214
|
+
# Use sh -c to ensure the entire command runs in a shell
|
|
215
|
+
# (timeout expects an executable, not shell builtins like cd)
|
|
216
|
+
quoted = shlex.quote(command)
|
|
217
|
+
command = f"timeout {effective_timeout} sh -c {quoted}"
|
|
215
218
|
start_time = time.perf_counter()
|
|
216
219
|
try:
|
|
217
220
|
# Pass command directly without splitting - ACP clients run it through
|
|
@@ -266,7 +269,10 @@ class ACPExecutionEnvironment(ExecutionEnvironment):
|
|
|
266
269
|
effective_timeout = timeout if timeout is not None else self.default_command_timeout
|
|
267
270
|
# Wrap command with shell timeout if specified
|
|
268
271
|
if effective_timeout is not None:
|
|
269
|
-
command
|
|
272
|
+
# Use sh -c to ensure the entire command runs in a shell
|
|
273
|
+
# (timeout expects an executable, not shell builtins like cd)
|
|
274
|
+
quoted = shlex.quote(command)
|
|
275
|
+
command = f"timeout {effective_timeout} sh -c {quoted}"
|
|
270
276
|
start_time = time.perf_counter()
|
|
271
277
|
terminal_id: str | None = None
|
|
272
278
|
try:
|
|
@@ -81,6 +81,8 @@ class DaytonaExecutionEnvironment(ExecutionEnvironment):
|
|
|
81
81
|
self._sandbox: AsyncSandbox | None = None
|
|
82
82
|
# Daytona sandboxes run Linux containers
|
|
83
83
|
self._os_type = "Linux"
|
|
84
|
+
# Cache PTY manager instance
|
|
85
|
+
self._pty_manager: DaytonaPtyManager | None = None
|
|
84
86
|
|
|
85
87
|
@property
|
|
86
88
|
def sandbox(self) -> AsyncSandbox:
|
|
@@ -134,9 +136,11 @@ class DaytonaExecutionEnvironment(ExecutionEnvironment):
|
|
|
134
136
|
|
|
135
137
|
def get_pty_manager(self) -> DaytonaPtyManager:
|
|
136
138
|
"""Return a DaytonaPtyManager for interactive terminal sessions."""
|
|
137
|
-
|
|
139
|
+
if self._pty_manager is None:
|
|
140
|
+
from exxec.daytona_provider.pty_manager import DaytonaPtyManager
|
|
138
141
|
|
|
139
|
-
|
|
142
|
+
self._pty_manager = DaytonaPtyManager(self.sandbox)
|
|
143
|
+
return self._pty_manager
|
|
140
144
|
|
|
141
145
|
async def execute(self, code: str) -> ExecutionResult:
|
|
142
146
|
"""Execute code in the Daytona sandbox."""
|
|
@@ -69,6 +69,8 @@ class DockerExecutionEnvironment(ExecutionEnvironment):
|
|
|
69
69
|
self.host_workdir: str | None = None
|
|
70
70
|
# Docker containers are always Linux
|
|
71
71
|
self._os_type = "Linux"
|
|
72
|
+
# Cache PTY manager instance
|
|
73
|
+
self._pty_manager: DockerPtyManager | None = None
|
|
72
74
|
|
|
73
75
|
async def __aenter__(self) -> Self:
|
|
74
76
|
from testcontainers.core.container import DockerContainer
|
|
@@ -133,12 +135,14 @@ class DockerExecutionEnvironment(ExecutionEnvironment):
|
|
|
133
135
|
|
|
134
136
|
def get_pty_manager(self) -> DockerPtyManager:
|
|
135
137
|
"""Return a DockerPtyManager for interactive terminal sessions."""
|
|
136
|
-
|
|
138
|
+
if self._pty_manager is None:
|
|
139
|
+
from exxec.docker_provider.pty_manager import DockerPtyManager
|
|
137
140
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
if not self.container:
|
|
142
|
+
msg = "Docker environment not started"
|
|
143
|
+
raise RuntimeError(msg)
|
|
144
|
+
self._pty_manager = DockerPtyManager(self.container.get_wrapped_container())
|
|
145
|
+
return self._pty_manager
|
|
142
146
|
|
|
143
147
|
async def execute(self, code: str) -> ExecutionResult:
|
|
144
148
|
"""Execute code in Docker container."""
|
|
@@ -97,6 +97,8 @@ class E2bExecutionEnvironment(ExecutionEnvironment):
|
|
|
97
97
|
self.sandbox: AsyncSandbox | None = None
|
|
98
98
|
# E2B sandboxes run Linux
|
|
99
99
|
self._os_type = "Linux"
|
|
100
|
+
# Cache PTY manager instance
|
|
101
|
+
self._pty_manager: E2BPtyManager | None = None
|
|
100
102
|
|
|
101
103
|
def _ensure_initialized(self) -> AsyncSandbox:
|
|
102
104
|
"""Ensure async context."""
|
|
@@ -147,10 +149,12 @@ class E2bExecutionEnvironment(ExecutionEnvironment):
|
|
|
147
149
|
|
|
148
150
|
def get_pty_manager(self) -> E2BPtyManager:
|
|
149
151
|
"""Return an E2BPtyManager for interactive terminal sessions."""
|
|
150
|
-
|
|
152
|
+
if self._pty_manager is None:
|
|
153
|
+
from exxec.e2b_provider.pty_manager import E2BPtyManager
|
|
151
154
|
|
|
152
|
-
|
|
153
|
-
|
|
155
|
+
sandbox = self._ensure_initialized()
|
|
156
|
+
self._pty_manager = E2BPtyManager(sandbox)
|
|
157
|
+
return self._pty_manager
|
|
154
158
|
|
|
155
159
|
async def get_domain(self, port: int) -> str:
|
|
156
160
|
"""Return the domain name for the sandbox."""
|
|
@@ -88,6 +88,8 @@ class LocalExecutionEnvironment(ExecutionEnvironment):
|
|
|
88
88
|
self.root_path = root_path
|
|
89
89
|
# Local provider knows OS statically
|
|
90
90
|
self._os_type = platform.system() # type: ignore[assignment]
|
|
91
|
+
# Cache PTY manager instance
|
|
92
|
+
self._pty_manager: LocalPtyManager | None = None
|
|
91
93
|
|
|
92
94
|
async def __aenter__(self) -> Self:
|
|
93
95
|
# Start tool server via base class
|
|
@@ -134,9 +136,11 @@ class LocalExecutionEnvironment(ExecutionEnvironment):
|
|
|
134
136
|
|
|
135
137
|
def get_pty_manager(self) -> LocalPtyManager:
|
|
136
138
|
"""Return a LocalPtyManager for interactive terminal sessions."""
|
|
137
|
-
|
|
139
|
+
if self._pty_manager is None:
|
|
140
|
+
from exxec.local_provider.pty_manager import LocalPtyManager
|
|
138
141
|
|
|
139
|
-
|
|
142
|
+
self._pty_manager = LocalPtyManager(cwd=self.cwd)
|
|
143
|
+
return self._pty_manager
|
|
140
144
|
|
|
141
145
|
async def execute(self, code: str) -> ExecutionResult:
|
|
142
146
|
"""Execute code in same process or isolated subprocess."""
|
|
@@ -81,6 +81,8 @@ class MockExecutionEnvironment(ExecutionEnvironment):
|
|
|
81
81
|
self._os_type = "Linux"
|
|
82
82
|
self._deterministic_ids = deterministic_ids
|
|
83
83
|
self._process_counter = 0
|
|
84
|
+
# Cache PTY manager instance
|
|
85
|
+
self._pty_manager: MockPtyManager | None = None
|
|
84
86
|
|
|
85
87
|
@property
|
|
86
88
|
def process_manager(self) -> MockProcessManager:
|
|
@@ -107,9 +109,11 @@ class MockExecutionEnvironment(ExecutionEnvironment):
|
|
|
107
109
|
|
|
108
110
|
def get_pty_manager(self) -> MockPtyManager:
|
|
109
111
|
"""Return a MockPtyManager for testing interactive terminal sessions."""
|
|
110
|
-
|
|
112
|
+
if self._pty_manager is None:
|
|
113
|
+
from exxec.mock_provider.pty_manager import MockPtyManager
|
|
111
114
|
|
|
112
|
-
|
|
115
|
+
self._pty_manager = MockPtyManager()
|
|
116
|
+
return self._pty_manager
|
|
113
117
|
|
|
114
118
|
async def execute(self, code: str) -> ExecutionResult:
|
|
115
119
|
"""Execute code and return mock result."""
|
|
@@ -112,6 +112,8 @@ class ModalExecutionEnvironment(ExecutionEnvironment):
|
|
|
112
112
|
self.sandbox: Sandbox | None = None
|
|
113
113
|
# Modal sandboxes run Linux
|
|
114
114
|
self._os_type = "Linux"
|
|
115
|
+
# Cache PTY manager instance
|
|
116
|
+
self._pty_manager: ModalPtyManager | None = None
|
|
115
117
|
|
|
116
118
|
def _ensure_initialized(self) -> Sandbox:
|
|
117
119
|
"""Validate that the environment is properly initialized.
|
|
@@ -208,10 +210,12 @@ class ModalExecutionEnvironment(ExecutionEnvironment):
|
|
|
208
210
|
|
|
209
211
|
def get_pty_manager(self) -> ModalPtyManager:
|
|
210
212
|
"""Return a ModalPtyManager for interactive terminal sessions."""
|
|
211
|
-
|
|
213
|
+
if self._pty_manager is None:
|
|
214
|
+
from exxec.modal_provider.pty_manager import ModalPtyManager
|
|
212
215
|
|
|
213
|
-
|
|
214
|
-
|
|
216
|
+
sandbox = self._ensure_initialized()
|
|
217
|
+
self._pty_manager = ModalPtyManager(sandbox)
|
|
218
|
+
return self._pty_manager
|
|
215
219
|
|
|
216
220
|
async def execute(self, code: str) -> ExecutionResult:
|
|
217
221
|
"""Execute code in the Modal sandbox."""
|
|
@@ -81,6 +81,8 @@ class SshExecutionEnvironment(ExecutionEnvironment):
|
|
|
81
81
|
self._connection_cm: _ACMWrapper[SSHClientConnection] | None = None
|
|
82
82
|
self.connection: SSHClientConnection | None = None
|
|
83
83
|
self._remote_work_dir: str | None = None
|
|
84
|
+
# Cache PTY manager instance
|
|
85
|
+
self._pty_manager: SshPtyManager | None = None
|
|
84
86
|
self._fs: WrapperFileSystem | None = None
|
|
85
87
|
|
|
86
88
|
def _ensure_connected(self) -> SSHClientConnection:
|
|
@@ -207,10 +209,12 @@ class SshExecutionEnvironment(ExecutionEnvironment):
|
|
|
207
209
|
|
|
208
210
|
def get_pty_manager(self) -> SshPtyManager:
|
|
209
211
|
"""Return a SshPtyManager for interactive terminal sessions."""
|
|
210
|
-
|
|
212
|
+
if self._pty_manager is None:
|
|
213
|
+
from exxec.ssh_provider.pty_manager import SshPtyManager
|
|
211
214
|
|
|
212
|
-
|
|
213
|
-
|
|
215
|
+
connection = self._ensure_connected()
|
|
216
|
+
self._pty_manager = SshPtyManager(connection)
|
|
217
|
+
return self._pty_manager
|
|
214
218
|
|
|
215
219
|
async def _verify_tools(self) -> None:
|
|
216
220
|
"""Verify that required tools are available on the remote machine."""
|
|
@@ -63,13 +63,13 @@ class BaseExecutionEnvironmentConfig(Schema):
|
|
|
63
63
|
)
|
|
64
64
|
"""List of packages to install (pip for Python, npm for JS/TS)."""
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
default=
|
|
66
|
+
default_command_timeout: float | None = Field(
|
|
67
|
+
default=None,
|
|
68
68
|
gt=0.0,
|
|
69
|
-
title="
|
|
70
|
-
examples=[
|
|
69
|
+
title="Default Command Timeout",
|
|
70
|
+
examples=[30.0, 60.0, 120.0],
|
|
71
71
|
)
|
|
72
|
-
"""
|
|
72
|
+
"""Default timeout for individual command execution in seconds. None means no timeout."""
|
|
73
73
|
|
|
74
74
|
cwd: str | None = Field(
|
|
75
75
|
default=None,
|
|
@@ -135,7 +135,7 @@ class LocalExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
|
|
|
135
135
|
return LocalExecutionEnvironment(
|
|
136
136
|
lifespan_handler=lifespan_handler,
|
|
137
137
|
dependencies=self.dependencies,
|
|
138
|
-
default_command_timeout=self.
|
|
138
|
+
default_command_timeout=self.default_command_timeout,
|
|
139
139
|
isolated=self.isolated,
|
|
140
140
|
executable=self.executable,
|
|
141
141
|
language=self.language,
|
|
@@ -180,7 +180,7 @@ class DockerExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
|
|
|
180
180
|
lifespan_handler=lifespan_handler,
|
|
181
181
|
dependencies=self.dependencies,
|
|
182
182
|
image=self.image,
|
|
183
|
-
default_command_timeout=self.
|
|
183
|
+
default_command_timeout=self.default_command_timeout,
|
|
184
184
|
language=self.language,
|
|
185
185
|
cwd=self.cwd,
|
|
186
186
|
env_vars=self.env_vars,
|
|
@@ -203,6 +203,14 @@ class E2bExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
|
|
|
203
203
|
)
|
|
204
204
|
"""E2B template to use."""
|
|
205
205
|
|
|
206
|
+
sandbox_timeout: float = Field(
|
|
207
|
+
default=300.0,
|
|
208
|
+
gt=0.0,
|
|
209
|
+
title="Sandbox Lifetime",
|
|
210
|
+
examples=[300.0, 600.0, 3600.0],
|
|
211
|
+
)
|
|
212
|
+
"""How long the sandbox stays alive in seconds."""
|
|
213
|
+
|
|
206
214
|
keep_alive: bool = Field(default=False, title="Keep Alive")
|
|
207
215
|
"""Keep sandbox running after execution."""
|
|
208
216
|
|
|
@@ -223,7 +231,8 @@ class E2bExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
|
|
|
223
231
|
lifespan_handler=lifespan_handler,
|
|
224
232
|
dependencies=self.dependencies,
|
|
225
233
|
template=self.template,
|
|
226
|
-
timeout=self.
|
|
234
|
+
timeout=self.sandbox_timeout,
|
|
235
|
+
default_command_timeout=self.default_command_timeout,
|
|
227
236
|
keep_alive=self.keep_alive,
|
|
228
237
|
language=self.language,
|
|
229
238
|
cwd=self.cwd,
|
|
@@ -257,6 +266,14 @@ class BeamExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
|
|
|
257
266
|
keep_warm_seconds: int = Field(default=600, title="Keep Warm Duration", examples=[300, 600, -1])
|
|
258
267
|
"""Seconds to keep sandbox alive, -1 for no timeout."""
|
|
259
268
|
|
|
269
|
+
sandbox_timeout: float = Field(
|
|
270
|
+
default=300.0,
|
|
271
|
+
gt=0.0,
|
|
272
|
+
title="Sandbox Lifetime",
|
|
273
|
+
examples=[300.0, 600.0, 3600.0],
|
|
274
|
+
)
|
|
275
|
+
"""How long the sandbox stays alive in seconds."""
|
|
276
|
+
|
|
260
277
|
language: Language = Field(
|
|
261
278
|
default="python",
|
|
262
279
|
title="Programming Language",
|
|
@@ -276,7 +293,8 @@ class BeamExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
|
|
|
276
293
|
cpu=self.cpu,
|
|
277
294
|
memory=self.memory,
|
|
278
295
|
keep_warm_seconds=self.keep_warm_seconds,
|
|
279
|
-
timeout=self.
|
|
296
|
+
timeout=self.sandbox_timeout,
|
|
297
|
+
default_command_timeout=self.default_command_timeout,
|
|
280
298
|
language=self.language,
|
|
281
299
|
cwd=self.cwd,
|
|
282
300
|
env_vars=self.env_vars,
|
|
@@ -319,6 +337,14 @@ class DaytonaExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
|
|
|
319
337
|
keep_alive: bool = Field(default=False, title="Keep Alive")
|
|
320
338
|
"""Keep sandbox running after execution."""
|
|
321
339
|
|
|
340
|
+
sandbox_timeout: float = Field(
|
|
341
|
+
default=300.0,
|
|
342
|
+
gt=0.0,
|
|
343
|
+
title="Sandbox Lifetime",
|
|
344
|
+
examples=[300.0, 600.0, 3600.0],
|
|
345
|
+
)
|
|
346
|
+
"""How long the sandbox stays alive in seconds."""
|
|
347
|
+
|
|
322
348
|
def get_provider(
|
|
323
349
|
self, lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None
|
|
324
350
|
) -> DaytonaExecutionEnvironment:
|
|
@@ -333,7 +359,8 @@ class DaytonaExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
|
|
|
333
359
|
api_key=api_key_str,
|
|
334
360
|
target=self.target,
|
|
335
361
|
image=self.image,
|
|
336
|
-
timeout=self.
|
|
362
|
+
timeout=self.sandbox_timeout,
|
|
363
|
+
default_command_timeout=self.default_command_timeout,
|
|
337
364
|
keep_alive=self.keep_alive,
|
|
338
365
|
cwd=self.cwd,
|
|
339
366
|
env_vars=self.env_vars,
|
|
@@ -369,6 +396,14 @@ class SRTExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
|
|
|
369
396
|
sandbox: SandboxConfig = Field(default_factory=SandboxConfig)
|
|
370
397
|
"""Sandbox restrictions configuration."""
|
|
371
398
|
|
|
399
|
+
sandbox_timeout: float = Field(
|
|
400
|
+
default=300.0,
|
|
401
|
+
gt=0.0,
|
|
402
|
+
title="Sandbox Lifetime",
|
|
403
|
+
examples=[300.0, 600.0, 3600.0],
|
|
404
|
+
)
|
|
405
|
+
"""How long the sandbox stays alive in seconds."""
|
|
406
|
+
|
|
372
407
|
def get_provider(
|
|
373
408
|
self, lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None
|
|
374
409
|
) -> SRTExecutionEnvironment:
|
|
@@ -379,7 +414,8 @@ class SRTExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
|
|
|
379
414
|
sandbox_config=self.sandbox,
|
|
380
415
|
lifespan_handler=lifespan_handler,
|
|
381
416
|
dependencies=self.dependencies,
|
|
382
|
-
timeout=self.
|
|
417
|
+
timeout=self.sandbox_timeout,
|
|
418
|
+
default_command_timeout=self.default_command_timeout,
|
|
383
419
|
executable=self.executable,
|
|
384
420
|
language=self.language,
|
|
385
421
|
cwd=self.cwd,
|
|
@@ -433,6 +469,14 @@ class MicrosandboxExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
|
|
|
433
469
|
)
|
|
434
470
|
"""Custom Docker image (uses default for language if None)."""
|
|
435
471
|
|
|
472
|
+
sandbox_timeout: float = Field(
|
|
473
|
+
default=300.0,
|
|
474
|
+
gt=0.0,
|
|
475
|
+
title="Sandbox Lifetime",
|
|
476
|
+
examples=[300.0, 600.0, 3600.0],
|
|
477
|
+
)
|
|
478
|
+
"""How long the sandbox stays alive in seconds."""
|
|
479
|
+
|
|
436
480
|
def get_provider(
|
|
437
481
|
self, lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None
|
|
438
482
|
) -> MicrosandboxExecutionEnvironment:
|
|
@@ -448,7 +492,8 @@ class MicrosandboxExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
|
|
|
448
492
|
api_key=api_key_str,
|
|
449
493
|
memory=self.memory,
|
|
450
494
|
cpus=self.cpus,
|
|
451
|
-
timeout=self.
|
|
495
|
+
timeout=self.sandbox_timeout,
|
|
496
|
+
default_command_timeout=self.default_command_timeout,
|
|
452
497
|
language=self.language,
|
|
453
498
|
image=self.image,
|
|
454
499
|
cwd=self.cwd,
|
|
@@ -555,6 +600,14 @@ class SshExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
|
|
|
555
600
|
)
|
|
556
601
|
"""Programming language to use."""
|
|
557
602
|
|
|
603
|
+
sandbox_timeout: float = Field(
|
|
604
|
+
default=300.0,
|
|
605
|
+
gt=0.0,
|
|
606
|
+
title="Connection Timeout",
|
|
607
|
+
examples=[300.0, 600.0, 3600.0],
|
|
608
|
+
)
|
|
609
|
+
"""SSH connection timeout in seconds."""
|
|
610
|
+
|
|
558
611
|
def get_provider(
|
|
559
612
|
self, lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None
|
|
560
613
|
) -> SshExecutionEnvironment:
|
|
@@ -570,7 +623,8 @@ class SshExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
|
|
|
570
623
|
password=password_str,
|
|
571
624
|
private_key_path=self.private_key_path,
|
|
572
625
|
port=self.port,
|
|
573
|
-
timeout=self.
|
|
626
|
+
timeout=self.sandbox_timeout,
|
|
627
|
+
default_command_timeout=self.default_command_timeout,
|
|
574
628
|
language=self.language,
|
|
575
629
|
cwd=self.cwd,
|
|
576
630
|
env_vars=self.env_vars,
|
|
@@ -759,6 +813,14 @@ class PyodideExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
|
|
|
759
813
|
)
|
|
760
814
|
"""Path to deno executable (auto-detected if None)."""
|
|
761
815
|
|
|
816
|
+
sandbox_timeout: float = Field(
|
|
817
|
+
default=300.0,
|
|
818
|
+
gt=0.0,
|
|
819
|
+
title="Sandbox Lifetime",
|
|
820
|
+
examples=[300.0, 600.0, 3600.0],
|
|
821
|
+
)
|
|
822
|
+
"""How long the sandbox stays alive in seconds."""
|
|
823
|
+
|
|
762
824
|
def get_provider(
|
|
763
825
|
self, lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None
|
|
764
826
|
) -> PyodideExecutionEnvironment:
|
|
@@ -768,7 +830,8 @@ class PyodideExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
|
|
|
768
830
|
return PyodideExecutionEnvironment(
|
|
769
831
|
lifespan_handler=lifespan_handler,
|
|
770
832
|
dependencies=self.dependencies,
|
|
771
|
-
timeout=self.
|
|
833
|
+
timeout=self.sandbox_timeout,
|
|
834
|
+
default_command_timeout=self.default_command_timeout,
|
|
772
835
|
startup_timeout=self.startup_timeout,
|
|
773
836
|
allow_net=self.allow_net,
|
|
774
837
|
allow_read=self.allow_read,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|