modal 0.62.16__py3-none-any.whl → 0.72.11__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 +17 -13
  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 +420 -937
  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 -59
  11. modal/_resources.py +51 -0
  12. modal/_runtime/__init__.py +1 -0
  13. modal/_runtime/asgi.py +519 -0
  14. modal/_runtime/container_io_manager.py +1036 -0
  15. modal/_runtime/execution_context.py +89 -0
  16. modal/_runtime/telemetry.py +169 -0
  17. modal/_runtime/user_code_imports.py +356 -0
  18. modal/_serialization.py +134 -9
  19. modal/_traceback.py +47 -187
  20. modal/_tunnel.py +52 -16
  21. modal/_tunnel.pyi +19 -36
  22. modal/_utils/app_utils.py +3 -17
  23. modal/_utils/async_utils.py +479 -100
  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 +460 -171
  29. modal/_utils/grpc_testing.py +47 -31
  30. modal/_utils/grpc_utils.py +62 -109
  31. modal/_utils/hash_utils.py +61 -19
  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 +5 -7
  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 +14 -12
  43. modal/app.py +1003 -314
  44. modal/app.pyi +540 -264
  45. modal/call_graph.py +7 -6
  46. modal/cli/_download.py +63 -53
  47. modal/cli/_traceback.py +200 -0
  48. modal/cli/app.py +205 -45
  49. modal/cli/config.py +12 -5
  50. modal/cli/container.py +62 -14
  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 +64 -58
  55. modal/cli/launch.py +32 -18
  56. modal/cli/network_file_system.py +64 -83
  57. modal/cli/profile.py +1 -1
  58. modal/cli/programs/run_jupyter.py +35 -10
  59. modal/cli/programs/vscode.py +60 -10
  60. modal/cli/queues.py +131 -0
  61. modal/cli/run.py +234 -131
  62. modal/cli/secret.py +8 -7
  63. modal/cli/token.py +7 -2
  64. modal/cli/utils.py +79 -10
  65. modal/cli/volume.py +110 -109
  66. modal/client.py +250 -144
  67. modal/client.pyi +157 -118
  68. modal/cloud_bucket_mount.py +108 -34
  69. modal/cloud_bucket_mount.pyi +32 -38
  70. modal/cls.py +535 -148
  71. modal/cls.pyi +190 -146
  72. modal/config.py +41 -19
  73. modal/container_process.py +177 -0
  74. modal/container_process.pyi +82 -0
  75. modal/dict.py +111 -65
  76. modal/dict.pyi +136 -131
  77. modal/environments.py +106 -5
  78. modal/environments.pyi +77 -25
  79. modal/exception.py +34 -43
  80. modal/experimental.py +61 -2
  81. modal/extensions/ipython.py +5 -5
  82. modal/file_io.py +537 -0
  83. modal/file_io.pyi +235 -0
  84. modal/file_pattern_matcher.py +197 -0
  85. modal/functions.py +906 -911
  86. modal/functions.pyi +466 -430
  87. modal/gpu.py +57 -44
  88. modal/image.py +1089 -479
  89. modal/image.pyi +584 -228
  90. modal/io_streams.py +434 -0
  91. modal/io_streams.pyi +122 -0
  92. modal/mount.py +314 -101
  93. modal/mount.pyi +241 -235
  94. modal/network_file_system.py +92 -92
  95. modal/network_file_system.pyi +152 -110
  96. modal/object.py +67 -36
  97. modal/object.pyi +166 -143
  98. modal/output.py +63 -0
  99. modal/parallel_map.py +434 -0
  100. modal/parallel_map.pyi +75 -0
  101. modal/partial_function.py +282 -117
  102. modal/partial_function.pyi +222 -129
  103. modal/proxy.py +15 -12
  104. modal/proxy.pyi +3 -8
  105. modal/queue.py +182 -65
  106. modal/queue.pyi +218 -118
  107. modal/requirements/2024.04.txt +29 -0
  108. modal/requirements/2024.10.txt +16 -0
  109. modal/requirements/README.md +21 -0
  110. modal/requirements/base-images.json +22 -0
  111. modal/retries.py +48 -7
  112. modal/runner.py +459 -156
  113. modal/runner.pyi +135 -71
  114. modal/running_app.py +38 -0
  115. modal/sandbox.py +514 -236
  116. modal/sandbox.pyi +397 -169
  117. modal/schedule.py +4 -4
  118. modal/scheduler_placement.py +20 -3
  119. modal/secret.py +56 -31
  120. modal/secret.pyi +62 -42
  121. modal/serving.py +51 -56
  122. modal/serving.pyi +44 -36
  123. modal/stream_type.py +15 -0
  124. modal/token_flow.py +5 -3
  125. modal/token_flow.pyi +37 -32
  126. modal/volume.py +285 -157
  127. modal/volume.pyi +249 -184
  128. {modal-0.62.16.dist-info → modal-0.72.11.dist-info}/METADATA +7 -7
  129. modal-0.72.11.dist-info/RECORD +174 -0
  130. {modal-0.62.16.dist-info → modal-0.72.11.dist-info}/top_level.txt +0 -1
  131. modal_docs/gen_reference_docs.py +3 -1
  132. modal_docs/mdmd/mdmd.py +0 -1
  133. modal_docs/mdmd/signatures.py +5 -2
  134. modal_global_objects/images/base_images.py +28 -0
  135. modal_global_objects/mounts/python_standalone.py +2 -2
  136. modal_proto/__init__.py +1 -1
  137. modal_proto/api.proto +1288 -533
  138. modal_proto/api_grpc.py +856 -456
  139. modal_proto/api_pb2.py +2165 -1157
  140. modal_proto/api_pb2.pyi +8859 -0
  141. modal_proto/api_pb2_grpc.py +1674 -855
  142. modal_proto/api_pb2_grpc.pyi +1416 -0
  143. modal_proto/modal_api_grpc.py +149 -0
  144. modal_proto/modal_options_grpc.py +3 -0
  145. modal_proto/options_pb2.pyi +20 -0
  146. modal_proto/options_pb2_grpc.pyi +7 -0
  147. modal_proto/py.typed +0 -0
  148. modal_version/__init__.py +1 -1
  149. modal_version/_version_generated.py +2 -2
  150. modal/_asgi.py +0 -370
  151. modal/_container_entrypoint.pyi +0 -378
  152. modal/_container_exec.py +0 -128
  153. modal/_sandbox_shell.py +0 -49
  154. modal/shared_volume.py +0 -23
  155. modal/shared_volume.pyi +0 -24
  156. modal/stub.py +0 -783
  157. modal/stub.pyi +0 -332
  158. modal-0.62.16.dist-info/RECORD +0 -198
  159. modal_global_objects/images/conda.py +0 -15
  160. modal_global_objects/images/debian_slim.py +0 -15
  161. modal_global_objects/images/micromamba.py +0 -15
  162. test/__init__.py +0 -1
  163. test/aio_test.py +0 -12
  164. test/async_utils_test.py +0 -262
  165. test/blob_test.py +0 -67
  166. test/cli_imports_test.py +0 -149
  167. test/cli_test.py +0 -659
  168. test/client_test.py +0 -194
  169. test/cls_test.py +0 -630
  170. test/config_test.py +0 -137
  171. test/conftest.py +0 -1420
  172. test/container_app_test.py +0 -32
  173. test/container_test.py +0 -1389
  174. test/cpu_test.py +0 -23
  175. test/decorator_test.py +0 -85
  176. test/deprecation_test.py +0 -34
  177. test/dict_test.py +0 -33
  178. test/e2e_test.py +0 -68
  179. test/error_test.py +0 -7
  180. test/function_serialization_test.py +0 -32
  181. test/function_test.py +0 -653
  182. test/function_utils_test.py +0 -101
  183. test/gpu_test.py +0 -159
  184. test/grpc_utils_test.py +0 -141
  185. test/helpers.py +0 -42
  186. test/image_test.py +0 -669
  187. test/live_reload_test.py +0 -80
  188. test/lookup_test.py +0 -70
  189. test/mdmd_test.py +0 -329
  190. test/mount_test.py +0 -162
  191. test/mounted_files_test.py +0 -329
  192. test/network_file_system_test.py +0 -181
  193. test/notebook_test.py +0 -66
  194. test/object_test.py +0 -41
  195. test/package_utils_test.py +0 -25
  196. test/queue_test.py +0 -97
  197. test/resolver_test.py +0 -58
  198. test/retries_test.py +0 -67
  199. test/runner_test.py +0 -85
  200. test/sandbox_test.py +0 -191
  201. test/schedule_test.py +0 -15
  202. test/scheduler_placement_test.py +0 -29
  203. test/secret_test.py +0 -78
  204. test/serialization_test.py +0 -42
  205. test/stub_composition_test.py +0 -10
  206. test/stub_test.py +0 -360
  207. test/test_asgi_wrapper.py +0 -234
  208. test/token_flow_test.py +0 -18
  209. test/traceback_test.py +0 -135
  210. test/tunnel_test.py +0 -29
  211. test/utils_test.py +0 -88
  212. test/version_test.py +0 -14
  213. test/volume_test.py +0 -341
  214. test/watcher_test.py +0 -30
  215. test/webhook_test.py +0 -146
  216. /modal/{requirements.312.txt → requirements/2023.12.312.txt} +0 -0
  217. /modal/{requirements.txt → requirements/2023.12.txt} +0 -0
  218. {modal-0.62.16.dist-info → modal-0.72.11.dist-info}/LICENSE +0 -0
  219. {modal-0.62.16.dist-info → modal-0.72.11.dist-info}/WHEEL +0 -0
  220. {modal-0.62.16.dist-info → modal-0.72.11.dist-info}/entry_points.txt +0 -0
