flyte 2.0.0b22__py3-none-any.whl → 2.0.0b30__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 +18 -2
- flyte/_bin/runtime.py +43 -5
- flyte/_cache/cache.py +4 -2
- flyte/_cache/local_cache.py +216 -0
- flyte/_code_bundle/_ignore.py +1 -1
- flyte/_code_bundle/_packaging.py +4 -4
- flyte/_code_bundle/_utils.py +14 -8
- flyte/_code_bundle/bundle.py +13 -5
- flyte/_constants.py +1 -0
- flyte/_context.py +4 -1
- flyte/_custom_context.py +73 -0
- flyte/_debug/constants.py +0 -1
- flyte/_debug/vscode.py +6 -1
- flyte/_deploy.py +223 -59
- flyte/_environment.py +5 -0
- flyte/_excepthook.py +1 -1
- flyte/_image.py +144 -82
- flyte/_initialize.py +95 -12
- flyte/_interface.py +2 -0
- flyte/_internal/controllers/_local_controller.py +65 -24
- flyte/_internal/controllers/_trace.py +1 -1
- flyte/_internal/controllers/remote/_action.py +13 -11
- flyte/_internal/controllers/remote/_client.py +1 -1
- flyte/_internal/controllers/remote/_controller.py +9 -4
- flyte/_internal/controllers/remote/_core.py +16 -16
- flyte/_internal/controllers/remote/_informer.py +4 -4
- flyte/_internal/controllers/remote/_service_protocol.py +7 -7
- flyte/_internal/imagebuild/docker_builder.py +139 -84
- flyte/_internal/imagebuild/image_builder.py +7 -13
- flyte/_internal/imagebuild/remote_builder.py +65 -13
- flyte/_internal/imagebuild/utils.py +51 -3
- flyte/_internal/resolvers/_task_module.py +5 -38
- flyte/_internal/resolvers/default.py +2 -2
- flyte/_internal/runtime/convert.py +42 -20
- flyte/_internal/runtime/entrypoints.py +24 -1
- flyte/_internal/runtime/io.py +21 -8
- flyte/_internal/runtime/resources_serde.py +20 -6
- flyte/_internal/runtime/reuse.py +1 -1
- flyte/_internal/runtime/rusty.py +20 -5
- flyte/_internal/runtime/task_serde.py +33 -27
- flyte/_internal/runtime/taskrunner.py +10 -1
- flyte/_internal/runtime/trigger_serde.py +160 -0
- flyte/_internal/runtime/types_serde.py +1 -1
- flyte/_keyring/file.py +39 -9
- flyte/_logging.py +79 -12
- flyte/_map.py +31 -12
- flyte/_module.py +70 -0
- flyte/_pod.py +2 -2
- flyte/_resources.py +213 -31
- flyte/_run.py +107 -41
- flyte/_task.py +66 -10
- flyte/_task_environment.py +96 -24
- flyte/_task_plugins.py +4 -2
- flyte/_trigger.py +1000 -0
- flyte/_utils/__init__.py +2 -1
- flyte/_utils/asyn.py +3 -1
- flyte/_utils/docker_credentials.py +173 -0
- flyte/_utils/module_loader.py +17 -2
- flyte/_version.py +3 -3
- flyte/cli/_abort.py +3 -3
- flyte/cli/_build.py +1 -3
- flyte/cli/_common.py +78 -7
- flyte/cli/_create.py +178 -3
- flyte/cli/_delete.py +23 -1
- flyte/cli/_deploy.py +49 -11
- flyte/cli/_get.py +79 -34
- flyte/cli/_params.py +8 -6
- flyte/cli/_plugins.py +209 -0
- flyte/cli/_run.py +127 -11
- flyte/cli/_serve.py +64 -0
- flyte/cli/_update.py +37 -0
- flyte/cli/_user.py +17 -0
- flyte/cli/main.py +30 -4
- flyte/config/_config.py +2 -0
- flyte/config/_internal.py +1 -0
- flyte/config/_reader.py +3 -3
- flyte/connectors/__init__.py +11 -0
- flyte/connectors/_connector.py +270 -0
- flyte/connectors/_server.py +197 -0
- flyte/connectors/utils.py +135 -0
- flyte/errors.py +10 -1
- flyte/extend.py +8 -1
- flyte/extras/_container.py +6 -1
- flyte/git/_config.py +11 -9
- flyte/io/__init__.py +2 -0
- flyte/io/_dataframe/__init__.py +2 -0
- flyte/io/_dataframe/basic_dfs.py +1 -1
- flyte/io/_dataframe/dataframe.py +12 -8
- flyte/io/_dir.py +551 -120
- flyte/io/_file.py +538 -141
- flyte/models.py +57 -12
- flyte/remote/__init__.py +6 -1
- flyte/remote/_action.py +18 -16
- flyte/remote/_client/_protocols.py +39 -4
- flyte/remote/_client/auth/_channel.py +10 -6
- flyte/remote/_client/controlplane.py +17 -5
- flyte/remote/_console.py +3 -2
- flyte/remote/_data.py +4 -3
- flyte/remote/_logs.py +3 -3
- flyte/remote/_run.py +47 -7
- flyte/remote/_secret.py +26 -17
- flyte/remote/_task.py +21 -9
- flyte/remote/_trigger.py +306 -0
- flyte/remote/_user.py +33 -0
- flyte/storage/__init__.py +6 -1
- flyte/storage/_parallel_reader.py +274 -0
- flyte/storage/_storage.py +185 -103
- flyte/types/__init__.py +16 -0
- flyte/types/_interface.py +2 -2
- flyte/types/_pickle.py +17 -4
- flyte/types/_string_literals.py +8 -9
- flyte/types/_type_engine.py +26 -19
- flyte/types/_utils.py +1 -1
- {flyte-2.0.0b22.data → flyte-2.0.0b30.data}/scripts/runtime.py +43 -5
- {flyte-2.0.0b22.dist-info → flyte-2.0.0b30.dist-info}/METADATA +8 -1
- flyte-2.0.0b30.dist-info/RECORD +192 -0
- flyte/_protos/__init__.py +0 -0
- 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 -99
- flyte/_protos/common/identifier_pb2.pyi +0 -120
- 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 -71
- 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/imagebuilder/definition_pb2.py +0 -60
- flyte/_protos/imagebuilder/definition_pb2.pyi +0 -153
- flyte/_protos/imagebuilder/definition_pb2_grpc.py +0 -4
- flyte/_protos/imagebuilder/payload_pb2.py +0 -32
- flyte/_protos/imagebuilder/payload_pb2.pyi +0 -21
- flyte/_protos/imagebuilder/payload_pb2_grpc.py +0 -4
- flyte/_protos/imagebuilder/service_pb2.py +0 -29
- flyte/_protos/imagebuilder/service_pb2.pyi +0 -5
- flyte/_protos/imagebuilder/service_pb2_grpc.py +0 -66
- flyte/_protos/logs/dataplane/payload_pb2.py +0 -100
- flyte/_protos/logs/dataplane/payload_pb2.pyi +0 -177
- 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/common_pb2.py +0 -27
- flyte/_protos/workflow/common_pb2.pyi +0 -14
- flyte/_protos/workflow/common_pb2_grpc.py +0 -4
- flyte/_protos/workflow/environment_pb2.py +0 -29
- flyte/_protos/workflow/environment_pb2.pyi +0 -12
- flyte/_protos/workflow/environment_pb2_grpc.py +0 -4
- 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 -111
- flyte/_protos/workflow/queue_service_pb2.pyi +0 -168
- flyte/_protos/workflow/queue_service_pb2_grpc.py +0 -172
- flyte/_protos/workflow/run_definition_pb2.py +0 -123
- flyte/_protos/workflow/run_definition_pb2.pyi +0 -352
- 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 -137
- flyte/_protos/workflow/run_service_pb2.pyi +0 -185
- flyte/_protos/workflow/run_service_pb2_grpc.py +0 -446
- flyte/_protos/workflow/state_service_pb2.py +0 -67
- flyte/_protos/workflow/state_service_pb2.pyi +0 -76
- flyte/_protos/workflow/state_service_pb2_grpc.py +0 -138
- flyte/_protos/workflow/task_definition_pb2.py +0 -82
- flyte/_protos/workflow/task_definition_pb2.pyi +0 -88
- flyte/_protos/workflow/task_definition_pb2_grpc.py +0 -4
- flyte/_protos/workflow/task_service_pb2.py +0 -60
- flyte/_protos/workflow/task_service_pb2.pyi +0 -59
- flyte/_protos/workflow/task_service_pb2_grpc.py +0 -138
- flyte-2.0.0b22.dist-info/RECORD +0 -250
- {flyte-2.0.0b22.data → flyte-2.0.0b30.data}/scripts/debug.py +0 -0
- {flyte-2.0.0b22.dist-info → flyte-2.0.0b30.dist-info}/WHEEL +0 -0
- {flyte-2.0.0b22.dist-info → flyte-2.0.0b30.dist-info}/entry_points.txt +0 -0
- {flyte-2.0.0b22.dist-info → flyte-2.0.0b30.dist-info}/licenses/LICENSE +0 -0
- {flyte-2.0.0b22.dist-info → flyte-2.0.0b30.dist-info}/top_level.txt +0 -0
flyte/git/_config.py
CHANGED
|
@@ -4,16 +4,18 @@ import subprocess
|
|
|
4
4
|
import flyte.config
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
def config_from_root(path: pathlib.Path | str = ".flyte/config.yaml") -> flyte.config.Config:
|
|
7
|
+
def config_from_root(path: pathlib.Path | str = ".flyte/config.yaml") -> flyte.config.Config | None:
|
|
8
8
|
"""Get the config file from the git root directory.
|
|
9
9
|
|
|
10
10
|
By default, the config file is expected to be in `.flyte/config.yaml` in the git root directory.
|
|
11
11
|
"""
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
try:
|
|
13
|
+
result = subprocess.run(["git", "rev-parse", "--show-toplevel"], check=False, capture_output=True, text=True)
|
|
14
|
+
if result.returncode != 0:
|
|
15
|
+
return None
|
|
16
|
+
root = pathlib.Path(result.stdout.strip())
|
|
17
|
+
if not (root / path).exists():
|
|
18
|
+
return None
|
|
19
|
+
return flyte.config.auto(root / path)
|
|
20
|
+
except Exception:
|
|
21
|
+
return None
|
flyte/io/__init__.py
CHANGED
|
@@ -7,6 +7,7 @@ of large datasets in Union.
|
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
9
|
__all__ = [
|
|
10
|
+
"PARQUET",
|
|
10
11
|
"DataFrame",
|
|
11
12
|
"DataFrameDecoder",
|
|
12
13
|
"DataFrameEncoder",
|
|
@@ -17,6 +18,7 @@ __all__ = [
|
|
|
17
18
|
]
|
|
18
19
|
|
|
19
20
|
from ._dataframe import (
|
|
21
|
+
PARQUET,
|
|
20
22
|
DataFrame,
|
|
21
23
|
DataFrameDecoder,
|
|
22
24
|
DataFrameEncoder,
|
flyte/io/_dataframe/__init__.py
CHANGED
|
@@ -18,6 +18,7 @@ from flyte._logging import logger
|
|
|
18
18
|
from flyte._utils.lazy_module import is_imported
|
|
19
19
|
|
|
20
20
|
from .dataframe import (
|
|
21
|
+
PARQUET,
|
|
21
22
|
DataFrame,
|
|
22
23
|
DataFrameDecoder,
|
|
23
24
|
DataFrameEncoder,
|
|
@@ -121,6 +122,7 @@ def lazy_import_dataframe_handler():
|
|
|
121
122
|
|
|
122
123
|
|
|
123
124
|
__all__ = [
|
|
125
|
+
"PARQUET",
|
|
124
126
|
"DataFrame",
|
|
125
127
|
"DataFrameDecoder",
|
|
126
128
|
"DataFrameEncoder",
|
flyte/io/_dataframe/basic_dfs.py
CHANGED
|
@@ -3,7 +3,7 @@ import typing
|
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
from typing import TypeVar
|
|
5
5
|
|
|
6
|
-
from
|
|
6
|
+
from flyteidl2.core import literals_pb2, types_pb2
|
|
7
7
|
from fsspec.core import split_protocol, strip_protocol
|
|
8
8
|
|
|
9
9
|
import flyte.storage as storage
|
flyte/io/_dataframe/dataframe.py
CHANGED
|
@@ -8,7 +8,7 @@ from abc import ABC, abstractmethod
|
|
|
8
8
|
from dataclasses import is_dataclass
|
|
9
9
|
from typing import Any, ClassVar, Coroutine, Dict, Generic, List, Optional, Type, Union
|
|
10
10
|
|
|
11
|
-
from
|
|
11
|
+
from flyteidl2.core import literals_pb2, types_pb2
|
|
12
12
|
from fsspec.utils import get_protocol
|
|
13
13
|
from mashumaro.types import SerializableType
|
|
14
14
|
from pydantic import BaseModel, ConfigDict, Field, PrivateAttr, model_serializer, model_validator
|
|
@@ -647,17 +647,21 @@ class DataFrameTransformerEngine(TypeTransformer[DataFrame]):
|
|
|
647
647
|
f"Already registered a handler for {(h.python_type, protocol, h.supported_format)}"
|
|
648
648
|
)
|
|
649
649
|
lowest_level[h.supported_format] = h
|
|
650
|
-
logger.debug(
|
|
650
|
+
logger.debug(
|
|
651
|
+
f"Registered {h.__class__.__name__} as handler for {h.python_type.__class__.__name__},"
|
|
652
|
+
f" protocol {protocol}, fmt {h.supported_format}"
|
|
653
|
+
)
|
|
651
654
|
|
|
652
655
|
if (default_format_for_type or default_for_type) and h.supported_format != GENERIC_FORMAT:
|
|
653
656
|
if h.python_type in cls.DEFAULT_FORMATS and not override:
|
|
654
657
|
if cls.DEFAULT_FORMATS[h.python_type] != h.supported_format:
|
|
655
658
|
logger.info(
|
|
656
|
-
f"Not using handler {h} with format {h.supported_format}"
|
|
657
|
-
f" as default for {h.python_type
|
|
659
|
+
f"Not using handler {h.__class__.__name__} with format {h.supported_format}"
|
|
660
|
+
f" as default for {h.python_type.__class__.__name__},"
|
|
661
|
+
f" {cls.DEFAULT_FORMATS[h.python_type]} already specified."
|
|
658
662
|
)
|
|
659
663
|
else:
|
|
660
|
-
logger.debug(f"Use {type(h).__name__} as default handler for {h.python_type}.")
|
|
664
|
+
logger.debug(f"Use {type(h).__name__} as default handler for {h.python_type.__class__.__name__}.")
|
|
661
665
|
cls.DEFAULT_FORMATS[h.python_type] = h.supported_format
|
|
662
666
|
if default_storage_for_type or default_for_type:
|
|
663
667
|
if h.protocol in cls.DEFAULT_PROTOCOLS and not override:
|
|
@@ -685,7 +689,7 @@ class DataFrameTransformerEngine(TypeTransformer[DataFrame]):
|
|
|
685
689
|
expected: types_pb2.LiteralType,
|
|
686
690
|
) -> literals_pb2.Literal:
|
|
687
691
|
# Make a copy in case we need to hand off to encoders, since we can't be sure of mutations.
|
|
688
|
-
python_type, *
|
|
692
|
+
python_type, *_attrs = extract_cols_and_format(python_type)
|
|
689
693
|
sdt = types_pb2.StructuredDatasetType(format=self.DEFAULT_FORMATS.get(python_type, GENERIC_FORMAT))
|
|
690
694
|
|
|
691
695
|
if issubclass(python_type, DataFrame) and not isinstance(python_val, DataFrame):
|
|
@@ -876,7 +880,7 @@ class DataFrameTransformerEngine(TypeTransformer[DataFrame]):
|
|
|
876
880
|
raise TypeTransformerFailedError("Attribute access unsupported.")
|
|
877
881
|
|
|
878
882
|
# Detect annotations and extract out all the relevant information that the user might supply
|
|
879
|
-
expected_python_type, column_dict,
|
|
883
|
+
expected_python_type, column_dict, _storage_fmt, _pa_schema = extract_cols_and_format(expected_python_type)
|
|
880
884
|
|
|
881
885
|
# Start handling for DataFrame scalars, first look at the columns
|
|
882
886
|
incoming_columns = lv.scalar.structured_dataset.metadata.structured_dataset_type.columns
|
|
@@ -986,7 +990,7 @@ class DataFrameTransformerEngine(TypeTransformer[DataFrame]):
|
|
|
986
990
|
return converted_cols
|
|
987
991
|
|
|
988
992
|
def _get_dataset_type(self, t: typing.Union[Type[DataFrame], typing.Any]) -> types_pb2.StructuredDatasetType:
|
|
989
|
-
|
|
993
|
+
_original_python_type, column_map, storage_format, pa_schema = extract_cols_and_format(t) # type: ignore
|
|
990
994
|
|
|
991
995
|
# Get the column information
|
|
992
996
|
converted_cols: typing.List[types_pb2.StructuredDatasetType.DatasetColumn] = (
|