modal 0.74.7__py3-none-any.whl → 0.74.9__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
@@ -27,7 +27,7 @@ class _Client:
27
27
  _snapshotted: bool
28
28
 
29
29
  def __init__(
30
- self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.74.7"
30
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.74.9"
31
31
  ): ...
32
32
  def is_closed(self) -> bool: ...
33
33
  @property
@@ -85,7 +85,7 @@ class Client:
85
85
  _snapshotted: bool
86
86
 
87
87
  def __init__(
88
- self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.74.7"
88
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.74.9"
89
89
  ): ...
90
90
  def is_closed(self) -> bool: ...
91
91
  @property
@@ -7,11 +7,14 @@ from typing import Literal, Optional, Union
7
7
  from modal_proto import api_pb2
8
8
 
9
9
  from .._clustered_functions import ClusterInfo, get_cluster_info as _get_cluster_info
10
+ from .._functions import _Function
10
11
  from .._object import _get_environment_name
11
12
  from .._partial_function import _clustered
12
13
  from .._runtime.container_io_manager import _ContainerIOManager
13
14
  from .._utils.async_utils import synchronize_api, synchronizer
15
+ from .._utils.grpc_utils import retry_transient_errors
14
16
  from ..client import _Client
17
+ from ..cls import _Obj
15
18
  from ..exception import InvalidError
16
19
  from ..image import DockerfileSpec, ImageBuilderVersion, _Image, _ImageRegistryConfig
17
20
  from ..secret import _Secret
@@ -157,3 +160,42 @@ async def raw_registry_image(
157
160
  image_registry_config=registry_config,
158
161
  force_build=force_build,
159
162
  )
163
+
164
+
165
+ @synchronizer.create_blocking
166
+ async def update_autoscaler(
167
+ obj: Union[_Function, _Obj],
168
+ *,
169
+ min_containers: Optional[int] = None,
170
+ max_containers: Optional[int] = None,
171
+ buffer_containers: Optional[int] = None,
172
+ scaledown_window: Optional[int] = None,
173
+ client: Optional[_Client] = None,
174
+ ) -> None:
175
+ """Update the autoscaler settings for a Function or Obj (instance of a Cls).
176
+
177
+ This is an experimental interface for a feature that we will be adding to
178
+ replace the existing `.keep_warm()` method. The stable form of this interface
179
+ may look different (i.e., it may be a standalone function or a method).
180
+
181
+ """
182
+ settings = api_pb2.AutoscalerSettings(
183
+ min_containers=min_containers,
184
+ max_containers=max_containers,
185
+ buffer_containers=buffer_containers,
186
+ scaledown_window=scaledown_window,
187
+ )
188
+
189
+ if client is None:
190
+ client = await _Client.from_env()
191
+
192
+ if isinstance(obj, _Function):
193
+ f = obj
194
+ else:
195
+ assert obj._cls._class_service_function is not None
196
+ await obj._cls._class_service_function.hydrate(client=client)
197
+ f = obj._cached_service_function()
198
+ await f.hydrate(client=client)
199
+
200
+ request = api_pb2.FunctionUpdateSchedulingParamsRequest(function_id=f.object_id, settings=settings)
201
+ await retry_transient_errors(client.stub.FunctionUpdateSchedulingParams, request)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modal
3
- Version: 0.74.7
3
+ Version: 0.74.9
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License: Apache-2.0
@@ -22,7 +22,7 @@ modal/app.py,sha256=4EeD3MXXpaeSFatuWt80xGbMH9cSYS3b9m9z3PQDlwU,48144
22
22
  modal/app.pyi,sha256=SkqXNrdnGIZ4MmNNvpGtzNLoUdyuvi9IjQQR_DRiRHk,26968
23
23
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
24
24
  modal/client.py,sha256=U-YKSw0n7J1ZLREt9cbEJCtmHe5YoPKFxl0xlkan2yc,15565
