modal 0.62.115__py3-none-any.whl → 0.72.13__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.
Files changed (220) hide show
  1. modal/__init__.py +13 -9
  2. modal/__main__.py +41 -3
  3. modal/_clustered_functions.py +80 -0
  4. modal/_clustered_functions.pyi +22 -0
  5. modal/_container_entrypoint.py +402 -398
  6. modal/_ipython.py +3 -13
  7. modal/_location.py +17 -10
  8. modal/_output.py +243 -99
  9. modal/_pty.py +2 -2
  10. modal/_resolver.py +55 -60
  11. modal/_resources.py +26 -7
  12. modal/_runtime/__init__.py +1 -0
  13. modal/_runtime/asgi.py +519 -0
  14. modal/_runtime/container_io_manager.py +1025 -0
  15. modal/{execution_context.py → _runtime/execution_context.py} +11 -2
  16. modal/_runtime/telemetry.py +169 -0
  17. modal/_runtime/user_code_imports.py +356 -0
  18. modal/_serialization.py +123 -6
  19. modal/_traceback.py +47 -187
  20. modal/_tunnel.py +50 -14
  21. modal/_tunnel.pyi +19 -36
  22. modal/_utils/app_utils.py +3 -17
  23. modal/_utils/async_utils.py +386 -104
  24. modal/_utils/blob_utils.py +157 -186
  25. modal/_utils/bytes_io_segment_payload.py +97 -0
  26. modal/_utils/deprecation.py +89 -0
  27. modal/_utils/docker_utils.py +98 -0
  28. modal/_utils/function_utils.py +299 -98
  29. modal/_utils/grpc_testing.py +47 -34
  30. modal/_utils/grpc_utils.py +54 -21
  31. modal/_utils/hash_utils.py +51 -10
  32. modal/_utils/http_utils.py +39 -9
  33. modal/_utils/logger.py +2 -1
  34. modal/_utils/mount_utils.py +34 -16
  35. modal/_utils/name_utils.py +58 -0
  36. modal/_utils/package_utils.py +14 -1
  37. modal/_utils/pattern_utils.py +205 -0
  38. modal/_utils/rand_pb_testing.py +3 -3
  39. modal/_utils/shell_utils.py +15 -49
  40. modal/_vendor/a2wsgi_wsgi.py +62 -72
  41. modal/_vendor/cloudpickle.py +1 -1
  42. modal/_watcher.py +12 -10
  43. modal/app.py +561 -323
  44. modal/app.pyi +474 -262
  45. modal/call_graph.py +7 -6
  46. modal/cli/_download.py +22 -6
  47. modal/cli/_traceback.py +200 -0
  48. modal/cli/app.py +203 -42
  49. modal/cli/config.py +12 -5
  50. modal/cli/container.py +61 -13
  51. modal/cli/dict.py +128 -0
  52. modal/cli/entry_point.py +26 -13
  53. modal/cli/environment.py +40 -9
  54. modal/cli/import_refs.py +21 -48
  55. modal/cli/launch.py +28 -14
  56. modal/cli/network_file_system.py +57 -21
  57. modal/cli/profile.py +1 -1
  58. modal/cli/programs/run_jupyter.py +34 -9
  59. modal/cli/programs/vscode.py +58 -8
  60. modal/cli/queues.py +131 -0
  61. modal/cli/run.py +199 -96
  62. modal/cli/secret.py +5 -4
  63. modal/cli/token.py +7 -2
  64. modal/cli/utils.py +74 -8
  65. modal/cli/volume.py +97 -56
  66. modal/client.py +248 -144
  67. modal/client.pyi +156 -124
  68. modal/cloud_bucket_mount.py +43 -30
  69. modal/cloud_bucket_mount.pyi +32 -25
  70. modal/cls.py +528 -141
  71. modal/cls.pyi +189 -145
  72. modal/config.py +32 -15
  73. modal/container_process.py +177 -0
  74. modal/container_process.pyi +82 -0
  75. modal/dict.py +50 -54
  76. modal/dict.pyi +120 -164
  77. modal/environments.py +106 -5
  78. modal/environments.pyi +77 -25
  79. modal/exception.py +30 -43
  80. modal/experimental.py +62 -2
  81. modal/file_io.py +537 -0
  82. modal/file_io.pyi +235 -0
  83. modal/file_pattern_matcher.py +196 -0
  84. modal/functions.py +846 -428
  85. modal/functions.pyi +446 -387
  86. modal/gpu.py +57 -44
  87. modal/image.py +943 -417
  88. modal/image.pyi +584 -245
  89. modal/io_streams.py +434 -0
  90. modal/io_streams.pyi +122 -0
  91. modal/mount.py +223 -90
  92. modal/mount.pyi +241 -243
  93. modal/network_file_system.py +85 -86
  94. modal/network_file_system.pyi +151 -110
  95. modal/object.py +66 -36
  96. modal/object.pyi +166 -143
  97. modal/output.py +63 -0
  98. modal/parallel_map.py +73 -47
  99. modal/parallel_map.pyi +51 -63
  100. modal/partial_function.py +272 -107
  101. modal/partial_function.pyi +219 -120
  102. modal/proxy.py +15 -12
  103. modal/proxy.pyi +3 -8
  104. modal/queue.py +96 -72
  105. modal/queue.pyi +210 -135
  106. modal/requirements/2024.04.txt +2 -1
  107. modal/requirements/2024.10.txt +16 -0
  108. modal/requirements/README.md +21 -0
  109. modal/requirements/base-images.json +22 -0
  110. modal/retries.py +45 -4
  111. modal/runner.py +325 -203
  112. modal/runner.pyi +124 -110
  113. modal/running_app.py +27 -4
  114. modal/sandbox.py +509 -231
  115. modal/sandbox.pyi +396 -169
  116. modal/schedule.py +2 -2
  117. modal/scheduler_placement.py +20 -3
  118. modal/secret.py +41 -25
  119. modal/secret.pyi +62 -42
  120. modal/serving.py +39 -49
  121. modal/serving.pyi +37 -43
  122. modal/stream_type.py +15 -0
  123. modal/token_flow.py +5 -3
  124. modal/token_flow.pyi +37 -32
  125. modal/volume.py +123 -137
  126. modal/volume.pyi +228 -221
  127. {modal-0.62.115.dist-info → modal-0.72.13.dist-info}/METADATA +5 -5
  128. modal-0.72.13.dist-info/RECORD +174 -0
  129. {modal-0.62.115.dist-info → modal-0.72.13.dist-info}/top_level.txt +0 -1
  130. modal_docs/gen_reference_docs.py +3 -1
  131. modal_docs/mdmd/mdmd.py +0 -1
  132. modal_docs/mdmd/signatures.py +1 -2
  133. modal_global_objects/images/base_images.py +28 -0
  134. modal_global_objects/mounts/python_standalone.py +2 -2
  135. modal_proto/__init__.py +1 -1
  136. modal_proto/api.proto +1231 -531
  137. modal_proto/api_grpc.py +750 -430
  138. modal_proto/api_pb2.py +2102 -1176
  139. modal_proto/api_pb2.pyi +8859 -0
  140. modal_proto/api_pb2_grpc.py +1329 -675
  141. modal_proto/api_pb2_grpc.pyi +1416 -0
  142. modal_proto/modal_api_grpc.py +149 -0
  143. modal_proto/modal_options_grpc.py +3 -0
  144. modal_proto/options_pb2.pyi +20 -0
  145. modal_proto/options_pb2_grpc.pyi +7 -0
  146. modal_proto/py.typed +0 -0
  147. modal_version/__init__.py +1 -1
  148. modal_version/_version_generated.py +2 -2
  149. modal/_asgi.py +0 -370
  150. modal/_container_exec.py +0 -128
  151. modal/_container_io_manager.py +0 -646
  152. modal/_container_io_manager.pyi +0 -412
  153. modal/_sandbox_shell.py +0 -49
  154. modal/app_utils.py +0 -20
  155. modal/app_utils.pyi +0 -17
  156. modal/execution_context.pyi +0 -37
  157. modal/shared_volume.py +0 -23
  158. modal/shared_volume.pyi +0 -24
  159. modal-0.62.115.dist-info/RECORD +0 -207
  160. modal_global_objects/images/conda.py +0 -15
  161. modal_global_objects/images/debian_slim.py +0 -15
  162. modal_global_objects/images/micromamba.py +0 -15
  163. test/__init__.py +0 -1
  164. test/aio_test.py +0 -12
  165. test/async_utils_test.py +0 -279
  166. test/blob_test.py +0 -67
  167. test/cli_imports_test.py +0 -149
  168. test/cli_test.py +0 -674
  169. test/client_test.py +0 -203
  170. test/cloud_bucket_mount_test.py +0 -22
  171. test/cls_test.py +0 -636
  172. test/config_test.py +0 -149
  173. test/conftest.py +0 -1485
  174. test/container_app_test.py +0 -50
  175. test/container_test.py +0 -1405
  176. test/cpu_test.py +0 -23
  177. test/decorator_test.py +0 -85
  178. test/deprecation_test.py +0 -34
  179. test/dict_test.py +0 -51
  180. test/e2e_test.py +0 -68
  181. test/error_test.py +0 -7
  182. test/function_serialization_test.py +0 -32
  183. test/function_test.py +0 -791
  184. test/function_utils_test.py +0 -101
  185. test/gpu_test.py +0 -159
  186. test/grpc_utils_test.py +0 -82
  187. test/helpers.py +0 -47
  188. test/image_test.py +0 -814
  189. test/live_reload_test.py +0 -80
  190. test/lookup_test.py +0 -70
  191. test/mdmd_test.py +0 -329
  192. test/mount_test.py +0 -162
  193. test/mounted_files_test.py +0 -327
  194. test/network_file_system_test.py +0 -188
  195. test/notebook_test.py +0 -66
  196. test/object_test.py +0 -41
  197. test/package_utils_test.py +0 -25
  198. test/queue_test.py +0 -115
  199. test/resolver_test.py +0 -59
  200. test/retries_test.py +0 -67
  201. test/runner_test.py +0 -85
  202. test/sandbox_test.py +0 -191
  203. test/schedule_test.py +0 -15
  204. test/scheduler_placement_test.py +0 -57
  205. test/secret_test.py +0 -89
  206. test/serialization_test.py +0 -50
  207. test/stub_composition_test.py +0 -10
  208. test/stub_test.py +0 -361
  209. test/test_asgi_wrapper.py +0 -234
  210. test/token_flow_test.py +0 -18
  211. test/traceback_test.py +0 -135
  212. test/tunnel_test.py +0 -29
  213. test/utils_test.py +0 -88
  214. test/version_test.py +0 -14
  215. test/volume_test.py +0 -397
  216. test/watcher_test.py +0 -58
  217. test/webhook_test.py +0 -145
  218. {modal-0.62.115.dist-info → modal-0.72.13.dist-info}/LICENSE +0 -0
  219. {modal-0.62.115.dist-info → modal-0.72.13.dist-info}/WHEEL +0 -0
  220. {modal-0.62.115.dist-info → modal-0.72.13.dist-info}/entry_points.txt +0 -0
