modal 0.72.4__py3-none-any.whl → 0.72.48__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.
Files changed (73) hide show
  1. modal/_container_entrypoint.py +5 -10
  2. modal/_object.py +297 -0
  3. modal/_resolver.py +7 -5
  4. modal/_runtime/container_io_manager.py +0 -11
  5. modal/_runtime/user_code_imports.py +7 -7
  6. modal/_serialization.py +4 -3
  7. modal/_tunnel.py +1 -1
  8. modal/app.py +14 -61
  9. modal/app.pyi +25 -25
  10. modal/cli/app.py +3 -2
  11. modal/cli/container.py +1 -1
  12. modal/cli/import_refs.py +185 -113
  13. modal/cli/launch.py +10 -5
  14. modal/cli/programs/run_jupyter.py +2 -2
  15. modal/cli/programs/vscode.py +3 -3
  16. modal/cli/run.py +134 -68
  17. modal/client.py +1 -0
  18. modal/client.pyi +18 -14
  19. modal/cloud_bucket_mount.py +4 -0
  20. modal/cloud_bucket_mount.pyi +4 -0
  21. modal/cls.py +33 -5
  22. modal/cls.pyi +20 -5
  23. modal/container_process.pyi +8 -6
  24. modal/dict.py +1 -1
  25. modal/dict.pyi +32 -29
  26. modal/environments.py +1 -1
  27. modal/environments.pyi +2 -1
  28. modal/experimental.py +47 -11
  29. modal/experimental.pyi +29 -0
  30. modal/file_io.pyi +30 -28
  31. modal/file_pattern_matcher.py +32 -25
  32. modal/functions.py +31 -23
  33. modal/functions.pyi +57 -50
  34. modal/gpu.py +19 -26
  35. modal/image.py +47 -19
  36. modal/image.pyi +28 -21
  37. modal/io_streams.pyi +14 -12
  38. modal/mount.py +14 -5
  39. modal/mount.pyi +28 -25
  40. modal/network_file_system.py +7 -7
  41. modal/network_file_system.pyi +27 -24
  42. modal/object.py +2 -265
  43. modal/object.pyi +46 -130
  44. modal/parallel_map.py +2 -2
  45. modal/parallel_map.pyi +10 -7
  46. modal/partial_function.py +22 -3
  47. modal/partial_function.pyi +45 -27
  48. modal/proxy.py +1 -1
  49. modal/proxy.pyi +2 -1
  50. modal/queue.py +1 -1
  51. modal/queue.pyi +26 -23
  52. modal/runner.py +14 -3
  53. modal/sandbox.py +11 -7
  54. modal/sandbox.pyi +30 -27
  55. modal/secret.py +1 -1
  56. modal/secret.pyi +2 -1
  57. modal/token_flow.pyi +6 -4
  58. modal/volume.py +1 -1
  59. modal/volume.pyi +36 -33
  60. {modal-0.72.4.dist-info → modal-0.72.48.dist-info}/METADATA +2 -2
  61. {modal-0.72.4.dist-info → modal-0.72.48.dist-info}/RECORD +73 -71
  62. modal_proto/api.proto +151 -4
  63. modal_proto/api_grpc.py +113 -0
  64. modal_proto/api_pb2.py +998 -795
  65. modal_proto/api_pb2.pyi +430 -11
  66. modal_proto/api_pb2_grpc.py +233 -1
  67. modal_proto/api_pb2_grpc.pyi +75 -3
  68. modal_proto/modal_api_grpc.py +7 -0
  69. modal_version/_version_generated.py +1 -1
  70. {modal-0.72.4.dist-info → modal-0.72.48.dist-info}/LICENSE +0 -0
  71. {modal-0.72.4.dist-info → modal-0.72.48.dist-info}/WHEEL +0 -0
  72. {modal-0.72.4.dist-info → modal-0.72.48.dist-info}/entry_points.txt +0 -0
  73. {modal-0.72.4.dist-info → modal-0.72.48.dist-info}/top_level.txt +0 -0
modal_proto/api_grpc.py CHANGED
@@ -11,6 +11,7 @@ if typing.TYPE_CHECKING:
11
11
 