25
- modal/client.pyi,sha256=aosc4b3QOba0inpXwYjn8FmQTcUn4oFHS7rS5gNr4fw,7591
25
+ modal/client.pyi,sha256=Ygty1OuVtOJTzSj8yIcLWxXQBzmE6ahBf564fc3vm_s,7591
26
26
  modal/cloud_bucket_mount.py,sha256=YOe9nnvSr4ZbeCn587d7_VhE9IioZYRvF9VYQTQux08,5914
27
27
  modal/cloud_bucket_mount.pyi,sha256=30T3K1a89l6wzmEJ_J9iWv9SknoGqaZDx59Xs-ZQcmk,1607
28
28
  modal/cls.py,sha256=GvaNl8R5UsH7Vg88WEOyerdjvZEPK7xxi3nqHlyOW_c,33497
@@ -136,7 +136,7 @@ modal/cli/volume.py,sha256=c2IuVNO2yJVaXmZkRh3xwQmznlRTgFoJr_BIzzqtVv0,10251
136
136
  modal/cli/programs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
137
137
  modal/cli/programs/run_jupyter.py,sha256=YVvJYu927A4ji72d6i27CKfyZ_uDWteeittARtJnf7E,2775
138
138
  modal/cli/programs/vscode.py,sha256=kfvhZQ4bJwtVm3MgC1V7AlygZOlKT1a33alr_uwrewA,3473
139
- modal/experimental/__init__.py,sha256=7qlR4P4U1_sfPdiX8mhSzHR5scbS96QVxeKFnsIcpS4,6457
139
+ modal/experimental/__init__.py,sha256=GCE8vAcVj2nQB0-v2j49mQBsHpAQkbmCTths9lJffNw,7962
140
140
  modal/experimental/ipython.py,sha256=epLUZeDSdE226TH_tU3igRKCiVuQi99mUOrIJ4SemOE,2792
141
141
  modal/requirements/2023.12.312.txt,sha256=zWWUVgVQ92GXBKNYYr2-5vn9rlnXcmkqlwlX5u1eTYw,400
142
142
  modal/requirements/2023.12.txt,sha256=OjsbXFkCSdkzzryZP82Q73osr5wxQ6EUzmGcK7twfkA,502
@@ -145,7 +145,7 @@ modal/requirements/2024.10.txt,sha256=qD-5cVIVM9wXesJ6JC89Ew-3m2KjEElUz3jaw_MddR
145
145
  modal/requirements/PREVIEW.txt,sha256=qD-5cVIVM9wXesJ6JC89Ew-3m2KjEElUz3jaw_MddRo,296
146
146
  modal/requirements/README.md,sha256=9tK76KP0Uph7O0M5oUgsSwEZDj5y-dcUPsnpR0Sc-Ik,854
147
147
  modal/requirements/base-images.json,sha256=57vMSqzMbLBxw5tFWSaMiIkkVEps4JfX5PAtXGnkS4U,740
148
- modal-0.74.7.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
148
+ modal-0.74.9.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
149
149
  modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
150
150
  modal_docs/gen_cli_docs.py,sha256=c1yfBS_x--gL5bs0N4ihMwqwX8l3IBWSkBAKNNIi6bQ,3801
151
151
  modal_docs/gen_reference_docs.py,sha256=cvTgltucqYLLIX84QxAwf51Z5Vc2n6cLxS8VcrxNCAo,6401
@@ -153,10 +153,10 @@ modal_docs/mdmd/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,2
153
153
  modal_docs/mdmd/mdmd.py,sha256=Irx49MCCTlBOP4FBdLR--JrpA3-WhsVeriq0LGgsRic,6232
154
154
  modal_docs/mdmd/signatures.py,sha256=XJaZrK7Mdepk5fdX51A8uENiLFNil85Ud0d4MH8H5f0,3218
155
155
  modal_proto/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0VESpjWR0fc,28
156
- modal_proto/api.proto,sha256=xSHdEaGcAei3TWvffr6ixbYqjrEfXkANYZP94iXlSFM,92409
156
+ modal_proto/api.proto,sha256=WAhgZhYHZMkMY9atv-3NVDCvi7dOIRWg44pB8FlEa-I,92559
157
157
  modal_proto/api_grpc.py,sha256=DlrVx10B6HLy4LjWrgK7HJ7kUNDKqEvm6mUqh-6EVvs,112161