modal/image.pyi CHANGED
@@ -1,268 +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
- def _validate_python_version(version: str) -> None:
13
- ...
14
-
15
-
16
- def _dockerhub_python_version(python_version=None):
17
- ...
18
-
19
-
20
- def _get_client_requirements_path(python_version: typing.Union[str, None] = None) -> str:
21
- ...
22
-
23
-
24
- def _flatten_str_args(function_name: str, arg_name: str, args: typing.Tuple[typing.Union[str, typing.List[str]], ...]) -> typing.List[str]:
25
- ...
26
-
27
-
28
- 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:
29
- ...
30
-
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
+ ): ...
31
64
 
32
65
  class _ImageRegistryConfig:
33
- def __init__(self, registry_auth_type: int = 0, secret: typing.Union[modal.secret._Secret, None] = None):
34
- ...
35
-
36
- def get_proto(self) -> modal_proto.api_pb2.ImageRegistryConfig:
37
- ...
38
-
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: ...
39
68
 
40
69
  class DockerfileSpec:
41
- commands: typing.List[str]
42
- context_files: typing.Dict[str, str]
43
-
44
- def __init__(self, commands: typing.List[str], context_files: typing.Dict[str, str]) -> None:
45
- ...
70
+ commands: list[str]
71
+ context_files: dict[str, str]
46
72
 
