flyte 0.0.1b3__py3-none-any.whl → 0.2.0a0__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 +20 -4
- flyte/_bin/runtime.py +33 -7
- flyte/_build.py +3 -2
- flyte/_cache/cache.py +1 -2
- flyte/_code_bundle/_packaging.py +1 -1
- flyte/_code_bundle/_utils.py +0 -16
- flyte/_code_bundle/bundle.py +43 -12
- flyte/_context.py +8 -2
- flyte/_deploy.py +56 -15
- flyte/_environment.py +45 -4
- flyte/_excepthook.py +37 -0
- flyte/_group.py +2 -1
- flyte/_image.py +8 -4
- flyte/_initialize.py +112 -254
- flyte/_interface.py +3 -3
- flyte/_internal/controllers/__init__.py +19 -6
- flyte/_internal/controllers/_local_controller.py +83 -8
- flyte/_internal/controllers/_trace.py +2 -1
- flyte/_internal/controllers/remote/__init__.py +27 -7
- flyte/_internal/controllers/remote/_action.py +7 -2
- flyte/_internal/controllers/remote/_client.py +5 -1
- flyte/_internal/controllers/remote/_controller.py +159 -26
- flyte/_internal/controllers/remote/_core.py +13 -5
- flyte/_internal/controllers/remote/_informer.py +4 -4
- flyte/_internal/controllers/remote/_service_protocol.py +6 -6
- flyte/_internal/imagebuild/docker_builder.py +12 -1
- flyte/_internal/imagebuild/image_builder.py +16 -11
- flyte/_internal/runtime/convert.py +164 -21
- flyte/_internal/runtime/entrypoints.py +1 -1
- flyte/_internal/runtime/io.py +3 -3
- flyte/_internal/runtime/task_serde.py +140 -20
- flyte/_internal/runtime/taskrunner.py +4 -3
- flyte/_internal/runtime/types_serde.py +1 -1
- flyte/_logging.py +12 -1
- flyte/_map.py +215 -0
- flyte/_pod.py +19 -0
- flyte/_protos/common/list_pb2.py +3 -3
- flyte/_protos/common/list_pb2.pyi +2 -0
- flyte/_protos/logs/dataplane/payload_pb2.py +28 -24
- flyte/_protos/logs/dataplane/payload_pb2.pyi +11 -2
- flyte/_protos/workflow/common_pb2.py +27 -0
- flyte/_protos/workflow/common_pb2.pyi +14 -0
- flyte/_protos/workflow/environment_pb2.py +29 -0
- flyte/_protos/workflow/environment_pb2.pyi +12 -0
- flyte/_protos/workflow/queue_service_pb2.py +40 -41
- flyte/_protos/workflow/queue_service_pb2.pyi +35 -30
- flyte/_protos/workflow/queue_service_pb2_grpc.py +15 -15
- flyte/_protos/workflow/run_definition_pb2.py +61 -61
- flyte/_protos/workflow/run_definition_pb2.pyi +8 -4
- flyte/_protos/workflow/run_service_pb2.py +20 -24
- flyte/_protos/workflow/run_service_pb2.pyi +2 -6
- flyte/_protos/workflow/state_service_pb2.py +36 -28
- flyte/_protos/workflow/state_service_pb2.pyi +19 -15
- flyte/_protos/workflow/state_service_pb2_grpc.py +28 -28
- flyte/_protos/workflow/task_definition_pb2.py +29 -22
- flyte/_protos/workflow/task_definition_pb2.pyi +21 -5
- flyte/_protos/workflow/task_service_pb2.py +27 -11
- flyte/_protos/workflow/task_service_pb2.pyi +29 -1
- flyte/_protos/workflow/task_service_pb2_grpc.py +34 -0
- flyte/_run.py +166 -95
- flyte/_task.py +110 -28
- flyte/_task_environment.py +55 -72
- flyte/_trace.py +6 -14
- flyte/_utils/__init__.py +6 -0
- flyte/_utils/async_cache.py +139 -0
- flyte/_utils/coro_management.py +0 -2
- flyte/_utils/helpers.py +45 -19
- flyte/_utils/org_discovery.py +57 -0
- flyte/_version.py +2 -2
- flyte/cli/__init__.py +3 -0
- flyte/cli/_abort.py +28 -0
- flyte/{_cli → cli}/_common.py +73 -23
- flyte/cli/_create.py +145 -0
- flyte/{_cli → cli}/_delete.py +4 -4
- flyte/{_cli → cli}/_deploy.py +26 -14
- flyte/cli/_gen.py +163 -0
- flyte/{_cli → cli}/_get.py +98 -23
- {union/_cli → flyte/cli}/_params.py +106 -147
- flyte/{_cli → cli}/_run.py +99 -20
- flyte/cli/main.py +166 -0
- flyte/config/__init__.py +3 -0
- flyte/config/_config.py +216 -0
- flyte/config/_internal.py +64 -0
- flyte/config/_reader.py +207 -0
- flyte/errors.py +29 -0
- flyte/extras/_container.py +33 -43
- flyte/io/__init__.py +17 -1
- flyte/io/_dir.py +2 -2
- flyte/io/_file.py +3 -4
- flyte/io/{structured_dataset → _structured_dataset}/basic_dfs.py +1 -1
- flyte/io/{structured_dataset → _structured_dataset}/structured_dataset.py +1 -1
- flyte/{_datastructures.py → models.py} +56 -7
- flyte/remote/__init__.py +2 -1
- flyte/remote/_client/_protocols.py +2 -0
- flyte/remote/_client/auth/_auth_utils.py +14 -0
- flyte/remote/_client/auth/_channel.py +34 -3
- flyte/remote/_client/auth/_token_client.py +3 -3
- flyte/remote/_client/controlplane.py +13 -13
- flyte/remote/_console.py +1 -1
- flyte/remote/_data.py +10 -6
- flyte/remote/_logs.py +89 -29
- flyte/remote/_project.py +8 -9
- flyte/remote/_run.py +228 -131
- flyte/remote/_secret.py +12 -12
- flyte/remote/_task.py +179 -15
- flyte/report/_report.py +4 -4
- flyte/storage/__init__.py +5 -0
- flyte/storage/_config.py +233 -0
- flyte/storage/_storage.py +23 -3
- flyte/syncify/__init__.py +56 -0
- flyte/syncify/_api.py +371 -0
- flyte/types/__init__.py +23 -0
- flyte/types/_interface.py +22 -7
- flyte/{io/pickle/transformer.py → types/_pickle.py} +2 -1
- flyte/types/_type_engine.py +95 -18
- flyte-0.2.0a0.dist-info/METADATA +249 -0
- flyte-0.2.0a0.dist-info/RECORD +218 -0
- {flyte-0.0.1b3.dist-info → flyte-0.2.0a0.dist-info}/entry_points.txt +1 -1
- flyte/_api_commons.py +0 -3
- flyte/_cli/__init__.py +0 -0
- flyte/_cli/_create.py +0 -42
- flyte/_cli/main.py +0 -72
- flyte/_internal/controllers/pbhash.py +0 -39
- flyte/io/_dataframe.py +0 -0
- flyte/io/pickle/__init__.py +0 -0
- flyte-0.0.1b3.dist-info/METADATA +0 -179
- flyte-0.0.1b3.dist-info/RECORD +0 -390
- union/__init__.py +0 -54
- union/_api_commons.py +0 -3
- union/_bin/__init__.py +0 -0
- union/_bin/runtime.py +0 -113
- union/_build.py +0 -25
- union/_cache/__init__.py +0 -12
- union/_cache/cache.py +0 -141
- union/_cache/defaults.py +0 -9
- union/_cache/policy_function_body.py +0 -42
- union/_cli/__init__.py +0 -0
- union/_cli/_common.py +0 -263
- union/_cli/_create.py +0 -40
- union/_cli/_delete.py +0 -23
- union/_cli/_deploy.py +0 -120
- union/_cli/_get.py +0 -162
- union/_cli/_run.py +0 -150
- union/_cli/main.py +0 -72
- union/_code_bundle/__init__.py +0 -8
- union/_code_bundle/_ignore.py +0 -113
- union/_code_bundle/_packaging.py +0 -187
- union/_code_bundle/_utils.py +0 -342
- union/_code_bundle/bundle.py +0 -176
- union/_context.py +0 -146
- union/_datastructures.py +0 -295
- union/_deploy.py +0 -185
- union/_doc.py +0 -29
- union/_docstring.py +0 -26
- union/_environment.py +0 -43
- union/_group.py +0 -31
- union/_hash.py +0 -23
- union/_image.py +0 -760
- union/_initialize.py +0 -585
- union/_interface.py +0 -84
- union/_internal/__init__.py +0 -3
- union/_internal/controllers/__init__.py +0 -77
- union/_internal/controllers/_local_controller.py +0 -77
- union/_internal/controllers/pbhash.py +0 -39
- union/_internal/controllers/remote/__init__.py +0 -40
- union/_internal/controllers/remote/_action.py +0 -131
- union/_internal/controllers/remote/_client.py +0 -43
- union/_internal/controllers/remote/_controller.py +0 -169
- union/_internal/controllers/remote/_core.py +0 -341
- union/_internal/controllers/remote/_informer.py +0 -260
- union/_internal/controllers/remote/_service_protocol.py +0 -44
- union/_internal/imagebuild/__init__.py +0 -11
- union/_internal/imagebuild/docker_builder.py +0 -416
- union/_internal/imagebuild/image_builder.py +0 -243
- union/_internal/imagebuild/remote_builder.py +0 -0
- union/_internal/resolvers/__init__.py +0 -0
- union/_internal/resolvers/_task_module.py +0 -31
- union/_internal/resolvers/common.py +0 -24
- union/_internal/resolvers/default.py +0 -27
- union/_internal/runtime/__init__.py +0 -0
- union/_internal/runtime/convert.py +0 -163
- union/_internal/runtime/entrypoints.py +0 -121
- union/_internal/runtime/io.py +0 -136
- union/_internal/runtime/resources_serde.py +0 -134
- union/_internal/runtime/task_serde.py +0 -202
- union/_internal/runtime/taskrunner.py +0 -179
- union/_internal/runtime/types_serde.py +0 -53
- union/_logging.py +0 -124
- union/_protos/__init__.py +0 -0
- union/_protos/common/authorization_pb2.py +0 -66
- union/_protos/common/authorization_pb2.pyi +0 -106
- union/_protos/common/identifier_pb2.py +0 -71
- union/_protos/common/identifier_pb2.pyi +0 -82
- union/_protos/common/identity_pb2.py +0 -48
- union/_protos/common/identity_pb2.pyi +0 -72
- union/_protos/common/identity_pb2_grpc.py +0 -4
- union/_protos/common/list_pb2.py +0 -36
- union/_protos/common/list_pb2.pyi +0 -69
- union/_protos/common/list_pb2_grpc.py +0 -4
- union/_protos/common/policy_pb2.py +0 -37
- union/_protos/common/policy_pb2.pyi +0 -27
- union/_protos/common/policy_pb2_grpc.py +0 -4
- union/_protos/common/role_pb2.py +0 -37
- union/_protos/common/role_pb2.pyi +0 -51
- union/_protos/common/role_pb2_grpc.py +0 -4
- union/_protos/common/runtime_version_pb2.py +0 -28
- union/_protos/common/runtime_version_pb2.pyi +0 -24
- union/_protos/common/runtime_version_pb2_grpc.py +0 -4
- union/_protos/logs/dataplane/payload_pb2.py +0 -96
- union/_protos/logs/dataplane/payload_pb2.pyi +0 -168
- union/_protos/logs/dataplane/payload_pb2_grpc.py +0 -4
- union/_protos/secret/definition_pb2.py +0 -49
- union/_protos/secret/definition_pb2.pyi +0 -93
- union/_protos/secret/definition_pb2_grpc.py +0 -4
- union/_protos/secret/payload_pb2.py +0 -62
- union/_protos/secret/payload_pb2.pyi +0 -94
- union/_protos/secret/payload_pb2_grpc.py +0 -4
- union/_protos/secret/secret_pb2.py +0 -38
- union/_protos/secret/secret_pb2.pyi +0 -6
- union/_protos/secret/secret_pb2_grpc.py +0 -198
- union/_protos/validate/validate/validate_pb2.py +0 -76
- union/_protos/workflow/node_execution_service_pb2.py +0 -26
- union/_protos/workflow/node_execution_service_pb2.pyi +0 -4
- union/_protos/workflow/node_execution_service_pb2_grpc.py +0 -32
- union/_protos/workflow/queue_service_pb2.py +0 -75
- union/_protos/workflow/queue_service_pb2.pyi +0 -103
- union/_protos/workflow/queue_service_pb2_grpc.py +0 -172
- union/_protos/workflow/run_definition_pb2.py +0 -100
- union/_protos/workflow/run_definition_pb2.pyi +0 -256
- union/_protos/workflow/run_definition_pb2_grpc.py +0 -4
- union/_protos/workflow/run_logs_service_pb2.py +0 -41
- union/_protos/workflow/run_logs_service_pb2.pyi +0 -28
- union/_protos/workflow/run_logs_service_pb2_grpc.py +0 -69
- union/_protos/workflow/run_service_pb2.py +0 -133
- union/_protos/workflow/run_service_pb2.pyi +0 -173
- union/_protos/workflow/run_service_pb2_grpc.py +0 -412
- union/_protos/workflow/state_service_pb2.py +0 -58
- union/_protos/workflow/state_service_pb2.pyi +0 -69
- union/_protos/workflow/state_service_pb2_grpc.py +0 -138
- union/_protos/workflow/task_definition_pb2.py +0 -72
- union/_protos/workflow/task_definition_pb2.pyi +0 -65
- union/_protos/workflow/task_definition_pb2_grpc.py +0 -4
- union/_protos/workflow/task_service_pb2.py +0 -44
- union/_protos/workflow/task_service_pb2.pyi +0 -31
- union/_protos/workflow/task_service_pb2_grpc.py +0 -104
- union/_resources.py +0 -226
- union/_retry.py +0 -32
- union/_reusable_environment.py +0 -25
- union/_run.py +0 -374
- union/_secret.py +0 -61
- union/_task.py +0 -354
- union/_task_environment.py +0 -186
- union/_timeout.py +0 -47
- union/_tools.py +0 -27
- union/_utils/__init__.py +0 -11
- union/_utils/asyn.py +0 -119
- union/_utils/file_handling.py +0 -71
- union/_utils/helpers.py +0 -46
- union/_utils/lazy_module.py +0 -54
- union/_utils/uv_script_parser.py +0 -49
- union/_version.py +0 -21
- union/connectors/__init__.py +0 -0
- union/errors.py +0 -128
- union/extras/__init__.py +0 -5
- union/extras/_container.py +0 -263
- union/io/__init__.py +0 -11
- union/io/_dataframe.py +0 -0
- union/io/_dir.py +0 -425
- union/io/_file.py +0 -418
- union/io/pickle/__init__.py +0 -0
- union/io/pickle/transformer.py +0 -117
- union/io/structured_dataset/__init__.py +0 -122
- union/io/structured_dataset/basic_dfs.py +0 -219
- union/io/structured_dataset/structured_dataset.py +0 -1057
- union/py.typed +0 -0
- union/remote/__init__.py +0 -23
- union/remote/_client/__init__.py +0 -0
- union/remote/_client/_protocols.py +0 -129
- union/remote/_client/auth/__init__.py +0 -12
- union/remote/_client/auth/_authenticators/__init__.py +0 -0
- union/remote/_client/auth/_authenticators/base.py +0 -391
- union/remote/_client/auth/_authenticators/client_credentials.py +0 -73
- union/remote/_client/auth/_authenticators/device_code.py +0 -120
- union/remote/_client/auth/_authenticators/external_command.py +0 -77
- union/remote/_client/auth/_authenticators/factory.py +0 -200
- union/remote/_client/auth/_authenticators/pkce.py +0 -515
- union/remote/_client/auth/_channel.py +0 -184
- union/remote/_client/auth/_client_config.py +0 -83
- union/remote/_client/auth/_default_html.py +0 -32
- union/remote/_client/auth/_grpc_utils/__init__.py +0 -0
- union/remote/_client/auth/_grpc_utils/auth_interceptor.py +0 -204
- union/remote/_client/auth/_grpc_utils/default_metadata_interceptor.py +0 -144
- union/remote/_client/auth/_keyring.py +0 -154
- union/remote/_client/auth/_token_client.py +0 -258
- union/remote/_client/auth/errors.py +0 -16
- union/remote/_client/controlplane.py +0 -86
- union/remote/_data.py +0 -149
- union/remote/_logs.py +0 -74
- union/remote/_project.py +0 -86
- union/remote/_run.py +0 -820
- union/remote/_secret.py +0 -132
- union/remote/_task.py +0 -193
- union/report/__init__.py +0 -3
- union/report/_report.py +0 -178
- union/report/_template.html +0 -124
- union/storage/__init__.py +0 -24
- union/storage/_remote_fs.py +0 -34
- union/storage/_storage.py +0 -247
- union/storage/_utils.py +0 -5
- union/types/__init__.py +0 -11
- union/types/_renderer.py +0 -162
- union/types/_string_literals.py +0 -120
- union/types/_type_engine.py +0 -2131
- union/types/_utils.py +0 -80
- /union/_protos/common/authorization_pb2_grpc.py → /flyte/_protos/workflow/common_pb2_grpc.py +0 -0
- /union/_protos/common/identifier_pb2_grpc.py → /flyte/_protos/workflow/environment_pb2_grpc.py +0 -0
- /flyte/io/{structured_dataset → _structured_dataset}/__init__.py +0 -0
- {flyte-0.0.1b3.dist-info → flyte-0.2.0a0.dist-info}/WHEEL +0 -0
- {flyte-0.0.1b3.dist-info → flyte-0.2.0a0.dist-info}/top_level.txt +0 -0
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
from flyte._protos.common import identifier_pb2 as _identifier_pb2
|
|
2
|
+
from flyte._protos.common import list_pb2 as _list_pb2
|
|
1
3
|
from flyte._protos.validate.validate import validate_pb2 as _validate_pb2
|
|
2
4
|
from flyte._protos.workflow import task_definition_pb2 as _task_definition_pb2
|
|
5
|
+
from google.protobuf.internal import containers as _containers
|
|
3
6
|
from google.protobuf import descriptor as _descriptor
|
|
4
7
|
from google.protobuf import message as _message
|
|
5
|
-
from typing import ClassVar as _ClassVar, Mapping as _Mapping, Optional as _Optional, Union as _Union
|
|
8
|
+
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
|
|
6
9
|
|
|
7
10
|
DESCRIPTOR: _descriptor.FileDescriptor
|
|
8
11
|
|
|
@@ -29,3 +32,28 @@ class GetTaskDetailsResponse(_message.Message):
|
|
|
29
32
|
DETAILS_FIELD_NUMBER: _ClassVar[int]
|
|
30
33
|
details: _task_definition_pb2.TaskDetails
|
|
31
34
|
def __init__(self, details: _Optional[_Union[_task_definition_pb2.TaskDetails, _Mapping]] = ...) -> None: ...
|
|
35
|
+
|
|
36
|
+
class ListTasksRequest(_message.Message):
|
|
37
|
+
__slots__ = ["request", "org", "project_id", "known_filters"]
|
|
38
|
+
class KnownFilter(_message.Message):
|
|
39
|
+
__slots__ = ["deployed_by"]
|
|
40
|
+
DEPLOYED_BY_FIELD_NUMBER: _ClassVar[int]
|
|
41
|
+
deployed_by: str
|
|
42
|
+
def __init__(self, deployed_by: _Optional[str] = ...) -> None: ...
|
|
43
|
+
REQUEST_FIELD_NUMBER: _ClassVar[int]
|
|
44
|
+
ORG_FIELD_NUMBER: _ClassVar[int]
|
|
45
|
+
PROJECT_ID_FIELD_NUMBER: _ClassVar[int]
|
|
46
|
+
KNOWN_FILTERS_FIELD_NUMBER: _ClassVar[int]
|
|
47
|
+
request: _list_pb2.ListRequest
|
|
48
|
+
org: str
|
|
49
|
+
project_id: _identifier_pb2.ProjectIdentifier
|
|
50
|
+
known_filters: _containers.RepeatedCompositeFieldContainer[ListTasksRequest.KnownFilter]
|
|
51
|
+
def __init__(self, request: _Optional[_Union[_list_pb2.ListRequest, _Mapping]] = ..., org: _Optional[str] = ..., project_id: _Optional[_Union[_identifier_pb2.ProjectIdentifier, _Mapping]] = ..., known_filters: _Optional[_Iterable[_Union[ListTasksRequest.KnownFilter, _Mapping]]] = ...) -> None: ...
|
|
52
|
+
|
|
53
|
+
class ListTasksResponse(_message.Message):
|
|
54
|
+
__slots__ = ["tasks", "token"]
|
|
55
|
+
TASKS_FIELD_NUMBER: _ClassVar[int]
|
|
56
|
+
TOKEN_FIELD_NUMBER: _ClassVar[int]
|
|
57
|
+
tasks: _containers.RepeatedCompositeFieldContainer[_task_definition_pb2.Task]
|
|
58
|
+
token: str
|
|
59
|
+
def __init__(self, tasks: _Optional[_Iterable[_Union[_task_definition_pb2.Task, _Mapping]]] = ..., token: _Optional[str] = ...) -> None: ...
|
|
@@ -25,6 +25,11 @@ class TaskServiceStub(object):
|
|
|
25
25
|
request_serializer=workflow_dot_task__service__pb2.GetTaskDetailsRequest.SerializeToString,
|
|
26
26
|
response_deserializer=workflow_dot_task__service__pb2.GetTaskDetailsResponse.FromString,
|
|
27
27
|
)
|
|
28
|
+
self.ListTasks = channel.unary_unary(
|
|
29
|
+
'/cloudidl.workflow.TaskService/ListTasks',
|
|
30
|
+
request_serializer=workflow_dot_task__service__pb2.ListTasksRequest.SerializeToString,
|
|
31
|
+
response_deserializer=workflow_dot_task__service__pb2.ListTasksResponse.FromString,
|
|
32
|
+
)
|
|
28
33
|
|
|
29
34
|
|
|
30
35
|
class TaskServiceServicer(object):
|
|
@@ -45,6 +50,13 @@ class TaskServiceServicer(object):
|
|
|
45
50
|
context.set_details('Method not implemented!')
|
|
46
51
|
raise NotImplementedError('Method not implemented!')
|
|
47
52
|
|
|
53
|
+
def ListTasks(self, request, context):
|
|
54
|
+
"""Lists tasks, one per task name, returning the latest version and who it was deployed by.
|
|
55
|
+
"""
|
|
56
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
57
|
+
context.set_details('Method not implemented!')
|
|
58
|
+
raise NotImplementedError('Method not implemented!')
|
|
59
|
+
|
|
48
60
|
|
|
49
61
|
def add_TaskServiceServicer_to_server(servicer, server):
|
|
50
62
|
rpc_method_handlers = {
|
|
@@ -58,6 +70,11 @@ def add_TaskServiceServicer_to_server(servicer, server):
|
|
|
58
70
|
request_deserializer=workflow_dot_task__service__pb2.GetTaskDetailsRequest.FromString,
|
|
59
71
|
response_serializer=workflow_dot_task__service__pb2.GetTaskDetailsResponse.SerializeToString,
|
|
60
72
|
),
|
|
73
|
+
'ListTasks': grpc.unary_unary_rpc_method_handler(
|
|
74
|
+
servicer.ListTasks,
|
|
75
|
+
request_deserializer=workflow_dot_task__service__pb2.ListTasksRequest.FromString,
|
|
76
|
+
response_serializer=workflow_dot_task__service__pb2.ListTasksResponse.SerializeToString,
|
|
77
|
+
),
|
|
61
78
|
}
|
|
62
79
|
generic_handler = grpc.method_handlers_generic_handler(
|
|
63
80
|
'cloudidl.workflow.TaskService', rpc_method_handlers)
|
|
@@ -102,3 +119,20 @@ class TaskService(object):
|
|
|
102
119
|
workflow_dot_task__service__pb2.GetTaskDetailsResponse.FromString,
|
|
103
120
|
options, channel_credentials,
|
|
104
121
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
122
|
+
|
|
123
|
+
@staticmethod
|
|
124
|
+
def ListTasks(request,
|
|
125
|
+
target,
|
|
126
|
+
options=(),
|
|
127
|
+
channel_credentials=None,
|
|
128
|
+
call_credentials=None,
|
|
129
|
+
insecure=False,
|
|
130
|
+
compression=None,
|
|
131
|
+
wait_for_ready=None,
|
|
132
|
+
timeout=None,
|
|
133
|
+
metadata=None):
|
|
134
|
+
return grpc.experimental.unary_unary(request, target, '/cloudidl.workflow.TaskService/ListTasks',
|
|
135
|
+
workflow_dot_task__service__pb2.ListTasksRequest.SerializeToString,
|
|
136
|
+
workflow_dot_task__service__pb2.ListTasksResponse.FromString,
|
|
137
|
+
options, channel_credentials,
|
|
138
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
flyte/_run.py
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import asyncio
|
|
3
4
|
import pathlib
|
|
4
5
|
import uuid
|
|
5
6
|
from typing import TYPE_CHECKING, Any, Literal, Optional, Tuple, Union, cast
|
|
6
7
|
|
|
7
|
-
import flyte
|
|
8
|
-
|
|
9
|
-
from flyte import
|
|
8
|
+
import flyte.errors
|
|
9
|
+
from flyte.errors import InitializationError
|
|
10
|
+
from flyte.models import ActionID, Checkpoints, CodeBundle, RawDataPath, SerializationContext, TaskContext
|
|
11
|
+
from flyte.syncify import syncify
|
|
10
12
|
|
|
11
|
-
from ._api_commons import syncer
|
|
12
13
|
from ._context import contextual_run, internal_ctx
|
|
13
|
-
from ._datastructures import ActionID, Checkpoints, RawDataPath, SerializationContext, TaskContext
|
|
14
14
|
from ._environment import Environment
|
|
15
15
|
from ._initialize import (
|
|
16
|
-
ABFS,
|
|
17
|
-
GCS,
|
|
18
16
|
_get_init_config,
|
|
19
17
|
get_client,
|
|
20
18
|
get_common_config,
|
|
@@ -22,24 +20,35 @@ from ._initialize import (
|
|
|
22
20
|
requires_initialization,
|
|
23
21
|
requires_storage,
|
|
24
22
|
)
|
|
25
|
-
from ._internal import create_controller
|
|
26
|
-
from ._internal.runtime.io import _CHECKPOINT_FILE_NAME
|
|
27
|
-
from ._internal.runtime.taskrunner import run_task
|
|
28
23
|
from ._logging import logger
|
|
29
|
-
from ._protos.common import identifier_pb2
|
|
30
24
|
from ._task import P, R, TaskTemplate
|
|
31
25
|
from ._tools import ipython_check
|
|
32
|
-
from .errors import InitializationError
|
|
33
26
|
|
|
34
27
|
if TYPE_CHECKING:
|
|
35
28
|
from flyte.remote import Run
|
|
29
|
+
from flyte.remote._task import LazyEntity
|
|
36
30
|
|
|
37
31
|
from ._code_bundle import CopyFiles
|
|
38
32
|
|
|
39
33
|
Mode = Literal["local", "remote", "hybrid"]
|
|
40
34
|
|
|
41
35
|
|
|
42
|
-
|
|
36
|
+
async def _get_code_bundle_for_run(name: str) -> CodeBundle | None:
|
|
37
|
+
"""
|
|
38
|
+
Get the code bundle for the run with the given name.
|
|
39
|
+
This is used to get the code bundle for the run when running in hybrid mode.
|
|
40
|
+
"""
|
|
41
|
+
from flyte._internal.runtime.task_serde import extract_code_bundle
|
|
42
|
+
from flyte.remote import Run
|
|
43
|
+
|
|
44
|
+
run = await Run.get.aio(name=name)
|
|
45
|
+
if run:
|
|
46
|
+
run_details = await run.details()
|
|
47
|
+
spec = run_details.action_details.pb2.resolved_task_spec
|
|
48
|
+
return extract_code_bundle(spec)
|
|
49
|
+
return None
|
|
50
|
+
|
|
51
|
+
|
|
43
52
|
class _Runner:
|
|
44
53
|
def __init__(
|
|
45
54
|
self,
|
|
@@ -54,13 +63,14 @@ class _Runner:
|
|
|
54
63
|
raw_data_path: str | None = None,
|
|
55
64
|
metadata_path: str | None = None,
|
|
56
65
|
run_base_dir: str | None = None,
|
|
66
|
+
overwrite_cache: bool = False,
|
|
57
67
|
):
|
|
58
68
|
init_config = _get_init_config()
|
|
59
69
|
client = init_config.client if init_config else None
|
|
60
70
|
if not force_mode and client is not None:
|
|
61
71
|
force_mode = "remote"
|
|
62
72
|
force_mode = force_mode or "local"
|
|
63
|
-
logger.debug(f"Effective run mode: {force_mode}
|
|
73
|
+
logger.debug(f"Effective run mode: `{force_mode}`, client configured: `{client is not None}`")
|
|
64
74
|
self._mode = force_mode
|
|
65
75
|
self._name = name
|
|
66
76
|
self._service_account = service_account
|
|
@@ -72,50 +82,65 @@ class _Runner:
|
|
|
72
82
|
self._raw_data_path = raw_data_path
|
|
73
83
|
self._metadata_path = metadata_path or "/tmp"
|
|
74
84
|
self._run_base_dir = run_base_dir or "/tmp/base"
|
|
85
|
+
self._overwrite_cache = overwrite_cache
|
|
75
86
|
|
|
76
87
|
@requires_initialization
|
|
77
|
-
async def _run_remote(self, obj: TaskTemplate[P, R], *args: P.args, **kwargs: P.kwargs) -> Run:
|
|
88
|
+
async def _run_remote(self, obj: TaskTemplate[P, R] | LazyEntity, *args: P.args, **kwargs: P.kwargs) -> Run:
|
|
89
|
+
import grpc
|
|
90
|
+
|
|
78
91
|
from flyte.remote import Run
|
|
92
|
+
from flyte.remote._task import LazyEntity
|
|
79
93
|
|
|
80
94
|
from ._code_bundle import build_code_bundle, build_pkl_bundle
|
|
81
95
|
from ._deploy import build_images, plan_deploy
|
|
82
96
|
from ._internal.runtime.convert import convert_from_native_to_inputs
|
|
83
97
|
from ._internal.runtime.task_serde import translate_task_to_wire
|
|
98
|
+
from ._protos.common import identifier_pb2
|
|
84
99
|
from ._protos.workflow import run_definition_pb2, run_service_pb2
|
|
85
100
|
|
|
86
101
|
cfg = get_common_config()
|
|
87
102
|
|
|
88
|
-
if obj
|
|
89
|
-
|
|
103
|
+
if isinstance(obj, LazyEntity):
|
|
104
|
+
task = await obj.fetch.aio()
|
|
105
|
+
task_spec = task.pb2.spec
|
|
106
|
+
inputs = await convert_from_native_to_inputs(task.interface, *args, **kwargs)
|
|
107
|
+
version = task.pb2.task_id.version
|
|
108
|
+
code_bundle = None
|
|
109
|
+
else:
|
|
110
|
+
if obj.parent_env is None:
|
|
111
|
+
raise ValueError("Task is not attached to an environment. Please attach the task to an environment")
|
|
90
112
|
|
|
91
|
-
|
|
92
|
-
|
|
113
|
+
deploy_plan = plan_deploy(cast(Environment, obj.parent_env()))
|
|
114
|
+
image_cache = await build_images(deploy_plan)
|
|
93
115
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
)
|
|
98
|
-
else:
|
|
99
|
-
if self._copy_files != "none":
|
|
100
|
-
code_bundle = await build_code_bundle(
|
|
101
|
-
from_dir=cfg.root_dir, dryrun=self._dry_run, copy_bundle_to=self._copy_bundle_to
|
|
116
|
+
if self._interactive_mode:
|
|
117
|
+
code_bundle = await build_pkl_bundle(
|
|
118
|
+
obj, upload_to_controlplane=not self._dry_run, copy_bundle_to=self._copy_bundle_to
|
|
102
119
|
)
|
|
103
120
|
else:
|
|
104
|
-
|
|
121
|
+
if self._copy_files != "none":
|
|
122
|
+
code_bundle = await build_code_bundle(
|
|
123
|
+
from_dir=cfg.root_dir,
|
|
124
|
+
dryrun=self._dry_run,
|
|
125
|
+
copy_bundle_to=self._copy_bundle_to,
|
|
126
|
+
copy_style=self._copy_files,
|
|
127
|
+
)
|
|
128
|
+
else:
|
|
129
|
+
code_bundle = None
|
|
105
130
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
131
|
+
version = self._version or (
|
|
132
|
+
code_bundle.computed_version if code_bundle and code_bundle.computed_version else None
|
|
133
|
+
)
|
|
134
|
+
if not version:
|
|
135
|
+
raise ValueError("Version is required when running a task")
|
|
136
|
+
s_ctx = SerializationContext(
|
|
137
|
+
code_bundle=code_bundle,
|
|
138
|
+
version=version,
|
|
139
|
+
image_cache=image_cache,
|
|
140
|
+
root_dir=cfg.root_dir,
|
|
141
|
+
)
|
|
142
|
+
task_spec = translate_task_to_wire(obj, s_ctx)
|
|
143
|
+
inputs = await convert_from_native_to_inputs(obj.native_interface, *args, **kwargs)
|
|
119
144
|
|
|
120
145
|
if not self._dry_run:
|
|
121
146
|
if get_client() is None:
|
|
@@ -152,15 +177,38 @@ class _Runner:
|
|
|
152
177
|
if task_spec.task_template.id.version == "":
|
|
153
178
|
task_spec.task_template.id.version = version
|
|
154
179
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
180
|
+
try:
|
|
181
|
+
resp = await get_client().run_service.CreateRun(
|
|
182
|
+
run_service_pb2.CreateRunRequest(
|
|
183
|
+
run_id=run_id,
|
|
184
|
+
project_id=project_id,
|
|
185
|
+
task_spec=task_spec,
|
|
186
|
+
inputs=inputs.proto_inputs,
|
|
187
|
+
run_spec=run_definition_pb2.RunSpec(
|
|
188
|
+
overwrite_cache=self._overwrite_cache,
|
|
189
|
+
),
|
|
190
|
+
),
|
|
191
|
+
)
|
|
192
|
+
return Run(pb2=resp.run)
|
|
193
|
+
except grpc.aio.AioRpcError as e:
|
|
194
|
+
if e.code() == grpc.StatusCode.UNAVAILABLE:
|
|
195
|
+
raise flyte.errors.RuntimeSystemError(
|
|
196
|
+
"SystemUnavailableError",
|
|
197
|
+
"Flyte system is currently unavailable. check your configuration, or the service status.",
|
|
198
|
+
) from e
|
|
199
|
+
elif e.code() == grpc.StatusCode.INVALID_ARGUMENT:
|
|
200
|
+
raise flyte.errors.RuntimeUserError("InvalidArgumentError", e.details())
|
|
201
|
+
elif e.code() == grpc.StatusCode.ALREADY_EXISTS:
|
|
202
|
+
# TODO maybe this should be a pass and return existing run?
|
|
203
|
+
raise flyte.errors.RuntimeUserError(
|
|
204
|
+
"RunAlreadyExistsError",
|
|
205
|
+
f"A run with the name '{self._name}' already exists. Please choose a different name.",
|
|
206
|
+
)
|
|
207
|
+
else:
|
|
208
|
+
raise flyte.errors.RuntimeSystemError(
|
|
209
|
+
"RunCreationError",
|
|
210
|
+
f"Failed to create run: {e.details()}",
|
|
211
|
+
) from e
|
|
164
212
|
|
|
165
213
|
class DryRun(Run):
|
|
166
214
|
def __init__(self, _task_spec, _inputs, _code_bundle):
|
|
@@ -187,9 +235,14 @@ class _Runner:
|
|
|
187
235
|
run in the cluster remotely. This is currently only used for testing,
|
|
188
236
|
over the longer term we will productize this.
|
|
189
237
|
"""
|
|
238
|
+
import flyte.report
|
|
190
239
|
from flyte._code_bundle import build_code_bundle, build_pkl_bundle
|
|
191
|
-
from flyte._datastructures import RawDataPath
|
|
192
240
|
from flyte._deploy import build_images, plan_deploy
|
|
241
|
+
from flyte.models import RawDataPath
|
|
242
|
+
from flyte.storage import ABFS, GCS, S3
|
|
243
|
+
|
|
244
|
+
from ._internal import create_controller
|
|
245
|
+
from ._internal.runtime.taskrunner import run_task
|
|
193
246
|
|
|
194
247
|
cfg = get_common_config()
|
|
195
248
|
|
|
@@ -199,17 +252,26 @@ class _Runner:
|
|
|
199
252
|
deploy_plan = plan_deploy(cast(Environment, obj.parent_env()))
|
|
200
253
|
image_cache = await build_images(deploy_plan)
|
|
201
254
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
)
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
255
|
+
code_bundle = None
|
|
256
|
+
if self._name is not None:
|
|
257
|
+
# Check if remote run service has this run name already and if exists, then extract the code bundle from it.
|
|
258
|
+
code_bundle = await _get_code_bundle_for_run(name=self._name)
|
|
259
|
+
|
|
260
|
+
if not code_bundle:
|
|
261
|
+
if self._interactive_mode:
|
|
262
|
+
code_bundle = await build_pkl_bundle(
|
|
263
|
+
obj, upload_to_controlplane=not self._dry_run, copy_bundle_to=self._copy_bundle_to
|
|
210
264
|
)
|
|
211
265
|
else:
|
|
212
|
-
|
|
266
|
+
if self._copy_files != "none":
|
|
267
|
+
code_bundle = await build_code_bundle(
|
|
268
|
+
from_dir=cfg.root_dir,
|
|
269
|
+
dryrun=self._dry_run,
|
|
270
|
+
copy_bundle_to=self._copy_bundle_to,
|
|
271
|
+
copy_style=self._copy_files,
|
|
272
|
+
)
|
|
273
|
+
else:
|
|
274
|
+
code_bundle = None
|
|
213
275
|
|
|
214
276
|
version = self._version or (
|
|
215
277
|
code_bundle.computed_version if code_bundle and code_bundle.computed_version else None
|
|
@@ -217,14 +279,14 @@ class _Runner:
|
|
|
217
279
|
if not version:
|
|
218
280
|
raise ValueError("Version is required when running a task")
|
|
219
281
|
|
|
220
|
-
project = cfg.project
|
|
221
|
-
domain = cfg.domain
|
|
222
|
-
org = cfg.org
|
|
282
|
+
project = cfg.project
|
|
283
|
+
domain = cfg.domain
|
|
284
|
+
org = cfg.org
|
|
223
285
|
action_name = "a0"
|
|
224
286
|
run_name = self._name
|
|
225
287
|
random_id = str(uuid.uuid4())[:6]
|
|
226
288
|
|
|
227
|
-
controller = create_controller(
|
|
289
|
+
controller = create_controller("remote", endpoint="localhost:8090", insecure=True)
|
|
228
290
|
action = ActionID(name=action_name, run_name=run_name, project=project, domain=domain, org=org)
|
|
229
291
|
|
|
230
292
|
inputs = obj.native_interface.convert_to_kwargs(*args, **kwargs)
|
|
@@ -242,7 +304,7 @@ class _Runner:
|
|
|
242
304
|
output_path = self._run_base_dir
|
|
243
305
|
raw_data_path = f"{output_path}/rd/{random_id}"
|
|
244
306
|
raw_data_path_obj = RawDataPath(path=raw_data_path)
|
|
245
|
-
checkpoint_path = f"{raw_data_path}/
|
|
307
|
+
checkpoint_path = f"{raw_data_path}/checkpoint"
|
|
246
308
|
prev_checkpoint = f"{raw_data_path}/prev_checkpoint"
|
|
247
309
|
checkpoints = Checkpoints(checkpoint_path, prev_checkpoint)
|
|
248
310
|
|
|
@@ -253,7 +315,7 @@ class _Runner:
|
|
|
253
315
|
checkpoints=checkpoints,
|
|
254
316
|
code_bundle=code_bundle,
|
|
255
317
|
output_path=output_path,
|
|
256
|
-
version=version,
|
|
318
|
+
version=version if version else "na",
|
|
257
319
|
raw_data_path=raw_data_path_obj,
|
|
258
320
|
compiled_image_cache=image_cache,
|
|
259
321
|
run_base_dir=self._run_base_dir,
|
|
@@ -269,43 +331,44 @@ class _Runner:
|
|
|
269
331
|
|
|
270
332
|
async def _run_local(self, obj: TaskTemplate[P, R], *args: P.args, **kwargs: P.kwargs) -> R:
|
|
271
333
|
from flyte._internal.controllers import create_controller
|
|
272
|
-
from flyte._internal.
|
|
273
|
-
|
|
274
|
-
convert_from_native_to_inputs,
|
|
275
|
-
convert_outputs_to_native,
|
|
276
|
-
)
|
|
277
|
-
from flyte._internal.runtime.entrypoints import direct_dispatch
|
|
334
|
+
from flyte._internal.controllers._local_controller import LocalController
|
|
335
|
+
from flyte.report import Report
|
|
278
336
|
|
|
279
|
-
controller = create_controller(
|
|
337
|
+
controller = cast(LocalController, create_controller("local"))
|
|
280
338
|
|
|
281
|
-
inputs = await convert_from_native_to_inputs(obj.native_interface, *args, **kwargs)
|
|
282
339
|
if self._name is None:
|
|
283
340
|
action = ActionID.create_random()
|
|
284
341
|
else:
|
|
285
342
|
action = ActionID(name=self._name)
|
|
286
|
-
|
|
287
|
-
|
|
343
|
+
|
|
344
|
+
ctx = internal_ctx()
|
|
345
|
+
tctx = TaskContext(
|
|
288
346
|
action=action,
|
|
289
|
-
raw_data_path=internal_ctx().raw_data,
|
|
290
|
-
version="na",
|
|
291
|
-
controller=controller,
|
|
292
|
-
inputs=inputs,
|
|
293
|
-
output_path=self._metadata_path,
|
|
294
|
-
run_base_dir=self._metadata_path,
|
|
295
347
|
checkpoints=Checkpoints(
|
|
296
348
|
prev_checkpoint_path=internal_ctx().raw_data.path, checkpoint_path=internal_ctx().raw_data.path
|
|
297
349
|
),
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
350
|
+
code_bundle=None,
|
|
351
|
+
output_path=self._metadata_path,
|
|
352
|
+
run_base_dir=self._metadata_path,
|
|
353
|
+
version="na",
|
|
354
|
+
raw_data_path=internal_ctx().raw_data,
|
|
355
|
+
compiled_image_cache=None,
|
|
356
|
+
report=Report(name=action.name),
|
|
357
|
+
mode="local",
|
|
358
|
+
)
|
|
359
|
+
with ctx.replace_task_context(tctx):
|
|
360
|
+
# make the local version always runs on a different thread, returns a wrapped future.
|
|
361
|
+
if obj._call_as_synchronous:
|
|
362
|
+
fut = controller.submit_sync(obj, *args, **kwargs)
|
|
363
|
+
awaitable = asyncio.wrap_future(fut)
|
|
364
|
+
return await awaitable
|
|
365
|
+
else:
|
|
366
|
+
return await controller.submit(obj, *args, **kwargs)
|
|
367
|
+
|
|
368
|
+
@syncify
|
|
369
|
+
async def run(
|
|
370
|
+
self, task: TaskTemplate[P, Union[R, Run]] | LazyEntity, *args: P.args, **kwargs: P.kwargs
|
|
371
|
+
) -> Union[R, Run]:
|
|
309
372
|
"""
|
|
310
373
|
Run an async `@env.task` or `TaskTemplate` instance. The existing async context will be used.
|
|
311
374
|
|
|
@@ -327,13 +390,18 @@ class _Runner:
|
|
|
327
390
|
:param kwargs: Keyword arguments to pass to the Task
|
|
328
391
|
:return: Run instance or the result of the task
|
|
329
392
|
"""
|
|
393
|
+
from flyte.remote._task import LazyEntity
|
|
394
|
+
|
|
395
|
+
if isinstance(task, LazyEntity) and self._mode != "remote":
|
|
396
|
+
raise ValueError("Remote task can only be run in remote mode.")
|
|
330
397
|
if self._mode == "remote":
|
|
331
398
|
return await self._run_remote(task, *args, **kwargs)
|
|
399
|
+
task = cast(TaskTemplate, task)
|
|
332
400
|
if self._mode == "hybrid":
|
|
333
401
|
return await self._run_hybrid(task, *args, **kwargs)
|
|
334
402
|
|
|
335
403
|
# TODO We could use this for remote as well and users could simply pass flyte:// or s3:// or file://
|
|
336
|
-
|
|
404
|
+
with internal_ctx().new_raw_data_path(
|
|
337
405
|
raw_data_path=RawDataPath.from_local_folder(local_folder=self._raw_data_path)
|
|
338
406
|
):
|
|
339
407
|
return await self._run_local(task, *args, **kwargs)
|
|
@@ -351,6 +419,7 @@ def with_runcontext(
|
|
|
351
419
|
interactive_mode: bool | None = None,
|
|
352
420
|
raw_data_path: str | None = None,
|
|
353
421
|
run_base_dir: str | None = None,
|
|
422
|
+
overwrite_cache: bool = False,
|
|
354
423
|
) -> _Runner:
|
|
355
424
|
"""
|
|
356
425
|
Launch a new run with the given parameters as the context.
|
|
@@ -380,6 +449,8 @@ def with_runcontext(
|
|
|
380
449
|
interactive mode, while scripts are not. This is used to determine how the code bundle is created.
|
|
381
450
|
:param raw_data_path: Use this path to store the raw data for the run. Currently only supported for local runs,
|
|
382
451
|
and can be used to store raw data in specific locations. TODO coming soon for remote runs as well.
|
|
452
|
+
:param run_base_dir: Optional The base directory to use for the run. This is used to store the metadata for the run,
|
|
453
|
+
that is passed between tasks.
|
|
383
454
|
:return: runner
|
|
384
455
|
"""
|
|
385
456
|
if mode == "hybrid" and not name and not run_base_dir:
|
|
@@ -398,7 +469,7 @@ def with_runcontext(
|
|
|
398
469
|
)
|
|
399
470
|
|
|
400
471
|
|
|
401
|
-
@
|
|
472
|
+
@syncify
|
|
402
473
|
async def run(task: TaskTemplate[P, R], *args: P.args, **kwargs: P.kwargs) -> Union[R, Run]:
|
|
403
474
|
"""
|
|
404
475
|
Run a task with the given parameters
|