modAL 1.5.4.dev8__py3-none-any.whl → 1.5.4.dev10__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/_output/rich.py CHANGED
@@ -37,6 +37,7 @@ from rich.progress import (
37
37
  )
38
38
  from rich.spinner import Spinner
39
39
  from rich.status import Status
40
+ from rich.table import Column
40
41
  from rich.text import Text
41
42
  from rich.tree import Tree
42
43
 
@@ -476,7 +477,10 @@ class RichOutputManager(OutputManager):
476
477
  and adds it to the current render group."""
477
478
  if not self._function_queueing_progress:
478
479
  self._function_queueing_progress = Progress(
479
- TextColumn("[progress.description]{task.description}"),
480
+ TextColumn(
481
+ "[progress.description]{task.description}",
482
+ table_column=Column(no_wrap=False, overflow="fold"),
483
+ ),
480
484
  FunctionQueuingColumn(),
481
485
  console=self._console,
482
486
  transient=True,
@@ -581,11 +585,17 @@ class RichOutputManager(OutputManager):
581
585
  """Handle queueing updates, ignoring completion updates for functions that have no queue progress bar."""
582
586
  task_key = (function_id, api_pb2.FUNCTION_QUEUED)
583
587
  task_description = description or f"'{function_id}' function waiting on worker"
588
+ task_description = escape(task_description)
584
589
  task_desc = f"[yellow]{task_description}. Time in queue:"
585
590
  if task_key in self._task_progress_items:
586
591
  progress_task_id = self._task_progress_items[task_key]
587
592
  try:
588
- self._function_queueing_progress_bar.update(progress_task_id, completed=completed, total=total)
593
+ self._function_queueing_progress_bar.update(
594
+ progress_task_id,
595
+ description=task_desc if description else None,
596
+ completed=completed,
597
+ total=total,
598
+ )
589
599
  if completed == total:
590
600
  del self._task_progress_items[task_key]
591
601
  self._function_queueing_progress_bar.remove_task(progress_task_id)
@@ -2,6 +2,7 @@
2
2
  import asyncio
3
3
  import base64
4
4
  import json
5
+ import random
5
6
  import time
6
7
  from typing import Any
7
8
 
@@ -17,8 +18,14 @@ AUTH_DENIED_EXCEPTIONS = (AuthError, PermissionDeniedError)
17
18
  class _AuthTokenManager:
18
19
  """Handles fetching and refreshing of the input plane auth token."""
19
20
 
20
- # Start refreshing this many seconds before the token expires
21
- REFRESH_WINDOW = 5 * 60
21
+ # Fraction of the token's lifetime to use before refreshing.
22
+ REFRESH_FRACTION = 0.5
23
+ # Width of the random band added on top of REFRESH_FRACTION, so that clients issued
24
+ # same-lifetime tokens at the same moment (a fan-out of containers starting together)
25
+ # spread their refreshes out instead of refreshing in lockstep every cycle. The band
26
+ # only ever delays a refresh, so the margin before expiry stays at no less than
27
+ # 1 - REFRESH_FRACTION - REFRESH_JITTER of the lifetime.
28
+ REFRESH_JITTER = 0.1
22
29
  # Bound each AuthTokenGet attempt so a refresh can't hang.
23
30
  AUTH_TOKEN_TIMEOUT = 5.0
24
31
  AUTH_TOKEN_RETRY_TOTAL_TIMEOUT = 3 * AUTH_TOKEN_TIMEOUT
@@ -33,9 +40,10 @@ class _AuthTokenManager:
33
40
  self._stub = stub
34
41
  self._token = ""
35
42
  self._expiry = 0.0
43
+ self._refresh_at = 0.0
36
44
  self._retry_after = 0.0
37
45
  self._backoff = self.FAILURE_BACKOFF_BASE
38
- self._lock: asyncio.Lock | None = None
46
+ self._refresh_task: asyncio.Task | None = None
39
47
 
40
48
  async def get_token(self) -> str:
41
49
  """
@@ -45,21 +53,20 @@ class _AuthTokenManager:
45
53
  concurrently by multiple coroutines, all requests will block until the token has been fetched. But only one
46
54
  coroutine will actually make a request to the control plane to fetch the new token. This ensures we do not hit
47
55
  the control plane with more requests than needed.