47
- def __repr__(self):
48
- ...
49
-
50
- def __eq__(self, other):
51
- ...
73
+ def __init__(self, commands: list[str], context_files: dict[str, str]) -> None: ...
74
+ def __repr__(self): ...
75
+ def __eq__(self, other): ...
52
76
 
77
+ async def _image_await_build_result(
78
+ image_id: str, client: modal.client._Client
79
+ ) -> modal_proto.api_pb2.ImageJoinStreamingResponse: ...
53
80
 
54
81
  class _Image(modal.object._Object):
55
82
  force_build: bool
56
- inside_exceptions: typing.List[Exception]
57
-
58
- def _initialize_from_empty(self):
59
- ...
60
-
61
- def _hydrate_metadata(self, message: typing.Union[google.protobuf.message.Message, None]):
62
- ...
63
-
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): ...
64
95
  @staticmethod
65
- def _from_args(*, base_images: typing.Union[typing.Dict[str, _Image], None] = None, dockerfile_function: typing.Union[typing.Callable[[], 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):
66
- ...
67
-
68
- 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:
69
- ...
70
-
71
- def copy_mount(self, mount: modal.mount._Mount, remote_path: typing.Union[str, pathlib.Path] = '.') -> _Image:
72
- ...
73
-
74
- def copy_local_file(self, local_path: typing.Union[str, pathlib.Path], remote_path: typing.Union[str, pathlib.Path] = './') -> _Image:
75
- ...
76
-
77
- def copy_local_dir(self, local_path: typing.Union[str, pathlib.Path], remote_path: typing.Union[str, pathlib.Path] = '.') -> _Image:
78
- ...
79
-
80
- 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:
81
- ...
82
-
83
- 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:
84
- ...
85
-
86
- 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:
87
- ...
88
-
89
- 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:
90
- ...
91
-
92
- 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:
93
- ...
94
-
95
- 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:
96
- ...
97
-
98
- 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:
99
- ...
100
-
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: ...
101
141
  @staticmethod
102
- def conda(python_version: str = '3.9', force_build: bool = False) -> _Image:
103
- ...
104
-
105
- 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:
106
- ...
107
-
108
- 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:
109
- ...
110
-
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: ...
111
230
  @staticmethod
112
- def micromamba(python_version: str = '3.9', force_build: bool = False) -> _Image:
113
- ...
114
-
115
- 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:
116
- ...
117
-
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
+ ): ...
118
248
  @staticmethod
119
- def _registry_setup_commands(tag: str, setup_commands: typing.List[str], add_python: typing.Union[str, None]) -> typing.List[str]:
120
- ...
121
-
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: ...
122
259
  @staticmethod
123
- 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:
124
- ...
125
-
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]: ...
126
266
  @staticmethod
