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.
Files changed (455) hide show
  1. flyte/__init__.py +83 -30
  2. flyte/_bin/connect.py +61 -0
  3. flyte/_bin/debug.py +38 -0
  4. flyte/_bin/runtime.py +87 -19
  5. flyte/_bin/serve.py +351 -0
  6. flyte/_build.py +3 -2
  7. flyte/_cache/cache.py +6 -5
  8. flyte/_cache/local_cache.py +216 -0
  9. flyte/_code_bundle/_ignore.py +31 -5
  10. flyte/_code_bundle/_packaging.py +42 -11
  11. flyte/_code_bundle/_utils.py +57 -34
  12. flyte/_code_bundle/bundle.py +130 -27
  13. flyte/_constants.py +1 -0
  14. flyte/_context.py +21 -5
  15. flyte/_custom_context.py +73 -0
  16. flyte/_debug/constants.py +37 -0
  17. flyte/_debug/utils.py +17 -0
  18. flyte/_debug/vscode.py +315 -0
  19. flyte/_deploy.py +396 -75
  20. flyte/_deployer.py +109 -0
  21. flyte/_environment.py +94 -11
  22. flyte/_excepthook.py +37 -0
  23. flyte/_group.py +2 -1
  24. flyte/_hash.py +1 -16
  25. flyte/_image.py +544 -234
  26. flyte/_initialize.py +443 -294
  27. flyte/_interface.py +40 -5
  28. flyte/_internal/controllers/__init__.py +22 -8
  29. flyte/_internal/controllers/_local_controller.py +159 -35
  30. flyte/_internal/controllers/_trace.py +18 -10
  31. flyte/_internal/controllers/remote/__init__.py +38 -9
  32. flyte/_internal/controllers/remote/_action.py +82 -12
  33. flyte/_internal/controllers/remote/_client.py +6 -2
  34. flyte/_internal/controllers/remote/_controller.py +290 -64
  35. flyte/_internal/controllers/remote/_core.py +155 -95
  36. flyte/_internal/controllers/remote/_informer.py +40 -20
  37. flyte/_internal/controllers/remote/_service_protocol.py +2 -2
  38. flyte/_internal/imagebuild/__init__.py +2 -10
  39. flyte/_internal/imagebuild/docker_builder.py +391 -84
  40. flyte/_internal/imagebuild/image_builder.py +111 -55
  41. flyte/_internal/imagebuild/remote_builder.py +409 -0
  42. flyte/_internal/imagebuild/utils.py +79 -0
  43. flyte/_internal/resolvers/_app_env_module.py +92 -0
  44. flyte/_internal/resolvers/_task_module.py +5 -38
  45. flyte/_internal/resolvers/app_env.py +26 -0
  46. flyte/_internal/resolvers/common.py +8 -1
  47. flyte/_internal/resolvers/default.py +2 -2
  48. flyte/_internal/runtime/convert.py +322 -33
  49. flyte/_internal/runtime/entrypoints.py +106 -18
  50. flyte/_internal/runtime/io.py +71 -23
  51. flyte/_internal/runtime/resources_serde.py +21 -7
  52. flyte/_internal/runtime/reuse.py +125 -0
  53. flyte/_internal/runtime/rusty.py +196 -0
  54. flyte/_internal/runtime/task_serde.py +239 -66
  55. flyte/_internal/runtime/taskrunner.py +48 -8
  56. flyte/_internal/runtime/trigger_serde.py +162 -0
  57. flyte/_internal/runtime/types_serde.py +7 -16
  58. flyte/_keyring/file.py +115 -0
  59. flyte/_link.py +30 -0
  60. flyte/_logging.py +241 -42
  61. flyte/_map.py +312 -0
  62. flyte/_metrics.py +59 -0
  63. flyte/_module.py +74 -0
  64. flyte/_pod.py +30 -0
  65. flyte/_resources.py +296 -33
  66. flyte/_retry.py +1 -7
  67. flyte/_reusable_environment.py +72 -7
  68. flyte/_run.py +461 -132
  69. flyte/_secret.py +47 -11
  70. flyte/_serve.py +333 -0
  71. flyte/_task.py +245 -56
  72. flyte/_task_environment.py +219 -97
  73. flyte/_task_plugins.py +47 -0
  74. flyte/_tools.py +8 -8
  75. flyte/_trace.py +15 -24
  76. flyte/_trigger.py +1027 -0
  77. flyte/_utils/__init__.py +12 -1
  78. flyte/_utils/asyn.py +3 -1
  79. flyte/_utils/async_cache.py +139 -0
  80. flyte/_utils/coro_management.py +5 -4
  81. flyte/_utils/description_parser.py +19 -0
  82. flyte/_utils/docker_credentials.py +173 -0
  83. flyte/_utils/helpers.py +45 -19
  84. flyte/_utils/module_loader.py +123 -0
  85. flyte/_utils/org_discovery.py +57 -0
  86. flyte/_utils/uv_script_parser.py +8 -1
  87. flyte/_version.py +16 -3
  88. flyte/app/__init__.py +27 -0
  89. flyte/app/_app_environment.py +362 -0
  90. flyte/app/_connector_environment.py +40 -0
  91. flyte/app/_deploy.py +130 -0
  92. flyte/app/_parameter.py +343 -0
  93. flyte/app/_runtime/__init__.py +3 -0
  94. flyte/app/_runtime/app_serde.py +383 -0
  95. flyte/app/_types.py +113 -0
  96. flyte/app/extras/__init__.py +9 -0
  97. flyte/app/extras/_auth_middleware.py +217 -0
  98. flyte/app/extras/_fastapi.py +93 -0
  99. flyte/app/extras/_model_loader/__init__.py +3 -0
  100. flyte/app/extras/_model_loader/config.py +7 -0
  101. flyte/app/extras/_model_loader/loader.py +288 -0
  102. flyte/cli/__init__.py +12 -0
  103. flyte/cli/_abort.py +28 -0
  104. flyte/cli/_build.py +114 -0
  105. flyte/cli/_common.py +493 -0
  106. flyte/cli/_create.py +371 -0
  107. flyte/cli/_delete.py +45 -0
  108. flyte/cli/_deploy.py +401 -0
  109. flyte/cli/_gen.py +316 -0
  110. flyte/cli/_get.py +446 -0
  111. flyte/cli/_option.py +33 -0
  112. {union/_cli → flyte/cli}/_params.py +152 -153
  113. flyte/cli/_plugins.py +209 -0
  114. flyte/cli/_prefetch.py +292 -0
  115. flyte/cli/_run.py +690 -0
  116. flyte/cli/_serve.py +338 -0
  117. flyte/cli/_update.py +86 -0
  118. flyte/cli/_user.py +20 -0
  119. flyte/cli/main.py +246 -0
  120. flyte/config/__init__.py +3 -0
  121. flyte/config/_config.py +248 -0
  122. flyte/config/_internal.py +73 -0
  123. flyte/config/_reader.py +225 -0
  124. flyte/connectors/__init__.py +11 -0
  125. flyte/connectors/_connector.py +330 -0
  126. flyte/connectors/_server.py +194 -0
  127. flyte/connectors/utils.py +159 -0
  128. flyte/errors.py +134 -2
  129. flyte/extend.py +24 -0
  130. flyte/extras/_container.py +69 -56
  131. flyte/git/__init__.py +3 -0
  132. flyte/git/_config.py +279 -0
  133. flyte/io/__init__.py +8 -1
  134. flyte/io/{structured_dataset → _dataframe}/__init__.py +32 -30
  135. flyte/io/{structured_dataset → _dataframe}/basic_dfs.py +75 -68
  136. flyte/io/{structured_dataset/structured_dataset.py → _dataframe/dataframe.py} +207 -242
  137. flyte/io/_dir.py +575 -113
  138. flyte/io/_file.py +587 -141
  139. flyte/io/_hashing_io.py +342 -0
  140. flyte/io/extend.py +7 -0
  141. flyte/models.py +635 -0
  142. flyte/prefetch/__init__.py +22 -0
  143. flyte/prefetch/_hf_model.py +563 -0
  144. flyte/remote/__init__.py +14 -3
  145. flyte/remote/_action.py +879 -0
  146. flyte/remote/_app.py +346 -0
  147. flyte/remote/_auth_metadata.py +42 -0
  148. flyte/remote/_client/_protocols.py +62 -4
  149. flyte/remote/_client/auth/_auth_utils.py +19 -0
  150. flyte/remote/_client/auth/_authenticators/base.py +8 -2
  151. flyte/remote/_client/auth/_authenticators/device_code.py +4 -5
  152. flyte/remote/_client/auth/_authenticators/factory.py +4 -0
  153. flyte/remote/_client/auth/_authenticators/passthrough.py +79 -0
  154. flyte/remote/_client/auth/_authenticators/pkce.py +17 -18
  155. flyte/remote/_client/auth/_channel.py +47 -18
  156. flyte/remote/_client/auth/_client_config.py +5 -3
  157. flyte/remote/_client/auth/_keyring.py +15 -2
  158. flyte/remote/_client/auth/_token_client.py +3 -3
  159. flyte/remote/_client/controlplane.py +206 -18
  160. flyte/remote/_common.py +66 -0
  161. flyte/remote/_data.py +107 -22
  162. flyte/remote/_logs.py +116 -33
  163. flyte/remote/_project.py +21 -19
  164. flyte/remote/_run.py +164 -631
  165. flyte/remote/_secret.py +72 -29
  166. flyte/remote/_task.py +387 -46
  167. flyte/remote/_trigger.py +368 -0
  168. flyte/remote/_user.py +43 -0
  169. flyte/report/_report.py +10 -6
  170. flyte/storage/__init__.py +13 -1
  171. flyte/storage/_config.py +237 -0
  172. flyte/storage/_parallel_reader.py +289 -0
  173. flyte/storage/_storage.py +268 -59
  174. flyte/syncify/__init__.py +56 -0
  175. flyte/syncify/_api.py +414 -0
  176. flyte/types/__init__.py +39 -0
  177. flyte/types/_interface.py +22 -7
  178. flyte/{io/pickle/transformer.py → types/_pickle.py} +37 -9
  179. flyte/types/_string_literals.py +8 -9
  180. flyte/types/_type_engine.py +230 -129
  181. flyte/types/_utils.py +1 -1
  182. flyte-2.0.0b46.data/scripts/debug.py +38 -0
  183. flyte-2.0.0b46.data/scripts/runtime.py +194 -0
  184. flyte-2.0.0b46.dist-info/METADATA +352 -0
  185. flyte-2.0.0b46.dist-info/RECORD +221 -0
  186. flyte-2.0.0b46.dist-info/entry_points.txt +8 -0
  187. flyte-2.0.0b46.dist-info/licenses/LICENSE +201 -0
  188. flyte/_api_commons.py +0 -3
  189. flyte/_cli/_common.py +0 -287
  190. flyte/_cli/_create.py +0 -42
  191. flyte/_cli/_delete.py +0 -23
  192. flyte/_cli/_deploy.py +0 -140
  193. flyte/_cli/_get.py +0 -235
  194. flyte/_cli/_run.py +0 -152
  195. flyte/_cli/main.py +0 -72
  196. flyte/_datastructures.py +0 -342
  197. flyte/_internal/controllers/pbhash.py +0 -39
  198. flyte/_protos/common/authorization_pb2.py +0 -66
  199. flyte/_protos/common/authorization_pb2.pyi +0 -108
  200. flyte/_protos/common/authorization_pb2_grpc.py +0 -4
  201. flyte/_protos/common/identifier_pb2.py +0 -71
  202. flyte/_protos/common/identifier_pb2.pyi +0 -82
  203. flyte/_protos/common/identifier_pb2_grpc.py +0 -4
  204. flyte/_protos/common/identity_pb2.py +0 -48
  205. flyte/_protos/common/identity_pb2.pyi +0 -72
  206. flyte/_protos/common/identity_pb2_grpc.py +0 -4
  207. flyte/_protos/common/list_pb2.py +0 -36
  208. flyte/_protos/common/list_pb2.pyi +0 -69
  209. flyte/_protos/common/list_pb2_grpc.py +0 -4
  210. flyte/_protos/common/policy_pb2.py +0 -37
  211. flyte/_protos/common/policy_pb2.pyi +0 -27
  212. flyte/_protos/common/policy_pb2_grpc.py +0 -4
  213. flyte/_protos/common/role_pb2.py +0 -37
  214. flyte/_protos/common/role_pb2.pyi +0 -53
  215. flyte/_protos/common/role_pb2_grpc.py +0 -4
  216. flyte/_protos/common/runtime_version_pb2.py +0 -28
  217. flyte/_protos/common/runtime_version_pb2.pyi +0 -24
  218. flyte/_protos/common/runtime_version_pb2_grpc.py +0 -4
  219. flyte/_protos/logs/dataplane/payload_pb2.py +0 -96
  220. flyte/_protos/logs/dataplane/payload_pb2.pyi +0 -168
  221. flyte/_protos/logs/dataplane/payload_pb2_grpc.py +0 -4
  222. flyte/_protos/secret/definition_pb2.py +0 -49
  223. flyte/_protos/secret/definition_pb2.pyi +0 -93
  224. flyte/_protos/secret/definition_pb2_grpc.py +0 -4
  225. flyte/_protos/secret/payload_pb2.py +0 -62
  226. flyte/_protos/secret/payload_pb2.pyi +0 -94
  227. flyte/_protos/secret/payload_pb2_grpc.py +0 -4
  228. flyte/_protos/secret/secret_pb2.py +0 -38
  229. flyte/_protos/secret/secret_pb2.pyi +0 -6
  230. flyte/_protos/secret/secret_pb2_grpc.py +0 -198
  231. flyte/_protos/secret/secret_pb2_grpc_grpc.py +0 -198
  232. flyte/_protos/validate/validate/validate_pb2.py +0 -76
  233. flyte/_protos/workflow/node_execution_service_pb2.py +0 -26
  234. flyte/_protos/workflow/node_execution_service_pb2.pyi +0 -4
  235. flyte/_protos/workflow/node_execution_service_pb2_grpc.py +0 -32
  236. flyte/_protos/workflow/queue_service_pb2.py +0 -106
  237. flyte/_protos/workflow/queue_service_pb2.pyi +0 -141
  238. flyte/_protos/workflow/queue_service_pb2_grpc.py +0 -172
  239. flyte/_protos/workflow/run_definition_pb2.py +0 -128
  240. flyte/_protos/workflow/run_definition_pb2.pyi +0 -310
  241. flyte/_protos/workflow/run_definition_pb2_grpc.py +0 -4
  242. flyte/_protos/workflow/run_logs_service_pb2.py +0 -41
  243. flyte/_protos/workflow/run_logs_service_pb2.pyi +0 -28
  244. flyte/_protos/workflow/run_logs_service_pb2_grpc.py +0 -69
  245. flyte/_protos/workflow/run_service_pb2.py +0 -133
  246. flyte/_protos/workflow/run_service_pb2.pyi +0 -175
  247. flyte/_protos/workflow/run_service_pb2_grpc.py +0 -412
  248. flyte/_protos/workflow/state_service_pb2.py +0 -58
  249. flyte/_protos/workflow/state_service_pb2.pyi +0 -71
  250. flyte/_protos/workflow/state_service_pb2_grpc.py +0 -138
  251. flyte/_protos/workflow/task_definition_pb2.py +0 -72
  252. flyte/_protos/workflow/task_definition_pb2.pyi +0 -65
  253. flyte/_protos/workflow/task_definition_pb2_grpc.py +0 -4
  254. flyte/_protos/workflow/task_service_pb2.py +0 -44
  255. flyte/_protos/workflow/task_service_pb2.pyi +0 -31
  256. flyte/_protos/workflow/task_service_pb2_grpc.py +0 -104
  257. flyte/io/_dataframe.py +0 -0
  258. flyte/io/pickle/__init__.py +0 -0
  259. flyte/remote/_console.py +0 -18
  260. flyte-0.0.1b0.dist-info/METADATA +0 -179
  261. flyte-0.0.1b0.dist-info/RECORD +0 -390
  262. flyte-0.0.1b0.dist-info/entry_points.txt +0 -3
  263. union/__init__.py +0 -54
  264. union/_api_commons.py +0 -3
  265. union/_bin/__init__.py +0 -0
  266. union/_bin/runtime.py +0 -113
  267. union/_build.py +0 -25
  268. union/_cache/__init__.py +0 -12
  269. union/_cache/cache.py +0 -141
  270. union/_cache/defaults.py +0 -9
  271. union/_cache/policy_function_body.py +0 -42
  272. union/_cli/__init__.py +0 -0
  273. union/_cli/_common.py +0 -263
  274. union/_cli/_create.py +0 -40
  275. union/_cli/_delete.py +0 -23
  276. union/_cli/_deploy.py +0 -120
  277. union/_cli/_get.py +0 -162
  278. union/_cli/_run.py +0 -150
  279. union/_cli/main.py +0 -72
  280. union/_code_bundle/__init__.py +0 -8
  281. union/_code_bundle/_ignore.py +0 -113
  282. union/_code_bundle/_packaging.py +0 -187
  283. union/_code_bundle/_utils.py +0 -342
  284. union/_code_bundle/bundle.py +0 -176
  285. union/_context.py +0 -146
  286. union/_datastructures.py +0 -295
  287. union/_deploy.py +0 -185
  288. union/_doc.py +0 -29
  289. union/_docstring.py +0 -26
  290. union/_environment.py +0 -43
  291. union/_group.py +0 -31
  292. union/_hash.py +0 -23
  293. union/_image.py +0 -760
  294. union/_initialize.py +0 -585
  295. union/_interface.py +0 -84
  296. union/_internal/__init__.py +0 -3
  297. union/_internal/controllers/__init__.py +0 -77
  298. union/_internal/controllers/_local_controller.py +0 -77
  299. union/_internal/controllers/pbhash.py +0 -39
  300. union/_internal/controllers/remote/__init__.py +0 -40
  301. union/_internal/controllers/remote/_action.py +0 -131
  302. union/_internal/controllers/remote/_client.py +0 -43
  303. union/_internal/controllers/remote/_controller.py +0 -169
  304. union/_internal/controllers/remote/_core.py +0 -341
  305. union/_internal/controllers/remote/_informer.py +0 -260
  306. union/_internal/controllers/remote/_service_protocol.py +0 -44
  307. union/_internal/imagebuild/__init__.py +0 -11
  308. union/_internal/imagebuild/docker_builder.py +0 -416
  309. union/_internal/imagebuild/image_builder.py +0 -243
  310. union/_internal/imagebuild/remote_builder.py +0 -0
  311. union/_internal/resolvers/__init__.py +0 -0
  312. union/_internal/resolvers/_task_module.py +0 -31
  313. union/_internal/resolvers/common.py +0 -24
  314. union/_internal/resolvers/default.py +0 -27
  315. union/_internal/runtime/__init__.py +0 -0
  316. union/_internal/runtime/convert.py +0 -163
  317. union/_internal/runtime/entrypoints.py +0 -121
  318. union/_internal/runtime/io.py +0 -136
  319. union/_internal/runtime/resources_serde.py +0 -134
  320. union/_internal/runtime/task_serde.py +0 -202
  321. union/_internal/runtime/taskrunner.py +0 -179
  322. union/_internal/runtime/types_serde.py +0 -53
  323. union/_logging.py +0 -124
  324. union/_protos/__init__.py +0 -0
  325. union/_protos/common/authorization_pb2.py +0 -66
  326. union/_protos/common/authorization_pb2.pyi +0 -106
  327. union/_protos/common/authorization_pb2_grpc.py +0 -4
  328. union/_protos/common/identifier_pb2.py +0 -71
  329. union/_protos/common/identifier_pb2.pyi +0 -82
  330. union/_protos/common/identifier_pb2_grpc.py +0 -4
  331. union/_protos/common/identity_pb2.py +0 -48
  332. union/_protos/common/identity_pb2.pyi +0 -72
  333. union/_protos/common/identity_pb2_grpc.py +0 -4
  334. union/_protos/common/list_pb2.py +0 -36
  335. union/_protos/common/list_pb2.pyi +0 -69
  336. union/_protos/common/list_pb2_grpc.py +0 -4
  337. union/_protos/common/policy_pb2.py +0 -37
  338. union/_protos/common/policy_pb2.pyi +0 -27
  339. union/_protos/common/policy_pb2_grpc.py +0 -4
  340. union/_protos/common/role_pb2.py +0 -37
  341. union/_protos/common/role_pb2.pyi +0 -51
  342. union/_protos/common/role_pb2_grpc.py +0 -4
  343. union/_protos/common/runtime_version_pb2.py +0 -28
  344. union/_protos/common/runtime_version_pb2.pyi +0 -24
  345. union/_protos/common/runtime_version_pb2_grpc.py +0 -4
  346. union/_protos/logs/dataplane/payload_pb2.py +0 -96
  347. union/_protos/logs/dataplane/payload_pb2.pyi +0 -168
  348. union/_protos/logs/dataplane/payload_pb2_grpc.py +0 -4
  349. union/_protos/secret/definition_pb2.py +0 -49
  350. union/_protos/secret/definition_pb2.pyi +0 -93
  351. union/_protos/secret/definition_pb2_grpc.py +0 -4
  352. union/_protos/secret/payload_pb2.py +0 -62
  353. union/_protos/secret/payload_pb2.pyi +0 -94
  354. union/_protos/secret/payload_pb2_grpc.py +0 -4
  355. union/_protos/secret/secret_pb2.py +0 -38
  356. union/_protos/secret/secret_pb2.pyi +0 -6
  357. union/_protos/secret/secret_pb2_grpc.py +0 -198
  358. union/_protos/validate/validate/validate_pb2.py +0 -76
  359. union/_protos/workflow/node_execution_service_pb2.py +0 -26
  360. union/_protos/workflow/node_execution_service_pb2.pyi +0 -4
  361. union/_protos/workflow/node_execution_service_pb2_grpc.py +0 -32
  362. union/_protos/workflow/queue_service_pb2.py +0 -75
  363. union/_protos/workflow/queue_service_pb2.pyi +0 -103
  364. union/_protos/workflow/queue_service_pb2_grpc.py +0 -172
  365. union/_protos/workflow/run_definition_pb2.py +0 -100
  366. union/_protos/workflow/run_definition_pb2.pyi +0 -256
  367. union/_protos/workflow/run_definition_pb2_grpc.py +0 -4
  368. union/_protos/workflow/run_logs_service_pb2.py +0 -41
  369. union/_protos/workflow/run_logs_service_pb2.pyi +0 -28
  370. union/_protos/workflow/run_logs_service_pb2_grpc.py +0 -69
  371. union/_protos/workflow/run_service_pb2.py +0 -133
  372. union/_protos/workflow/run_service_pb2.pyi +0 -173
  373. union/_protos/workflow/run_service_pb2_grpc.py +0 -412
  374. union/_protos/workflow/state_service_pb2.py +0 -58
  375. union/_protos/workflow/state_service_pb2.pyi +0 -69
  376. union/_protos/workflow/state_service_pb2_grpc.py +0 -138
  377. union/_protos/workflow/task_definition_pb2.py +0 -72
  378. union/_protos/workflow/task_definition_pb2.pyi +0 -65
  379. union/_protos/workflow/task_definition_pb2_grpc.py +0 -4
  380. union/_protos/workflow/task_service_pb2.py +0 -44
  381. union/_protos/workflow/task_service_pb2.pyi +0 -31
  382. union/_protos/workflow/task_service_pb2_grpc.py +0 -104
  383. union/_resources.py +0 -226
  384. union/_retry.py +0 -32
  385. union/_reusable_environment.py +0 -25
  386. union/_run.py +0 -374
  387. union/_secret.py +0 -61
  388. union/_task.py +0 -354
  389. union/_task_environment.py +0 -186
  390. union/_timeout.py +0 -47
  391. union/_tools.py +0 -27
  392. union/_utils/__init__.py +0 -11
  393. union/_utils/asyn.py +0 -119
  394. union/_utils/file_handling.py +0 -71
  395. union/_utils/helpers.py +0 -46
  396. union/_utils/lazy_module.py +0 -54
  397. union/_utils/uv_script_parser.py +0 -49
  398. union/_version.py +0 -21
  399. union/connectors/__init__.py +0 -0
  400. union/errors.py +0 -128
  401. union/extras/__init__.py +0 -5
  402. union/extras/_container.py +0 -263
  403. union/io/__init__.py +0 -11
  404. union/io/_dataframe.py +0 -0
  405. union/io/_dir.py +0 -425
  406. union/io/_file.py +0 -418
  407. union/io/pickle/__init__.py +0 -0
  408. union/io/pickle/transformer.py +0 -117
  409. union/io/structured_dataset/__init__.py +0 -122
  410. union/io/structured_dataset/basic_dfs.py +0 -219
  411. union/io/structured_dataset/structured_dataset.py +0 -1057
  412. union/py.typed +0 -0
  413. union/remote/__init__.py +0 -23
  414. union/remote/_client/__init__.py +0 -0
  415. union/remote/_client/_protocols.py +0 -129
  416. union/remote/_client/auth/__init__.py +0 -12
  417. union/remote/_client/auth/_authenticators/__init__.py +0 -0
  418. union/remote/_client/auth/_authenticators/base.py +0 -391
  419. union/remote/_client/auth/_authenticators/client_credentials.py +0 -73
  420. union/remote/_client/auth/_authenticators/device_code.py +0 -120
  421. union/remote/_client/auth/_authenticators/external_command.py +0 -77
  422. union/remote/_client/auth/_authenticators/factory.py +0 -200
  423. union/remote/_client/auth/_authenticators/pkce.py +0 -515
  424. union/remote/_client/auth/_channel.py +0 -184
  425. union/remote/_client/auth/_client_config.py +0 -83
  426. union/remote/_client/auth/_default_html.py +0 -32
  427. union/remote/_client/auth/_grpc_utils/__init__.py +0 -0
  428. union/remote/_client/auth/_grpc_utils/auth_interceptor.py +0 -204
  429. union/remote/_client/auth/_grpc_utils/default_metadata_interceptor.py +0 -144
  430. union/remote/_client/auth/_keyring.py +0 -154
  431. union/remote/_client/auth/_token_client.py +0 -258
  432. union/remote/_client/auth/errors.py +0 -16
  433. union/remote/_client/controlplane.py +0 -86
  434. union/remote/_data.py +0 -149
  435. union/remote/_logs.py +0 -74
  436. union/remote/_project.py +0 -86
  437. union/remote/_run.py +0 -820
  438. union/remote/_secret.py +0 -132
  439. union/remote/_task.py +0 -193
  440. union/report/__init__.py +0 -3
  441. union/report/_report.py +0 -178
  442. union/report/_template.html +0 -124
  443. union/storage/__init__.py +0 -24
  444. union/storage/_remote_fs.py +0 -34
  445. union/storage/_storage.py +0 -247
  446. union/storage/_utils.py +0 -5
  447. union/types/__init__.py +0 -11
  448. union/types/_renderer.py +0 -162
  449. union/types/_string_literals.py +0 -120
  450. union/types/_type_engine.py +0 -2131
  451. union/types/_utils.py +0 -80
  452. /flyte/{_cli → _debug}/__init__.py +0 -0
  453. /flyte/{_protos → _keyring}/__init__.py +0 -0
  454. {flyte-0.0.1b0.dist-info → flyte-2.0.0b46.dist-info}/WHEEL +0 -0
  455. {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__ = ["Dir", "File"]
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 StructuredDataset
2
+ Flytekit DataFrame
3
3
  ==========================================================
4
- .. currentmodule:: flytekit.types.structured
4
+ .. currentmodule:: flyte.io._dataframe
5
5
 
6
6
  .. autosummary::
7
7
  :template: custom.rst
8
8
  :toctree: generated/
9
9
 
10
- StructuredDataset
11
- StructuredDatasetDecoder
12
- StructuredDatasetEncoder
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 .structured_dataset import (
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
- StructuredDatasetTransformerEngine.register(PandasToCSVEncodingHandler(), default_format_for_type=True)
34
- StructuredDatasetTransformerEngine.register(CSVToPandasDecodingHandler(), default_format_for_type=True)
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
- StructuredDatasetTransformerEngine.register(PandasToParquetEncodingHandler(), default_format_for_type=True)
46
- StructuredDatasetTransformerEngine.register(ParquetToPandasDecodingHandler(), default_format_for_type=True)
47
- StructuredDatasetTransformerEngine.register_renderer(pd.DataFrame, TopFrameRenderer())
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
- StructuredDatasetTransformerEngine.register(ArrowToParquetEncodingHandler(), default_format_for_type=True)
59
- StructuredDatasetTransformerEngine.register(ParquetToArrowDecodingHandler(), default_format_for_type=True)
60
- StructuredDatasetTransformerEngine.register_renderer(pa.Table, ArrowRenderer())
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
- StructuredDatasetTransformerEngine.register(PandasToBQEncodingHandlers())
74
- StructuredDatasetTransformerEngine.register(BQToPandasDecodingHandler())
75
- StructuredDatasetTransformerEngine.register(ArrowToBQEncodingHandlers())
76
- StructuredDatasetTransformerEngine.register(BQToArrowDecodingHandler())
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
- StructuredDatasetTransformerEngine.register(SnowflakeToPandasDecodingHandler())
90
- StructuredDatasetTransformerEngine.register(PandasToSnowflakeEncodingHandlers())
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 lazy_import_structured_dataset_handler():
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
- "StructuredDataset",
125
- "StructuredDatasetDecoder",
126
- "StructuredDatasetEncoder",
127
- "StructuredDatasetTransformerEngine",
128
- "lazy_import_structured_dataset_handler",
125
+ "PARQUET",
126
+ "DataFrame",
127
+ "DataFrameDecoder",
128
+ "DataFrameEncoder",
129
+ "DataFrameTransformerEngine",
130
+ "lazy_import_dataframe_handler",
129
131
  ]