48
- 3. Has a valid cached token, but it is going to expire in the next 5 minutes. In this case we fetch a new token
49
- and cache it. If `get_token` is called concurrently, only one request will fetch the new token, and the others
50
- will be given the old (but still valid) token - i.e. they will not block.
56
+ 3. Has a valid cached token that has used up its refresh fraction of its lifetime. In this case we fetch a new
57
+ token and cache it. If `get_token` is called concurrently, only one request will fetch the new token, and the
58
+ others will be given the old (but still valid) token - i.e. they will not block.
51
59
  """
52
60
  if not self._token or self._is_expired():
53
61
  # We either have no token or it is expired - block everyone until we get a new token
54
62
  await self._try_refresh_token()
55
63
  elif self._should_refresh():
56
- # The token hasn't expired yet, but will soon, so it needs a refresh.
57
- lock = await self._get_lock()
58
- if lock.locked():
59
- # The lock is taken, so someone else is refreshing. Continue to use the old token.
64
+ # The token is still valid, but has used up its refresh fraction of its lifetime.
65
+ if self._refresh_task is not None:
66
+ # A refresh is in flight, so someone else is refreshing. Continue to use the old token.
60
67
  return self._token
61
68
  else:
62
- # The lock is not taken, so we need to fetch a new token.
69
+ # Nobody is refreshing, so we need to fetch a new token.
63
70
  await self._try_refresh_token()
64
71
 
65
72
  return self._token
@@ -76,58 +83,63 @@ class _AuthTokenManager:
76
83
 
77
84
  async def _refresh_token(self):
78
85
  """