modal/image.pyi CHANGED
@@ -1,285 +1,624 @@
1
+ import collections.abc
1
2
  import google.protobuf.message
3
+ import modal.client
4
+ import modal.cloud_bucket_mount
2
5
  import modal.functions
3
6
  import modal.gpu
4
7
  import modal.mount
5
8
  import modal.network_file_system
6
9
  import modal.object
7
10
  import modal.secret
11
+ import modal.volume
8
12
  import modal_proto.api_pb2
9
13
  import pathlib
10
14
  import typing
11
-
12
- ImageBuilderVersion = typing.Literal['2023.12', '2024.04']
13
-
14
- def _validate_python_version(version: typing.Union[str, None], allow_micro_granularity: bool = True) -> str:
15
- ...
16
-
17
-
18
- def _dockerhub_python_version(builder_version: typing.Literal['2023.12', '2024.04'], python_version: typing.Union[str, None] = None) -> str:
19
- ...
20
-
21
-
22
- def _dockerhub_debian_codename(builder_version: typing.Literal['2023.12', '2024.04']) -> str:
23
- ...
24
-
25
-
26
- def _get_modal_requirements_path(builder_version: typing.Literal['2023.12', '2024.04'], python_version: typing.Union[str, None] = None) -> str:
27
- ...
28
-
29
-
30
- def _get_modal_requirements_command(version: typing.Literal['2023.12', '2024.04']) -> str:
31
- ...
32
-
33
-
34
- def _flatten_str_args(function_name: str, arg_name: str, args: typing.Tuple[typing.Union[str, typing.List[str]], ...]) -> typing.List[str]:
35
- ...
36
-
37
-
38
- def _make_pip_install_args(find_links: typing.Union[str, None] = None, index_url: typing.Union[str, None] = None, extra_index_url: typing.Union[str, None] = None, pre: bool = False) -> str:
39
- ...
40
-
41
-
42
- def _get_image_builder_version(client_version: str) -> typing.Literal['2023.12', '2024.04']:
43
- ...
44
-
15
+ import typing_extensions
16
+
17
+ ImageBuilderVersion = typing.Literal["2023.12", "2024.04", "2024.10"]
18
+
19
+ class _AutoDockerIgnoreSentinel:
20
+ def __repr__(self) -> str: ...
21
+ def __call__(self, _: pathlib.Path) -> bool: ...
22
+
23
+ AUTO_DOCKERIGNORE: _AutoDockerIgnoreSentinel
24
+
25
+ def _validate_python_version(
26
+ python_version: typing.Optional[str],
27
+ builder_version: typing.Literal["2023.12", "2024.04", "2024.10"],
28
+ allow_micro_granularity: bool = True,
29
+ ) -> str: ...
30
+ def _dockerhub_python_version(
31
+ builder_version: typing.Literal["2023.12", "2024.04", "2024.10"], python_version: typing.Optional[str] = None
32
+ ) -> str: ...
33
+ def _base_image_config(group: str, builder_version: typing.Literal["2023.12", "2024.04", "2024.10"]) -> typing.Any: ...
34
+ def _get_modal_requirements_path(
35
+ builder_version: typing.Literal["2023.12", "2024.04", "2024.10"], python_version: typing.Optional[str] = None
36
+ ) -> str: ...
37
+ def _get_modal_requirements_command(version: typing.Literal["2023.12", "2024.04", "2024.10"]) -> str: ...
38
+ def _flatten_str_args(
39
+ function_name: str, arg_name: str, args: collections.abc.Sequence[typing.Union[str, list[str]]]
40
+ ) -> list[str]: ...
41
+ def _validate_packages(packages: list[str]) -> bool: ...
42
+ def _warn_invalid_packages(old_command: str) -> None: ...
43
+ def _make_pip_install_args(
44
+ find_links: typing.Optional[str] = None,
45
+ index_url: typing.Optional[str] = None,
46
+ extra_index_url: typing.Optional[str] = None,
47
+ pre: bool = False,
48
+ extra_options: str = "",
49
+ ) -> str: ...
50
+ def _get_image_builder_version(
51
+ server_version: typing.Literal["2023.12", "2024.04", "2024.10"],
52
+ ) -> typing.Literal["2023.12", "2024.04", "2024.10"]: ...
53
+ def _create_context_mount(
54
+ docker_commands: collections.abc.Sequence[str],
55
+ ignore_fn: typing.Callable[[pathlib.Path], bool],
56
+ context_dir: pathlib.Path,
57
+ ) -> typing.Optional[modal.mount._Mount]: ...
58
+ def _create_context_mount_function(
59
+ ignore: typing.Union[collections.abc.Sequence[str], typing.Callable[[pathlib.Path], bool]],
60
+ dockerfile_cmds: list[str] = [],
61
+ dockerfile_path: typing.Optional[pathlib.Path] = None,
62
+ context_mount: typing.Optional[modal.mount._Mount] = None,
63
+ ): ...
45
64
 
