flyte 0.0.1b0__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 -234
- flyte/_initialize.py +443 -294
- 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 +322 -33
- 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 +461 -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
- {union/_cli → flyte/cli}/_params.py +152 -153
- 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 +3 -0
- flyte/config/_config.py +248 -0
- flyte/config/_internal.py +73 -0
- 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 +230 -129
- 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 -287
- 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 -152
- flyte/_cli/main.py +0 -72
- 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.0.1b0.dist-info/METADATA +0 -179
- flyte-0.0.1b0.dist-info/RECORD +0 -390
- flyte-0.0.1b0.dist-info/entry_points.txt +0 -3
- 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/authorization_pb2_grpc.py +0 -4
- union/_protos/common/identifier_pb2.py +0 -71
- union/_protos/common/identifier_pb2.pyi +0 -82
- union/_protos/common/identifier_pb2_grpc.py +0 -4
- 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
- /flyte/{_cli → _debug}/__init__.py +0 -0
- /flyte/{_protos → _keyring}/__init__.py +0 -0
- {flyte-0.0.1b0.dist-info → flyte-2.0.0b46.dist-info}/WHEEL +0 -0
- {flyte-0.0.1b0.dist-info → flyte-2.0.0b46.dist-info}/top_level.txt +0 -0
flyte/git/_config.py
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import pathlib
|
|
2
|
+
import subprocess
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Dict, Protocol
|
|
6
|
+
|
|
7
|
+
import flyte.config
|
|
8
|
+
from flyte._logging import logger
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class GitUrlBuilder(Protocol):
|
|
12
|
+
@staticmethod
|
|
13
|
+
def build_url(remote_url: str, file_path: str, commit_sha: str, line_number: int, is_tree_clean: bool) -> str: ...
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class GithubUrlBuilder(GitUrlBuilder):
|
|
17
|
+
host_name = "github.com"
|
|
18
|
+
|
|
19
|
+
@staticmethod
|
|
20
|
+
def build_url(remote_url: str, file_path: str, commit_sha: str, line_number: int, is_tree_clean: bool) -> str:
|
|
21
|
+
url = f"{remote_url}/blob/{commit_sha}/{file_path}"
|
|
22
|
+
if is_tree_clean:
|
|
23
|
+
url += f"#L{line_number}"
|
|
24
|
+
return url
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class GitlabUrlBuilder(GitUrlBuilder):
|
|
28
|
+
host_name = "gitlab.com"
|
|
29
|
+
|
|
30
|
+
@staticmethod
|
|
31
|
+
def build_url(remote_url: str, file_path: str, commit_sha: str, line_number: int, is_tree_clean: bool) -> str:
|
|
32
|
+
url = f"{remote_url}/-/blob/{commit_sha}/{file_path}"
|
|
33
|
+
if is_tree_clean:
|
|
34
|
+
url += f"#L{line_number}"
|
|
35
|
+
return url
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
GIT_URL_BUILDER_REGISTRY: Dict[str, GitUrlBuilder] = {
|
|
39
|
+
GithubUrlBuilder.host_name: GithubUrlBuilder,
|
|
40
|
+
GitlabUrlBuilder.host_name: GitlabUrlBuilder,
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@dataclass(init=True, frozen=True)
|
|
45
|
+
class GitStatus:
|
|
46
|
+
"""
|
|
47
|
+
A class representing the status of a git repository.
|
|
48
|
+
|
|
49
|
+
:param is_valid: Whether git repository is valid
|
|
50
|
+
:param is_tree_clean: Whether working tree is clean
|
|
51
|
+
:param remote_url: Remote URL in HTTPS format
|
|
52
|
+
:param repo_dir: Repository root directory
|
|
53
|
+
:param commit_sha: Current commit SHA
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
is_valid: bool = False
|
|
57
|
+
is_tree_clean: bool = False
|
|
58
|
+
remote_url: str = ""
|
|
59
|
+
repo_dir: Path = Path()
|
|
60
|
+
commit_sha: str = ""
|
|
61
|
+
|
|
62
|
+
@classmethod
|
|
63
|
+
def from_current_repo(cls) -> "GitStatus":
|
|
64
|
+
"""Discover git information from the current repository.
|
|
65
|
+
|
|
66
|
+
If Git is not installed or .git does not exist, returns GitStatus with is_valid=False.
|
|
67
|
+
|
|
68
|
+
:return: GitStatus instance with discovered git information
|
|
69
|
+
"""
|
|
70
|
+
try:
|
|
71
|
+
# Check if we're in a git repository and get the root directory
|
|
72
|
+
result = subprocess.run(
|
|
73
|
+
["git", "rev-parse", "--show-toplevel"],
|
|
74
|
+
check=False,
|
|
75
|
+
capture_output=True,
|
|
76
|
+
text=True,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
if result.returncode != 0:
|
|
80
|
+
logger.warning("Not in a git repository or git is not installed")
|
|
81
|
+
return cls()
|
|
82
|
+
|
|
83
|
+
repo_dir = Path(result.stdout.strip())
|
|
84
|
+
|
|
85
|
+
# Get current commit SHA
|
|
86
|
+
result = subprocess.run(
|
|
87
|
+
["git", "rev-parse", "HEAD"],
|
|
88
|
+
check=False,
|
|
89
|
+
capture_output=True,
|
|
90
|
+
text=True,
|
|
91
|
+
)
|
|
92
|
+
if result.returncode == 0:
|
|
93
|
+
commit_sha = result.stdout.strip()
|
|
94
|
+
else:
|
|
95
|
+
logger.warning("Failed to get current commit SHA")
|
|
96
|
+
return cls(repo_dir=repo_dir)
|
|
97
|
+
|
|
98
|
+
# Check if working tree is clean
|
|
99
|
+
result = subprocess.run(
|
|
100
|
+
["git", "status", "--porcelain"],
|
|
101
|
+
check=False,
|
|
102
|
+
capture_output=True,
|
|
103
|
+
text=True,
|
|
104
|
+
)
|
|
105
|
+
if result.returncode == 0:
|
|
106
|
+
is_tree_clean = len(result.stdout.strip()) == 0
|
|
107
|
+
else:
|
|
108
|
+
logger.warning("Failed to check if working tree is clean")
|
|
109
|
+
return cls(repo_dir=repo_dir, commit_sha=commit_sha)
|
|
110
|
+
|
|
111
|
+
# Get remote URL
|
|
112
|
+
instance = cls(repo_dir=repo_dir, commit_sha=commit_sha, is_tree_clean=is_tree_clean)
|
|
113
|
+
remote_url = instance._get_remote_url()
|
|
114
|
+
if not remote_url:
|
|
115
|
+
logger.warning("Failed to get remote URL")
|
|
116
|
+
return cls(repo_dir=repo_dir, commit_sha=commit_sha, is_tree_clean=is_tree_clean)
|
|
117
|
+
|
|
118
|
+
return cls(
|
|
119
|
+
is_valid=True,
|
|
120
|
+
is_tree_clean=is_tree_clean,
|
|
121
|
+
remote_url=remote_url,
|
|
122
|
+
repo_dir=repo_dir,
|
|
123
|
+
commit_sha=commit_sha,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
except Exception as e:
|
|
127
|
+
logger.debug(f"Failed to discover git repository: {e}")
|
|
128
|
+
return cls()
|
|
129
|
+
|
|
130
|
+
def _get_remote_url(self) -> str:
|
|
131
|
+
"""Get the remote push URL.
|
|
132
|
+
|
|
133
|
+
Returns the 'origin' remote push URL if it exists, otherwise returns
|
|
134
|
+
the first remote alphabetically. Converts SSH/Git protocol URLs to HTTPS format.
|
|
135
|
+
|
|
136
|
+
:return: The remote push URL in HTTPS format, or empty string if not found
|
|
137
|
+
"""
|
|
138
|
+
try:
|
|
139
|
+
# Try to get origin push remote first
|
|
140
|
+
result = subprocess.run(
|
|
141
|
+
["git", "remote", "get-url", "--push", "origin"],
|
|
142
|
+
check=False,
|
|
143
|
+
capture_output=True,
|
|
144
|
+
text=True,
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
if result.returncode == 0:
|
|
148
|
+
url = result.stdout.strip()
|
|
149
|
+
return self._normalize_url_to_https(url)
|
|
150
|
+
|
|
151
|
+
# If origin doesn't exist, get all remotes
|
|
152
|
+
result = subprocess.run(
|
|
153
|
+
["git", "remote"],
|
|
154
|
+
check=False,
|
|
155
|
+
capture_output=True,
|
|
156
|
+
text=True,
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
if result.returncode == 0:
|
|
160
|
+
remotes = result.stdout.strip().split("\n")
|
|
161
|
+
if remotes:
|
|
162
|
+
# Sort alphabetically and get the first one
|
|
163
|
+
remotes.sort()
|
|
164
|
+
first_remote = remotes[0]
|
|
165
|
+
|
|
166
|
+
# Get push URL for this remote
|
|
167
|
+
result = subprocess.run(
|
|
168
|
+
["git", "remote", "get-url", "--push", first_remote],
|
|
169
|
+
check=False,
|
|
170
|
+
capture_output=True,
|
|
171
|
+
text=True,
|
|
172
|
+
)
|
|
173
|
+
if result.returncode == 0:
|
|
174
|
+
url = result.stdout.strip()
|
|
175
|
+
return self._normalize_url_to_https(url)
|
|
176
|
+
|
|
177
|
+
return ""
|
|
178
|
+
|
|
179
|
+
except Exception:
|
|
180
|
+
return ""
|
|
181
|
+
|
|
182
|
+
def _normalize_url_to_https(self, url: str) -> str:
|
|
183
|
+
"""Convert SSH or Git protocol URLs to HTTPS format.
|
|
184
|
+
|
|
185
|
+
Examples:
|
|
186
|
+
git@github.com:user/repo.git -> https://github.com/user/repo
|
|
187
|
+
https://github.com/user/repo.git -> https://github.com/user/repo
|
|
188
|
+
|
|
189
|
+
:param url: The Git URL to normalize
|
|
190
|
+
:return: The normalized HTTPS URL
|
|
191
|
+
"""
|
|
192
|
+
# Remove .git suffix first
|
|
193
|
+
url = url.removesuffix(".git")
|
|
194
|
+
|
|
195
|
+
# Handle SSH format: git@host:path or user@host:path
|
|
196
|
+
if url.startswith("git@"):
|
|
197
|
+
parts = url.split("@", 1)
|
|
198
|
+
if len(parts) == 2:
|
|
199
|
+
host_and_path = parts[1].replace(":", "/", 1)
|
|
200
|
+
return f"https://{host_and_path}"
|
|
201
|
+
|
|
202
|
+
return url
|
|
203
|
+
|
|
204
|
+
def _get_remote_host(self, url: str) -> str:
|
|
205
|
+
"""Get the remote host name from a normalized HTTPS URL.
|
|
206
|
+
|
|
207
|
+
:param url: URL that has been normalized to HTTPS format by _normalize_url_to_https
|
|
208
|
+
:return: The host name (e.g., "github.com", "gitlab.com")
|
|
209
|
+
"""
|
|
210
|
+
parts = url.split("//", 1)
|
|
211
|
+
if len(parts) < 2:
|
|
212
|
+
return ""
|
|
213
|
+
|
|
214
|
+
# Get everything after "//" and split by "/"
|
|
215
|
+
host_and_path = parts[1]
|
|
216
|
+
parts = host_and_path.split("/", 1)
|
|
217
|
+
if len(parts) < 2:
|
|
218
|
+
return ""
|
|
219
|
+
host = host_and_path.split("/")[0]
|
|
220
|
+
|
|
221
|
+
return host
|
|
222
|
+
|
|
223
|
+
def _get_file_path(self, path: Path | str) -> str:
|
|
224
|
+
"""Get the path relative to the repository root directory.
|
|
225
|
+
|
|
226
|
+
:param path: Absolute or relative path to a file
|
|
227
|
+
:return: Path relative to repo_dir as string, or empty string if failed
|
|
228
|
+
"""
|
|
229
|
+
try:
|
|
230
|
+
path_obj = Path(path).resolve()
|
|
231
|
+
relative_path = path_obj.relative_to(self.repo_dir)
|
|
232
|
+
return str(relative_path)
|
|
233
|
+
except Exception as e:
|
|
234
|
+
logger.warning(f"Failed to get relative path for {path}: {e}")
|
|
235
|
+
return ""
|
|
236
|
+
|
|
237
|
+
def build_url(self, path: Path | str, line_number: int) -> str:
|
|
238
|
+
"""Build a git URL for the given path.
|
|
239
|
+
|
|
240
|
+
:param path: Path to a file
|
|
241
|
+
:param line_number: Line number of the code file
|
|
242
|
+
:return: Path relative to repo_dir
|
|
243
|
+
"""
|
|
244
|
+
if not self.is_valid:
|
|
245
|
+
logger.warning("GitConfig is not valid, cannot build URL")
|
|
246
|
+
return ""
|
|
247
|
+
host_name = self._get_remote_host(self.remote_url)
|
|
248
|
+
git_file_path = self._get_file_path(path)
|
|
249
|
+
if not host_name:
|
|
250
|
+
logger.warning(f"Failed to extract host name from remote URL: {self.remote_url}")
|
|
251
|
+
return ""
|
|
252
|
+
if not git_file_path:
|
|
253
|
+
return ""
|
|
254
|
+
builder = GIT_URL_BUILDER_REGISTRY.get(host_name)
|
|
255
|
+
if not builder:
|
|
256
|
+
logger.warning(f"URL builder for {host_name} is not implemented")
|
|
257
|
+
return ""
|
|
258
|
+
url = builder.build_url(self.remote_url, git_file_path, self.commit_sha, line_number, self.is_tree_clean)
|
|
259
|
+
return url
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
def config_from_root(path: pathlib.Path | str = ".flyte/config.yaml") -> flyte.config.Config | None:
|
|
263
|
+
"""Get the config file from the git root directory.
|
|
264
|
+
|
|
265
|
+
By default, the config file is expected to be in `.flyte/config.yaml` in the git root directory.
|
|
266
|
+
|
|
267
|
+
:param path: Path to the config file relative to git root directory (default: ".flyte/config.yaml")
|
|
268
|
+
:return: Config object if found, None otherwise
|
|
269
|
+
"""
|
|
270
|
+
try:
|
|
271
|
+
result = subprocess.run(["git", "rev-parse", "--show-toplevel"], check=False, capture_output=True, text=True)
|
|
272
|
+
if result.returncode != 0:
|
|
273
|
+
return None
|
|
274
|
+
root = pathlib.Path(result.stdout.strip())
|
|
275
|
+
if not (root / path).exists():
|
|
276
|
+
return None
|
|
277
|
+
return flyte.config.auto(root / path)
|
|
278
|
+
except Exception:
|
|
279
|
+
return None
|
flyte/io/__init__.py
CHANGED
|
@@ -3,9 +3,16 @@
|
|
|
3
3
|
|
|
4
4
|
This package contains additional data types beyond the primitive data types in python to abstract data flow
|
|
5
5
|
of large datasets in Union.
|
|
6
|
+
|
|
6
7
|
"""
|
|
7
8
|
|
|
8
|
-
__all__ = [
|
|
9
|
+
__all__ = [
|
|
10
|
+
"PARQUET",
|
|
11
|
+
"DataFrame",
|
|
12
|
+
"Dir",
|
|
13
|
+
"File",
|
|
14
|
+
]
|
|
9
15
|
|
|
16
|
+
from ._dataframe import PARQUET, DataFrame
|
|
10
17
|
from ._dir import Dir
|
|
11
18
|
from ._file import File
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Flytekit
|
|
2
|
+
Flytekit DataFrame
|
|
3
3
|
==========================================================
|
|
4
|
-
.. currentmodule::
|
|
4
|
+
.. currentmodule:: flyte.io._dataframe
|
|
5
5
|
|
|
6
6
|
.. autosummary::
|
|
7
7
|
:template: custom.rst
|
|
8
8
|
:toctree: generated/
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
DataFrame
|
|
11
|
+
DataFrameDecoder
|
|
12
|
+
DataFrameEncoder
|
|
13
13
|
"""
|
|
14
14
|
|
|
15
15
|
import functools
|
|
@@ -17,12 +17,13 @@ import functools
|
|
|
17
17
|
from flyte._logging import logger
|
|
18
18
|
from flyte._utils.lazy_module import is_imported
|
|
19
19
|
|
|
20
|
-
from .
|
|
20
|
+
from .dataframe import (
|
|
21
|
+
PARQUET,
|
|
22
|
+
DataFrame,
|
|
23
|
+
DataFrameDecoder,
|
|
24
|
+
DataFrameEncoder,
|
|
25
|
+
DataFrameTransformerEngine,
|
|
21
26
|
DuplicateHandlerError,
|
|
22
|
-
StructuredDataset,
|
|
23
|
-
StructuredDatasetDecoder,
|
|
24
|
-
StructuredDatasetEncoder,
|
|
25
|
-
StructuredDatasetTransformerEngine,
|
|
26
27
|
)
|
|
27
28
|
|
|
28
29
|
|
|
@@ -30,8 +31,8 @@ from .structured_dataset import (
|
|
|
30
31
|
def register_csv_handlers():
|
|
31
32
|
from .basic_dfs import CSVToPandasDecodingHandler, PandasToCSVEncodingHandler
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
DataFrameTransformerEngine.register(PandasToCSVEncodingHandler(), default_format_for_type=True)
|
|
35
|
+
DataFrameTransformerEngine.register(CSVToPandasDecodingHandler(), default_format_for_type=True)
|
|
35
36
|
|
|
36
37
|
|
|
37
38
|
@functools.lru_cache(maxsize=None)
|
|
@@ -42,9 +43,9 @@ def register_pandas_handlers():
|
|
|
42
43
|
|
|
43
44
|
from .basic_dfs import PandasToParquetEncodingHandler, ParquetToPandasDecodingHandler
|
|
44
45
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
DataFrameTransformerEngine.register(PandasToParquetEncodingHandler(), default_format_for_type=True)
|
|
47
|
+
DataFrameTransformerEngine.register(ParquetToPandasDecodingHandler(), default_format_for_type=True)
|
|
48
|
+
DataFrameTransformerEngine.register_renderer(pd.DataFrame, TopFrameRenderer())
|
|
48
49
|
|
|
49
50
|
|
|
50
51
|
@functools.lru_cache(maxsize=None)
|
|
@@ -55,9 +56,9 @@ def register_arrow_handlers():
|
|
|
55
56
|
|
|
56
57
|
from .basic_dfs import ArrowToParquetEncodingHandler, ParquetToArrowDecodingHandler
|
|
57
58
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
DataFrameTransformerEngine.register(ArrowToParquetEncodingHandler(), default_format_for_type=True)
|
|
60
|
+
DataFrameTransformerEngine.register(ParquetToArrowDecodingHandler(), default_format_for_type=True)
|
|
61
|
+
DataFrameTransformerEngine.register_renderer(pa.Table, ArrowRenderer())
|
|
61
62
|
|
|
62
63
|
|
|
63
64
|
@functools.lru_cache(maxsize=None)
|
|
@@ -70,10 +71,10 @@ def register_bigquery_handlers():
|
|
|
70
71
|
PandasToBQEncodingHandlers,
|
|
71
72
|
)
|
|
72
73
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
DataFrameTransformerEngine.register(PandasToBQEncodingHandlers())
|
|
75
|
+
DataFrameTransformerEngine.register(BQToPandasDecodingHandler())
|
|
76
|
+
DataFrameTransformerEngine.register(ArrowToBQEncodingHandlers())
|
|
77
|
+
DataFrameTransformerEngine.register(BQToArrowDecodingHandler())
|
|
77
78
|
except ImportError:
|
|
78
79
|
logger.info(
|
|
79
80
|
"We won't register bigquery handler for structured dataset because "
|
|
@@ -86,8 +87,8 @@ def register_snowflake_handlers():
|
|
|
86
87
|
try:
|
|
87
88
|
from .snowflake import PandasToSnowflakeEncodingHandlers, SnowflakeToPandasDecodingHandler
|
|
88
89
|
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
DataFrameTransformerEngine.register(SnowflakeToPandasDecodingHandler())
|
|
91
|
+
DataFrameTransformerEngine.register(PandasToSnowflakeEncodingHandlers())
|
|
91
92
|
|
|
92
93
|
except ImportError:
|
|
93
94
|
logger.info(
|
|
@@ -96,7 +97,7 @@ def register_snowflake_handlers():
|
|
|
96
97
|
)
|
|
97
98
|
|
|
98
99
|
|
|
99
|
-
def
|
|
100
|
+
def lazy_import_dataframe_handler():
|
|
100
101
|
if is_imported("pandas"):
|
|
101
102
|
try:
|
|
102
103
|
register_pandas_handlers()
|
|
@@ -121,9 +122,10 @@ def lazy_import_structured_dataset_handler():
|
|
|
121
122
|
|
|
122
123
|
|
|
123
124
|
__all__ = [
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
"
|
|
125
|
+
"PARQUET",
|
|
126
|
+
"DataFrame",
|
|
127
|
+
"DataFrameDecoder",
|
|
128
|
+
"DataFrameEncoder",
|
|
129
|
+
"DataFrameTransformerEngine",
|
|
130
|
+
"lazy_import_dataframe_handler",
|
|
129
131
|
]
|