From b36b3677b2cfa554f7504ab2321a691219130b68 Mon Sep 17 00:00:00 2001 From: Colin Weld <54096193+cweld510@users.noreply.github.com> Date: Fri, 14 Feb 2025 17:32:18 -0500 Subject: [PATCH] Remove check for snapshot enabled locally (#2876) --- modal/sandbox.py | 5 ----- test/sandbox_test.py | 5 ----- 2 files changed, 10 deletions(-) diff --git a/modal/sandbox.py b/modal/sandbox.py index c1426b6ef..81f14b58c 100644 --- a/modal/sandbox.py +++ b/modal/sandbox.py @@ -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) diff --git a/test/sandbox_test.py b/test/sandbox_test.py index 77257c67e..ab2954ceb 100644 --- a/test/sandbox_test.py +++ b/test/sandbox_test.py @@ -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