modal 0.73.164__py3-none-any.whl → 0.73.166__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.
@@ -46,13 +46,13 @@ from modal.exception import ExecutionError, InputCancellation, InvalidError
46
46
  from modal.running_app import RunningApp, running_app_from_layout
47
47
  from modal_proto import api_pb2
48
48
 
49
+ from ._runtime import execution_context
49
50
  from ._runtime.container_io_manager import (
50
51
  ContainerIOManager,
51
52
  IOContext,
52
53
  UserException,
53
54
  _ContainerIOManager,
54
55
  )
55
- from ._runtime.execution_context import _set_current_context_ids
56
56
 
57
57
  if TYPE_CHECKING:
58
58
  import modal._object
@@ -190,7 +190,7 @@ def call_function(
190
190
  async def run_input_async(io_context: IOContext) -> None:
191
191
  started_at = time.time()
192
192
  input_ids, function_call_ids = io_context.input_ids, io_context.function_call_ids
193
- reset_context = _set_current_context_ids(input_ids, function_call_ids)
193
+ reset_context = execution_context._set_current_context_ids(input_ids, function_call_ids)
194
194
  async with container_io_manager.handle_input_exception.aio(io_context, started_at):
195
195
  res = io_context.call_finalized_function()
196
196
  # TODO(erikbern): any exception below shouldn't be considered a user exception
@@ -240,7 +240,7 @@ def call_function(
240
240
  def run_input_sync(io_context: IOContext) -> None:
241
241
  started_at = time.time()
242
242
  input_ids, function_call_ids = io_context.input_ids, io_context.function_call_ids
243
- reset_context = _set_current_context_ids(input_ids, function_call_ids)
243
+ reset_context = execution_context._set_current_context_ids(input_ids, function_call_ids)
244
244
  with container_io_manager.handle_input_exception(io_context, started_at):
245
245
  res = io_context.call_finalized_function()
246
246
 
@@ -407,33 +407,34 @@ def main(container_args: api_pb2.ContainerArguments, client: Client):
407
407
  param_args = ()
408
408
  param_kwargs = {}
409
409
 
410
- if function_def.is_class:
411
- # this is a bit ugly - match the function and class based on function name to get metadata
412
- # This metadata is required in order to hydrate the class in case it's not globally
413
- # decorated (or serialized)
414
- service_base_function_id = container_args.app_layout.function_ids[function_def.function_name]
415
- service_function_hydration_data = [
416
- o for o in container_args.app_layout.objects if o.object_id == service_base_function_id
417
- ][0]
418
- class_id = container_args.app_layout.class_ids[function_def.function_name.removesuffix(".*")]
419
-
420
- service = import_class_service(
421
- function_def,
422
- service_function_hydration_data,
423
- class_id,
424
- client,
425
- ser_usr_cls,
426
- param_args,
427
- param_kwargs,
428
- )
429
- else:
430
- service = import_single_function_service(
431
- function_def,
432
- ser_usr_cls,
433
- ser_fun,
434
- param_args,
435
- param_kwargs,
436
- )
410
+ with execution_context._import_context():
411
+ if function_def.is_class:
412
+ # this is a bit ugly - match the function and class based on function name to get metadata
413
+ # This metadata is required in order to hydrate the class in case it's not globally
414
+ # decorated (or serialized)
415
+ service_base_function_id = container_args.app_layout.function_ids[function_def.function_name]
416
+ service_function_hydration_data = [
417
+ o for o in container_args.app_layout.objects if o.object_id == service_base_function_id
418
+ ][0]
419
+ class_id = container_args.app_layout.class_ids[function_def.function_name.removesuffix(".*")]
420
+
421
+ service = import_class_service(
422
+ function_def,
423
+ service_function_hydration_data,
424
+ class_id,
425
+ client,
426
+ ser_usr_cls,
427
+ param_args,
428
+ param_kwargs,
429
+ )
430
+ else:
431
+ service = import_single_function_service(
432
+ function_def,
433
+ ser_usr_cls,
434
+ ser_fun,
435
+ param_args,
436
+ param_kwargs,
437
+ )
437
438
 
438
439
  # If the cls/function decorator was applied in local scope, but the app is global, we can look it up
439
440
  if service.app is not None:
@@ -1,4 +1,5 @@
1
1
  # Copyright Modal Labs 2024
2
+ from contextlib import contextmanager
2
3
  from contextvars import ContextVar
3
4
  from typing import Callable, Optional
4
5
 
@@ -87,3 +88,15 @@ def _set_current_context_ids(input_ids: list[str], function_call_ids: list[str])
87
88
 
88
89
  _current_input_id: ContextVar = ContextVar("_current_input_id")
89
90
  _current_function_call_id: ContextVar = ContextVar("_current_function_call_id")
91
+
92
+ _is_currently_importing = False # we set this to True while a container is importing user code
93
+
94
+
95
+ @contextmanager
96
+ def _import_context():
97
+ global _is_currently_importing
98
+ _is_currently_importing = True
99
+ try:
100
+ yield
101
+ finally:
102
+ _is_currently_importing = False
@@ -17,6 +17,7 @@ def current_function_call_id() -> typing.Optional[str]: ...
17
17
  def _set_current_context_ids(
18
18
  input_ids: list[str], function_call_ids: list[str]
19
19
  ) -> collections.abc.Callable[[], None]: ...
20
+ def _import_context(): ...
20
21
 
21
22
  _current_input_id: contextvars.ContextVar
22
23
 
modal/client.pyi CHANGED
@@ -31,7 +31,7 @@ class _Client:
31
31
  server_url: str,
32
32
  client_type: int,
33
33
  credentials: typing.Optional[tuple[str, str]],
34
- version: str = "0.73.164",
34
+ version: str = "0.73.166",
35
35
  ): ...
36
36
  def is_closed(self) -> bool: ...
37
37
  @property
@@ -93,7 +93,7 @@ class Client:
93
93
  server_url: str,
94
94
  client_type: int,
95
95
  credentials: typing.Optional[tuple[str, str]],
96
- version: str = "0.73.164",
96
+ version: str = "0.73.166",
97
97
  ): ...