46
65
  class _ImageRegistryConfig:
47
- def __init__(self, registry_auth_type: int = 0, secret: typing.Union[modal.secret._Secret, None] = None):
48
- ...
49
-
50
- def get_proto(self) -> modal_proto.api_pb2.ImageRegistryConfig:
51
- ...
52
-
66
+ def __init__(self, registry_auth_type: int = 0, secret: typing.Optional[modal.secret._Secret] = None): ...
67
+ def get_proto(self) -> modal_proto.api_pb2.ImageRegistryConfig: ...
53
68
 
54
69
  class DockerfileSpec:
55
- commands: typing.List[str]
56
- context_files: typing.Dict[str, str]
57
-
58
- def __init__(self, commands: typing.List[str], context_files: typing.Dict[str, str]) -> None:
59
- ...
70
+ commands: list[str]
71
+ context_files: dict[str, str]
60
72
 
61
- def __repr__(self):
62
- ...
63
-
64
- def __eq__(self, other):
65
- ...
73
+ def __init__(self, commands: list[str], context_files: dict[str, str]) -> None: ...
74
+ def __repr__(self): ...
75
+ def __eq__(self, other): ...
66
76
 
77
+ async def _image_await_build_result(
78
+ image_id: str, client: modal.client._Client
79
+ ) -> modal_proto.api_pb2.ImageJoinStreamingResponse: ...
67
80
 
68
81
  class _Image(modal.object._Object):
69
82
  force_build: bool
70
- inside_exceptions: typing.List[Exception]
71
-
72
- def _initialize_from_empty(self):
73
- ...
74
-
75
- def _hydrate_metadata(self, message: typing.Union[google.protobuf.message.Message, None]):
76
- ...
77
-
83
+ inside_exceptions: list[Exception]
84
+ _serve_mounts: frozenset[modal.mount._Mount]
85
+ _deferred_mounts: collections.abc.Sequence[modal.mount._Mount]
86
+ _metadata: typing.Optional[modal_proto.api_pb2.ImageMetadata]
87
+
88
+ def _initialize_from_empty(self): ...
89
+ def _initialize_from_other(self, other: _Image): ...
90
+ def _hydrate_metadata(self, metadata: typing.Optional[google.protobuf.message.Message]): ...
91
+ def _add_mount_layer_or_copy(self, mount: modal.mount._Mount, copy: bool = False): ...
92
+ @property
93
+ def _mount_layers(self) -> typing.Sequence[modal.mount._Mount]: ...
94
+ def _assert_no_mount_layers(self): ...
78
95
  @staticmethod
79
- def _from_args(*, base_images: typing.Union[typing.Dict[str, _Image], None] = None, dockerfile_function: typing.Union[typing.Callable[[typing.Literal['2023.12', '2024.04']], DockerfileSpec], None] = None, secrets: typing.Union[typing.Sequence[modal.secret._Secret], None] = None, gpu_config: typing.Union[modal_proto.api_pb2.GPUConfig, None] = None, build_function: typing.Union[modal.functions._Function, None] = None, build_function_input: typing.Union[modal_proto.api_pb2.FunctionInput, None] = None, image_registry_config: typing.Union[_ImageRegistryConfig, None] = None, context_mount: typing.Union[modal.mount._Mount, None] = None, force_build: bool = False, _namespace: int = 1):
80
- ...
81
-
82
- def extend(self, *, secrets: typing.Union[typing.Sequence[modal.secret._Secret], None] = None, gpu_config: typing.Union[modal_proto.api_pb2.GPUConfig, None] = None, build_function: typing.Union[modal.functions._Function, None] = None, build_function_input: typing.Union[modal_proto.api_pb2.FunctionInput, None] = None, image_registry_config: typing.Union[_ImageRegistryConfig, None] = None, context_mount: typing.Union[modal.mount._Mount, None] = None, force_build: bool = False, _namespace: int = 1) -> _Image:
83
- ...
84
-
85
- def copy_mount(self, mount: modal.mount._Mount, remote_path: typing.Union[str, pathlib.Path] = '.') -> _Image:
86
- ...
87
-
88
- def copy_local_file(self, local_path: typing.Union[str, pathlib.Path], remote_path: typing.Union[str, pathlib.Path] = './') -> _Image:
89
- ...
90
-
91
- def copy_local_dir(self, local_path: typing.Union[str, pathlib.Path], remote_path: typing.Union[str, pathlib.Path] = '.') -> _Image:
92
- ...
93
-
94
- def pip_install(self, *packages: typing.Union[str, typing.List[str]], find_links: typing.Union[str, None] = None, index_url: typing.Union[str, None] = None, extra_index_url: typing.Union[str, None] = None, pre: bool = False, force_build: bool = False, secrets: typing.Sequence[modal.secret._Secret] = [], gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None) -> _Image:
95
- ...
96
-
97
- def pip_install_private_repos(self, *repositories: str, git_user: str, find_links: typing.Union[str, None] = None, index_url: typing.Union[str, None] = None, extra_index_url: typing.Union[str, None] = None, pre: bool = False, gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None, secrets: typing.Sequence[modal.secret._Secret] = [], force_build: bool = False) -> _Image:
98
- ...
99
-
100
- def pip_install_from_requirements(self, requirements_txt: str, find_links: typing.Union[str, None] = None, *, index_url: typing.Union[str, None] = None, extra_index_url: typing.Union[str, None] = None, pre: bool = False, force_build: bool = False, secrets: typing.Sequence[modal.secret._Secret] = [], gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None) -> _Image:
101
- ...
102
-
103
- def pip_install_from_pyproject(self, pyproject_toml: str, optional_dependencies: typing.List[str] = [], *, find_links: typing.Union[str, None] = None, index_url: typing.Union[str, None] = None, extra_index_url: typing.Union[str, None] = None, pre: bool = False, force_build: bool = False, secrets: typing.Sequence[modal.secret._Secret] = [], gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None) -> _Image:
104
- ...
105
-
106
- def poetry_install_from_file(self, poetry_pyproject_toml: str, poetry_lockfile: typing.Union[str, None] = None, ignore_lockfile: bool = False, old_installer: bool = False, force_build: bool = False, with_: typing.List[str] = [], without: typing.List[str] = [], only: typing.List[str] = [], *, secrets: typing.Sequence[modal.secret._Secret] = [], gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None) -> _Image:
107
- ...
108
-
109
- def dockerfile_commands(self, *dockerfile_commands: typing.Union[str, typing.List[str]], context_files: typing.Dict[str, str] = {}, secrets: typing.Sequence[modal.secret._Secret] = [], gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None, context_mount: typing.Union[modal.mount._Mount, None] = None, force_build: bool = False) -> _Image:
110
- ...
111
-
112
- def run_commands(self, *commands: typing.Union[str, typing.List[str]], secrets: typing.Sequence[modal.secret._Secret] = [], gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None, force_build: bool = False) -> _Image:
113
- ...
114
-
96
+ def _from_args(
97
+ *,
98
+ base_images: typing.Optional[dict[str, _Image]] = None,
99
+ dockerfile_function: typing.Optional[
100
+ typing.Callable[[typing.Literal["2023.12", "2024.04", "2024.10"]], DockerfileSpec]
101
+ ] = None,
102
+ secrets: typing.Optional[collections.abc.Sequence[modal.secret._Secret]] = None,
103
+ gpu_config: typing.Optional[modal_proto.api_pb2.GPUConfig] = None,
104
+ build_function: typing.Optional[modal.functions._Function] = None,
105
+ build_function_input: typing.Optional[modal_proto.api_pb2.FunctionInput] = None,
106
+ image_registry_config: typing.Optional[_ImageRegistryConfig] = None,
107
+ context_mount_function: typing.Optional[typing.Callable[[], typing.Optional[modal.mount._Mount]]] = None,
108
+ force_build: bool = False,
109
+ _namespace: int = 1,
110
+ _do_assert_no_mount_layers: bool = True,
111
+ ): ...
112
+ def copy_mount(self, mount: modal.mount._Mount, remote_path: typing.Union[str, pathlib.Path] = ".") -> _Image: ...
113
+ def add_local_file(
114
+ self, local_path: typing.Union[str, pathlib.Path], remote_path: str, *, copy: bool = False
115
+ ) -> _Image: ...
116
+ def add_local_dir(
117
+ self,
118
+ local_path: typing.Union[str, pathlib.Path],
119
+ remote_path: str,
120
+ *,
121
+ copy: bool = False,
122
+ ignore: typing.Union[collections.abc.Sequence[str], typing.Callable[[pathlib.Path], bool]] = [],
123
+ ) -> _Image: ...
124
+ def copy_local_file(
125
+ self, local_path: typing.Union[str, pathlib.Path], remote_path: typing.Union[str, pathlib.Path] = "./"
126
+ ) -> _Image: ...
127
+ def add_local_python_source(
128
+ self,
129
+ *module_names: str,
130
+ copy: bool = False,
131
+ ignore: typing.Union[
132
+ collections.abc.Sequence[str], typing.Callable[[pathlib.Path], bool]
133
+ ] = modal.file_pattern_matcher.NON_PYTHON_FILES,
134
+ ) -> _Image: ...
135
+ def copy_local_dir(
136
+ self,
137
+ local_path: typing.Union[str, pathlib.Path],
138
+ remote_path: typing.Union[str, pathlib.Path] = ".",
139
+ ignore: typing.Union[collections.abc.Sequence[str], typing.Callable[[pathlib.Path], bool]] = [],
140
+ ) -> _Image: ...
115
141
  @staticmethod