12
12
  import modal_proto.options_pb2
13
13
  import google.protobuf.empty_pb2
14
+ import google.protobuf.struct_pb2
14
15
  import google.protobuf.wrappers_pb2
15
16
  import modal_proto.api_pb2
16
17
 
@@ -329,6 +330,14 @@ class ModalClientBase(abc.ABC):
329
330
  async def MountPutFile(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.MountPutFileRequest, modal_proto.api_pb2.MountPutFileResponse]') -> None:
330
331
  pass
331
332
 
333
+ @abc.abstractmethod
334
+ async def NotebookKernelPublishResults(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.NotebookKernelPublishResultsRequest, google.protobuf.empty_pb2.Empty]') -> None:
335
+ pass
336
+
337
+ @abc.abstractmethod
338
+ async def ProxyAddIp(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.ProxyAddIpRequest, modal_proto.api_pb2.ProxyAddIpResponse]') -> None:
339
+ pass
340
+
332
341
  @abc.abstractmethod
333
342
  async def ProxyCreate(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.ProxyCreateRequest, modal_proto.api_pb2.ProxyCreateResponse]') -> None:
334
343
  pass
@@ -349,6 +358,10 @@ class ModalClientBase(abc.ABC):
349
358
  async def ProxyList(self, stream: 'grpclib.server.Stream[google.protobuf.empty_pb2.Empty, modal_proto.api_pb2.ProxyListResponse]') -> None:
350
359
  pass
351
360
 
361
+ @abc.abstractmethod
362
+ async def ProxyRemoveIp(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.ProxyRemoveIpRequest, google.protobuf.empty_pb2.Empty]') -> None:
363
+ pass
364
+
352
365
  @abc.abstractmethod
353
366
  async def QueueClear(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.QueueClearRequest, google.protobuf.empty_pb2.Empty]') -> None:
354
367
  pass
@@ -405,10 +418,26 @@ class ModalClientBase(abc.ABC):
405
418
  async def SandboxList(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.SandboxListRequest, modal_proto.api_pb2.SandboxListResponse]') -> None:
406
419
  pass
407
420
 
421
+ @abc.abstractmethod
422
+ async def SandboxRestore(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.SandboxRestoreRequest, modal_proto.api_pb2.SandboxRestoreResponse]') -> None:
423
+ pass
424
+
425
+ @abc.abstractmethod
426
+ async def SandboxSnapshot(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.SandboxSnapshotRequest, modal_proto.api_pb2.SandboxSnapshotResponse]') -> None:
427
+ pass
428
+
429
+ @abc.abstractmethod
430
+ async def SandboxSnapshotFromId(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.SandboxSnapshotFromIdRequest, modal_proto.api_pb2.SandboxSnapshotFromIdResponse]') -> None:
431
+ pass
432
+
408
433
  @abc.abstractmethod
409
434
  async def SandboxSnapshotFs(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.SandboxSnapshotFsRequest, modal_proto.api_pb2.SandboxSnapshotFsResponse]') -> None:
410
435
  pass
411
436
 
437
+ @abc.abstractmethod
438
+ async def SandboxSnapshotWait(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.SandboxSnapshotWaitRequest, modal_proto.api_pb2.SandboxSnapshotWaitResponse]') -> None:
439
+ pass
440
+
412
441
  @abc.abstractmethod
413
442
  async def SandboxStdinWrite(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.SandboxStdinWriteRequest, modal_proto.api_pb2.SandboxStdinWriteResponse]') -> None:
414
443
  pass
@@ -1027,6 +1056,18 @@ class ModalClientBase(abc.ABC):
1027
1056
  modal_proto.api_pb2.MountPutFileRequest,
1028
1057
  modal_proto.api_pb2.MountPutFileResponse,
1029
1058
  ),
