modal 1.1.1.dev3__py3-none-any.whl → 1.1.1.dev5__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.
Potentially problematic release.
This version of modal might be problematic. Click here for more details.
- modal/_functions.py +45 -7
- modal/_utils/function_utils.py +13 -2
- modal/client.pyi +2 -2
- modal/sandbox.py +68 -4
- modal/sandbox.pyi +85 -3
- {modal-1.1.1.dev3.dist-info → modal-1.1.1.dev5.dist-info}/METADATA +1 -1
- {modal-1.1.1.dev3.dist-info → modal-1.1.1.dev5.dist-info}/RECORD +12 -12
- modal_version/__init__.py +1 -1
- {modal-1.1.1.dev3.dist-info → modal-1.1.1.dev5.dist-info}/WHEEL +0 -0
- {modal-1.1.1.dev3.dist-info → modal-1.1.1.dev5.dist-info}/entry_points.txt +0 -0
- {modal-1.1.1.dev3.dist-info → modal-1.1.1.dev5.dist-info}/licenses/LICENSE +0 -0
- {modal-1.1.1.dev3.dist-info → modal-1.1.1.dev5.dist-info}/top_level.txt +0 -0
modal/_functions.py
CHANGED
|
@@ -451,6 +451,33 @@ class _InputPlaneInvocation:
|
|
|
451
451
|
await_response.output.result, await_response.output.data_format, control_plane_stub, self.client
|
|
452
452
|
)
|
|
453
453
|
|
|
454
|
+
async def run_generator(self):
|
|
455
|
+
items_received = 0
|
|
456
|
+
# populated when self.run_function() completes
|
|
457
|
+
items_total: Union[int, None] = None
|
|
458
|
+
async with aclosing(
|
|
459
|
+
async_merge(
|
|
460
|
+
_stream_function_call_data(
|
|
461
|
+
self.client,
|
|
462
|
+
self.stub,
|
|
463
|
+
"",
|
|
464
|
+
variant="data_out",
|
|
465
|
+
attempt_token=self.attempt_token,
|
|
466
|
+
),
|
|
467
|
+
callable_to_agen(self.run_function),
|
|
468
|
+
)
|
|
469
|
+
) as streamer:
|
|
470
|
+
async for item in streamer:
|
|
471
|
+
if isinstance(item, api_pb2.GeneratorDone):
|
|
472
|
+
items_total = item.items_total
|
|
473
|
+
else:
|
|
474
|
+
yield item
|
|
475
|
+
items_received += 1
|
|
476
|
+
# The comparison avoids infinite loops if a non-deterministic generator is retried
|
|
477
|
+
# and produces less data in the second run than what was already sent.
|
|
478
|
+
if items_total is not None and items_received >= items_total:
|
|
479
|
+
break
|
|
480
|
+
|
|
454
481
|
@staticmethod
|
|
455
482
|
async def _get_metadata(input_plane_region: str, client: _Client) -> list[tuple[str, str]]:
|
|
456
483
|
if not input_plane_region:
|
|
@@ -1544,13 +1571,24 @@ Use the `Function.get_web_url()` method instead.
|
|
|
1544
1571
|
@live_method_gen
|
|
1545
1572
|
@synchronizer.no_input_translation
|
|
1546
1573
|
async def _call_generator(self, args, kwargs):
|
|
1547
|
-
invocation
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1574
|
+
invocation: Union[_Invocation, _InputPlaneInvocation]
|
|
1575
|
+
if self._input_plane_url:
|
|
1576
|
+
invocation = await _InputPlaneInvocation.create(
|
|
1577
|
+
self,
|
|
1578
|
+
args,
|
|
1579
|
+
kwargs,
|
|
1580
|
+
client=self.client,
|
|
1581
|
+
input_plane_url=self._input_plane_url,
|
|
1582
|
+
input_plane_region=self._input_plane_region,
|
|
1583
|
+
)
|
|
1584
|
+
else:
|
|
1585
|
+
invocation = await _Invocation.create(
|
|
1586
|
+
self,
|
|
1587
|
+
args,
|
|
1588
|
+
kwargs,
|
|
1589
|
+
client=self.client,
|
|
1590
|
+
function_call_invocation_type=api_pb2.FUNCTION_CALL_INVOCATION_TYPE_SYNC_LEGACY,
|
|
1591
|
+
)
|
|
1554
1592
|
async for res in invocation.run_generator():
|
|
1555
1593
|
yield res
|
|
1556
1594
|
|
modal/_utils/function_utils.py
CHANGED
|
@@ -385,9 +385,16 @@ def callable_has_non_self_non_default_params(f: Callable[..., Any]) -> bool:
|
|
|
385
385
|
|
|
386
386
|
|
|
387
387
|
async def _stream_function_call_data(
|
|
388
|
-
client,
|
|
388
|
+
client,
|
|
389
|
+
stub,
|
|
390
|
+
function_call_id: Optional[str],
|
|
391
|
+
variant: Literal["data_in", "data_out"],
|
|
392
|
+
attempt_token: Optional[str] = None,
|
|
389
393
|
) -> AsyncGenerator[Any, None]:
|
|
390
394
|
"""Read from the `data_in` or `data_out` stream of a function call."""
|
|
395
|
+
if function_call_id is None and attempt_token is None:
|
|
396
|
+
raise ValueError("function_call_id or attempt_token is required for data_out stream")
|
|
397
|
+
|
|
391
398
|
if stub is None:
|
|
392
399
|
stub = client.stub
|
|
393
400
|
|
|
@@ -405,7 +412,11 @@ async def _stream_function_call_data(
|
|
|
405
412
|
raise ValueError(f"Invalid variant {variant}")
|
|
406
413
|
|
|
407
414
|
while True:
|
|
408
|
-
req = api_pb2.FunctionCallGetDataRequest(
|
|
415
|
+
req = api_pb2.FunctionCallGetDataRequest(
|
|
416
|
+
function_call_id=function_call_id,
|
|
417
|
+
last_index=last_index,
|
|
418
|
+
attempt_token=attempt_token,
|
|
419
|
+
)
|
|
409
420
|
try:
|
|
410
421
|
async for chunk in stub_fn.unary_stream(req):
|
|
411
422
|
if chunk.index <= last_index:
|
modal/client.pyi
CHANGED
|
@@ -33,7 +33,7 @@ class _Client:
|
|
|
33
33
|
server_url: str,
|
|
34
34
|
client_type: int,
|
|
35
35
|
credentials: typing.Optional[tuple[str, str]],
|
|
36
|
-
version: str = "1.1.1.
|
|
36
|
+
version: str = "1.1.1.dev5",
|
|
37
37
|
):
|
|
38
38
|
"""mdmd:hidden
|
|
39
39
|
The Modal client object is not intended to be instantiated directly by users.
|
|
@@ -163,7 +163,7 @@ class Client:
|
|
|
163
163
|
server_url: str,
|
|
164
164
|
client_type: int,
|
|
165
165
|
credentials: typing.Optional[tuple[str, str]],
|
|
166
|
-
version: str = "1.1.1.
|
|
166
|
+
version: str = "1.1.1.dev5",
|
|
167
167
|
):
|
|
168
168
|
"""mdmd:hidden
|
|
169
169
|
The Modal client object is not intended to be instantiated directly by users.
|
modal/sandbox.py
CHANGED
|
@@ -73,6 +73,20 @@ def _validate_exec_args(entrypoint_args: Sequence[str]) -> None:
|
|
|
73
73
|
)
|
|
74
74
|
|
|
75
75
|
|
|
76
|
+
class DefaultSandboxNameOverride(str):
|
|
77
|
+
"""A singleton class that represents the default sandbox name override.
|
|
78
|
+
|
|
79
|
+
It is used to indicate that the sandbox name should not be overridden.
|
|
80
|
+
"""
|
|
81
|
+
|
|
82
|
+
def __repr__(self) -> str:
|
|
83
|
+
# NOTE: this must match the instance var name below in order for type stubs to work 😬
|
|
84
|
+
return "_DEFAULT_SANDBOX_NAME_OVERRIDE"
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
_DEFAULT_SANDBOX_NAME_OVERRIDE = DefaultSandboxNameOverride()
|
|
88
|
+
|
|
89
|
+
|
|
76
90
|
class _Sandbox(_Object, type_prefix="sb"):
|
|
77
91
|
"""A `Sandbox` object lets you interact with a running sandbox. This API is similar to Python's
|
|
78
92
|
[asyncio.subprocess.Process](https://docs.python.org/3/library/asyncio-subprocess.html#asyncio.subprocess.Process).
|
|
@@ -93,6 +107,7 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
|
93
107
|
entrypoint_args: Sequence[str],
|
|
94
108
|
image: _Image,
|
|
95
109
|
secrets: Sequence[_Secret],
|
|
110
|
+
name: Optional[str] = None,
|
|
96
111
|
timeout: Optional[int] = None,
|
|
97
112
|
workdir: Optional[str] = None,
|
|
98
113
|
gpu: GPU_T = None,
|
|
@@ -216,6 +231,7 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
|
216
231
|
proxy_id=(proxy.object_id if proxy else None),
|
|
217
232
|
enable_snapshot=enable_snapshot,
|
|
218
233
|
verbose=verbose,
|
|
234
|
+
name=name,
|
|
219
235
|
experimental_options=experimental_options,
|
|
220
236
|
)
|
|
221
237
|
|
|
@@ -230,7 +246,9 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
|
230
246
|
@staticmethod
|
|
231
247
|
async def create(
|
|
232
248
|
*entrypoint_args: str,
|
|
233
|
-
|
|
249
|
+
# Associate the sandbox with an app. Required unless creating from a container.
|
|
250
|
+
app: Optional["modal.app._App"] = None,
|
|
251
|
+
name: Optional[str] = None, # Optionally give the sandbox a name. Unique within an app.
|
|
234
252
|
image: Optional[_Image] = None, # The image to run as the container for the sandbox.
|
|
235
253
|
secrets: Sequence[_Secret] = (), # Environment variables to inject into the sandbox.
|
|
236
254
|
network_file_systems: dict[Union[str, os.PathLike], _NetworkFileSystem] = {},
|
|
@@ -295,6 +313,7 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
|
295
313
|
return await _Sandbox._create(
|
|
296
314
|
*entrypoint_args,
|
|
297
315
|
app=app,
|
|
316
|
+
name=name,
|
|
298
317
|
image=image,
|
|
299
318
|
secrets=secrets,
|
|
300
319
|
network_file_systems=network_file_systems,
|
|
@@ -323,7 +342,9 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
|
323
342
|
@staticmethod
|
|
324
343
|
async def _create(
|
|
325
344
|
*entrypoint_args: str,
|
|
326
|
-
|
|
345
|
+
# Associate the sandbox with an app. Required unless creating from a container.
|
|
346
|
+
app: Optional["modal.app._App"] = None,
|
|
347
|
+
name: Optional[str] = None, # Optionally give the sandbox a name. Unique within an app.
|
|
327
348
|
image: Optional[_Image] = None, # The image to run as the container for the sandbox.
|
|
328
349
|
secrets: Sequence[_Secret] = (), # Environment variables to inject into the sandbox.
|
|
329
350
|
mounts: Sequence[_Mount] = (),
|
|
@@ -376,6 +397,7 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
|
376
397
|
entrypoint_args,
|
|
377
398
|
image=image or _default_image,
|
|
378
399
|
secrets=secrets,
|
|
400
|
+
name=name,
|
|
379
401
|
timeout=timeout,
|
|
380
402
|
workdir=workdir,
|
|
381
403
|
gpu=gpu,
|
|
@@ -443,6 +465,27 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
|
443
465
|
self._stdin = StreamWriter(self.object_id, "sandbox", self._client)
|
|
444
466
|
self._result = None
|
|
445
467
|
|
|
468
|
+
@staticmethod
|
|
469
|
+
async def from_name(
|
|
470
|
+
app_name: str,
|
|
471
|
+
name: str,
|
|
472
|
+
*,
|
|
473
|
+
environment_name: Optional[str] = None,
|
|
474
|
+
client: Optional[_Client] = None,
|
|
475
|
+
) -> "_Sandbox":
|
|
476
|
+
"""Get a running Sandbox by name from the given app.
|
|
477
|
+
|
|
478
|
+
Raises an error if no running sandbox is found with the given name. A Sandbox's name
|
|
479
|
+
is the `name` argument passed to `Sandbox.create`.
|
|
480
|
+
"""
|
|
481
|
+
if client is None:
|
|
482
|
+
client = await _Client.from_env()
|
|
483
|
+
env_name = _get_environment_name(environment_name)
|
|
484
|
+
|
|
485
|
+
req = api_pb2.SandboxGetFromNameRequest(sandbox_name=name, app_name=app_name, environment_name=env_name)
|
|
486
|
+
resp = await retry_transient_errors(client.stub.SandboxGetFromName, req)
|
|
487
|
+
return _Sandbox._new_hydrated(resp.sandbox_id, client, None)
|
|
488
|
+
|
|
446
489
|
@staticmethod
|
|
447
490
|
async def from_id(sandbox_id: str, client: Optional[_Client] = None) -> "_Sandbox":
|
|
448
491
|
"""Construct a Sandbox from an id and look up the Sandbox result.
|
|
@@ -719,10 +762,31 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
|
719
762
|
return obj
|
|
720
763
|
|
|
721
764
|
@staticmethod
|
|
722
|
-
async def _experimental_from_snapshot(
|
|
765
|
+
async def _experimental_from_snapshot(
|
|
766
|
+
snapshot: _SandboxSnapshot,
|
|
767
|
+
client: Optional[_Client] = None,
|
|
768
|
+
*,
|
|
769
|
+
name: Optional[str] = _DEFAULT_SANDBOX_NAME_OVERRIDE,
|
|
770
|
+
):
|
|
723
771
|
client = client or await _Client.from_env()
|
|
724
772
|
|
|
725
|
-
|
|
773
|
+
if name is _DEFAULT_SANDBOX_NAME_OVERRIDE:
|
|
774
|
+
restore_req = api_pb2.SandboxRestoreRequest(
|
|
775
|
+
snapshot_id=snapshot.object_id,
|
|
776
|
+
sandbox_name_override_type=api_pb2.SandboxRestoreRequest.SANDBOX_NAME_OVERRIDE_TYPE_UNSPECIFIED,
|
|
777
|
+
)
|
|
778
|
+
elif name is None:
|
|
779
|
+
restore_req = api_pb2.SandboxRestoreRequest(
|
|
780
|
+
snapshot_id=snapshot.object_id,
|
|
781
|
+
sandbox_name_override_type=api_pb2.SandboxRestoreRequest.SANDBOX_NAME_OVERRIDE_TYPE_NONE,
|
|
782
|
+
)
|
|
783
|
+
else:
|
|
784
|
+
restore_req = api_pb2.SandboxRestoreRequest(
|
|
785
|
+
snapshot_id=snapshot.object_id,
|
|
786
|
+
sandbox_name_override=name,
|
|
787
|
+
sandbox_name_override_type=api_pb2.SandboxRestoreRequest.SANDBOX_NAME_OVERRIDE_TYPE_STRING,
|
|
788
|
+
)
|
|
789
|
+
|
|
726
790
|
restore_resp: api_pb2.SandboxRestoreResponse = await retry_transient_errors(
|
|
727
791
|
client.stub.SandboxRestore, restore_req
|
|
728
792
|
)
|
modal/sandbox.pyi
CHANGED
|
@@ -27,6 +27,17 @@ import typing_extensions
|
|
|
27
27
|
|
|
28
28
|
def _validate_exec_args(entrypoint_args: collections.abc.Sequence[str]) -> None: ...
|
|
29
29
|
|
|
30
|
+
class DefaultSandboxNameOverride(str):
|
|
31
|
+
"""A singleton class that represents the default sandbox name override.
|
|
32
|
+
|
|
33
|
+
It is used to indicate that the sandbox name should not be overridden.
|
|
34
|
+
"""
|
|
35
|
+
def __repr__(self) -> str:
|
|
36
|
+
"""Return repr(self)."""
|
|
37
|
+
...
|
|
38
|
+
|
|
39
|
+
_DEFAULT_SANDBOX_NAME_OVERRIDE: DefaultSandboxNameOverride
|
|
40
|
+
|
|
30
41
|
class _Sandbox(modal._object._Object):
|
|
31
42
|
"""A `Sandbox` object lets you interact with a running sandbox. This API is similar to Python's
|
|
32
43
|
[asyncio.subprocess.Process](https://docs.python.org/3/library/asyncio-subprocess.html#asyncio.subprocess.Process).
|
|
@@ -47,6 +58,7 @@ class _Sandbox(modal._object._Object):
|
|
|
47
58
|
entrypoint_args: collections.abc.Sequence[str],
|
|
48
59
|
image: modal.image._Image,
|
|
49
60
|
secrets: collections.abc.Sequence[modal.secret._Secret],
|
|
61
|
+
name: typing.Optional[str] = None,
|
|
50
62
|
timeout: typing.Optional[int] = None,
|
|
51
63
|
workdir: typing.Optional[str] = None,
|
|
52
64
|
gpu: typing.Union[None, str, modal.gpu._GPUConfig] = None,
|
|
@@ -79,6 +91,7 @@ class _Sandbox(modal._object._Object):
|
|
|
79
91
|
async def create(
|
|
80
92
|
*entrypoint_args: str,
|
|
81
93
|
app: typing.Optional[modal.app._App] = None,
|
|
94
|
+
name: typing.Optional[str] = None,
|
|
82
95
|
image: typing.Optional[modal.image._Image] = None,
|
|
83
96
|
secrets: collections.abc.Sequence[modal.secret._Secret] = (),
|
|
84
97
|
network_file_systems: dict[typing.Union[str, os.PathLike], modal.network_file_system._NetworkFileSystem] = {},
|
|
@@ -125,6 +138,7 @@ class _Sandbox(modal._object._Object):
|
|
|
125
138
|
async def _create(
|
|
126
139
|
*entrypoint_args: str,
|
|
127
140
|
app: typing.Optional[modal.app._App] = None,
|
|
141
|
+
name: typing.Optional[str] = None,
|
|
128
142
|
image: typing.Optional[modal.image._Image] = None,
|
|
129
143
|
secrets: collections.abc.Sequence[modal.secret._Secret] = (),
|
|
130
144
|
mounts: collections.abc.Sequence[modal.mount._Mount] = (),
|
|
@@ -154,6 +168,21 @@ class _Sandbox(modal._object._Object):
|
|
|
154
168
|
verbose: bool = False,
|
|
155
169
|
): ...
|
|
156
170
|
def _hydrate_metadata(self, handle_metadata: typing.Optional[google.protobuf.message.Message]): ...
|
|
171
|
+
@staticmethod
|
|
172
|
+
async def from_name(
|
|
173
|
+
app_name: str,
|
|
174
|
+
name: str,
|
|
175
|
+
*,
|
|
176
|
+
environment_name: typing.Optional[str] = None,
|
|
177
|
+
client: typing.Optional[modal.client._Client] = None,
|
|
178
|
+
) -> _Sandbox:
|
|
179
|
+
"""Get a running Sandbox by name from the given app.
|
|
180
|
+
|
|
181
|
+
Raises an error if no running sandbox is found with the given name. A Sandbox's name
|
|
182
|
+
is the `name` argument passed to `Sandbox.create`.
|
|
183
|
+
"""
|
|
184
|
+
...
|
|
185
|
+
|
|
157
186
|
@staticmethod
|
|
158
187
|
async def from_id(sandbox_id: str, client: typing.Optional[modal.client._Client] = None) -> _Sandbox:
|
|
159
188
|
"""Construct a Sandbox from an id and look up the Sandbox result.
|
|
@@ -243,7 +272,10 @@ class _Sandbox(modal._object._Object):
|
|
|
243
272
|
async def _experimental_snapshot(self) -> modal.snapshot._SandboxSnapshot: ...
|
|
244
273
|
@staticmethod
|
|
245
274
|
async def _experimental_from_snapshot(
|
|
246
|
-
snapshot: modal.snapshot._SandboxSnapshot,
|
|
275
|
+
snapshot: modal.snapshot._SandboxSnapshot,
|
|
276
|
+
client: typing.Optional[modal.client._Client] = None,
|
|
277
|
+
*,
|
|
278
|
+
name: typing.Optional[str] = _DEFAULT_SANDBOX_NAME_OVERRIDE,
|
|
247
279
|
): ...
|
|
248
280
|
@typing.overload
|
|
249
281
|
async def open(self, path: str, mode: _typeshed.OpenTextMode) -> modal.file_io._FileIO[str]: ...
|
|
@@ -335,6 +367,7 @@ class Sandbox(modal.object.Object):
|
|
|
335
367
|
entrypoint_args: collections.abc.Sequence[str],
|
|
336
368
|
image: modal.image.Image,
|
|
337
369
|
secrets: collections.abc.Sequence[modal.secret.Secret],
|
|
370
|
+
name: typing.Optional[str] = None,
|
|
338
371
|
timeout: typing.Optional[int] = None,
|
|
339
372
|
workdir: typing.Optional[str] = None,
|
|
340
373
|
gpu: typing.Union[None, str, modal.gpu._GPUConfig] = None,
|
|
@@ -368,6 +401,7 @@ class Sandbox(modal.object.Object):
|
|
|
368
401
|
/,
|
|
369
402
|
*entrypoint_args: str,
|
|
370
403
|
app: typing.Optional[modal.app.App] = None,
|
|
404
|
+
name: typing.Optional[str] = None,
|
|
371
405
|
image: typing.Optional[modal.image.Image] = None,
|
|
372
406
|
secrets: collections.abc.Sequence[modal.secret.Secret] = (),
|
|
373
407
|
network_file_systems: dict[
|
|
@@ -417,6 +451,7 @@ class Sandbox(modal.object.Object):
|
|
|
417
451
|
/,
|
|
418
452
|
*entrypoint_args: str,
|
|
419
453
|
app: typing.Optional[modal.app.App] = None,
|
|
454
|
+
name: typing.Optional[str] = None,
|
|
420
455
|
image: typing.Optional[modal.image.Image] = None,
|
|
421
456
|
secrets: collections.abc.Sequence[modal.secret.Secret] = (),
|
|
422
457
|
network_file_systems: dict[
|
|
@@ -469,6 +504,7 @@ class Sandbox(modal.object.Object):
|
|
|
469
504
|
/,
|
|
470
505
|
*entrypoint_args: str,
|
|
471
506
|
app: typing.Optional[modal.app.App] = None,
|
|
507
|
+
name: typing.Optional[str] = None,
|
|
472
508
|
image: typing.Optional[modal.image.Image] = None,
|
|
473
509
|
secrets: collections.abc.Sequence[modal.secret.Secret] = (),
|
|
474
510
|
mounts: collections.abc.Sequence[modal.mount.Mount] = (),
|
|
@@ -504,6 +540,7 @@ class Sandbox(modal.object.Object):
|
|
|
504
540
|
/,
|
|
505
541
|
*entrypoint_args: str,
|
|
506
542
|
app: typing.Optional[modal.app.App] = None,
|
|
543
|
+
name: typing.Optional[str] = None,
|
|
507
544
|
image: typing.Optional[modal.image.Image] = None,
|
|
508
545
|
secrets: collections.abc.Sequence[modal.secret.Secret] = (),
|
|
509
546
|
mounts: collections.abc.Sequence[modal.mount.Mount] = (),
|
|
@@ -539,6 +576,41 @@ class Sandbox(modal.object.Object):
|
|
|
539
576
|
|
|
540
577
|
def _hydrate_metadata(self, handle_metadata: typing.Optional[google.protobuf.message.Message]): ...
|
|
541
578
|
|
|
579
|
+
class __from_name_spec(typing_extensions.Protocol):
|
|
580
|
+
def __call__(
|
|
581
|
+
self,
|
|
582
|
+
/,
|
|
583
|
+
app_name: str,
|
|
584
|
+
name: str,
|
|
585
|
+
*,
|
|
586
|
+
environment_name: typing.Optional[str] = None,
|
|
587
|
+
client: typing.Optional[modal.client.Client] = None,
|
|
588
|
+
) -> Sandbox:
|
|
589
|
+
"""Get a running Sandbox by name from the given app.
|
|
590
|
+
|
|
591
|
+
Raises an error if no running sandbox is found with the given name. A Sandbox's name
|
|
592
|
+
is the `name` argument passed to `Sandbox.create`.
|
|
593
|
+
"""
|
|
594
|
+
...
|
|
595
|
+
|
|
596
|
+
async def aio(
|
|
597
|
+
self,
|
|
598
|
+
/,
|
|
599
|
+
app_name: str,
|
|
600
|
+
name: str,
|
|
601
|
+
*,
|
|
602
|
+
environment_name: typing.Optional[str] = None,
|
|
603
|
+
client: typing.Optional[modal.client.Client] = None,
|
|
604
|
+
) -> Sandbox:
|
|
605
|
+
"""Get a running Sandbox by name from the given app.
|
|
606
|
+
|
|
607
|
+
Raises an error if no running sandbox is found with the given name. A Sandbox's name
|
|
608
|
+
is the `name` argument passed to `Sandbox.create`.
|
|
609
|
+
"""
|
|
610
|
+
...
|
|
611
|
+
|
|
612
|
+
from_name: __from_name_spec
|
|
613
|
+
|
|
542
614
|
class __from_id_spec(typing_extensions.Protocol):
|
|
543
615
|
def __call__(self, /, sandbox_id: str, client: typing.Optional[modal.client.Client] = None) -> Sandbox:
|
|
544
616
|
"""Construct a Sandbox from an id and look up the Sandbox result.
|
|
@@ -753,10 +825,20 @@ class Sandbox(modal.object.Object):
|
|
|
753
825
|
|
|
754
826
|
class ___experimental_from_snapshot_spec(typing_extensions.Protocol):
|
|
755
827
|
def __call__(
|
|
756
|
-
self,
|
|
828
|
+
self,
|
|
829
|
+
/,
|
|
830
|
+
snapshot: modal.snapshot.SandboxSnapshot,
|
|
831
|
+
client: typing.Optional[modal.client.Client] = None,
|
|
832
|
+
*,
|
|
833
|
+
name: typing.Optional[str] = _DEFAULT_SANDBOX_NAME_OVERRIDE,
|
|
757
834
|
): ...
|
|
758
835
|
async def aio(
|
|
759
|
-
self,
|
|
836
|
+
self,
|
|
837
|
+
/,
|
|
838
|
+
snapshot: modal.snapshot.SandboxSnapshot,
|
|
839
|
+
client: typing.Optional[modal.client.Client] = None,
|
|
840
|
+
*,
|
|
841
|
+
name: typing.Optional[str] = _DEFAULT_SANDBOX_NAME_OVERRIDE,
|
|
760
842
|
): ...
|
|
761
843
|
|
|
762
844
|
_experimental_from_snapshot: ___experimental_from_snapshot_spec
|
|
@@ -3,7 +3,7 @@ modal/__main__.py,sha256=sTJcc9EbDuCKSwg3tL6ZckFw9WWdlkXW8mId1IvJCNc,2846
|
|
|
3
3
|
modal/_clustered_functions.py,sha256=kTf-9YBXY88NutC1akI-gCbvf01RhMPCw-zoOI_YIUE,2700
|
|
4
4
|
modal/_clustered_functions.pyi,sha256=_QKM87tdYwcALSGth8a0-9qXl02fZK6zMfEGEoYz7eA,1007
|
|
5
5
|
modal/_container_entrypoint.py,sha256=1qBMNY_E9ICC_sRCtillMxmKPsmxJl1J0_qOAG8rH-0,28288
|
|
6
|
-
modal/_functions.py,sha256=
|
|
6
|
+
modal/_functions.py,sha256=AjaKmH9hz_ii9VxdxPj4OGP5Hzjgq4iMCEJmw5R9ETg,82388
|
|
7
7
|
modal/_ipython.py,sha256=TW1fkVOmZL3YYqdS2YlM1hqpf654Yf8ZyybHdBnlhSw,301
|
|
8
8
|
modal/_location.py,sha256=joiX-0ZeutEUDTrrqLF1GHXCdVLF-rHzstocbMcd_-k,366
|
|
9
9
|
modal/_object.py,sha256=vzRWhAcFJDM8ZmiUSDgSj9gJhLZJA-wjLVvTl984N4A,11295
|
|
@@ -22,7 +22,7 @@ modal/app.py,sha256=BBR2NmGzZbFGfhKAmtzllD0o4TbVDBbOEs0O2ysSdQo,48277
|
|
|
22
22
|
modal/app.pyi,sha256=h6JtBA6a7wobdZAuS3QuXrWCUZqfyKPuGV3XdjCqT3k,43753
|
|
23
23
|
modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
|
|
24
24
|
modal/client.py,sha256=pBSZ7lv5dezIL9U9H4tpE0Yz6qA1n0NoNbnJ3KCQMMA,18252
|
|
25
|
-
modal/client.pyi,sha256=
|
|
25
|
+
modal/client.pyi,sha256=bJ0-hfTmZNW2pwpxalluOCn6JyXjmbExASplv-8ad6Y,15388
|
|
26
26
|
modal/cloud_bucket_mount.py,sha256=YOe9nnvSr4ZbeCn587d7_VhE9IioZYRvF9VYQTQux08,5914
|
|
27
27
|
modal/cloud_bucket_mount.pyi,sha256=-qSfYAQvIoO_l2wsCCGTG5ZUwQieNKXdAO00yP1-LYU,7394
|
|
28
28
|
modal/cls.py,sha256=7A0xGnugQzm8dOfnKMjLjtqekRlRtQ0jPFRYgq6xdUM,40018
|
|
@@ -65,8 +65,8 @@ modal/retries.py,sha256=IvNLDM0f_GLUDD5VgEDoN09C88yoxSrCquinAuxT1Sc,5205
|
|
|
65
65
|
modal/runner.py,sha256=ostdzYpQb-20tlD6dIq7bpWTkZkOhjJBNuMNektqnJA,24068
|
|
66
66
|
modal/runner.pyi,sha256=lbwLljm1cC8d6PcNvmYQhkE8501V9fg0bYqqKX6G4r4,8489
|
|
67
67
|
modal/running_app.py,sha256=v61mapYNV1-O-Uaho5EfJlryMLvIT9We0amUOSvSGx8,1188
|
|
68
|
-
modal/sandbox.py,sha256=
|
|
69
|
-
modal/sandbox.pyi,sha256=
|
|
68
|
+
modal/sandbox.py,sha256=o7LnaMDgfflE6gOvlCESoboFY6_BFZzBydoOhq91t3U,40469
|
|
69
|
+
modal/sandbox.pyi,sha256=SRCbHXMBpBT5PBvKuC2lOTv8YenQHk0lvRj8dAqV_X8,41743
|
|
70
70
|
modal/schedule.py,sha256=ng0g0AqNY5GQI9KhkXZQ5Wam5G42glbkqVQsNpBtbDE,3078
|
|
71
71
|
modal/scheduler_placement.py,sha256=BAREdOY5HzHpzSBqt6jDVR6YC_jYfHMVqOzkyqQfngU,1235
|
|
72
72
|
modal/secret.py,sha256=bpgtv0urwaBOmmJpMTZIwVWUraQlpeu4hW8pbJiGcOA,10546
|
|
@@ -97,7 +97,7 @@ modal/_utils/blob_utils.py,sha256=v2NAQVVGx1AQjHQ7-2T64x5rYtwjFFykxDXb-0grrzA,21
|
|
|
97
97
|
modal/_utils/bytes_io_segment_payload.py,sha256=vaXPq8b52-x6G2hwE7SrjS58pg_aRm7gV3bn3yjmTzQ,4261
|
|
98
98
|
modal/_utils/deprecation.py,sha256=-Bgg7jZdcJU8lROy18YyVnQYbM8hue-hVmwJqlWAGH0,5504
|
|
99
99
|
modal/_utils/docker_utils.py,sha256=h1uETghR40mp_y3fSWuZAfbIASH1HMzuphJHghAL6DU,3722
|
|
100
|
-
modal/_utils/function_utils.py,sha256=
|
|
100
|
+
modal/_utils/function_utils.py,sha256=9QIDlMpSKh3dH1lNZxTYIkTuGdt3WdiPrESzMhCwOFE,27320
|
|
101
101
|
modal/_utils/git_utils.py,sha256=qtUU6JAttF55ZxYq51y55OR58B0tDPZsZWK5dJe6W5g,3182
|
|
102
102
|
modal/_utils/grpc_testing.py,sha256=H1zHqthv19eGPJz2HKXDyWXWGSqO4BRsxah3L5Xaa8A,8619
|
|
103
103
|
modal/_utils/grpc_utils.py,sha256=HBZdMcBHCk6uozILYTjGnR0mV8fg7WOdJldoyZ-ZhSg,10137
|
|
@@ -151,7 +151,7 @@ modal/requirements/2025.06.txt,sha256=KxDaVTOwatHvboDo4lorlgJ7-n-MfAwbPwxJ0zcJqr
|
|
|
151
151
|
modal/requirements/PREVIEW.txt,sha256=KxDaVTOwatHvboDo4lorlgJ7-n-MfAwbPwxJ0zcJqrs,312
|
|
152
152
|
modal/requirements/README.md,sha256=9tK76KP0Uph7O0M5oUgsSwEZDj5y-dcUPsnpR0Sc-Ik,854
|
|
153
153
|
modal/requirements/base-images.json,sha256=JYSDAgHTl-WrV_TZW5icY-IJEnbe2eQ4CZ_KN6EOZKU,1304
|
|
154
|
-
modal-1.1.1.
|
|
154
|
+
modal-1.1.1.dev5.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
|
|
155
155
|
modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
|
|
156
156
|
modal_docs/gen_cli_docs.py,sha256=c1yfBS_x--gL5bs0N4ihMwqwX8l3IBWSkBAKNNIi6bQ,3801
|
|
157
157
|
modal_docs/gen_reference_docs.py,sha256=d_CQUGQ0rfw28u75I2mov9AlS773z9rG40-yq5o7g2U,6359
|
|
@@ -174,10 +174,10 @@ modal_proto/options_pb2.pyi,sha256=l7DBrbLO7q3Ir-XDkWsajm0d0TQqqrfuX54i4BMpdQg,1
|
|
|
174
174
|
modal_proto/options_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
|
|
175
175
|
modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0yJSI,247
|
|
176
176
|
modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
177
|
-
modal_version/__init__.py,sha256=
|
|
177
|
+
modal_version/__init__.py,sha256=PJ10s1xJiHCSn1n75gwj0-eWWGXm8lDWZcaoIdkFv94,120
|
|
178
178
|
modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
|
|
179
|
-
modal-1.1.1.
|
|
180
|
-
modal-1.1.1.
|
|
181
|
-
modal-1.1.1.
|
|
182
|
-
modal-1.1.1.
|
|
183
|
-
modal-1.1.1.
|
|
179
|
+
modal-1.1.1.dev5.dist-info/METADATA,sha256=m7ULzpsU9JHWRbmnFBQSYiKfjJ8VpqYyCm4L1gZN234,2461
|
|
180
|
+
modal-1.1.1.dev5.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
|
181
|
+
modal-1.1.1.dev5.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
|
|
182
|
+
modal-1.1.1.dev5.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
|
|
183
|
+
modal-1.1.1.dev5.dist-info/RECORD,,
|
modal_version/__init__.py
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|