modal 0.67.0__py3-none-any.whl → 0.67.22__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 (113) hide show
  1. modal/_clustered_functions.py +2 -2
  2. modal/_clustered_functions.pyi +2 -2
  3. modal/_container_entrypoint.py +5 -4
  4. modal/_output.py +29 -28
  5. modal/_pty.py +2 -2
  6. modal/_resolver.py +6 -5
  7. modal/_resources.py +3 -3
  8. modal/_runtime/asgi.py +46 -6
  9. modal/_runtime/container_io_manager.py +22 -26
  10. modal/_runtime/execution_context.py +2 -2
  11. modal/_runtime/telemetry.py +1 -2
  12. modal/_runtime/user_code_imports.py +12 -14
  13. modal/_serialization.py +3 -7
  14. modal/_traceback.py +5 -5
  15. modal/_tunnel.py +5 -4
  16. modal/_tunnel.pyi +2 -2
  17. modal/_utils/async_utils.py +53 -17
  18. modal/_utils/blob_utils.py +22 -7
  19. modal/_utils/function_utils.py +14 -10
  20. modal/_utils/grpc_testing.py +7 -6
  21. modal/_utils/grpc_utils.py +2 -3
  22. modal/_utils/hash_utils.py +2 -2
  23. modal/_utils/mount_utils.py +5 -4
  24. modal/_utils/package_utils.py +2 -3
  25. modal/_utils/pattern_matcher.py +6 -6
  26. modal/_utils/rand_pb_testing.py +3 -3
  27. modal/_utils/shell_utils.py +2 -1
  28. modal/_vendor/a2wsgi_wsgi.py +62 -72
  29. modal/_vendor/cloudpickle.py +1 -1
  30. modal/_watcher.py +8 -7
  31. modal/app.py +81 -69
  32. modal/app.pyi +104 -99
  33. modal/call_graph.py +6 -6
  34. modal/cli/_download.py +3 -2
  35. modal/cli/_traceback.py +4 -4
  36. modal/cli/app.py +4 -4
  37. modal/cli/container.py +4 -4
  38. modal/cli/dict.py +1 -1
  39. modal/cli/environment.py +2 -3
  40. modal/cli/import_refs.py +1 -1
  41. modal/cli/launch.py +2 -2
  42. modal/cli/network_file_system.py +1 -1
  43. modal/cli/profile.py +1 -1
  44. modal/cli/programs/run_jupyter.py +2 -2
  45. modal/cli/programs/vscode.py +3 -3
  46. modal/cli/queues.py +1 -1
  47. modal/cli/run.py +6 -6
  48. modal/cli/secret.py +3 -3
  49. modal/cli/utils.py +2 -1
  50. modal/cli/volume.py +3 -3
  51. modal/client.py +6 -11
  52. modal/client.pyi +18 -27
  53. modal/cloud_bucket_mount.py +3 -3
  54. modal/cloud_bucket_mount.pyi +2 -2
  55. modal/cls.py +32 -32
  56. modal/cls.pyi +35 -34
  57. modal/config.py +3 -2
  58. modal/container_process.py +6 -2
  59. modal/dict.py +6 -3
  60. modal/dict.pyi +10 -9
  61. modal/environments.py +3 -3
  62. modal/environments.pyi +3 -3
  63. modal/exception.py +2 -3
  64. modal/functions.py +111 -40
  65. modal/functions.pyi +71 -48
  66. modal/image.py +46 -49
  67. modal/image.pyi +102 -101
  68. modal/io_streams.py +20 -12
  69. modal/io_streams.pyi +24 -14
  70. modal/mount.py +24 -24
  71. modal/mount.pyi +28 -29
  72. modal/network_file_system.py +14 -11
  73. modal/network_file_system.pyi +12 -11
  74. modal/object.py +9 -8
  75. modal/object.pyi +47 -34
  76. modal/output.py +2 -1
  77. modal/parallel_map.py +4 -4
  78. modal/partial_function.py +10 -14
  79. modal/partial_function.pyi +17 -18
  80. modal/queue.py +11 -8
  81. modal/queue.pyi +23 -22
  82. modal/retries.py +38 -0
  83. modal/runner.py +8 -7
  84. modal/runner.pyi +8 -14
  85. modal/running_app.py +3 -3
  86. modal/sandbox.py +20 -13
  87. modal/sandbox.pyi +73 -72
  88. modal/scheduler_placement.py +2 -1
  89. modal/secret.py +7 -7
  90. modal/secret.pyi +12 -12
  91. modal/serving.py +4 -3
  92. modal/serving.pyi +5 -4
  93. modal/token_flow.py +3 -2
  94. modal/token_flow.pyi +3 -3
  95. modal/volume.py +16 -23
  96. modal/volume.pyi +17 -16
  97. {modal-0.67.0.dist-info → modal-0.67.22.dist-info}/METADATA +2 -2
  98. modal-0.67.22.dist-info/RECORD +168 -0
  99. modal_docs/mdmd/signatures.py +1 -2
  100. modal_global_objects/mounts/python_standalone.py +1 -1
  101. modal_proto/api.proto +13 -0
  102. modal_proto/api_grpc.py +16 -0
  103. modal_proto/api_pb2.py +241 -221
  104. modal_proto/api_pb2.pyi +41 -0
  105. modal_proto/api_pb2_grpc.py +33 -0
  106. modal_proto/api_pb2_grpc.pyi +10 -0
  107. modal_proto/modal_api_grpc.py +1 -0
  108. modal_version/_version_generated.py +1 -1
  109. modal-0.67.0.dist-info/RECORD +0 -168
  110. {modal-0.67.0.dist-info → modal-0.67.22.dist-info}/LICENSE +0 -0
  111. {modal-0.67.0.dist-info → modal-0.67.22.dist-info}/WHEEL +0 -0
  112. {modal-0.67.0.dist-info → modal-0.67.22.dist-info}/entry_points.txt +0 -0
  113. {modal-0.67.0.dist-info → modal-0.67.22.dist-info}/top_level.txt +0 -0
