modal 0.73.144__py3-none-any.whl → 0.73.146__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
modal/client.pyi CHANGED
@@ -31,7 +31,7 @@ class _Client:
31
31
  server_url: str,
32
32
  client_type: int,
33
33
  credentials: typing.Optional[tuple[str, str]],
34
- version: str = "0.73.144",
34
+ version: str = "0.73.146",
35
35
  ): ...
36
36
  def is_closed(self) -> bool: ...
37
37
  @property
@@ -93,7 +93,7 @@ class Client:
93
93
  server_url: str,
94
94
  client_type: int,
95
95
  credentials: typing.Optional[tuple[str, str]],
96
- version: str = "0.73.144",
96
+ version: str = "0.73.146",
97
97
  ): ...
98
98
  def is_closed(self) -> bool: ...
99
99
  @property
@@ -59,6 +59,9 @@ class _ContainerProcess(Generic[T]):
59
59
  )
60
60
  self._stdin = _StreamWriter(process_id, "container_process", self._client)
61
61
 
62
+ def __repr__(self) -> str:
63
+ return f"ContainerProcess(process_id={self._process_id!r})"
64
+
62
65
  @property
63
66
  def stdout(self) -> _StreamReader[T]:
64
67
  """StreamReader for the container process's stdout stream."""
@@ -107,7 +110,7 @@ class _ContainerProcess(Generic[T]):
107
110
  return self._returncode
108
111
 
109
112
  while True:
110
- req = api_pb2.ContainerExecWaitRequest(exec_id=self._process_id, timeout=50)
113
+ req = api_pb2.ContainerExecWaitRequest(exec_id=self._process_id, timeout=10)
111
114
  resp: api_pb2.ContainerExecWaitResponse = await retry_transient_errors(
112
115
  self._client.stub.ContainerExecWait, req
113
116
  )
@@ -24,6 +24,7 @@ class _ContainerProcess(typing.Generic[T]):
24
24
  text: bool = True,
25
25
  by_line: bool = False,
26
26
  ) -> None: ...
27
+ def __repr__(self) -> str: ...
27
28
  @property
28
29
  def stdout(self) -> modal.io_streams._StreamReader[T]: ...
29
30
  @property
@@ -56,6 +57,7 @@ class ContainerProcess(typing.Generic[T]):
56
57
  text: bool = True,
57
58
  by_line: bool = False,
58
59
  ) -> None: ...
60
+ def __repr__(self) -> str: ...
59
61
  @property
60
62
  def stdout(self) -> modal.io_streams.StreamReader[T]: ...
61
63
  @property
@@ -1,6 +1,8 @@
1
1
  # Copyright Modal Labs 2025
2
+ import os
2
3
  from dataclasses import dataclass
3
- from typing import Any, Callable, Optional
4
+ from pathlib import Path
5
+ from typing import Any, Callable, Literal, Optional, Union
4
6
 
5
7
  from modal_proto import api_pb2
6
8
 
@@ -12,6 +14,8 @@ from .._runtime.container_io_manager import _ContainerIOManager
12
14
  from .._utils.async_utils import synchronizer
13
15
  from ..client import _Client
14
16
  from ..exception import InvalidError
17
+ from ..image import DockerfileSpec, ImageBuilderVersion, _Image, _ImageRegistryConfig
18
+ from ..secret import _Secret
15
19
 
16
20
 
17
21
  def stop_fetching_inputs():
@@ -103,3 +107,82 @@ async def list_deployed_apps(environment_name: str = "", client: Optional[_Clien
103
107
  )
104
108
  )
105
109
  return app_infos