1059
+ '/modal.client.ModalClient/NotebookKernelPublishResults': grpclib.const.Handler(
1060
+ self.NotebookKernelPublishResults,
1061
+ grpclib.const.Cardinality.UNARY_UNARY,
1062
+ modal_proto.api_pb2.NotebookKernelPublishResultsRequest,
1063
+ google.protobuf.empty_pb2.Empty,
1064
+ ),
1065
+ '/modal.client.ModalClient/ProxyAddIp': grpclib.const.Handler(
1066
+ self.ProxyAddIp,
1067
+ grpclib.const.Cardinality.UNARY_UNARY,
1068
+ modal_proto.api_pb2.ProxyAddIpRequest,
1069
+ modal_proto.api_pb2.ProxyAddIpResponse,
1070
+ ),
1030
1071
  '/modal.client.ModalClient/ProxyCreate': grpclib.const.Handler(
1031
1072
  self.ProxyCreate,
1032
1073
  grpclib.const.Cardinality.UNARY_UNARY,
@@ -1057,6 +1098,12 @@ class ModalClientBase(abc.ABC):
1057
1098
  google.protobuf.empty_pb2.Empty,
1058
1099
  modal_proto.api_pb2.ProxyListResponse,
1059
1100
  ),
1101
+ '/modal.client.ModalClient/ProxyRemoveIp': grpclib.const.Handler(
1102
+ self.ProxyRemoveIp,
1103
+ grpclib.const.Cardinality.UNARY_UNARY,
1104
+ modal_proto.api_pb2.ProxyRemoveIpRequest,
1105
+ google.protobuf.empty_pb2.Empty,
1106
+ ),
1060
1107
  '/modal.client.ModalClient/QueueClear': grpclib.const.Handler(
1061
1108
  self.QueueClear,
1062
1109
  grpclib.const.Cardinality.UNARY_UNARY,
@@ -1141,12 +1188,36 @@ class ModalClientBase(abc.ABC):
1141
1188
  modal_proto.api_pb2.SandboxListRequest,
1142
1189
  modal_proto.api_pb2.SandboxListResponse,
1143
1190
  ),
1191
+ '/modal.client.ModalClient/SandboxRestore': grpclib.const.Handler(
1192
+ self.SandboxRestore,
1193
+ grpclib.const.Cardinality.UNARY_UNARY,
1194
+ modal_proto.api_pb2.SandboxRestoreRequest,
1195
+ modal_proto.api_pb2.SandboxRestoreResponse,
1196
+ ),
1197
+ '/modal.client.ModalClient/SandboxSnapshot': grpclib.const.Handler(
1198
+ self.SandboxSnapshot,
1199
+ grpclib.const.Cardinality.UNARY_UNARY,
1200
+ modal_proto.api_pb2.SandboxSnapshotRequest,
1201
+ modal_proto.api_pb2.SandboxSnapshotResponse,
1202
+ ),
1203
+ '/modal.client.ModalClient/SandboxSnapshotFromId': grpclib.const.Handler(
1204
+ self.SandboxSnapshotFromId,
1205
+ grpclib.const.Cardinality.UNARY_UNARY,
1206
+ modal_proto.api_pb2.SandboxSnapshotFromIdRequest,
1207
+ modal_proto.api_pb2.SandboxSnapshotFromIdResponse,
1208
+ ),
1144
1209
  '/modal.client.ModalClient/SandboxSnapshotFs': grpclib.const.Handler(
1145
1210
  self.SandboxSnapshotFs,
1146
1211
  grpclib.const.Cardinality.UNARY_UNARY,
1147
1212
  modal_proto.api_pb2.SandboxSnapshotFsRequest,
1148
1213
  modal_proto.api_pb2.SandboxSnapshotFsResponse,
1149
1214
  ),
1215
+ '/modal.client.ModalClient/SandboxSnapshotWait': grpclib.const.Handler(
1216
+ self.SandboxSnapshotWait,
1217
+ grpclib.const.Cardinality.UNARY_UNARY,
1218
+ modal_proto.api_pb2.SandboxSnapshotWaitRequest,
1219
+ modal_proto.api_pb2.SandboxSnapshotWaitResponse,
1220
+ ),
1150
1221
  '/modal.client.ModalClient/SandboxStdinWrite': grpclib.const.Handler(
1151
1222
  self.SandboxStdinWrite,
1152
1223
  grpclib.const.Cardinality.UNARY_UNARY,
@@ -1843,6 +1914,18 @@ class ModalClientStub:
1843
1914
  modal_proto.api_pb2.MountPutFileRequest,
1844
1915
  modal_proto.api_pb2.MountPutFileResponse,
1845
1916
  )