@@ -4,12 +4,11 @@ import inspect
4
4
  import re
5
5
  import textwrap
6
6
  import warnings
7
- from typing import Tuple
8
7
 
9
8
  from synchronicity.synchronizer import FunctionWithAio
10
9
 
11
10
 
12
- def _signature_from_ast(func) -> Tuple[str, str]:
11
+ def _signature_from_ast(func) -> tuple[str, str]:
13
12
  """Get function signature, including decorators and comments, from source code
14
13
 
15
14
  Traverses functools.wraps-wrappings to get source of underlying function.
@@ -17,7 +17,7 @@ def publish_python_standalone_mount(client, version: str) -> None:
17
17
  release, full_version = PYTHON_STANDALONE_VERSIONS[version]
18
18
 
19
19
  libc = "gnu"
20
- arch = "x86_64" if version == "3.8" else "x86_64_v3"
20
+ arch = "x86_64_v3"
21
21
  url = (
22
22
  "https://github.com/indygreg/python-build-standalone/releases/download"
23
23
  + f"/{release}/cpython-{full_version}+{release}-{arch}-unknown-linux-gnu-install_only.tar.gz"
modal_proto/api.proto CHANGED
@@ -2146,6 +2146,18 @@ message SandboxListResponse {
2146
2146
  repeated SandboxInfo sandboxes = 1;
2147
2147
  }
2148
2148
 
2149
+ message SandboxSnapshotFsRequest {
2150
+ string sandbox_id = 1;
2151
+ float timeout = 2;
2152
+ }
2153
+
2154
+ message SandboxSnapshotFsResponse {
2155
+ string image_id = 1;
2156
+ GenericResult result = 2;
2157
+ // Metadata may be empty since we may skip it for performance reasons.
2158
+ ImageMetadata image_metadata = 3;
2159
+ }
2160
+
2149
2161
  message SandboxStdinWriteRequest {
2150
2162
  string sandbox_id = 1;
2151
2163
  bytes input = 2;
@@ -2745,6 +2757,7 @@ service ModalClient {
2745
2757
  rpc SandboxGetTaskId(SandboxGetTaskIdRequest) returns (SandboxGetTaskIdResponse); // needed for modal container exec
2746
2758
  rpc SandboxGetTunnels(SandboxGetTunnelsRequest) returns (SandboxGetTunnelsResponse);
2747
2759
  rpc SandboxList(SandboxListRequest) returns (SandboxListResponse);
2760
+ rpc SandboxSnapshotFs(SandboxSnapshotFsRequest) returns (SandboxSnapshotFsResponse);
2748
2761
  rpc SandboxStdinWrite(SandboxStdinWriteRequest) returns (SandboxStdinWriteResponse);
2749
2762
  rpc SandboxTagsSet(SandboxTagsSetRequest) returns (google.protobuf.Empty);
2750
2763
  rpc SandboxTerminate(SandboxTerminateRequest) returns (SandboxTerminateResponse);
modal_proto/api_grpc.py CHANGED
@@ -389,6 +389,10 @@ class ModalClientBase(abc.ABC):
389
389
  async def SandboxList(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.SandboxListRequest, modal_proto.api_pb2.SandboxListResponse]') -> None:
390
390
  pass
391
391
 
392
+ @abc.abstractmethod
393
+ async def SandboxSnapshotFs(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.SandboxSnapshotFsRequest, modal_proto.api_pb2.SandboxSnapshotFsResponse]') -> None:
394
+ pass
395
+
392
396
  @abc.abstractmethod
393
397
  async def SandboxStdinWrite(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.SandboxStdinWriteRequest, modal_proto.api_pb2.SandboxStdinWriteResponse]') -> None:
394
398
  pass
@@ -1093,6 +1097,12 @@ class ModalClientBase(abc.ABC):
1093
1097
  modal_proto.api_pb2.SandboxListRequest,
1094
1098
  modal_proto.api_pb2.SandboxListResponse,
1095
1099
  ),
1100
+ '/modal.client.ModalClient/SandboxSnapshotFs': grpclib.const.Handler(
1101
+ self.SandboxSnapshotFs,
1102
+ grpclib.const.Cardinality.UNARY_UNARY,
1103
+ modal_proto.api_pb2.SandboxSnapshotFsRequest,
1104
+ modal_proto.api_pb2.SandboxSnapshotFsResponse,
1105
+ ),
1096
1106
  '/modal.client.ModalClient/SandboxStdinWrite': grpclib.const.Handler(
1097
1107
  self.SandboxStdinWrite,
1098
1108
  grpclib.const.Cardinality.UNARY_UNARY,
@@ -1873,6 +1883,12 @@ class ModalClientStub:
1873
1883
  modal_proto.api_pb2.SandboxListRequest,
1874
1884
  modal_proto.api_pb2.SandboxListResponse,
1875
1885
  )
1886
+ self.SandboxSnapshotFs = grpclib.client.UnaryUnaryMethod(
1887
+ channel,
1888
+ '/modal.client.ModalClient/SandboxSnapshotFs',
1889
+ modal_proto.api_pb2.SandboxSnapshotFsRequest,
1890
+ modal_proto.api_pb2.SandboxSnapshotFsResponse,
1891
+ )
1876
1892
  self.SandboxStdinWrite = grpclib.client.UnaryUnaryMethod(
1877
1893
  channel,
1878
1894
  '/modal.client.ModalClient/SandboxStdinWrite',