79
- Fetch a new token from the control plane. If called concurrently, only one coroutine will make a request for a
80
- new token. The others will block on a lock, until the first coroutine has fetched the new token.
86
+ Fetch a new token from the control plane. Concurrent callers share a single request: the first caller starts it
87
+ and the others await the same task, so a burst of callers results in one RPC whether it succeeds or fails. The
88
+ task is owned by the event loop rather than by the caller that started it, so it runs to completion even if that
89
+ caller goes away.
81
90
  """
82
- lock = await self._get_lock()
83
- async with lock:
84
- # Double check inside lock - maybe another coroutine refreshed already. This happens the first time we fetch
85
- # the token. The first coroutine will fetch the token, while the others block on the lock, waiting for the
86
- # new token. Once we have a new token, the other coroutines will unblock and return from here.
91
+ if self._refresh_task is None:
92
+ # Maybe another coroutine refreshed already, or we're cooling down after a failure.
87
93
  if self._token and not self._should_refresh():
88
94
  return
89
- try:
90
- resp: api_pb2.AuthTokenGetResponse = await self._stub.AuthTokenGet(
91
- api_pb2.AuthTokenGetRequest(),
92
- # No cached token to fall back on, so a failure is user-visible: retry transient errors.
93
- # Otherwise one attempt, and _retry_after handles the cooldown.
94
- retry=Retry(
95
- attempt_timeout=self.AUTH_TOKEN_TIMEOUT,
96
- total_timeout=self.AUTH_TOKEN_RETRY_TOTAL_TIMEOUT,
97
- max_retries=0 if self._token else DEFAULT_MAX_RETRIES,
98
- ),
95
+ # Note: the task is created in async code so it binds to the synchronicity event loop.
96
+ self._refresh_task = asyncio.create_task(self._fetch_token())
97
+ self._refresh_task.add_done_callback(self._refresh_task_done)
98
+ # Shielded so a cancelled caller doesn't cancel the refresh for everyone else.
99
+ await asyncio.shield(self._refresh_task)
100
+
101
+ def _refresh_task_done(self, task: "asyncio.Task"):
102
+ if self._refresh_task is task:
103
+ self._refresh_task = None
104
+ if not task.cancelled():
105
+ # Retrieve the exception, if any, so a failure isn't logged as unhandled when no caller is waiting.
106
+ task.exception()
107
+
108
+ async def _fetch_token(self):
109
+ """Make the AuthTokenGet request and cache its token, or arm the failure backoff."""
110
+ try:
111
+ resp: api_pb2.AuthTokenGetResponse = await self._stub.AuthTokenGet(
112
+ api_pb2.AuthTokenGetRequest(),
113
+ # No cached token to fall back on, so a failure is user-visible: retry transient errors.
114
+ # Otherwise one attempt, and _retry_after handles the cooldown.
115
+ retry=Retry(
116
+ attempt_timeout=self.AUTH_TOKEN_TIMEOUT,
117
+ total_timeout=self.AUTH_TOKEN_RETRY_TOTAL_TIMEOUT,
118
+ max_retries=0 if self._token else DEFAULT_MAX_RETRIES,
119
+ ),
120
+ )
121
+ if not resp.token:
122
+ # Not expected
123
+ raise ExecutionError(
124
+ "Internal error: Did not receive auth token from server. Please contact Modal support."
99
125
  )
100
- if not resp.token:
101
- # Not expected
102
- raise ExecutionError(
103
- "Internal error: Did not receive auth token from server. Please contact Modal support."
104
- )
105
- if exp := self._decode_jwt(resp.token).get("exp"):
106
- expiry = float(exp)
107
- else:
108
- # This should never happen.
109
- logger.warning("x-modal-auth-token does not contain exp field")
110
- expiry = time.time() + self.DEFAULT_EXPIRY_OFFSET
111
- self._token = resp.token
112
- self._expiry = expiry
113
- self._retry_after = 0.0
114
- self._backoff = self.FAILURE_BACKOFF_BASE
115
- except AUTH_DENIED_EXCEPTIONS:
116
- raise
117
- except Exception as e:
118
- # Back off (exponentially on consecutive failures) so we don't hammer a struggling server.
119
- self._retry_after = time.time() + self._backoff
120
- self._backoff = min(self._backoff * 2, self.FAILURE_BACKOFF_MAX)
121
- raise
122
-
123
- async def _get_lock(self) -> asyncio.Lock:
124
- # Note: this function runs no async code but is marked as async to ensure it's
125
- # being run inside the synchronicity event loop and binds the lock to the
126
- # correct event loop on Python 3.9 which eagerly assigns event loops on
127
- # constructions of locks
128
- if self._lock is None:
129
- self._lock = asyncio.Lock()
130
- return self._lock
126
+ if exp := self._decode_jwt(resp.token).get("exp"):
127
+ expiry = float(exp)
128
+ else:
129
+ # This should never happen.
130
+ logger.warning("x-modal-auth-token does not contain exp field")
131
+ expiry = time.time() + self.DEFAULT_EXPIRY_OFFSET
132
+ self._token = resp.token
133
+ self._set_expiry(expiry)
134
+ self._retry_after = 0.0
135
+ self._backoff = self.FAILURE_BACKOFF_BASE
136
+ except AUTH_DENIED_EXCEPTIONS:
137
+ raise
138
+ except Exception as e:
139
+ # Back off (exponentially on consecutive failures) so we don't hammer a struggling server.
140
+ self._retry_after = time.time() + self._backoff
141
+ self._backoff = min(self._backoff * 2, self.FAILURE_BACKOFF_MAX)
142
+ raise
131
143
 
132
144
  @staticmethod
133
145
  def _decode_jwt(token: str) -> dict[str, Any]:
@@ -150,8 +162,20 @@ class _AuthTokenManager:
150
162
  # Fetch only when the token is stale/expiring and we're not in a post-failure backoff.
151
163
  return self._needs_refresh() and not self._in_backoff()
152
164
 
165
+ def _set_expiry(self, expiry: float) -> None:
166
+ """Record a new expiry and schedule the proactive refresh a jittered fraction of the way through.
167
+
168
+ The delay is measured from the remaining lifetime as this client sees it, so a client whose clock is
169
+ skewed relative to the issuer still keeps a margin proportional to the lifetime it observes.
170
+ """
171
+ now = time.time()
172
+ self._expiry = expiry
173
+ remaining = max(expiry - now, 0.0)
174
+ fraction = self.REFRESH_FRACTION + random.random() * self.REFRESH_JITTER
175
+ self._refresh_at = now + remaining * fraction
176
+
153
177
  def _needs_refresh(self):
154
- return time.time() >= (self._expiry - self.REFRESH_WINDOW)
178
+ return time.time() >= self._refresh_at
155
179
 
156
180
  def _is_expired(self):
157
181
  return time.time() >= self._expiry
@@ -288,11 +288,22 @@ class TaskCommandRouterClient:
288
288
  server_client,
289
289
  sandbox_id: str,
290
290
  task_id: str,
291
+ access: api_pb2.CommandRouterAccess | None = None,
291
292
  ) -> "TaskCommandRouterClient":
292
- """Initialize a TaskCommandRouterClient for a V2 sandbox."""
293
- resp = await fetch_command_router_access_v2(server_client, sandbox_id=sandbox_id)
293
+ """Initialize a TaskCommandRouterClient for a V2 sandbox.
294
+
295
+ `access` is the router access returned by SandboxCreateV2/SandboxRestoreV2,
296
+ which lets a freshly scheduled sandbox connect without a round-trip. When it
297
+ is absent — a re-attached sandbox, or the server could not mint a token — we
298
+ ask for it.
299
+ """
300
+ if access is not None:
301
+ url, jwt = access.url, access.jwt
302
+ else:
303
+ resp = await fetch_command_router_access_v2(server_client, sandbox_id=sandbox_id)
304
+ url, jwt = resp.url, resp.jwt
294
305
  logger.debug(f"Using command router access for sandbox {sandbox_id}")
295
- return await cls._connect(server_client, task_id, resp.url, resp.jwt, sandbox_id=sandbox_id)
306
+ return await cls._connect(server_client, task_id, url, jwt, sandbox_id=sandbox_id)
296
307
 
297
308
  @classmethod
298
309
  async def init_v2_by_task_id(
modal/client.pyi CHANGED
@@ -37,7 +37,7 @@ class _Client:
37
37
  server_url: str,
38
38
  client_type: int,
39
39
  credentials: typing.Optional[tuple[str, str]],
40
- version: str = "1.5.4.dev8",
40
+ version: str = "1.5.4.dev10",
41
41
  ):
42
42
  """mdmd:hidden
43
43
  The Modal client object is not intended to be instantiated directly by users.
@@ -207,7 +207,7 @@ class Client:
207
207
  server_url: str,
208
208
  client_type: int,