1917
+ self.NotebookKernelPublishResults = grpclib.client.UnaryUnaryMethod(
1918
+ channel,
1919
+ '/modal.client.ModalClient/NotebookKernelPublishResults',
1920
+ modal_proto.api_pb2.NotebookKernelPublishResultsRequest,
1921
+ google.protobuf.empty_pb2.Empty,
1922
+ )
1923
+ self.ProxyAddIp = grpclib.client.UnaryUnaryMethod(
1924
+ channel,
1925
+ '/modal.client.ModalClient/ProxyAddIp',
1926
+ modal_proto.api_pb2.ProxyAddIpRequest,
1927
+ modal_proto.api_pb2.ProxyAddIpResponse,
1928
+ )
1846
1929
  self.ProxyCreate = grpclib.client.UnaryUnaryMethod(
1847
1930
  channel,
1848
1931
  '/modal.client.ModalClient/ProxyCreate',
@@ -1873,6 +1956,12 @@ class ModalClientStub:
1873
1956
  google.protobuf.empty_pb2.Empty,
1874
1957
  modal_proto.api_pb2.ProxyListResponse,
1875
1958
  )
1959
+ self.ProxyRemoveIp = grpclib.client.UnaryUnaryMethod(
1960
+ channel,
1961
+ '/modal.client.ModalClient/ProxyRemoveIp',
1962
+ modal_proto.api_pb2.ProxyRemoveIpRequest,
1963
+ google.protobuf.empty_pb2.Empty,
1964
+ )
1876
1965
  self.QueueClear = grpclib.client.UnaryUnaryMethod(
1877
1966
  channel,
1878
1967
  '/modal.client.ModalClient/QueueClear',
@@ -1957,12 +2046,36 @@ class ModalClientStub:
1957
2046
  modal_proto.api_pb2.SandboxListRequest,
1958
2047
  modal_proto.api_pb2.SandboxListResponse,
1959
2048
  )
2049
+ self.SandboxRestore = grpclib.client.UnaryUnaryMethod(
2050
+ channel,
2051
+ '/modal.client.ModalClient/SandboxRestore',
2052
+ modal_proto.api_pb2.SandboxRestoreRequest,
2053
+ modal_proto.api_pb2.SandboxRestoreResponse,
2054
+ )
2055
+ self.SandboxSnapshot = grpclib.client.UnaryUnaryMethod(
2056
+ channel,
2057
+ '/modal.client.ModalClient/SandboxSnapshot',
2058
+ modal_proto.api_pb2.SandboxSnapshotRequest,
2059
+ modal_proto.api_pb2.SandboxSnapshotResponse,
2060
+ )
2061
+ self.SandboxSnapshotFromId = grpclib.client.UnaryUnaryMethod(
2062
+ channel,
2063
+ '/modal.client.ModalClient/SandboxSnapshotFromId',
2064
+ modal_proto.api_pb2.SandboxSnapshotFromIdRequest,
2065
+ modal_proto.api_pb2.SandboxSnapshotFromIdResponse,
2066
+ )
1960
2067
  self.SandboxSnapshotFs = grpclib.client.UnaryUnaryMethod(
1961
2068
  channel,
1962
2069
  '/modal.client.ModalClient/SandboxSnapshotFs',
1963
2070
  modal_proto.api_pb2.SandboxSnapshotFsRequest,
1964
2071
  modal_proto.api_pb2.SandboxSnapshotFsResponse,
1965
2072
  )
2073
+ self.SandboxSnapshotWait = grpclib.client.UnaryUnaryMethod(
2074
+ channel,
2075
+ '/modal.client.ModalClient/SandboxSnapshotWait',
2076
+ modal_proto.api_pb2.SandboxSnapshotWaitRequest,
2077
+ modal_proto.api_pb2.SandboxSnapshotWaitResponse,
2078
+ )
1966
2079
  self.SandboxStdinWrite = grpclib.client.UnaryUnaryMethod(
1967
2080
  channel,
1968
2081
  '/modal.client.ModalClient/SandboxStdinWrite',