ob-metaflow-stubs 6.0.7.2__py2.py3-none-any.whl → 6.0.7.3__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ob-metaflow-stubs might be problematic. Click here for more details.

Files changed (262) hide show
  1. metaflow-stubs/__init__.pyi +863 -863
  2. metaflow-stubs/cards.pyi +1 -1
  3. metaflow-stubs/cli.pyi +1 -1
  4. metaflow-stubs/cli_components/__init__.pyi +1 -1
  5. metaflow-stubs/cli_components/utils.pyi +1 -1
  6. metaflow-stubs/client/__init__.pyi +1 -1
  7. metaflow-stubs/client/core.pyi +3 -3
  8. metaflow-stubs/client/filecache.pyi +2 -2
  9. metaflow-stubs/events.pyi +1 -1
  10. metaflow-stubs/exception.pyi +1 -1
  11. metaflow-stubs/flowspec.pyi +3 -3
  12. metaflow-stubs/generated_for.txt +1 -1
  13. metaflow-stubs/includefile.pyi +4 -4
  14. metaflow-stubs/meta_files.pyi +1 -1
  15. metaflow-stubs/metadata_provider/__init__.pyi +1 -1
  16. metaflow-stubs/metadata_provider/heartbeat.pyi +1 -1
  17. metaflow-stubs/metadata_provider/metadata.pyi +1 -1
  18. metaflow-stubs/metadata_provider/util.pyi +1 -1
  19. metaflow-stubs/metaflow_config.pyi +1 -1
  20. metaflow-stubs/metaflow_current.pyi +52 -52
  21. metaflow-stubs/metaflow_git.pyi +1 -1
  22. metaflow-stubs/mf_extensions/__init__.pyi +1 -1
  23. metaflow-stubs/mf_extensions/obcheckpoint/__init__.pyi +1 -1
  24. metaflow-stubs/mf_extensions/obcheckpoint/plugins/__init__.pyi +1 -1
  25. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/__init__.pyi +1 -1
  26. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/__init__.pyi +1 -1
  27. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/async_cards.pyi +1 -1
  28. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/deco_injection_mixin.pyi +1 -1
  29. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/extra_components.pyi +1 -1
  30. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/__init__.pyi +1 -1
  31. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/__init__.pyi +1 -1
  32. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/checkpoint_lister.pyi +3 -3
  33. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/lineage_card.pyi +1 -1
  34. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/checkpoint_storage.pyi +3 -3
  35. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/constructors.pyi +1 -1
  36. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/core.pyi +2 -2
  37. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/decorator.pyi +5 -5
  38. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/exceptions.pyi +1 -1
  39. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/final_api.pyi +2 -2
  40. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/lineage.pyi +1 -1
  41. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/__init__.pyi +1 -1
  42. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/context.pyi +2 -2
  43. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/core.pyi +2 -2
  44. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/decorator.pyi +1 -1
  45. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/exceptions.pyi +1 -1
  46. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/task_utils.pyi +2 -2
  47. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi +1 -1
  48. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi +2 -2
  49. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/exceptions.pyi +1 -1
  50. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/__init__.pyi +1 -1
  51. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/decorator.pyi +1 -1
  52. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/__init__.pyi +1 -1
  53. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/core.pyi +2 -2
  54. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/exceptions.pyi +1 -1
  55. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/model_storage.pyi +3 -3
  56. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/__init__.pyi +1 -1
  57. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/flowspec_utils.pyi +1 -1
  58. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/general.pyi +1 -1
  59. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/identity_utils.pyi +2 -2
  60. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/__init__.pyi +1 -1
  61. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/base.pyi +1 -1
  62. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/tar.pyi +1 -1
  63. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +1 -1
  64. metaflow-stubs/mf_extensions/outerbounds/__init__.pyi +1 -1
  65. metaflow-stubs/mf_extensions/outerbounds/plugins/__init__.pyi +1 -1
  66. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/__init__.pyi +1 -1
  67. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/__init__.pyi +1 -1
  68. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/_state_machine.pyi +1 -1
  69. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/_vendor/__init__.pyi +1 -1
  70. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/_vendor/spinner/__init__.pyi +1 -1
  71. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/_vendor/spinner/spinners.pyi +1 -1
  72. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/app_cli.pyi +2 -2
  73. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/app_config.pyi +2 -2
  74. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/capsule.pyi +2 -2
  75. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/click_importer.pyi +1 -1
  76. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/code_package/__init__.pyi +1 -1
  77. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/code_package/code_packager.pyi +1 -1
  78. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/__init__.pyi +1 -1
  79. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/cli_generator.pyi +1 -1
  80. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/config_utils.pyi +4 -4
  81. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/schema_export.pyi +1 -1
  82. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/typed_configs.pyi +3 -3
  83. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/unified_config.pyi +3 -3
  84. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/dependencies.pyi +2 -2
  85. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/deployer.pyi +3 -3
  86. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/experimental/__init__.pyi +1 -1
  87. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/perimeters.pyi +1 -1
  88. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/utils.pyi +3 -3
  89. metaflow-stubs/mf_extensions/outerbounds/plugins/aws/__init__.pyi +1 -1
  90. metaflow-stubs/mf_extensions/outerbounds/plugins/aws/assume_role_decorator.pyi +1 -1
  91. metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/__init__.pyi +1 -1
  92. metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/async_cards.pyi +1 -1
  93. metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/injector.pyi +1 -1
  94. metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/__init__.pyi +1 -1
  95. metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/coreweave.pyi +1 -1
  96. metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/nebius.pyi +1 -1
  97. metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/__init__.pyi +1 -1
  98. metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/baker.pyi +2 -2
  99. metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/docker_environment.pyi +2 -2
  100. metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/fast_bakery.pyi +1 -1
  101. metaflow-stubs/mf_extensions/outerbounds/plugins/kubernetes/__init__.pyi +1 -1
  102. metaflow-stubs/mf_extensions/outerbounds/plugins/kubernetes/pod_killer.pyi +1 -1
  103. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/__init__.pyi +1 -1
  104. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/constants.pyi +1 -1
  105. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/exceptions.pyi +1 -1
  106. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/ollama.pyi +1 -1
  107. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/status_card.pyi +1 -1
  108. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/__init__.pyi +1 -1
  109. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/snowflake.pyi +1 -1
  110. metaflow-stubs/mf_extensions/outerbounds/profilers/__init__.pyi +1 -1
  111. metaflow-stubs/mf_extensions/outerbounds/profilers/gpu.pyi +1 -1
  112. metaflow-stubs/mf_extensions/outerbounds/remote_config.pyi +1 -1
  113. metaflow-stubs/mf_extensions/outerbounds/toplevel/__init__.pyi +1 -1
  114. metaflow-stubs/mf_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.pyi +1 -1
  115. metaflow-stubs/mf_extensions/outerbounds/toplevel/s3_proxy.pyi +1 -1
  116. metaflow-stubs/multicore_utils.pyi +1 -1
  117. metaflow-stubs/ob_internal.pyi +1 -1
  118. metaflow-stubs/packaging_sys/__init__.pyi +5 -5
  119. metaflow-stubs/packaging_sys/backend.pyi +4 -4
  120. metaflow-stubs/packaging_sys/distribution_support.pyi +3 -3
  121. metaflow-stubs/packaging_sys/tar_backend.pyi +2 -2
  122. metaflow-stubs/packaging_sys/utils.pyi +1 -1
  123. metaflow-stubs/packaging_sys/v1.pyi +2 -2
  124. metaflow-stubs/parameters.pyi +4 -4
  125. metaflow-stubs/plugins/__init__.pyi +12 -12
  126. metaflow-stubs/plugins/airflow/__init__.pyi +1 -1
  127. metaflow-stubs/plugins/airflow/airflow_utils.pyi +1 -1
  128. metaflow-stubs/plugins/airflow/exception.pyi +1 -1
  129. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +1 -1
  130. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +1 -1
  131. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +1 -1
  132. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +1 -1
  133. metaflow-stubs/plugins/argo/__init__.pyi +1 -1
  134. metaflow-stubs/plugins/argo/argo_client.pyi +1 -1
  135. metaflow-stubs/plugins/argo/argo_events.pyi +1 -1
  136. metaflow-stubs/plugins/argo/argo_workflows.pyi +2 -2
  137. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +2 -2
  138. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +2 -2
  139. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +2 -2
  140. metaflow-stubs/plugins/argo/exit_hooks.pyi +2 -2
  141. metaflow-stubs/plugins/aws/__init__.pyi +1 -1
  142. metaflow-stubs/plugins/aws/aws_client.pyi +1 -1
  143. metaflow-stubs/plugins/aws/aws_utils.pyi +1 -1
  144. metaflow-stubs/plugins/aws/batch/__init__.pyi +1 -1
  145. metaflow-stubs/plugins/aws/batch/batch.pyi +1 -1
  146. metaflow-stubs/plugins/aws/batch/batch_client.pyi +1 -1
  147. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +1 -1
  148. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +1 -1
  149. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +2 -2
  150. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +1 -1
  151. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +1 -1
  152. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +1 -1
  153. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +1 -1
  154. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +1 -1
  155. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +2 -2
  156. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +2 -2
  157. metaflow-stubs/plugins/azure/__init__.pyi +1 -1
  158. metaflow-stubs/plugins/azure/azure_credential.pyi +1 -1
  159. metaflow-stubs/plugins/azure/azure_exceptions.pyi +1 -1
  160. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +2 -2
  161. metaflow-stubs/plugins/azure/azure_utils.pyi +1 -1
  162. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +1 -1
  163. metaflow-stubs/plugins/azure/includefile_support.pyi +1 -1
  164. metaflow-stubs/plugins/cards/__init__.pyi +1 -1
  165. metaflow-stubs/plugins/cards/card_client.pyi +1 -1
  166. metaflow-stubs/plugins/cards/card_creator.pyi +1 -1
  167. metaflow-stubs/plugins/cards/card_datastore.pyi +1 -1
  168. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  169. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +1 -1
  170. metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
  171. metaflow-stubs/plugins/cards/card_modules/card.pyi +1 -1
  172. metaflow-stubs/plugins/cards/card_modules/components.pyi +2 -2
  173. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +1 -1
  174. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +1 -1
  175. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +1 -1
  176. metaflow-stubs/plugins/cards/card_resolver.pyi +1 -1
  177. metaflow-stubs/plugins/cards/component_serializer.pyi +1 -1
  178. metaflow-stubs/plugins/cards/exception.pyi +1 -1
  179. metaflow-stubs/plugins/catch_decorator.pyi +1 -1
  180. metaflow-stubs/plugins/datatools/__init__.pyi +1 -1
  181. metaflow-stubs/plugins/datatools/local.pyi +1 -1
  182. metaflow-stubs/plugins/datatools/s3/__init__.pyi +1 -1
  183. metaflow-stubs/plugins/datatools/s3/s3.pyi +2 -2
  184. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +1 -1
  185. metaflow-stubs/plugins/datatools/s3/s3util.pyi +1 -1
  186. metaflow-stubs/plugins/debug_logger.pyi +1 -1
  187. metaflow-stubs/plugins/debug_monitor.pyi +1 -1
  188. metaflow-stubs/plugins/environment_decorator.pyi +1 -1
  189. metaflow-stubs/plugins/events_decorator.pyi +1 -1
  190. metaflow-stubs/plugins/exit_hook/__init__.pyi +1 -1
  191. metaflow-stubs/plugins/exit_hook/exit_hook_decorator.pyi +1 -1
  192. metaflow-stubs/plugins/frameworks/__init__.pyi +1 -1
  193. metaflow-stubs/plugins/frameworks/pytorch.pyi +1 -1
  194. metaflow-stubs/plugins/gcp/__init__.pyi +1 -1
  195. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +2 -2
  196. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +1 -1
  197. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +1 -1
  198. metaflow-stubs/plugins/gcp/gs_utils.pyi +1 -1
  199. metaflow-stubs/plugins/gcp/includefile_support.pyi +1 -1
  200. metaflow-stubs/plugins/kubernetes/__init__.pyi +1 -1
  201. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +1 -1
  202. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +1 -1
  203. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +1 -1
  204. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +1 -1
  205. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +1 -1
  206. metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +1 -1
  207. metaflow-stubs/plugins/ollama/__init__.pyi +2 -2
  208. metaflow-stubs/plugins/optuna/__init__.pyi +1 -1
  209. metaflow-stubs/plugins/parallel_decorator.pyi +1 -1
  210. metaflow-stubs/plugins/perimeters.pyi +1 -1
  211. metaflow-stubs/plugins/project_decorator.pyi +1 -1
  212. metaflow-stubs/plugins/pypi/__init__.pyi +1 -1
  213. metaflow-stubs/plugins/pypi/conda_decorator.pyi +1 -1
  214. metaflow-stubs/plugins/pypi/conda_environment.pyi +3 -3
  215. metaflow-stubs/plugins/pypi/parsers.pyi +1 -1
  216. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +1 -1
  217. metaflow-stubs/plugins/pypi/pypi_environment.pyi +1 -1
  218. metaflow-stubs/plugins/pypi/utils.pyi +1 -1
  219. metaflow-stubs/plugins/resources_decorator.pyi +1 -1
  220. metaflow-stubs/plugins/retry_decorator.pyi +1 -1
  221. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  222. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
  223. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +1 -1
  224. metaflow-stubs/plugins/secrets/secrets_func.pyi +1 -1
  225. metaflow-stubs/plugins/secrets/secrets_spec.pyi +1 -1
  226. metaflow-stubs/plugins/secrets/utils.pyi +1 -1
  227. metaflow-stubs/plugins/snowflake/__init__.pyi +1 -1
  228. metaflow-stubs/plugins/storage_executor.pyi +1 -1
  229. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +1 -1
  230. metaflow-stubs/plugins/timeout_decorator.pyi +1 -1
  231. metaflow-stubs/plugins/torchtune/__init__.pyi +1 -1
  232. metaflow-stubs/plugins/uv/__init__.pyi +1 -1
  233. metaflow-stubs/plugins/uv/uv_environment.pyi +2 -2
  234. metaflow-stubs/profilers/__init__.pyi +1 -1
  235. metaflow-stubs/pylint_wrapper.pyi +1 -1
  236. metaflow-stubs/runner/__init__.pyi +1 -1
  237. metaflow-stubs/runner/deployer.pyi +32 -32
  238. metaflow-stubs/runner/deployer_impl.pyi +2 -2
  239. metaflow-stubs/runner/metaflow_runner.pyi +3 -3
  240. metaflow-stubs/runner/nbdeploy.pyi +1 -1
  241. metaflow-stubs/runner/nbrun.pyi +1 -1
  242. metaflow-stubs/runner/subprocess_manager.pyi +1 -1
  243. metaflow-stubs/runner/utils.pyi +2 -2
  244. metaflow-stubs/system/__init__.pyi +1 -1
  245. metaflow-stubs/system/system_logger.pyi +2 -2
  246. metaflow-stubs/system/system_monitor.pyi +1 -1
  247. metaflow-stubs/tagging_util.pyi +1 -1
  248. metaflow-stubs/tuple_util.pyi +1 -1
  249. metaflow-stubs/user_configs/__init__.pyi +1 -1
  250. metaflow-stubs/user_configs/config_options.pyi +2 -2
  251. metaflow-stubs/user_configs/config_parameters.pyi +6 -6
  252. metaflow-stubs/user_decorators/__init__.pyi +1 -1
  253. metaflow-stubs/user_decorators/common.pyi +1 -1
  254. metaflow-stubs/user_decorators/mutable_flow.pyi +3 -3
  255. metaflow-stubs/user_decorators/mutable_step.pyi +2 -2
  256. metaflow-stubs/user_decorators/user_flow_decorator.pyi +3 -3
  257. metaflow-stubs/user_decorators/user_step_decorator.pyi +4 -4
  258. {ob_metaflow_stubs-6.0.7.2.dist-info → ob_metaflow_stubs-6.0.7.3.dist-info}/METADATA +1 -1
  259. ob_metaflow_stubs-6.0.7.3.dist-info/RECORD +262 -0
  260. ob_metaflow_stubs-6.0.7.2.dist-info/RECORD +0 -262
  261. {ob_metaflow_stubs-6.0.7.2.dist-info → ob_metaflow_stubs-6.0.7.3.dist-info}/WHEEL +0 -0
  262. {ob_metaflow_stubs-6.0.7.2.dist-info → ob_metaflow_stubs-6.0.7.3.dist-info}/top_level.txt +0 -0