209
209
  credentials: typing.Optional[tuple[str, str]],
210
- version: str = "1.5.4.dev8",
210
+ version: str = "1.5.4.dev10",
211
211
  ):
212
212
  """mdmd:hidden
213
213
  The Modal client object is not intended to be instantiated directly by users.
modal/sandbox.py CHANGED
@@ -333,6 +333,7 @@ class _Sandbox(_Object, type_prefix="sb"):
333
333
  _tunnels: dict[int, Tunnel] | None
334
334
  _enable_snapshot: bool
335
335
  _command_router_client: TaskCommandRouterClient | None
336
+ _init_command_router_access: api_pb2.CommandRouterAccess | None
336
337
  _attached: bool
337
338
  _filesystem: _SandboxFilesystem | None
338
339
  _is_v2: bool = False
@@ -1034,6 +1035,10 @@ class _Sandbox(_Object, type_prefix="sb"):
1034
1035
  self._hydrate(sandbox_id, load_context.client, create_resp.metadata)
1035
1036
  self._is_v2 = True
1036
1037
  self._task_id = create_resp.task_id
1038
+ # An unset proto message reads as an empty one rather than None, so the
1039
+ # presence check is what distinguishes "no access" from "empty access".
1040
+ if create_resp.HasField("command_router_access"):
1041
+ self._init_command_router_access = create_resp.command_router_access
1037
1042
  self._hydrate_metadata_v2()
1038
1043
  # Unencrypted tunnel endpoints are not known at create time. Only
1039
1044
  # cache a complete set so tunnels() fetches the rest otherwise.
@@ -1121,6 +1126,7 @@ class _Sandbox(_Object, type_prefix="sb"):
1121
1126
  self._tunnels = None
1122
1127
  self._enable_snapshot = False
1123
1128
  self._command_router_client = None
1129
+ self._init_command_router_access = None
1124
1130
  self._filesystem = None
1125
1131
  self._is_v2 = _is_v2_sandbox_id(self.object_id)
1126
1132
  if self._is_v2:
@@ -1912,8 +1918,12 @@ class _Sandbox(_Object, type_prefix="sb"):
1912
1918
  if self._command_router_client is None:
1913
1919
  try:
1914
1920
  if self._is_v2:
1921
+ # Consume the seeded access, so if connecting with it fails the
1922
+ # retry falls back to the authoritative RPC instead of
1923
+ # re-trying the same credentials forever.
1924
+ access, self._init_command_router_access = self._init_command_router_access, None
1915
1925
  self._command_router_client = await TaskCommandRouterClient.init_v2_by_sandbox_id(
1916
- self._client, self.object_id, task_id
1926
+ self._client, self.object_id, task_id, access
1917
1927
  )
1918
1928
  else:
1919
1929
  self._command_router_client = await TaskCommandRouterClient.init(self._client, task_id)
@@ -2278,6 +2288,9 @@ class _Sandbox(_Object, type_prefix="sb"):
2278
2288
 
2279
2289
  sandbox = await _Sandbox.from_id(restore_resp.sandbox_id, client)
2280
2290
  sandbox._task_id = restore_resp.task_id
2291
+ # Seeded after from_id, whose hydration resets the field.
2292
+ if restore_resp.HasField("command_router_access"):
2293
+ sandbox._init_command_router_access = restore_resp.command_router_access
2281
2294
  return sandbox
2282
2295
 
2283
2296
  @property
modal/sandbox.pyi CHANGED
@@ -147,6 +147,7 @@ class _Sandbox(modal._object._Object):
147
147
  _tunnels: typing.Optional[dict[int, modal._tunnel.Tunnel]]
148
148
  _enable_snapshot: bool
149
149
  _command_router_client: typing.Optional[modal._utils.task_command_router_client.TaskCommandRouterClient]
150
+ _init_command_router_access: typing.Optional[modal_proto.api_pb2.CommandRouterAccess]
150
151
  _attached: bool
151
152
  _filesystem: typing.Optional[modal.sandbox_fs._SandboxFilesystem]
152
153
  _is_v2: bool
@@ -1454,6 +1455,7 @@ class Sandbox(modal.object.Object):
1454
1455
  _tunnels: typing.Optional[dict[int, modal._tunnel.Tunnel]]
1455
1456
  _enable_snapshot: bool
1456
1457
  _command_router_client: typing.Optional[modal._utils.task_command_router_client.TaskCommandRouterClient]
1458
+ _init_command_router_access: typing.Optional[modal_proto.api_pb2.CommandRouterAccess]
1457
1459
  _attached: bool
1458
1460
  _filesystem: typing.Optional[modal.sandbox_fs.SandboxFilesystem]
1459
1461
  _is_v2: bool
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modal
3
- Version: 1.5.4.dev8
3
+ Version: 1.5.4.dev10
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License-Expression: Apache-2.0
@@ -34,7 +34,7 @@ modal/billing.py,sha256=E1-P_P8bJFLp-bTaggYd4BaaViImPB5UdtXiY8VeAZQ,390
34
34
  modal/billing.pyi,sha256=4m7VLYNS8IiJ2I3CJx0awvrOM6BILWRVLfdeqtAYr8M,7189
35
35
  modal/call_graph.py,sha256=XGALIDn1bLchWo_goyX23bcPjzCZcfqKUo8INIfDapo,1775
36
36
  modal/client.py,sha256=NjpAL0fIKabEaN0uXJPEoI1OTjFtXSp4tSck-M-WF3k,16360
37
- modal/client.pyi,sha256=9l4Zsaj2DRBywAFp42Px57ByNlXL4XVkWFiUaNpMV1A,17997
37
+ modal/client.pyi,sha256=ibgsT1a5xZKVUot-Zpn_E1GOVWcWn2eQYvXRL1ZuSdM,17999
38
38
  modal/cloud_bucket_mount.py,sha256=NrdNV9r9aL3QFrlt-Dhtd7_K3f8v1igrHf2FRwgJ1CI,6827
39
39
  modal/cloud_bucket_mount.pyi,sha256=0E8d53pMh2KsFa-rMh_i6LxlzW4cMV8drVmmkPHSqZk,8149
40
40
  modal/cls.py,sha256=TxRxHdY4L6AZ6I16DNPgDryAkGtlFadD-Mm0ovtfN58,41206
@@ -76,8 +76,8 @@ modal/retries.py,sha256=tSGB5bGM5xZZUDXMkuelIEoQJY0vOukOssZhwc6tXAo,5014
76
76
  modal/runner.py,sha256=oqKyahvUEDpbGcNkxoCtKqFUShKWhoYEPecn7pk-fc4,31090
77
77
  modal/runner.pyi,sha256=HjkJBkv3GPIe9occmuQUBRgVuw82vrTL0urM8zV4TaY,9760
78
78
  modal/running_app.py,sha256=xSR1VVlhxEFytmjx2x697_0GpD25Vc9crhp6r117_QY,1145
79
- modal/sandbox.py,sha256=3UdESA3fDGlDOCP6K0QEl7UCmo0t204ahMrMiyHZyTE,125106
80
- modal/sandbox.pyi,sha256=GO6ADS5GLluBVTvsm78vyVlK7Oyve0aMu1nIxgRbmbQ,146442
79
+ modal/sandbox.py,sha256=p-QgzNALkRb0q_qRc-K28HpgAe1LRyomc3URd3QsRBY,126078
80
+ modal/sandbox.pyi,sha256=PXlInwHCuZYNXkRO0AKMpX3yKTAmhliN-ajiXltcsb0,146622
81
81
  modal/sandbox_fs.py,sha256=GSuPlrLSdQ7fG7c_TGMd-VWs_s6RqQxMvLivdvC6s4s,27002
82
82
  modal/sandbox_fs.pyi,sha256=TJWx8h7x3yRC7KUxeF7q62_0a7w1IHufnJL7AYEojAg,45285
83
83
  modal/schedule.py,sha256=J0rpNAVcoQjCCzobYFQXHXv1BBPLYATUwGS5prCHp4c,3242
@@ -101,7 +101,7 @@ modal/workspace.pyi,sha256=aB3LCYnbzD8eyaBMsEfMeMiSHOUdpTdio4rK6nsjHUU,24215
101
101
  modal/_output/__init__.py,sha256=xtGN6SPv2zvByrJ32JPao0yJKpxyCIZ-2JMTScrisuQ,28
102
102
  modal/_output/manager.py,sha256=lL9fK9_cSJHdVIOcgzjCZEJ90fgNB7_mO7ih_4sk1hI,18097
103
103
  modal/_output/pty.py,sha256=YIrNGH9kxJr8TFbIMwPnK3Wvh2rECyGYebx4TOqNWhk,10296
104
- modal/_output/rich.py,sha256=6QsXXD-LK0sxd5wiLQS4-sy-pgtBKvAV92flzAmAwKo,31864
104
+ modal/_output/rich.py,sha256=K6dUEqeeyytqUR-78eiS1GNmvuFW7HuKhws_41pjCRQ,32205
105
105
  modal/_output/status.py,sha256=c0rdvjoYKtIG7XJqq42TlcKawkYqZWtod38RmRY5IWA,4492
106
106
  modal/_runtime/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0VESpjWR0fc,28
107
107
  modal/_runtime/asgi.py,sha256=eDNPsmV6SXl0CwUqgy7yrFDaPdlx4NiWTScXpCTlBFQ,22805
@@ -118,7 +118,7 @@ modal/_runtime/user_code_imports.py,sha256=5MgewJzAeZqop47FQyB-lEpHBfC50ApHgSb86
118
118
  modal/_utils/__init__.py,sha256=waLjl5c6IPDhSsdWAm9Bji4e2PVxamYABKAze6CHVXY,28
119
119
  modal/_utils/app_utils.py,sha256=88BT4TPLWfYAQwKTHcyzNQRHg8n9B-QE2UyJs96iV-0,108
120
120
  modal/_utils/async_utils.py,sha256=2pBzV_ErMH055TGxT0re2szYUN6k8X94RkLwIp_JbZw,46393
121
- modal/_utils/auth_token_manager.py,sha256=_XAYZsMDgtRqVeyNBjcr88pMnZbg49n8D8wxDhqLltg,7335
121
+ modal/_utils/auth_token_manager.py,sha256=qhnbTv6EO5_BxvUUlyCrNt8sQaUIZ77CdSrzBH9sLaU,8563
122
122
  modal/_utils/blob_utils.py,sha256=KyqXWF82PdfA6pvEu99QwGfSqyHQxPUvjyi760GXkdY,26242
123
123
  modal/_utils/browser_utils.py,sha256=Yqq0qU4Id6oaDOdeT1JEmbCN7vj4baNJJraJhRWU8ZI,1085
124
124
  modal/_utils/bytes_io_segment_payload.py,sha256=2OrIrjrsJR38a9D7JCITLqGvIPaiWViTQhxtcZlFn_M,4328
@@ -142,7 +142,7 @@ modal/_utils/proxy_support.py,sha256=hLA_XojYxzPysOiLqyUbB-SgMLmn_X8WtXTk92xh7g4
142
142
  modal/_utils/rand_pb_testing.py,sha256=kwAKIros_g6XPXluiJAktQ79YPkD9SGopKGl83GQ1l0,4361
143
143
  modal/_utils/sandbox_fs_utils.py,sha256=rsfo1uDbVSoiY21XERDzsmp-DALcNmlPfJ6jn_2p5T0,15680
144
144
  modal/_utils/shell_utils.py,sha256=_2yHrlx4Crx5JWQXECLPQ51kclu8H-U3N7jOkBN7q5U,3390
145
- modal/_utils/task_command_router_client.py,sha256=QTIkgXqSFHi6sO2rhRyAk1TT5XeCISbq7nY93lWW1NY,45599
145
+ modal/_utils/task_command_router_client.py,sha256=QJxxzceZDrr9BEDVs524tZ17tgO3wEVDw-4gF8-P96U,46073
146
146
  modal/_utils/time_utils.py,sha256=JaFyW8y4iimzhrGT5KlQmlXH4oMZrZOGCtUBZAV-gfU,10965
147
147
  modal/_vendor/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0VESpjWR0fc,28
148
148
  modal/_vendor/a2wsgi_wsgi.py,sha256=RVLIYVJA8a8o96QxEXYT5tuog2zev2S24XOuAVTXZAs,21872
@@ -198,7 +198,7 @@ modal/experimental/flash.py,sha256=GAJ1c-EGL8M3_loAkqr5gdUfySMHY3U_oc6RywfZ8-0,3
198
198
  modal/experimental/flash.pyi,sha256=lpTqJFZRMGWscw0xpYZVdBMnAYjj16asXE4_64A6itQ,17774
199
199
  modal/experimental/ipython.py,sha256=kJ6o9wkAY_MiSb7paewI7f1MJAeqdi8TX5pBdhr_mUI,2925
200
200
  modal/skills/modal/SKILL.md,sha256=WzLjYJ1utjc_ZOf6qZTPwB6wxxwRYB5PibdvIf_FLy0,5316
201
- modal-1.5.4.dev8.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
201
+ modal-1.5.4.dev10.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
202
202
  modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
203
203
  modal_docs/gen_cli_docs.py,sha256=9-b8vl2EsLWD9zJqpCK8IUi5h44Bjn3i3rSdedZV4bA,6415
204
204
  modal_docs/gen_cli_docs_main.py,sha256=UPGr7O1DYTIRLwfINe2rbdh89J3cPVTU1OWL-SjxnOQ,198
@@ -209,23 +209,23 @@ modal_docs/mdmd/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,2
209
209
  modal_docs/mdmd/mdmd.py,sha256=J49V8ak-hnF7SyBJDc-p3a_aEZpaAImkz2Rf74mDvA4,25070
210
210
  modal_docs/mdmd/signatures.py,sha256=OASroKle763Kfumn4Ek4PABJXEGP56JMCTug44QoBx4,11327
211
211
  modal_docs/mdmd/types.py,sha256=tv7fvziPr-MeDzOp4e2pK5h3d1DXTUOO74rPqDoBn6g,736
212
- modal_proto/__init__.py,sha256=tFdSv9eaHBvYcwhgq-XqIlYDNDw57clrvO91Fb-oUV4,130
213
- modal_proto/api_grpc.py,sha256=zFY9HEa330mx7P8-b4bQexf5HkEbOqdnymeYO0SN7Po,182439
214
- modal_proto/api_pb2.py,sha256=fCCrs6Bc-kFT0FJ0Alja_9Qa-3jrVhwBHgvBdUQRSiA,498800
215
- modal_proto/api_pb2.pyi,sha256=ykSac1gwUcpCLGxOAPZKXDI493PHxwSLNUBjQRJM8bQ,687971
216
- modal_proto/api_pb2_grpc.py,sha256=CU5p-AoluXydNZsQva4WPolS2caboTbxD-jINzWJqdE,391633
217
- modal_proto/api_pb2_grpc.pyi,sha256=pWvTEJqn6kW_sFQ6lzw_G08E_T63XMuA-I-vO4avDus,91568
218
- modal_proto/modal_api_grpc.py,sha256=j0WxD1iNwLzvm2bS4KAc2OTN4QnXZ9_672oGA227P40,28771
212
+ modal_proto/__init__.py,sha256=Hkou4lcD5tArEkW_9v9KZhLY7fl0fA9-O28beKU55pg,396
213
+ modal_proto/api_grpc.py,sha256=T7G1w30VHACC466T9WgEuAUKzk1T55K4xhh9yrx30jE,184199
214
+ modal_proto/api_pb2.py,sha256=Cv-bAV11PEAgWXYeQHcLBgmjvgjDvwR1MrrdT7hNXr0,503011
215
+ modal_proto/api_pb2.pyi,sha256=RrSAYQpmuc2pCz3sF3zbTcmC7R1oOppakVUdwm-IKOs,695248
216
+ modal_proto/api_pb2_grpc.py,sha256=iVzwMoa9O8vZKvPX4gCFq3f5QYTMpHFsLa-mEc-Zwis,395203
217
+ modal_proto/api_pb2_grpc.pyi,sha256=Clzhm_sI17aGhz31Rtl2MpCdfeM_8PlGu2O4aH92fbk,92749
218
+ modal_proto/modal_api_grpc.py,sha256=36yBgbLRHAKnchTZlRHVQyYWbFTTc_xrx6j8JHz1Ozo,29059
219
219
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
220
220
  modal_proto/task_command_router_grpc.py,sha256=UurJEgLeAc2CCdEsCOFE9DgIQy1ra6bXHXJLNBK81Mg,21284
221
221
  modal_proto/task_command_router_pb2.py,sha256=4cyDT_uPGi54blsO663bnSzUe7aBFqi9F4iM8N1JPaU,41130
222
222
  modal_proto/task_command_router_pb2.pyi,sha256=5xfhnwtTDTmJo1Nv0tPBJrYzb0aeilY2Lm92wWT_6yw,46211
223
223
  modal_proto/task_command_router_pb2_grpc.py,sha256=zuFkJgKcswB2ftjnyEgs70dp61VMA7gK0h0uzR3gYFw,42563
224
224
  modal_proto/task_command_router_pb2_grpc.pyi,sha256=UjAJFqz9DpOFXP04fVm5lB2eAyTtjOg3oKjfWei8yLU,14262
225
- modal_version/__init__.py,sha256=KhzhvJODlTPfdzPYDv79P-JU9OqeyywBlvigSELIBg4,120
225
+ modal_version/__init__.py,sha256=m4zi0JLZ3JoNiMRuYVI2kPLAjBX0EfNFfw7dstre8IU,121
226
226
  modal_version/__main__.py,sha256=nLUbubxKx7GXNzJIkTB7M7_u8080LyLM0IS0rzFkC_c,119
227
- modal-1.5.4.dev8.dist-info/METADATA,sha256=oOydWAb-YD50rDlYo1Op1Tu3jzMF74jSXYayUax-nEw,2512
228
- modal-1.5.4.dev8.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
229
- modal-1.5.4.dev8.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
230
- modal-1.5.4.dev8.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
231
- modal-1.5.4.dev8.dist-info/RECORD,,
227
+ modal-1.5.4.dev10.dist-info/METADATA,sha256=4c3UGSDeWIAxuzAsfIuIYr7TtmJxI0aTnsOd4uOkzYw,2513
228
+ modal-1.5.4.dev10.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
229
+ modal-1.5.4.dev10.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
230
+ modal-1.5.4.dev10.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
231
+ modal-1.5.4.dev10.dist-info/RECORD,,
modal_proto/__init__.py CHANGED
@@ -1,4 +1,11 @@
1
1
  # Copyright Modal Labs 2024
2
+ """Modal gRPC types for Python.
3
+
4
+ Warning: direct usage of Modal's gRPC API is discouraged,
5
+ and no support or compatibility guarantees are provided.
6
+ Message fields or entire RPCs may be changed or removed
7
+ without notice. We recommend using official SDKs instead.
8
+ """
2
9
  from pkgutil import extend_path
3
10
 
4
11
  __path__ = extend_path(__path__, __name__) # type: ignore[has-type]
modal_proto/api_grpc.py CHANGED
@@ -123,6 +123,10 @@ class ModalClientBase(abc.ABC):
123
123
  async def AuthTokenGet(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.AuthTokenGetRequest, modal_proto.api_pb2.AuthTokenGetResponse]') -> None:
124
124
  pass
125
125
 
126
+ @abc.abstractmethod
127
+ async def AutoscalerOverrideHistory(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.AutoscalerOverrideHistoryRequest, modal_proto.api_pb2.AutoscalerOverrideHistoryResponse]') -> None:
128
+ pass
129
+
126
130
  @abc.abstractmethod
127
131
  async def BlobCreate(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.BlobCreateRequest, modal_proto.api_pb2.BlobCreateResponse]') -> None:
128
132
  pass
@@ -327,6 +331,10 @@ class ModalClientBase(abc.ABC):
327
331
  async def EnvironmentSetBudget(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.EnvironmentSetBudgetRequest, google.protobuf.empty_pb2.Empty]') -> None:
328
332
  pass
329
333
 
334
+ @abc.abstractmethod
335
+ async def EnvironmentSetDefaultMemberRole(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.EnvironmentSetDefaultMemberRoleRequest, google.protobuf.empty_pb2.Empty]') -> None:
336
+ pass
337
+
330
338
  @abc.abstractmethod
331
339
  async def EnvironmentSetManaged(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.EnvironmentSetManagedRequest, google.protobuf.empty_pb2.Empty]') -> None:
332
340
  pass
@@ -1113,6 +1121,12 @@ class ModalClientBase(abc.ABC):
1113
1121
  modal_proto.api_pb2.AuthTokenGetRequest,
1114
1122
  modal_proto.api_pb2.AuthTokenGetResponse,
1115
1123
  ),
1124
+ '/modal.client.ModalClient/AutoscalerOverrideHistory': grpclib.const.Handler(
1125
+ self.AutoscalerOverrideHistory,
1126
+ grpclib.const.Cardinality.UNARY_UNARY,
1127
+ modal_proto.api_pb2.AutoscalerOverrideHistoryRequest,
1128
+ modal_proto.api_pb2.AutoscalerOverrideHistoryResponse,
1129
+ ),
1116
1130
  '/modal.client.ModalClient/BlobCreate': grpclib.const.Handler(
1117
1131
  self.BlobCreate,
1118
1132
  grpclib.const.Cardinality.UNARY_UNARY,
@@ -1419,6 +1433,12 @@ class ModalClientBase(abc.ABC):
1419
1433
  modal_proto.api_pb2.EnvironmentSetBudgetRequest,
1420
1434
  google.protobuf.empty_pb2.Empty,
1421
1435
  ),
1436
+ '/modal.client.ModalClient/EnvironmentSetDefaultMemberRole': grpclib.const.Handler(
1437
+ self.EnvironmentSetDefaultMemberRole,
1438
+ grpclib.const.Cardinality.UNARY_UNARY,
1439
+ modal_proto.api_pb2.EnvironmentSetDefaultMemberRoleRequest,
1440
+ google.protobuf.empty_pb2.Empty,
1441
+ ),
1422
1442
  '/modal.client.ModalClient/EnvironmentSetManaged': grpclib.const.Handler(
1423
1443
  self.EnvironmentSetManaged,
1424
1444
  grpclib.const.Cardinality.UNARY_UNARY,
@@ -2523,6 +2543,12 @@ class ModalClientStub:
2523
2543
  modal_proto.api_pb2.AuthTokenGetRequest,
2524
2544
  modal_proto.api_pb2.AuthTokenGetResponse,
2525
2545
  )
2546
+ self.AutoscalerOverrideHistory = grpclib.client.UnaryUnaryMethod(
2547
+ channel,
2548
+ '/modal.client.ModalClient/AutoscalerOverrideHistory',
2549
+ modal_proto.api_pb2.AutoscalerOverrideHistoryRequest,
2550
+ modal_proto.api_pb2.AutoscalerOverrideHistoryResponse,
2551
+ )
2526
2552
  self.BlobCreate = grpclib.client.UnaryUnaryMethod(
2527
2553
  channel,
2528
2554
  '/modal.client.ModalClient/BlobCreate',
@@ -2829,6 +2855,12 @@ class ModalClientStub:
2829
2855
  modal_proto.api_pb2.EnvironmentSetBudgetRequest,
2830
2856
  google.protobuf.empty_pb2.Empty,
2831
2857
  )
2858
+ self.EnvironmentSetDefaultMemberRole = grpclib.client.UnaryUnaryMethod(
2859
+ channel,
2860
+ '/modal.client.ModalClient/EnvironmentSetDefaultMemberRole',
2861
+ modal_proto.api_pb2.EnvironmentSetDefaultMemberRoleRequest,
2862
+ google.protobuf.empty_pb2.Empty,
2863
+ )
2832
2864
  self.EnvironmentSetManaged = grpclib.client.UnaryUnaryMethod(
2833
2865
  channel,
2834
2866
  '/modal.client.ModalClient/EnvironmentSetManaged',