Skip to content

Commit

Permalink
Remove check for snapshot enabled locally (#2876)
Browse files Browse the repository at this point in the history
  • Loading branch information
cweld510 authored Feb 14, 2025
1 parent 360a691 commit b36b367
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
5 changes: 0 additions & 5 deletions modal/sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,11 +560,6 @@ async def exec(
return _ContainerProcess(resp.exec_id, self._client, stdout=stdout, stderr=stderr, text=text, by_line=by_line)

async def _experimental_snapshot(self) -> _SandboxSnapshot:
if not self._enable_snapshot:
raise ValueError(
"Memory snapshots are not supported for this sandbox. To enable memory snapshots, "
"set `_experimental_enable_snapshot=True` when creating the sandbox."
)
await self._get_task_id()
snap_req = api_pb2.SandboxSnapshotRequest(sandbox_id=self.object_id)
snap_resp = await retry_transient_errors(self._client.stub.SandboxSnapshot, snap_req)
Expand Down
5 changes: 0 additions & 5 deletions test/sandbox_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,6 @@ def test_sandbox_exec_stdout(app, servicer, capsys):

@skip_non_subprocess
def test_sandbox_snapshot(app, client, servicer):
invalid_sb = Sandbox.create(app=app)
with pytest.raises(ValueError):
# cannot snapshot a sandbox without memory snapshotting enabled
sandbox_snapshot = invalid_sb._experimental_snapshot()

sb = Sandbox.create(app=app, _experimental_enable_snapshot=True)
sandbox_snapshot = sb._experimental_snapshot()
snapshot_id = sandbox_snapshot.object_id
Expand Down

0 comments on commit b36b367

Please sign in to comment.