flyte 0.2.0b5__py3-none-any.whl → 0.2.0b7__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/__init__.py +2 -1
- flyte/_code_bundle/_utils.py +0 -16
- flyte/_code_bundle/bundle.py +1 -1
- flyte/_initialize.py +52 -23
- flyte/_internal/controllers/remote/_core.py +1 -1
- flyte/_version.py +2 -2
- flyte/cli/_common.py +23 -15
- flyte/cli/_run.py +12 -6
- flyte/cli/main.py +15 -9
- flyte/config/__init__.py +2 -189
- flyte/config/_config.py +181 -172
- flyte/config/_internal.py +1 -1
- flyte/config/_reader.py +207 -0
- flyte/remote/_logs.py +9 -2
- flyte/remote/_run.py +25 -17
- flyte-0.2.0b7.dist-info/METADATA +156 -0
- {flyte-0.2.0b5.dist-info → flyte-0.2.0b7.dist-info}/RECORD +20 -19
- flyte-0.2.0b5.dist-info/METADATA +0 -178
- {flyte-0.2.0b5.dist-info → flyte-0.2.0b7.dist-info}/WHEEL +0 -0
- {flyte-0.2.0b5.dist-info → flyte-0.2.0b7.dist-info}/entry_points.txt +0 -0
- {flyte-0.2.0b5.dist-info → flyte-0.2.0b7.dist-info}/top_level.txt +0 -0
flyte/remote/_run.py
CHANGED
|
@@ -3,7 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
import asyncio
|
|
4
4
|
from dataclasses import dataclass, field
|
|
5
5
|
from datetime import datetime, timedelta, timezone
|
|
6
|
-
from typing import AsyncGenerator, AsyncIterator, Iterator, Literal, Tuple, Union, cast
|
|
6
|
+
from typing import AsyncGenerator, AsyncIterator, Iterator, List, Literal, Tuple, Union, cast
|
|
7
7
|
|
|
8
8
|
import grpc
|
|
9
9
|
import rich.repr
|
|
@@ -46,33 +46,41 @@ def _action_time_phase(action: run_definition_pb2.Action | run_definition_pb2.Ac
|
|
|
46
46
|
yield "error", action.error_info if action.HasField("error_info") else "NA"
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
def _action_rich_repr(action: run_definition_pb2.Action
|
|
49
|
+
def _action_rich_repr(action: run_definition_pb2.Action) -> rich.repr.Result:
|
|
50
50
|
"""
|
|
51
51
|
Rich representation of the action.
|
|
52
52
|
"""
|
|
53
|
-
|
|
53
|
+
if action.metadata.HasField("task"):
|
|
54
|
+
yield "task", action.metadata.task.id.name
|
|
55
|
+
yield "type", "task"
|
|
54
56
|
yield "name", action.id.name
|
|
55
57
|
yield from _action_time_phase(action)
|
|
56
|
-
yield "
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
yield "parent", action.metadata.parent
|
|
58
|
+
yield "group", action.metadata.group
|
|
59
|
+
yield "parent", action.metadata.parent
|
|
60
|
+
yield "attempts", action.status.attempts
|
|
60
61
|
|
|
61
62
|
|
|
62
|
-
def
|
|
63
|
+
def _attempt_rich_repr(action: List[run_definition_pb2.ActionAttempt]) -> rich.repr.Result:
|
|
64
|
+
for attempt in action:
|
|
65
|
+
yield "attempt", attempt.attempt
|
|
66
|
+
yield "phase", run_definition_pb2.Phase.Name(attempt.phase)
|
|
67
|
+
yield "logs_available", attempt.logs_available
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def _action_details_rich_repr(action: run_definition_pb2.ActionDetails) -> rich.repr.Result:
|
|
63
71
|
"""
|
|
64
72
|
Rich representation of the action details.
|
|
65
73
|
"""
|
|
66
74
|
yield "name", action.id.run.name
|
|
67
75
|
yield from _action_time_phase(action)
|
|
68
|
-
# yield "task", action.metadata.task.id.name
|
|
69
76
|
yield "task", action.resolved_task_spec.task_template.id.name
|
|
70
77
|
yield "task_type", action.resolved_task_spec.task_template.type
|
|
71
78
|
yield "task_version", action.resolved_task_spec.task_template.id.version
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
79
|
+
yield "attempts", action.attempts
|
|
80
|
+
yield "error_info", action.error_info if action.HasField("error_info") else "NA"
|
|
81
|
+
yield "phase", run_definition_pb2.Phase.Name(action.status.phase)
|
|
82
|
+
yield "group", action.metadata.group
|
|
83
|
+
yield "parent", action.metadata.parent
|
|
76
84
|
|
|
77
85
|
|
|
78
86
|
def _action_done_check(phase: run_definition_pb2.Phase) -> bool:
|
|
@@ -270,7 +278,7 @@ class Run:
|
|
|
270
278
|
"""
|
|
271
279
|
Rich representation of the Run object.
|
|
272
280
|
"""
|
|
273
|
-
yield from _action_rich_repr(self.pb2.action
|
|
281
|
+
yield from _action_rich_repr(self.pb2.action)
|
|
274
282
|
|
|
275
283
|
def __repr__(self) -> str:
|
|
276
284
|
"""
|
|
@@ -375,7 +383,7 @@ class RunDetails:
|
|
|
375
383
|
"""
|
|
376
384
|
Rich representation of the Run object.
|
|
377
385
|
"""
|
|
378
|
-
yield from _action_details_rich_repr(self.pb2.action
|
|
386
|
+
yield from _action_details_rich_repr(self.pb2.action)
|
|
379
387
|
|
|
380
388
|
def __repr__(self) -> str:
|
|
381
389
|
"""
|
|
@@ -657,7 +665,7 @@ class Action:
|
|
|
657
665
|
"""
|
|
658
666
|
Rich representation of the Action object.
|
|
659
667
|
"""
|
|
660
|
-
yield from _action_rich_repr(self.pb2
|
|
668
|
+
yield from _action_rich_repr(self.pb2)
|
|
661
669
|
|
|
662
670
|
def __repr__(self) -> str:
|
|
663
671
|
"""
|
|
@@ -911,7 +919,7 @@ class ActionDetails:
|
|
|
911
919
|
"""
|
|
912
920
|
Rich representation of the Action object.
|
|
913
921
|
"""
|
|
914
|
-
yield from _action_details_rich_repr(self.pb2
|
|
922
|
+
yield from _action_details_rich_repr(self.pb2)
|
|
915
923
|
|
|
916
924
|
def __repr__(self) -> str:
|
|
917
925
|
"""
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: flyte
|
|
3
|
+
Version: 0.2.0b7
|
|
4
|
+
Summary: Add your description here
|
|
5
|
+
Author-email: Ketan Umare <kumare3@users.noreply.github.com>
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
Requires-Dist: aiofiles>=24.1.0
|
|
9
|
+
Requires-Dist: click>=8.2.1
|
|
10
|
+
Requires-Dist: flyteidl==1.15.4b0
|
|
11
|
+
Requires-Dist: cloudpickle>=3.1.1
|
|
12
|
+
Requires-Dist: fsspec>=2025.3.0
|
|
13
|
+
Requires-Dist: grpcio>=1.71.0
|
|
14
|
+
Requires-Dist: obstore>=0.6.0
|
|
15
|
+
Requires-Dist: protobuf>=6.30.1
|
|
16
|
+
Requires-Dist: pydantic>=2.10.6
|
|
17
|
+
Requires-Dist: pyyaml>=6.0.2
|
|
18
|
+
Requires-Dist: rich-click>=1.8.9
|
|
19
|
+
Requires-Dist: httpx>=0.28.1
|
|
20
|
+
Requires-Dist: keyring>=25.6.0
|
|
21
|
+
Requires-Dist: msgpack>=1.1.0
|
|
22
|
+
Requires-Dist: toml>=0.10.2
|
|
23
|
+
Requires-Dist: async-lru>=2.0.5
|
|
24
|
+
Requires-Dist: mashumaro
|
|
25
|
+
Requires-Dist: dataclasses_json
|
|
26
|
+
|
|
27
|
+
# Flyte 2
|
|
28
|
+
|
|
29
|
+
Next-gen of SDK for Flyte.
|
|
30
|
+
|
|
31
|
+
## Get started
|
|
32
|
+
|
|
33
|
+
1. Only async tasks are supported right now. Style recommended, `import flyte` and then `flyte.TaskEnvironment` etc
|
|
34
|
+
2. You have to create environment for even a single task
|
|
35
|
+
3. look at examples/... for various examples.
|
|
36
|
+
4. For a single script recommend using uv run scripts with metadata headers.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
import flyte
|
|
41
|
+
|
|
42
|
+
env = flyte.TaskEnvironment(name="hello_world")
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
@env.task
|
|
46
|
+
async def say_hello(data: str) -> str:
|
|
47
|
+
return f"Hello {data}"
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@env.task
|
|
51
|
+
async def say_hello_nested(data: str) -> str:
|
|
52
|
+
return await say_hello.override(resources=flyte.Resources(gpu="A100 80G:4")).execute(data)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
if __name__ == "__main__":
|
|
56
|
+
import asyncio
|
|
57
|
+
|
|
58
|
+
# to run pure python - the SDK is not invoked at all
|
|
59
|
+
asyncio.run(say_hello_nested("test"))
|
|
60
|
+
|
|
61
|
+
# To run locally, but run through type system etc
|
|
62
|
+
flyte.init()
|
|
63
|
+
flyte.run(say_hello_nested, "World")
|
|
64
|
+
|
|
65
|
+
# To run remote
|
|
66
|
+
flyte.init(endpoint="dns:///localhost:8090", insecure=True)
|
|
67
|
+
flyte.run(say_hello_nested, "World")
|
|
68
|
+
# It is possible to switch local and remote, but keeping init to have and endpoint, but , changing context during run
|
|
69
|
+
flyte.with_runcontext(mode="local").run(...) # this will run locally only
|
|
70
|
+
|
|
71
|
+
# To run remote with a config
|
|
72
|
+
flyte.init_auto_from_config("config.yaml")
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
# CLI
|
|
76
|
+
All commands can be run from any root directory.
|
|
77
|
+
For examples, it is not needed to have `__init__.py` in the directory. If you run from a directory, the
|
|
78
|
+
code will automatically package and upload all modules that are imported. You can change the behaviour by using --copy-style flag.
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
flyte run examples/basics/devbox_one.py say_hello --data "World"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
To Follow the logs for the a0 action, you can use the `--follow` flag:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
flyte run --follow examples/basics/devbox_one.py say_hello --data "World"
|
|
88
|
+
```
|
|
89
|
+
Note follow has to be used with `run` command
|
|
90
|
+
|
|
91
|
+
Change copy style
|
|
92
|
+
```bash
|
|
93
|
+
flyte run --copy-style examples/basics/devbox_one.py say_hello_nested --data "World"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
# Building Images
|
|
97
|
+
```python
|
|
98
|
+
|
|
99
|
+
import flyte
|
|
100
|
+
|
|
101
|
+
env = flyte.TaskEnvironment(
|
|
102
|
+
name="hello_world",
|
|
103
|
+
image=flyte.Image.auto().with_apt_packages(...).with_pip_packages(...),
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Deploy
|
|
109
|
+
```bash
|
|
110
|
+
flyte deploy examples/basics/devbox_one.py say_hello_nested
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
CLI shortcuts
|
|
114
|
+
|
|
115
|
+
Get runs
|
|
116
|
+
```bash
|
|
117
|
+
flyte get run
|
|
118
|
+
```
|
|
119
|
+
Get specific run
|
|
120
|
+
```bash
|
|
121
|
+
flyte get run "run-name"
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Get run actions
|
|
125
|
+
```bash
|
|
126
|
+
flyte get actions "run-name"
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Get specific action
|
|
130
|
+
```bash
|
|
131
|
+
flyte get action "run-name" "action-name"
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Get action logs
|
|
135
|
+
```bash
|
|
136
|
+
flyte get logs "run-name" ["action-name"]
|
|
137
|
+
```
|
|
138
|
+
defaults to root action if no action name is provided
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
you can run any python script directly within the script module using __main__:
|
|
142
|
+
|
|
143
|
+
```python
|
|
144
|
+
if __name__ == "__main__":
|
|
145
|
+
import flyte
|
|
146
|
+
flyte.init()
|
|
147
|
+
flyte.run(say_hello_nested, "World")
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
You can also run from cli
|
|
151
|
+
|
|
152
|
+
you can Also run a uv script with metadata headers:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
uv run scripts / hello_world.py
|
|
156
|
+
```
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
flyte/__init__.py,sha256=
|
|
1
|
+
flyte/__init__.py,sha256=gqNaDkBPRGcOC0BbTbgHYatkttjVJljjEKoULmswQ0Q,1392
|
|
2
2
|
flyte/_build.py,sha256=MkgfLAPeL56YeVrGRNZUCZgbwzlEzVP3wLbl5Qru4yk,578
|
|
3
3
|
flyte/_context.py,sha256=pYa43ut8gp6i-Y_zOy1WW_N2IbP9Vd-zIORO11vqK1E,4995
|
|
4
4
|
flyte/_deploy.py,sha256=hHZKLU3U7t1ZF_8x6LykkPu_KSDyaHL3f2WzyjLj9BQ,7723
|
|
@@ -8,7 +8,7 @@ flyte/_environment.py,sha256=ft0EsyFg6OnoIFPFbwkABLcq676veIH3TTR4SNilrj8,1499
|
|
|
8
8
|
flyte/_group.py,sha256=64q2GFDp3koIkx3IV4GBeGEbu4v-GPUxTlxU_sV2fPk,743
|
|
9
9
|
flyte/_hash.py,sha256=Of_Zl_DzzzF2jp4ZsLm-3o-xJFCCJ8_GubmLI1htx78,504
|
|
10
10
|
flyte/_image.py,sha256=8xEGmAALY6jQAsLfJQH9NweeVUaSTWivFEQt-JchN24,29068
|
|
11
|
-
flyte/_initialize.py,sha256=
|
|
11
|
+
flyte/_initialize.py,sha256=ihTIvoMHs67UKbtFLR_zy9M1e7OK26ywoc_yMfLYwMw,16499
|
|
12
12
|
flyte/_interface.py,sha256=MP5o_qpIwfBNtAc7zo_cLSjMugsPyanuO6EgUSk4fBE,3644
|
|
13
13
|
flyte/_logging.py,sha256=FQvF3W1kkFypbARcOQ7WZVXO0XJasXp8EhozF6E6-aQ,3379
|
|
14
14
|
flyte/_resources.py,sha256=UOLyEVhdxolvrHhddiBbYdJuE1RkM_l7xeS9G1abe6M,7583
|
|
@@ -21,7 +21,7 @@ flyte/_task_environment.py,sha256=svSJJMEiiYsqz403s_urMgPdjguHJJSGVuBobT3uwVo,84
|
|
|
21
21
|
flyte/_timeout.py,sha256=zx5sFcbYmjJAJbZWSGzzX-BpC9HC7Jfs35T7vVhKwkk,1571
|
|
22
22
|
flyte/_tools.py,sha256=JewkQZBR_M85tS6QY8e4xXue75jbOE48nID4ZHnc9jY,632
|
|
23
23
|
flyte/_trace.py,sha256=7OQtQNosIlycTwaMjdc3GW4h3T3N0bYTsY6og4clPl8,5234
|
|
24
|
-
flyte/_version.py,sha256=
|
|
24
|
+
flyte/_version.py,sha256=aew4sh3XJsC-oHvLUBV1yrPYnRPf3pvzP7MaVQdQXzs,519
|
|
25
25
|
flyte/errors.py,sha256=m2JUNqLC6anVW6UiDK_ihuA06q_Hkw1mIUMDskb2OW8,4289
|
|
26
26
|
flyte/models.py,sha256=GTRuR6GXc0RAbLmPEnnH54oRF7__2TNFhmYjFoYMjZA,12660
|
|
27
27
|
flyte/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -34,8 +34,8 @@ flyte/_cache/policy_function_body.py,sha256=_AcyN6XKRXq16yV5lWuRJYCIVUlmyPvvWuYR
|
|
|
34
34
|
flyte/_code_bundle/__init__.py,sha256=G7DJTQ0UN_ETvdh55pYcWsTrZJKXEcyQl9iQQNQOBXQ,328
|
|
35
35
|
flyte/_code_bundle/_ignore.py,sha256=Tfaoa62CQVTH17kBHD6Xv6xEh1FhcAyvXivl9m-MEE0,3853
|
|
36
36
|
flyte/_code_bundle/_packaging.py,sha256=_wEozcQTYgqvAAaKQYna9ptvShIMlXk3vEdccwAOYn8,6873
|
|
37
|
-
flyte/_code_bundle/_utils.py,sha256=
|
|
38
|
-
flyte/_code_bundle/bundle.py,sha256=
|
|
37
|
+
flyte/_code_bundle/_utils.py,sha256=b0s3ZVKSRwaa_2CMTCqt2iRrUvTTW3FmlyqCD9k5BS0,12028
|
|
38
|
+
flyte/_code_bundle/bundle.py,sha256=8T0gcXck6dmg-8L2-0G3B2iNjC-Xwydu806iyKneMMY,8789
|
|
39
39
|
flyte/_internal/__init__.py,sha256=vjXgGzAAjy609YFkAy9_RVPuUlslsHSJBXCLNTVnqOY,136
|
|
40
40
|
flyte/_internal/controllers/__init__.py,sha256=qaawXUgYdC5yHh5JfQ9mCH3u9a7oTYriDChADekzuzo,3750
|
|
41
41
|
flyte/_internal/controllers/_local_controller.py,sha256=wTrJitUZMKodvvZMiy4bQbmIv0doF8Pb-OCsa8lAHgA,4708
|
|
@@ -44,7 +44,7 @@ flyte/_internal/controllers/remote/__init__.py,sha256=9_azH1eHLqY6VULpDugXi7Kf1k
|
|
|
44
44
|
flyte/_internal/controllers/remote/_action.py,sha256=w6vE1vPz1BwxvwfotDWjTNbDXfGEPrRBA8N3UVQ6P0w,4905
|
|
45
45
|
flyte/_internal/controllers/remote/_client.py,sha256=HPbzbfaWZVv5wpOvKNtFXR6COiZDwd1cUJQqi60A7oU,1421
|
|
46
46
|
flyte/_internal/controllers/remote/_controller.py,sha256=uqZYQDGG70DeJiqAU4y7n7VhXQ0gvD4ktWu15-zg86I,17387
|
|
47
|
-
flyte/_internal/controllers/remote/_core.py,sha256
|
|
47
|
+
flyte/_internal/controllers/remote/_core.py,sha256=2dka1rDnA8Ui_qhfE1ymZuN8E2BYQPn123h_eMixSiM,18091
|
|
48
48
|
flyte/_internal/controllers/remote/_informer.py,sha256=6WPaT1EmDcIwQ3VlujGWICzHy-kaGhMut_zBh2ShZnE,14186
|
|
49
49
|
flyte/_internal/controllers/remote/_service_protocol.py,sha256=B9qbIg6DiGeac-iSccLmX_AL2xUgX4ezNUOiAbSy4V0,1357
|
|
50
50
|
flyte/_internal/imagebuild/__init__.py,sha256=cLXVxkAyFpbdC1y-k3Rb6FRW9f_xpoRQWVn__G9IqKs,354
|
|
@@ -136,17 +136,18 @@ flyte/_utils/lazy_module.py,sha256=fvXPjvZLzCfcI8Vzs4pKedUDdY0U_RQ1ZVrp9b8qBQY,1
|
|
|
136
136
|
flyte/_utils/uv_script_parser.py,sha256=PxqD8lSMi6xv0uDd1s8LKB2IPZr4ttZJCUweqlyMTKk,1483
|
|
137
137
|
flyte/cli/__init__.py,sha256=Hx_mrERToVkrvORPB56ZnUED86T4S50ac1nwLQfvsgo,278
|
|
138
138
|
flyte/cli/_abort.py,sha256=WkXmjAOcrBU9NXXndcwF7YW7QcUTJzyUrvIRW0fjpSE,580
|
|
139
|
-
flyte/cli/_common.py,sha256=
|
|
139
|
+
flyte/cli/_common.py,sha256=u9Vf4VR601cEawlKw-o9bJJuQVNlLMMsFgCTWl-umU4,10748
|
|
140
140
|
flyte/cli/_create.py,sha256=8g9LgrjhpJiusUkmWeIRB3XviTVmMfo1dGCEt8Hna00,2377
|
|
141
141
|
flyte/cli/_delete.py,sha256=xOZN7Y13AQjAEQvdEod9qk1MQPU9l7bjQCkYzf_l4uY,497
|
|
142
142
|
flyte/cli/_deploy.py,sha256=u30rb6KfZnr52M6zHlLueaOkgdCGoS2pIpfb0wFoTvY,4371
|
|
143
143
|
flyte/cli/_get.py,sha256=u5PNAeJTPkGzdcz5gd2oiFrNvIfm8oRGK3MsjyY4Dzc,7553
|
|
144
144
|
flyte/cli/_params.py,sha256=X3GpuftXmtfIsYQ7vBilD4kmlkXTc7_AxpaxohRjSuY,19458
|
|
145
|
-
flyte/cli/_run.py,sha256=
|
|
146
|
-
flyte/cli/main.py,sha256=
|
|
147
|
-
flyte/config/__init__.py,sha256=
|
|
148
|
-
flyte/config/_config.py,sha256=
|
|
149
|
-
flyte/config/_internal.py,sha256=
|
|
145
|
+
flyte/cli/_run.py,sha256=F8Io2WB4dGHvNWbCmvCtyx4YGQhmoCAxeARwAwNSn78,7150
|
|
146
|
+
flyte/cli/main.py,sha256=1-Qm3IAPIRQSKaWVL1iGajiJoOO0mRqJsRnNtfd_uw4,3064
|
|
147
|
+
flyte/config/__init__.py,sha256=MiwEYK5Iv7MRR22z61nzbsbvZ9Q6MdmAU_g9If1Pmb8,144
|
|
148
|
+
flyte/config/_config.py,sha256=QE3T0W8xOULjJaqDMdMF90f9gFVjGR6h8QPOLsyqjYw,9831
|
|
149
|
+
flyte/config/_internal.py,sha256=Bj0uzn3PYgxKbzM-q2GKXxp7Y6cyzhPzUB-Y2i6cQKo,2836
|
|
150
|
+
flyte/config/_reader.py,sha256=c16jm0_IYxwEAjXENtllLeO_sT5Eg2RNLG4UjnAv_x4,7157
|
|
150
151
|
flyte/connectors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
151
152
|
flyte/extras/__init__.py,sha256=FhB0uK7H1Yo5De9vOuF7UGnezTKncj3u2Wo5uQdWN0g,74
|
|
152
153
|
flyte/extras/_container.py,sha256=JM-JNsj9-Mjf7E4OQcAS2Z5IJBXhB-HtQkGn_mu7gvk,11249
|
|
@@ -162,9 +163,9 @@ flyte/io/structured_dataset/structured_dataset.py,sha256=DrRIHA3zbkfLBekw3pPTF_S
|
|
|
162
163
|
flyte/remote/__init__.py,sha256=zBWV88VF-L8430xVrOyk07EmLsOKhOUMVBsqFUDtO6Q,565
|
|
163
164
|
flyte/remote/_console.py,sha256=avmELJPx8nQMAVPrHlh6jEIRPjrMwFpdZjJsWOOa9rE,660
|
|
164
165
|
flyte/remote/_data.py,sha256=DPK85gB6M71RjxqIh1Q5PdZ9xcJ0m1w_3cT2lAO0r7w,5795
|
|
165
|
-
flyte/remote/_logs.py,sha256=
|
|
166
|
+
flyte/remote/_logs.py,sha256=EOXg4OS8yYclsT6NASgOLMo0TA2sZpKb2MWZXpWBPuI,6404
|
|
166
167
|
flyte/remote/_project.py,sha256=dTBYqORDAbLvh9WnPO1Ytuzw2vxNYZwwNsKE2_b0o14,2807
|
|
167
|
-
flyte/remote/_run.py,sha256=
|
|
168
|
+
flyte/remote/_run.py,sha256=Dk7LQaB_edxSd6H93H-khjeZKXT76PgHPSLKIuGJQfw,31021
|
|
168
169
|
flyte/remote/_secret.py,sha256=l5xeMS83uMcWWeSSTRsSZUNhS0N--1Dze09C-thSOQs,4341
|
|
169
170
|
flyte/remote/_task.py,sha256=6TBdjPWgxHmdY9OJMMPGZax8h7Qs7q9dprNktjnZ77E,7904
|
|
170
171
|
flyte/remote/_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -204,8 +205,8 @@ flyte/types/_renderer.py,sha256=ygcCo5l60lHufyQISFddZfWwLlQ8kJAKxUT_XnR_6dY,4818
|
|
|
204
205
|
flyte/types/_string_literals.py,sha256=NlG1xV8RSA-sZ-n-IFQCAsdB6jXJOAKkHWtnopxVVDk,4231
|
|
205
206
|
flyte/types/_type_engine.py,sha256=QxyoDWRG_whfLCz88YqEVVoTTnca0FZv9eHeLLT0_-s,93645
|
|
206
207
|
flyte/types/_utils.py,sha256=pbts9E1_2LTdLygAY0UYTLYJ8AsN3BZyviSXvrtcutc,2626
|
|
207
|
-
flyte-0.2.
|
|
208
|
-
flyte-0.2.
|
|
209
|
-
flyte-0.2.
|
|
210
|
-
flyte-0.2.
|
|
211
|
-
flyte-0.2.
|
|
208
|
+
flyte-0.2.0b7.dist-info/METADATA,sha256=PEzzLl143Af5aF5AtaQFINAedUl2-txdzh36uHWd6fQ,3751
|
|
209
|
+
flyte-0.2.0b7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
210
|
+
flyte-0.2.0b7.dist-info/entry_points.txt,sha256=MIq2z5dBurdCJfpXfMKzgBv7sJOakKRYxr8G0cMiTrg,75
|
|
211
|
+
flyte-0.2.0b7.dist-info/top_level.txt,sha256=7dkyFbikvA12LEZEqawx8oDG1CMod6hTliPj7iWzgYo,6
|
|
212
|
+
flyte-0.2.0b7.dist-info/RECORD,,
|
flyte-0.2.0b5.dist-info/METADATA
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: flyte
|
|
3
|
-
Version: 0.2.0b5
|
|
4
|
-
Summary: Add your description here
|
|
5
|
-
Author-email: Ketan Umare <kumare3@users.noreply.github.com>
|
|
6
|
-
Requires-Python: >=3.10
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
Requires-Dist: aiofiles>=24.1.0
|
|
9
|
-
Requires-Dist: click>=8.2.1
|
|
10
|
-
Requires-Dist: flyteidl==1.15.4b0
|
|
11
|
-
Requires-Dist: cloudpickle>=3.1.1
|
|
12
|
-
Requires-Dist: fsspec>=2025.3.0
|
|
13
|
-
Requires-Dist: grpcio>=1.71.0
|
|
14
|
-
Requires-Dist: obstore>=0.6.0
|
|
15
|
-
Requires-Dist: protobuf>=6.30.1
|
|
16
|
-
Requires-Dist: pydantic>=2.10.6
|
|
17
|
-
Requires-Dist: pyyaml>=6.0.2
|
|
18
|
-
Requires-Dist: rich-click>=1.8.9
|
|
19
|
-
Requires-Dist: httpx>=0.28.1
|
|
20
|
-
Requires-Dist: keyring>=25.6.0
|
|
21
|
-
Requires-Dist: msgpack>=1.1.0
|
|
22
|
-
Requires-Dist: toml>=0.10.2
|
|
23
|
-
Requires-Dist: async-lru>=2.0.5
|
|
24
|
-
Requires-Dist: mashumaro
|
|
25
|
-
Requires-Dist: dataclasses_json
|
|
26
|
-
|
|
27
|
-
# Flyte 2
|
|
28
|
-
|
|
29
|
-
Next-gen of SDK for Flyte.
|
|
30
|
-
|
|
31
|
-
## Get started
|
|
32
|
-
|
|
33
|
-
1. Only async tasks are supported right now. Style recommended, `import flyte` and then `flyte.TaskEnvironment` etc
|
|
34
|
-
2. You have to create environment for even a single task
|
|
35
|
-
3. `flyte run` CLI does not yet support arguments (but will soon)
|
|
36
|
-
4. Support for dataclasses is still limited if present at all
|
|
37
|
-
5. look at examples/... for various examples.
|
|
38
|
-
6. For a single script recommend using uv run scripts with metadata headers.
|
|
39
|
-
|
|
40
|
-
Hello world
|
|
41
|
-
|
|
42
|
-
```python
|
|
43
|
-
import flyte
|
|
44
|
-
|
|
45
|
-
env = flyte.TaskEnvironment(name="hello_world")
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
@env.task
|
|
49
|
-
async def say_hello(data: str) -> str:
|
|
50
|
-
return f"Hello {data}"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
@env.task
|
|
54
|
-
async def say_hello_nested(data: str) -> str:
|
|
55
|
-
return await say_hello.override(resources=flyte.Resources(gpu="A100 80G:4")).execute(data)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if __name__ == "__main__":
|
|
59
|
-
import asyncio
|
|
60
|
-
|
|
61
|
-
# to run pure python - the SDK is not invoked at all
|
|
62
|
-
asyncio.run(say_hello_nested("test"))
|
|
63
|
-
|
|
64
|
-
# To run locally, but run through type system etc
|
|
65
|
-
flyte.init()
|
|
66
|
-
flyte.run(say_hello_nested, "World")
|
|
67
|
-
|
|
68
|
-
# To run remote
|
|
69
|
-
flyte.init(endpoint="dns:///localhost:8090", insecure=True)
|
|
70
|
-
flyte.run(say_hello_nested, "World")
|
|
71
|
-
# It is possible to switch local and remote, but keeping init to have and endpoint, but , changing context during run
|
|
72
|
-
flyte.with_runcontext(name="my-run-1", mode="local").run(...) # this will run locally only
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## When testing now, you will have to build images with v2 sdk installed.
|
|
76
|
-
To do this, you can use a nifty way to add the sdk to the image.
|
|
77
|
-
|
|
78
|
-
```python
|
|
79
|
-
import flyte
|
|
80
|
-
import pathlib
|
|
81
|
-
|
|
82
|
-
env = flyte.TaskEnvironment(
|
|
83
|
-
name="test",
|
|
84
|
-
image=flyte.Image.auto(registry="ghcr.io/your-handle", name="package-name")
|
|
85
|
-
.with_source_folder(pathlib.Path(
|
|
86
|
-
__file__).parent.parent / "dist") # Assuming you have run `make dist` and the dist folder is in the directory above
|
|
87
|
-
.with_local_v2(), # This will add the v2 sdk to the image from the local dist folder
|
|
88
|
-
)
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## Run using CLI
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
flyte --endpoint dns:///localhost:8090 --insecure --org-override testorg run -p project -d development devbox_one.py say_hello_nested
|
|
95
|
-
```
|
|
96
|
-
### Retrieve runs
|
|
97
|
-
```bash
|
|
98
|
-
flyte --endpoint dns:///localhost:8090 --insecure --org-override testorg get run --project testproject --domain development
|
|
99
|
-
```
|
|
100
|
-
Output:
|
|
101
|
-
```bash
|
|
102
|
-
┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┓
|
|
103
|
-
┃ Run-name ┃ Name ┃ Start_time ┃ End_time ┃ Run_time ┃ Phase ┃ Task ┃
|
|
104
|
-
┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━┩
|
|
105
|
-
│ testrun │ a0 │ 2025-04-25T21:47:37.564471 │ None │ 41154 secs │ PHASE_QUEUED │ │
|
|
106
|
-
│ random-run-5783fbc8 │ a0 │ 2025-04-29T04:39:33.871810 │ 2025-04-29T04:42:24 │ 170 secs │ PHASE_SUCCEEDED │ │
|
|
107
|
-
│ random-run-e57d6195 │ a0 │ 2025-04-29T04:40:53.467206 │ 2025-04-29T04:42:54 │ 120 secs │ PHASE_SUCCEEDED │ say_hello_nested │
|
|
108
|
-
│ random-run-752c52a0 │ a0 │ 2025-04-29T04:44:50.169879 │ 2025-04-29T04:47:34 │ 163 secs │ PHASE_SUCCEEDED │ failure_recovery │
|
|
109
|
-
│ random-run-4f57d4af │ a0 │ 2025-04-29T05:04:28.780208 │ 2025-04-29T05:07:10 │ 161 secs │ PHASE_FAILED │ failure_recovery │
|
|
110
|
-
│ random-run-f6c6405f │ a0 │ 2025-04-29T05:10:19.808186 │ 2025-04-29T05:13:07 │ 167 secs │ PHASE_FAILED │ failure_recovery │
|
|
111
|
-
│ random-run-66448df4 │ a0 │ 2025-04-29T05:42:21.625827 │ 2025-04-29T05:45:01 │ 159 secs │ PHASE_SUCCEEDED │ failure_recovery │
|
|
112
|
-
│ random-run-5c5c905f │ a0 │ 2025-04-29T05:50:32.623097 │ 2025-04-29T05:53:21 │ 168 secs │ PHASE_SUCCEEDED │ failure_recovery │
|
|
113
|
-
│ random-run-99056dba │ a0 │ 2025-04-29T05:54:47.820520 │ 2025-04-29T05:57:31 │ 163 secs │ PHASE_SUCCEEDED │ failure_recovery │
|
|
114
|
-
└─────────────────────┴──────┴────────────────────────────┴─────────────────────┴────────────┴─────────────────┴──────────────────┘
|
|
115
|
-
```
|
|
116
|
-
### Retrieve specific run details
|
|
117
|
-
```bash
|
|
118
|
-
flyte --endpoint dns:///localhost:8090 --insecure --org-override testorg get run --project testproject --domain development random-run-66448df4
|
|
119
|
-
```
|
|
120
|
-
Output:
|
|
121
|
-
```bash
|
|
122
|
-
RunDetails(name='random-run-66448df4', start_time='2025-04-29T05:42:21.625827', end_time='2025-04-29T05:45:01', run_time='159 secs', phase='PHASE_SUCCEEDED', error=, task='failure_recovery')
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### Retrieve actions for a run
|
|
126
|
-
```bash
|
|
127
|
-
flyte --endpoint dns:///localhost:8090 --insecure --org-override testorg get action --project testproject --domain development random-run-99056dba
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
Output:
|
|
131
|
-
```bash
|
|
132
|
-
┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┓
|
|
133
|
-
┃ Run-name ┃ Name ┃ Start_time ┃ End_time ┃ Run_time ┃ Phase ┃ Task ┃
|
|
134
|
-
┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━┩
|
|
135
|
-
│ random-run-99056dba │ a0 │ 2025-04-29T05:54:47.820520 │ 2025-04-29T05:57:31 │ 163 secs │ PHASE_SUCCEEDED │ failure_recovery │
|
|
136
|
-
│ random-run-99056dba │ 5DYnhmntDf3WG9bm5B54E9 │ 2025-04-29T05:55:18.098842 │ 2025-04-29T05:55:51 │ 32 secs │ PHASE_FAILED │ always_fails │
|
|
137
|
-
│ random-run-99056dba │ 7rg3HTmTfCjMqhLLq17ZjR │ 2025-04-29T05:55:51.933307 │ 2025-04-29T05:56:31 │ 39 secs │ PHASE_FAILED │ always_fails │
|
|
138
|
-
│ random-run-99056dba │ 3avSConCJYUMmCuTpqUCdO │ 2025-04-29T05:56:31.939420 │ 2025-04-29T05:57:11 │ 39 secs │ PHASE_SUCCEEDED │ always_succeeds │
|
|
139
|
-
└─────────────────────┴────────────────────────┴────────────────────────────┴─────────────────────┴──────────┴─────────────────┴──────────────────┘
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### Retrieve action details
|
|
143
|
-
```bash
|
|
144
|
-
flyte --endpoint dns:///localhost:8090 --insecure --org-override testorg get action --project testproject --domain development random-run-99056dba 5DYnhmntDf3WG9bm5B54E9
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
Output:
|
|
148
|
-
```bash
|
|
149
|
-
ActionDetails(name='random-run-99056dba', start_time='2025-04-29T05:55:18.098842', end_time='2025-04-29T05:55:51', run_time='32 secs', phase='PHASE_FAILED', error=, task='always_fails')
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### Deploy
|
|
153
|
-
```bash
|
|
154
|
-
flyte deploy --endpoint dns:///localhost:8090 --insecure --org-override testorg -p project -d development devbox_one.py say_hello_nested
|
|
155
|
-
```
|
|
156
|
-
# Contributor Notes
|
|
157
|
-
Some of these are limited to Union for now, because the new IDL has not yet been open-sourced.
|
|
158
|
-
|
|
159
|
-
## How to import proto stubs?
|
|
160
|
-
|
|
161
|
-
Make sure that you have `uv` installed locally then run `make copy-protos <path-to-cloud-repo>`, where `<path-to-cloud-repo>`
|
|
162
|
-
is optional, if it's not defined then it assumes by default that there's a sibling `cloud` directory.
|
|
163
|
-
|
|
164
|
-
## Iterating on the SDK itself.
|
|
165
|
-
While there is a publicly available semantically version base image (similar to flytekit) for each flyte sdk release,
|
|
166
|
-
it's probably helpful to create your own images if you're to iterate on this SDK itself. Anyone who wishes to modify
|
|
167
|
-
this code and then run it on a Flyte cluster, will need to build their own image.
|
|
168
|
-
|
|
169
|
-
To do this:
|
|
170
|
-
|
|
171
|
-
1. Build a wheel with your updated code by running `make dist`
|
|
172
|
-
|
|
173
|
-
2. (This step only works for Union employees for now) Create the image by running
|
|
174
|
-
```
|
|
175
|
-
python maint_tools/build_default_image.py
|
|
176
|
-
```
|
|
177
|
-
This will build the image using buildx, creating a buildx builder. The image will be tagged with a SHA that changes
|
|
178
|
-
based on a hash of the built wheel inside the dist folder.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|