flyte 2.0.0b7__py3-none-any.whl → 2.0.0b8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of flyte might be problematic. Click here for more details.
- flyte/_image.py +5 -3
- flyte/_internal/imagebuild/docker_builder.py +36 -17
- flyte/_internal/imagebuild/remote_builder.py +4 -16
- flyte/_internal/imagebuild/utils.py +29 -0
- flyte/_run.py +1 -1
- flyte/_version.py +3 -16
- flyte/cli/_get.py +1 -1
- flyte/cli/_run.py +17 -11
- flyte/remote/_action.py +1 -0
- flyte/remote/_logs.py +3 -3
- flyte/remote/_run.py +2 -1
- flyte/remote/_task.py +33 -7
- {flyte-2.0.0b7.dist-info → flyte-2.0.0b8.dist-info}/METADATA +1 -1
- {flyte-2.0.0b7.dist-info → flyte-2.0.0b8.dist-info}/RECORD +19 -18
- {flyte-2.0.0b7.data → flyte-2.0.0b8.data}/scripts/runtime.py +0 -0
- {flyte-2.0.0b7.dist-info → flyte-2.0.0b8.dist-info}/WHEEL +0 -0
- {flyte-2.0.0b7.dist-info → flyte-2.0.0b8.dist-info}/entry_points.txt +0 -0
- {flyte-2.0.0b7.dist-info → flyte-2.0.0b8.dist-info}/licenses/LICENSE +0 -0
- {flyte-2.0.0b7.dist-info → flyte-2.0.0b8.dist-info}/top_level.txt +0 -0
flyte/_image.py
CHANGED
|
@@ -154,6 +154,7 @@ class PipPackages(PipOption, Layer):
|
|
|
154
154
|
class PythonWheels(PipOption, Layer):
|
|
155
155
|
wheel_dir: Path = field(metadata={"identifier": False})
|
|
156
156
|
wheel_dir_name: str = field(init=False)
|
|
157
|
+
package_name: str
|
|
157
158
|
|
|
158
159
|
def __post_init__(self):
|
|
159
160
|
object.__setattr__(self, "wheel_dir_name", self.wheel_dir.name)
|
|
@@ -498,7 +499,8 @@ class Image:
|
|
|
498
499
|
image = image.with_pip_packages(f"flyte=={flyte_version}", pre=True)
|
|
499
500
|
else:
|
|
500
501
|
image = image.with_pip_packages(f"flyte=={flyte_version}")
|
|
501
|
-
|
|
502
|
+
if not dev_mode:
|
|
503
|
+
object.__setattr__(image, "_tag", preset_tag)
|
|
502
504
|
# Set this to auto for all auto images because the meaning of "auto" can change (based on logic inside
|
|
503
505
|
# _get_default_image_for, acts differently in a running task container) so let's make sure it stays auto.
|
|
504
506
|
object.__setattr__(image, "_identifier_override", "auto")
|
|
@@ -546,7 +548,7 @@ class Image:
|
|
|
546
548
|
platform=platform,
|
|
547
549
|
)
|
|
548
550
|
|
|
549
|
-
if registry
|
|
551
|
+
if registry or name:
|
|
550
552
|
return base_image.clone(registry=registry, name=name)
|
|
551
553
|
|
|
552
554
|
# # Set this to auto for all auto images because the meaning of "auto" can change (based on logic inside
|
|
@@ -940,7 +942,7 @@ class Image:
|
|
|
940
942
|
dist_folder = Path(__file__).parent.parent.parent / "dist"
|
|
941
943
|
# Manually declare the PythonWheel so we can set the hashing
|
|
942
944
|
# used to compute the identifier. Can remove if we ever decide to expose the lambda in with_ commands
|
|
943
|
-
with_dist = self.clone(addl_layer=PythonWheels(wheel_dir=dist_folder))
|
|
945
|
+
with_dist = self.clone(addl_layer=PythonWheels(wheel_dir=dist_folder, package_name="flyte", pre=True))
|
|
944
946
|
|
|
945
947
|
return with_dist
|
|
946
948
|
|
|
@@ -37,6 +37,7 @@ from flyte._internal.imagebuild.image_builder import (
|
|
|
37
37
|
LocalDockerCommandImageChecker,
|
|
38
38
|
LocalPodmanCommandImageChecker,
|
|
39
39
|
)
|
|
40
|
+
from flyte._internal.imagebuild.utils import copy_files_to_context
|
|
40
41
|
from flyte._logging import logger
|
|
41
42
|
|
|
42
43
|
_F_IMG_ID = "_F_IMG_ID"
|
|
@@ -109,7 +110,7 @@ RUN uv venv $$VIRTUALENV --python=$PYTHON_VERSION
|
|
|
109
110
|
|
|
110
111
|
# Adds nvidia just in case it exists
|
|
111
112
|
ENV PATH="$$PATH:/usr/local/nvidia/bin:/usr/local/cuda/bin" \
|
|
112
|
-
LD_LIBRARY_PATH="/usr/local/nvidia/lib64
|
|
113
|
+
LD_LIBRARY_PATH="/usr/local/nvidia/lib64"
|
|
113
114
|
""")
|
|
114
115
|
|
|
115
116
|
# This gets added on to the end of the dockerfile
|
|
@@ -128,30 +129,29 @@ class Handler(Protocol):
|
|
|
128
129
|
class PipAndRequirementsHandler:
|
|
129
130
|
@staticmethod
|
|
130
131
|
async def handle(layer: PipPackages, context_path: Path, dockerfile: str) -> str:
|
|
132
|
+
# Set pip_install_args based on the layer type - either a requirements file or a list of packages
|
|
131
133
|
if isinstance(layer, Requirements):
|
|
132
134
|
if not layer.file.exists():
|
|
133
135
|
raise FileNotFoundError(f"Requirements file {layer.file} does not exist")
|
|
134
136
|
if not layer.file.is_file():
|
|
135
137
|
raise ValueError(f"Requirements file {layer.file} is not a file")
|
|
136
138
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
requirements.append(requirement.strip())
|
|
139
|
+
# Copy the requirements file to the context path
|
|
140
|
+
requirements_path = copy_files_to_context(layer.file, context_path)
|
|
141
|
+
pip_install_args = layer.get_pip_install_args()
|
|
142
|
+
pip_install_args.extend(["--requirement", str(requirements_path)])
|
|
142
143
|
else:
|
|
143
144
|
requirements = list(layer.packages) if layer.packages else []
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
await f.write(reqs)
|
|
145
|
+
reqs = " ".join(requirements)
|
|
146
|
+
pip_install_args = layer.get_pip_install_args()
|
|
147
|
+
pip_install_args.append(reqs)
|
|
148
148
|
|
|
149
|
-
pip_install_args = layer.get_pip_install_args()
|
|
150
|
-
pip_install_args.extend(["--requirement", "requirements_uv.txt"])
|
|
151
149
|
secret_mounts = _get_secret_mounts_layer(layer.secret_mounts)
|
|
152
150
|
delta = UV_PACKAGE_INSTALL_COMMAND_TEMPLATE.substitute(
|
|
153
|
-
|
|
151
|
+
SECRET_MOUNT=secret_mounts,
|
|
152
|
+
PIP_INSTALL_ARGS=" ".join(pip_install_args),
|
|
154
153
|
)
|
|
154
|
+
|
|
155
155
|
dockerfile += delta
|
|
156
156
|
|
|
157
157
|
return dockerfile
|
|
@@ -162,12 +162,31 @@ class PythonWheelHandler:
|
|
|
162
162
|
async def handle(layer: PythonWheels, context_path: Path, dockerfile: str) -> str:
|
|
163
163
|
shutil.copytree(layer.wheel_dir, context_path / "dist", dirs_exist_ok=True)
|
|
164
164
|
pip_install_args = layer.get_pip_install_args()
|
|
165
|
-
pip_install_args.extend(["/dist/*.whl"])
|
|
166
165
|
secret_mounts = _get_secret_mounts_layer(layer.secret_mounts)
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
|
|
167
|
+
# First install: Install the wheel without dependencies using --no-deps
|
|
168
|
+
pip_install_args_no_deps = [
|
|
169
|
+
*pip_install_args,
|
|
170
|
+
*[
|
|
171
|
+
"--find-links",
|
|
172
|
+
"/dist",
|
|
173
|
+
"--no-deps",
|
|
174
|
+
"--no-index",
|
|
175
|
+
layer.package_name,
|
|
176
|
+
],
|
|
177
|
+
]
|
|
178
|
+
|
|
179
|
+
delta1 = UV_WHEEL_INSTALL_COMMAND_TEMPLATE.substitute(
|
|
180
|
+
PIP_INSTALL_ARGS=" ".join(pip_install_args_no_deps), SECRET_MOUNT=secret_mounts
|
|
169
181
|
)
|
|
170
|
-
dockerfile +=
|
|
182
|
+
dockerfile += delta1
|
|
183
|
+
|
|
184
|
+
# Second install: Install dependencies from PyPI
|
|
185
|
+
pip_install_args_deps = [*pip_install_args, layer.package_name]
|
|
186
|
+
delta2 = UV_WHEEL_INSTALL_COMMAND_TEMPLATE.substitute(
|
|
187
|
+
PIP_INSTALL_ARGS=" ".join(pip_install_args_deps), SECRET_MOUNT=secret_mounts
|
|
188
|
+
)
|
|
189
|
+
dockerfile += delta2
|
|
171
190
|
|
|
172
191
|
return dockerfile
|
|
173
192
|
|
|
@@ -26,6 +26,7 @@ from flyte._image import (
|
|
|
26
26
|
UVScript,
|
|
27
27
|
)
|
|
28
28
|
from flyte._internal.imagebuild.image_builder import ImageBuilder, ImageChecker
|
|
29
|
+
from flyte._internal.imagebuild.utils import copy_files_to_context
|
|
29
30
|
from flyte._logging import logger
|
|
30
31
|
from flyte.remote import ActionOutputs, Run
|
|
31
32
|
|
|
@@ -169,7 +170,7 @@ def _get_layers_proto(image: Image, context_path: Path) -> "image_definition_pb2
|
|
|
169
170
|
)
|
|
170
171
|
layers.append(apt_layer)
|
|
171
172
|
elif isinstance(layer, PythonWheels):
|
|
172
|
-
dst_path =
|
|
173
|
+
dst_path = copy_files_to_context(layer.wheel_dir, context_path)
|
|
173
174
|
wheel_layer = image_definition_pb2.Layer(
|
|
174
175
|
python_wheels=image_definition_pb2.PythonWheels(
|
|
175
176
|
dir=str(dst_path.relative_to(context_path)),
|
|
@@ -184,7 +185,7 @@ def _get_layers_proto(image: Image, context_path: Path) -> "image_definition_pb2
|
|
|
184
185
|
layers.append(wheel_layer)
|
|
185
186
|
|
|
186
187
|
elif isinstance(layer, Requirements):
|
|
187
|
-
dst_path =
|
|
188
|
+
dst_path = copy_files_to_context(layer.file, context_path)
|
|
188
189
|
requirements_layer = image_definition_pb2.Layer(
|
|
189
190
|
requirements=image_definition_pb2.Requirements(
|
|
190
191
|
file=str(dst_path.relative_to(context_path)),
|
|
@@ -240,7 +241,7 @@ def _get_layers_proto(image: Image, context_path: Path) -> "image_definition_pb2
|
|
|
240
241
|
elif isinstance(layer, DockerIgnore):
|
|
241
242
|
shutil.copy(layer.path, context_path)
|
|
242
243
|
elif isinstance(layer, CopyConfig):
|
|
243
|
-
dst_path =
|
|
244
|
+
dst_path = copy_files_to_context(layer.src, context_path)
|
|
244
245
|
|
|
245
246
|
copy_layer = image_definition_pb2.Layer(
|
|
246
247
|
copy_config=image_definition_pb2.CopyConfig(
|
|
@@ -264,18 +265,5 @@ def _get_layers_proto(image: Image, context_path: Path) -> "image_definition_pb2
|
|
|
264
265
|
)
|
|
265
266
|
|
|
266
267
|
|
|
267
|
-
def _copy_files_to_context(src: Path, context_path: Path) -> Path:
|
|
268
|
-
if src.is_absolute() or ".." in str(src):
|
|
269
|
-
dst_path = context_path / str(src.absolute()).replace("/", "./_flyte_abs_context/", 1)
|
|
270
|
-
else:
|
|
271
|
-
dst_path = context_path / src
|
|
272
|
-
dst_path.parent.mkdir(parents=True, exist_ok=True)
|
|
273
|
-
if src.is_dir():
|
|
274
|
-
shutil.copytree(src, dst_path, dirs_exist_ok=True)
|
|
275
|
-
else:
|
|
276
|
-
shutil.copy(src, dst_path)
|
|
277
|
-
return dst_path
|
|
278
|
-
|
|
279
|
-
|
|
280
268
|
def _get_fully_qualified_image_name(outputs: ActionOutputs) -> str:
|
|
281
269
|
return outputs.pb2.literals[0].value.scalar.primitive.string_value
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import shutil
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def copy_files_to_context(src: Path, context_path: Path) -> Path:
|
|
6
|
+
"""
|
|
7
|
+
This helper function ensures that absolute paths that users specify are converted correctly to a path in the
|
|
8
|
+
context directory. Doing this prevents collisions while ensuring files are available in the context.
|
|
9
|
+
|
|
10
|
+
For example, if a user has
|
|
11
|
+
img.with_requirements(Path("/Users/username/requirements.txt"))
|
|
12
|
+
.with_requirements(Path("requirements.txt"))
|
|
13
|
+
.with_requirements(Path("../requirements.txt"))
|
|
14
|
+
|
|
15
|
+
copying with this function ensures that the Docker context folder has all three files.
|
|
16
|
+
|
|
17
|
+
:param src: The source path to copy
|
|
18
|
+
:param context_path: The context path where the files should be copied to
|
|
19
|
+
"""
|
|
20
|
+
if src.is_absolute() or ".." in str(src):
|
|
21
|
+
dst_path = context_path / str(src.absolute()).replace("/", "./_flyte_abs_context/", 1)
|
|
22
|
+
else:
|
|
23
|
+
dst_path = context_path / src
|
|
24
|
+
dst_path.parent.mkdir(parents=True, exist_ok=True)
|
|
25
|
+
if src.is_dir():
|
|
26
|
+
shutil.copytree(src, dst_path, dirs_exist_ok=True)
|
|
27
|
+
else:
|
|
28
|
+
shutil.copy(src, dst_path)
|
|
29
|
+
return dst_path
|
flyte/_run.py
CHANGED
|
@@ -512,7 +512,7 @@ class _Runner:
|
|
|
512
512
|
raise ValueError("Remote task can only be run in remote mode.")
|
|
513
513
|
|
|
514
514
|
if not isinstance(task, TaskTemplate) and not isinstance(task, LazyEntity):
|
|
515
|
-
raise TypeError("On Flyte tasks can be run, not generic functions or methods.")
|
|
515
|
+
raise TypeError(f"On Flyte tasks can be run, not generic functions or methods '{type(task)}'.")
|
|
516
516
|
|
|
517
517
|
if self._mode == "remote":
|
|
518
518
|
return await self._run_remote(task, *args, **kwargs)
|
flyte/_version.py
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
# file generated by setuptools-scm
|
|
2
2
|
# don't change, don't track in version control
|
|
3
3
|
|
|
4
|
-
__all__ = [
|
|
5
|
-
"__version__",
|
|
6
|
-
"__version_tuple__",
|
|
7
|
-
"version",
|
|
8
|
-
"version_tuple",
|
|
9
|
-
"__commit_id__",
|
|
10
|
-
"commit_id",
|
|
11
|
-
]
|
|
4
|
+
__all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
|
|
12
5
|
|
|
13
6
|
TYPE_CHECKING = False
|
|
14
7
|
if TYPE_CHECKING:
|
|
@@ -16,19 +9,13 @@ if TYPE_CHECKING:
|
|
|
16
9
|
from typing import Union
|
|
17
10
|
|
|
18
11
|
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
19
|
-
COMMIT_ID = Union[str, None]
|
|
20
12
|
else:
|
|
21
13
|
VERSION_TUPLE = object
|
|
22
|
-
COMMIT_ID = object
|
|
23
14
|
|
|
24
15
|
version: str
|
|
25
16
|
__version__: str
|
|
26
17
|
__version_tuple__: VERSION_TUPLE
|
|
27
18
|
version_tuple: VERSION_TUPLE
|
|
28
|
-
commit_id: COMMIT_ID
|
|
29
|
-
__commit_id__: COMMIT_ID
|
|
30
19
|
|
|
31
|
-
__version__ = version = '2.0.
|
|
32
|
-
__version_tuple__ = version_tuple = (2, 0, 0, '
|
|
33
|
-
|
|
34
|
-
__commit_id__ = commit_id = 'g5cfd1e5ec'
|
|
20
|
+
__version__ = version = '2.0.0b8'
|
|
21
|
+
__version_tuple__ = version_tuple = (2, 0, 0, 'b8')
|
flyte/cli/_get.py
CHANGED
flyte/cli/_run.py
CHANGED
|
@@ -116,7 +116,7 @@ class RunTaskCommand(click.Command):
|
|
|
116
116
|
"Run",
|
|
117
117
|
f"[green bold]Created Run: {r.name} [/green bold] "
|
|
118
118
|
f"(Project: {r.action.action_id.run.project}, Domain: {r.action.action_id.run.domain})\n"
|
|
119
|
-
f"➡️ [blue bold]{r.url}[/blue bold]",
|
|
119
|
+
f"➡️ [blue bold][link={r.url}]{r.url}[/link][/blue bold]",
|
|
120
120
|
obj.output_format,
|
|
121
121
|
)
|
|
122
122
|
)
|
|
@@ -125,7 +125,7 @@ class RunTaskCommand(click.Command):
|
|
|
125
125
|
"[dim]Log streaming enabled, will wait for task to start running "
|
|
126
126
|
"and log stream to be available[/dim]"
|
|
127
127
|
)
|
|
128
|
-
await r.show_logs(max_lines=30, show_ts=True, raw=False)
|
|
128
|
+
await r.show_logs.aio(max_lines=30, show_ts=True, raw=False)
|
|
129
129
|
|
|
130
130
|
asyncio.run(_run())
|
|
131
131
|
|
|
@@ -212,21 +212,27 @@ run = TaskFiles(
|
|
|
212
212
|
Run a task from a python file.
|
|
213
213
|
|
|
214
214
|
Example usage:
|
|
215
|
+
|
|
215
216
|
```bash
|
|
216
|
-
flyte run --
|
|
217
|
+
flyte run --project my-project --domain development hello.py my_task --arg1 value1 --arg2 value2
|
|
217
218
|
```
|
|
218
|
-
Note: all arguments for the run command are provided right after the `run` command and before the file name.
|
|
219
219
|
|
|
220
|
-
|
|
221
|
-
|
|
220
|
+
Arguments to the run command are provided right after the `run` command and before the file name.
|
|
221
|
+
For example, the command above specifies the project and domain.
|
|
222
|
+
|
|
223
|
+
To run a task locally, use the `--local` flag. This will run the task in the local environment instead of the remote
|
|
224
|
+
Flyte environment:
|
|
222
225
|
|
|
223
|
-
Note: The arguments for the task are provided after the task name and can be retrieved using `--help`
|
|
224
|
-
Example:
|
|
225
226
|
```bash
|
|
226
|
-
flyte run --
|
|
227
|
+
flyte run --local hello.py my_task --arg1 value1 --arg2 value2
|
|
227
228
|
```
|
|
228
229
|
|
|
229
|
-
|
|
230
|
-
|
|
230
|
+
Other arguments to the run command are listed below.
|
|
231
|
+
|
|
232
|
+
Arguments for the task itself are provided after the task name and can be retrieved using `--help`. For example:
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
flyte run hello.py my_task --help
|
|
236
|
+
```
|
|
231
237
|
""",
|
|
232
238
|
)
|
flyte/remote/_action.py
CHANGED
flyte/remote/_logs.py
CHANGED
|
@@ -30,7 +30,7 @@ def _format_line(logline: payload_pb2.LogLine, show_ts: bool, filter_system: boo
|
|
|
30
30
|
if logline.originator == payload_pb2.LogLineOriginator.SYSTEM:
|
|
31
31
|
return None
|
|
32
32
|
style = style_map.get(logline.originator, "")
|
|
33
|
-
if "flyte" in logline.message and "flyte.errors" not in logline.message:
|
|
33
|
+
if "[flyte]" in logline.message and "flyte.errors" not in logline.message:
|
|
34
34
|
if filter_system:
|
|
35
35
|
return None
|
|
36
36
|
style = "dim"
|
|
@@ -101,7 +101,7 @@ class Logs:
|
|
|
101
101
|
cls,
|
|
102
102
|
action_id: identifier_pb2.ActionIdentifier,
|
|
103
103
|
attempt: int = 1,
|
|
104
|
-
retry: int =
|
|
104
|
+
retry: int = 5,
|
|
105
105
|
) -> AsyncGenerator[payload_pb2.LogLine, None]:
|
|
106
106
|
"""
|
|
107
107
|
Tail the logs for a given action ID and attempt.
|
|
@@ -135,7 +135,7 @@ class Logs:
|
|
|
135
135
|
f"Log stream not available for action {action_id.name} in run {action_id.run.name}."
|
|
136
136
|
)
|
|
137
137
|
else:
|
|
138
|
-
await asyncio.sleep(
|
|
138
|
+
await asyncio.sleep(2)
|
|
139
139
|
|
|
140
140
|
@classmethod
|
|
141
141
|
async def create_viewer(
|
flyte/remote/_run.py
CHANGED
|
@@ -141,6 +141,7 @@ class Run(ToJSONMixin):
|
|
|
141
141
|
"""
|
|
142
142
|
return self.action.watch(cache_data_on_done=cache_data_on_done)
|
|
143
143
|
|
|
144
|
+
@syncify
|
|
144
145
|
async def show_logs(
|
|
145
146
|
self,
|
|
146
147
|
attempt: int | None = None,
|
|
@@ -149,7 +150,7 @@ class Run(ToJSONMixin):
|
|
|
149
150
|
raw: bool = False,
|
|
150
151
|
filter_system: bool = False,
|
|
151
152
|
):
|
|
152
|
-
await self.action.show_logs(attempt, max_lines, show_ts, raw, filter_system=filter_system)
|
|
153
|
+
await self.action.show_logs.aio(attempt, max_lines, show_ts, raw, filter_system=filter_system)
|
|
153
154
|
|
|
154
155
|
@syncify
|
|
155
156
|
async def details(self) -> RunDetails:
|
flyte/remote/_task.py
CHANGED
|
@@ -3,9 +3,10 @@ from __future__ import annotations
|
|
|
3
3
|
import functools
|
|
4
4
|
from dataclasses import dataclass
|
|
5
5
|
from threading import Lock
|
|
6
|
-
from typing import Any, AsyncIterator, Callable, Coroutine, Dict, Iterator, Literal, Optional, Tuple, Union
|
|
6
|
+
from typing import Any, AsyncIterator, Callable, Coroutine, Dict, Iterator, Literal, Optional, Tuple, Union, cast
|
|
7
7
|
|
|
8
8
|
import rich.repr
|
|
9
|
+
from flyteidl.core import literals_pb2
|
|
9
10
|
from google.protobuf import timestamp
|
|
10
11
|
|
|
11
12
|
import flyte
|
|
@@ -13,6 +14,8 @@ import flyte.errors
|
|
|
13
14
|
from flyte._cache.cache import CacheBehavior
|
|
14
15
|
from flyte._context import internal_ctx
|
|
15
16
|
from flyte._initialize import ensure_client, get_client, get_common_config
|
|
17
|
+
from flyte._internal.runtime.resources_serde import get_proto_resources
|
|
18
|
+
from flyte._internal.runtime.task_serde import get_proto_retry_strategy, get_proto_timeout, get_security_context
|
|
16
19
|
from flyte._logging import logger
|
|
17
20
|
from flyte._protos.common import identifier_pb2, list_pb2
|
|
18
21
|
from flyte._protos.workflow import task_definition_pb2, task_service_pb2
|
|
@@ -64,6 +67,15 @@ class LazyEntity:
|
|
|
64
67
|
raise RuntimeError(f"Error downloading the task {self._name}, (check original exception...)")
|
|
65
68
|
return self._task
|
|
66
69
|
|
|
70
|
+
@syncify
|
|
71
|
+
async def override(
|
|
72
|
+
self,
|
|
73
|
+
**kwargs: Any,
|
|
74
|
+
) -> LazyEntity:
|
|
75
|
+
task_details = cast(TaskDetails, await self.fetch.aio())
|
|
76
|
+
task_details.override(**kwargs)
|
|
77
|
+
return self
|
|
78
|
+
|
|
67
79
|
async def __call__(self, *args, **kwargs):
|
|
68
80
|
"""
|
|
69
81
|
Forwards the call to the underlying task. The entity will be fetched if not already present
|
|
@@ -271,19 +283,33 @@ class TaskDetails(ToJSONMixin):
|
|
|
271
283
|
def override(
|
|
272
284
|
self,
|
|
273
285
|
*,
|
|
274
|
-
local: Optional[bool] = None,
|
|
275
|
-
ref: Optional[bool] = None,
|
|
276
286
|
resources: Optional[flyte.Resources] = None,
|
|
277
|
-
cache: flyte.CacheRequest = "auto",
|
|
278
287
|
retries: Union[int, flyte.RetryStrategy] = 0,
|
|
279
288
|
timeout: Optional[flyte.TimeoutType] = None,
|
|
280
|
-
reusable: Union[flyte.ReusePolicy, Literal["auto"], None] = None,
|
|
281
289
|
env: Optional[Dict[str, str]] = None,
|
|
282
290
|
secrets: Optional[flyte.SecretRequest] = None,
|
|
283
|
-
max_inline_io_bytes: int | None = None,
|
|
284
291
|
**kwargs: Any,
|
|
285
292
|
) -> TaskDetails:
|
|
286
|
-
|
|
293
|
+
if len(kwargs) > 0:
|
|
294
|
+
raise ValueError(
|
|
295
|
+
f"ReferenceTasks [{self.name}] do not support overriding with kwargs: {kwargs}, "
|
|
296
|
+
f"Check the parameters for override method."
|
|
297
|
+
)
|
|
298
|
+
template = self.pb2.spec.task_template
|
|
299
|
+
if secrets:
|
|
300
|
+
template.security_context.CopyFrom(get_security_context(secrets))
|
|
301
|
+
if template.HasField("container"):
|
|
302
|
+
if env:
|
|
303
|
+
template.container.env.clear()
|
|
304
|
+
template.container.env.extend([literals_pb2.KeyValuePair(key=k, value=v) for k, v in env.items()])
|
|
305
|
+
if resources:
|
|
306
|
+
template.container.resources.CopyFrom(get_proto_resources(resources))
|
|
307
|
+
if retries:
|
|
308
|
+
template.metadata.retries.CopyFrom(get_proto_retry_strategy(retries))
|
|
309
|
+
if timeout:
|
|
310
|
+
template.metadata.timeout.CopyFrom(get_proto_timeout(timeout))
|
|
311
|
+
|
|
312
|
+
return self
|
|
287
313
|
|
|
288
314
|
def __rich_repr__(self) -> rich.repr.Result:
|
|
289
315
|
"""
|
|
@@ -8,7 +8,7 @@ flyte/_environment.py,sha256=6ks0lkvGt4oSqM5EFPFlhWC3eoUghxUvCn0wstcAD2E,3713
|
|
|
8
8
|
flyte/_excepthook.py,sha256=nXts84rzEg6-7RtFarbKzOsRZTQR4plnbWVIFMAEprs,1310
|
|
9
9
|
flyte/_group.py,sha256=7o1j16sZyUmYB50mOiq1ui4TBAKhRpDqLakV8Ya1kw4,803
|
|
10
10
|
flyte/_hash.py,sha256=Of_Zl_DzzzF2jp4ZsLm-3o-xJFCCJ8_GubmLI1htx78,504
|
|
11
|
-
flyte/_image.py,sha256=
|
|
11
|
+
flyte/_image.py,sha256=m7wuVTS5xGQrYgS58hEBXJ8GY7YcYMvgPtNp3fRm2fA,37392
|
|
12
12
|
flyte/_initialize.py,sha256=xKl_LYMluRt21wWqa6RTKuLo0_DCbSaTfUk27_brtNk,18232
|
|
13
13
|
flyte/_interface.py,sha256=1B9zIwFDjiVp_3l_mk8EpA4g3Re-6DUBEBi9z9vDvPs,3504
|
|
14
14
|
flyte/_logging.py,sha256=QrT4Z30C2tsZ-yIojisQODTuq6Y6zSJYuTrLgF58UYc,3664
|
|
@@ -17,7 +17,7 @@ flyte/_pod.py,sha256=--72b0c6IkOEbBwZPLmgl-ll-j7ECfG-kh75LzBnNN8,1068
|
|
|
17
17
|
flyte/_resources.py,sha256=L2JuvQDlMo1JLJeUmJPRwtWbunhR2xJEhFgQW5yc72c,9690
|
|
18
18
|
flyte/_retry.py,sha256=rfLv0MvWxzPByKESTglEmjPsytEAKiIvvmzlJxXwsfE,941
|
|
19
19
|
flyte/_reusable_environment.py,sha256=f8Y1GilUwGcXH4n2Fckrnx0SrZmhk3nCfoe-TqUKivI,3740
|
|
20
|
-
flyte/_run.py,sha256=
|
|
20
|
+
flyte/_run.py,sha256=LEZQFhIUf9retXvNrzPN2HV-LkTX77dK7YmL8L0zQmk,25678
|
|
21
21
|
flyte/_secret.py,sha256=89VIihdXI03irHb217GMfipt7jzXBafm17YYmyv6gHo,3245
|
|
22
22
|
flyte/_task.py,sha256=FUqGDtDmhOVPdv-UVko4h0oecoAcc3JZKu8S__cwUpY,19805
|
|
23
23
|
flyte/_task_environment.py,sha256=hblOR-B_Cc6ibpFkedZSyN6V9vi0_vZ0132YKN5D4EM,9826
|
|
@@ -25,7 +25,7 @@ flyte/_task_plugins.py,sha256=9MH3nFPOH_e8_92BT4sFk4oyAnj6GJFvaPYWaraX7yE,1037
|
|
|
25
25
|
flyte/_timeout.py,sha256=zx5sFcbYmjJAJbZWSGzzX-BpC9HC7Jfs35T7vVhKwkk,1571
|
|
26
26
|
flyte/_tools.py,sha256=tWb0sx3t3mm4jbaQVjCTc9y39oR_Ibo3z_KHToP3Lto,966
|
|
27
27
|
flyte/_trace.py,sha256=SSE1nzUgmVTS2xFNtchEOjEjlRavMOIInasXzY8i9lU,4911
|
|
28
|
-
flyte/_version.py,sha256=
|
|
28
|
+
flyte/_version.py,sha256=_KVkHM5e9KFXaa0WlXQpBKZVOwVoURoWGQnGv9wA_0A,519
|
|
29
29
|
flyte/errors.py,sha256=z28rhbNmJF5Ie7quQWtoSL4K5p_tC3QjZDIZTupNQFw,6395
|
|
30
30
|
flyte/extend.py,sha256=GB4ZedGzKa30vYWRVPOdxEeK62xnUVFY4z2tD6H9eEw,376
|
|
31
31
|
flyte/models.py,sha256=2TgfrkPPgcnnk1P_MO5SEmOYAUbsMKl3gxIDwhW2yEU,15674
|
|
@@ -53,9 +53,10 @@ flyte/_internal/controllers/remote/_core.py,sha256=R-gm0tFzsdvyCbrPs0zikXCnzyaTe
|
|
|
53
53
|
flyte/_internal/controllers/remote/_informer.py,sha256=w4p29_dzS_ns762eNBljvnbJLgCm36d1Ogo2ZkgV1yg,14418
|
|
54
54
|
flyte/_internal/controllers/remote/_service_protocol.py,sha256=B9qbIg6DiGeac-iSccLmX_AL2xUgX4ezNUOiAbSy4V0,1357
|
|
55
55
|
flyte/_internal/imagebuild/__init__.py,sha256=dwXdJ1jMhw9RF8itF7jkPLanvX1yCviSns7hE5eoIts,102
|
|
56
|
-
flyte/_internal/imagebuild/docker_builder.py,sha256=
|
|
56
|
+
flyte/_internal/imagebuild/docker_builder.py,sha256=Lb9kKmBcEDKaWmyxgHW15BBYRMEQknM72pw8BNfRpTA,21160
|
|
57
57
|
flyte/_internal/imagebuild/image_builder.py,sha256=dXBXl62qcPabus6dR3eP8P9mBGNhpZHZ2Xm12AymKkk,11150
|
|
58
|
-
flyte/_internal/imagebuild/remote_builder.py,sha256=
|
|
58
|
+
flyte/_internal/imagebuild/remote_builder.py,sha256=S83QZc5nblQaEyTKn2vxQdvLBIDtvNhDDKRjjjFJ-to,10622
|
|
59
|
+
flyte/_internal/imagebuild/utils.py,sha256=_ULn4jzoffXbuFpB-o_Lro-PvZ9KObYgtELC31NXsgM,1160
|
|
59
60
|
flyte/_internal/resolvers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
60
61
|
flyte/_internal/resolvers/_task_module.py,sha256=jwy1QYygUK7xmpCZLt1SPTfJCkfox3Ck3mTlTsm66UI,1973
|
|
61
62
|
flyte/_internal/resolvers/common.py,sha256=ADQLRoyGsJ4vuUkitffMGrMKKjy0vpk6X53g4FuKDLc,993
|
|
@@ -163,10 +164,10 @@ flyte/cli/_create.py,sha256=tXDhZAdsxvpQ4ngO4U-PhyYwzQ3Hi2AJrNtZ3eqJptQ,5541
|
|
|
163
164
|
flyte/cli/_delete.py,sha256=VTmXv09PBjkdtyl23mbSjIQQlN7Y1AI_bO0GkHP-f9E,546
|
|
164
165
|
flyte/cli/_deploy.py,sha256=sDbO8gobXR4O0Vlp3RKEH-kBSr25BiXJIoHVwau9Occ,8877
|
|
165
166
|
flyte/cli/_gen.py,sha256=ni3E65_wSBc9x5NNbq1REuxfZCJz-ioLMVQnZIgwyYg,5745
|
|
166
|
-
flyte/cli/_get.py,sha256=
|
|
167
|
+
flyte/cli/_get.py,sha256=lzjg62at9oAswuOBORlg5B-LSRrNJgC6C2UViQuzBgk,10343
|
|
167
168
|
flyte/cli/_option.py,sha256=oC1Gs0u0UrOC1SsrFo-iCuAkqQvI1wJWCdjYXA9rW4Q,1445
|
|
168
169
|
flyte/cli/_params.py,sha256=8Gj8UYGHwu-SUXGWCTRX5QsVf19NiajhaUMMae6FF9o,19466
|
|
169
|
-
flyte/cli/_run.py,sha256=
|
|
170
|
+
flyte/cli/_run.py,sha256=qf_E60ZMT06g6j50P1_q5_y0uslIF9FQZE3s4PHycmg,7787
|
|
170
171
|
flyte/cli/main.py,sha256=t5Ivjipd6bVHIGjRBGwkeP577j59ASq9c1wgoNf3h2c,5334
|
|
171
172
|
flyte/config/__init__.py,sha256=MiwEYK5Iv7MRR22z61nzbsbvZ9Q6MdmAU_g9If1Pmb8,144
|
|
172
173
|
flyte/config/_config.py,sha256=WElU--Kw4MM9zx1v-rLD8qYu2T5Zk0-1QbTpkEc27bc,10779
|
|
@@ -182,15 +183,15 @@ flyte/io/_dataframe/__init__.py,sha256=SDgNw45uf7m3cHhbUCOA3V3-5A2zSKgPcsWriRLwd
|
|
|
182
183
|
flyte/io/_dataframe/basic_dfs.py,sha256=weQ8EfzdU-LcKi8Eebq1AiATVS1fGdfcbqtCDOrVLos,7728
|
|
183
184
|
flyte/io/_dataframe/dataframe.py,sha256=uecLLjaAuLyYta2d4Tkk-DjxuHkzZjFUBbvMapPM7R8,51554
|
|
184
185
|
flyte/remote/__init__.py,sha256=y9eke9JzEJkygk8eKZjSj44fJGlyepuW4i-j6lbCAPY,617
|
|
185
|
-
flyte/remote/_action.py,sha256=
|
|
186
|
+
flyte/remote/_action.py,sha256=aLaX0-mfFNjOPAB1pskxLbgrljpbvXuvdpGCpU2k7Go,23949
|
|
186
187
|
flyte/remote/_common.py,sha256=2XLLxWL1NjwfdPQUhOfYn3zMrg-yGNfi6NYIaqHutUA,862
|
|
187
188
|
flyte/remote/_console.py,sha256=avmELJPx8nQMAVPrHlh6jEIRPjrMwFpdZjJsWOOa9rE,660
|
|
188
189
|
flyte/remote/_data.py,sha256=zYXXlqEvPdsC44Gm7rP_hQjRgVe3EFfhZNEWKF0p4MQ,6163
|
|
189
|
-
flyte/remote/_logs.py,sha256=
|
|
190
|
+
flyte/remote/_logs.py,sha256=t4H7DEZDYJC9Vx7oJ7R7m4Z56bWBAjm9ylU4UP1hKq0,6711
|
|
190
191
|
flyte/remote/_project.py,sha256=IbkxKRAvZunKLIwpmcreA4O-0GxWC0KPC62WSYvsK34,2868
|
|
191
|
-
flyte/remote/_run.py,sha256=
|
|
192
|
+
flyte/remote/_run.py,sha256=FtIIMNODQGyc6oYLmuI_ku3bUxhDFIE-UU7ecMNZvBg,10018
|
|
192
193
|
flyte/remote/_secret.py,sha256=CF9WiZKeMJaUNeIawVPf8XHk9OjFt2wc0m7S9ZOdGbE,4399
|
|
193
|
-
flyte/remote/_task.py,sha256=
|
|
194
|
+
flyte/remote/_task.py,sha256=23sDeYYtcvqNqK51pRB2hmTeBxAmKr1aIbrR6rpKqKg,16693
|
|
194
195
|
flyte/remote/_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
195
196
|
flyte/remote/_client/_protocols.py,sha256=JyBWHs5WsVOxEDUyG9X7wPLDzzzjkoaNhJlU-X4YlN0,5599
|
|
196
197
|
flyte/remote/_client/controlplane.py,sha256=FsOfj4rO4MIMnYrpAT53F8q588VVf5t4sDuwoPuc840,3102
|
|
@@ -229,10 +230,10 @@ flyte/types/_renderer.py,sha256=ygcCo5l60lHufyQISFddZfWwLlQ8kJAKxUT_XnR_6dY,4818
|
|
|
229
230
|
flyte/types/_string_literals.py,sha256=NlG1xV8RSA-sZ-n-IFQCAsdB6jXJOAKkHWtnopxVVDk,4231
|
|
230
231
|
flyte/types/_type_engine.py,sha256=Tas_OXYddOi0nDuORjqan2SkJ96wKD8937I2l1bo8vk,97916
|
|
231
232
|
flyte/types/_utils.py,sha256=pbts9E1_2LTdLygAY0UYTLYJ8AsN3BZyviSXvrtcutc,2626
|
|
232
|
-
flyte-2.0.
|
|
233
|
-
flyte-2.0.
|
|
234
|
-
flyte-2.0.
|
|
235
|
-
flyte-2.0.
|
|
236
|
-
flyte-2.0.
|
|
237
|
-
flyte-2.0.
|
|
238
|
-
flyte-2.0.
|
|
233
|
+
flyte-2.0.0b8.data/scripts/runtime.py,sha256=8U_tIhdF8phBLDFr0U1xv92OKK5RquiaTJFv8v_fIgQ,5537
|
|
234
|
+
flyte-2.0.0b8.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
235
|
+
flyte-2.0.0b8.dist-info/METADATA,sha256=yDQq8HfWnmk2QGtx8tsYwZqPm1gK26W_Dvjs5Pf7IeM,10004
|
|
236
|
+
flyte-2.0.0b8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
237
|
+
flyte-2.0.0b8.dist-info/entry_points.txt,sha256=MIq2z5dBurdCJfpXfMKzgBv7sJOakKRYxr8G0cMiTrg,75
|
|
238
|
+
flyte-2.0.0b8.dist-info/top_level.txt,sha256=7dkyFbikvA12LEZEqawx8oDG1CMod6hTliPj7iWzgYo,6
|
|
239
|
+
flyte-2.0.0b8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|