116
- def conda(python_version: typing.Union[str, None] = None, force_build: bool = False) -> _Image:
117
- ...
118
-
119
- def conda_install(self, *packages: typing.Union[str, typing.List[str]], channels: typing.List[str] = [], force_build: bool = False, secrets: typing.Sequence[modal.secret._Secret] = [], gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None) -> _Image:
120
- ...
121
-
122
- def conda_update_from_environment(self, environment_yml: str, force_build: bool = False, *, secrets: typing.Sequence[modal.secret._Secret] = [], gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None) -> _Image:
123
- ...
124
-
142
+ async def from_id(image_id: str, client: typing.Optional[modal.client._Client] = None) -> _Image: ...
143
+ def pip_install(
144
+ self,
145
+ *packages: typing.Union[str, list[str]],
146
+ find_links: typing.Optional[str] = None,
147
+ index_url: typing.Optional[str] = None,
148
+ extra_index_url: typing.Optional[str] = None,
149
+ pre: bool = False,
150
+ extra_options: str = "",
151
+ force_build: bool = False,
152
+ secrets: collections.abc.Sequence[modal.secret._Secret] = [],
153
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
154
+ ) -> _Image: ...
155
+ def pip_install_private_repos(
156
+ self,
157
+ *repositories: str,
158
+ git_user: str,
159
+ find_links: typing.Optional[str] = None,
160
+ index_url: typing.Optional[str] = None,
161
+ extra_index_url: typing.Optional[str] = None,
162
+ pre: bool = False,
163
+ extra_options: str = "",
164
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
165
+ secrets: collections.abc.Sequence[modal.secret._Secret] = [],
166
+ force_build: bool = False,
167
+ ) -> _Image: ...
168
+ def pip_install_from_requirements(
169
+ self,
170
+ requirements_txt: str,
171
+ find_links: typing.Optional[str] = None,
172
+ *,
173
+ index_url: typing.Optional[str] = None,
174
+ extra_index_url: typing.Optional[str] = None,
175
+ pre: bool = False,
176
+ extra_options: str = "",
177
+ force_build: bool = False,
178
+ secrets: collections.abc.Sequence[modal.secret._Secret] = [],
179
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
180
+ ) -> _Image: ...
181
+ def pip_install_from_pyproject(
182
+ self,
183
+ pyproject_toml: str,
184
+ optional_dependencies: list[str] = [],
185
+ *,
186
+ find_links: typing.Optional[str] = None,
187
+ index_url: typing.Optional[str] = None,
188
+ extra_index_url: typing.Optional[str] = None,
189
+ pre: bool = False,
190
+ extra_options: str = "",
191
+ force_build: bool = False,
192
+ secrets: collections.abc.Sequence[modal.secret._Secret] = [],
193
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
194
+ ) -> _Image: ...
195
+ def poetry_install_from_file(
196
+ self,
197
+ poetry_pyproject_toml: str,
198
+ poetry_lockfile: typing.Optional[str] = None,
199
+ ignore_lockfile: bool = False,
200
+ old_installer: bool = False,
201
+ force_build: bool = False,
202
+ with_: list[str] = [],
203
+ without: list[str] = [],
204
+ only: list[str] = [],
205
+ *,
206
+ secrets: collections.abc.Sequence[modal.secret._Secret] = [],
207
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
208
+ ) -> _Image: ...
209
+ def dockerfile_commands(
210
+ self,
211
+ *dockerfile_commands: typing.Union[str, list[str]],
212
+ context_files: dict[str, str] = {},
213
+ secrets: collections.abc.Sequence[modal.secret._Secret] = [],
214
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
215
+ context_mount: typing.Optional[modal.mount._Mount] = None,
216
+ force_build: bool = False,
217
+ ignore: typing.Union[
218
+ collections.abc.Sequence[str], typing.Callable[[pathlib.Path], bool]
219
+ ] = modal.image.AUTO_DOCKERIGNORE,
220
+ ) -> _Image: ...
221
+ def entrypoint(self, entrypoint_commands: list[str]) -> _Image: ...
222
+ def shell(self, shell_commands: list[str]) -> _Image: ...
223
+ def run_commands(
224
+ self,
225
+ *commands: typing.Union[str, list[str]],
226
+ secrets: collections.abc.Sequence[modal.secret._Secret] = [],
227
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
228
+ force_build: bool = False,
229
+ ) -> _Image: ...
125
230
  @staticmethod