127
- 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:
128
- ...
129
-
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: ...
130
276
  @staticmethod
131
- 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:
132
- ...
133
-
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: ...
134
286
  @staticmethod
135
- 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:
136
- ...
137
-
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: ...
138
296
  @staticmethod
139
- def debian_slim(python_version: typing.Union[str, None] = None, force_build: bool = False) -> _Image:
140
- ...
141
-
142
- 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:
143
- ...
144
-
145
- 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:
146
- ...
147
-
148
- def env(self, vars: typing.Dict[str, str]) -> _Image:
149
- ...
150
-
151
- def workdir(self, path: str) -> _Image:
152
- ...
153
-
154
- def imports(self):
155
- ...
156
-
157
- def run_inside(self):
158
- ...
159
-
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]: ...
160
346
 
161
347
  class Image(modal.object.Object):
162
348
  force_build: bool
163
- inside_exceptions: typing.List[Exception]
164
-
165
- def __init__(self, *args, **kwargs):
166
- ...
167
-
168
- def _initialize_from_empty(self):
169
- ...
170
-
171
- def _hydrate_metadata(self, message: typing.Union[google.protobuf.message.Message, None]):
172
- ...
173
-
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): ...
174
362
  @staticmethod
175
- def _from_args(*, base_images: typing.Union[typing.Dict[str, Image], None] = None, dockerfile_function: typing.Union[typing.Callable[[], 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):
176
- ...
177
-
178
- def extend(self, **kwargs) -> Image:
179
- ...
180
-
181
- def copy_mount(self, mount: modal.mount.Mount, remote_path: typing.Union[str, pathlib.Path] = '.') -> Image:
182
- ...
183
-
184
- def copy_local_file(self, local_path: typing.Union[str, pathlib.Path], remote_path: typing.Union[str, pathlib.Path] = './') -> Image:
185
- ...
186
-
187
- def copy_local_dir(self, local_path: typing.Union[str, pathlib.Path], remote_path: typing.Union[str, pathlib.Path] = '.') -> Image:
188
- ...
189
-
190
- 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:
191
- ...
192
-
193
- 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:
194
- ...
195
-
196
- 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:
197
- ...
198
-
199
- 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:
200
- ...
201
-
202
- 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:
203
- ...
204
-
205
- 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:
206
- ...
207
-
208
- 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:
209
- ...
210
-
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: ...
211
502
  @staticmethod
212
- def conda(python_version: str = '3.9', force_build: bool = False) -> Image:
213
- ...
214
-
215
- 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:
216
- ...
217
-
218
- 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:
219
- ...
220
-
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
+ ): ...
221
520
  @staticmethod
222
- def micromamba(python_version: str = '3.9', force_build: bool = False) -> Image:
223
- ...
224
-
225
- 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:
226
- ...
227
-
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: ...
228
531
  @staticmethod
229
- def _registry_setup_commands(tag: str, setup_commands: typing.List[str], add_python: typing.Union[str, None]) -> typing.List[str]:
230
- ...
231
-
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]: ...
232
538
  @staticmethod
233
- 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:
234
- ...
235
-
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: ...
236
548
  @staticmethod
237
- 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:
238
- ...
239
-
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: ...
240
558
  @staticmethod
241
- 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:
242
- ...
243
-
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: ...
244
568
  @staticmethod
245
- 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:
246
- ...
247
-
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: ...
248
581
  @staticmethod
249
- def debian_slim(python_version: typing.Union[str, None] = None, force_build: bool = False) -> Image:
250
- ...
251
-
252
- 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:
253
- ...
254
-
255
- 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:
256
- ...
257
-
258
- def env(self, vars: typing.Dict[str, str]) -> Image:
259
- ...
260
-
261
- def workdir(self, path: str) -> Image:
262
- ...
263
-
264
- def imports(self):
265
- ...
266
-
267
- def run_inside(self):
268
- ...
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]]