98
98
  def is_closed(self) -> bool: ...
99
99
  @property
modal/mount.py CHANGED
@@ -655,8 +655,6 @@ class _Mount(_Object, type_prefix="mo"):
655
655
  condition: Optional[Callable[[str], bool]] = None,
656
656
  ignore: Optional[Union[Sequence[str], Callable[[Path], bool]]] = None,
657
657
  ) -> "_Mount":
658
- # Don't re-run inside container.
659
-
660
658
  if condition is not None:
661
659
  if ignore is not None:
662
660
  raise InvalidError("Cannot specify both `ignore` and `condition`")
@@ -669,10 +667,6 @@ class _Mount(_Object, type_prefix="mo"):
669
667
  ignore = FilePatternMatcher(*ignore)
670
668
 
671
669
  mount = _Mount._new()
672
- from ._runtime.execution_context import is_local
673
-
674
- if not is_local():
675
- return mount # empty/non-mountable mount in case it's used from within a container
676
670
  for module_name in module_names:
677
671
  mount = mount._extend(_MountedPythonModule(module_name, remote_dir, ignore))
678
672
  return mount
modal/runner.py CHANGED
@@ -12,6 +12,7 @@ from typing import TYPE_CHECKING, Any, Optional, TypeVar
12
12
  from grpclib import GRPCError, Status
13
13
  from synchronicity.async_wrap import asynccontextmanager
14
14
 
15
+ import modal._runtime.execution_context
15
16
  import modal_proto.api_pb2
16
17
  from modal_proto import api_pb2
17
18
 