126
- def micromamba(python_version: typing.Union[str, None] = None, force_build: bool = False) -> _Image:
127
- ...
128
-
129
- def micromamba_install(self, *packages: typing.Union[str, typing.List[str]], channels: typing.List[str] = [], force_build: bool = False, secrets: typing.Sequence[modal.secret._Secret] = [], gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None) -> _Image:
130
- ...
131
-
231
+ def conda(python_version: typing.Optional[str] = None, force_build: bool = False): ...
232
+ def conda_install(
233
+ self,
234
+ *packages: typing.Union[str, list[str]],
235
+ channels: list[str] = [],
236
+ force_build: bool = False,
237
+ secrets: collections.abc.Sequence[modal.secret._Secret] = [],
238
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
239
+ ): ...
240
+ def conda_update_from_environment(
241
+ self,
242
+ environment_yml: str,
243
+ force_build: bool = False,
244
+ *,
245
+ secrets: collections.abc.Sequence[modal.secret._Secret] = [],
246
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
247
+ ): ...
132
248
  @staticmethod
133
- def _registry_setup_commands(tag: str, builder_version: typing.Literal['2023.12', '2024.04'], setup_commands: typing.List[str], add_python: typing.Union[str, None] = None) -> typing.List[str]:
134
- ...
135
-
249
+ def micromamba(python_version: typing.Optional[str] = None, force_build: bool = False) -> _Image: ...
250
+ def micromamba_install(
251
+ self,
252
+ *packages: typing.Union[str, list[str]],
253
+ spec_file: typing.Optional[str] = None,
254
+ channels: list[str] = [],
255
+ force_build: bool = False,
256
+ secrets: collections.abc.Sequence[modal.secret._Secret] = [],
257
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
258
+ ) -> _Image: ...
136
259
  @staticmethod
137
- def from_registry(tag: str, *, secret: typing.Union[modal.secret._Secret, None] = None, setup_dockerfile_commands: typing.List[str] = [], force_build: bool = False, add_python: typing.Union[str, None] = None, **kwargs) -> _Image:
138
- ...
139
-
260
+ def _registry_setup_commands(
261
+ tag: str,
262
+ builder_version: typing.Literal["2023.12", "2024.04", "2024.10"],
263
+ setup_commands: list[str],
264
+ add_python: typing.Optional[str] = None,
265
+ ) -> list[str]: ...
140
266
  @staticmethod
141
- def from_gcp_artifact_registry(tag: str, secret: typing.Union[modal.secret._Secret, None] = None, *, setup_dockerfile_commands: typing.List[str] = [], force_build: bool = False, add_python: typing.Union[str, None] = None, **kwargs) -> _Image:
142
- ...
143
-
267
+ def from_registry(
268
+ tag: str,
269
+ *,
270
+ secret: typing.Optional[modal.secret._Secret] = None,
271
+ setup_dockerfile_commands: list[str] = [],
272
+ force_build: bool = False,
273
+ add_python: typing.Optional[str] = None,
274
+ **kwargs,
275
+ ) -> _Image: ...
144
276
  @staticmethod
145
- def from_aws_ecr(tag: str, secret: typing.Union[modal.secret._Secret, None] = None, *, setup_dockerfile_commands: typing.List[str] = [], force_build: bool = False, add_python: typing.Union[str, None] = None, **kwargs) -> _Image:
146
- ...
147
-
277
+ def from_gcp_artifact_registry(
278
+ tag: str,
279
+ secret: typing.Optional[modal.secret._Secret] = None,
280
+ *,
281
+ setup_dockerfile_commands: list[str] = [],
282
+ force_build: bool = False,
283
+ add_python: typing.Optional[str] = None,
284
+ **kwargs,
285
+ ) -> _Image: ...
148
286
  @staticmethod
149
- def from_dockerfile(path: typing.Union[str, pathlib.Path], context_mount: typing.Union[modal.mount._Mount, None] = None, force_build: bool = False, *, secrets: typing.Sequence[modal.secret._Secret] = [], gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None, add_python: typing.Union[str, None] = None) -> _Image:
150
- ...
151
-
287
+ def from_aws_ecr(
288
+ tag: str,
289
+ secret: typing.Optional[modal.secret._Secret] = None,
290
+ *,
291
+ setup_dockerfile_commands: list[str] = [],
292
+ force_build: bool = False,
293
+ add_python: typing.Optional[str] = None,
294
+ **kwargs,
295
+ ) -> _Image: ...
152
296
  @staticmethod
153
- def debian_slim(python_version: typing.Union[str, None] = None, force_build: bool = False) -> _Image:
154
- ...
155
-
156
- def apt_install(self, *packages: typing.Union[str, typing.List[str]], force_build: bool = False, secrets: typing.Sequence[modal.secret._Secret] = [], gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None) -> _Image:
157
- ...
158
-
159
- def run_function(self, raw_f: typing.Callable, secrets: typing.Sequence[modal.secret._Secret] = (), gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None, mounts: typing.Sequence[modal.mount._Mount] = (), shared_volumes: typing.Dict[typing.Union[str, pathlib.PurePosixPath], modal.network_file_system._NetworkFileSystem] = {}, network_file_systems: typing.Dict[typing.Union[str, pathlib.PurePosixPath], modal.network_file_system._NetworkFileSystem] = {}, cpu: typing.Union[float, None] = None, memory: typing.Union[int, None] = None, timeout: typing.Union[int, None] = 86400, force_build: bool = False, secret: typing.Union[modal.secret._Secret, None] = None, args: typing.Sequence[typing.Any] = (), kwargs: typing.Dict[str, typing.Any] = {}) -> _Image:
160
- ...
161
-
162
- def env(self, vars: typing.Dict[str, str]) -> _Image:
163
- ...
164
-
165
- def workdir(self, path: str) -> _Image:
166
- ...
167
-
168
- def imports(self):
169
- ...
170
-
171
- def run_inside(self):
172
- ...
173
-
297
+ def from_dockerfile(
298
+ path: typing.Union[str, pathlib.Path],
299
+ context_mount: typing.Optional[modal.mount._Mount] = None,
300
+ force_build: bool = False,
301
+ *,
302
+ secrets: collections.abc.Sequence[modal.secret._Secret] = [],
303
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
304
+ add_python: typing.Optional[str] = None,
305
+ ignore: typing.Union[
306
+ collections.abc.Sequence[str], typing.Callable[[pathlib.Path], bool]
307
+ ] = modal.image.AUTO_DOCKERIGNORE,
308
+ ) -> _Image: ...
309
+ @staticmethod
310
+ def debian_slim(python_version: typing.Optional[str] = None, force_build: bool = False) -> _Image: ...
311
+ def apt_install(
312
+ self,
313
+ *packages: typing.Union[str, list[str]],
314
+ force_build: bool = False,
315
+ secrets: collections.abc.Sequence[modal.secret._Secret] = [],
316
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
317
+ ) -> _Image: ...
318
+ def run_function(
319
+ self,
320
+ raw_f: typing.Callable[..., typing.Any],
321
+ secrets: collections.abc.Sequence[modal.secret._Secret] = (),
322
+ gpu: typing.Union[
323
+ None, bool, str, modal.gpu._GPUConfig, list[typing.Union[None, bool, str, modal.gpu._GPUConfig]]
324
+ ] = None,
325
+ mounts: collections.abc.Sequence[modal.mount._Mount] = (),
326
+ volumes: dict[
327
+ typing.Union[str, pathlib.PurePosixPath],
328
+ typing.Union[modal.volume._Volume, modal.cloud_bucket_mount._CloudBucketMount],
329
+ ] = {},
330
+ network_file_systems: dict[
331
+ typing.Union[str, pathlib.PurePosixPath], modal.network_file_system._NetworkFileSystem
332
+ ] = {},
333
+ cpu: typing.Optional[float] = None,
334
+ memory: typing.Optional[int] = None,
335
+ timeout: typing.Optional[int] = 3600,
336
+ force_build: bool = False,
337
+ cloud: typing.Optional[str] = None,
338
+ region: typing.Union[str, collections.abc.Sequence[str], None] = None,
339
+ args: collections.abc.Sequence[typing.Any] = (),
340
+ kwargs: dict[str, typing.Any] = {},
341
+ ) -> _Image: ...
342
+ def env(self, vars: dict[str, str]) -> _Image: ...
343
+ def workdir(self, path: typing.Union[str, pathlib.PurePosixPath]) -> _Image: ...
344
+ def imports(self): ...
345
+ def _logs(self) -> typing.AsyncGenerator[str, None]: ...
174
346
 
