modal 0.74.7__py3-none-any.whl → 0.74.8__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.8"
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.8"
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.8
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=nR5ZYzOwOa9b-5B_PiZ4Ddtu_KKfN2KpAHO2UQEaan8,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.8.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
@@ -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=SKRywF4xkghsAUSPFoIkr9QXNxiWC-hTZXuIpgTd91M,148
174
+ modal-0.74.8.dist-info/METADATA,sha256=HsM0NqrOdeyaB2HjUUJLwmm0xvXNNtxX1jxmhsw9ARk,2473
175
+ modal-0.74.8.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
176
+ modal-0.74.8.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
177
+ modal-0.74.8.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
178
+ modal-0.74.8.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  # Copyright Modal Labs 2025
2
2
 
3
3
  # Note: Reset this value to -1 whenever you make a minor `0.X` release of the client.
4
- build_number = 7 # git: 52311ba
4
+ build_number = 8 # git: ea2b838
File without changes