@@ -19,7 +20,6 @@ from ._functions import _Function
19
20
  from ._object import _get_environment_name, _Object
20
21
  from ._pty import get_pty_info
21
22
  from ._resolver import Resolver
22
- from ._runtime.execution_context import is_local
23
23
  from ._traceback import print_server_warnings, traceback_contains_remote_call
24
24
  from ._utils.async_utils import TaskContext, gather_cancel_on_exc, synchronize_api
25
25
  from ._utils.deprecation import deprecation_error
@@ -266,12 +266,9 @@ async def _run_app(
266
266
  if environment_name is None:
267
267
  environment_name = typing.cast(str, config.get("environment"))
268
268
 
269
- if not is_local():
270
- raise InvalidError(
271
- "Can not run an app from within a container."
272
- " Are you calling app.run() directly?"
273
- " Consider using the `modal run` shell command."
274
- )
269
+ if modal._runtime.execution_context._is_currently_importing:
270
+ raise InvalidError("Can not run an app in global scope within a container")
271
+
275
272
  if app._running_app:
276
273
  raise InvalidError(
277
274
  "App is already running and can't be started again.\n"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modal
3
- Version: 0.73.164
3
+ Version: 0.73.166
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License: Apache-2.0
@@ -2,7 +2,7 @@ modal/__init__.py,sha256=7wz1AT_bpWJJEzXsAo3QMb7i87y7UGXwfneb0bGDhRg,2502
2
2
  modal/__main__.py,sha256=CgIjP8m1xJjjd4AXc-delmR6LdBCZclw2A_V38CFIio,2870
3
3
  modal/_clustered_functions.py,sha256=kTf-9YBXY88NutC1akI-gCbvf01RhMPCw-zoOI_YIUE,2700
4
4
  modal/_clustered_functions.pyi,sha256=vllkegc99A0jrUOWa8mdlSbdp6uz36TsHhGxysAOpaQ,771
5
- modal/_container_entrypoint.py,sha256=ueRlANz7w9dgBlkuP9o3iFGxU5dAnx-IRAu2JMYaq1c,28997
5
+ modal/_container_entrypoint.py,sha256=85KptUAmlftjHR-mpl32H5deATqqDrRWp0Z1XrKmWyk,29166
6
6
  modal/_functions.py,sha256=M94gzMA9xfW9086djoG2yYFVihcslKnsleacmNbVrG0,74996
7
7
  modal/_ipython.py,sha256=TW1fkVOmZL3YYqdS2YlM1hqpf654Yf8ZyybHdBnlhSw,301
8
8
  modal/_location.py,sha256=joiX-0ZeutEUDTrrqLF1GHXCdVLF-rHzstocbMcd_-k,366
@@ -23,7 +23,7 @@ modal/app.py,sha256=bJp7W3liuVG2VwWkG31tMFogDh84EKppzP8YJFWl3eQ,48140
23
23
  modal/app.pyi,sha256=SkqXNrdnGIZ4MmNNvpGtzNLoUdyuvi9IjQQR_DRiRHk,26968
24
24
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
25
25
  modal/client.py,sha256=U-YKSw0n7J1ZLREt9cbEJCtmHe5YoPKFxl0xlkan2yc,15565
26
- modal/client.pyi,sha256=DBHwH_dRIRw4etokK1g9IRaFv1a6lDKHIglO74F01Go,7661
26
+ modal/client.pyi,sha256=iDprzZTVWygReQ1tdzssE36Uvq1_RfNgdO5GC_dMhSc,7661
27
27
  modal/cloud_bucket_mount.py,sha256=YOe9nnvSr4ZbeCn587d7_VhE9IioZYRvF9VYQTQux08,5914
28
28
  modal/cloud_bucket_mount.pyi,sha256=30T3K1a89l6wzmEJ_J9iWv9SknoGqaZDx59Xs-ZQcmk,1607
29
29
  modal/cls.py,sha256=8tvSw7QFTS1FnX2MXaxagu3KwuR6y_DMwhqHv3MZ0Nk,32963
@@ -46,7 +46,7 @@ modal/image.py,sha256=qagLzHPbeEoM7TqvIuFJ8JV_IEJtRqiR0lik4O_K4Gw,92857
46
46
  modal/image.pyi,sha256=89zv12C1sFrJs7Es9SnX23_m208ASAdeNGCVTrhjzHI,25632
47
47
  modal/io_streams.py,sha256=h5O2LmbRoT9l777z3TQhCAm-JF1r7avZ2ykXlejztDs,15163
48
48
  modal/io_streams.pyi,sha256=bJ7ZLmSmJ0nKoa6r4FJpbqvzdUVa0lEe0Fa-MMpMezU,5071
49
- modal/mount.py,sha256=JII0zTS1fPCcCbZgO18okkOuTDqYCxY1DIVa6i1E9cI,32196
49
+ modal/mount.py,sha256=Y2sXIbUbr3ymVvfvknwbouBkkAUPIW1nkSToRGh8w7g,31973
50
50
  modal/mount.pyi,sha256=CmHa7zKSxHA_7-vMQLnGfw_ZXvAvHlafvUEVJcQ1LQA,12535
51
51
  modal/network_file_system.py,sha256=WXdyL7du_fvjvuG6hSAREyJ83sSEP2xSLAIAhBsisdI,14869
52
52
  modal/network_file_system.pyi,sha256=4N3eqMbTSlqmS8VV_aJK-uvrgJC8xnf_YtW5FHfRfc8,8156
@@ -63,7 +63,7 @@ modal/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
63
63
  modal/queue.py,sha256=OIYmve1a4GTP54Vj2CcLatLPIAWToU7hWBNeu7IJiBY,18985
64
64
  modal/queue.pyi,sha256=sgvELCK4bJXMZIZw7gllooGFZNipGjI3BT4rmUuyD9M,10282
65
65
  modal/retries.py,sha256=IvNLDM0f_GLUDD5VgEDoN09C88yoxSrCquinAuxT1Sc,5205
66
- modal/runner.py,sha256=8jBg-gOjjYyteXMI01u6f7izYsGrABsFaByixeQlTmo,25126
66
+ modal/runner.py,sha256=V17Fb9OtTGplvILc4ogT-waHYjxyCnjf0PP4aYy_0ho,25036
67
67
  modal/runner.pyi,sha256=HW2pvC_PLwg1Es_EkrfQgMZsktIr9zzVEtmjOVFG6Dw,5351
68
68
  modal/running_app.py,sha256=v61mapYNV1-O-Uaho5EfJlryMLvIT9We0amUOSvSGx8,1188
69
69
  modal/sandbox.py,sha256=FRcMkVDfp39_ACbhR71iDJcT6xaqFXuCI3LKsLETHPc,32619
@@ -85,8 +85,8 @@ modal/_runtime/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0VESpjWR0fc,28
85
85
  modal/_runtime/asgi.py,sha256=KNarxvZI9z8fnmZl2vbkWTjnoLXs9kqOahkrbsTLkyc,22429
86
86
  modal/_runtime/container_io_manager.py,sha256=WZnvKlmHaF7yteHMoeX-jIgU4OEPLhQyAvhNXmjjVy0,44318
87
87
  modal/_runtime/container_io_manager.pyi,sha256=wRd2wHMFru0NmNgiCBVdDTrJGkeVZsZvWwA1fzn8wi8,17009
88
- modal/_runtime/execution_context.py,sha256=E6ofm6j1POXGPxS841X3V7JU6NheVb8OkQc7JpLq4Kg,2712
89
- modal/_runtime/execution_context.pyi,sha256=wQZwMNADExkeNdB9yKX0PPojovxlFHbap3441wAsiMY,634
88
+ modal/_runtime/execution_context.py,sha256=73Y5zH_o-MhVCrkJXakYVlFkKqCa2CWvqoHjOfJrJGg,3034
89
+ modal/_runtime/execution_context.pyi,sha256=TAxQq7uLj7i9r9XbXgFZiSVBWxObFWN-rkssS0I7Vkk,661
90
90
  modal/_runtime/gpu_memory_snapshot.py,sha256=tA3m1d1cwnmHpvpCeN_WijDd6n8byn7LWlpicbIxiOI,3144
91
91
  modal/_runtime/telemetry.py,sha256=T1RoAGyjBDr1swiM6pPsGRSITm7LI5FDK18oNXxY08U,5163
92
92
  modal/_runtime/user_code_imports.py,sha256=kAv37Pl1TmGKduv0Kozum0xNTD42bDLloSIsT7zf84o,16884
@@ -146,7 +146,7 @@ modal/requirements/2024.10.txt,sha256=qD-5cVIVM9wXesJ6JC89Ew-3m2KjEElUz3jaw_MddR
146
146
  modal/requirements/PREVIEW.txt,sha256=qD-5cVIVM9wXesJ6JC89Ew-3m2KjEElUz3jaw_MddRo,296
147
147
  modal/requirements/README.md,sha256=9tK76KP0Uph7O0M5oUgsSwEZDj5y-dcUPsnpR0Sc-Ik,854
148
148
  modal/requirements/base-images.json,sha256=57vMSqzMbLBxw5tFWSaMiIkkVEps4JfX5PAtXGnkS4U,740
149
- modal-0.73.164.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
149
+ modal-0.73.166.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
150
150
  modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
151
151
  modal_docs/gen_cli_docs.py,sha256=c1yfBS_x--gL5bs0N4ihMwqwX8l3IBWSkBAKNNIi6bQ,3801
152
152
  modal_docs/gen_reference_docs.py,sha256=cvTgltucqYLLIX84QxAwf51Z5Vc2n6cLxS8VcrxNCAo,6401
@@ -154,13 +154,13 @@ modal_docs/mdmd/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,2
154
154
  modal_docs/mdmd/mdmd.py,sha256=Irx49MCCTlBOP4FBdLR--JrpA3-WhsVeriq0LGgsRic,6232
155
155
  modal_docs/mdmd/signatures.py,sha256=XJaZrK7Mdepk5fdX51A8uENiLFNil85Ud0d4MH8H5f0,3218
156
156
  modal_proto/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0VESpjWR0fc,28
157
- modal_proto/api.proto,sha256=jrhg7sMfpcFSL8xCPBzW8U7kas16vYh0c0WmCo4NN4o,91483
158
- modal_proto/api_grpc.py,sha256=9Rs0JyHcz_DSjVKhdtMbDuNt6qDkrE2718KsyA3QL4c,110702
159
- modal_proto/api_pb2.py,sha256=u6qmhGmIjnYxuofALoz0a5TaQKtASbWSlEIk27BfQ_I,322045
160
- modal_proto/api_pb2.pyi,sha256=EoQ1OnFWEVf9jVVvrjdWSFRJ7MXtWTkBtN3rbWjR8Ok,439118
161
- modal_proto/api_pb2_grpc.py,sha256=olXvs6OQvy7pqvHP9bkSWC_DdIv0iO38xRlmkLo-ai8,239213
162
- modal_proto/api_pb2_grpc.pyi,sha256=ybhcN2nwFBIPd4Z4kkMOv-M8Ejidz93Bl4zScLpYcK0,55706
163
- modal_proto/modal_api_grpc.py,sha256=43ujbC_a8YAjuhtEvS-O-5lNpkG5d0K0ZIlryJ4weT4,14766
157
+ modal_proto/api.proto,sha256=pVzFEsIpOuybO3v6aQW2ONmTaX6-Gcfk9sBbpxNYOOk,92066
158
+ modal_proto/api_grpc.py,sha256=DlrVx10B6HLy4LjWrgK7HJ7kUNDKqEvm6mUqh-6EVvs,112161
159
+ modal_proto/api_pb2.py,sha256=ACSAQ0P-ZR36tTgN3C_RmO381ZK-9EM1FXzUtQzCOn8,325087
160
+ modal_proto/api_pb2.pyi,sha256=KNJrAFmFXQY5REYJUgL4Rjg2ie-CZKGPkFz8vVIx0zs,442208
161
+ modal_proto/api_pb2_grpc.py,sha256=NQPpAa3Co-zFNB6L6BQoZjf-RaOlWFFPX8chQyGHQEo,242401
162
+ modal_proto/api_pb2_grpc.pyi,sha256=zK2Ms2Xws02cC9uy5U5A5sPULXx4T6A9o9BONqFcipg,56456
163
+ modal_proto/modal_api_grpc.py,sha256=K_GsrHIw2CayKh_nyuYAblQW_tOijUNW267Hs9vWUWU,14948
164
164
  modal_proto/modal_options_grpc.py,sha256=qJ1cuwA54oRqrdTyPTbvfhFZYd9HhJKK5UCwt523r3Y,120
165
165
  modal_proto/options.proto,sha256=a-siq4swVbZPfaFRXAipRZzGP2bq8OsdUvjlyzAeodQ,488
166
166
  modal_proto/options_grpc.py,sha256=M18X3d-8F_cNYSVM3I25dUTO5rZ0rd-vCCfynfh13Nc,125
@@ -171,9 +171,9 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
171
171
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
172
172
  modal_version/__init__.py,sha256=wiJQ53c-OMs0Xf1UeXOxQ7FwlV1VzIjnX6o-pRYZ_Pk,470
173
173
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
174
- modal_version/_version_generated.py,sha256=2I0ucIXjzi2tKSflkJUmKq9nN0hIKaLV0cEjBQVxcf0,150
175
- modal-0.73.164.dist-info/METADATA,sha256=QEcE3qTvoJmPOms19OEunLqOXOzHXbG7TA7ZiJy7FNk,2475
176
- modal-0.73.164.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
177
- modal-0.73.164.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
178
- modal-0.73.164.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
179
- modal-0.73.164.dist-info/RECORD,,
174
+ modal_version/_version_generated.py,sha256=sC0tLCnx3SA3ug30Mb8CeHVzuzTF5kCgUvvoRJgRMB0,150
175
+ modal-0.73.166.dist-info/METADATA,sha256=vKOazcM7Fa1cFmz6c1DZZhuPGXzwHG4O0iVSDqHQTwA,2475
176
+ modal-0.73.166.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
177
+ modal-0.73.166.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
178
+ modal-0.73.166.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
179
+ modal-0.73.166.dist-info/RECORD,,
modal_proto/api.proto CHANGED
@@ -757,6 +757,29 @@ message CloudBucketMount {
757
757
  optional string oidc_auth_role_arn = 9;
758
758
  }
759
759
 
760
+ message ClusterGetRequest {
761
+ string cluster_id = 1;
762
+ }
763
+
764
+ message ClusterGetResponse {
765
+ ClusterStats cluster = 1;
766
+ }
767
+
768
+ message ClusterListRequest {
769
+ string environment_name = 1;
770
+ }
771
+
772
+ message ClusterListResponse {
773
+ repeated ClusterStats clusters = 1;
774
+ }
775
+
776
+ message ClusterStats {
777
+ string app_id = 1;
778
+ repeated string task_ids = 2;
779
+ string region = 3;
780
+ double started_at = 4; // Defined as start time of the first task in the cluster
781
+ }
782
+
760
783
  message CommitInfo {
761
784
  string vcs = 1; // Only git is supported for now
762
785
  string branch = 2;
@@ -3052,6 +3075,10 @@ service ModalClient {
3052
3075
  // Clients
3053
3076
  rpc ClientHello(google.protobuf.Empty) returns (ClientHelloResponse);
3054
3077
 
3078
+ // Clusters
3079
+ rpc ClusterGet(ClusterGetRequest) returns (ClusterGetResponse);
3080
+ rpc ClusterList(ClusterListRequest) returns (ClusterListResponse);
3081
+
3055
3082
  // Container
3056
3083
  rpc ContainerCheckpoint(ContainerCheckpointRequest) returns (google.protobuf.Empty);
3057
3084
  rpc ContainerExec(ContainerExecRequest) returns (ContainerExecResponse);
modal_proto/api_grpc.py CHANGED
@@ -102,6 +102,14 @@ class ModalClientBase(abc.ABC):
102
102
  async def ClientHello(self, stream: 'grpclib.server.Stream[google.protobuf.empty_pb2.Empty, modal_proto.api_pb2.ClientHelloResponse]') -> None:
103
103
  pass
104
104
 
105
+ @abc.abstractmethod
106
+ async def ClusterGet(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.ClusterGetRequest, modal_proto.api_pb2.ClusterGetResponse]') -> None:
107
+ pass
108
+
109
+ @abc.abstractmethod
110
+ async def ClusterList(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.ClusterListRequest, modal_proto.api_pb2.ClusterListResponse]') -> None:
111
+ pass
112
+
105
113
  @abc.abstractmethod
106
114
  async def ContainerCheckpoint(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.ContainerCheckpointRequest, google.protobuf.empty_pb2.Empty]') -> None:
107
115
  pass
@@ -722,6 +730,18 @@ class ModalClientBase(abc.ABC):
722
730
  google.protobuf.empty_pb2.Empty,
723
731
  modal_proto.api_pb2.ClientHelloResponse,
724
732
  ),
733
+ '/modal.client.ModalClient/ClusterGet': grpclib.const.Handler(
734
+ self.ClusterGet,
735
+ grpclib.const.Cardinality.UNARY_UNARY,
736
+ modal_proto.api_pb2.ClusterGetRequest,
737
+ modal_proto.api_pb2.ClusterGetResponse,
738
+ ),
739
+ '/modal.client.ModalClient/ClusterList': grpclib.const.Handler(
740
+ self.ClusterList,
741
+ grpclib.const.Cardinality.UNARY_UNARY,
742
+ modal_proto.api_pb2.ClusterListRequest,
743
+ modal_proto.api_pb2.ClusterListResponse,
744
+ ),
725
745
  '/modal.client.ModalClient/ContainerCheckpoint': grpclib.const.Handler(
726
746
  self.ContainerCheckpoint,
727
747
  grpclib.const.Cardinality.UNARY_UNARY,
@@ -1592,6 +1612,18 @@ class ModalClientStub:
1592
1612
  google.protobuf.empty_pb2.Empty,
1593
1613
  modal_proto.api_pb2.ClientHelloResponse,
1594
1614
  )
1615
+ self.ClusterGet = grpclib.client.UnaryUnaryMethod(
1616
+ channel,
1617
+ '/modal.client.ModalClient/ClusterGet',
1618
+ modal_proto.api_pb2.ClusterGetRequest,
1619
+ modal_proto.api_pb2.ClusterGetResponse,
1620
+ )
1621
+ self.ClusterList = grpclib.client.UnaryUnaryMethod(
1622
+ channel,
1623
+ '/modal.client.ModalClient/ClusterList',
1624
+ modal_proto.api_pb2.ClusterListRequest,
1625
+ modal_proto.api_pb2.ClusterListResponse,
1626
+ )
1595
1627
  self.ContainerCheckpoint = grpclib.client.UnaryUnaryMethod(
1596
1628
  channel,
1597
1629
  '/modal.client.ModalClient/ContainerCheckpoint',