110
+
111
+
112
+ @synchronizer.create_blocking
113
+ async def raw_dockerfile_image(
114
+ path: Union[str, Path],
115
+ force_build: bool = False,
116
+ ) -> _Image:
117
+ """
118
+ Build a Modal Image from a local Dockerfile recipe without any changes.
119
+
120
+ Unlike for `modal.Image.from_dockerfile`, the provided recipe will not be embellished with
121
+ steps to install dependencies for the Modal client package. As a consequence, the resulting
122
+ Image cannot be used with a modal Function unless those dependencies are added in a subsequent
123
+ layer. It _can_ be directly used with a modal Sandbox, which does not need the Modal client.
124
+
125
+ We expect to support this experimental function until the `2025.04` Modal Image Builder is
126
+ stable, at which point Modal Image recipes will no longer install the client dependencies
127
+ by default. At that point, users can upgrade their Image Builder Version and migrate to
128
+ `modal.Image.from_dockerfile` for usecases supported by this function.
129
+
130
+ """
131
+
132
+ def build_dockerfile(version: ImageBuilderVersion) -> DockerfileSpec:
133
+ with open(os.path.expanduser(path)) as f:
134
+ commands = f.read().split("\n")
135
+ return DockerfileSpec(commands=commands, context_files={})
136
+
137
+ return _Image._from_args(
138
+ dockerfile_function=build_dockerfile,
139
+ force_build=force_build,
140
+ )
141
+
142
+
143
+ @synchronizer.create_blocking
144
+ async def raw_registry_image(
145
+ tag: str,
146
+ registry_secret: Optional[_Secret] = None,
147
+ credential_type: Literal["static", "aws", "gcp", None] = None,
148
+ force_build: bool = False,
149
+ ) -> _Image:
150
+ """
151
+ Build a Modal Image from a public or private image registry without any changes.
152
+
153
+ Unlike for `modal.Image.from_registry`, the provided recipe will not be embellished with
154
+ steps to install dependencies for the Modal client package. As a consequence, the resulting
155
+ Image cannot be used with a modal Function unless those dependencies are added in a subsequent
156
+ layer. It _can_ be directly used with a modal Sandbox, which does not need the Modal client.
157
+
158
+ We expect to support this experimental function until the `2025.04` Modal Image Builder is
159
+ stable, at which point Modal Image recipes will no longer install the client dependencies
160
+ by default. At that point, users can upgrade their Image Builder Version and migrate to
161
+ `modal.Image.from_registry` for usecases supported by this function.
162
+
163
+ """
164
+
165
+ def build_dockerfile(version: ImageBuilderVersion) -> DockerfileSpec:
166
+ commands = [f"FROM {tag}"]
167
+ return DockerfileSpec(commands=commands, context_files={})
168
+
169
+ if registry_secret:
170
+ if credential_type is None:
171
+ raise InvalidError("credential_type must be provided when using a registry_secret")
172
+ elif credential_type == "static":
173
+ auth_type = api_pb2.REGISTRY_AUTH_TYPE_STATIC_CREDS
174
+ elif credential_type == "aws":
175
+ auth_type = api_pb2.REGISTRY_AUTH_TYPE_AWS
176
+ elif credential_type == "gcp":
177
+ auth_type = api_pb2.REGISTRY_AUTH_TYPE_GCP
178
+ else:
179
+ raise InvalidError(f"Invalid credential_type: {credential_type!r}")
180
+ registry_config = _ImageRegistryConfig(auth_type, registry_secret)
181
+ else:
182
+ registry_config = None
183
+
184
+ return _Image._from_args(
185
+ dockerfile_function=build_dockerfile,
186
+ image_registry_config=registry_config,
187
+ force_build=force_build,
188
+ )
modal/image.py CHANGED
@@ -1562,7 +1562,7 @@ class _Image(_Object, type_prefix="im"):
1562
1562
  add_python: Optional[str] = None,
1563
1563
  **kwargs,
1564
1564
  ) -> "_Image":
1565
- """Build a Modal image from a public or private image registry, such as Docker Hub.
1565
+ """Build a Modal Image from a public or private image registry, such as Docker Hub.
1566
1566
 
1567
1567
  The image must be built for the `linux/amd64` platform.
1568
1568
 
modal/sandbox.py CHANGED
@@ -408,7 +408,7 @@ class _Sandbox(_Object, type_prefix="sb"):
408
408
  """Wait for the Sandbox to finish running."""
409
409
 
410
410
  while True:
411
- req = api_pb2.SandboxWaitRequest(sandbox_id=self.object_id, timeout=50)
411
+ req = api_pb2.SandboxWaitRequest(sandbox_id=self.object_id, timeout=10)
412
412
  resp = await retry_transient_errors(self._client.stub.SandboxWait, req)
413
413
  if resp.result.status:
414
414
  self._result = resp.result
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: modal
3
- Version: 0.73.144
3
+ Version: 0.73.146
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License: Apache-2.0
@@ -23,14 +23,14 @@ modal/app.py,sha256=NKH7Cw1M6eyyrMXFbhWfdo3uRd28-8kv0Pcw56kPiPU,47312
23
23
  modal/app.pyi,sha256=pUEqciyGZ446sc_QoG8XcQ_oc6oU-U4dqjkxjhgOX98,26968
24
24
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
25
25
  modal/client.py,sha256=j9D3hNis1lfhnz9lVFGgJgowbH3PaGUzNKgHPWYG778,15372
26
- modal/client.pyi,sha256=TPAHOAvhShPn02XTJTDuDHKZCGHH4NR5g0cg63AGJn0,7661
26
+ modal/client.pyi,sha256=bdRQ5vkT_ruyvdR7pZTK6l4qYekAEyH_AsyOXVQNDLo,7661
27
27
  modal/cloud_bucket_mount.py,sha256=YOe9nnvSr4ZbeCn587d7_VhE9IioZYRvF9VYQTQux08,5914
28
28
  modal/cloud_bucket_mount.pyi,sha256=30T3K1a89l6wzmEJ_J9iWv9SknoGqaZDx59Xs-ZQcmk,1607
29
29
  modal/cls.py,sha256=PJimWA9q_sbQJNLbYy7fzjZGBm_hdfXuuZ7O_pKLXdk,31586
30
30
  modal/cls.pyi,sha256=ZJUwtRaQBGlM6tphvnv49FHBVDSgttMdD_LnYyRSKJM,10302
31
31
  modal/config.py,sha256=Zx7YsllgIJzMRKeIkaGSLLtMFV4kTUvGxpptnmqlP1U,11623
32
- modal/container_process.py,sha256=WTqLn01dJPVkPpwR_0w_JH96ceN5mV4TGtiu1ZR2RRA,6108
33
- modal/container_process.pyi,sha256=Hf0J5JyDdCCXBJSKx6gvkPOo0XrztCm78xzxamtzUjQ,2828
32
+ modal/container_process.py,sha256=vvyK3DVPUMsuqvkKdUiQ49cDLF9JawGrxpglLk5vfgI,6208
33
+ modal/container_process.pyi,sha256=bXs2KHe7nxVuLAm6RRBqXCvDKelANGX9gFY8qIuZYDs,2898
34
34
  modal/dict.py,sha256=3Pb45IkfqcDGXu3VVStJVbC_QYk6RTRXrMbZxtByAAk,13354
35
35
  modal/dict.pyi,sha256=kKb0Kc6RUabtQ5Hwslg_vwL_OIrwIAJ2NXrJTepTtp4,7684
36
36
  modal/environments.py,sha256=mrOaS9hiIQijGWJYIgVKQnwC-kONhWHm1GqoK_9G75E,6924
@@ -42,7 +42,7 @@ modal/file_pattern_matcher.py,sha256=trosX-Bp7dOubudN1bLLhRAoidWy1TcoaR4Pv8CedWw
42
42
  modal/functions.py,sha256=kcNHvqeGBxPI7Cgd57NIBBghkfbeFJzXO44WW0jSmao,325
43
43
  modal/functions.pyi,sha256=PqApQjvICj11NIMEVCmaUIUyJUfEIuY_KkEzCZ4t6iI,14438
44
44
  modal/gpu.py,sha256=Kbhs_u49FaC2Zi0TjCdrpstpRtT5eZgecynmQi5IZVE,6752
45
- modal/image.py,sha256=5LQt3gqIUg-OCsrNgDBgnGxxjc-qpoKALh7orazzfns,92835
45
+ modal/image.py,sha256=HtkKomhX4inozqSRi7lf5Vt9IEqCnVHn5bEo59hD64A,92835
46
46
  modal/image.pyi,sha256=iWclz2rxaP-LSsYMgU0X3ZcN5mEFvpyKzIPKJbohmsg,25591
47
47
  modal/io_streams.py,sha256=h5O2LmbRoT9l777z3TQhCAm-JF1r7avZ2ykXlejztDs,15163
48
48
  modal/io_streams.pyi,sha256=bJ7ZLmSmJ0nKoa6r4FJpbqvzdUVa0lEe0Fa-MMpMezU,5071