@@ -1,15 +1,15 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.17.1.0+obcheckpoint(0.2.4);ob(v1) #
4
- # Generated on 2025-08-19T23:54:56.174978 #
4
+ # Generated on 2025-08-20T21:57:30.472423 #
5
5
  ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
- import datetime
12
11
  import typing
12
+ import datetime
13
13
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
14
14
  StepFlag = typing.NewType("StepFlag", bool)
15
15
 
@@ -39,17 +39,17 @@ from .user_decorators.user_step_decorator import UserStepDecorator as UserStepDe
39
39
  from .user_decorators.user_step_decorator import StepMutator as StepMutator
40
40
  from .user_decorators.user_step_decorator import user_step_decorator as user_step_decorator
41
41
  from .user_decorators.user_flow_decorator import FlowMutator as FlowMutator
42
+ from . import events as events
43
+ from . import tuple_util as tuple_util
42
44
  from . import cards as cards
43
45
  from . import metaflow_git as metaflow_git
44
- from . import tuple_util as tuple_util
45
- from . import events as events
46
46
  from . import runner as runner
47
47
  from . import plugins as plugins
48
48
  from .mf_extensions.outerbounds.toplevel.global_aliases_for_metaflow_package import S3 as S3
49
49
  from . import includefile as includefile
50
50
  from .includefile import IncludeFile as IncludeFile
51
- from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
52
51
  from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
52
+ from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
53
53
  from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
54
54
  from . import client as client
55
55
  from .client.core import namespace as namespace
@@ -167,265 +167,91 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
167
167
  """
168
168
  ...
169
169
 
170
- def ollama(*, models: list, backend: str, force_pull: bool, cache_update_policy: str, force_cache_update: bool, debug: bool, circuit_breaker_config: dict, timeout_config: dict) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
170
+ def nvidia(*, gpu: int, gpu_type: str, queue_timeout: int) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
171
171
  """
172
- This decorator is used to run Ollama APIs as Metaflow task sidecars.
173
-
174
- User code call
175
- --------------
176
- @ollama(
177
- models=[...],
178
- ...
179
- )
180
-
181
- Valid backend options
182
- ---------------------
183
- - 'local': Run as a separate process on the local task machine.
184
- - (TODO) 'managed': Outerbounds hosts and selects compute provider.
185
- - (TODO) 'remote': Spin up separate instance to serve Ollama models.
186
-
187
- Valid model options
188
- -------------------
189
- Any model here https://ollama.com/search, e.g. 'llama3.2', 'llama3.3'
172
+ Specifies that this step should execute on DGX cloud.
190
173
 
191
174
 
192
175
  Parameters
193
176
  ----------
194
- models: list[str]
195
- List of Ollama containers running models in sidecars.
196
- backend: str
197
- Determines where and how to run the Ollama process.
198
- force_pull: bool
199
- Whether to run `ollama pull` no matter what, or first check the remote cache in Metaflow datastore for this model key.
200
- cache_update_policy: str
201
- Cache update policy: "auto", "force", or "never".
202
- force_cache_update: bool
203
- Simple override for "force" cache update policy.
204
- debug: bool
205
- Whether to turn on verbose debugging logs.
206
- circuit_breaker_config: dict
207
- Configuration for circuit breaker protection. Keys: failure_threshold, recovery_timeout, reset_timeout.
208
- timeout_config: dict
209
- Configuration for various operation timeouts. Keys: pull, stop, health_check, install, server_startup.
177
+ gpu : int
178
+ Number of GPUs to use.
179
+ gpu_type : str
180
+ Type of Nvidia GPU to use.
181
+ queue_timeout : int
182
+ Time to keep the job in NVCF's queue.
210
183
  """
211
184
  ...
212
185
 
213
186
  @typing.overload
214
- def pypi(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
187
+ def environment(*, vars: typing.Dict[str, str] = {}) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
215
188
  """
216
- Specifies the PyPI packages for the step.
217
-
218
- Information in this decorator will augment any
219
- attributes set in the `@pyi_base` flow-level decorator. Hence,
220
- you can use `@pypi_base` to set packages required by all
221
- steps and use `@pypi` to specify step-specific overrides.
189
+ Specifies environment variables to be set prior to the execution of a step.
222
190
 
223
191
 
224
192
  Parameters
225
193
  ----------
226
- packages : Dict[str, str], default: {}
227
- Packages to use for this step. The key is the name of the package
228
- and the value is the version to use.
229
- python : str, optional, default: None
230
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
231
- that the version used will correspond to the version of the Python interpreter used to start the run.
194
+ vars : Dict[str, str], default {}
195
+ Dictionary of environment variables to set.
232
196
  """
233
197
  ...
234
198
 
235
199
  @typing.overload
236
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
200
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
237
201
  ...
238
202
 
239
203
  @typing.overload
240
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
204
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
241
205
  ...
242
206
 
243
- def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
207
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
244
208
  """
245
- Specifies the PyPI packages for the step.
246
-
247
- Information in this decorator will augment any
248
- attributes set in the `@pyi_base` flow-level decorator. Hence,
249
- you can use `@pypi_base` to set packages required by all
250
- steps and use `@pypi` to specify step-specific overrides.
209
+ Specifies environment variables to be set prior to the execution of a step.
251
210
 
252
211
 
253
212
  Parameters
254
213
  ----------
255
- packages : Dict[str, str], default: {}
256
- Packages to use for this step. The key is the name of the package
257
- and the value is the version to use.
258
- python : str, optional, default: None
259
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
260
- that the version used will correspond to the version of the Python interpreter used to start the run.
214
+ vars : Dict[str, str], default {}
215
+ Dictionary of environment variables to set.
261
216
  """
262
217
  ...
263
218
 
264
219
  @typing.overload
265
- def checkpoint(*, load_policy: str = 'fresh', temp_dir_root: str = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
220
+ def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
266
221
  """
