modal 1.1.5.dev66__py3-none-any.whl → 1.3.1.dev8__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/__init__.py +4 -4
- modal/__main__.py +4 -29
- modal/_billing.py +84 -0
- modal/_clustered_functions.py +1 -3
- modal/_container_entrypoint.py +33 -208
- modal/_functions.py +171 -138
- modal/_grpc_client.py +191 -0
- modal/_ipython.py +16 -6
- modal/_load_context.py +106 -0
- modal/_object.py +72 -21
- modal/_output.py +12 -14
- modal/_partial_function.py +31 -4
- modal/_resolver.py +44 -57
- modal/_runtime/container_io_manager.py +30 -28
- modal/_runtime/container_io_manager.pyi +42 -44
- modal/_runtime/gpu_memory_snapshot.py +9 -7
- modal/_runtime/user_code_event_loop.py +80 -0
- modal/_runtime/user_code_imports.py +236 -10
- modal/_serialization.py +2 -1
- modal/_traceback.py +4 -13
- modal/_tunnel.py +16 -11
- modal/_tunnel.pyi +25 -3
- modal/_utils/async_utils.py +337 -10
- modal/_utils/auth_token_manager.py +1 -4
- modal/_utils/blob_utils.py +29 -22
- modal/_utils/function_utils.py +20 -21
- modal/_utils/grpc_testing.py +6 -3
- modal/_utils/grpc_utils.py +223 -64
- modal/_utils/mount_utils.py +26 -1
- modal/_utils/name_utils.py +2 -3
- modal/_utils/package_utils.py +0 -1
- modal/_utils/rand_pb_testing.py +8 -1
- modal/_utils/task_command_router_client.py +524 -0
- modal/_vendor/cloudpickle.py +144 -48
- modal/app.py +285 -105
- modal/app.pyi +216 -53
- modal/billing.py +5 -0
- modal/builder/2025.06.txt +6 -3
- modal/builder/PREVIEW.txt +2 -1
- modal/builder/base-images.json +4 -2
- modal/cli/_download.py +19 -3
- modal/cli/cluster.py +4 -2
- modal/cli/config.py +3 -1
- modal/cli/container.py +5 -4
- modal/cli/dict.py +5 -2
- modal/cli/entry_point.py +26 -2
- modal/cli/environment.py +2 -16
- modal/cli/launch.py +1 -76
- modal/cli/network_file_system.py +5 -20
- modal/cli/programs/run_jupyter.py +1 -1
- modal/cli/programs/vscode.py +1 -1
- modal/cli/queues.py +5 -4
- modal/cli/run.py +24 -204
- modal/cli/secret.py +1 -2
- modal/cli/shell.py +375 -0
- modal/cli/utils.py +1 -13
- modal/cli/volume.py +11 -17
- modal/client.py +16 -125
- modal/client.pyi +94 -144
- modal/cloud_bucket_mount.py +3 -1
- modal/cloud_bucket_mount.pyi +4 -0
- modal/cls.py +101 -64
- modal/cls.pyi +9 -8
- modal/config.py +21 -1
- modal/container_process.py +288 -12
- modal/container_process.pyi +99 -38
- modal/dict.py +72 -33
- modal/dict.pyi +88 -57
- modal/environments.py +16 -8
- modal/environments.pyi +6 -2
- modal/exception.py +154 -16
- modal/experimental/__init__.py +24 -53
- modal/experimental/flash.py +161 -74
- modal/experimental/flash.pyi +97 -49
- modal/file_io.py +50 -92
- modal/file_io.pyi +117 -89
- modal/functions.pyi +70 -87
- modal/image.py +82 -47
- modal/image.pyi +51 -30
- modal/io_streams.py +500 -149
- modal/io_streams.pyi +279 -189
- modal/mount.py +60 -46
- modal/mount.pyi +41 -17
- modal/network_file_system.py +19 -11
- modal/network_file_system.pyi +72 -39
- modal/object.pyi +114 -22
- modal/parallel_map.py +42 -44
- modal/parallel_map.pyi +9 -17
- modal/partial_function.pyi +4 -2
- modal/proxy.py +14 -6
- modal/proxy.pyi +10 -2
- modal/queue.py +45 -38
- modal/queue.pyi +88 -52
- modal/runner.py +96 -96
- modal/runner.pyi +44 -27
- modal/sandbox.py +225 -107
- modal/sandbox.pyi +226 -60
- modal/secret.py +58 -56
- modal/secret.pyi +28 -13
- modal/serving.py +7 -11
- modal/serving.pyi +7 -8
- modal/snapshot.py +29 -15
- modal/snapshot.pyi +18 -10
- modal/token_flow.py +1 -1
- modal/token_flow.pyi +4 -6
- modal/volume.py +102 -55
- modal/volume.pyi +125 -66
- {modal-1.1.5.dev66.dist-info → modal-1.3.1.dev8.dist-info}/METADATA +10 -9
- modal-1.3.1.dev8.dist-info/RECORD +189 -0
- modal_proto/api.proto +141 -70
- modal_proto/api_grpc.py +42 -26
- modal_proto/api_pb2.py +1123 -1103
- modal_proto/api_pb2.pyi +331 -83
- modal_proto/api_pb2_grpc.py +80 -48
- modal_proto/api_pb2_grpc.pyi +26 -18
- modal_proto/modal_api_grpc.py +175 -174
- modal_proto/task_command_router.proto +164 -0
- modal_proto/task_command_router_grpc.py +138 -0
- modal_proto/task_command_router_pb2.py +180 -0
- modal_proto/{sandbox_router_pb2.pyi → task_command_router_pb2.pyi} +148 -57
- modal_proto/task_command_router_pb2_grpc.py +272 -0
- modal_proto/task_command_router_pb2_grpc.pyi +100 -0
- modal_version/__init__.py +1 -1
- modal_version/__main__.py +1 -1
- modal/cli/programs/launch_instance_ssh.py +0 -94
- modal/cli/programs/run_marimo.py +0 -95
- modal-1.1.5.dev66.dist-info/RECORD +0 -191
- modal_proto/modal_options_grpc.py +0 -3
- modal_proto/options.proto +0 -19
- modal_proto/options_grpc.py +0 -3
- modal_proto/options_pb2.py +0 -35
- modal_proto/options_pb2.pyi +0 -20
- modal_proto/options_pb2_grpc.py +0 -4
- modal_proto/options_pb2_grpc.pyi +0 -7
- modal_proto/sandbox_router.proto +0 -125
- modal_proto/sandbox_router_grpc.py +0 -89
- modal_proto/sandbox_router_pb2.py +0 -128
- modal_proto/sandbox_router_pb2_grpc.py +0 -169
- modal_proto/sandbox_router_pb2_grpc.pyi +0 -63
- {modal-1.1.5.dev66.dist-info → modal-1.3.1.dev8.dist-info}/WHEEL +0 -0
- {modal-1.1.5.dev66.dist-info → modal-1.3.1.dev8.dist-info}/entry_points.txt +0 -0
- {modal-1.1.5.dev66.dist-info → modal-1.3.1.dev8.dist-info}/licenses/LICENSE +0 -0
- {modal-1.1.5.dev66.dist-info → modal-1.3.1.dev8.dist-info}/top_level.txt +0 -0
modal/client.pyi
CHANGED
|
@@ -5,7 +5,6 @@ import google.protobuf.message
|
|
|
5
5
|
import grpclib.client
|
|
6
6
|
import modal._utils.async_utils
|
|
7
7
|
import modal._utils.auth_token_manager
|
|
8
|
-
import modal_proto.api_grpc
|
|
9
8
|
import modal_proto.modal_api_grpc
|
|
10
9
|
import synchronicity.combined_types
|
|
11
10
|
import typing
|
|
@@ -23,17 +22,18 @@ class _Client:
|
|
|
23
22
|
_client_from_env: typing.ClassVar[typing.Optional[_Client]]
|
|
24
23
|
_client_from_env_lock: typing.ClassVar[typing.Optional[asyncio.locks.Lock]]
|
|
25
24
|
_cancellation_context: modal._utils.async_utils.TaskContext
|
|
26
|
-
_cancellation_context_event_loop: asyncio.events.AbstractEventLoop
|
|
27
|
-
_stub: typing.Optional[modal_proto.
|
|
28
|
-
_auth_token_manager: modal._utils.auth_token_manager._AuthTokenManager
|
|
25
|
+
_cancellation_context_event_loop: typing.Optional[asyncio.events.AbstractEventLoop]
|
|
26
|
+
_stub: typing.Optional[modal_proto.modal_api_grpc.ModalClientModal]
|
|
27
|
+
_auth_token_manager: typing.Optional[modal._utils.auth_token_manager._AuthTokenManager]
|
|
29
28
|
_snapshotted: bool
|
|
29
|
+
client_type: int
|
|
30
30
|
|
|
31
31
|
def __init__(
|
|
32
32
|
self,
|
|
33
33
|
server_url: str,
|
|
34
34
|
client_type: int,
|
|
35
35
|
credentials: typing.Optional[tuple[str, str]],
|
|
36
|
-
version: str = "1.1.
|
|
36
|
+
version: str = "1.3.1.dev8",
|
|
37
37
|
):
|
|
38
38
|
"""mdmd:hidden
|
|
39
39
|
The Modal client object is not intended to be instantiated directly by users.
|
|
@@ -148,23 +148,22 @@ class _Client:
|
|
|
148
148
|
],
|
|
149
149
|
) -> collections.abc.AsyncGenerator[typing.Any, None]: ...
|
|
150
150
|
|
|
151
|
-
SUPERSELF = typing.TypeVar("SUPERSELF", covariant=True)
|
|
152
|
-
|
|
153
151
|
class Client:
|
|
154
152
|
_client_from_env: typing.ClassVar[typing.Optional[Client]]
|
|
155
153
|
_client_from_env_lock: typing.ClassVar[typing.Optional[asyncio.locks.Lock]]
|
|
156
154
|
_cancellation_context: modal._utils.async_utils.TaskContext
|
|
157
|
-
_cancellation_context_event_loop: asyncio.events.AbstractEventLoop
|
|
158
|
-
_stub: typing.Optional[modal_proto.
|
|
159
|
-
_auth_token_manager: modal._utils.auth_token_manager._AuthTokenManager
|
|
155
|
+
_cancellation_context_event_loop: typing.Optional[asyncio.events.AbstractEventLoop]
|
|
156
|
+
_stub: typing.Optional[modal_proto.modal_api_grpc.ModalClientModal]
|
|
157
|
+
_auth_token_manager: typing.Optional[modal._utils.auth_token_manager._AuthTokenManager]
|
|
160
158
|
_snapshotted: bool
|
|
159
|
+
client_type: int
|
|
161
160
|
|
|
162
161
|
def __init__(
|
|
163
162
|
self,
|
|
164
163
|
server_url: str,
|
|
165
164
|
client_type: int,
|
|
166
165
|
credentials: typing.Optional[tuple[str, str]],
|
|
167
|
-
version: str = "1.1.
|
|
166
|
+
version: str = "1.3.1.dev8",
|
|
168
167
|
):
|
|
169
168
|
"""mdmd:hidden
|
|
170
169
|
The Modal client object is not intended to be instantiated directly by users.
|
|
@@ -184,7 +183,7 @@ class Client:
|
|
|
184
183
|
"""
|
|
185
184
|
...
|
|
186
185
|
|
|
187
|
-
class __get_stub_spec(typing_extensions.Protocol
|
|
186
|
+
class __get_stub_spec(typing_extensions.Protocol):
|
|
188
187
|
def __call__(self, /, server_url: str) -> modal_proto.modal_api_grpc.ModalClientModal:
|
|
189
188
|
"""mdmd:hidden
|
|
190
189
|
Get a stub for a specific server URL. Stubs can safely be used across forks / client snapshots.
|
|
@@ -207,21 +206,21 @@ class Client:
|
|
|
207
206
|
"""
|
|
208
207
|
...
|
|
209
208
|
|
|
210
|
-
get_stub: __get_stub_spec
|
|
209
|
+
get_stub: __get_stub_spec
|
|
211
210
|
|
|
212
|
-
class ___open_spec(typing_extensions.Protocol
|
|
211
|
+
class ___open_spec(typing_extensions.Protocol):
|
|
213
212
|
def __call__(self, /): ...
|
|
214
213
|
async def aio(self, /): ...
|
|
215
214
|
|
|
216
|
-
_open: ___open_spec
|
|
215
|
+
_open: ___open_spec
|
|
217
216
|
|
|
218
|
-
class ___close_spec(typing_extensions.Protocol
|
|
217
|
+
class ___close_spec(typing_extensions.Protocol):
|
|
219
218
|
def __call__(self, /, prep_for_restore: bool = False): ...
|
|
220
219
|
async def aio(self, /, prep_for_restore: bool = False): ...
|
|
221
220
|
|
|
222
|
-
_close: ___close_spec
|
|
221
|
+
_close: ___close_spec
|
|
223
222
|
|
|
224
|
-
class __hello_spec(typing_extensions.Protocol
|
|
223
|
+
class __hello_spec(typing_extensions.Protocol):
|
|
225
224
|
def __call__(self, /):
|
|
226
225
|
"""Connect to server and retrieve version information; raise appropriate error for various failures."""
|
|
227
226
|
...
|
|
@@ -230,59 +229,99 @@ class Client:
|
|
|
230
229
|
"""Connect to server and retrieve version information; raise appropriate error for various failures."""
|
|
231
230
|
...
|
|
232
231
|
|
|
233
|
-
hello: __hello_spec
|
|
232
|
+
hello: __hello_spec
|
|
234
233
|
|
|
235
234
|
def __enter__(self): ...
|
|
236
235
|
async def __aenter__(self): ...
|
|
237
236
|
def __exit__(self, exc_type, exc, tb): ...
|
|
238
237
|
async def __aexit__(self, exc_type, exc, tb): ...
|
|
239
|
-
@classmethod
|
|
240
|
-
def anonymous(cls, server_url: str) -> synchronicity.combined_types.AsyncAndBlockingContextManager[Client]:
|
|
241
|
-
"""mdmd:hidden
|
|
242
|
-
Create a connection with no credentials; to be used for token creation.
|
|
243
|
-
"""
|
|
244
|
-
...
|
|
245
238
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
239
|
+
class __anonymous_spec(typing_extensions.Protocol):
|
|
240
|
+
def __call__(self, /, server_url: str) -> synchronicity.combined_types.AsyncAndBlockingContextManager[Client]:
|
|
241
|
+
"""mdmd:hidden
|
|
242
|
+
Create a connection with no credentials; to be used for token creation.
|
|
243
|
+
"""
|
|
244
|
+
...
|
|
252
245
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
246
|
+
def aio(self, /, server_url: str) -> typing.AsyncContextManager[Client]:
|
|
247
|
+
"""mdmd:hidden
|
|
248
|
+
Create a connection with no credentials; to be used for token creation.
|
|
249
|
+
"""
|
|
250
|
+
...
|
|
256
251
|
|
|
257
|
-
|
|
252
|
+
anonymous: typing.ClassVar[__anonymous_spec]
|
|
258
253
|
|
|
259
|
-
|
|
260
|
-
|
|
254
|
+
class __from_env_spec(typing_extensions.Protocol):
|
|
255
|
+
def __call__(self, /, _override_config=None) -> Client:
|
|
256
|
+
"""mdmd:hidden
|
|
257
|
+
Singleton that is instantiated from the Modal config and reused on subsequent calls.
|
|
258
|
+
"""
|
|
259
|
+
...
|
|
261
260
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
261
|
+
async def aio(self, /, _override_config=None) -> Client:
|
|
262
|
+
"""mdmd:hidden
|
|
263
|
+
Singleton that is instantiated from the Modal config and reused on subsequent calls.
|
|
264
|
+
"""
|
|
265
|
+
...
|
|
266
266
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
267
|
+
from_env: typing.ClassVar[__from_env_spec]
|
|
268
|
+
|
|
269
|
+
class __from_credentials_spec(typing_extensions.Protocol):
|
|
270
|
+
def __call__(self, /, token_id: str, token_secret: str) -> Client:
|
|
271
|
+
"""Constructor based on token credentials; useful for managing Modal on behalf of third-party users.
|
|
272
|
+
|
|
273
|
+
**Usage:**
|
|
274
|
+
|
|
275
|
+
```python notest
|
|
276
|
+
client = modal.Client.from_credentials("my_token_id", "my_token_secret")
|
|
277
|
+
|
|
278
|
+
modal.Sandbox.create("echo", "hi", client=client, app=app)
|
|
279
|
+
```
|
|
280
|
+
"""
|
|
281
|
+
...
|
|
282
|
+
|
|
283
|
+
async def aio(self, /, token_id: str, token_secret: str) -> Client:
|
|
284
|
+
"""Constructor based on token credentials; useful for managing Modal on behalf of third-party users.
|
|
285
|
+
|
|
286
|
+
**Usage:**
|
|
287
|
+
|
|
288
|
+
```python notest
|
|
289
|
+
client = modal.Client.from_credentials("my_token_id", "my_token_secret")
|
|
290
|
+
|
|
291
|
+
modal.Sandbox.create("echo", "hi", client=client, app=app)
|
|
292
|
+
```
|
|
293
|
+
"""
|
|
294
|
+
...
|
|
295
|
+
|
|
296
|
+
from_credentials: typing.ClassVar[__from_credentials_spec]
|
|
297
|
+
|
|
298
|
+
class __verify_spec(typing_extensions.Protocol):
|
|
299
|
+
def __call__(self, /, server_url: str, credentials: tuple[str, str]) -> None:
|
|
300
|
+
"""mdmd:hidden
|
|
301
|
+
Check whether can the client can connect to this server with these credentials; raise if not.
|
|
302
|
+
"""
|
|
303
|
+
...
|
|
304
|
+
|
|
305
|
+
async def aio(self, /, server_url: str, credentials: tuple[str, str]) -> None:
|
|
306
|
+
"""mdmd:hidden
|
|
307
|
+
Check whether can the client can connect to this server with these credentials; raise if not.
|
|
308
|
+
"""
|
|
309
|
+
...
|
|
310
|
+
|
|
311
|
+
verify: typing.ClassVar[__verify_spec]
|
|
273
312
|
|
|
274
313
|
@classmethod
|
|
275
314
|
def set_env_client(cls, client: typing.Optional[Client]):
|
|
276
315
|
"""mdmd:hidden"""
|
|
277
316
|
...
|
|
278
317
|
|
|
279
|
-
class __get_input_plane_metadata_spec(typing_extensions.Protocol
|
|
318
|
+
class __get_input_plane_metadata_spec(typing_extensions.Protocol):
|
|
280
319
|
def __call__(self, /, input_plane_region: str) -> list[tuple[str, str]]: ...
|
|
281
320
|
async def aio(self, /, input_plane_region: str) -> list[tuple[str, str]]: ...
|
|
282
321
|
|
|
283
|
-
get_input_plane_metadata: __get_input_plane_metadata_spec
|
|
322
|
+
get_input_plane_metadata: __get_input_plane_metadata_spec
|
|
284
323
|
|
|
285
|
-
class ___call_safely_spec(typing_extensions.Protocol
|
|
324
|
+
class ___call_safely_spec(typing_extensions.Protocol):
|
|
286
325
|
def __call__(self, /, coro, readable_method: str):
|
|
287
326
|
"""Runs coroutine wrapped in a task that's part of the client's task context
|
|
288
327
|
|
|
@@ -301,19 +340,19 @@ class Client:
|
|
|
301
340
|
"""
|
|
302
341
|
...
|
|
303
342
|
|
|
304
|
-
_call_safely: ___call_safely_spec
|
|
343
|
+
_call_safely: ___call_safely_spec
|
|
305
344
|
|
|
306
|
-
class ___reset_on_pid_change_spec(typing_extensions.Protocol
|
|
345
|
+
class ___reset_on_pid_change_spec(typing_extensions.Protocol):
|
|
307
346
|
def __call__(self, /): ...
|
|
308
347
|
async def aio(self, /): ...
|
|
309
348
|
|
|
310
|
-
_reset_on_pid_change: ___reset_on_pid_change_spec
|
|
349
|
+
_reset_on_pid_change: ___reset_on_pid_change_spec
|
|
311
350
|
|
|
312
|
-
class ___get_channel_spec(typing_extensions.Protocol
|
|
351
|
+
class ___get_channel_spec(typing_extensions.Protocol):
|
|
313
352
|
def __call__(self, /, server_url: str) -> grpclib.client.Channel: ...
|
|
314
353
|
async def aio(self, /, server_url: str) -> grpclib.client.Channel: ...
|
|
315
354
|
|
|
316
|
-
_get_channel: ___get_channel_spec
|
|
355
|
+
_get_channel: ___get_channel_spec
|
|
317
356
|
|
|
318
357
|
async def _call_unary(
|
|
319
358
|
self,
|
|
@@ -339,95 +378,6 @@ class Client:
|
|
|
339
378
|
],
|
|
340
379
|
) -> collections.abc.AsyncGenerator[typing.Any, None]: ...
|
|
341
380
|
|
|
342
|
-
class grpc_error_converter:
|
|
343
|
-
def __enter__(self): ...
|
|
344
|
-
def __exit__(self, exc_type, exc, traceback) -> bool: ...
|
|
345
|
-
|
|
346
|
-
class UnaryUnaryWrapper(typing.Generic[RequestType, ResponseType]):
|
|
347
|
-
"""Abstract base class for generic types.
|
|
348
|
-
|
|
349
|
-
A generic type is typically declared by inheriting from
|
|
350
|
-
this class parameterized with one or more type variables.
|
|
351
|
-
For example, a generic mapping type might be defined as::
|
|
352
|
-
|
|
353
|
-
class Mapping(Generic[KT, VT]):
|
|
354
|
-
def __getitem__(self, key: KT) -> VT:
|
|
355
|
-
...
|
|
356
|
-
# Etc.
|
|
357
|
-
|
|
358
|
-
This class can then be used as follows::
|
|
359
|
-
|
|
360
|
-
def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
|
|
361
|
-
try:
|
|
362
|
-
return mapping[key]
|
|
363
|
-
except KeyError:
|
|
364
|
-
return default
|
|
365
|
-
"""
|
|
366
|
-
|
|
367
|
-
wrapped_method: grpclib.client.UnaryUnaryMethod[RequestType, ResponseType]
|
|
368
|
-
client: _Client
|
|
369
|
-
|
|
370
|
-
def __init__(
|
|
371
|
-
self,
|
|
372
|
-
wrapped_method: grpclib.client.UnaryUnaryMethod[RequestType, ResponseType],
|
|
373
|
-
client: _Client,
|
|
374
|
-
server_url: str,
|
|
375
|
-
):
|
|
376
|
-
"""Initialize self. See help(type(self)) for accurate signature."""
|
|
377
|
-
...
|
|
378
|
-
|
|
379
|
-
@property
|
|
380
|
-
def name(self) -> str: ...
|
|
381
|
-
async def __call__(
|
|
382
|
-
self,
|
|
383
|
-
req: RequestType,
|
|
384
|
-
*,
|
|
385
|
-
timeout: typing.Optional[float] = None,
|
|
386
|
-
metadata: typing.Union[
|
|
387
|
-
collections.abc.Mapping[str, typing.Union[str, bytes]],
|
|
388
|
-
collections.abc.Collection[tuple[str, typing.Union[str, bytes]]],
|
|
389
|
-
None,
|
|
390
|
-
] = None,
|
|
391
|
-
) -> ResponseType:
|
|
392
|
-
"""Call self as a function."""
|
|
393
|
-
...
|
|
394
|
-
|
|
395
|
-
class UnaryStreamWrapper(typing.Generic[RequestType, ResponseType]):
|
|
396
|
-
"""Abstract base class for generic types.
|
|
397
|
-
|
|
398
|
-
A generic type is typically declared by inheriting from
|
|
399
|
-
this class parameterized with one or more type variables.
|
|
400
|
-
For example, a generic mapping type might be defined as::
|
|
401
|
-
|
|
402
|
-
class Mapping(Generic[KT, VT]):
|
|
403
|
-
def __getitem__(self, key: KT) -> VT:
|
|
404
|
-
...
|
|
405
|
-
# Etc.
|
|
406
|
-
|
|
407
|
-
This class can then be used as follows::
|
|
408
|
-
|
|
409
|
-
def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
|
|
410
|
-
try:
|
|
411
|
-
return mapping[key]
|
|
412
|
-
except KeyError:
|
|
413
|
-
return default
|
|
414
|
-
"""
|
|
415
|
-
|
|
416
|
-
wrapped_method: grpclib.client.UnaryStreamMethod[RequestType, ResponseType]
|
|
417
|
-
|
|
418
|
-
def __init__(
|
|
419
|
-
self,
|
|
420
|
-
wrapped_method: grpclib.client.UnaryStreamMethod[RequestType, ResponseType],
|
|
421
|
-
client: _Client,
|
|
422
|
-
server_url: str,
|
|
423
|
-
):
|
|
424
|
-
"""Initialize self. See help(type(self)) for accurate signature."""
|
|
425
|
-
...
|
|
426
|
-
|
|
427
|
-
@property
|
|
428
|
-
def name(self) -> str: ...
|
|
429
|
-
def unary_stream(self, request, metadata: typing.Optional[typing.Any] = None): ...
|
|
430
|
-
|
|
431
381
|
HEARTBEAT_INTERVAL: float
|
|
432
382
|
|
|
433
383
|
HEARTBEAT_TIMEOUT: float
|
modal/cloud_bucket_mount.py
CHANGED
|
@@ -117,6 +117,7 @@ class _CloudBucketMount:
|
|
|
117
117
|
|
|
118
118
|
read_only: bool = False
|
|
119
119
|
requester_pays: bool = False
|
|
120
|
+
force_path_style: bool = False
|
|
120
121
|
|
|
121
122
|
|
|
122
123
|
def cloud_bucket_mounts_to_proto(mounts: Sequence[tuple[str, _CloudBucketMount]]) -> list[api_pb2.CloudBucketMount]:
|
|
@@ -132,7 +133,7 @@ def cloud_bucket_mounts_to_proto(mounts: Sequence[tuple[str, _CloudBucketMount]]
|
|
|
132
133
|
elif parse_result.hostname.endswith("storage.googleapis.com"):
|
|
133
134
|
bucket_type = api_pb2.CloudBucketMount.BucketType.GCP
|
|
134
135
|
else:
|
|
135
|
-
logger.
|
|
136
|
+
logger.info(
|
|
136
137
|
"CloudBucketMount received unrecognized bucket endpoint URL. "
|
|
137
138
|
"Assuming AWS S3 configuration as fallback."
|
|
138
139
|
)
|
|
@@ -159,6 +160,7 @@ def cloud_bucket_mounts_to_proto(mounts: Sequence[tuple[str, _CloudBucketMount]]
|
|
|
159
160
|
requester_pays=mount.requester_pays,
|
|
160
161
|
key_prefix=key_prefix,
|
|
161
162
|
oidc_auth_role_arn=mount.oidc_auth_role_arn,
|
|
163
|
+
force_path_style=mount.force_path_style,
|
|
162
164
|
)
|
|
163
165
|
cloud_bucket_mounts.append(cloud_bucket_mount)
|
|
164
166
|
|
modal/cloud_bucket_mount.pyi
CHANGED
|
@@ -99,6 +99,7 @@ class _CloudBucketMount:
|
|
|
99
99
|
oidc_auth_role_arn: typing.Optional[str]
|
|
100
100
|
read_only: bool
|
|
101
101
|
requester_pays: bool
|
|
102
|
+
force_path_style: bool
|
|
102
103
|
|
|
103
104
|
def __init__(
|
|
104
105
|
self,
|
|
@@ -109,6 +110,7 @@ class _CloudBucketMount:
|
|
|
109
110
|
oidc_auth_role_arn: typing.Optional[str] = None,
|
|
110
111
|
read_only: bool = False,
|
|
111
112
|
requester_pays: bool = False,
|
|
113
|
+
force_path_style: bool = False,
|
|
112
114
|
) -> None:
|
|
113
115
|
"""Initialize self. See help(type(self)) for accurate signature."""
|
|
114
116
|
...
|
|
@@ -224,6 +226,7 @@ class CloudBucketMount:
|
|
|
224
226
|
oidc_auth_role_arn: typing.Optional[str]
|
|
225
227
|
read_only: bool
|
|
226
228
|
requester_pays: bool
|
|
229
|
+
force_path_style: bool
|
|
227
230
|
|
|
228
231
|
def __init__(
|
|
229
232
|
self,
|
|
@@ -234,6 +237,7 @@ class CloudBucketMount:
|
|
|
234
237
|
oidc_auth_role_arn: typing.Optional[str] = None,
|
|
235
238
|
read_only: bool = False,
|
|
236
239
|
requester_pays: bool = False,
|
|
240
|
+
force_path_style: bool = False,
|
|
237
241
|
) -> None: ...
|
|
238
242
|
def __repr__(self): ...
|
|
239
243
|
def __eq__(self, other): ...
|