@@ -66,7 +66,7 @@ modal/retries.py,sha256=IvNLDM0f_GLUDD5VgEDoN09C88yoxSrCquinAuxT1Sc,5205
66
66
  modal/runner.py,sha256=8jBg-gOjjYyteXMI01u6f7izYsGrABsFaByixeQlTmo,25126
67
67
  modal/runner.pyi,sha256=HW2pvC_PLwg1Es_EkrfQgMZsktIr9zzVEtmjOVFG6Dw,5351
68
68
  modal/running_app.py,sha256=v61mapYNV1-O-Uaho5EfJlryMLvIT9We0amUOSvSGx8,1188
69
- modal/sandbox.py,sha256=effbnWXqLwxj5ix7fFHyq3n5FJHtuv2qzpdN7XLZ4ds,32619
69
+ modal/sandbox.py,sha256=FRcMkVDfp39_ACbhR71iDJcT6xaqFXuCI3LKsLETHPc,32619
70
70
  modal/sandbox.pyi,sha256=cLmSwI1ab-2DgEuXNf6S1PiK63wfUR9dHtxlZtSOuX8,22719
71
71
  modal/schedule.py,sha256=0ZFpKs1bOxeo5n3HZjoL7OE2ktsb-_oGtq-WJEPO4tY,2615
72
72
  modal/scheduler_placement.py,sha256=BAREdOY5HzHpzSBqt6jDVR6YC_jYfHMVqOzkyqQfngU,1235
@@ -137,7 +137,7 @@ modal/cli/volume.py,sha256=c2IuVNO2yJVaXmZkRh3xwQmznlRTgFoJr_BIzzqtVv0,10251
137
137
  modal/cli/programs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
138
138
  modal/cli/programs/run_jupyter.py,sha256=MX6YQ6zRyRk1xo8tYZFiGam0p5KETwax81L6TpaS9I0,2778
139
139
  modal/cli/programs/vscode.py,sha256=kfvhZQ4bJwtVm3MgC1V7AlygZOlKT1a33alr_uwrewA,3473
140
- modal/experimental/__init__.py,sha256=6VY98HfgoQU-65ELJ4Re_PB3VBCjDMZywuK1oOvljkg,4025
140
+ modal/experimental/__init__.py,sha256=DXXQnYEjaRPcr1b4pbKk4DckHKtQ8T8PcWTUuXG4_ug,7595
141
141
  modal/experimental/ipython.py,sha256=epLUZeDSdE226TH_tU3igRKCiVuQi99mUOrIJ4SemOE,2792
142
142
  modal/requirements/2023.12.312.txt,sha256=zWWUVgVQ92GXBKNYYr2-5vn9rlnXcmkqlwlX5u1eTYw,400
143
143
  modal/requirements/2023.12.txt,sha256=OjsbXFkCSdkzzryZP82Q73osr5wxQ6EUzmGcK7twfkA,502
@@ -170,10 +170,10 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
170
170
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
171
171
  modal_version/__init__.py,sha256=wiJQ53c-OMs0Xf1UeXOxQ7FwlV1VzIjnX6o-pRYZ_Pk,470
172
172
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
173
- modal_version/_version_generated.py,sha256=oP8FBwJ_HKXD6yAhf1l_IrgPeFJSa6ZQvwv4tNoQVCI,150
174
- modal-0.73.144.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
175
- modal-0.73.144.dist-info/METADATA,sha256=w8KwgQdaRx180ZIspfveM_SM3EGHff-v9LndELGyNqA,2453
176
- modal-0.73.144.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
177
- modal-0.73.144.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
178
- modal-0.73.144.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
179
- modal-0.73.144.dist-info/RECORD,,
173
+ modal_version/_version_generated.py,sha256=qXFivVwqk3XozQgTf5wU8Dy4T77AmnPeQjIFqesEans,150
174
+ modal-0.73.146.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
175
+ modal-0.73.146.dist-info/METADATA,sha256=LxtkRG1reaAqP5lbyQUMlRKFAAt-lLGO7c5V_NfZ5Co,2453
176
+ modal-0.73.146.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
177
+ modal-0.73.146.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
178
+ modal-0.73.146.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
179
+ modal-0.73.146.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  # Copyright Modal Labs 2025
2
2
 
3
3
  # Note: Reset this value to -1 whenever you make a minor `0.X` release of the client.
4
- build_number = 144 # git: d3f70c8
4
+ build_number = 146 # git: 868bbba