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,202 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
This module provides functionality to serialize and deserialize tasks to and from the wire format.
|
|
3
|
-
It includes a Resolver interface for loading tasks, and functions to load classes and tasks.
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
import importlib
|
|
7
|
-
from typing import List, Optional, Type
|
|
8
|
-
|
|
9
|
-
from flyteidl.core import identifier_pb2, literals_pb2, security_pb2, tasks_pb2
|
|
10
|
-
from google.protobuf import duration_pb2, wrappers_pb2
|
|
11
|
-
|
|
12
|
-
from union._cache.cache import VersionParameters, cache_from_request
|
|
13
|
-
from union._datastructures import SerializationContext
|
|
14
|
-
from union._internal.resolvers.common import Resolver
|
|
15
|
-
from union._logging import logger
|
|
16
|
-
from union._protos.workflow import task_definition_pb2
|
|
17
|
-
from union._secret import SecretRequest, secrets_from_request
|
|
18
|
-
from union._task import AsyncFunctionTaskTemplate, TaskTemplate
|
|
19
|
-
|
|
20
|
-
from ..._timeout import timeout_from_request
|
|
21
|
-
from .resources_serde import get_proto_extended_resources, get_proto_resources
|
|
22
|
-
from .types_serde import transform_native_to_typed_interface
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
def load_class(qualified_name) -> Type:
|
|
26
|
-
"""
|
|
27
|
-
Load a class from a qualified name. The qualified name should be in the format 'module.ClassName'.
|
|
28
|
-
:param qualified_name: The qualified name of the class to load.
|
|
29
|
-
:return: The class object.
|
|
30
|
-
"""
|
|
31
|
-
module_name, class_name = qualified_name.rsplit(".", 1) # Split module and class
|
|
32
|
-
module = importlib.import_module(module_name) # Import the module
|
|
33
|
-
return getattr(module, class_name) # Retrieve the class
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def load_task(resolver: str, *resolver_args: str) -> TaskTemplate:
|
|
37
|
-
"""
|
|
38
|
-
Load a task from a resolver. This is a placeholder function.
|
|
39
|
-
|
|
40
|
-
:param resolver: The resolver to use to load the task.
|
|
41
|
-
:param resolver_args: Arguments to pass to the resolver.
|
|
42
|
-
:return: The loaded task.
|
|
43
|
-
"""
|
|
44
|
-
resolver_class = load_class(resolver)
|
|
45
|
-
resolver_instance = resolver_class()
|
|
46
|
-
return resolver_instance.load_task(resolver_args)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
def get_task_loader_args(resolver: Resolver, task: TaskTemplate) -> List[str]:
|
|
50
|
-
"""
|
|
51
|
-
Get the task loader args from a resolver. This is a placeholder function.
|
|
52
|
-
|
|
53
|
-
:param resolver: The resolver to use to load the task.
|
|
54
|
-
:param task: The task to get the loader args for.
|
|
55
|
-
|
|
56
|
-
:return: The loader args for the task.
|
|
57
|
-
"""
|
|
58
|
-
return resolver.loader_args(task)
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
def translate_task_to_wire(
|
|
62
|
-
task: TaskTemplate, serialization_context: SerializationContext
|
|
63
|
-
) -> task_definition_pb2.TaskSpec:
|
|
64
|
-
"""
|
|
65
|
-
Translate a task to a wire format. This is a placeholder function.
|
|
66
|
-
|
|
67
|
-
:param task: The task to translate.
|
|
68
|
-
:param serialization_context: The serialization context to use for the translation.
|
|
69
|
-
|
|
70
|
-
:return: The translated task.
|
|
71
|
-
"""
|
|
72
|
-
# Placeholder implementation
|
|
73
|
-
return get_proto_task(task, serialization_context)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
def get_security_context(secrets: Optional[SecretRequest]) -> Optional[security_pb2.SecurityContext]:
|
|
77
|
-
"""
|
|
78
|
-
Get the security context from a list of secrets. This is a placeholder function.
|
|
79
|
-
|
|
80
|
-
:param secrets: The list of secrets to use for the security context.
|
|
81
|
-
|
|
82
|
-
:return: The security context.
|
|
83
|
-
"""
|
|
84
|
-
if secrets is None:
|
|
85
|
-
return None
|
|
86
|
-
|
|
87
|
-
secret_list = secrets_from_request(secrets)
|
|
88
|
-
return security_pb2.SecurityContext(
|
|
89
|
-
secrets=[
|
|
90
|
-
security_pb2.Secret(
|
|
91
|
-
group=secret.group,
|
|
92
|
-
key=secret.key,
|
|
93
|
-
mount_requirement=(
|
|
94
|
-
security_pb2.Secret.MountType.ENV_VAR if secret.as_env_var else security_pb2.Secret.MountType.FILE
|
|
95
|
-
),
|
|
96
|
-
env_var=secret.as_env_var,
|
|
97
|
-
)
|
|
98
|
-
for secret in secret_list
|
|
99
|
-
]
|
|
100
|
-
)
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
def get_proto_task(task: TaskTemplate, serialize_context: SerializationContext) -> task_definition_pb2.TaskSpec:
|
|
104
|
-
task_id = identifier_pb2.Identifier(
|
|
105
|
-
resource_type=identifier_pb2.ResourceType.TASK,
|
|
106
|
-
project=serialize_context.project,
|
|
107
|
-
domain=serialize_context.domain,
|
|
108
|
-
org=serialize_context.org,
|
|
109
|
-
name=task.name,
|
|
110
|
-
version=serialize_context.version,
|
|
111
|
-
)
|
|
112
|
-
|
|
113
|
-
# TODO, there will be tasks that do not have images, handle that case
|
|
114
|
-
# if task.parent_env is None:
|
|
115
|
-
# raise ValueError(f"Task {task.name} must have a parent environment")
|
|
116
|
-
|
|
117
|
-
#
|
|
118
|
-
# This pod will be incorrect when doing fast serialize
|
|
119
|
-
#
|
|
120
|
-
pod = None
|
|
121
|
-
sql = None
|
|
122
|
-
container = _get_urun_container(serialize_context, task)
|
|
123
|
-
# pod = task.get_k8s_pod(serialize_context)
|
|
124
|
-
extra_config = {}
|
|
125
|
-
custom = {}
|
|
126
|
-
task_cache = cache_from_request(task.cache)
|
|
127
|
-
|
|
128
|
-
# -------------- CACHE HANDLING ----------------------
|
|
129
|
-
task_cache = cache_from_request(task.cache)
|
|
130
|
-
cache_enabled = task_cache.is_enabled()
|
|
131
|
-
cache_version = None
|
|
132
|
-
|
|
133
|
-
if task_cache.is_enabled():
|
|
134
|
-
logger.debug(f"Cache enabled for task {task.name}")
|
|
135
|
-
if serialize_context.code_bundle and serialize_context.code_bundle.pkl:
|
|
136
|
-
logger.debug(f"Detected pkl bundle for task {task.name}, using computed version as cache version")
|
|
137
|
-
cache_version = serialize_context.code_bundle.computed_version
|
|
138
|
-
else:
|
|
139
|
-
version_parameters = None
|
|
140
|
-
if isinstance(task, AsyncFunctionTaskTemplate):
|
|
141
|
-
version_parameters = VersionParameters(func=task.func, image=task.image)
|
|
142
|
-
else:
|
|
143
|
-
version_parameters = VersionParameters(func=None, image=task.image)
|
|
144
|
-
cache_version = task_cache.get_version(version_parameters)
|
|
145
|
-
logger.debug(f"Cache version for task {task.name} is {cache_version}")
|
|
146
|
-
else:
|
|
147
|
-
logger.debug(f"Cache disabled for task {task.name}")
|
|
148
|
-
|
|
149
|
-
tt = tasks_pb2.TaskTemplate(
|
|
150
|
-
id=task_id,
|
|
151
|
-
type=task.task_type,
|
|
152
|
-
metadata=tasks_pb2.TaskMetadata(
|
|
153
|
-
discoverable=cache_enabled,
|
|
154
|
-
discovery_version=cache_version,
|
|
155
|
-
cache_serializable=task_cache.serialize,
|
|
156
|
-
cache_ignore_input_vars=task.cache.ignored_inputs,
|
|
157
|
-
runtime=tasks_pb2.RuntimeMetadata(),
|
|
158
|
-
retries=literals_pb2.RetryStrategy(retries=task.retries.count),
|
|
159
|
-
timeout=duration_pb2.Duration(seconds=timeout_from_request(task.timeout).max_runtime.seconds)
|
|
160
|
-
if task.timeout
|
|
161
|
-
else None,
|
|
162
|
-
pod_template_name=task.pod_template if task.pod_template and isinstance(task.pod_template, str) else None,
|
|
163
|
-
interruptible=task.interruptable,
|
|
164
|
-
generates_deck=wrappers_pb2.BoolValue(value=False), # TODO add support for reports
|
|
165
|
-
),
|
|
166
|
-
interface=transform_native_to_typed_interface(task.native_interface),
|
|
167
|
-
custom=custom,
|
|
168
|
-
container=container,
|
|
169
|
-
task_type_version=task.task_type_version,
|
|
170
|
-
security_context=get_security_context(task.secrets),
|
|
171
|
-
config=extra_config,
|
|
172
|
-
k8s_pod=pod,
|
|
173
|
-
sql=sql,
|
|
174
|
-
extended_resources=get_proto_extended_resources(task.resources),
|
|
175
|
-
)
|
|
176
|
-
return task_definition_pb2.TaskSpec(task_template=tt)
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
def _get_urun_container(
|
|
180
|
-
serialize_context: SerializationContext, task_template: TaskTemplate
|
|
181
|
-
) -> Optional[tasks_pb2.Container]:
|
|
182
|
-
env = (
|
|
183
|
-
[literals_pb2.KeyValuePair(key=k, value=v) for k, v in task_template.env.items()] if task_template.env else None
|
|
184
|
-
)
|
|
185
|
-
resources = get_proto_resources(task_template.resources)
|
|
186
|
-
# pr: under what conditions should this return None?
|
|
187
|
-
image_id = task_template.image.identifier
|
|
188
|
-
if not serialize_context.image_cache or image_id not in serialize_context.image_cache.image_lookup:
|
|
189
|
-
# This computes the image uri, computing hashes as necessary so can fail if done remotely.
|
|
190
|
-
img_uri = task_template.image.uri
|
|
191
|
-
else:
|
|
192
|
-
img_uri = serialize_context.image_cache.image_lookup[image_id]
|
|
193
|
-
|
|
194
|
-
return tasks_pb2.Container(
|
|
195
|
-
image=img_uri,
|
|
196
|
-
command=[],
|
|
197
|
-
args=task_template.container_args(serialize_context),
|
|
198
|
-
resources=resources,
|
|
199
|
-
env=env,
|
|
200
|
-
data_config=task_template.data_loading_config(serialize_context),
|
|
201
|
-
config=task_template.config(serialize_context),
|
|
202
|
-
)
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
This module is responsible for running tasks in the V2 runtime. All methods in this file should be
|
|
3
|
-
invoked within a context tree.
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
import logging
|
|
7
|
-
import pathlib
|
|
8
|
-
from typing import Any, Dict, List, Optional, Tuple
|
|
9
|
-
|
|
10
|
-
from union._context import internal_ctx
|
|
11
|
-
from union._datastructures import ActionID, Checkpoints, CodeBundle, RawDataPath, TaskContext
|
|
12
|
-
from union._internal.imagebuild.image_builder import ImageCache
|
|
13
|
-
from union._logging import log, logger
|
|
14
|
-
from union._task import TaskTemplate
|
|
15
|
-
from union.errors import CustomError, RuntimeSystemError, RuntimeUnknownError, RuntimeUserError
|
|
16
|
-
|
|
17
|
-
from .. import Controller
|
|
18
|
-
from .convert import (
|
|
19
|
-
Error,
|
|
20
|
-
Inputs,
|
|
21
|
-
Outputs,
|
|
22
|
-
convert_from_native_to_error,
|
|
23
|
-
convert_from_native_to_outputs,
|
|
24
|
-
convert_inputs_to_native,
|
|
25
|
-
)
|
|
26
|
-
from .io import load_inputs, upload_error, upload_outputs
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def replace_task_cli(args: List[str], inputs: Inputs, tmp_path: pathlib.Path, action: ActionID) -> List[str]:
|
|
30
|
-
"""
|
|
31
|
-
This method can be used to run an task from the cli, if you have cli for the task. It will replace,
|
|
32
|
-
all the args with the task args.
|
|
33
|
-
|
|
34
|
-
The urun cli is of the format
|
|
35
|
-
```python
|
|
36
|
-
['urun', '--inputs', '{{.Inputs}}', '--outputs-path', '{{.Outputs}}', '--version', '',
|
|
37
|
-
'--raw-data-path', '{{.rawOutputDataPrefix}}',
|
|
38
|
-
'--checkpoint-path', '{{.checkpointOutputPrefix}}', '--prev-checkpoint', '{{.prevCheckpointPrefix}}',
|
|
39
|
-
'--run-name', '{{.runName}}', '--name', '{{.actionName}}',
|
|
40
|
-
'--tgz', 'some-path', '--dest', '.',
|
|
41
|
-
'--resolver', 'union._internal.resolvers.default.DefaultTaskResolver', '--resolver-args',
|
|
42
|
-
'mod', 'test_round_trip', 'instance', 'task1']
|
|
43
|
-
```
|
|
44
|
-
We will replace, inputs, outputs, raw_data_path, checkpoint_path, prev_checkpoint, run_name, name
|
|
45
|
-
with supplied values.
|
|
46
|
-
|
|
47
|
-
:param args: urun command
|
|
48
|
-
:param inputs: converted inputs to the task
|
|
49
|
-
:param tmp_path: temporary path to use for the task
|
|
50
|
-
:param action: run id to use for the task
|
|
51
|
-
:return: modified args
|
|
52
|
-
"""
|
|
53
|
-
# Iterate over all the args and replace the inputs, outputs, raw_data_path, checkpoint_path, prev_checkpoint,
|
|
54
|
-
# root_name, run_name with the supplied values
|
|
55
|
-
# first we will write the inputs to a file called inputs.pb
|
|
56
|
-
inputs_path = tmp_path / "inputs.pb"
|
|
57
|
-
with open(inputs_path, "wb") as f:
|
|
58
|
-
f.write(inputs.proto_inputs.SerializeToString())
|
|
59
|
-
# now modify the args
|
|
60
|
-
for i, arg in enumerate(args):
|
|
61
|
-
match arg:
|
|
62
|
-
case "--inputs":
|
|
63
|
-
args[i + 1] = str(inputs_path)
|
|
64
|
-
case "--outputs-path":
|
|
65
|
-
args[i + 1] = str(tmp_path)
|
|
66
|
-
case "--raw-data-path":
|
|
67
|
-
args[i + 1] = str(tmp_path / "raw_data_path")
|
|
68
|
-
case "--checkpoint-path":
|
|
69
|
-
args[i + 1] = str(tmp_path / "checkpoint_path")
|
|
70
|
-
case "--prev-checkpoint":
|
|
71
|
-
args[i + 1] = str(tmp_path / "prev_checkpoint")
|
|
72
|
-
case "--run-name":
|
|
73
|
-
args[i + 1] = action.run_name
|
|
74
|
-
case "--name":
|
|
75
|
-
args[i + 1] = action.name
|
|
76
|
-
return args
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
@log(level=logging.INFO)
|
|
80
|
-
async def run_task(
|
|
81
|
-
tctx: TaskContext, controller: Controller, task: TaskTemplate, inputs: Dict[str, Any]
|
|
82
|
-
) -> Tuple[Any, Optional[Exception]]:
|
|
83
|
-
try:
|
|
84
|
-
logger.info(f"Parent task executing {tctx.action}")
|
|
85
|
-
outputs = await task.execute(**inputs)
|
|
86
|
-
logger.info(f"Parent task completed successfully, {tctx.action}")
|
|
87
|
-
return outputs, None
|
|
88
|
-
except RuntimeSystemError as e:
|
|
89
|
-
logger.exception(f"Task failed with error: {e}")
|
|
90
|
-
return {}, e
|
|
91
|
-
except RuntimeUnknownError as e:
|
|
92
|
-
logger.exception(f"Task failed with error: {e}")
|
|
93
|
-
return {}, e
|
|
94
|
-
except RuntimeUserError as e:
|
|
95
|
-
logger.exception(f"Task failed with error: {e}")
|
|
96
|
-
return {}, e
|
|
97
|
-
except Exception as e:
|
|
98
|
-
logger.exception(f"Task failed with error: {e}")
|
|
99
|
-
return {}, CustomError.from_exception(e)
|
|
100
|
-
finally:
|
|
101
|
-
logger.info(f"Parent task finalized {tctx.action}")
|
|
102
|
-
# reconstruct run id here
|
|
103
|
-
await controller.finalize_parent_action(tctx.action)
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
async def convert_and_run(
|
|
107
|
-
*,
|
|
108
|
-
task: TaskTemplate,
|
|
109
|
-
inputs: Inputs,
|
|
110
|
-
action: ActionID,
|
|
111
|
-
controller: Controller,
|
|
112
|
-
raw_data_path: RawDataPath,
|
|
113
|
-
version: str,
|
|
114
|
-
output_path: str | None,
|
|
115
|
-
checkpoints: Checkpoints | None = None,
|
|
116
|
-
code_bundle: CodeBundle | None = None,
|
|
117
|
-
image_cache: ImageCache | None = None,
|
|
118
|
-
) -> Tuple[Optional[Outputs], Optional[Error]]:
|
|
119
|
-
"""
|
|
120
|
-
This method is used to convert the inputs to native types, and run the task. It assumes you are running
|
|
121
|
-
in a context tree.
|
|
122
|
-
"""
|
|
123
|
-
ctx = internal_ctx()
|
|
124
|
-
tctx = TaskContext(
|
|
125
|
-
action=action,
|
|
126
|
-
checkpoints=checkpoints,
|
|
127
|
-
code_bundle=code_bundle,
|
|
128
|
-
output_path=output_path,
|
|
129
|
-
version=version,
|
|
130
|
-
raw_data_path=raw_data_path,
|
|
131
|
-
compiled_image_cache=image_cache,
|
|
132
|
-
)
|
|
133
|
-
async with ctx.replace_task_context(tctx):
|
|
134
|
-
inputs_kwargs = await convert_inputs_to_native(inputs, task.native_interface)
|
|
135
|
-
out, err = await run_task(tctx=tctx, controller=controller, task=task, inputs=inputs_kwargs)
|
|
136
|
-
if err is not None:
|
|
137
|
-
return None, convert_from_native_to_error(err)
|
|
138
|
-
return await convert_from_native_to_outputs(out, task.native_interface), None
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
async def extract_download_run_upload(
|
|
142
|
-
task: TaskTemplate,
|
|
143
|
-
*,
|
|
144
|
-
action: ActionID,
|
|
145
|
-
controller: Controller,
|
|
146
|
-
raw_data_path: RawDataPath,
|
|
147
|
-
output_path: str,
|
|
148
|
-
version: str,
|
|
149
|
-
checkpoints: Checkpoints | None = None,
|
|
150
|
-
code_bundle: CodeBundle | None = None,
|
|
151
|
-
input_path: str | Inputs | None = None,
|
|
152
|
-
image_cache: ImageCache | None = None,
|
|
153
|
-
):
|
|
154
|
-
"""
|
|
155
|
-
This method is invoked from the CLI (urun) and is used to run a task. This assumes that the context tree
|
|
156
|
-
has already been created, and the task has been loaded. It also handles the loading of the task.
|
|
157
|
-
"""
|
|
158
|
-
inputs = await load_inputs(input_path) if input_path else None
|
|
159
|
-
outputs, err = await convert_and_run(
|
|
160
|
-
task=task,
|
|
161
|
-
inputs=inputs,
|
|
162
|
-
action=action,
|
|
163
|
-
controller=controller,
|
|
164
|
-
raw_data_path=raw_data_path,
|
|
165
|
-
output_path=output_path,
|
|
166
|
-
version=version,
|
|
167
|
-
checkpoints=checkpoints,
|
|
168
|
-
code_bundle=code_bundle,
|
|
169
|
-
image_cache=image_cache,
|
|
170
|
-
)
|
|
171
|
-
if err is not None:
|
|
172
|
-
path = await upload_error(err.err, output_path)
|
|
173
|
-
logger.error(f"Task {task.name} failed with error: {err}. Uploaded error to {path}")
|
|
174
|
-
return
|
|
175
|
-
if outputs is None:
|
|
176
|
-
logger.info(f"Task {task.name} completed successfully, no outputs")
|
|
177
|
-
return
|
|
178
|
-
await upload_outputs(outputs, output_path) if output_path else None
|
|
179
|
-
logger.info(f"Task {task.name} completed successfully, uploaded outputs to {output_path}")
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
from typing import Dict, Optional, TypeVar
|
|
2
|
-
|
|
3
|
-
from flyteidl.core import interface_pb2
|
|
4
|
-
|
|
5
|
-
from union._datastructures import NativeInterface
|
|
6
|
-
from union.types._type_engine import TypeEngine
|
|
7
|
-
|
|
8
|
-
T = TypeVar("T")
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def transform_variable_map(
|
|
12
|
-
variable_map: Dict[str, type],
|
|
13
|
-
descriptions: Optional[Dict[str, str]] = None,
|
|
14
|
-
) -> Dict[str, interface_pb2.Variable]:
|
|
15
|
-
"""
|
|
16
|
-
Given a map of str (names of inputs for instance) to their Python native types, return a map of the name to a
|
|
17
|
-
Flyte Variable object with that type.
|
|
18
|
-
"""
|
|
19
|
-
res = {}
|
|
20
|
-
descriptions = descriptions or {}
|
|
21
|
-
if variable_map:
|
|
22
|
-
for k, v in variable_map.items():
|
|
23
|
-
res[k] = transform_type(v, descriptions.get(k, k))
|
|
24
|
-
return res
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def transform_native_to_typed_interface(
|
|
28
|
-
interface: Optional[NativeInterface],
|
|
29
|
-
) -> Optional[interface_pb2.TypedInterface]:
|
|
30
|
-
"""
|
|
31
|
-
Transform the given simple python native interface to FlyteIDL's interface
|
|
32
|
-
"""
|
|
33
|
-
if interface is None:
|
|
34
|
-
return None
|
|
35
|
-
if interface.docstring is None:
|
|
36
|
-
input_descriptions = output_descriptions = {}
|
|
37
|
-
else:
|
|
38
|
-
# Fill in descriptions from docstring in the future
|
|
39
|
-
input_descriptions = output_descriptions = {}
|
|
40
|
-
|
|
41
|
-
inputs_map = transform_variable_map(interface.get_input_types(), input_descriptions)
|
|
42
|
-
outputs_map = transform_variable_map(interface.outputs, output_descriptions)
|
|
43
|
-
return interface_pb2.TypedInterface(
|
|
44
|
-
inputs=interface_pb2.VariableMap(variables=inputs_map), outputs=interface_pb2.VariableMap(variables=outputs_map)
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def transform_type(x: type, description: Optional[str] = None) -> interface_pb2.Variable:
|
|
49
|
-
# add artifact handling eventually
|
|
50
|
-
return interface_pb2.Variable(
|
|
51
|
-
type=TypeEngine.to_literal_type(x),
|
|
52
|
-
description=description,
|
|
53
|
-
)
|
union/_logging.py
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import logging
|
|
4
|
-
import os
|
|
5
|
-
from typing import Optional
|
|
6
|
-
|
|
7
|
-
from ._tools import ipython_check, is_in_cluster
|
|
8
|
-
|
|
9
|
-
DEFAULT_LOG_LEVEL = logging.INFO
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
def is_rich_logging_disabled() -> bool:
|
|
13
|
-
"""
|
|
14
|
-
Check if rich logging is enabled
|
|
15
|
-
"""
|
|
16
|
-
return os.environ.get("DISABLE_RICH_LOGGING") is not None
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def get_env_log_level() -> int:
|
|
20
|
-
return os.environ.get("LOG_LEVEL", DEFAULT_LOG_LEVEL)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def log_format_from_env() -> str:
|
|
24
|
-
"""
|
|
25
|
-
Get the log format from the environment variable.
|
|
26
|
-
"""
|
|
27
|
-
return os.environ.get("LOG_FORMAT", "json")
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def get_rich_handler(log_level: int) -> Optional[logging.Handler]:
|
|
31
|
-
"""
|
|
32
|
-
Upgrades the global loggers to use Rich logging.
|
|
33
|
-
"""
|
|
34
|
-
if is_in_cluster():
|
|
35
|
-
return None
|
|
36
|
-
if not ipython_check() and is_rich_logging_disabled():
|
|
37
|
-
return None
|
|
38
|
-
|
|
39
|
-
import click
|
|
40
|
-
from rich.console import Console
|
|
41
|
-
from rich.logging import RichHandler
|
|
42
|
-
|
|
43
|
-
try:
|
|
44
|
-
width = os.get_terminal_size().columns
|
|
45
|
-
except Exception as e:
|
|
46
|
-
logger.debug(f"Failed to get terminal size: {e}")
|
|
47
|
-
width = 160
|
|
48
|
-
|
|
49
|
-
handler = RichHandler(
|
|
50
|
-
tracebacks_suppress=[click],
|
|
51
|
-
rich_tracebacks=True,
|
|
52
|
-
omit_repeated_times=False,
|
|
53
|
-
show_path=False,
|
|
54
|
-
log_time_format="%H:%M:%S.%f",
|
|
55
|
-
console=Console(width=width),
|
|
56
|
-
level=log_level,
|
|
57
|
-
)
|
|
58
|
-
|
|
59
|
-
formatter = logging.Formatter(fmt="%(filename)s:%(lineno)d - %(message)s")
|
|
60
|
-
handler.setFormatter(formatter)
|
|
61
|
-
return handler
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
def get_default_handler(log_level: int) -> logging.Handler:
|
|
65
|
-
handler = logging.StreamHandler()
|
|
66
|
-
handler.setLevel(log_level)
|
|
67
|
-
formatter = logging.Formatter(fmt="[%(name)s] %(message)s")
|
|
68
|
-
if log_format_from_env() == "json":
|
|
69
|
-
pass
|
|
70
|
-
# formatter = jsonlogger.JsonFormatter(fmt="%(asctime)s %(name)s %(levelname)s %(message)s")
|
|
71
|
-
handler.setFormatter(formatter)
|
|
72
|
-
return handler
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
def initialize_logger(log_level: int = DEFAULT_LOG_LEVEL, enable_rich: bool = False):
|
|
76
|
-
"""
|
|
77
|
-
Initializes the global loggers to the default configuration.
|
|
78
|
-
"""
|
|
79
|
-
global logger # noqa: PLW0603
|
|
80
|
-
logger = _create_logger("union", log_level, enable_rich)
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
def _create_logger(name: str, log_level: int = DEFAULT_LOG_LEVEL, enable_rich: bool = False) -> logging.Logger:
|
|
84
|
-
"""
|
|
85
|
-
Creates a logger with the given name and log level.
|
|
86
|
-
"""
|
|
87
|
-
logger = logging.getLogger(name)
|
|
88
|
-
logger.setLevel(log_level)
|
|
89
|
-
handler = None
|
|
90
|
-
logger.handlers = []
|
|
91
|
-
if enable_rich:
|
|
92
|
-
handler = get_rich_handler(log_level)
|
|
93
|
-
if handler is None:
|
|
94
|
-
handler = get_default_handler(log_level)
|
|
95
|
-
logger.addHandler(handler)
|
|
96
|
-
return logger
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
def log(fn=None, *, level=logging.DEBUG, entry=True, exit=True):
|
|
100
|
-
"""
|
|
101
|
-
Decorator to log function calls.
|
|
102
|
-
"""
|
|
103
|
-
|
|
104
|
-
def decorator(func):
|
|
105
|
-
if logger.isEnabledFor(level):
|
|
106
|
-
|
|
107
|
-
def wrapper(*args, **kwargs):
|
|
108
|
-
if entry:
|
|
109
|
-
logger.log(level, f"[{func.__name__}] with args: {args} and kwargs: {kwargs}")
|
|
110
|
-
try:
|
|
111
|
-
return func(*args, **kwargs)
|
|
112
|
-
finally:
|
|
113
|
-
if exit:
|
|
114
|
-
logger.log(level, f"[{func.__name__}] completed")
|
|
115
|
-
|
|
116
|
-
return wrapper
|
|
117
|
-
return func
|
|
118
|
-
|
|
119
|
-
if fn is None:
|
|
120
|
-
return decorator
|
|
121
|
-
return decorator(fn)
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
logger = _create_logger("union", get_env_log_level())
|
union/_protos/__init__.py
DELETED
|
File without changes
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
-
# source: common/authorization.proto
|
|
4
|
-
"""Generated protocol buffer code."""
|
|
5
|
-
from google.protobuf import descriptor as _descriptor
|
|
6
|
-
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
7
|
-
from google.protobuf import symbol_database as _symbol_database
|
|
8
|
-
from google.protobuf.internal import builder as _builder
|
|
9
|
-
# @@protoc_insertion_point(imports)
|
|
10
|
-
|
|
11
|
-
_sym_db = _symbol_database.Default()
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
from union._protos.common import identifier_pb2 as common_dot_identifier__pb2
|
|
15
|
-
from union._protos.validate.validate import validate_pb2 as validate_dot_validate__pb2
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1a\x63ommon/authorization.proto\x12\x0f\x63loudidl.common\x1a\x17\x63ommon/identifier.proto\x1a\x17validate/validate.proto\"+\n\x0cOrganization\x12\x1b\n\x04name\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x04name\"i\n\x06\x44omain\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12K\n\x0corganization\x18\x02 \x01(\x0b\x32\x1d.cloudidl.common.OrganizationB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x0corganization\"a\n\x07Project\x12\x1b\n\x04name\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x04name\x12\x39\n\x06\x64omain\x18\x02 \x01(\x0b\x32\x17.cloudidl.common.DomainB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x06\x64omain\"e\n\x08Workflow\x12\x1b\n\x04name\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x04name\x12<\n\x07project\x18\x02 \x01(\x0b\x32\x18.cloudidl.common.ProjectB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x07project\"g\n\nLaunchPlan\x12\x1b\n\x04name\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x04name\x12<\n\x07project\x18\x02 \x01(\x0b\x32\x18.cloudidl.common.ProjectB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x07project\"\xfd\x02\n\x08Resource\x12\x43\n\x0corganization\x18\x01 \x01(\x0b\x32\x1d.cloudidl.common.OrganizationH\x00R\x0corganization\x12\x31\n\x06\x64omain\x18\x02 \x01(\x0b\x32\x17.cloudidl.common.DomainH\x00R\x06\x64omain\x12\x34\n\x07project\x18\x03 \x01(\x0b\x32\x18.cloudidl.common.ProjectH\x00R\x07project\x12\x37\n\x08workflow\x18\x04 \x01(\x0b\x32\x19.cloudidl.common.WorkflowH\x00R\x08workflow\x12>\n\x0blaunch_plan\x18\x05 \x01(\x0b\x32\x1b.cloudidl.common.LaunchPlanH\x00R\nlaunchPlan\x12>\n\x07\x63luster\x18\x06 \x01(\x0b\x32\".cloudidl.common.ClusterIdentifierH\x00R\x07\x63lusterB\n\n\x08resource\"v\n\nPermission\x12\x35\n\x08resource\x18\x01 \x01(\x0b\x32\x19.cloudidl.common.ResourceR\x08resource\x12\x31\n\x07\x61\x63tions\x18\x02 \x03(\x0e\x32\x17.cloudidl.common.ActionR\x07\x61\x63tions*\xf4\x03\n\x06\x41\x63tion\x12\x0f\n\x0b\x41\x43TION_NONE\x10\x00\x12\x15\n\rACTION_CREATE\x10\x01\x1a\x02\x08\x01\x12\x13\n\x0b\x41\x43TION_READ\x10\x02\x1a\x02\x08\x01\x12\x15\n\rACTION_UPDATE\x10\x03\x1a\x02\x08\x01\x12\x15\n\rACTION_DELETE\x10\x04\x1a\x02\x08\x01\x12\x1f\n\x1b\x41\x43TION_VIEW_FLYTE_INVENTORY\x10\x05\x12 \n\x1c\x41\x43TION_VIEW_FLYTE_EXECUTIONS\x10\x06\x12#\n\x1f\x41\x43TION_REGISTER_FLYTE_INVENTORY\x10\x07\x12\"\n\x1e\x41\x43TION_CREATE_FLYTE_EXECUTIONS\x10\x08\x12\x1d\n\x19\x41\x43TION_ADMINISTER_PROJECT\x10\t\x12\x1d\n\x19\x41\x43TION_MANAGE_PERMISSIONS\x10\n\x12\x1d\n\x19\x41\x43TION_ADMINISTER_ACCOUNT\x10\x0b\x12\x19\n\x15\x41\x43TION_MANAGE_CLUSTER\x10\x0c\x12,\n(ACTION_EDIT_EXECUTION_RELATED_ATTRIBUTES\x10\r\x12*\n&ACTION_EDIT_CLUSTER_RELATED_ATTRIBUTES\x10\x0e\x12!\n\x1d\x41\x43TION_EDIT_UNUSED_ATTRIBUTES\x10\x0f\x42\xb3\x01\n\x13\x63om.cloudidl.commonB\x12\x41uthorizationProtoH\x02P\x01Z)github.com/unionai/cloud/gen/pb-go/common\xa2\x02\x03\x43\x43X\xaa\x02\x0f\x43loudidl.Common\xca\x02\x0f\x43loudidl\\Common\xe2\x02\x1b\x43loudidl\\Common\\GPBMetadata\xea\x02\x10\x43loudidl::Commonb\x06proto3')
|
|
19
|
-
|
|
20
|
-
_globals = globals()
|
|
21
|
-
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
22
|
-
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'common.authorization_pb2', _globals)
|
|
23
|
-
if _descriptor._USE_C_DESCRIPTORS == False:
|
|
24
|
-
DESCRIPTOR._options = None
|
|
25
|
-
DESCRIPTOR._serialized_options = b'\n\023com.cloudidl.commonB\022AuthorizationProtoH\002P\001Z)github.com/unionai/cloud/gen/pb-go/common\242\002\003CCX\252\002\017Cloudidl.Common\312\002\017Cloudidl\\Common\342\002\033Cloudidl\\Common\\GPBMetadata\352\002\020Cloudidl::Common'
|
|
26
|
-
_ACTION.values_by_name["ACTION_CREATE"]._options = None
|
|
27
|
-
_ACTION.values_by_name["ACTION_CREATE"]._serialized_options = b'\010\001'
|
|
28
|
-
_ACTION.values_by_name["ACTION_READ"]._options = None
|
|
29
|
-
_ACTION.values_by_name["ACTION_READ"]._serialized_options = b'\010\001'
|
|
30
|
-
_ACTION.values_by_name["ACTION_UPDATE"]._options = None
|
|
31
|
-
_ACTION.values_by_name["ACTION_UPDATE"]._serialized_options = b'\010\001'
|
|
32
|
-
_ACTION.values_by_name["ACTION_DELETE"]._options = None
|
|
33
|
-
_ACTION.values_by_name["ACTION_DELETE"]._serialized_options = b'\010\001'
|
|
34
|
-
_ORGANIZATION.fields_by_name['name']._options = None
|
|
35
|
-
_ORGANIZATION.fields_by_name['name']._serialized_options = b'\372B\004r\002\020\001'
|
|
36
|
-
_DOMAIN.fields_by_name['organization']._options = None
|
|
37
|
-
_DOMAIN.fields_by_name['organization']._serialized_options = b'\372B\005\212\001\002\020\001'
|
|
38
|
-
_PROJECT.fields_by_name['name']._options = None
|
|
39
|
-
_PROJECT.fields_by_name['name']._serialized_options = b'\372B\004r\002\020\001'
|
|
40
|
-
_PROJECT.fields_by_name['domain']._options = None
|
|
41
|
-
_PROJECT.fields_by_name['domain']._serialized_options = b'\372B\005\212\001\002\020\001'
|
|
42
|
-
_WORKFLOW.fields_by_name['name']._options = None
|
|
43
|
-
_WORKFLOW.fields_by_name['name']._serialized_options = b'\372B\004r\002\020\001'
|
|
44
|
-
_WORKFLOW.fields_by_name['project']._options = None
|
|
45
|
-
_WORKFLOW.fields_by_name['project']._serialized_options = b'\372B\005\212\001\002\020\001'
|
|
46
|
-
_LAUNCHPLAN.fields_by_name['name']._options = None
|
|
47
|
-
_LAUNCHPLAN.fields_by_name['name']._serialized_options = b'\372B\004r\002\020\001'
|
|
48
|
-
_LAUNCHPLAN.fields_by_name['project']._options = None
|
|
49
|
-
_LAUNCHPLAN.fields_by_name['project']._serialized_options = b'\372B\005\212\001\002\020\001'
|
|
50
|
-
_globals['_ACTION']._serialized_start=1061
|
|
51
|
-
_globals['_ACTION']._serialized_end=1561
|
|
52
|
-
_globals['_ORGANIZATION']._serialized_start=97
|
|
53
|
-
_globals['_ORGANIZATION']._serialized_end=140
|
|
54
|
-
_globals['_DOMAIN']._serialized_start=142
|
|
55
|
-
_globals['_DOMAIN']._serialized_end=247
|
|
56
|
-
_globals['_PROJECT']._serialized_start=249
|
|
57
|
-
_globals['_PROJECT']._serialized_end=346
|
|
58
|
-
_globals['_WORKFLOW']._serialized_start=348
|
|
59
|
-
_globals['_WORKFLOW']._serialized_end=449
|
|
60
|
-
_globals['_LAUNCHPLAN']._serialized_start=451
|
|
61
|
-
_globals['_LAUNCHPLAN']._serialized_end=554
|
|
62
|
-
_globals['_RESOURCE']._serialized_start=557
|
|
63
|
-
_globals['_RESOURCE']._serialized_end=938
|
|
64
|
-
_globals['_PERMISSION']._serialized_start=940
|
|
65
|
-
_globals['_PERMISSION']._serialized_end=1058
|
|
66
|
-
# @@protoc_insertion_point(module_scope)
|