175
347
  class Image(modal.object.Object):
176
348
  force_build: bool
177
- inside_exceptions: typing.List[Exception]
178
-
179
- def __init__(self, *args, **kwargs):
180
- ...
181
-
182
- def _initialize_from_empty(self):
183
- ...
184
-
185
- def _hydrate_metadata(self, message: typing.Union[google.protobuf.message.Message, None]):
186
- ...
187
-
349
+ inside_exceptions: list[Exception]
350
+ _serve_mounts: frozenset[modal.mount.Mount]
351
+ _deferred_mounts: collections.abc.Sequence[modal.mount.Mount]
352
+ _metadata: typing.Optional[modal_proto.api_pb2.ImageMetadata]
353
+
354
+ def __init__(self, *args, **kwargs): ...
355
+ def _initialize_from_empty(self): ...
356
+ def _initialize_from_other(self, other: Image): ...
357
+ def _hydrate_metadata(self, metadata: typing.Optional[google.protobuf.message.Message]): ...
358
+ def _add_mount_layer_or_copy(self, mount: modal.mount.Mount, copy: bool = False): ...
359
+ @property
360
+ def _mount_layers(self) -> typing.Sequence[modal.mount.Mount]: ...
361
+ def _assert_no_mount_layers(self): ...
188
362
  @staticmethod