267
- Enables checkpointing for a step.
268
-
269
- > Examples
270
-
271
- - Saving Checkpoints
272
-
273
- ```python
274
- @checkpoint
275
- @step
276
- def train(self):
277
- model = create_model(self.parameters, checkpoint_path = None)
278
- for i in range(self.epochs):
279
- # some training logic
280
- loss = model.train(self.dataset)
281
- if i % 10 == 0:
282
- model.save(
283
- current.checkpoint.directory,
284
- )
285
- # saves the contents of the `current.checkpoint.directory` as a checkpoint
286
- # and returns a reference dictionary to the checkpoint saved in the datastore
287
- self.latest_checkpoint = current.checkpoint.save(
288
- name="epoch_checkpoint",
289
- metadata={
290
- "epoch": i,
291
- "loss": loss,
292
- }
293
- )
294
- ```
295
-
296
- - Using Loaded Checkpoints
297
-
298
- ```python
299
- @retry(times=3)
300
- @checkpoint
301
- @step
302
- def train(self):
303
- # Assume that the task has restarted and the previous attempt of the task
304
- # saved a checkpoint
305
- checkpoint_path = None
306
- if current.checkpoint.is_loaded: # Check if a checkpoint is loaded
307
- print("Loaded checkpoint from the previous attempt")
308
- checkpoint_path = current.checkpoint.directory
309
-
310
- model = create_model(self.parameters, checkpoint_path = checkpoint_path)
311
- for i in range(self.epochs):
312
- ...
313
- ```
222
+ Specifies secrets to be retrieved and injected as environment variables prior to
223
+ the execution of a step.
314
224
 
315
225
 
316
226
  Parameters
317
227
  ----------
318
- load_policy : str, default: "fresh"
319
- The policy for loading the checkpoint. The following policies are supported:
320
- - "eager": Loads the the latest available checkpoint within the namespace.
321
- With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
322
- will be loaded at the start of the task.
323
- - "none": Do not load any checkpoint
324
- - "fresh": Loads the lastest checkpoint created within the running Task.
325
- This mode helps loading checkpoints across various retry attempts of the same task.
326
- With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
327
- created within the task will be loaded when the task is retries execution on failure.
328
-
329
- temp_dir_root : str, default: None
330
- The root directory under which `current.checkpoint.directory` will be created.
228
+ sources : List[Union[str, Dict[str, Any]]], default: []
229
+ List of secret specs, defining how the secrets are to be retrieved
230
+ role : str, optional, default: None
231
+ Role to use for fetching secrets
331
232
  """
332
233
  ...
333
234
 
334
235
  @typing.overload
335
- def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
236
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
336
237
  ...
337
238
 
338
239
  @typing.overload
339
- def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
240
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
340
241
  ...
341
242
 
342
- def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load_policy: str = 'fresh', temp_dir_root: str = None):
243
+ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None):
343
244
  """
344
- Enables checkpointing for a step.
345
-
346
- > Examples
347
-
348
- - Saving Checkpoints
349
-
350
- ```python
351
- @checkpoint
352
- @step
353
- def train(self):
354
- model = create_model(self.parameters, checkpoint_path = None)
355
- for i in range(self.epochs):
356
- # some training logic
357
- loss = model.train(self.dataset)
358
- if i % 10 == 0:
359
- model.save(
360
- current.checkpoint.directory,
361
- )
362
- # saves the contents of the `current.checkpoint.directory` as a checkpoint
363
- # and returns a reference dictionary to the checkpoint saved in the datastore
364
- self.latest_checkpoint = current.checkpoint.save(
365
- name="epoch_checkpoint",
366
- metadata={
367
- "epoch": i,
368
- "loss": loss,
369
- }
370
- )
371
- ```
372
-
373
- - Using Loaded Checkpoints
374
-
375
- ```python
376
- @retry(times=3)
377
- @checkpoint
378
- @step
379
- def train(self):
380
- # Assume that the task has restarted and the previous attempt of the task
381
- # saved a checkpoint
382
- checkpoint_path = None
383
- if current.checkpoint.is_loaded: # Check if a checkpoint is loaded
384
- print("Loaded checkpoint from the previous attempt")
385
- checkpoint_path = current.checkpoint.directory
386
-
387
- model = create_model(self.parameters, checkpoint_path = checkpoint_path)
388
- for i in range(self.epochs):
389
- ...
390
- ```
245
+ Specifies secrets to be retrieved and injected as environment variables prior to
246
+ the execution of a step.
391
247
 
392
248
 
393
249
  Parameters
394
250
  ----------
395
- load_policy : str, default: "fresh"
396
- The policy for loading the checkpoint. The following policies are supported:
397
- - "eager": Loads the the latest available checkpoint within the namespace.
398
- With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
399
- will be loaded at the start of the task.
400
- - "none": Do not load any checkpoint
401
- - "fresh": Loads the lastest checkpoint created within the running Task.
402
- This mode helps loading checkpoints across various retry attempts of the same task.
403
- With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
404
- created within the task will be loaded when the task is retries execution on failure.
405
-
406
- temp_dir_root : str, default: None
407
- The root directory under which `current.checkpoint.directory` will be created.
408
- """
409
- ...
410
-
411
- @typing.overload
412
- def coreweave_s3_proxy(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
413
- """
414
- CoreWeave-specific S3 Proxy decorator for routing S3 requests through a local proxy service.
415
- It exists to make it easier for users to know that this decorator should only be used with
416
- a Neo Cloud like CoreWeave.
417
- """
418
- ...
419
-
420
- @typing.overload
421
- def coreweave_s3_proxy(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
422
- ...
423
-
424
- def coreweave_s3_proxy(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
425
- """
426
- CoreWeave-specific S3 Proxy decorator for routing S3 requests through a local proxy service.
427
- It exists to make it easier for users to know that this decorator should only be used with
428
- a Neo Cloud like CoreWeave.
251
+ sources : List[Union[str, Dict[str, Any]]], default: []
252
+ List of secret specs, defining how the secrets are to be retrieved
253
+ role : str, optional, default: None
254
+ Role to use for fetching secrets
429
255
  """
430
256
  ...
431
257
 
@@ -558,28 +384,7 @@ def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
558
384
  """
559
385
  ...
560
386
 
