modal 0.67.37__py3-none-any.whl → 0.67.38__py3-none-any.whl

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.
modal/client.pyi CHANGED
@@ -26,7 +26,7 @@ class _Client:
26
26
  _stub: typing.Optional[modal_proto.api_grpc.ModalClientStub]
27
27
 
28
28
  def __init__(
29
- self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.67.37"
29
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.67.38"
30
30
  ): ...
31
31
  def is_closed(self) -> bool: ...
32
32
  @property
@@ -81,7 +81,7 @@ class Client:
81
81
  _stub: typing.Optional[modal_proto.api_grpc.ModalClientStub]
82
82
 
83
83
  def __init__(
84
- self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.67.37"
84
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.67.38"
85
85
  ): ...
86
86
  def is_closed(self) -> bool: ...
87
87
  @property
modal/functions.pyi CHANGED
@@ -455,11 +455,11 @@ class Function(typing.Generic[P, ReturnType, OriginalReturnType], modal.object.O
455
455
 
456
456
  _call_generator_nowait: ___call_generator_nowait_spec
457
457
 
458
- class __remote_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
458
+ class __remote_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
459
459
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
460
460
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
461
461
 
462
- remote: __remote_spec[ReturnType, P]
462
+ remote: __remote_spec[P, ReturnType]
463
463
 
464
464
  class __remote_gen_spec(typing_extensions.Protocol):
465
465
  def __call__(self, *args, **kwargs) -> typing.Generator[typing.Any, None, None]: ...
@@ -471,17 +471,17 @@ class Function(typing.Generic[P, ReturnType, OriginalReturnType], modal.object.O
471
471
  def _get_obj(self) -> typing.Optional[modal.cls.Obj]: ...
472
472
  def local(self, *args: P.args, **kwargs: P.kwargs) -> OriginalReturnType: ...
473
473
 
474
- class ___experimental_spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
474
+ class ___experimental_spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
475
475
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
476
476
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
477
477
 
478
- _experimental_spawn: ___experimental_spawn_spec[ReturnType, P]
478
+ _experimental_spawn: ___experimental_spawn_spec[P, ReturnType]
479
479
 
480
- class __spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
480
+ class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
481
481
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
482
482
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
483
483
 
484
- spawn: __spawn_spec[ReturnType, P]
484
+ spawn: __spawn_spec[P, ReturnType]
485
485
 
486
486
  def get_raw_f(self) -> typing.Callable[..., typing.Any]: ...
487
487
 
modal/sandbox.py CHANGED
@@ -21,7 +21,7 @@ from ._utils.mount_utils import validate_network_file_systems, validate_volumes
21
21
  from .client import _Client
22
22
  from .config import config
23
23
  from .container_process import _ContainerProcess
24
- from .exception import InvalidError, SandboxTerminatedError, SandboxTimeoutError, deprecation_warning
24
+ from .exception import ExecutionError, InvalidError, SandboxTerminatedError, SandboxTimeoutError, deprecation_warning
25
25
  from .gpu import GPU_T
26
26
  from .image import _Image
27
27
  from .io_streams import StreamReader, StreamWriter, _StreamReader, _StreamWriter
@@ -331,6 +331,29 @@ class _Sandbox(_Object, type_prefix="sb"):
331
331
  except GRPCError as exc:
332
332
  raise InvalidError(exc.message) if exc.status == Status.INVALID_ARGUMENT else exc
333
333
 
334
+ async def snapshot_filesystem(self, timeout: int = 55) -> _Image:
335
+ """Snapshot the filesystem of the Sandbox.
336
+
337
+ Returns an [`Image`](https://modal.com/docs/reference/modal.Image) object which
338
+ can be used to spawn a new Sandbox with the same filesystem.
339
+ """
340
+ req = api_pb2.SandboxSnapshotFsRequest(sandbox_id=self.object_id, timeout=timeout)
341
+ resp = await retry_transient_errors(self._client.stub.SandboxSnapshotFs, req)
342
+
343
+ if resp.result.status != api_pb2.GenericResult.GENERIC_STATUS_SUCCESS:
344
+ raise ExecutionError(resp.result.exception)
345
+
346
+ image_id = resp.image_id
347
+ metadata = resp.image_metadata
348
+
349
+ async def _load(self: _Image, resolver: Resolver, existing_object_id: Optional[str]):
350
+ self._hydrate(image_id, resolver.client, metadata)
351
+
352
+ rep = "Image()"
353
+ image = _Image._from_loader(_load, rep)
354
+
355
+ return image
356
+
334
357
  # Live handle methods
335
358
 
336
359
  async def wait(self, raise_on_termination: bool = True):
modal/sandbox.pyi CHANGED
@@ -88,6 +88,7 @@ class _Sandbox(modal.object._Object):
88
88
  @staticmethod
89
89
  async def from_id(sandbox_id: str, client: typing.Optional[modal.client._Client] = None) -> _Sandbox: ...
90
90
  async def set_tags(self, tags: dict[str, str], *, client: typing.Optional[modal.client._Client] = None): ...
91
+ async def snapshot_filesystem(self, timeout: int = 55) -> modal.image._Image: ...
91
92
  async def wait(self, raise_on_termination: bool = True): ...
92
93
  async def tunnels(self, timeout: int = 50) -> dict[int, modal._tunnel.Tunnel]: ...
93
94
  async def terminate(self): ...
@@ -252,6 +253,12 @@ class Sandbox(modal.object.Object):
252
253
 
253
254
  set_tags: __set_tags_spec
254
255
 
256
+ class __snapshot_filesystem_spec(typing_extensions.Protocol):
257
+ def __call__(self, timeout: int = 55) -> modal.image.Image: ...
258
+ async def aio(self, timeout: int = 55) -> modal.image.Image: ...
259
+
260
+ snapshot_filesystem: __snapshot_filesystem_spec
261
+
255
262
  class __wait_spec(typing_extensions.Protocol):
256
263
  def __call__(self, raise_on_termination: bool = True): ...
257
264
  async def aio(self, raise_on_termination: bool = True): ...
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: modal
3
- Version: 0.67.37
3
+ Version: 0.67.38
4
4
  Summary: Python client library for Modal
5
5
  Author: Modal Labs
6
6
  Author-email: support@modal.com
@@ -19,7 +19,7 @@ modal/app.py,sha256=EJ7FUN6rWnSwLJoYJh8nmKg_t-8hdN8_rt0OrkP7JvQ,46084
19
19
  modal/app.pyi,sha256=BE5SlR5tRECuc6-e2lUuOknDdov3zxgZ4N0AsLb5ZVQ,25270
20
20
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
21
21
  modal/client.py,sha256=cmylZhU35txmrx4nltNYuuqXRgeoMtm0ow1J9wJkEYQ,16400
22
- modal/client.pyi,sha256=PQliOg8QgQZBQyaPNhZq5kxq9VhJsNw14tDw8koItxQ,7354
22
+ modal/client.pyi,sha256=sajmbeAGXrg5jPosjlaVZLs1sbrSMEdGJVUD-VIdKlQ,7354
23
23
  modal/cloud_bucket_mount.py,sha256=G7T7jWLD0QkmrfKR75mSTwdUZ2xNfj7pkVqb4ipmxmI,5735
24
24
  modal/cloud_bucket_mount.pyi,sha256=CEi7vrH3kDUF4LAy4qP6tfImy2UJuFRcRbsgRNM1wo8,1403
25
25
  modal/cls.py,sha256=OJqzj_V-n1g48BY_4Jg_BOTQdftEEl4kTWN0X4FOOdg,27378
@@ -34,7 +34,7 @@ modal/environments.pyi,sha256=XalNpiPkAtHWAvOU2Cotq0ozmtl-Jv0FDsR8h9mr27Q,3521
34
34
  modal/exception.py,sha256=EBkdWVved2XEPsXaoPRu56xfxFFHL9iuqvUsdj42WDA,6392
35
35
  modal/experimental.py,sha256=jFuNbwrNHos47viMB9q-cHJSvf2RDxDdoEcss9plaZE,2302
36
36
  modal/functions.py,sha256=Lteg8dMa8ly72-RM1ozxeGQ500pdeFyJgtflVwp3U7Q,66629
37
- modal/functions.pyi,sha256=DXodybnhZ4kD0CAFmQXRTv6FhcsHIgZ5TT_rInG3xDo,24892
37
+ modal/functions.pyi,sha256=3Jupx4QKaqQ9p9XQSG4zDjB3W-87EYkFg55w2QuSQ8M,24892
38
38
  modal/gpu.py,sha256=r4rL6uH3UJIQthzYvfWauXNyh01WqCPtKZCmmSX1fd4,6881
39
39
  modal/image.py,sha256=cQ6WP1xHXZT_nY8z3aEFiGwKzrTV0yxi3Ab8JzF91eo,79653
40
40
  modal/image.pyi,sha256=PIKH6JBA4L5TfdJrQu3pm2ykyIITmiP920TpP8cdyQA,24585
@@ -60,8 +60,8 @@ modal/retries.py,sha256=HKR2Q9aNPWkMjQ5nwobqYTuZaSuw0a8lI2zrtY5IW98,5230
60
60
  modal/runner.py,sha256=7obU-Gq1ocpBGCuR6pvn1T-D6ggg1T48qFo2TNUGWkU,24089
61
61
  modal/runner.pyi,sha256=RAtCvx_lXWjyFjIaZ3t9-X1c7rqpgAQlhl4Hww53OY8,5038
62
62
  modal/running_app.py,sha256=CshNvGDJtagOdKW54uYjY8HY73j2TpnsL9jkPFZAsfA,560
63
- modal/sandbox.py,sha256=25DvTWSgClANvk67HM3FHukRVLig_Fw_aQC1BLMCRhs,25150
64
- modal/sandbox.pyi,sha256=JRh6Q-WdY6GgVSOGm0L_pgo5bfsi2UacsZezpT0-cDU,17685
63
+ modal/sandbox.py,sha256=5V0y7HfhfhVYY-mx-w--iKMYBPrSnu-KYOp5nPy9LkE,26097
64
+ modal/sandbox.pyi,sha256=mUxo6YMJgwiWLuG-NiqhZvH7yaWmAortTlqz2Tzmc7A,18036
65
65
  modal/schedule.py,sha256=0ZFpKs1bOxeo5n3HZjoL7OE2ktsb-_oGtq-WJEPO4tY,2615
66
66
  modal/scheduler_placement.py,sha256=BAREdOY5HzHpzSBqt6jDVR6YC_jYfHMVqOzkyqQfngU,1235
67
67
  modal/secret.py,sha256=Y1WgybQIkfkxdzH9CQ1h-Wd1DJJpzipigMhyyvSxTww,10007
@@ -159,10 +159,10 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
159
159
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
160
160
  modal_version/__init__.py,sha256=3IY-AWLH55r35_mQXIaut0jrJvoPuf1NZJBQQfSbPuo,470
161
161
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
162
- modal_version/_version_generated.py,sha256=0ZVUTUMyQmX9WMAzUW4ERsGyr3A3X6IRS1mWW5OAjJI,149
163
- modal-0.67.37.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
164
- modal-0.67.37.dist-info/METADATA,sha256=80QihddjVsEJ_-OEYTZr20zRzyJMAqAUKX8EywLmnPo,2329
165
- modal-0.67.37.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
166
- modal-0.67.37.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
167
- modal-0.67.37.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
168
- modal-0.67.37.dist-info/RECORD,,
162
+ modal_version/_version_generated.py,sha256=3NHLBOrGj42fsaFeBFT1M4_yRBUNnAtZRMfJXAlioJI,149
163
+ modal-0.67.38.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
164
+ modal-0.67.38.dist-info/METADATA,sha256=Lwe3k35O_dnqtLZ6YTUtqcKpvyIvkSURD_rGSfY9Ph8,2329
165
+ modal-0.67.38.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
166
+ modal-0.67.38.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
167
+ modal-0.67.38.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
168
+ modal-0.67.38.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  # Copyright Modal Labs 2024
2
2
 
3
3
  # Note: Reset this value to -1 whenever you make a minor `0.X` release of the client.
4
- build_number = 37 # git: d4f4dcc
4
+ build_number = 38 # git: 991c623