flyte 0.2.0b1__py3-none-any.whl → 2.0.0b46__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.
- flyte/__init__.py +83 -30
- flyte/_bin/connect.py +61 -0
- flyte/_bin/debug.py +38 -0
- flyte/_bin/runtime.py +87 -19
- flyte/_bin/serve.py +351 -0
- flyte/_build.py +3 -2
- flyte/_cache/cache.py +6 -5
- flyte/_cache/local_cache.py +216 -0
- flyte/_code_bundle/_ignore.py +31 -5
- flyte/_code_bundle/_packaging.py +42 -11
- flyte/_code_bundle/_utils.py +57 -34
- flyte/_code_bundle/bundle.py +130 -27
- flyte/_constants.py +1 -0
- flyte/_context.py +21 -5
- flyte/_custom_context.py +73 -0
- flyte/_debug/constants.py +37 -0
- flyte/_debug/utils.py +17 -0
- flyte/_debug/vscode.py +315 -0
- flyte/_deploy.py +396 -75
- flyte/_deployer.py +109 -0
- flyte/_environment.py +94 -11
- flyte/_excepthook.py +37 -0
- flyte/_group.py +2 -1
- flyte/_hash.py +1 -16
- flyte/_image.py +544 -231
- flyte/_initialize.py +456 -316
- flyte/_interface.py +40 -5
- flyte/_internal/controllers/__init__.py +22 -8
- flyte/_internal/controllers/_local_controller.py +159 -35
- flyte/_internal/controllers/_trace.py +18 -10
- flyte/_internal/controllers/remote/__init__.py +38 -9
- flyte/_internal/controllers/remote/_action.py +82 -12
- flyte/_internal/controllers/remote/_client.py +6 -2
- flyte/_internal/controllers/remote/_controller.py +290 -64
- flyte/_internal/controllers/remote/_core.py +155 -95
- flyte/_internal/controllers/remote/_informer.py +40 -20
- flyte/_internal/controllers/remote/_service_protocol.py +2 -2
- flyte/_internal/imagebuild/__init__.py +2 -10
- flyte/_internal/imagebuild/docker_builder.py +391 -84
- flyte/_internal/imagebuild/image_builder.py +111 -55
- flyte/_internal/imagebuild/remote_builder.py +409 -0
- flyte/_internal/imagebuild/utils.py +79 -0
- flyte/_internal/resolvers/_app_env_module.py +92 -0
- flyte/_internal/resolvers/_task_module.py +5 -38
- flyte/_internal/resolvers/app_env.py +26 -0
- flyte/_internal/resolvers/common.py +8 -1
- flyte/_internal/resolvers/default.py +2 -2
- flyte/_internal/runtime/convert.py +319 -36
- flyte/_internal/runtime/entrypoints.py +106 -18
- flyte/_internal/runtime/io.py +71 -23
- flyte/_internal/runtime/resources_serde.py +21 -7
- flyte/_internal/runtime/reuse.py +125 -0
- flyte/_internal/runtime/rusty.py +196 -0
- flyte/_internal/runtime/task_serde.py +239 -66
- flyte/_internal/runtime/taskrunner.py +48 -8
- flyte/_internal/runtime/trigger_serde.py +162 -0
- flyte/_internal/runtime/types_serde.py +7 -16
- flyte/_keyring/file.py +115 -0
- flyte/_link.py +30 -0
- flyte/_logging.py +241 -42
- flyte/_map.py +312 -0
- flyte/_metrics.py +59 -0
- flyte/_module.py +74 -0
- flyte/_pod.py +30 -0
- flyte/_resources.py +296 -33
- flyte/_retry.py +1 -7
- flyte/_reusable_environment.py +72 -7
- flyte/_run.py +462 -132
- flyte/_secret.py +47 -11
- flyte/_serve.py +333 -0
- flyte/_task.py +245 -56
- flyte/_task_environment.py +219 -97
- flyte/_task_plugins.py +47 -0
- flyte/_tools.py +8 -8
- flyte/_trace.py +15 -24
- flyte/_trigger.py +1027 -0
- flyte/_utils/__init__.py +12 -1
- flyte/_utils/asyn.py +3 -1
- flyte/_utils/async_cache.py +139 -0
- flyte/_utils/coro_management.py +5 -4
- flyte/_utils/description_parser.py +19 -0
- flyte/_utils/docker_credentials.py +173 -0
- flyte/_utils/helpers.py +45 -19
- flyte/_utils/module_loader.py +123 -0
- flyte/_utils/org_discovery.py +57 -0
- flyte/_utils/uv_script_parser.py +8 -1
- flyte/_version.py +16 -3
- flyte/app/__init__.py +27 -0
- flyte/app/_app_environment.py +362 -0
- flyte/app/_connector_environment.py +40 -0
- flyte/app/_deploy.py +130 -0
- flyte/app/_parameter.py +343 -0
- flyte/app/_runtime/__init__.py +3 -0
- flyte/app/_runtime/app_serde.py +383 -0
- flyte/app/_types.py +113 -0
- flyte/app/extras/__init__.py +9 -0
- flyte/app/extras/_auth_middleware.py +217 -0
- flyte/app/extras/_fastapi.py +93 -0
- flyte/app/extras/_model_loader/__init__.py +3 -0
- flyte/app/extras/_model_loader/config.py +7 -0
- flyte/app/extras/_model_loader/loader.py +288 -0
- flyte/cli/__init__.py +12 -0
- flyte/cli/_abort.py +28 -0
- flyte/cli/_build.py +114 -0
- flyte/cli/_common.py +493 -0
- flyte/cli/_create.py +371 -0
- flyte/cli/_delete.py +45 -0
- flyte/cli/_deploy.py +401 -0
- flyte/cli/_gen.py +316 -0
- flyte/cli/_get.py +446 -0
- flyte/cli/_option.py +33 -0
- flyte/{_cli → cli}/_params.py +57 -17
- flyte/cli/_plugins.py +209 -0
- flyte/cli/_prefetch.py +292 -0
- flyte/cli/_run.py +690 -0
- flyte/cli/_serve.py +338 -0
- flyte/cli/_update.py +86 -0
- flyte/cli/_user.py +20 -0
- flyte/cli/main.py +246 -0
- flyte/config/__init__.py +2 -167
- flyte/config/_config.py +215 -163
- flyte/config/_internal.py +10 -1
- flyte/config/_reader.py +225 -0
- flyte/connectors/__init__.py +11 -0
- flyte/connectors/_connector.py +330 -0
- flyte/connectors/_server.py +194 -0
- flyte/connectors/utils.py +159 -0
- flyte/errors.py +134 -2
- flyte/extend.py +24 -0
- flyte/extras/_container.py +69 -56
- flyte/git/__init__.py +3 -0
- flyte/git/_config.py +279 -0
- flyte/io/__init__.py +8 -1
- flyte/io/{structured_dataset → _dataframe}/__init__.py +32 -30
- flyte/io/{structured_dataset → _dataframe}/basic_dfs.py +75 -68
- flyte/io/{structured_dataset/structured_dataset.py → _dataframe/dataframe.py} +207 -242
- flyte/io/_dir.py +575 -113
- flyte/io/_file.py +587 -141
- flyte/io/_hashing_io.py +342 -0
- flyte/io/extend.py +7 -0
- flyte/models.py +635 -0
- flyte/prefetch/__init__.py +22 -0
- flyte/prefetch/_hf_model.py +563 -0
- flyte/remote/__init__.py +14 -3
- flyte/remote/_action.py +879 -0
- flyte/remote/_app.py +346 -0
- flyte/remote/_auth_metadata.py +42 -0
- flyte/remote/_client/_protocols.py +62 -4
- flyte/remote/_client/auth/_auth_utils.py +19 -0
- flyte/remote/_client/auth/_authenticators/base.py +8 -2
- flyte/remote/_client/auth/_authenticators/device_code.py +4 -5
- flyte/remote/_client/auth/_authenticators/factory.py +4 -0
- flyte/remote/_client/auth/_authenticators/passthrough.py +79 -0
- flyte/remote/_client/auth/_authenticators/pkce.py +17 -18
- flyte/remote/_client/auth/_channel.py +47 -18
- flyte/remote/_client/auth/_client_config.py +5 -3
- flyte/remote/_client/auth/_keyring.py +15 -2
- flyte/remote/_client/auth/_token_client.py +3 -3
- flyte/remote/_client/controlplane.py +206 -18
- flyte/remote/_common.py +66 -0
- flyte/remote/_data.py +107 -22
- flyte/remote/_logs.py +116 -33
- flyte/remote/_project.py +21 -19
- flyte/remote/_run.py +164 -631
- flyte/remote/_secret.py +72 -29
- flyte/remote/_task.py +387 -46
- flyte/remote/_trigger.py +368 -0
- flyte/remote/_user.py +43 -0
- flyte/report/_report.py +10 -6
- flyte/storage/__init__.py +13 -1
- flyte/storage/_config.py +237 -0
- flyte/storage/_parallel_reader.py +289 -0
- flyte/storage/_storage.py +268 -59
- flyte/syncify/__init__.py +56 -0
- flyte/syncify/_api.py +414 -0
- flyte/types/__init__.py +39 -0
- flyte/types/_interface.py +22 -7
- flyte/{io/pickle/transformer.py → types/_pickle.py} +37 -9
- flyte/types/_string_literals.py +8 -9
- flyte/types/_type_engine.py +226 -126
- flyte/types/_utils.py +1 -1
- flyte-2.0.0b46.data/scripts/debug.py +38 -0
- flyte-2.0.0b46.data/scripts/runtime.py +194 -0
- flyte-2.0.0b46.dist-info/METADATA +352 -0
- flyte-2.0.0b46.dist-info/RECORD +221 -0
- flyte-2.0.0b46.dist-info/entry_points.txt +8 -0
- flyte-2.0.0b46.dist-info/licenses/LICENSE +201 -0
- flyte/_api_commons.py +0 -3
- flyte/_cli/_common.py +0 -299
- flyte/_cli/_create.py +0 -42
- flyte/_cli/_delete.py +0 -23
- flyte/_cli/_deploy.py +0 -140
- flyte/_cli/_get.py +0 -235
- flyte/_cli/_run.py +0 -174
- flyte/_cli/main.py +0 -98
- flyte/_datastructures.py +0 -342
- flyte/_internal/controllers/pbhash.py +0 -39
- flyte/_protos/common/authorization_pb2.py +0 -66
- flyte/_protos/common/authorization_pb2.pyi +0 -108
- flyte/_protos/common/authorization_pb2_grpc.py +0 -4
- flyte/_protos/common/identifier_pb2.py +0 -71
- flyte/_protos/common/identifier_pb2.pyi +0 -82
- flyte/_protos/common/identifier_pb2_grpc.py +0 -4
- flyte/_protos/common/identity_pb2.py +0 -48
- flyte/_protos/common/identity_pb2.pyi +0 -72
- flyte/_protos/common/identity_pb2_grpc.py +0 -4
- flyte/_protos/common/list_pb2.py +0 -36
- flyte/_protos/common/list_pb2.pyi +0 -69
- flyte/_protos/common/list_pb2_grpc.py +0 -4
- flyte/_protos/common/policy_pb2.py +0 -37
- flyte/_protos/common/policy_pb2.pyi +0 -27
- flyte/_protos/common/policy_pb2_grpc.py +0 -4
- flyte/_protos/common/role_pb2.py +0 -37
- flyte/_protos/common/role_pb2.pyi +0 -53
- flyte/_protos/common/role_pb2_grpc.py +0 -4
- flyte/_protos/common/runtime_version_pb2.py +0 -28
- flyte/_protos/common/runtime_version_pb2.pyi +0 -24
- flyte/_protos/common/runtime_version_pb2_grpc.py +0 -4
- flyte/_protos/logs/dataplane/payload_pb2.py +0 -96
- flyte/_protos/logs/dataplane/payload_pb2.pyi +0 -168
- flyte/_protos/logs/dataplane/payload_pb2_grpc.py +0 -4
- flyte/_protos/secret/definition_pb2.py +0 -49
- flyte/_protos/secret/definition_pb2.pyi +0 -93
- flyte/_protos/secret/definition_pb2_grpc.py +0 -4
- flyte/_protos/secret/payload_pb2.py +0 -62
- flyte/_protos/secret/payload_pb2.pyi +0 -94
- flyte/_protos/secret/payload_pb2_grpc.py +0 -4
- flyte/_protos/secret/secret_pb2.py +0 -38
- flyte/_protos/secret/secret_pb2.pyi +0 -6
- flyte/_protos/secret/secret_pb2_grpc.py +0 -198
- flyte/_protos/secret/secret_pb2_grpc_grpc.py +0 -198
- flyte/_protos/validate/validate/validate_pb2.py +0 -76
- flyte/_protos/workflow/node_execution_service_pb2.py +0 -26
- flyte/_protos/workflow/node_execution_service_pb2.pyi +0 -4
- flyte/_protos/workflow/node_execution_service_pb2_grpc.py +0 -32
- flyte/_protos/workflow/queue_service_pb2.py +0 -106
- flyte/_protos/workflow/queue_service_pb2.pyi +0 -141
- flyte/_protos/workflow/queue_service_pb2_grpc.py +0 -172
- flyte/_protos/workflow/run_definition_pb2.py +0 -128
- flyte/_protos/workflow/run_definition_pb2.pyi +0 -310
- flyte/_protos/workflow/run_definition_pb2_grpc.py +0 -4
- flyte/_protos/workflow/run_logs_service_pb2.py +0 -41
- flyte/_protos/workflow/run_logs_service_pb2.pyi +0 -28
- flyte/_protos/workflow/run_logs_service_pb2_grpc.py +0 -69
- flyte/_protos/workflow/run_service_pb2.py +0 -133
- flyte/_protos/workflow/run_service_pb2.pyi +0 -175
- flyte/_protos/workflow/run_service_pb2_grpc.py +0 -412
- flyte/_protos/workflow/state_service_pb2.py +0 -58
- flyte/_protos/workflow/state_service_pb2.pyi +0 -71
- flyte/_protos/workflow/state_service_pb2_grpc.py +0 -138
- flyte/_protos/workflow/task_definition_pb2.py +0 -72
- flyte/_protos/workflow/task_definition_pb2.pyi +0 -65
- flyte/_protos/workflow/task_definition_pb2_grpc.py +0 -4
- flyte/_protos/workflow/task_service_pb2.py +0 -44
- flyte/_protos/workflow/task_service_pb2.pyi +0 -31
- flyte/_protos/workflow/task_service_pb2_grpc.py +0 -104
- flyte/io/_dataframe.py +0 -0
- flyte/io/pickle/__init__.py +0 -0
- flyte/remote/_console.py +0 -18
- flyte-0.2.0b1.dist-info/METADATA +0 -179
- flyte-0.2.0b1.dist-info/RECORD +0 -204
- flyte-0.2.0b1.dist-info/entry_points.txt +0 -3
- /flyte/{_cli → _debug}/__init__.py +0 -0
- /flyte/{_protos → _keyring}/__init__.py +0 -0
- {flyte-0.2.0b1.dist-info → flyte-2.0.0b46.dist-info}/WHEEL +0 -0
- {flyte-0.2.0b1.dist-info → flyte-2.0.0b46.dist-info}/top_level.txt +0 -0
flyte/_datastructures.py
DELETED
|
@@ -1,342 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import inspect
|
|
4
|
-
import os
|
|
5
|
-
import pathlib
|
|
6
|
-
import tempfile
|
|
7
|
-
from dataclasses import dataclass, field, replace
|
|
8
|
-
from typing import TYPE_CHECKING, Any, Callable, Dict, Optional, Tuple, Type
|
|
9
|
-
|
|
10
|
-
from flyte._docstring import Docstring
|
|
11
|
-
from flyte._interface import extract_return_annotation
|
|
12
|
-
from flyte._logging import logger
|
|
13
|
-
from flyte._utils.helpers import base36_encode
|
|
14
|
-
|
|
15
|
-
if TYPE_CHECKING:
|
|
16
|
-
from flyte._internal.imagebuild.image_builder import ImageCache
|
|
17
|
-
from flyte.report import Report
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def generate_random_name() -> str:
|
|
21
|
-
"""
|
|
22
|
-
Generate a random name for the task. This is used to create unique names for tasks.
|
|
23
|
-
TODO we can use unique-namer in the future, for now its just guids
|
|
24
|
-
"""
|
|
25
|
-
from uuid import uuid4
|
|
26
|
-
|
|
27
|
-
return str(uuid4()) # Placeholder for actual random name generation logic
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
@dataclass(frozen=True, kw_only=True)
|
|
31
|
-
class ActionID:
|
|
32
|
-
"""
|
|
33
|
-
A class representing the ID of an Action, nested within a Run. This is used to identify a specific action on a task.
|
|
34
|
-
"""
|
|
35
|
-
|
|
36
|
-
name: str
|
|
37
|
-
run_name: str | None = None
|
|
38
|
-
project: str | None = None
|
|
39
|
-
domain: str | None = None
|
|
40
|
-
org: str | None = None
|
|
41
|
-
|
|
42
|
-
def __post_init__(self):
|
|
43
|
-
if self.run_name is None:
|
|
44
|
-
object.__setattr__(self, "run_name", self.name)
|
|
45
|
-
|
|
46
|
-
@classmethod
|
|
47
|
-
def create_random(cls):
|
|
48
|
-
name = generate_random_name()
|
|
49
|
-
return cls(name=name, run_name=name)
|
|
50
|
-
|
|
51
|
-
def new_sub_action(self, name: str | None = None) -> ActionID:
|
|
52
|
-
"""
|
|
53
|
-
Create a new sub-run with the given name. If name is None, a random name will be generated.
|
|
54
|
-
"""
|
|
55
|
-
if name is None:
|
|
56
|
-
name = generate_random_name()
|
|
57
|
-
return replace(self, name=name)
|
|
58
|
-
|
|
59
|
-
def new_sub_action_from(self, task_name: str, input_hash: str, group: str | None) -> ActionID:
|
|
60
|
-
"""Make a deterministic name"""
|
|
61
|
-
import hashlib
|
|
62
|
-
|
|
63
|
-
components = f"{self.run_name}-{self.name}-{input_hash}-{task_name}" + (f"-{group}" if group else "")
|
|
64
|
-
# has the components into something deterministic
|
|
65
|
-
bytes_digest = hashlib.md5(components.encode()).digest()
|
|
66
|
-
new_name = base36_encode(bytes_digest)
|
|
67
|
-
return self.new_sub_action(new_name)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
@dataclass(frozen=True, kw_only=True)
|
|
71
|
-
class RawDataPath:
|
|
72
|
-
"""
|
|
73
|
-
A class representing the raw data path for a task. This is used to store the raw data for the task execution and
|
|
74
|
-
also get mutations on the path.
|
|
75
|
-
"""
|
|
76
|
-
|
|
77
|
-
path: str
|
|
78
|
-
|
|
79
|
-
@classmethod
|
|
80
|
-
def from_local_folder(cls, local_folder: str | pathlib.Path | None = None) -> RawDataPath:
|
|
81
|
-
"""
|
|
82
|
-
Create a new context attribute object, with local path given. Will be created if it doesn't exist.
|
|
83
|
-
:return: Path to the temporary directory
|
|
84
|
-
"""
|
|
85
|
-
match local_folder:
|
|
86
|
-
case pathlib.Path():
|
|
87
|
-
local_folder.mkdir(parents=True, exist_ok=True)
|
|
88
|
-
return RawDataPath(path=str(local_folder))
|
|
89
|
-
case None:
|
|
90
|
-
# Create a temporary directory for data storage
|
|
91
|
-
p = tempfile.mkdtemp()
|
|
92
|
-
logger.debug(f"Creating temporary directory for data storage: {p}")
|
|
93
|
-
return RawDataPath(path=p)
|
|
94
|
-
case str():
|
|
95
|
-
return RawDataPath(path=local_folder)
|
|
96
|
-
case _:
|
|
97
|
-
raise ValueError(f"Invalid local path {local_folder}")
|
|
98
|
-
|
|
99
|
-
def get_random_remote_path(self, file_name: Optional[str] = None) -> str:
|
|
100
|
-
"""
|
|
101
|
-
Returns a random path for uploading a file/directory to.
|
|
102
|
-
|
|
103
|
-
:param file_name: If given, will be joined after a randomly generated portion.
|
|
104
|
-
:return:
|
|
105
|
-
"""
|
|
106
|
-
import random
|
|
107
|
-
from uuid import UUID
|
|
108
|
-
|
|
109
|
-
import fsspec
|
|
110
|
-
from fsspec.utils import get_protocol
|
|
111
|
-
|
|
112
|
-
random_string = UUID(int=random.getrandbits(128)).hex
|
|
113
|
-
file_prefix = self.path
|
|
114
|
-
|
|
115
|
-
protocol = get_protocol(file_prefix)
|
|
116
|
-
if "file" in protocol:
|
|
117
|
-
local_path = pathlib.Path(file_prefix) / random_string
|
|
118
|
-
if file_name:
|
|
119
|
-
# Only if file name is given do we create the parent, because it may be needed as a folder otherwise
|
|
120
|
-
local_path = local_path / file_name
|
|
121
|
-
if not local_path.exists():
|
|
122
|
-
local_path.parent.mkdir(exist_ok=True, parents=True)
|
|
123
|
-
local_path.touch()
|
|
124
|
-
return str(local_path.absolute())
|
|
125
|
-
|
|
126
|
-
fs = fsspec.filesystem(protocol)
|
|
127
|
-
if file_prefix.endswith(fs.sep):
|
|
128
|
-
file_prefix = file_prefix[:-1]
|
|
129
|
-
remote_path = fs.sep.join([file_prefix, random_string])
|
|
130
|
-
if file_name:
|
|
131
|
-
remote_path = fs.sep.join([remote_path, file_name])
|
|
132
|
-
return remote_path
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
@dataclass(frozen=True)
|
|
136
|
-
class GroupData:
|
|
137
|
-
name: str
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
@dataclass(frozen=True, kw_only=True)
|
|
141
|
-
class TaskContext:
|
|
142
|
-
"""
|
|
143
|
-
A context class to hold the current task executions context.
|
|
144
|
-
This can be used to access various contextual parameters in the task execution by the user.
|
|
145
|
-
|
|
146
|
-
:param action: The action ID of the current execution. This is always set, within a run.
|
|
147
|
-
:param version: The version of the executed task. This is set when the task is executed by an action and will be
|
|
148
|
-
set on all sub-actions.
|
|
149
|
-
"""
|
|
150
|
-
|
|
151
|
-
action: ActionID
|
|
152
|
-
version: str
|
|
153
|
-
raw_data_path: RawDataPath
|
|
154
|
-
output_path: str
|
|
155
|
-
run_base_dir: str
|
|
156
|
-
report: Report
|
|
157
|
-
group_data: GroupData | None = None
|
|
158
|
-
checkpoints: Checkpoints | None = None
|
|
159
|
-
code_bundle: CodeBundle | None = None
|
|
160
|
-
compiled_image_cache: ImageCache | None = None
|
|
161
|
-
data: Dict[str, Any] = field(default_factory=dict)
|
|
162
|
-
|
|
163
|
-
def replace(self, **kwargs) -> TaskContext:
|
|
164
|
-
if "data" in kwargs:
|
|
165
|
-
rec_data = kwargs.pop("data")
|
|
166
|
-
if rec_data is None:
|
|
167
|
-
return replace(self, **kwargs)
|
|
168
|
-
data = {}
|
|
169
|
-
if self.data is not None:
|
|
170
|
-
data = self.data.copy()
|
|
171
|
-
data.update(rec_data)
|
|
172
|
-
kwargs.update({"data": data})
|
|
173
|
-
return replace(self, **kwargs)
|
|
174
|
-
|
|
175
|
-
def __getitem__(self, key: str) -> Optional[Any]:
|
|
176
|
-
return self.data.get(key)
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
@dataclass(frozen=True, kw_only=True)
|
|
180
|
-
class CodeBundle:
|
|
181
|
-
"""
|
|
182
|
-
A class representing a code bundle for a task. This is used to package the code and the inflation path.
|
|
183
|
-
The code bundle computes the version of the code using the hash of the code.
|
|
184
|
-
|
|
185
|
-
:param computed_version: The version of the code bundle. This is the hash of the code.
|
|
186
|
-
:param destination: The destination path for the code bundle to be inflated to.
|
|
187
|
-
:param tgz: Optional path to the tgz file.
|
|
188
|
-
:param pkl: Optional path to the pkl file.
|
|
189
|
-
:param downloaded_path: The path to the downloaded code bundle. This is only available during runtime, when
|
|
190
|
-
the code bundle has been downloaded and inflated.
|
|
191
|
-
"""
|
|
192
|
-
|
|
193
|
-
computed_version: str
|
|
194
|
-
destination: str = "."
|
|
195
|
-
tgz: str | None = None
|
|
196
|
-
pkl: str | None = None
|
|
197
|
-
downloaded_path: pathlib.Path | None = None
|
|
198
|
-
|
|
199
|
-
# runtime_dependencies: Tuple[str, ...] = field(default_factory=tuple) In the future if we want we could add this
|
|
200
|
-
# but this messes up actors, spark etc
|
|
201
|
-
|
|
202
|
-
def __post_init__(self):
|
|
203
|
-
if self.tgz is None and self.pkl is None:
|
|
204
|
-
raise ValueError("Either tgz or pkl must be provided")
|
|
205
|
-
|
|
206
|
-
def with_downloaded_path(self, path: pathlib.Path) -> CodeBundle:
|
|
207
|
-
"""
|
|
208
|
-
Create a new CodeBundle with the given downloaded path.
|
|
209
|
-
"""
|
|
210
|
-
return replace(self, downloaded_path=path)
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
@dataclass(frozen=True)
|
|
214
|
-
class Checkpoints:
|
|
215
|
-
"""
|
|
216
|
-
A class representing the checkpoints for a task. This is used to store the checkpoints for the task execution.
|
|
217
|
-
"""
|
|
218
|
-
|
|
219
|
-
prev_checkpoint_path: str | None
|
|
220
|
-
checkpoint_path: str | None
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
@dataclass(frozen=True)
|
|
224
|
-
class NativeInterface:
|
|
225
|
-
"""
|
|
226
|
-
A class representing the native interface for a task. This is used to interact with the task and its execution
|
|
227
|
-
context.
|
|
228
|
-
"""
|
|
229
|
-
|
|
230
|
-
inputs: Dict[str, Tuple[Type, Any]]
|
|
231
|
-
outputs: Dict[str, Type]
|
|
232
|
-
docstring: Optional[Docstring] = field(default=None)
|
|
233
|
-
|
|
234
|
-
def has_outputs(self) -> bool:
|
|
235
|
-
"""
|
|
236
|
-
Check if the task has outputs. This is used to determine if the task has outputs or not.
|
|
237
|
-
"""
|
|
238
|
-
return self.outputs is not None and len(self.outputs) > 0
|
|
239
|
-
|
|
240
|
-
@classmethod
|
|
241
|
-
def from_types(cls, inputs: Dict[str, Type], outputs: Dict[str, Type]) -> NativeInterface:
|
|
242
|
-
"""
|
|
243
|
-
Create a new NativeInterface from the given types. This is used to create a native interface for the task.
|
|
244
|
-
"""
|
|
245
|
-
return cls(inputs={k: (v, inspect.Parameter.empty) for k, v in inputs.items()}, outputs=outputs)
|
|
246
|
-
|
|
247
|
-
@classmethod
|
|
248
|
-
def from_callable(cls, func: Callable) -> NativeInterface:
|
|
249
|
-
"""
|
|
250
|
-
Extract the native interface from the given function. This is used to create a native interface for the task.
|
|
251
|
-
"""
|
|
252
|
-
sig = inspect.signature(func)
|
|
253
|
-
|
|
254
|
-
# Extract parameter details (name, type, default value)
|
|
255
|
-
param_info = {name: (param.annotation, param.default) for name, param in sig.parameters.items()}
|
|
256
|
-
|
|
257
|
-
# Get return type
|
|
258
|
-
outputs = extract_return_annotation(sig.return_annotation)
|
|
259
|
-
return cls(inputs=param_info, outputs=outputs)
|
|
260
|
-
|
|
261
|
-
def convert_to_kwargs(self, *args, **kwargs) -> Dict[str, Any]:
|
|
262
|
-
"""
|
|
263
|
-
Convert the given arguments to keyword arguments based on the native interface. This is used to convert the
|
|
264
|
-
arguments to the correct types for the task execution.
|
|
265
|
-
"""
|
|
266
|
-
# Convert positional arguments to keyword arguments
|
|
267
|
-
if len(args) > len(self.inputs):
|
|
268
|
-
raise ValueError(f"Too many positional arguments provided, inputs {self.inputs.keys()}, args {len(args)}")
|
|
269
|
-
for arg, input_name in zip(args, self.inputs.keys()):
|
|
270
|
-
kwargs[input_name] = arg
|
|
271
|
-
return kwargs
|
|
272
|
-
|
|
273
|
-
def get_input_types(self) -> Dict[str, Type]:
|
|
274
|
-
"""
|
|
275
|
-
Get the input types for the task. This is used to get the types of the inputs for the task execution.
|
|
276
|
-
"""
|
|
277
|
-
return {k: v[0] for k, v in self.inputs.items()}
|
|
278
|
-
|
|
279
|
-
def __repr__(self):
|
|
280
|
-
"""
|
|
281
|
-
Returns a string representation of the task interface.
|
|
282
|
-
"""
|
|
283
|
-
i = "("
|
|
284
|
-
if self.inputs:
|
|
285
|
-
initial = True
|
|
286
|
-
for key, tpe in self.inputs.items():
|
|
287
|
-
if not initial:
|
|
288
|
-
i += ", "
|
|
289
|
-
initial = False
|
|
290
|
-
tp = tpe[0] if isinstance(tpe[0], str) else tpe[0].__name__
|
|
291
|
-
i += f"{key}: {tp}"
|
|
292
|
-
if tpe[1] is not inspect.Parameter.empty:
|
|
293
|
-
i += f" = {tpe[1]}"
|
|
294
|
-
i += ")"
|
|
295
|
-
if self.outputs:
|
|
296
|
-
initial = True
|
|
297
|
-
multi = len(self.outputs) > 1
|
|
298
|
-
i += " -> "
|
|
299
|
-
if multi:
|
|
300
|
-
i += "("
|
|
301
|
-
for key, tpe in self.outputs.items():
|
|
302
|
-
if not initial:
|
|
303
|
-
i += ", "
|
|
304
|
-
initial = False
|
|
305
|
-
tp = tpe.__name__ if isinstance(tpe, type) else tpe
|
|
306
|
-
i += f"{key}: {tp}"
|
|
307
|
-
if multi:
|
|
308
|
-
i += ")"
|
|
309
|
-
return i + ":"
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
@dataclass
|
|
313
|
-
class SerializationContext:
|
|
314
|
-
"""
|
|
315
|
-
This object holds serialization time contextual information, that can be used when serializing the task and
|
|
316
|
-
various parameters of a tasktemplate. This is only available when the task is being serialized and can be
|
|
317
|
-
during a deployment or runtime.
|
|
318
|
-
|
|
319
|
-
:param version: The version of the task
|
|
320
|
-
:param code_bundle: The code bundle for the task. This is used to package the code and the inflation path.
|
|
321
|
-
:param input_path: The path to the inputs for the task. This is used to determine where the inputs will be located
|
|
322
|
-
:param output_path: The path to the outputs for the task. This is used to determine where the outputs will be
|
|
323
|
-
located
|
|
324
|
-
"""
|
|
325
|
-
|
|
326
|
-
version: str
|
|
327
|
-
project: str | None = None
|
|
328
|
-
domain: str | None = None
|
|
329
|
-
org: str | None = None
|
|
330
|
-
code_bundle: Optional[CodeBundle] = None
|
|
331
|
-
input_path: str = "{{.input}}"
|
|
332
|
-
output_path: str = "{{.outputPrefix}}"
|
|
333
|
-
_entrypoint_path: str = field(default="_bin/runtime.py", init=False)
|
|
334
|
-
image_cache: ImageCache | None = None
|
|
335
|
-
root_dir: Optional[pathlib.Path] = None
|
|
336
|
-
|
|
337
|
-
def get_entrypoint_path(self, interpreter_path: str) -> str:
|
|
338
|
-
"""
|
|
339
|
-
Get the entrypoint path for the task. This is used to determine the entrypoint for the task execution.
|
|
340
|
-
:param interpreter_path: The path to the interpreter (python)
|
|
341
|
-
"""
|
|
342
|
-
return os.path.join(os.path.dirname(os.path.dirname(interpreter_path)), self._entrypoint_path)
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# This is a module that provides hashing utilities for Protobuf objects.
|
|
2
|
-
import base64
|
|
3
|
-
import hashlib
|
|
4
|
-
import json
|
|
5
|
-
|
|
6
|
-
from google.protobuf import json_format
|
|
7
|
-
from google.protobuf.message import Message
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def compute_hash(pb: Message) -> bytes:
|
|
11
|
-
"""
|
|
12
|
-
Computes a deterministic hash in bytes for the Protobuf object.
|
|
13
|
-
"""
|
|
14
|
-
try:
|
|
15
|
-
pb_dict = json_format.MessageToDict(pb)
|
|
16
|
-
# json.dumps with sorted keys to ensure stability
|
|
17
|
-
stable_json_str = json.dumps(
|
|
18
|
-
pb_dict, sort_keys=True, separators=(",", ":")
|
|
19
|
-
) # separators to ensure no extra spaces
|
|
20
|
-
except Exception as e:
|
|
21
|
-
raise ValueError(f"Failed to marshal Protobuf object {pb} to JSON with error: {e}")
|
|
22
|
-
|
|
23
|
-
try:
|
|
24
|
-
# Deterministically hash the JSON object to a byte array. Using SHA-256 for hashing here,
|
|
25
|
-
# assuming it provides a consistent hash output.
|
|
26
|
-
hash_obj = hashlib.sha256(stable_json_str.encode("utf-8"))
|
|
27
|
-
except Exception as e:
|
|
28
|
-
raise ValueError(f"Failed to hash JSON for Protobuf object {pb} with error: {e}")
|
|
29
|
-
|
|
30
|
-
# The digest is guaranteed to be 32 bytes long
|
|
31
|
-
return hash_obj.digest()
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
def compute_hash_string(pb: Message) -> str:
|
|
35
|
-
"""
|
|
36
|
-
Computes a deterministic hash in base64 encoded string for the Protobuf object
|
|
37
|
-
"""
|
|
38
|
-
hash_bytes = compute_hash(pb)
|
|
39
|
-
return base64.b64encode(hash_bytes).decode("utf-8")
|
|
@@ -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 flyte._protos.common import identifier_pb2 as common_dot_identifier__pb2
|
|
15
|
-
from flyte._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*\x94\x04\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\x12\x1e\n\x1a\x41\x43TION_SUPPORT_SYSTEM_LOGS\x10\x10\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=1593
|
|
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)
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
from flyte._protos.common import identifier_pb2 as _identifier_pb2
|
|
2
|
-
from flyte._protos.validate.validate import validate_pb2 as _validate_pb2
|
|
3
|
-
from google.protobuf.internal import containers as _containers
|
|
4
|
-
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
|
|
5
|
-
from google.protobuf import descriptor as _descriptor
|
|
6
|
-
from google.protobuf import message as _message
|
|
7
|
-
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
|
|
8
|
-
|
|
9
|
-
DESCRIPTOR: _descriptor.FileDescriptor
|
|
10
|
-
|
|
11
|
-
class Action(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
12
|
-
__slots__ = []
|
|
13
|
-
ACTION_NONE: _ClassVar[Action]
|
|
14
|
-
ACTION_CREATE: _ClassVar[Action]
|
|
15
|
-
ACTION_READ: _ClassVar[Action]
|
|
16
|
-
ACTION_UPDATE: _ClassVar[Action]
|
|
17
|
-
ACTION_DELETE: _ClassVar[Action]
|
|
18
|
-
ACTION_VIEW_FLYTE_INVENTORY: _ClassVar[Action]
|
|
19
|
-
ACTION_VIEW_FLYTE_EXECUTIONS: _ClassVar[Action]
|
|
20
|
-
ACTION_REGISTER_FLYTE_INVENTORY: _ClassVar[Action]
|
|
21
|
-
ACTION_CREATE_FLYTE_EXECUTIONS: _ClassVar[Action]
|
|
22
|
-
ACTION_ADMINISTER_PROJECT: _ClassVar[Action]
|
|
23
|
-
ACTION_MANAGE_PERMISSIONS: _ClassVar[Action]
|
|
24
|
-
ACTION_ADMINISTER_ACCOUNT: _ClassVar[Action]
|
|
25
|
-
ACTION_MANAGE_CLUSTER: _ClassVar[Action]
|
|
26
|
-
ACTION_EDIT_EXECUTION_RELATED_ATTRIBUTES: _ClassVar[Action]
|
|
27
|
-
ACTION_EDIT_CLUSTER_RELATED_ATTRIBUTES: _ClassVar[Action]
|
|
28
|
-
ACTION_EDIT_UNUSED_ATTRIBUTES: _ClassVar[Action]
|
|
29
|
-
ACTION_SUPPORT_SYSTEM_LOGS: _ClassVar[Action]
|
|
30
|
-
ACTION_NONE: Action
|
|
31
|
-
ACTION_CREATE: Action
|
|
32
|
-
ACTION_READ: Action
|
|
33
|
-
ACTION_UPDATE: Action
|
|
34
|
-
ACTION_DELETE: Action
|
|
35
|
-
ACTION_VIEW_FLYTE_INVENTORY: Action
|
|
36
|
-
ACTION_VIEW_FLYTE_EXECUTIONS: Action
|
|
37
|
-
ACTION_REGISTER_FLYTE_INVENTORY: Action
|
|
38
|
-
ACTION_CREATE_FLYTE_EXECUTIONS: Action
|
|
39
|
-
ACTION_ADMINISTER_PROJECT: Action
|
|
40
|
-
ACTION_MANAGE_PERMISSIONS: Action
|
|
41
|
-
ACTION_ADMINISTER_ACCOUNT: Action
|
|
42
|
-
ACTION_MANAGE_CLUSTER: Action
|
|
43
|
-
ACTION_EDIT_EXECUTION_RELATED_ATTRIBUTES: Action
|
|
44
|
-
ACTION_EDIT_CLUSTER_RELATED_ATTRIBUTES: Action
|
|
45
|
-
ACTION_EDIT_UNUSED_ATTRIBUTES: Action
|
|
46
|
-
ACTION_SUPPORT_SYSTEM_LOGS: Action
|
|
47
|
-
|
|
48
|
-
class Organization(_message.Message):
|
|
49
|
-
__slots__ = ["name"]
|
|
50
|
-
NAME_FIELD_NUMBER: _ClassVar[int]
|
|
51
|
-
name: str
|
|
52
|
-
def __init__(self, name: _Optional[str] = ...) -> None: ...
|
|
53
|
-
|
|
54
|
-
class Domain(_message.Message):
|
|
55
|
-
__slots__ = ["name", "organization"]
|
|
56
|
-
NAME_FIELD_NUMBER: _ClassVar[int]
|
|
57
|
-
ORGANIZATION_FIELD_NUMBER: _ClassVar[int]
|
|
58
|
-
name: str
|
|
59
|
-
organization: Organization
|
|
60
|
-
def __init__(self, name: _Optional[str] = ..., organization: _Optional[_Union[Organization, _Mapping]] = ...) -> None: ...
|
|
61
|
-
|
|
62
|
-
class Project(_message.Message):
|
|
63
|
-
__slots__ = ["name", "domain"]
|
|
64
|
-
NAME_FIELD_NUMBER: _ClassVar[int]
|
|
65
|
-
DOMAIN_FIELD_NUMBER: _ClassVar[int]
|
|
66
|
-
name: str
|
|
67
|
-
domain: Domain
|
|
68
|
-
def __init__(self, name: _Optional[str] = ..., domain: _Optional[_Union[Domain, _Mapping]] = ...) -> None: ...
|
|
69
|
-
|
|
70
|
-
class Workflow(_message.Message):
|
|
71
|
-
__slots__ = ["name", "project"]
|
|
72
|
-
NAME_FIELD_NUMBER: _ClassVar[int]
|
|
73
|
-
PROJECT_FIELD_NUMBER: _ClassVar[int]
|
|
74
|
-
name: str
|
|
75
|
-
project: Project
|
|
76
|
-
def __init__(self, name: _Optional[str] = ..., project: _Optional[_Union[Project, _Mapping]] = ...) -> None: ...
|
|
77
|
-
|
|
78
|
-
class LaunchPlan(_message.Message):
|
|
79
|
-
__slots__ = ["name", "project"]
|
|
80
|
-
NAME_FIELD_NUMBER: _ClassVar[int]
|
|
81
|
-
PROJECT_FIELD_NUMBER: _ClassVar[int]
|
|
82
|
-
name: str
|
|
83
|
-
project: Project
|
|
84
|
-
def __init__(self, name: _Optional[str] = ..., project: _Optional[_Union[Project, _Mapping]] = ...) -> None: ...
|
|
85
|
-
|
|
86
|
-
class Resource(_message.Message):
|
|
87
|
-
__slots__ = ["organization", "domain", "project", "workflow", "launch_plan", "cluster"]
|
|
88
|
-
ORGANIZATION_FIELD_NUMBER: _ClassVar[int]
|
|
89
|
-
DOMAIN_FIELD_NUMBER: _ClassVar[int]
|
|
90
|
-
PROJECT_FIELD_NUMBER: _ClassVar[int]
|
|
91
|
-
WORKFLOW_FIELD_NUMBER: _ClassVar[int]
|
|
92
|
-
LAUNCH_PLAN_FIELD_NUMBER: _ClassVar[int]
|
|
93
|
-
CLUSTER_FIELD_NUMBER: _ClassVar[int]
|
|
94
|
-
organization: Organization
|
|
95
|
-
domain: Domain
|
|
96
|
-
project: Project
|
|
97
|
-
workflow: Workflow
|
|
98
|
-
launch_plan: LaunchPlan
|
|
99
|
-
cluster: _identifier_pb2.ClusterIdentifier
|
|
100
|
-
def __init__(self, organization: _Optional[_Union[Organization, _Mapping]] = ..., domain: _Optional[_Union[Domain, _Mapping]] = ..., project: _Optional[_Union[Project, _Mapping]] = ..., workflow: _Optional[_Union[Workflow, _Mapping]] = ..., launch_plan: _Optional[_Union[LaunchPlan, _Mapping]] = ..., cluster: _Optional[_Union[_identifier_pb2.ClusterIdentifier, _Mapping]] = ...) -> None: ...
|
|
101
|
-
|
|
102
|
-
class Permission(_message.Message):
|
|
103
|
-
__slots__ = ["resource", "actions"]
|
|
104
|
-
RESOURCE_FIELD_NUMBER: _ClassVar[int]
|
|
105
|
-
ACTIONS_FIELD_NUMBER: _ClassVar[int]
|
|
106
|
-
resource: Resource
|
|
107
|
-
actions: _containers.RepeatedScalarFieldContainer[Action]
|
|
108
|
-
def __init__(self, resource: _Optional[_Union[Resource, _Mapping]] = ..., actions: _Optional[_Iterable[_Union[Action, str]]] = ...) -> None: ...
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
-
# source: common/identifier.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 flyte._protos.validate.validate import validate_pb2 as validate_dot_validate__pb2
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17\x63ommon/identifier.proto\x12\x0f\x63loudidl.common\x1a\x17validate/validate.proto\"~\n\x11ProjectIdentifier\x12+\n\x0corganization\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x0corganization\x12\x1f\n\x06\x64omain\x18\x02 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x06\x64omain\x12\x1b\n\x04name\x18\x03 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x04name\"T\n\x11\x43lusterIdentifier\x12\"\n\x0corganization\x18\x01 \x01(\tR\x0corganization\x12\x1b\n\x04name\x18\x02 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x04name\"O\n\x15\x43lusterPoolIdentifier\x12\"\n\x0corganization\x18\x01 \x01(\tR\x0corganization\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\"_\n\x17\x43lusterConfigIdentifier\x12+\n\x0corganization\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x0corganization\x12\x17\n\x02id\x18\x02 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x02id\"3\n\x0eUserIdentifier\x12!\n\x07subject\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x07subject\":\n\x15\x41pplicationIdentifier\x12!\n\x07subject\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x07subject\"Q\n\x0eRoleIdentifier\x12\"\n\x0corganization\x18\x01 \x01(\tR\x0corganization\x12\x1b\n\x04name\x18\x02 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x04name\"O\n\rOrgIdentifier\x12>\n\x04name\x18\x01 \x01(\tB*\xfa\x42\'r%\x10\x01\x18?2\x1f^[a-z0-9]([-a-z0-9]*[a-z0-9])?$R\x04name\"y\n\x18ManagedClusterIdentifier\x12\x1b\n\x04name\x18\x02 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x04name\x12:\n\x03org\x18\x03 \x01(\x0b\x32\x1e.cloudidl.common.OrgIdentifierB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x03orgJ\x04\x08\x01\x10\x02\"S\n\x10PolicyIdentifier\x12\"\n\x0corganization\x18\x01 \x01(\tR\x0corganization\x12\x1b\n\x04name\x18\x02 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x04nameB\xb0\x01\n\x13\x63om.cloudidl.commonB\x0fIdentifierProtoH\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')
|
|
18
|
-
|
|
19
|
-
_globals = globals()
|
|
20
|
-
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
21
|
-
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'common.identifier_pb2', _globals)
|
|
22
|
-
if _descriptor._USE_C_DESCRIPTORS == False:
|
|
23
|
-
DESCRIPTOR._options = None
|
|
24
|
-
DESCRIPTOR._serialized_options = b'\n\023com.cloudidl.commonB\017IdentifierProtoH\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'
|
|
25
|
-
_PROJECTIDENTIFIER.fields_by_name['organization']._options = None
|
|
26
|
-
_PROJECTIDENTIFIER.fields_by_name['organization']._serialized_options = b'\372B\004r\002\020\001'
|
|
27
|
-
_PROJECTIDENTIFIER.fields_by_name['domain']._options = None
|
|
28
|
-
_PROJECTIDENTIFIER.fields_by_name['domain']._serialized_options = b'\372B\004r\002\020\001'
|
|
29
|
-
_PROJECTIDENTIFIER.fields_by_name['name']._options = None
|
|
30
|
-
_PROJECTIDENTIFIER.fields_by_name['name']._serialized_options = b'\372B\004r\002\020\001'
|
|
31
|
-
_CLUSTERIDENTIFIER.fields_by_name['name']._options = None
|
|
32
|
-
_CLUSTERIDENTIFIER.fields_by_name['name']._serialized_options = b'\372B\004r\002\020\001'
|
|
33
|
-
_CLUSTERCONFIGIDENTIFIER.fields_by_name['organization']._options = None
|
|
34
|
-
_CLUSTERCONFIGIDENTIFIER.fields_by_name['organization']._serialized_options = b'\372B\004r\002\020\001'
|
|
35
|
-
_CLUSTERCONFIGIDENTIFIER.fields_by_name['id']._options = None
|
|
36
|
-
_CLUSTERCONFIGIDENTIFIER.fields_by_name['id']._serialized_options = b'\372B\004r\002\020\001'
|
|
37
|
-
_USERIDENTIFIER.fields_by_name['subject']._options = None
|
|
38
|
-
_USERIDENTIFIER.fields_by_name['subject']._serialized_options = b'\372B\004r\002\020\001'
|
|
39
|
-
_APPLICATIONIDENTIFIER.fields_by_name['subject']._options = None
|
|
40
|
-
_APPLICATIONIDENTIFIER.fields_by_name['subject']._serialized_options = b'\372B\004r\002\020\001'
|
|
41
|
-
_ROLEIDENTIFIER.fields_by_name['name']._options = None
|
|
42
|
-
_ROLEIDENTIFIER.fields_by_name['name']._serialized_options = b'\372B\004r\002\020\001'
|
|
43
|
-
_ORGIDENTIFIER.fields_by_name['name']._options = None
|
|
44
|
-
_ORGIDENTIFIER.fields_by_name['name']._serialized_options = b'\372B\'r%\020\001\030?2\037^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'
|
|
45
|
-
_MANAGEDCLUSTERIDENTIFIER.fields_by_name['name']._options = None
|
|
46
|
-
_MANAGEDCLUSTERIDENTIFIER.fields_by_name['name']._serialized_options = b'\372B\004r\002\020\001'
|
|
47
|
-
_MANAGEDCLUSTERIDENTIFIER.fields_by_name['org']._options = None
|
|
48
|
-
_MANAGEDCLUSTERIDENTIFIER.fields_by_name['org']._serialized_options = b'\372B\005\212\001\002\020\001'
|
|
49
|
-
_POLICYIDENTIFIER.fields_by_name['name']._options = None
|
|
50
|
-
_POLICYIDENTIFIER.fields_by_name['name']._serialized_options = b'\372B\004r\002\020\001'
|
|
51
|
-
_globals['_PROJECTIDENTIFIER']._serialized_start=69
|
|
52
|
-
_globals['_PROJECTIDENTIFIER']._serialized_end=195
|
|
53
|
-
_globals['_CLUSTERIDENTIFIER']._serialized_start=197
|
|
54
|
-
_globals['_CLUSTERIDENTIFIER']._serialized_end=281
|
|
55
|
-
_globals['_CLUSTERPOOLIDENTIFIER']._serialized_start=283
|
|
56
|
-
_globals['_CLUSTERPOOLIDENTIFIER']._serialized_end=362
|
|
57
|
-
_globals['_CLUSTERCONFIGIDENTIFIER']._serialized_start=364
|
|
58
|
-
_globals['_CLUSTERCONFIGIDENTIFIER']._serialized_end=459
|
|
59
|
-
_globals['_USERIDENTIFIER']._serialized_start=461
|
|
60
|
-
_globals['_USERIDENTIFIER']._serialized_end=512
|
|
61
|
-
_globals['_APPLICATIONIDENTIFIER']._serialized_start=514
|
|
62
|
-
_globals['_APPLICATIONIDENTIFIER']._serialized_end=572
|
|
63
|
-
_globals['_ROLEIDENTIFIER']._serialized_start=574
|
|
64
|
-
_globals['_ROLEIDENTIFIER']._serialized_end=655
|
|
65
|
-
_globals['_ORGIDENTIFIER']._serialized_start=657
|
|
66
|
-
_globals['_ORGIDENTIFIER']._serialized_end=736
|
|
67
|
-
_globals['_MANAGEDCLUSTERIDENTIFIER']._serialized_start=738
|
|
68
|
-
_globals['_MANAGEDCLUSTERIDENTIFIER']._serialized_end=859
|
|
69
|
-
_globals['_POLICYIDENTIFIER']._serialized_start=861
|
|
70
|
-
_globals['_POLICYIDENTIFIER']._serialized_end=944
|
|
71
|
-
# @@protoc_insertion_point(module_scope)
|