561
- @typing.overload
562
- def nebius_s3_proxy(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
563
- """
564
- Nebius-specific S3 Proxy decorator for routing S3 requests through a local proxy service.
565
- It exists to make it easier for users to know that this decorator should only be used with
566
- a Neo Cloud like Nebius.
567
- """
568
- ...
569
-
570
- @typing.overload
571
- def nebius_s3_proxy(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
572
- ...
573
-
574
- def nebius_s3_proxy(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
575
- """
576
- Nebius-specific S3 Proxy decorator for routing S3 requests through a local proxy service.
577
- It exists to make it easier for users to know that this decorator should only be used with
578
- a Neo Cloud like Nebius.
579
- """
580
- ...
581
-
582
- def nvidia(*, gpu: int, gpu_type: str, queue_timeout: int) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
387
+ def nvct(*, gpu: int, gpu_type: str) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
583
388
  """
584
389
  Specifies that this step should execute on DGX cloud.
585
390
 
@@ -590,27 +395,6 @@ def nvidia(*, gpu: int, gpu_type: str, queue_timeout: int) -> typing.Callable[[t
590
395
  Number of GPUs to use.
591
396
  gpu_type : str
592
397
  Type of Nvidia GPU to use.
593
- queue_timeout : int
594
- Time to keep the job in NVCF's queue.
595
- """
596
- ...
597
-
598
- @typing.overload
599
- def test_append_card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
600
- """
601
- A simple decorator that demonstrates using CardDecoratorInjector
602
- to inject a card and render simple markdown content.
603
- """
604
- ...
605
-
606
- @typing.overload
607
- def test_append_card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
608
- ...
609
-
610
- def test_append_card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
611
- """
612
- A simple decorator that demonstrates using CardDecoratorInjector
613
- to inject a card and render simple markdown content.
614
398
  """
615
399
  ...
616
400
 
@@ -753,57 +537,191 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
753
537
  """
754
538
  ...
755
539
 
540
+ def ollama(*, models: list, backend: str, force_pull: bool, cache_update_policy: str, force_cache_update: bool, debug: bool, circuit_breaker_config: dict, timeout_config: dict) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
541
+ """
542
+ This decorator is used to run Ollama APIs as Metaflow task sidecars.
543
+
544
+ User code call
545
+ --------------
546
+ @ollama(
547
+ models=[...],
548
+ ...
549
+ )
550
+
551
+ Valid backend options
552
+ ---------------------
553
+ - 'local': Run as a separate process on the local task machine.
554
+ - (TODO) 'managed': Outerbounds hosts and selects compute provider.
555
+ - (TODO) 'remote': Spin up separate instance to serve Ollama models.
556
+
557
+ Valid model options
558
+ -------------------
559
+ Any model here https://ollama.com/search, e.g. 'llama3.2', 'llama3.3'
560
+
561
+
562
+ Parameters
563
+ ----------
564
+ models: list[str]
565
+ List of Ollama containers running models in sidecars.
566
+ backend: str
567
+ Determines where and how to run the Ollama process.
568
+ force_pull: bool
569
+ Whether to run `ollama pull` no matter what, or first check the remote cache in Metaflow datastore for this model key.
570
+ cache_update_policy: str
571
+ Cache update policy: "auto", "force", or "never".
572
+ force_cache_update: bool
573
+ Simple override for "force" cache update policy.
574
+ debug: bool
575
+ Whether to turn on verbose debugging logs.
576
+ circuit_breaker_config: dict
577
+ Configuration for circuit breaker protection. Keys: failure_threshold, recovery_timeout, reset_timeout.
578
+ timeout_config: dict
579
+ Configuration for various operation timeouts. Keys: pull, stop, health_check, install, server_startup.
580
+ """
581
+ ...
582
+
583
+ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', image_pull_secrets: typing.List[str] = [], service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[typing.Dict[str, str]] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable', security_context: typing.Optional[typing.Dict[str, typing.Any]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
584
+ """
585
+ Specifies that this step should execute on Kubernetes.
586
+
587
+
588
+ Parameters
589
+ ----------
590
+ cpu : int, default 1
591
+ Number of CPUs required for this step. If `@resources` is
592
+ also present, the maximum value from all decorators is used.
593
+ memory : int, default 4096
594
+ Memory size (in MB) required for this step. If
595
+ `@resources` is also present, the maximum value from all decorators is
596
+ used.
597
+ disk : int, default 10240
598
+ Disk size (in MB) required for this step. If
599
+ `@resources` is also present, the maximum value from all decorators is
600
+ used.
601
+ image : str, optional, default None
602
+ Docker image to use when launching on Kubernetes. If not specified, and
603
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
604
+ not, a default Docker image mapping to the current version of Python is used.
605
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
606
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
607
+ image_pull_secrets: List[str], default []
608
+ The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
609
+ Kubernetes image pull secrets to use when pulling container images
610
+ in Kubernetes.
611
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
612
+ Kubernetes service account to use when launching pod in Kubernetes.
613
+ secrets : List[str], optional, default None
614
+ Kubernetes secrets to use when launching pod in Kubernetes. These
615
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
616
+ in Metaflow configuration.
617
+ node_selector: Union[Dict[str,str], str], optional, default None
618
+ Kubernetes node selector(s) to apply to the pod running the task.
619
+ Can be passed in as a comma separated string of values e.g.
620
+ 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
621
+ {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
622
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
623
+ Kubernetes namespace to use when launching pod in Kubernetes.
624
+ gpu : int, optional, default None
625
+ Number of GPUs required for this step. A value of zero implies that
626
+ the scheduled node should not have GPUs.
627
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
628
+ The vendor of the GPUs to be used for this step.
629
+ tolerations : List[Dict[str,str]], default []
630
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
631
+ Kubernetes tolerations to use when launching pod in Kubernetes.
632
+ labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
633
+ Kubernetes labels to use when launching pod in Kubernetes.
634
+ annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
635
+ Kubernetes annotations to use when launching pod in Kubernetes.
636
+ use_tmpfs : bool, default False
637
+ This enables an explicit tmpfs mount for this step.
638
+ tmpfs_tempdir : bool, default True
639
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
640
+ tmpfs_size : int, optional, default: None
641
+ The value for the size (in MiB) of the tmpfs mount for this step.
642
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
643
+ memory allocated for this step.
644
+ tmpfs_path : str, optional, default /metaflow_temp
645
+ Path to tmpfs mount for this step.
646
+ persistent_volume_claims : Dict[str, str], optional, default None
647
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
648
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
649
+ shared_memory: int, optional
650
+ Shared memory size (in MiB) required for this step
651
+ port: int, optional
652
+ Port number to specify in the Kubernetes job object
653
+ compute_pool : str, optional, default None
654
+ Compute pool to be used for for this step.
655
+ If not specified, any accessible compute pool within the perimeter is used.
656
+ hostname_resolution_timeout: int, default 10 * 60
657
+ Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
658
+ Only applicable when @parallel is used.
659
+ qos: str, default: Burstable
660
+ Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
661
+
662
+ security_context: Dict[str, Any], optional, default None
663
+ Container security context. Applies to the task container. Allows the following keys:
664
+ - privileged: bool, optional, default None
665
+ - allow_privilege_escalation: bool, optional, default None
666
+ - run_as_user: int, optional, default None
667
+ - run_as_group: int, optional, default None
668
+ - run_as_non_root: bool, optional, default None
669
+ """
670
+ ...
671
+
756
672
  @typing.overload
757
- def card(*, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
673
+ def pypi(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
758
674
  """
759
- Creates a human-readable report, a Metaflow Card, after this step completes.
675
+ Specifies the PyPI packages for the step.
760
676
 
761
- Note that you may add multiple `@card` decorators in a step with different parameters.
677
+ Information in this decorator will augment any
678
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
679
+ you can use `@pypi_base` to set packages required by all
680
+ steps and use `@pypi` to specify step-specific overrides.
762
681
 
763
682
 
764
683
  Parameters
765
684
  ----------
766
- type : str, default 'default'
767
- Card type.
768
- id : str, optional, default None
769
- If multiple cards are present, use this id to identify this card.
770
- options : Dict[str, Any], default {}
771
- Options passed to the card. The contents depend on the card type.
772
- timeout : int, default 45
773
- Interrupt reporting if it takes more than this many seconds.
685
+ packages : Dict[str, str], default: {}
686
+ Packages to use for this step. The key is the name of the package
687
+ and the value is the version to use.
688
+ python : str, optional, default: None
689
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
690
+ that the version used will correspond to the version of the Python interpreter used to start the run.
774
691
  """
775
692
  ...
776
693
 
777
694
  @typing.overload
778
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
695
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
779
696
  ...
780
697
 
781
698
  @typing.overload
782
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
699
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
783
700
  ...
784
701
 
785
- def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
702
+ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
786
703
  """
787
- Creates a human-readable report, a Metaflow Card, after this step completes.
704
+ Specifies the PyPI packages for the step.
788
705
 
789
- Note that you may add multiple `@card` decorators in a step with different parameters.
706
+ Information in this decorator will augment any
707
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
708
+ you can use `@pypi_base` to set packages required by all
709
+ steps and use `@pypi` to specify step-specific overrides.
790
710
 
791
711
 
792
712
  Parameters
793
713
  ----------
794
- type : str, default 'default'
795
- Card type.
796
- id : str, optional, default None
797
- If multiple cards are present, use this id to identify this card.
798
- options : Dict[str, Any], default {}
799
- Options passed to the card. The contents depend on the card type.
800
- timeout : int, default 45
801
- Interrupt reporting if it takes more than this many seconds.
714
+ packages : Dict[str, str], default: {}
715
+ Packages to use for this step. The key is the name of the package
716
+ and the value is the version to use.
717
+ python : str, optional, default: None
718
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
719
+ that the version used will correspond to the version of the Python interpreter used to start the run.
802
720
  """
803
721
  ...
804
722
 
805
723
  @typing.overload
806
- def app_deploy(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
724
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
807
725
  """
808
726
  Decorator prototype for all step decorators. This function gets specialized
809
727
  and imported for all decorators types by _import_plugin_decorators().
@@ -811,10 +729,10 @@ def app_deploy(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.
811
729
  ...
812
730
 
813
731
  @typing.overload
814
- def app_deploy(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
732
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
815
733
  ...
816
734
 
817
- def app_deploy(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
735
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
818
736
  """
819
737
  Decorator prototype for all step decorators. This function gets specialized
820
738
  and imported for all decorators types by _import_plugin_decorators().
@@ -822,125 +740,116 @@ def app_deploy(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None
822
740
  ...
823
741
 
824
742
  @typing.overload
825
- def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
743
+ def test_append_card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
826
744
  """
827
- Specifies secrets to be retrieved and injected as environment variables prior to
828
- the execution of a step.
829
-
830
-
831
- Parameters
832
- ----------
833
- sources : List[Union[str, Dict[str, Any]]], default: []
834
- List of secret specs, defining how the secrets are to be retrieved
835
- role : str, optional, default: None
836
- Role to use for fetching secrets
745
+ A simple decorator that demonstrates using CardDecoratorInjector
746
+ to inject a card and render simple markdown content.
837
747
  """
838
748
  ...
839
749
 
840
750
  @typing.overload
841
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
751
+ def test_append_card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
842
752
  ...
843
753
 
844
- @typing.overload
845
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
754
+ def test_append_card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
755
+ """
756
+ A simple decorator that demonstrates using CardDecoratorInjector
757
+ to inject a card and render simple markdown content.
758
+ """
846
759
  ...
847
760
 
848
- def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None):
761
+ @typing.overload
762
+ def nebius_s3_proxy(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
849
763
  """
850
- Specifies secrets to be retrieved and injected as environment variables prior to
851
- the execution of a step.
852
-
853
-
854
- Parameters
855
- ----------
856
- sources : List[Union[str, Dict[str, Any]]], default: []
857
- List of secret specs, defining how the secrets are to be retrieved
858
- role : str, optional, default: None
859
- Role to use for fetching secrets
764
+ Nebius-specific S3 Proxy decorator for routing S3 requests through a local proxy service.
765
+ It exists to make it easier for users to know that this decorator should only be used with
766
+ a Neo Cloud like Nebius.
860
767
  """
861
768
  ...
862
769
 
863
770
  @typing.overload
864
- def catch(*, var: typing.Optional[str] = None, print_exception: bool = True) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
771
+ def nebius_s3_proxy(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
772
+ ...
773
+
774
+ def nebius_s3_proxy(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
865
775
  """
866
- Specifies that the step will success under all circumstances.
776
+ Nebius-specific S3 Proxy decorator for routing S3 requests through a local proxy service.
777
+ It exists to make it easier for users to know that this decorator should only be used with
778
+ a Neo Cloud like Nebius.
779
+ """
780
+ ...
781
+
782
+ @typing.overload
783
+ def retry(*, times: int = 3, minutes_between_retries: int = 2) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
784
+ """
785
+ Specifies the number of times the task corresponding
786
+ to a step needs to be retried.
867
787
 
868
- The decorator will create an optional artifact, specified by `var`, which
869
- contains the exception raised. You can use it to detect the presence
870
- of errors, indicating that all happy-path artifacts produced by the step
871
- are missing.
788
+ This decorator is useful for handling transient errors, such as networking issues.
789
+ If your task contains operations that can't be retried safely, e.g. database updates,
790
+ it is advisable to annotate it with `@retry(times=0)`.
791
+
792
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
793
+ decorator will execute a no-op task after all retries have been exhausted,
794
+ ensuring that the flow execution can continue.
872
795
 
873
796
 
874
797
  Parameters
875
798
  ----------
876
- var : str, optional, default None
877
- Name of the artifact in which to store the caught exception.
878
- If not specified, the exception is not stored.
879
- print_exception : bool, default True
880
- Determines whether or not the exception is printed to
881
- stdout when caught.
799
+ times : int, default 3
800
+ Number of times to retry this task.
801
+ minutes_between_retries : int, default 2
802
+ Number of minutes between retries.
882
803
  """
883
804
  ...
884
805
 
885
806
  @typing.overload
886
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
807
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
887
808
  ...
888
809
 
889
810
  @typing.overload
890
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
811
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
891
812
  ...
892
813
 
893
- def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
814
+ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
894
815
  """
895
- Specifies that the step will success under all circumstances.
816
+ Specifies the number of times the task corresponding
817
+ to a step needs to be retried.
896
818
 
897
- The decorator will create an optional artifact, specified by `var`, which
898
- contains the exception raised. You can use it to detect the presence
899
- of errors, indicating that all happy-path artifacts produced by the step
900
- are missing.
819
+ This decorator is useful for handling transient errors, such as networking issues.
820
+ If your task contains operations that can't be retried safely, e.g. database updates,
821
+ it is advisable to annotate it with `@retry(times=0)`.
822
+
823
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
824
+ decorator will execute a no-op task after all retries have been exhausted,
825
+ ensuring that the flow execution can continue.
901
826
 
902
827
 
903
828
  Parameters
904
829
  ----------
905
- var : str, optional, default None
906
- Name of the artifact in which to store the caught exception.
907
- If not specified, the exception is not stored.
908
- print_exception : bool, default True
909
- Determines whether or not the exception is printed to
910
- stdout when caught.
830
+ times : int, default 3
831
+ Number of times to retry this task.
832
+ minutes_between_retries : int, default 2
833
+ Number of minutes between retries.
911
834
  """
912
835
  ...
913
836
 
914
837
  @typing.overload
915
- def environment(*, vars: typing.Dict[str, str] = {}) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
838
+ def app_deploy(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
916
839
  """
917
- Specifies environment variables to be set prior to the execution of a step.
918
-
919
-
920
- Parameters
921
- ----------
922
- vars : Dict[str, str], default {}
923
- Dictionary of environment variables to set.
840
+ Decorator prototype for all step decorators. This function gets specialized
841
+ and imported for all decorators types by _import_plugin_decorators().
924
842
  """
925
843
  ...
926
844
 
927
845
  @typing.overload
928
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
929
- ...
930
-
931
- @typing.overload
932
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
846
+ def app_deploy(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
933
847
  ...
934
848
 
935
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
849
+ def app_deploy(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
936
850
  """
937
- Specifies environment variables to be set prior to the execution of a step.
938
-
939
-
940
- Parameters
941
- ----------
942
- vars : Dict[str, str], default {}
943
- Dictionary of environment variables to set.
851
+ Decorator prototype for all step decorators. This function gets specialized
852
+ and imported for all decorators types by _import_plugin_decorators().
944
853
  """
945
854
  ...
946
855
 
@@ -1003,94 +912,155 @@ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
1003
912
  """
1004
913
  ...
1005
914
 
1006
- def nvct(*, gpu: int, gpu_type: str) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
915
+ @typing.overload
916
+ def checkpoint(*, load_policy: str = 'fresh', temp_dir_root: str = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1007
917
  """
1008
- Specifies that this step should execute on DGX cloud.
918
+ Enables checkpointing for a step.
1009
919
 
920
+ > Examples
1010
921
 
1011
- Parameters
1012
- ----------
1013
- gpu : int
1014
- Number of GPUs to use.
1015
- gpu_type : str
1016
- Type of Nvidia GPU to use.
1017
- """
1018
- ...
1019
-
1020
- @typing.overload
1021
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1022
- """
1023
- Internal decorator to support Fast bakery
1024
- """
1025
- ...
1026
-
1027
- @typing.overload
1028
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1029
- ...
1030
-
1031
- def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
1032
- """
1033
- Internal decorator to support Fast bakery
1034
- """
1035
- ...
1036
-
1037
- @typing.overload
1038
- def retry(*, times: int = 3, minutes_between_retries: int = 2) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1039
- """
1040
- Specifies the number of times the task corresponding
1041
- to a step needs to be retried.
922
+ - Saving Checkpoints
1042
923
 
1043
- This decorator is useful for handling transient errors, such as networking issues.
1044
- If your task contains operations that can't be retried safely, e.g. database updates,
1045
- it is advisable to annotate it with `@retry(times=0)`.
924
+ ```python
925
+ @checkpoint
926
+ @step
927
+ def train(self):
928
+ model = create_model(self.parameters, checkpoint_path = None)
929
+ for i in range(self.epochs):
930
+ # some training logic
931
+ loss = model.train(self.dataset)
932
+ if i % 10 == 0:
933
+ model.save(
934
+ current.checkpoint.directory,
935
+ )
936
+ # saves the contents of the `current.checkpoint.directory` as a checkpoint
937
+ # and returns a reference dictionary to the checkpoint saved in the datastore
938
+ self.latest_checkpoint = current.checkpoint.save(
939
+ name="epoch_checkpoint",
940
+ metadata={
941
+ "epoch": i,
942
+ "loss": loss,
943
+ }
944
+ )
945
+ ```
1046
946
 
1047
- This can be used in conjunction with the `@catch` decorator. The `@catch`
1048
- decorator will execute a no-op task after all retries have been exhausted,
1049
- ensuring that the flow execution can continue.
947
+ - Using Loaded Checkpoints
948
+
949
+ ```python
950
+ @retry(times=3)
951
+ @checkpoint
952
+ @step
953
+ def train(self):
954
+ # Assume that the task has restarted and the previous attempt of the task
955
+ # saved a checkpoint
956
+ checkpoint_path = None
957
+ if current.checkpoint.is_loaded: # Check if a checkpoint is loaded
958
+ print("Loaded checkpoint from the previous attempt")
959
+ checkpoint_path = current.checkpoint.directory
960
+
961
+ model = create_model(self.parameters, checkpoint_path = checkpoint_path)
962
+ for i in range(self.epochs):
963
+ ...
964
+ ```
1050
965
 
1051
966
 
1052
967
  Parameters
1053
968
  ----------
1054
- times : int, default 3
1055
- Number of times to retry this task.
1056
- minutes_between_retries : int, default 2
1057
- Number of minutes between retries.
969
+ load_policy : str, default: "fresh"
970
+ The policy for loading the checkpoint. The following policies are supported:
971
+ - "eager": Loads the the latest available checkpoint within the namespace.
972
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
973
+ will be loaded at the start of the task.
974
+ - "none": Do not load any checkpoint
975
+ - "fresh": Loads the lastest checkpoint created within the running Task.
976
+ This mode helps loading checkpoints across various retry attempts of the same task.
977
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
978
+ created within the task will be loaded when the task is retries execution on failure.
979
+
980
+ temp_dir_root : str, default: None
981
+ The root directory under which `current.checkpoint.directory` will be created.
1058
982
  """
1059
983
  ...
1060
984
 
1061
985
  @typing.overload
1062
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
986
+ def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1063
987
  ...
1064
988
 
1065
989
  @typing.overload
1066
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
990
+ def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1067
991
  ...
1068
992
 
1069
- def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
993
+ def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load_policy: str = 'fresh', temp_dir_root: str = None):
1070
994
  """
1071
- Specifies the number of times the task corresponding
1072
- to a step needs to be retried.
995
+ Enables checkpointing for a step.
1073
996
 
1074
- This decorator is useful for handling transient errors, such as networking issues.
1075
- If your task contains operations that can't be retried safely, e.g. database updates,
1076
- it is advisable to annotate it with `@retry(times=0)`.
997
+ > Examples
1077
998
 
1078
- This can be used in conjunction with the `@catch` decorator. The `@catch`
1079
- decorator will execute a no-op task after all retries have been exhausted,
1080
- ensuring that the flow execution can continue.
999
+ - Saving Checkpoints
1081
1000
 
1001
+ ```python
1002
+ @checkpoint
1003
+ @step
1004
+ def train(self):
1005
+ model = create_model(self.parameters, checkpoint_path = None)
1006
+ for i in range(self.epochs):
1007
+ # some training logic
1008
+ loss = model.train(self.dataset)
1009
+ if i % 10 == 0:
1010
+ model.save(
1011
+ current.checkpoint.directory,
1012
+ )
1013
+ # saves the contents of the `current.checkpoint.directory` as a checkpoint
1014
+ # and returns a reference dictionary to the checkpoint saved in the datastore
1015
+ self.latest_checkpoint = current.checkpoint.save(
1016
+ name="epoch_checkpoint",
1017
+ metadata={
1018
+ "epoch": i,
1019
+ "loss": loss,
1020
+ }
1021
+ )
1022
+ ```
1082
1023
 
1083
- Parameters
1084
- ----------
1085
- times : int, default 3
1086
- Number of times to retry this task.
1087
- minutes_between_retries : int, default 2
1088
- Number of minutes between retries.
1089
- """
1090
- ...
1091
-
1092
- def s3_proxy(*, integration_name: typing.Optional[str] = None, write_mode: typing.Optional[str] = None, debug: typing.Optional[bool] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1093
- """
1024
+ - Using Loaded Checkpoints
1025
+
1026
+ ```python
1027
+ @retry(times=3)
1028
+ @checkpoint
1029
+ @step
1030
+ def train(self):
1031
+ # Assume that the task has restarted and the previous attempt of the task
1032
+ # saved a checkpoint
1033
+ checkpoint_path = None
1034
+ if current.checkpoint.is_loaded: # Check if a checkpoint is loaded
1035
+ print("Loaded checkpoint from the previous attempt")
1036
+ checkpoint_path = current.checkpoint.directory
1037
+
1038
+ model = create_model(self.parameters, checkpoint_path = checkpoint_path)
1039
+ for i in range(self.epochs):
1040
+ ...
1041
+ ```
1042
+
1043
+
1044
+ Parameters
1045
+ ----------
1046
+ load_policy : str, default: "fresh"
1047
+ The policy for loading the checkpoint. The following policies are supported:
1048
+ - "eager": Loads the the latest available checkpoint within the namespace.
1049
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
1050
+ will be loaded at the start of the task.
1051
+ - "none": Do not load any checkpoint
1052
+ - "fresh": Loads the lastest checkpoint created within the running Task.
1053
+ This mode helps loading checkpoints across various retry attempts of the same task.
1054
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
1055
+ created within the task will be loaded when the task is retries execution on failure.
1056
+
1057
+ temp_dir_root : str, default: None
1058
+ The root directory under which `current.checkpoint.directory` will be created.
1059
+ """
1060
+ ...
1061
+
1062
+ def s3_proxy(*, integration_name: typing.Optional[str] = None, write_mode: typing.Optional[str] = None, debug: typing.Optional[bool] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1063
+ """
1094
1064
  S3 Proxy decorator for routing S3 requests through a local proxy service.
1095
1065
 
1096
1066
 
@@ -1111,142 +1081,71 @@ def s3_proxy(*, integration_name: typing.Optional[str] = None, write_mode: typin
1111
1081
  """
1112
1082
  ...
1113
1083
 
1114
- def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', image_pull_secrets: typing.List[str] = [], service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[typing.Dict[str, str]] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable', security_context: typing.Optional[typing.Dict[str, typing.Any]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1084
+ @typing.overload
1085
+ def catch(*, var: typing.Optional[str] = None, print_exception: bool = True) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1115
1086
  """
1116
- Specifies that this step should execute on Kubernetes.
1087
+ Specifies that the step will success under all circumstances.
1088
+
1089
+ The decorator will create an optional artifact, specified by `var`, which
1090
+ contains the exception raised. You can use it to detect the presence
1091
+ of errors, indicating that all happy-path artifacts produced by the step
1092
+ are missing.
1117
1093
 
1118
1094
 
1119
1095
  Parameters
1120
1096
  ----------
1121
- cpu : int, default 1
1122
- Number of CPUs required for this step. If `@resources` is
1123
- also present, the maximum value from all decorators is used.
1124
- memory : int, default 4096
1125
- Memory size (in MB) required for this step. If
1126
- `@resources` is also present, the maximum value from all decorators is
1127
- used.
1128
- disk : int, default 10240
1129
- Disk size (in MB) required for this step. If
1130
- `@resources` is also present, the maximum value from all decorators is
1131
- used.
1132
- image : str, optional, default None
1133
- Docker image to use when launching on Kubernetes. If not specified, and
1134
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
1135
- not, a default Docker image mapping to the current version of Python is used.
1136
- image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
1137
- If given, the imagePullPolicy to be applied to the Docker image of the step.
1138
- image_pull_secrets: List[str], default []
1139
- The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
1140
- Kubernetes image pull secrets to use when pulling container images
1141
- in Kubernetes.
1142
- service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
1143
- Kubernetes service account to use when launching pod in Kubernetes.
1144
- secrets : List[str], optional, default None
1145
- Kubernetes secrets to use when launching pod in Kubernetes. These
1146
- secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
1147
- in Metaflow configuration.
1148
- node_selector: Union[Dict[str,str], str], optional, default None
1149
- Kubernetes node selector(s) to apply to the pod running the task.
1150
- Can be passed in as a comma separated string of values e.g.
1151
- 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
1152
- {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
1153
- namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
1154
- Kubernetes namespace to use when launching pod in Kubernetes.
1155
- gpu : int, optional, default None
1156
- Number of GPUs required for this step. A value of zero implies that
1157
- the scheduled node should not have GPUs.
1158
- gpu_vendor : str, default KUBERNETES_GPU_VENDOR
1159
- The vendor of the GPUs to be used for this step.
1160
- tolerations : List[Dict[str,str]], default []
1161
- The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
1162
- Kubernetes tolerations to use when launching pod in Kubernetes.
1163
- labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
1164
- Kubernetes labels to use when launching pod in Kubernetes.
1165
- annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
1166
- Kubernetes annotations to use when launching pod in Kubernetes.
1167
- use_tmpfs : bool, default False
1168
- This enables an explicit tmpfs mount for this step.
1169
- tmpfs_tempdir : bool, default True
1170
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
1171
- tmpfs_size : int, optional, default: None
1172
- The value for the size (in MiB) of the tmpfs mount for this step.
1173
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
1174
- memory allocated for this step.
1175
- tmpfs_path : str, optional, default /metaflow_temp
1176
- Path to tmpfs mount for this step.
1177
- persistent_volume_claims : Dict[str, str], optional, default None
1178
- A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
1179
- volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
1180
- shared_memory: int, optional
1181
- Shared memory size (in MiB) required for this step
1182
- port: int, optional
1183
- Port number to specify in the Kubernetes job object
1184
- compute_pool : str, optional, default None
1185
- Compute pool to be used for for this step.
1186
- If not specified, any accessible compute pool within the perimeter is used.
1187
- hostname_resolution_timeout: int, default 10 * 60
1188
- Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
1189
- Only applicable when @parallel is used.
1190
- qos: str, default: Burstable
1191
- Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
1192
-
1193
- security_context: Dict[str, Any], optional, default None
1194
- Container security context. Applies to the task container. Allows the following keys:
1195
- - privileged: bool, optional, default None
1196
- - allow_privilege_escalation: bool, optional, default None
1197
- - run_as_user: int, optional, default None
1198
- - run_as_group: int, optional, default None
1199
- - run_as_non_root: bool, optional, default None
1097
+ var : str, optional, default None
1098
+ Name of the artifact in which to store the caught exception.
1099
+ If not specified, the exception is not stored.
1100
+ print_exception : bool, default True
1101
+ Determines whether or not the exception is printed to
1102
+ stdout when caught.
1200
1103
  """
1201
1104
  ...
1202
1105
 
1203
- def vllm(*, model: str, backend: str, openai_api_server: bool, debug: bool, card_refresh_interval: int, max_retries: int, retry_alert_frequency: int, engine_args: dict) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1106
+ @typing.overload
1107
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1108
+ ...
1109
+
1110
+ @typing.overload
1111
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1112
+ ...
1113
+
1114
+ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
1204
1115
  """
1205
- This decorator is used to run vllm APIs as Metaflow task sidecars.
1206
-
1207
- User code call
1208
- --------------
1209
- @vllm(
1210
- model="...",
1211
- ...
1212
- )
1213
-
1214
- Valid backend options
1215
- ---------------------
1216
- - 'local': Run as a separate process on the local task machine.
1217
-
1218
- Valid model options
1219
- -------------------
1220
- Any HuggingFace model identifier, e.g. 'meta-llama/Llama-3.2-1B'
1116
+ Specifies that the step will success under all circumstances.
1221
1117
 
1222
- NOTE: vLLM's OpenAI-compatible server serves ONE model per server instance.
1223
- If you need multiple models, you must create multiple @vllm decorators.
1118
+ The decorator will create an optional artifact, specified by `var`, which
1119
+ contains the exception raised. You can use it to detect the presence
1120
+ of errors, indicating that all happy-path artifacts produced by the step
1121
+ are missing.
1224
1122
 
1225
1123
 
1226
1124
  Parameters
1227
1125
  ----------
1228
- model: str
1229
- HuggingFace model identifier to be served by vLLM.
1230
- backend: str
1231
- Determines where and how to run the vLLM process.
1232
- openai_api_server: bool
1233
- Whether to use OpenAI-compatible API server mode (subprocess) instead of native engine.
1234
- Default is False (uses native engine).
1235
- Set to True for backward compatibility with existing code.
1236
- debug: bool
1237
- Whether to turn on verbose debugging logs.
1238
- card_refresh_interval: int
1239
- Interval in seconds for refreshing the vLLM status card.
1240
- Only used when openai_api_server=True.
1241
- max_retries: int
1242
- Maximum number of retries checking for vLLM server startup.
1243
- Only used when openai_api_server=True.
1244
- retry_alert_frequency: int
1245
- Frequency of alert logs for vLLM server startup retries.
1246
- Only used when openai_api_server=True.
1247
- engine_args : dict
1248
- Additional keyword arguments to pass to the vLLM engine.
1249
- For example, `tensor_parallel_size=2`.
1126
+ var : str, optional, default None
1127
+ Name of the artifact in which to store the caught exception.
1128
+ If not specified, the exception is not stored.
1129
+ print_exception : bool, default True
1130
+ Determines whether or not the exception is printed to
1131
+ stdout when caught.
1132
+ """
1133
+ ...
1134
+
1135
+ @typing.overload
1136
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1137
+ """
1138
+ Internal decorator to support Fast bakery
1139
+ """
1140
+ ...
1141
+
1142
+ @typing.overload
1143
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1144
+ ...
1145
+
1146
+ def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
1147
+ """
1148
+ Internal decorator to support Fast bakery
1250
1149
  """
1251
1150
  ...
1252
1151
 
@@ -1330,125 +1229,439 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
1330
1229
  ...
1331
1230
 
1332
1231
  @typing.overload
1333
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1232
+ def card(*, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1334
1233
  """
1335
- Decorator prototype for all step decorators. This function gets specialized
1336
- and imported for all decorators types by _import_plugin_decorators().
1234
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1235
+
1236
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1237
+
1238
+
1239
+ Parameters
1240
+ ----------
1241
+ type : str, default 'default'
1242
+ Card type.
1243
+ id : str, optional, default None
1244
+ If multiple cards are present, use this id to identify this card.
1245
+ options : Dict[str, Any], default {}
1246
+ Options passed to the card. The contents depend on the card type.
1247
+ timeout : int, default 45
1248
+ Interrupt reporting if it takes more than this many seconds.
1337
1249
  """
1338
1250
  ...
1339
1251
 
1340
1252
  @typing.overload
1341
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1253
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1342
1254
  ...
1343
1255
 
1344
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
1345
- """
1346
- Decorator prototype for all step decorators. This function gets specialized
1347
- and imported for all decorators types by _import_plugin_decorators().
1348
- """
1256
+ @typing.overload
1257
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1349
1258
  ...
1350
1259
 
1351
- @typing.overload
1352
- def trigger_on_finish(*, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1260
+ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
1353
1261
  """
1354
- Specifies the flow(s) that this flow depends on.
1262
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1355
1263
 
1356
- ```
1357
- @trigger_on_finish(flow='FooFlow')
1358
- ```
1359
- or
1360
- ```
1361
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1362
- ```
1363
- This decorator respects the @project decorator and triggers the flow
1364
- when upstream runs within the same namespace complete successfully
1264
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1265
+
1266
+
1267
+ Parameters
1268
+ ----------
1269
+ type : str, default 'default'
1270
+ Card type.
1271
+ id : str, optional, default None
1272
+ If multiple cards are present, use this id to identify this card.
1273
+ options : Dict[str, Any], default {}
1274
+ Options passed to the card. The contents depend on the card type.
1275
+ timeout : int, default 45
1276
+ Interrupt reporting if it takes more than this many seconds.
1277
+ """
1278
+ ...
1279
+
1280
+ @typing.overload
1281
+ def coreweave_s3_proxy(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1282
+ """
1283
+ CoreWeave-specific S3 Proxy decorator for routing S3 requests through a local proxy service.
1284
+ It exists to make it easier for users to know that this decorator should only be used with
1285
+ a Neo Cloud like CoreWeave.
1286
+ """
1287
+ ...
1288
+
1289
+ @typing.overload
1290
+ def coreweave_s3_proxy(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1291
+ ...
1292
+
1293
+ def coreweave_s3_proxy(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
1294
+ """
1295
+ CoreWeave-specific S3 Proxy decorator for routing S3 requests through a local proxy service.
1296
+ It exists to make it easier for users to know that this decorator should only be used with
1297
+ a Neo Cloud like CoreWeave.
1298
+ """
1299
+ ...
1300
+
1301
+ def vllm(*, model: str, backend: str, openai_api_server: bool, debug: bool, card_refresh_interval: int, max_retries: int, retry_alert_frequency: int, engine_args: dict) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1302
+ """
1303
+ This decorator is used to run vllm APIs as Metaflow task sidecars.
1304
+
1305
+ User code call
1306
+ --------------
1307
+ @vllm(
1308
+ model="...",
1309
+ ...
1310
+ )
1311
+
1312
+ Valid backend options
1313
+ ---------------------
1314
+ - 'local': Run as a separate process on the local task machine.
1315
+
1316
+ Valid model options
1317
+ -------------------
1318
+ Any HuggingFace model identifier, e.g. 'meta-llama/Llama-3.2-1B'
1319
+
1320
+ NOTE: vLLM's OpenAI-compatible server serves ONE model per server instance.
1321
+ If you need multiple models, you must create multiple @vllm decorators.
1322
+
1323
+
1324
+ Parameters
1325
+ ----------
1326
+ model: str
1327
+ HuggingFace model identifier to be served by vLLM.
1328
+ backend: str
1329
+ Determines where and how to run the vLLM process.
1330
+ openai_api_server: bool
1331
+ Whether to use OpenAI-compatible API server mode (subprocess) instead of native engine.
1332
+ Default is False (uses native engine).
1333
+ Set to True for backward compatibility with existing code.
1334
+ debug: bool
1335
+ Whether to turn on verbose debugging logs.
1336
+ card_refresh_interval: int
1337
+ Interval in seconds for refreshing the vLLM status card.
1338
+ Only used when openai_api_server=True.
1339
+ max_retries: int
1340
+ Maximum number of retries checking for vLLM server startup.
1341
+ Only used when openai_api_server=True.
1342
+ retry_alert_frequency: int
1343
+ Frequency of alert logs for vLLM server startup retries.
1344
+ Only used when openai_api_server=True.
1345
+ engine_args : dict
1346
+ Additional keyword arguments to pass to the vLLM engine.
1347
+ For example, `tensor_parallel_size=2`.
1348
+ """
1349
+ ...
1350
+
1351
+ @typing.overload
1352
+ def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1353
+ """
1354
+ Specifies the event(s) that this flow depends on.
1365
1355
 
1366
- Additionally, you can specify project aware upstream flow dependencies
1367
- by specifying the fully qualified project_flow_name.
1368
1356
  ```
1369
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1357
+ @trigger(event='foo')
1370
1358
  ```
1371
1359
  or
1372
1360
  ```
1373
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1361
+ @trigger(events=['foo', 'bar'])
1374
1362
  ```
1375
1363
 
1376
- You can also specify just the project or project branch (other values will be
1377
- inferred from the current project or project branch):
1364
+ Additionally, you can specify the parameter mappings
1365
+ to map event payload to Metaflow parameters for the flow.
1378
1366
  ```
1379
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1367
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1368
+ ```
1369
+ or
1370
+ ```
1371
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1372
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1380
1373
  ```
1381
1374
 
1382
- Note that `branch` is typically one of:
1383
- - `prod`
1384
- - `user.bob`
1385
- - `test.my_experiment`
1386
- - `prod.staging`
1375
+ 'parameters' can also be a list of strings and tuples like so:
1376
+ ```
1377
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1378
+ ```
1379
+ This is equivalent to:
1380
+ ```
1381
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1382
+ ```
1387
1383
 
1388
1384
 
1389
1385
  Parameters
1390
1386
  ----------
1391
- flow : Union[str, Dict[str, str]], optional, default None
1392
- Upstream flow dependency for this flow.
1393
- flows : List[Union[str, Dict[str, str]]], default []
1394
- Upstream flow dependencies for this flow.
1387
+ event : Union[str, Dict[str, Any]], optional, default None
1388
+ Event dependency for this flow.
1389
+ events : List[Union[str, Dict[str, Any]]], default []
1390
+ Events dependency for this flow.
1395
1391
  options : Dict[str, Any], default {}
1396
1392
  Backend-specific configuration for tuning eventing behavior.
1397
1393
  """
1398
1394
  ...
1399
1395
 
1400
1396
  @typing.overload
1401
- def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1397
+ def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1402
1398
  ...
1403
1399
 
1404
- def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}):
1400
+ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
1405
1401
  """
1406
- Specifies the flow(s) that this flow depends on.
1402
+ Specifies the event(s) that this flow depends on.
1407
1403
 
1408
1404
  ```
1409
- @trigger_on_finish(flow='FooFlow')
1405
+ @trigger(event='foo')
1410
1406
  ```
1411
1407
  or
1412
1408
  ```
1413
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1409
+ @trigger(events=['foo', 'bar'])
1414
1410
  ```
1415
- This decorator respects the @project decorator and triggers the flow
1416
- when upstream runs within the same namespace complete successfully
1417
1411
 
1418
- Additionally, you can specify project aware upstream flow dependencies
1419
- by specifying the fully qualified project_flow_name.
1412
+ Additionally, you can specify the parameter mappings
1413
+ to map event payload to Metaflow parameters for the flow.
1420
1414
  ```
1421
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1415
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1422
1416
  ```
1423
1417
  or
1424
1418
  ```
1425
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1419
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1420
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1426
1421
  ```
1427
1422
 
1428
- You can also specify just the project or project branch (other values will be
1429
- inferred from the current project or project branch):
1423
+ 'parameters' can also be a list of strings and tuples like so:
1430
1424
  ```
1431
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1425
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1426
+ ```
1427
+ This is equivalent to:
1428
+ ```
1429
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1432
1430
  ```
1433
-
1434
- Note that `branch` is typically one of:
1435
- - `prod`
1436
- - `user.bob`
1437
- - `test.my_experiment`
1438
- - `prod.staging`
1439
1431
 
1440
1432
 
1441
1433
  Parameters
1442
1434
  ----------
1443
- flow : Union[str, Dict[str, str]], optional, default None
1444
- Upstream flow dependency for this flow.
1445
- flows : List[Union[str, Dict[str, str]]], default []
1446
- Upstream flow dependencies for this flow.
1435
+ event : Union[str, Dict[str, Any]], optional, default None
1436
+ Event dependency for this flow.
1437
+ events : List[Union[str, Dict[str, Any]]], default []
1438
+ Events dependency for this flow.
1447
1439
  options : Dict[str, Any], default {}
1448
1440
  Backend-specific configuration for tuning eventing behavior.
1449
1441
  """
1450
1442
  ...
1451
1443
 
1444
+ @typing.overload
1445
+ def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1446
+ """
1447
+ Specifies the Conda environment for all steps of the flow.
1448
+
1449
+ Use `@conda_base` to set common libraries required by all
1450
+ steps and use `@conda` to specify step-specific additions.
1451
+
1452
+
1453
+ Parameters
1454
+ ----------
1455
+ packages : Dict[str, str], default {}
1456
+ Packages to use for this flow. The key is the name of the package
1457
+ and the value is the version to use.
1458
+ libraries : Dict[str, str], default {}
1459
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1460
+ python : str, optional, default None
1461
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1462
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1463
+ disabled : bool, default False
1464
+ If set to True, disables Conda.
1465
+ """
1466
+ ...
1467
+
1468
+ @typing.overload
1469
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1470
+ ...
1471
+
1472
+ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
1473
+ """
1474
+ Specifies the Conda environment for all steps of the flow.
1475
+
1476
+ Use `@conda_base` to set common libraries required by all
1477
+ steps and use `@conda` to specify step-specific additions.
1478
+
1479
+
1480
+ Parameters
1481
+ ----------
1482
+ packages : Dict[str, str], default {}
1483
+ Packages to use for this flow. The key is the name of the package
1484
+ and the value is the version to use.
1485
+ libraries : Dict[str, str], default {}
1486
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1487
+ python : str, optional, default None
1488
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1489
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1490
+ disabled : bool, default False
1491
+ If set to True, disables Conda.
1492
+ """
1493
+ ...
1494
+
1495
+ @typing.overload
1496
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1497
+ """
1498
+ Specifies the PyPI packages for all steps of the flow.
1499
+
1500
+ Use `@pypi_base` to set common packages required by all
1501
+ steps and use `@pypi` to specify step-specific overrides.
1502
+
1503
+ Parameters
1504
+ ----------
1505
+ packages : Dict[str, str], default: {}
1506
+ Packages to use for this flow. The key is the name of the package
1507
+ and the value is the version to use.
1508
+ python : str, optional, default: None
1509
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1510
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1511
+ """
1512
+ ...
1513
+
1514
+ @typing.overload
1515
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1516
+ ...
1517
+
1518
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1519
+ """
1520
+ Specifies the PyPI packages for all steps of the flow.
1521
+
1522
+ Use `@pypi_base` to set common packages required by all
1523
+ steps and use `@pypi` to specify step-specific overrides.
1524
+
1525
+ Parameters
1526
+ ----------
1527
+ packages : Dict[str, str], default: {}
1528
+ Packages to use for this flow. The key is the name of the package
1529
+ and the value is the version to use.
1530
+ python : str, optional, default: None
1531
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1532
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1533
+ """
1534
+ ...
1535
+
1536
+ @typing.overload
1537
+ def schedule(*, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1538
+ """
1539
+ Specifies the times when the flow should be run when running on a
1540
+ production scheduler.
1541
+
1542
+
1543
+ Parameters
1544
+ ----------
1545
+ hourly : bool, default False
1546
+ Run the workflow hourly.
1547
+ daily : bool, default True
1548
+ Run the workflow daily.
1549
+ weekly : bool, default False
1550
+ Run the workflow weekly.
1551
+ cron : str, optional, default None
1552
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1553
+ specified by this expression.
1554
+ timezone : str, optional, default None
1555
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1556
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1557
+ """
1558
+ ...
1559
+
1560
+ @typing.overload
1561
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1562
+ ...
1563
+
1564
+ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
1565
+ """
1566
+ Specifies the times when the flow should be run when running on a
1567
+ production scheduler.
1568
+
1569
+
1570
+ Parameters
1571
+ ----------
1572
+ hourly : bool, default False
1573
+ Run the workflow hourly.
1574
+ daily : bool, default True
1575
+ Run the workflow daily.
1576
+ weekly : bool, default False
1577
+ Run the workflow weekly.
1578
+ cron : str, optional, default None
1579
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1580
+ specified by this expression.
1581
+ timezone : str, optional, default None
1582
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1583
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1584
+ """
1585
+ ...
1586
+
1587
+ def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1588
+ """
1589
+ Specifies what flows belong to the same project.
1590
+
1591
+ A project-specific namespace is created for all flows that
1592
+ use the same `@project(name)`.
1593
+
1594
+
1595
+ Parameters
1596
+ ----------
1597
+ name : str
1598
+ Project name. Make sure that the name is unique amongst all
1599
+ projects that use the same production scheduler. The name may
1600
+ contain only lowercase alphanumeric characters and underscores.
1601
+
1602
+ branch : Optional[str], default None
1603
+ The branch to use. If not specified, the branch is set to
1604
+ `user.<username>` unless `production` is set to `True`. This can
1605
+ also be set on the command line using `--branch` as a top-level option.
1606
+ It is an error to specify `branch` in the decorator and on the command line.
1607
+
1608
+ production : bool, default False
1609
+ Whether or not the branch is the production branch. This can also be set on the
1610
+ command line using `--production` as a top-level option. It is an error to specify
1611
+ `production` in the decorator and on the command line.
1612
+ The project branch name will be:
1613
+ - if `branch` is specified:
1614
+ - if `production` is True: `prod.<branch>`
1615
+ - if `production` is False: `test.<branch>`
1616
+ - if `branch` is not specified:
1617
+ - if `production` is True: `prod`
1618
+ - if `production` is False: `user.<username>`
1619
+ """
1620
+ ...
1621
+
1622
+ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, bucket_key: typing.Union[str, typing.List[str]], bucket_name: str, wildcard_match: bool, aws_conn_id: str, verify: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1623
+ """
1624
+ The `@airflow_s3_key_sensor` decorator attaches a Airflow [S3KeySensor](https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/_api/airflow/providers/amazon/aws/sensors/s3/index.html#airflow.providers.amazon.aws.sensors.s3.S3KeySensor)
1625
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1626
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1627
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1628
+ starts only after all sensors finish.
1629
+
1630
+
1631
+ Parameters
1632
+ ----------
1633
+ timeout : int
1634
+ Time, in seconds before the task times out and fails. (Default: 3600)
1635
+ poke_interval : int
1636
+ Time in seconds that the job should wait in between each try. (Default: 60)
1637
+ mode : str
1638
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1639
+ exponential_backoff : bool
1640
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1641
+ pool : str
1642
+ the slot pool this task should run in,
1643
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1644
+ soft_fail : bool
1645
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1646
+ name : str
1647
+ Name of the sensor on Airflow
1648
+ description : str
1649
+ Description of sensor in the Airflow UI
1650
+ bucket_key : Union[str, List[str]]
1651
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1652
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1653
+ bucket_name : str
1654
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1655
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1656
+ wildcard_match : bool
1657
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1658
+ aws_conn_id : str
1659
+ a reference to the s3 connection on Airflow. (Default: None)
1660
+ verify : bool
1661
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1662
+ """
1663
+ ...
1664
+
1452
1665
  def with_artifact_store(f: typing.Optional[typing.Type[FlowSpecDerived]] = None):
1453
1666
  """
1454
1667
  Allows setting external datastores to save data for the
@@ -1564,190 +1777,106 @@ def with_artifact_store(f: typing.Optional[typing.Type[FlowSpecDerived]] = None)
1564
1777
  ...
1565
1778
 
1566
1779
  @typing.overload
1567
- def schedule(*, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1568
- """
1569
- Specifies the times when the flow should be run when running on a
1570
- production scheduler.
1571
-
1572
-
1573
- Parameters
1574
- ----------
1575
- hourly : bool, default False
1576
- Run the workflow hourly.
1577
- daily : bool, default True
1578
- Run the workflow daily.
1579
- weekly : bool, default False
1580
- Run the workflow weekly.
1581
- cron : str, optional, default None
1582
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1583
- specified by this expression.
1584
- timezone : str, optional, default None
1585
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1586
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1587
- """
1588
- ...
1589
-
1590
- @typing.overload
1591
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1592
- ...
1593
-
1594
- def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
1595
- """
1596
- Specifies the times when the flow should be run when running on a
1597
- production scheduler.
1598
-
1599
-
1600
- Parameters
1601
- ----------
1602
- hourly : bool, default False
1603
- Run the workflow hourly.
1604
- daily : bool, default True
1605
- Run the workflow daily.
1606
- weekly : bool, default False
1607
- Run the workflow weekly.
1608
- cron : str, optional, default None
1609
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1610
- specified by this expression.
1611
- timezone : str, optional, default None
1612
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1613
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1614
- """
1615
- ...
1616
-
1617
- @typing.overload
1618
- def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1780
+ def trigger_on_finish(*, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1619
1781
  """
1620
- Specifies the event(s) that this flow depends on.
1782
+ Specifies the flow(s) that this flow depends on.
1621
1783
 
1622
1784
  ```
1623
- @trigger(event='foo')
1785
+ @trigger_on_finish(flow='FooFlow')
1624
1786
  ```
1625
1787
  or
1626
1788
  ```
1627
- @trigger(events=['foo', 'bar'])
1789
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1628
1790
  ```
1791
+ This decorator respects the @project decorator and triggers the flow
1792
+ when upstream runs within the same namespace complete successfully
1629
1793
 
1630
- Additionally, you can specify the parameter mappings
1631
- to map event payload to Metaflow parameters for the flow.
1794
+ Additionally, you can specify project aware upstream flow dependencies
1795
+ by specifying the fully qualified project_flow_name.
1632
1796
  ```
1633
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1797
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1634
1798
  ```
1635
1799
  or
1636
1800
  ```
1637
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1638
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1801
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1639
1802
  ```
1640
1803
 
1641
- 'parameters' can also be a list of strings and tuples like so:
1642
- ```
1643
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1644
- ```
1645
- This is equivalent to:
1804
+ You can also specify just the project or project branch (other values will be
1805
+ inferred from the current project or project branch):
1646
1806
  ```
1647
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1807
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1648
1808
  ```
1649
1809
 
1810
+ Note that `branch` is typically one of:
1811
+ - `prod`
1812
+ - `user.bob`
1813
+ - `test.my_experiment`
1814
+ - `prod.staging`
1815
+
1650
1816
 
1651
1817
  Parameters
1652
1818
  ----------
1653
- event : Union[str, Dict[str, Any]], optional, default None
1654
- Event dependency for this flow.
1655
- events : List[Union[str, Dict[str, Any]]], default []
1656
- Events dependency for this flow.
1819
+ flow : Union[str, Dict[str, str]], optional, default None
1820
+ Upstream flow dependency for this flow.
1821
+ flows : List[Union[str, Dict[str, str]]], default []
1822
+ Upstream flow dependencies for this flow.
1657
1823
  options : Dict[str, Any], default {}
1658
1824
  Backend-specific configuration for tuning eventing behavior.
1659
1825
  """
1660
1826
  ...
1661
1827
 
1662
1828
  @typing.overload
1663
- def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1829
+ def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1664
1830
  ...
1665
1831
 
1666
- def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
1832
+ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}):
1667
1833
  """
1668
- Specifies the event(s) that this flow depends on.
1834
+ Specifies the flow(s) that this flow depends on.
1669
1835
 
1670
1836
  ```
1671
- @trigger(event='foo')
1837
+ @trigger_on_finish(flow='FooFlow')
1672
1838
  ```
1673
1839
  or
1674
1840
  ```
1675
- @trigger(events=['foo', 'bar'])
1841
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1676
1842
  ```
1843
+ This decorator respects the @project decorator and triggers the flow
1844
+ when upstream runs within the same namespace complete successfully
1677
1845
 
1678
- Additionally, you can specify the parameter mappings
1679
- to map event payload to Metaflow parameters for the flow.
1846
+ Additionally, you can specify project aware upstream flow dependencies
1847
+ by specifying the fully qualified project_flow_name.
1680
1848
  ```
1681
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1849
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1682
1850
  ```
1683
1851
  or
1684
1852
  ```
1685
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1686
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1853
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1687
1854
  ```
1688
1855
 
1689
- 'parameters' can also be a list of strings and tuples like so:
1690
- ```
1691
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1692
- ```
1693
- This is equivalent to:
1856
+ You can also specify just the project or project branch (other values will be
1857
+ inferred from the current project or project branch):
1694
1858
  ```
1695
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1859
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1696
1860
  ```
1697
1861
 
1862
+ Note that `branch` is typically one of:
1863
+ - `prod`
1864
+ - `user.bob`
1865
+ - `test.my_experiment`
1866
+ - `prod.staging`
1867
+
1698
1868
 
1699
1869
  Parameters
1700
1870
  ----------
1701
- event : Union[str, Dict[str, Any]], optional, default None
1702
- Event dependency for this flow.
1703
- events : List[Union[str, Dict[str, Any]]], default []
1704
- Events dependency for this flow.
1871
+ flow : Union[str, Dict[str, str]], optional, default None
1872
+ Upstream flow dependency for this flow.
1873
+ flows : List[Union[str, Dict[str, str]]], default []
1874
+ Upstream flow dependencies for this flow.
1705
1875
  options : Dict[str, Any], default {}
1706
1876
  Backend-specific configuration for tuning eventing behavior.
1707
1877
  """
1708
1878
  ...
1709
1879
 
1710
- @typing.overload
1711
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1712
- """
1713
- Specifies the PyPI packages for all steps of the flow.
1714
-
1715
- Use `@pypi_base` to set common packages required by all
1716
- steps and use `@pypi` to specify step-specific overrides.
1717
-
1718
- Parameters
1719
- ----------
1720
- packages : Dict[str, str], default: {}
1721
- Packages to use for this flow. The key is the name of the package
1722
- and the value is the version to use.
1723
- python : str, optional, default: None
1724
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1725
- that the version used will correspond to the version of the Python interpreter used to start the run.
1726
- """
1727
- ...
1728
-
1729
- @typing.overload
1730
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1731
- ...
1732
-
1733
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1734
- """
1735
- Specifies the PyPI packages for all steps of the flow.
1736
-
1737
- Use `@pypi_base` to set common packages required by all
1738
- steps and use `@pypi` to specify step-specific overrides.
1739
-
1740
- Parameters
1741
- ----------
1742
- packages : Dict[str, str], default: {}
1743
- Packages to use for this flow. The key is the name of the package
1744
- and the value is the version to use.
1745
- python : str, optional, default: None
1746
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1747
- that the version used will correspond to the version of the Python interpreter used to start the run.
1748
- """
1749
- ...
1750
-
1751
1880
  def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, external_dag_id: str, external_task_ids: typing.List[str], allowed_states: typing.List[str], failed_states: typing.List[str], execution_delta: "datetime.timedelta", check_existence: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1752
1881
  """
1753
1882
  The `@airflow_external_task_sensor` decorator attaches a Airflow [ExternalTaskSensor](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/sensors/external_task/index.html#airflow.sensors.external_task.ExternalTaskSensor) before the start step of the flow.
@@ -1791,134 +1920,5 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
1791
1920
  """
1792
1921
  ...
1793
1922
 
1794
- def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1795
- """
1796
- Specifies what flows belong to the same project.
1797
-
1798
- A project-specific namespace is created for all flows that
1799
- use the same `@project(name)`.
1800
-
1801
-
1802
- Parameters
1803
- ----------
1804
- name : str
1805
- Project name. Make sure that the name is unique amongst all
1806
- projects that use the same production scheduler. The name may
1807
- contain only lowercase alphanumeric characters and underscores.
1808
-
1809
- branch : Optional[str], default None
1810
- The branch to use. If not specified, the branch is set to
1811
- `user.<username>` unless `production` is set to `True`. This can
1812
- also be set on the command line using `--branch` as a top-level option.
1813
- It is an error to specify `branch` in the decorator and on the command line.
1814
-
1815
- production : bool, default False
1816
- Whether or not the branch is the production branch. This can also be set on the
1817
- command line using `--production` as a top-level option. It is an error to specify
1818
- `production` in the decorator and on the command line.
1819
- The project branch name will be:
1820
- - if `branch` is specified:
1821
- - if `production` is True: `prod.<branch>`
1822
- - if `production` is False: `test.<branch>`
1823
- - if `branch` is not specified:
1824
- - if `production` is True: `prod`
1825
- - if `production` is False: `user.<username>`
1826
- """
1827
- ...
1828
-
1829
- def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, bucket_key: typing.Union[str, typing.List[str]], bucket_name: str, wildcard_match: bool, aws_conn_id: str, verify: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1830
- """
1831
- The `@airflow_s3_key_sensor` decorator attaches a Airflow [S3KeySensor](https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/_api/airflow/providers/amazon/aws/sensors/s3/index.html#airflow.providers.amazon.aws.sensors.s3.S3KeySensor)
1832
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1833
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1834
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1835
- starts only after all sensors finish.
1836
-
1837
-
1838
- Parameters
1839
- ----------
1840
- timeout : int
1841
- Time, in seconds before the task times out and fails. (Default: 3600)
1842
- poke_interval : int
1843
- Time in seconds that the job should wait in between each try. (Default: 60)
1844
- mode : str
1845
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1846
- exponential_backoff : bool
1847
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1848
- pool : str
1849
- the slot pool this task should run in,
1850
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1851
- soft_fail : bool
1852
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1853
- name : str
1854
- Name of the sensor on Airflow
1855
- description : str
1856
- Description of sensor in the Airflow UI
1857
- bucket_key : Union[str, List[str]]
1858
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1859
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1860
- bucket_name : str
1861
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1862
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1863
- wildcard_match : bool
1864
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1865
- aws_conn_id : str
1866
- a reference to the s3 connection on Airflow. (Default: None)
1867
- verify : bool
1868
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1869
- """
1870
- ...
1871
-
1872
- @typing.overload
1873
- def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1874
- """
1875
- Specifies the Conda environment for all steps of the flow.
1876
-
1877
- Use `@conda_base` to set common libraries required by all
1878
- steps and use `@conda` to specify step-specific additions.
1879
-
1880
-
1881
- Parameters
1882
- ----------
1883
- packages : Dict[str, str], default {}
1884
- Packages to use for this flow. The key is the name of the package
1885
- and the value is the version to use.
1886
- libraries : Dict[str, str], default {}
1887
- Supported for backward compatibility. When used with packages, packages will take precedence.
1888
- python : str, optional, default None
1889
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1890
- that the version used will correspond to the version of the Python interpreter used to start the run.
1891
- disabled : bool, default False
1892
- If set to True, disables Conda.
1893
- """
1894
- ...
1895
-
1896
- @typing.overload
1897
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1898
- ...
1899
-
1900
- def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
1901
- """
1902
- Specifies the Conda environment for all steps of the flow.
1903
-
1904
- Use `@conda_base` to set common libraries required by all
1905
- steps and use `@conda` to specify step-specific additions.
1906
-
1907
-
1908
- Parameters
1909
- ----------
1910
- packages : Dict[str, str], default {}
1911
- Packages to use for this flow. The key is the name of the package
1912
- and the value is the version to use.
1913
- libraries : Dict[str, str], default {}
1914
- Supported for backward compatibility. When used with packages, packages will take precedence.
1915
- python : str, optional, default None
1916
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1917
- that the version used will correspond to the version of the Python interpreter used to start the run.
1918
- disabled : bool, default False
1919
- If set to True, disables Conda.
1920
- """
1921
- ...
1922
-
1923
1923
  pkg_name: str
1924
1924