158
- modal_proto/api_pb2.py,sha256=PXqk1L7sf4sxMv8S2AAfDD3qs-crP0-kXPPnc6lnvYo,325346
159
- modal_proto/api_pb2.pyi,sha256=H_iwQ9ux_UctBolWYqHXRpGaxIJ6NK-ilIhrHJgDZc0,443199
158
+ modal_proto/api_pb2.py,sha256=3TKHLp49XvK3utem8Bfa0iuS-2q_kMOl5JBWWTZs43Q,326216
159
+ modal_proto/api_pb2.pyi,sha256=7gqajulYGsCXshdIzPWQNOru4eZVdSgpfb7oLbC0JGA,444242
160
160
  modal_proto/api_pb2_grpc.py,sha256=NQPpAa3Co-zFNB6L6BQoZjf-RaOlWFFPX8chQyGHQEo,242401
161
161
  modal_proto/api_pb2_grpc.pyi,sha256=zK2Ms2Xws02cC9uy5U5A5sPULXx4T6A9o9BONqFcipg,56456
162
162
  modal_proto/modal_api_grpc.py,sha256=K_GsrHIw2CayKh_nyuYAblQW_tOijUNW267Hs9vWUWU,14948
@@ -170,9 +170,9 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
170
170
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
171
171
  modal_version/__init__.py,sha256=m94xZNWIjH8oUtJk4l9xfovzDJede2o7X-q0MHVECtM,470
172
172
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
173
- modal_version/_version_generated.py,sha256=PxczQaV6MUfmLB286M66JcCtkVQoLcQkaEYPUiP6SWU,148
174
- modal-0.74.7.dist-info/METADATA,sha256=kGNkT7G4UznAdhFmP8zEUJa_uSOeQXAtsPRnbBFysy4,2473
175
- modal-0.74.7.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
176
- modal-0.74.7.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
177
- modal-0.74.7.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
178
- modal-0.74.7.dist-info/RECORD,,
173
+ modal_version/_version_generated.py,sha256=1GW2cDwZS-XjvX83n9E-cVglVV1jmz1UYeukAG-UsGw,148
174
+ modal-0.74.9.dist-info/METADATA,sha256=ttY0WALOQqAItahH9zAnJDPol53AVFlsGLo3AF8Uw1w,2473
175
+ modal-0.74.9.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
176
+ modal-0.74.9.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
177
+ modal-0.74.9.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
178
+ modal-0.74.9.dist-info/RECORD,,
modal_proto/api.proto CHANGED
@@ -2071,6 +2071,7 @@ message Object {
2071
2071
  MountHandleMetadata mount_handle_metadata = 4;
2072
2072
  ClassHandleMetadata class_handle_metadata = 5;
2073
2073
  SandboxHandleMetadata sandbox_handle_metadata = 6;
2074
+ VolumeMetadata volume_metadata = 7;
2074
2075
  }
2075
2076
  }
2076
2077
 
@@ -2880,7 +2881,8 @@ message VolumeGetOrCreateRequest {
2880
2881
  string environment_name = 3;
2881
2882
  ObjectCreationType object_creation_type = 4;
2882
2883
  string app_id = 5; // only used with OBJECT_CREATION_TYPE_ANONYMOUS_OWNED_BY_APP
2883
- VolumeFsVersion version = 6;
2884
+ VolumeFsVersion version = 6 [deprecated = true];
2885
+ VolumeMetadata metadata = 7;
2884
2886
  }
2885
2887
 
2886
2888
  message VolumeGetOrCreateResponse {
@@ -2918,6 +2920,10 @@ message VolumeListResponse {
2918
2920
  string environment_name = 2;
2919
2921
  }
2920
2922
 
2923
+ message VolumeMetadata {
2924
+ VolumeFsVersion version = 1;
2925
+ }
2926
+
2921
2927
  message VolumeMount {
2922
2928
  string volume_id = 1;
2923
2929
  string mount_path = 2;