189
- def _from_args(*, base_images: typing.Union[typing.Dict[str, Image], None] = None, dockerfile_function: typing.Union[typing.Callable[[typing.Literal['2023.12', '2024.04']], DockerfileSpec], None] = None, secrets: typing.Union[typing.Sequence[modal.secret.Secret], None] = None, gpu_config: typing.Union[modal_proto.api_pb2.GPUConfig, None] = None, build_function: typing.Union[modal.functions.Function, None] = None, build_function_input: typing.Union[modal_proto.api_pb2.FunctionInput, None] = None, image_registry_config: typing.Union[_ImageRegistryConfig, None] = None, context_mount: typing.Union[modal.mount.Mount, None] = None, force_build: bool = False, _namespace: int = 1):
190
- ...
191
-
192
- def extend(self, **kwargs) -> Image:
193
- ...
194
-
195
- def copy_mount(self, mount: modal.mount.Mount, remote_path: typing.Union[str, pathlib.Path] = '.') -> Image:
196
- ...
197
-
198
- def copy_local_file(self, local_path: typing.Union[str, pathlib.Path], remote_path: typing.Union[str, pathlib.Path] = './') -> Image:
199
- ...
200
-
201
- def copy_local_dir(self, local_path: typing.Union[str, pathlib.Path], remote_path: typing.Union[str, pathlib.Path] = '.') -> Image:
202
- ...
203
-
204
- def pip_install(self, *packages: typing.Union[str, typing.List[str]], find_links: typing.Union[str, None] = None, index_url: typing.Union[str, None] = None, extra_index_url: typing.Union[str, None] = None, pre: bool = False, force_build: bool = False, secrets: typing.Sequence[modal.secret.Secret] = [], gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None) -> Image:
205
- ...
206
-
207
- def pip_install_private_repos(self, *repositories: str, git_user: str, find_links: typing.Union[str, None] = None, index_url: typing.Union[str, None] = None, extra_index_url: typing.Union[str, None] = None, pre: bool = False, gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None, secrets: typing.Sequence[modal.secret.Secret] = [], force_build: bool = False) -> Image:
208
- ...
209
-
210
- def pip_install_from_requirements(self, requirements_txt: str, find_links: typing.Union[str, None] = None, *, index_url: typing.Union[str, None] = None, extra_index_url: typing.Union[str, None] = None, pre: bool = False, force_build: bool = False, secrets: typing.Sequence[modal.secret.Secret] = [], gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None) -> Image:
211
- ...
212
-
213
- def pip_install_from_pyproject(self, pyproject_toml: str, optional_dependencies: typing.List[str] = [], *, find_links: typing.Union[str, None] = None, index_url: typing.Union[str, None] = None, extra_index_url: typing.Union[str, None] = None, pre: bool = False, force_build: bool = False, secrets: typing.Sequence[modal.secret.Secret] = [], gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None) -> Image:
214
- ...
215
-
216
- def poetry_install_from_file(self, poetry_pyproject_toml: str, poetry_lockfile: typing.Union[str, None] = None, ignore_lockfile: bool = False, old_installer: bool = False, force_build: bool = False, with_: typing.List[str] = [], without: typing.List[str] = [], only: typing.List[str] = [], *, secrets: typing.Sequence[modal.secret.Secret] = [], gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None) -> Image:
217
- ...
218
-
219
- def dockerfile_commands(self, *dockerfile_commands: typing.Union[str, typing.List[str]], context_files: typing.Dict[str, str] = {}, secrets: typing.Sequence[modal.secret.Secret] = [], gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None, context_mount: typing.Union[modal.mount.Mount, None] = None, force_build: bool = False) -> Image:
220
- ...
221
-
222
- def run_commands(self, *commands: typing.Union[str, typing.List[str]], secrets: typing.Sequence[modal.secret.Secret] = [], gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None, force_build: bool = False) -> Image:
223
- ...
224
-
363
+ def _from_args(
364
+ *,
365
+ base_images: typing.Optional[dict[str, Image]] = None,
366
+ dockerfile_function: typing.Optional[
367
+ typing.Callable[[typing.Literal["2023.12", "2024.04", "2024.10"]], DockerfileSpec]
368
+ ] = None,
369
+ secrets: typing.Optional[collections.abc.Sequence[modal.secret.Secret]] = None,
370
+ gpu_config: typing.Optional[modal_proto.api_pb2.GPUConfig] = None,
371
+ build_function: typing.Optional[modal.functions.Function] = None,
372
+ build_function_input: typing.Optional[modal_proto.api_pb2.FunctionInput] = None,
373
+ image_registry_config: typing.Optional[_ImageRegistryConfig] = None,
374
+ context_mount_function: typing.Optional[typing.Callable[[], typing.Optional[modal.mount.Mount]]] = None,
375
+ force_build: bool = False,
376
+ _namespace: int = 1,
377
+ _do_assert_no_mount_layers: bool = True,
378
+ ): ...
379
+ def copy_mount(self, mount: modal.mount.Mount, remote_path: typing.Union[str, pathlib.Path] = ".") -> Image: ...
380
+ def add_local_file(
381
+ self, local_path: typing.Union[str, pathlib.Path], remote_path: str, *, copy: bool = False
382
+ ) -> Image: ...
383
+ def add_local_dir(
384
+ self,
385
+ local_path: typing.Union[str, pathlib.Path],
386
+ remote_path: str,
387
+ *,
388
+ copy: bool = False,
389
+ ignore: typing.Union[collections.abc.Sequence[str], typing.Callable[[pathlib.Path], bool]] = [],
390
+ ) -> Image: ...
391
+ def copy_local_file(
392
+ self, local_path: typing.Union[str, pathlib.Path], remote_path: typing.Union[str, pathlib.Path] = "./"
393
+ ) -> Image: ...
394
+ def add_local_python_source(
395
+ self,
396
+ *module_names: str,
397
+ copy: bool = False,
398
+ ignore: typing.Union[
399
+ collections.abc.Sequence[str], typing.Callable[[pathlib.Path], bool]
400
+ ] = modal.file_pattern_matcher.NON_PYTHON_FILES,
401
+ ) -> Image: ...
402
+ def copy_local_dir(
403
+ self,
404
+ local_path: typing.Union[str, pathlib.Path],
405
+ remote_path: typing.Union[str, pathlib.Path] = ".",
406
+ ignore: typing.Union[collections.abc.Sequence[str], typing.Callable[[pathlib.Path], bool]] = [],
407
+ ) -> Image: ...
408
+
409
+ class __from_id_spec(typing_extensions.Protocol):
410
+ def __call__(self, image_id: str, client: typing.Optional[modal.client.Client] = None) -> Image: ...
411
+ async def aio(self, image_id: str, client: typing.Optional[modal.client.Client] = None) -> Image: ...
412
+
413
+ from_id: __from_id_spec
414
+
415
+ def pip_install(
416
+ self,
417
+ *packages: typing.Union[str, list[str]],
418
+ find_links: typing.Optional[str] = None,
419
+ index_url: typing.Optional[str] = None,
420
+ extra_index_url: typing.Optional[str] = None,
421
+ pre: bool = False,
422
+ extra_options: str = "",
423
+ force_build: bool = False,
424
+ secrets: collections.abc.Sequence[modal.secret.Secret] = [],
425
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
426
+ ) -> Image: ...
427
+ def pip_install_private_repos(
428
+ self,
429
+ *repositories: str,
430
+ git_user: str,
431
+ find_links: typing.Optional[str] = None,
432
+ index_url: typing.Optional[str] = None,
433
+ extra_index_url: typing.Optional[str] = None,
434
+ pre: bool = False,
435
+ extra_options: str = "",
436
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
437
+ secrets: collections.abc.Sequence[modal.secret.Secret] = [],
438
+ force_build: bool = False,
439
+ ) -> Image: ...
440
+ def pip_install_from_requirements(
441
+ self,
442
+ requirements_txt: str,
443
+ find_links: typing.Optional[str] = None,
444
+ *,
445
+ index_url: typing.Optional[str] = None,
446
+ extra_index_url: typing.Optional[str] = None,
447
+ pre: bool = False,
448
+ extra_options: str = "",
449
+ force_build: bool = False,
450
+ secrets: collections.abc.Sequence[modal.secret.Secret] = [],
451
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
452
+ ) -> Image: ...
453
+ def pip_install_from_pyproject(
454
+ self,
455
+ pyproject_toml: str,
456
+ optional_dependencies: list[str] = [],
457
+ *,
458
+ find_links: typing.Optional[str] = None,
459
+ index_url: typing.Optional[str] = None,
460
+ extra_index_url: typing.Optional[str] = None,
461
+ pre: bool = False,
462
+ extra_options: str = "",
463
+ force_build: bool = False,
464
+ secrets: collections.abc.Sequence[modal.secret.Secret] = [],
465
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
466
+ ) -> Image: ...
467
+ def poetry_install_from_file(
468
+ self,
469
+ poetry_pyproject_toml: str,
470
+ poetry_lockfile: typing.Optional[str] = None,
471
+ ignore_lockfile: bool = False,
472
+ old_installer: bool = False,
473
+ force_build: bool = False,
474
+ with_: list[str] = [],
475
+ without: list[str] = [],
476
+ only: list[str] = [],
477
+ *,
478
+ secrets: collections.abc.Sequence[modal.secret.Secret] = [],
479
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
480
+ ) -> Image: ...
481
+ def dockerfile_commands(
482
+ self,
483
+ *dockerfile_commands: typing.Union[str, list[str]],
484
+ context_files: dict[str, str] = {},
485
+ secrets: collections.abc.Sequence[modal.secret.Secret] = [],
486
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
487
+ context_mount: typing.Optional[modal.mount.Mount] = None,
488
+ force_build: bool = False,
489
+ ignore: typing.Union[
490
+ collections.abc.Sequence[str], typing.Callable[[pathlib.Path], bool]
491
+ ] = modal.image.AUTO_DOCKERIGNORE,
492
+ ) -> Image: ...
493
+ def entrypoint(self, entrypoint_commands: list[str]) -> Image: ...
494
+ def shell(self, shell_commands: list[str]) -> Image: ...
495
+ def run_commands(
496
+ self,
497
+ *commands: typing.Union[str, list[str]],
498
+ secrets: collections.abc.Sequence[modal.secret.Secret] = [],
499
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
500
+ force_build: bool = False,
501
+ ) -> Image: ...
225
502
  @staticmethod
226
- def conda(python_version: typing.Union[str, None] = None, force_build: bool = False) -> Image:
227
- ...
228
-
229
- def conda_install(self, *packages: typing.Union[str, typing.List[str]], channels: typing.List[str] = [], force_build: bool = False, secrets: typing.Sequence[modal.secret.Secret] = [], gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None) -> Image:
230
- ...
231
-
232
- def conda_update_from_environment(self, environment_yml: str, force_build: bool = False, *, secrets: typing.Sequence[modal.secret.Secret] = [], gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None) -> Image:
233
- ...
234
-
503
+ def conda(python_version: typing.Optional[str] = None, force_build: bool = False): ...
504
+ def conda_install(
505
+ self,
506
+ *packages: typing.Union[str, list[str]],
507
+ channels: list[str] = [],
508
+ force_build: bool = False,
509
+ secrets: collections.abc.Sequence[modal.secret.Secret] = [],
510
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
511
+ ): ...
512
+ def conda_update_from_environment(
513
+ self,
514
+ environment_yml: str,
515
+ force_build: bool = False,
516
+ *,
517
+ secrets: collections.abc.Sequence[modal.secret.Secret] = [],
518
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
519
+ ): ...
235
520
  @staticmethod
236
- def micromamba(python_version: typing.Union[str, None] = None, force_build: bool = False) -> Image:
237
- ...
238
-
239
- def micromamba_install(self, *packages: typing.Union[str, typing.List[str]], channels: typing.List[str] = [], force_build: bool = False, secrets: typing.Sequence[modal.secret.Secret] = [], gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None) -> Image:
240
- ...
241
-
521
+ def micromamba(python_version: typing.Optional[str] = None, force_build: bool = False) -> Image: ...
522
+ def micromamba_install(
523
+ self,
524
+ *packages: typing.Union[str, list[str]],
525
+ spec_file: typing.Optional[str] = None,
526
+ channels: list[str] = [],
527
+ force_build: bool = False,
528
+ secrets: collections.abc.Sequence[modal.secret.Secret] = [],
529
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
530
+ ) -> Image: ...
242
531
  @staticmethod
