marin-shellbox 0.2.297.dev44538136255__tar.gz → 0.2.299.dev44582786249__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.
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/PKG-INFO +4 -4
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/pyproject.toml +4 -4
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/daytona/machine.py +16 -5
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/daytona/snapshot.py +3 -2
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/tests/test_daytona_machine.py +28 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/.gitignore +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/README.md +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/benchmarks/tasktrove/sample.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/__init__.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/__init__.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/daytona/__init__.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/daytona/bridge.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/daytona/connection.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/daytona/process.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/daytona/snapshot_cli.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/docker/__init__.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/docker/machine.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/gvisor/__init__.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/gvisor/machine.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/iris/__init__.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/iris/machine.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/local/__init__.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/local/cgroup.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/local/images.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/local/launch.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/local/machine.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/local/nix.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/local/python_environment.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/local/transfers.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/qemu/__init__.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/qemu/bundle.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/qemu/guest/disk-init +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/qemu/guest/init +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/qemu/guest/pty-agent.c +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/qemu/image.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/qemu/machine.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/shellsim/__init__.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/backends/shellsim/machine.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/http_service.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/http_service_guest.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/image.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/machine.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/process_framing.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/process_session.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/task.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/transfer.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/tests/conftest.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/tests/manual/README.md +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/tests/manual/check_machine.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/tests/manual/check_prepared_image.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/tests/manual/check_qemu_isolation.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/tests/manual/check_shell.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/tests/manual/tasktrove_nl2bash_command.sh +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/tests/test_cgroup_delegation.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/tests/test_daytona_process.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/tests/test_docker_machine.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/tests/test_gvisor_machine.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/tests/test_http_service.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/tests/test_image_cache.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/tests/test_iris_machine.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/tests/test_local_cgroup.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/tests/test_local_launch.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/tests/test_local_machine.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/tests/test_process_session.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/tests/test_qemu_machine.py +0 -0
- {marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/tests/test_shellsim_machine.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: marin-shellbox
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.299.dev44582786249
|
|
4
4
|
Summary: Shell execution machines with local and remote backends
|
|
5
5
|
Requires-Python: >=3.12
|
|
6
6
|
Requires-Dist: bubblewrap-bin==0.11.0; sys_platform == 'linux'
|
|
@@ -8,14 +8,14 @@ Requires-Dist: httpx>=0.27
|
|
|
8
8
|
Requires-Dist: pydantic<3,>=2.12
|
|
9
9
|
Provides-Extra: daytona
|
|
10
10
|
Requires-Dist: daytona==0.200.2; extra == 'daytona'
|
|
11
|
-
Requires-Dist: marin-rigging==0.2.
|
|
11
|
+
Requires-Dist: marin-rigging==0.2.299.dev44582786249; extra == 'daytona'
|
|
12
12
|
Provides-Extra: gvisor
|
|
13
13
|
Provides-Extra: iris
|
|
14
|
-
Requires-Dist: marin-iris==0.2.
|
|
14
|
+
Requires-Dist: marin-iris==0.2.299.dev44582786249; extra == 'iris'
|
|
15
15
|
Provides-Extra: qemu
|
|
16
16
|
Requires-Dist: quicksand-qemu<0.6,>=0.5.12; extra == 'qemu'
|
|
17
17
|
Provides-Extra: shellsim
|
|
18
|
-
Requires-Dist: marin-rigging==0.2.
|
|
18
|
+
Requires-Dist: marin-rigging==0.2.299.dev44582786249; extra == 'shellsim'
|
|
19
19
|
Requires-Dist: shellsim[pypi]>=0.1.38; extra == 'shellsim'
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
21
|
|
{marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/pyproject.toml
RENAMED
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "marin-shellbox"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.299.dev44582786249"
|
|
8
8
|
description = "Shell execution machines with local and remote backends"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.12"
|
|
@@ -12,11 +12,11 @@ dependencies = ["httpx>=0.27", "pydantic>=2.12,<3", "bubblewrap-bin==0.11.0; sys
|
|
|
12
12
|
|
|
13
13
|
[project.optional-dependencies]
|
|
14
14
|
qemu = ["quicksand-qemu>=0.5.12,<0.6"]
|
|
15
|
-
shellsim = ["shellsim[pypi]>=0.1.38", "marin-rigging==0.2.
|
|
15
|
+
shellsim = ["shellsim[pypi]>=0.1.38", "marin-rigging==0.2.299.dev44582786249"]
|
|
16
16
|
gvisor = []
|
|
17
|
-
daytona = ["daytona==0.200.2", "marin-rigging==0.2.
|
|
17
|
+
daytona = ["daytona==0.200.2", "marin-rigging==0.2.299.dev44582786249"]
|
|
18
18
|
iris = [
|
|
19
|
-
"marin-iris==0.2.
|
|
19
|
+
"marin-iris==0.2.299.dev44582786249",
|
|
20
20
|
]
|
|
21
21
|
|
|
22
22
|
[project.scripts]
|
|
@@ -26,6 +26,7 @@ from daytona import (
|
|
|
26
26
|
CreateSandboxFromImageParams,
|
|
27
27
|
CreateSandboxFromSnapshotParams,
|
|
28
28
|
DaytonaConflictError,
|
|
29
|
+
DaytonaError,
|
|
29
30
|
DaytonaNotFoundError,
|
|
30
31
|
DaytonaRateLimitError,
|
|
31
32
|
)
|
|
@@ -33,6 +34,7 @@ from rigging.timing import ExponentialBackoff
|
|
|
33
34
|
|
|
34
35
|
from shellbox.backends.daytona.process import DaytonaProcessSession
|
|
35
36
|
from shellbox.backends.daytona.snapshot import (
|
|
37
|
+
TRANSIENT_DAYTONA_STATUS,
|
|
36
38
|
daytona_image,
|
|
37
39
|
ensure_snapshot,
|
|
38
40
|
snapshot_request_for_spec,
|
|
@@ -114,12 +116,21 @@ async def _create_sandbox(
|
|
|
114
116
|
|
|
115
117
|
|
|
116
118
|
async def _delete_named_sandbox(client: AsyncDaytona, name: str) -> None:
|
|
119
|
+
"""Delete the sandbox, retrying transient gateway errors until the interrupt deadline."""
|
|
120
|
+
backoff = ExponentialBackoff(initial=1, maximum=4, factor=2, jitter=0)
|
|
117
121
|
async with asyncio.timeout(INTERRUPT_TIMEOUT):
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
while True:
|
|
123
|
+
try:
|
|
124
|
+
sandbox = await client.get(name)
|
|
125
|
+
await client.delete(sandbox)
|
|
126
|
+
return
|
|
127
|
+
except DaytonaNotFoundError:
|
|
128
|
+
return
|
|
129
|
+
except DaytonaError as error:
|
|
130
|
+
if error.status_code not in TRANSIENT_DAYTONA_STATUS:
|
|
131
|
+
raise
|
|
132
|
+
logger.warning("Retrying Daytona sandbox deletion after HTTP %s: %s", error.status_code, name)
|
|
133
|
+
await sleep(backoff.next_interval())
|
|
123
134
|
|
|
124
135
|
|
|
125
136
|
class DaytonaImageBuild(StrEnum):
|
|
@@ -39,7 +39,8 @@ from shellbox.machine import MachineSpec, UnsupportedMachineSpec
|
|
|
39
39
|
SNAPSHOT_PREFIX = "shellbox-"
|
|
40
40
|
SNAPSHOT_STALE_AFTER = timedelta(hours=1)
|
|
41
41
|
SNAPSHOT_PAGE_SIZE = 100
|
|
42
|
-
|
|
42
|
+
# Gateway and availability statuses a Daytona API request may return transiently.
|
|
43
|
+
TRANSIENT_DAYTONA_STATUS = frozenset({502, 503, 504})
|
|
43
44
|
FAILED_SNAPSHOT_STATES = frozenset({SnapshotState.ERROR, SnapshotState.BUILD_FAILED, SnapshotState.INACTIVE})
|
|
44
45
|
|
|
45
46
|
|
|
@@ -173,7 +174,7 @@ async def _snapshot_metadata(client: AsyncDaytona, name: str) -> Snapshot:
|
|
|
173
174
|
return await client.snapshot.get(name)
|
|
174
175
|
except DaytonaError as error:
|
|
175
176
|
attempts += 1
|
|
176
|
-
if error.status_code not in
|
|
177
|
+
if error.status_code not in TRANSIENT_DAYTONA_STATUS or attempts == 3:
|
|
177
178
|
raise
|
|
178
179
|
await asyncio.sleep(backoff.next_interval())
|
|
179
180
|
|
|
@@ -32,6 +32,7 @@ from daytona import (
|
|
|
32
32
|
CreateSandboxFromSnapshotParams,
|
|
33
33
|
DaytonaConfig,
|
|
34
34
|
DaytonaConflictError,
|
|
35
|
+
DaytonaError,
|
|
35
36
|
DaytonaNotFoundError,
|
|
36
37
|
Image,
|
|
37
38
|
Resources,
|
|
@@ -46,6 +47,7 @@ from shellbox.backends.daytona.machine import (
|
|
|
46
47
|
DaytonaNetworkMode,
|
|
47
48
|
DaytonaNetworkPolicy,
|
|
48
49
|
_create_sandbox,
|
|
50
|
+
_delete_named_sandbox,
|
|
49
51
|
)
|
|
50
52
|
from shellbox.backends.daytona.snapshot import (
|
|
51
53
|
SnapshotRequest,
|
|
@@ -1516,3 +1518,29 @@ def test_snapshot_request_interchange_rejects_a_mismatched_name(tmp_path) -> Non
|
|
|
1516
1518
|
|
|
1517
1519
|
del spec["name"]
|
|
1518
1520
|
assert SnapshotRequest.from_dict(spec) == request
|
|
1521
|
+
|
|
1522
|
+
|
|
1523
|
+
def test_sandbox_deletion_retries_a_gateway_error(monkeypatch) -> None:
|
|
1524
|
+
class FlakyGateway:
|
|
1525
|
+
def __init__(self):
|
|
1526
|
+
self.gets = 0
|
|
1527
|
+
self.deleted = []
|
|
1528
|
+
|
|
1529
|
+
async def get(self, name):
|
|
1530
|
+
self.gets += 1
|
|
1531
|
+
if self.gets == 1:
|
|
1532
|
+
raise DaytonaError("Failed to get sandbox: 502 Bad Gateway", status_code=502)
|
|
1533
|
+
return SimpleNamespace(name=name)
|
|
1534
|
+
|
|
1535
|
+
async def delete(self, sandbox):
|
|
1536
|
+
self.deleted.append(sandbox.name)
|
|
1537
|
+
|
|
1538
|
+
async def no_wait(delay):
|
|
1539
|
+
pass
|
|
1540
|
+
|
|
1541
|
+
monkeypatch.setattr("shellbox.backends.daytona.machine.sleep", no_wait)
|
|
1542
|
+
client = FlakyGateway()
|
|
1543
|
+
|
|
1544
|
+
asyncio.run(_delete_named_sandbox(client, "fixture"))
|
|
1545
|
+
|
|
1546
|
+
assert client.deleted == ["fixture"]
|
|
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
|
{marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/src/shellbox/task.py
RENAMED
|
File without changes
|
|
File without changes
|
{marin_shellbox-0.2.297.dev44538136255 → marin_shellbox-0.2.299.dev44582786249}/tests/conftest.py
RENAMED
|
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
|