243
- def _registry_setup_commands(tag: str, builder_version: typing.Literal['2023.12', '2024.04'], setup_commands: typing.List[str], add_python: typing.Union[str, None] = None) -> typing.List[str]:
244
- ...
245
-
532
+ def _registry_setup_commands(
533
+ tag: str,
534
+ builder_version: typing.Literal["2023.12", "2024.04", "2024.10"],
535
+ setup_commands: list[str],
536
+ add_python: typing.Optional[str] = None,
537
+ ) -> list[str]: ...
246
538
  @staticmethod
247
- def from_registry(tag: str, *, secret: typing.Union[modal.secret.Secret, None] = None, setup_dockerfile_commands: typing.List[str] = [], force_build: bool = False, add_python: typing.Union[str, None] = None, **kwargs) -> Image:
248
- ...
249
-
539
+ def from_registry(
540
+ tag: str,
541
+ *,
542
+ secret: typing.Optional[modal.secret.Secret] = None,
543
+ setup_dockerfile_commands: list[str] = [],
544
+ force_build: bool = False,
545
+ add_python: typing.Optional[str] = None,
546
+ **kwargs,
547
+ ) -> Image: ...
250
548
  @staticmethod
251
- def from_gcp_artifact_registry(tag: str, secret: typing.Union[modal.secret.Secret, None] = None, *, setup_dockerfile_commands: typing.List[str] = [], force_build: bool = False, add_python: typing.Union[str, None] = None, **kwargs) -> Image:
252
- ...
253
-
549
+ def from_gcp_artifact_registry(
550
+ tag: str,
551
+ secret: typing.Optional[modal.secret.Secret] = None,
552
+ *,
553
+ setup_dockerfile_commands: list[str] = [],
554
+ force_build: bool = False,
555
+ add_python: typing.Optional[str] = None,
556
+ **kwargs,
557
+ ) -> Image: ...
254
558
  @staticmethod
255
- def from_aws_ecr(tag: str, secret: typing.Union[modal.secret.Secret, None] = None, *, setup_dockerfile_commands: typing.List[str] = [], force_build: bool = False, add_python: typing.Union[str, None] = None, **kwargs) -> Image:
256
- ...
257
-
559
+ def from_aws_ecr(
560
+ tag: str,
561
+ secret: typing.Optional[modal.secret.Secret] = None,
562
+ *,
563
+ setup_dockerfile_commands: list[str] = [],
564
+ force_build: bool = False,
565
+ add_python: typing.Optional[str] = None,
566
+ **kwargs,
567
+ ) -> Image: ...
258
568
  @staticmethod
259
- def from_dockerfile(path: typing.Union[str, pathlib.Path], context_mount: typing.Union[modal.mount.Mount, None] = None, force_build: bool = False, *, secrets: typing.Sequence[modal.secret.Secret] = [], gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None, add_python: typing.Union[str, None] = None) -> Image:
260
- ...
261
-
569
+ def from_dockerfile(
570
+ path: typing.Union[str, pathlib.Path],
571
+ context_mount: typing.Optional[modal.mount.Mount] = None,
572
+ force_build: bool = False,
573
+ *,
574
+ secrets: collections.abc.Sequence[modal.secret.Secret] = [],
575
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
576
+ add_python: typing.Optional[str] = None,
577
+ ignore: typing.Union[
578
+ collections.abc.Sequence[str], typing.Callable[[pathlib.Path], bool]
579
+ ] = modal.image.AUTO_DOCKERIGNORE,
580
+ ) -> Image: ...
262
581
  @staticmethod
263
- def debian_slim(python_version: typing.Union[str, None] = None, force_build: bool = False) -> Image:
264
- ...
265
-
266
- def apt_install(self, *packages: typing.Union[str, typing.List[str]], force_build: bool = False, secrets: typing.Sequence[modal.secret.Secret] = [], gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None) -> Image:
267
- ...
268
-
269
- def run_function(self, raw_f: typing.Callable, secrets: typing.Sequence[modal.secret.Secret] = (), gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None, mounts: typing.Sequence[modal.mount.Mount] = (), shared_volumes: typing.Dict[typing.Union[str, pathlib.PurePosixPath], modal.network_file_system.NetworkFileSystem] = {}, network_file_systems: typing.Dict[typing.Union[str, pathlib.PurePosixPath], modal.network_file_system.NetworkFileSystem] = {}, cpu: typing.Union[float, None] = None, memory: typing.Union[int, None] = None, timeout: typing.Union[int, None] = 86400, force_build: bool = False, secret: typing.Union[modal.secret.Secret, None] = None, args: typing.Sequence[typing.Any] = (), kwargs: typing.Dict[str, typing.Any] = {}) -> Image:
270
- ...
271
-
272
- def env(self, vars: typing.Dict[str, str]) -> Image:
273
- ...
274
-
275
- def workdir(self, path: str) -> Image:
276
- ...
277
-
278
- def imports(self):
279
- ...
280
-
281
- def run_inside(self):
282
- ...
283
-
284
-
285
- SUPPORTED_PYTHON_SERIES: typing.Set[str]
582
+ def debian_slim(python_version: typing.Optional[str] = None, force_build: bool = False) -> Image: ...
583
+ def apt_install(
584
+ self,
585
+ *packages: typing.Union[str, list[str]],
586
+ force_build: bool = False,
587
+ secrets: collections.abc.Sequence[modal.secret.Secret] = [],
588
+ gpu: typing.Union[None, bool, str, modal.gpu._GPUConfig] = None,
589
+ ) -> Image: ...
590
+ def run_function(
591
+ self,
592
+ raw_f: typing.Callable[..., typing.Any],
593
+ secrets: collections.abc.Sequence[modal.secret.Secret] = (),
594
+ gpu: typing.Union[
595
+ None, bool, str, modal.gpu._GPUConfig, list[typing.Union[None, bool, str, modal.gpu._GPUConfig]]
596
+ ] = None,
597
+ mounts: collections.abc.Sequence[modal.mount.Mount] = (),
598
+ volumes: dict[
599
+ typing.Union[str, pathlib.PurePosixPath],
600
+ typing.Union[modal.volume.Volume, modal.cloud_bucket_mount.CloudBucketMount],
601
+ ] = {},
602
+ network_file_systems: dict[
603
+ typing.Union[str, pathlib.PurePosixPath], modal.network_file_system.NetworkFileSystem
604
+ ] = {},
605
+ cpu: typing.Optional[float] = None,
606
+ memory: typing.Optional[int] = None,
607
+ timeout: typing.Optional[int] = 3600,
608
+ force_build: bool = False,
609
+ cloud: typing.Optional[str] = None,
610
+ region: typing.Union[str, collections.abc.Sequence[str], None] = None,
611
+ args: collections.abc.Sequence[typing.Any] = (),
612
+ kwargs: dict[str, typing.Any] = {},
613
+ ) -> Image: ...
614
+ def env(self, vars: dict[str, str]) -> Image: ...
615
+ def workdir(self, path: typing.Union[str, pathlib.PurePosixPath]) -> Image: ...
616
+ def imports(self): ...
617
+
618
+ class ___logs_spec(typing_extensions.Protocol):
619
+ def __call__(self) -> typing.Generator[str, None, None]: ...
620
+ def aio(self) -> typing.AsyncGenerator[str, None]: ...
621
+
622
+ _logs: ___logs_spec
623
+
624
+ SUPPORTED_PYTHON_SERIES: dict[typing.Literal["2023.12", "2024.04", "2024.10"], list[str]]