ob-metaflow-stubs 6.0.10.10__py2.py3-none-any.whl → 6.0.10.12__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 (265) hide show
  1. metaflow-stubs/__init__.pyi +988 -987
  2. metaflow-stubs/cards.pyi +2 -2
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/cli_components/__init__.pyi +2 -2
  5. metaflow-stubs/cli_components/utils.pyi +2 -2
  6. metaflow-stubs/client/__init__.pyi +2 -2
  7. metaflow-stubs/client/core.pyi +6 -6
  8. metaflow-stubs/client/filecache.pyi +2 -2
  9. metaflow-stubs/events.pyi +2 -2
  10. metaflow-stubs/exception.pyi +2 -2
  11. metaflow-stubs/flowspec.pyi +3 -3
  12. metaflow-stubs/generated_for.txt +1 -1
  13. metaflow-stubs/includefile.pyi +13 -6
  14. metaflow-stubs/meta_files.pyi +2 -2
  15. metaflow-stubs/metadata_provider/__init__.pyi +2 -2
  16. metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
  17. metaflow-stubs/metadata_provider/metadata.pyi +3 -3
  18. metaflow-stubs/metadata_provider/util.pyi +2 -2
  19. metaflow-stubs/metaflow_config.pyi +2 -2
  20. metaflow-stubs/metaflow_current.pyi +76 -76
  21. metaflow-stubs/metaflow_git.pyi +2 -2
  22. metaflow-stubs/mf_extensions/__init__.pyi +2 -2
  23. metaflow-stubs/mf_extensions/obcheckpoint/__init__.pyi +2 -2
  24. metaflow-stubs/mf_extensions/obcheckpoint/plugins/__init__.pyi +2 -2
  25. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/__init__.pyi +2 -2
  26. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/__init__.pyi +2 -2
  27. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/async_cards.pyi +2 -2
  28. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/deco_injection_mixin.pyi +2 -2
  29. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/extra_components.pyi +4 -4
  30. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/__init__.pyi +2 -2
  31. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/__init__.pyi +2 -2
  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 +2 -2
  34. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/checkpoint_storage.pyi +4 -4
  35. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/constructors.pyi +2 -2
  36. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/core.pyi +4 -4
  37. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/decorator.pyi +4 -4
  38. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/exceptions.pyi +2 -2
  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 +2 -2
  41. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/__init__.pyi +2 -2
  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 +2 -2
  45. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/exceptions.pyi +2 -2
  46. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/task_utils.pyi +3 -3
  47. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi +2 -2
  48. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi +3 -3
  49. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/exceptions.pyi +2 -2
  50. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/__init__.pyi +2 -2
  51. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/cards/__init__.pyi +6 -0
  52. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/cards/hf_hub_card.pyi +93 -0
  53. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/decorator.pyi +6 -3
  54. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/__init__.pyi +2 -2
  55. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/core.pyi +3 -3
  56. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/exceptions.pyi +2 -2
  57. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/model_storage.pyi +4 -4
  58. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/__init__.pyi +2 -2
  59. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/flowspec_utils.pyi +2 -2
  60. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/general.pyi +2 -2
  61. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/identity_utils.pyi +2 -2
  62. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/__init__.pyi +2 -2
  63. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/base.pyi +2 -2
  64. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/tar.pyi +3 -3
  65. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +3 -3
  66. metaflow-stubs/mf_extensions/outerbounds/__init__.pyi +2 -2
  67. metaflow-stubs/mf_extensions/outerbounds/plugins/__init__.pyi +2 -2
  68. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/__init__.pyi +2 -2
  69. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/__init__.pyi +2 -2
  70. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/_state_machine.pyi +2 -2
  71. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/_vendor/__init__.pyi +2 -2
  72. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/_vendor/spinner/__init__.pyi +2 -2
  73. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/_vendor/spinner/spinners.pyi +2 -2
  74. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/app_cli.pyi +2 -2
  75. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/app_config.pyi +3 -3
  76. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/capsule.pyi +2 -2
  77. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/click_importer.pyi +2 -2
  78. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/code_package/__init__.pyi +2 -2
  79. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/code_package/code_packager.pyi +2 -2
  80. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/__init__.pyi +2 -2
  81. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/cli_generator.pyi +2 -2
  82. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/config_utils.pyi +3 -3
  83. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/schema_export.pyi +2 -2
  84. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/typed_configs.pyi +4 -4
  85. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/unified_config.pyi +4 -4
  86. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/dependencies.pyi +3 -3
  87. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/deployer.pyi +4 -4
  88. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/experimental/__init__.pyi +2 -2
  89. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/perimeters.pyi +2 -2
  90. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/utils.pyi +3 -3
  91. metaflow-stubs/mf_extensions/outerbounds/plugins/aws/__init__.pyi +2 -2
  92. metaflow-stubs/mf_extensions/outerbounds/plugins/aws/assume_role_decorator.pyi +2 -2
  93. metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/__init__.pyi +2 -2
  94. metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/async_cards.pyi +2 -2
  95. metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/injector.pyi +2 -2
  96. metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/__init__.pyi +2 -2
  97. metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/coreweave.pyi +3 -3
  98. metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/nebius.pyi +3 -3
  99. metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/__init__.pyi +2 -2
  100. metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/baker.pyi +4 -4
  101. metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/docker_environment.pyi +2 -2
  102. metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/fast_bakery.pyi +2 -2
  103. metaflow-stubs/mf_extensions/outerbounds/plugins/kubernetes/__init__.pyi +2 -2
  104. metaflow-stubs/mf_extensions/outerbounds/plugins/kubernetes/pod_killer.pyi +2 -2
  105. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/__init__.pyi +2 -2
  106. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/constants.pyi +2 -2
  107. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/exceptions.pyi +2 -2
  108. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/ollama.pyi +2 -2
  109. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/status_card.pyi +2 -2
  110. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/__init__.pyi +2 -2
  111. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/snowflake.pyi +2 -2
  112. metaflow-stubs/mf_extensions/outerbounds/profilers/__init__.pyi +2 -2
  113. metaflow-stubs/mf_extensions/outerbounds/profilers/gpu.pyi +2 -2
  114. metaflow-stubs/mf_extensions/outerbounds/remote_config.pyi +3 -3
  115. metaflow-stubs/mf_extensions/outerbounds/toplevel/__init__.pyi +2 -2
  116. metaflow-stubs/mf_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.pyi +2 -2
  117. metaflow-stubs/mf_extensions/outerbounds/toplevel/s3_proxy.pyi +2 -2
  118. metaflow-stubs/multicore_utils.pyi +2 -2
  119. metaflow-stubs/ob_internal.pyi +2 -2
  120. metaflow-stubs/packaging_sys/__init__.pyi +7 -7
  121. metaflow-stubs/packaging_sys/backend.pyi +2 -2
  122. metaflow-stubs/packaging_sys/distribution_support.pyi +5 -5
  123. metaflow-stubs/packaging_sys/tar_backend.pyi +5 -5
  124. metaflow-stubs/packaging_sys/utils.pyi +2 -2
  125. metaflow-stubs/packaging_sys/v1.pyi +3 -3
  126. metaflow-stubs/parameters.pyi +4 -4
  127. metaflow-stubs/plugins/__init__.pyi +12 -11
  128. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  129. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  130. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  131. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  132. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  133. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
  134. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
  135. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  136. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  137. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  138. metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -3
  139. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
  140. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +4 -4
  141. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -3
  142. metaflow-stubs/plugins/argo/exit_hooks.pyi +3 -3
  143. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  144. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  145. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  146. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  147. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  148. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  149. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  150. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  151. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
  152. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  153. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  154. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  155. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  156. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  157. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +5 -5
  158. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +3 -3
  159. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  160. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  161. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  162. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +3 -3
  163. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  164. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  165. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  166. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  167. metaflow-stubs/plugins/cards/card_client.pyi +2 -2
  168. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  169. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  170. metaflow-stubs/plugins/cards/card_decorator.pyi +3 -3
  171. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  172. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  173. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  174. metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
  175. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  176. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  177. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  178. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  179. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  180. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  181. metaflow-stubs/plugins/catch_decorator.pyi +2 -2
  182. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  183. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  184. metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
  185. metaflow-stubs/plugins/datatools/s3/s3.pyi +4 -4
  186. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  187. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  188. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  189. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  190. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  191. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  192. metaflow-stubs/plugins/exit_hook/__init__.pyi +2 -2
  193. metaflow-stubs/plugins/exit_hook/exit_hook_decorator.pyi +2 -2
  194. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  195. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  196. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  197. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
  198. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  199. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  200. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  201. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  202. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  203. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +3 -3
  204. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  205. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  206. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
  207. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  208. metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
  209. metaflow-stubs/plugins/ollama/__init__.pyi +3 -3
  210. metaflow-stubs/plugins/optuna/__init__.pyi +2 -2
  211. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  212. metaflow-stubs/plugins/parsers.pyi +25 -0
  213. metaflow-stubs/plugins/perimeters.pyi +2 -2
  214. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  215. metaflow-stubs/plugins/pypi/__init__.pyi +3 -3
  216. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  217. metaflow-stubs/plugins/pypi/conda_environment.pyi +3 -3
  218. metaflow-stubs/plugins/pypi/parsers.pyi +2 -2
  219. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  220. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  221. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  222. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  223. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  224. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  225. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
  226. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  227. metaflow-stubs/plugins/secrets/secrets_func.pyi +2 -2
  228. metaflow-stubs/plugins/secrets/secrets_spec.pyi +2 -2
  229. metaflow-stubs/plugins/secrets/utils.pyi +2 -2
  230. metaflow-stubs/plugins/snowflake/__init__.pyi +2 -2
  231. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  232. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  233. metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
  234. metaflow-stubs/plugins/torchtune/__init__.pyi +2 -2
  235. metaflow-stubs/plugins/uv/__init__.pyi +2 -2
  236. metaflow-stubs/plugins/uv/uv_environment.pyi +2 -2
  237. metaflow-stubs/profilers/__init__.pyi +2 -2
  238. metaflow-stubs/pylint_wrapper.pyi +2 -2
  239. metaflow-stubs/runner/__init__.pyi +2 -2
  240. metaflow-stubs/runner/deployer.pyi +33 -33
  241. metaflow-stubs/runner/deployer_impl.pyi +2 -2
  242. metaflow-stubs/runner/metaflow_runner.pyi +4 -4
  243. metaflow-stubs/runner/nbdeploy.pyi +2 -2
  244. metaflow-stubs/runner/nbrun.pyi +2 -2
  245. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  246. metaflow-stubs/runner/utils.pyi +3 -3
  247. metaflow-stubs/system/__init__.pyi +2 -2
  248. metaflow-stubs/system/system_logger.pyi +2 -2
  249. metaflow-stubs/system/system_monitor.pyi +2 -2
  250. metaflow-stubs/tagging_util.pyi +2 -2
  251. metaflow-stubs/tuple_util.pyi +2 -2
  252. metaflow-stubs/user_configs/__init__.pyi +2 -2
  253. metaflow-stubs/user_configs/config_options.pyi +3 -3
  254. metaflow-stubs/user_configs/config_parameters.pyi +5 -5
  255. metaflow-stubs/user_decorators/__init__.pyi +2 -2
  256. metaflow-stubs/user_decorators/common.pyi +2 -2
  257. metaflow-stubs/user_decorators/mutable_flow.pyi +4 -4
  258. metaflow-stubs/user_decorators/mutable_step.pyi +5 -5
  259. metaflow-stubs/user_decorators/user_flow_decorator.pyi +5 -5
  260. metaflow-stubs/user_decorators/user_step_decorator.pyi +5 -5
  261. {ob_metaflow_stubs-6.0.10.10.dist-info → ob_metaflow_stubs-6.0.10.12.dist-info}/METADATA +1 -1
  262. ob_metaflow_stubs-6.0.10.12.dist-info/RECORD +265 -0
  263. ob_metaflow_stubs-6.0.10.10.dist-info/RECORD +0 -262
  264. {ob_metaflow_stubs-6.0.10.10.dist-info → ob_metaflow_stubs-6.0.10.12.dist-info}/WHEEL +0 -0
  265. {ob_metaflow_stubs-6.0.10.10.dist-info → ob_metaflow_stubs-6.0.10.12.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.18.7.5+obcheckpoint(0.2.7);ob(v1) #
4
- # Generated on 2025-09-23T01:34:30.897811 #
3
+ # MF version: 2.18.9.1+obcheckpoint(0.2.8);ob(v1) #
4
+ # Generated on 2025-09-30T17:31:30.391243 #
5
5
  ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -39,17 +39,18 @@ 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 tuple_util as tuple_util
42
+ from . import events as events
43
43
  from . import cards as cards
44
+ from . import tuple_util as tuple_util
44
45
  from . import metaflow_git as metaflow_git
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
51
+ from .plugins.parsers import yaml_parser as yaml_parser
52
52
  from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
53
+ from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
53
54
  from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
54
55
  from . import client as client
55
56
  from .client.core import namespace as namespace
@@ -169,21 +170,149 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
169
170
  ...
170
171
 
171
172
  @typing.overload
172
- def test_append_card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
173
+ 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]]]:
173
174
  """
174
- A simple decorator that demonstrates using CardDecoratorInjector
175
- to inject a card and render simple markdown content.
175
+ Enables checkpointing for a step.
176
+
177
+ > Examples
178
+
179
+ - Saving Checkpoints
180
+
181
+ ```python
182
+ @checkpoint
183
+ @step
184
+ def train(self):
185
+ model = create_model(self.parameters, checkpoint_path = None)
186
+ for i in range(self.epochs):
187
+ # some training logic
188
+ loss = model.train(self.dataset)
189
+ if i % 10 == 0:
190
+ model.save(
191
+ current.checkpoint.directory,
192
+ )
193
+ # saves the contents of the `current.checkpoint.directory` as a checkpoint
194
+ # and returns a reference dictionary to the checkpoint saved in the datastore
195
+ self.latest_checkpoint = current.checkpoint.save(
196
+ name="epoch_checkpoint",
197
+ metadata={
198
+ "epoch": i,
199
+ "loss": loss,
200
+ }
201
+ )
202
+ ```
203
+
204
+ - Using Loaded Checkpoints
205
+
206
+ ```python
207
+ @retry(times=3)
208
+ @checkpoint
209
+ @step
210
+ def train(self):
211
+ # Assume that the task has restarted and the previous attempt of the task
212
+ # saved a checkpoint
213
+ checkpoint_path = None
214
+ if current.checkpoint.is_loaded: # Check if a checkpoint is loaded
215
+ print("Loaded checkpoint from the previous attempt")
216
+ checkpoint_path = current.checkpoint.directory
217
+
218
+ model = create_model(self.parameters, checkpoint_path = checkpoint_path)
219
+ for i in range(self.epochs):
220
+ ...
221
+ ```
222
+
223
+
224
+ Parameters
225
+ ----------
226
+ load_policy : str, default: "fresh"
227
+ The policy for loading the checkpoint. The following policies are supported:
228
+ - "eager": Loads the the latest available checkpoint within the namespace.
229
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
230
+ will be loaded at the start of the task.
231
+ - "none": Do not load any checkpoint
232
+ - "fresh": Loads the lastest checkpoint created within the running Task.
233
+ This mode helps loading checkpoints across various retry attempts of the same task.
234
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
235
+ created within the task will be loaded when the task is retries execution on failure.
236
+
237
+ temp_dir_root : str, default: None
238
+ The root directory under which `current.checkpoint.directory` will be created.
176
239
  """
177
240
  ...
178
241
 
179
242
  @typing.overload
180
- def test_append_card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
243
+ def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
181
244
  ...
182
245
 
183
- def test_append_card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
246
+ @typing.overload
247
+ def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
248
+ ...
249
+
250
+ 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):
184
251
  """
185
- A simple decorator that demonstrates using CardDecoratorInjector
186
- to inject a card and render simple markdown content.
252
+ Enables checkpointing for a step.
253
+
254
+ > Examples
255
+
256
+ - Saving Checkpoints
257
+
258
+ ```python
259
+ @checkpoint
260
+ @step
261
+ def train(self):
262
+ model = create_model(self.parameters, checkpoint_path = None)
263
+ for i in range(self.epochs):
264
+ # some training logic
265
+ loss = model.train(self.dataset)
266
+ if i % 10 == 0:
267
+ model.save(
268
+ current.checkpoint.directory,
269
+ )
270
+ # saves the contents of the `current.checkpoint.directory` as a checkpoint
271
+ # and returns a reference dictionary to the checkpoint saved in the datastore
272
+ self.latest_checkpoint = current.checkpoint.save(
273
+ name="epoch_checkpoint",
274
+ metadata={
275
+ "epoch": i,
276
+ "loss": loss,
277
+ }
278
+ )
279
+ ```
280
+
281
+ - Using Loaded Checkpoints
282
+
283
+ ```python
284
+ @retry(times=3)
285
+ @checkpoint
286
+ @step
287
+ def train(self):
288
+ # Assume that the task has restarted and the previous attempt of the task
289
+ # saved a checkpoint
290
+ checkpoint_path = None
291
+ if current.checkpoint.is_loaded: # Check if a checkpoint is loaded
292
+ print("Loaded checkpoint from the previous attempt")
293
+ checkpoint_path = current.checkpoint.directory
294
+
295
+ model = create_model(self.parameters, checkpoint_path = checkpoint_path)
296
+ for i in range(self.epochs):
297
+ ...
298
+ ```
299
+
300
+
301
+ Parameters
302
+ ----------
303
+ load_policy : str, default: "fresh"
304
+ The policy for loading the checkpoint. The following policies are supported:
305
+ - "eager": Loads the the latest available checkpoint within the namespace.
306
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
307
+ will be loaded at the start of the task.
308
+ - "none": Do not load any checkpoint
309
+ - "fresh": Loads the lastest checkpoint created within the running Task.
310
+ This mode helps loading checkpoints across various retry attempts of the same task.
311
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
312
+ created within the task will be loaded when the task is retries execution on failure.
313
+
314
+ temp_dir_root : str, default: None
315
+ The root directory under which `current.checkpoint.directory` will be created.
187
316
  """
188
317
  ...
189
318
 
@@ -316,36 +445,19 @@ def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
316
445
  """
317
446
  ...
318
447
 
319
- @typing.overload
320
- 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]]]:
321
- """
322
- Specifies environment variables to be set prior to the execution of a step.
323
-
324
-
325
- Parameters
326
- ----------
327
- vars : Dict[str, str], default {}
328
- Dictionary of environment variables to set.
329
- """
330
- ...
331
-
332
- @typing.overload
333
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
334
- ...
335
-
336
- @typing.overload
337
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
338
- ...
339
-
340
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
448
+ 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]]]:
341
449
  """
342
- Specifies environment variables to be set prior to the execution of a step.
450
+ Specifies that this step should execute on DGX cloud.
343
451
 
344
452
 
345
453
  Parameters
346
454
  ----------
347
- vars : Dict[str, str], default {}
348
- Dictionary of environment variables to set.
455
+ gpu : int
456
+ Number of GPUs to use.
457
+ gpu_type : str
458
+ Type of Nvidia GPU to use.
459
+ queue_timeout : int
460
+ Time to keep the job in NVCF's queue.
349
461
  """
350
462
  ...
351
463
 
@@ -400,233 +512,54 @@ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
400
512
  """
401
513
  ...
402
514
 
403
- 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]]]:
404
- """
405
- Specifies that this step should execute on DGX cloud.
406
-
407
-
408
- Parameters
409
- ----------
410
- gpu : int
411
- Number of GPUs to use.
412
- gpu_type : str
413
- Type of Nvidia GPU to use.
414
- queue_timeout : int
415
- Time to keep the job in NVCF's queue.
416
- """
417
- ...
418
-
419
515
  @typing.overload
420
- 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]]]:
516
+ 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]]]:
421
517
  """
422
- Specifies the number of times the task corresponding
423
- to a step needs to be retried.
424
-
425
- This decorator is useful for handling transient errors, such as networking issues.
426
- If your task contains operations that can't be retried safely, e.g. database updates,
427
- it is advisable to annotate it with `@retry(times=0)`.
428
-
429
- This can be used in conjunction with the `@catch` decorator. The `@catch`
430
- decorator will execute a no-op task after all retries have been exhausted,
431
- ensuring that the flow execution can continue.
518
+ Specifies secrets to be retrieved and injected as environment variables prior to
519
+ the execution of a step.
432
520
 
433
521
 
434
522
  Parameters
435
523
  ----------
436
- times : int, default 3
437
- Number of times to retry this task.
438
- minutes_between_retries : int, default 2
439
- Number of minutes between retries.
524
+ sources : List[Union[str, Dict[str, Any]]], default: []
525
+ List of secret specs, defining how the secrets are to be retrieved
526
+ role : str, optional, default: None
527
+ Role to use for fetching secrets
440
528
  """
441
529
  ...
442
530
 
443
531
  @typing.overload
444
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
532
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
445
533
  ...
446
534
 
447
535
  @typing.overload
448
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
536
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
449
537
  ...
450
538
 
451
- 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):
539
+ 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):
452
540
  """
453
- Specifies the number of times the task corresponding
454
- to a step needs to be retried.
455
-
456
- This decorator is useful for handling transient errors, such as networking issues.
457
- If your task contains operations that can't be retried safely, e.g. database updates,
458
- it is advisable to annotate it with `@retry(times=0)`.
459
-
460
- This can be used in conjunction with the `@catch` decorator. The `@catch`
461
- decorator will execute a no-op task after all retries have been exhausted,
462
- ensuring that the flow execution can continue.
541
+ Specifies secrets to be retrieved and injected as environment variables prior to
542
+ the execution of a step.
463
543
 
464
544
 
465
545
  Parameters
466
546
  ----------
467
- times : int, default 3
468
- Number of times to retry this task.
469
- minutes_between_retries : int, default 2
470
- Number of minutes between retries.
547
+ sources : List[Union[str, Dict[str, Any]]], default: []
548
+ List of secret specs, defining how the secrets are to be retrieved
549
+ role : str, optional, default: None
550
+ Role to use for fetching secrets
471
551
  """
472
552
  ...
473
553
 
474
- @typing.overload
475
- 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]]]:
554
+ def nebius_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]]]:
476
555
  """
477
- Enables checkpointing for a step.
556
+ `@nebius_s3_proxy` is a Nebius-specific S3 Proxy decorator for routing S3 requests through a local proxy service.
557
+ It exists to make it easier for users to know that this decorator should only be used with
558
+ a Neo Cloud like Nebius. The underlying mechanics of the decorator is the same as the `@s3_proxy`:
478
559
 
479
- > Examples
480
560
 
481
- - Saving Checkpoints
482
-
483
- ```python
484
- @checkpoint
485
- @step
486
- def train(self):
487
- model = create_model(self.parameters, checkpoint_path = None)
488
- for i in range(self.epochs):
489
- # some training logic
490
- loss = model.train(self.dataset)
491
- if i % 10 == 0:
492
- model.save(
493
- current.checkpoint.directory,
494
- )
495
- # saves the contents of the `current.checkpoint.directory` as a checkpoint
496
- # and returns a reference dictionary to the checkpoint saved in the datastore
497
- self.latest_checkpoint = current.checkpoint.save(
498
- name="epoch_checkpoint",
499
- metadata={
500
- "epoch": i,
501
- "loss": loss,
502
- }
503
- )
504
- ```
505
-
506
- - Using Loaded Checkpoints
507
-
508
- ```python
509
- @retry(times=3)
510
- @checkpoint
511
- @step
512
- def train(self):
513
- # Assume that the task has restarted and the previous attempt of the task
514
- # saved a checkpoint
515
- checkpoint_path = None
516
- if current.checkpoint.is_loaded: # Check if a checkpoint is loaded
517
- print("Loaded checkpoint from the previous attempt")
518
- checkpoint_path = current.checkpoint.directory
519
-
520
- model = create_model(self.parameters, checkpoint_path = checkpoint_path)
521
- for i in range(self.epochs):
522
- ...
523
- ```
524
-
525
-
526
- Parameters
527
- ----------
528
- load_policy : str, default: "fresh"
529
- The policy for loading the checkpoint. The following policies are supported:
530
- - "eager": Loads the the latest available checkpoint within the namespace.
531
- With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
532
- will be loaded at the start of the task.
533
- - "none": Do not load any checkpoint
534
- - "fresh": Loads the lastest checkpoint created within the running Task.
535
- This mode helps loading checkpoints across various retry attempts of the same task.
536
- With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
537
- created within the task will be loaded when the task is retries execution on failure.
538
-
539
- temp_dir_root : str, default: None
540
- The root directory under which `current.checkpoint.directory` will be created.
541
- """
542
- ...
543
-
544
- @typing.overload
545
- def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
546
- ...
547
-
548
- @typing.overload
549
- def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
550
- ...
551
-
552
- 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):
553
- """
554
- Enables checkpointing for a step.
555
-
556
- > Examples
557
-
558
- - Saving Checkpoints
559
-
560
- ```python
561
- @checkpoint
562
- @step
563
- def train(self):
564
- model = create_model(self.parameters, checkpoint_path = None)
565
- for i in range(self.epochs):
566
- # some training logic
567
- loss = model.train(self.dataset)
568
- if i % 10 == 0:
569
- model.save(
570
- current.checkpoint.directory,
571
- )
572
- # saves the contents of the `current.checkpoint.directory` as a checkpoint
573
- # and returns a reference dictionary to the checkpoint saved in the datastore
574
- self.latest_checkpoint = current.checkpoint.save(
575
- name="epoch_checkpoint",
576
- metadata={
577
- "epoch": i,
578
- "loss": loss,
579
- }
580
- )
581
- ```
582
-
583
- - Using Loaded Checkpoints
584
-
585
- ```python
586
- @retry(times=3)
587
- @checkpoint
588
- @step
589
- def train(self):
590
- # Assume that the task has restarted and the previous attempt of the task
591
- # saved a checkpoint
592
- checkpoint_path = None
593
- if current.checkpoint.is_loaded: # Check if a checkpoint is loaded
594
- print("Loaded checkpoint from the previous attempt")
595
- checkpoint_path = current.checkpoint.directory
596
-
597
- model = create_model(self.parameters, checkpoint_path = checkpoint_path)
598
- for i in range(self.epochs):
599
- ...
600
- ```
601
-
602
-
603
- Parameters
604
- ----------
605
- load_policy : str, default: "fresh"
606
- The policy for loading the checkpoint. The following policies are supported:
607
- - "eager": Loads the the latest available checkpoint within the namespace.
608
- With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
609
- will be loaded at the start of the task.
610
- - "none": Do not load any checkpoint
611
- - "fresh": Loads the lastest checkpoint created within the running Task.
612
- This mode helps loading checkpoints across various retry attempts of the same task.
613
- With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
614
- created within the task will be loaded when the task is retries execution on failure.
615
-
616
- temp_dir_root : str, default: None
617
- The root directory under which `current.checkpoint.directory` will be created.
618
- """
619
- ...
620
-
621
- def nebius_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]]]:
622
- """
623
- `@nebius_s3_proxy` is a Nebius-specific S3 Proxy decorator for routing S3 requests through a local proxy service.
624
- It exists to make it easier for users to know that this decorator should only be used with
625
- a Neo Cloud like Nebius. The underlying mechanics of the decorator is the same as the `@s3_proxy`:
626
-
627
-
628
- Set up an S3 proxy that caches objects in an external, S3‑compatible bucket
629
- for S3 read and write requests.
561
+ Set up an S3 proxy that caches objects in an external, S3‑compatible bucket
562
+ for S3 read and write requests.
630
563
 
631
564
  This decorator requires an integration in the Outerbounds platform that
632
565
  points to an external bucket. It affects S3 operations performed via
@@ -682,268 +615,188 @@ def nebius_s3_proxy(*, integration_name: typing.Optional[str] = None, write_mode
682
615
  """
683
616
  ...
684
617
 
685
- 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]]]:
618
+ @typing.overload
619
+ 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]]]:
686
620
  """
687
- Specifies that this step should execute on Kubernetes.
621
+ Specifies environment variables to be set prior to the execution of a step.
688
622
 
689
623
 
690
624
  Parameters
691
625
  ----------
692
- cpu : int, default 1
693
- Number of CPUs required for this step. If `@resources` is
694
- also present, the maximum value from all decorators is used.
695
- memory : int, default 4096
696
- Memory size (in MB) required for this step. If
697
- `@resources` is also present, the maximum value from all decorators is
698
- used.
699
- disk : int, default 10240
700
- Disk size (in MB) required for this step. If
701
- `@resources` is also present, the maximum value from all decorators is
702
- used.
703
- image : str, optional, default None
704
- Docker image to use when launching on Kubernetes. If not specified, and
705
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
706
- not, a default Docker image mapping to the current version of Python is used.
707
- image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
708
- If given, the imagePullPolicy to be applied to the Docker image of the step.
709
- image_pull_secrets: List[str], default []
710
- The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
711
- Kubernetes image pull secrets to use when pulling container images
712
- in Kubernetes.
713
- service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
714
- Kubernetes service account to use when launching pod in Kubernetes.
715
- secrets : List[str], optional, default None
716
- Kubernetes secrets to use when launching pod in Kubernetes. These
717
- secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
718
- in Metaflow configuration.
719
- node_selector: Union[Dict[str,str], str], optional, default None
720
- Kubernetes node selector(s) to apply to the pod running the task.
721
- Can be passed in as a comma separated string of values e.g.
722
- 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
723
- {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
724
- namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
725
- Kubernetes namespace to use when launching pod in Kubernetes.
726
- gpu : int, optional, default None
727
- Number of GPUs required for this step. A value of zero implies that
728
- the scheduled node should not have GPUs.
729
- gpu_vendor : str, default KUBERNETES_GPU_VENDOR
730
- The vendor of the GPUs to be used for this step.
731
- tolerations : List[Dict[str,str]], default []
732
- The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
733
- Kubernetes tolerations to use when launching pod in Kubernetes.
734
- labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
735
- Kubernetes labels to use when launching pod in Kubernetes.
736
- annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
737
- Kubernetes annotations to use when launching pod in Kubernetes.
738
- use_tmpfs : bool, default False
739
- This enables an explicit tmpfs mount for this step.
740
- tmpfs_tempdir : bool, default True
741
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
742
- tmpfs_size : int, optional, default: None
743
- The value for the size (in MiB) of the tmpfs mount for this step.
744
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
745
- memory allocated for this step.
746
- tmpfs_path : str, optional, default /metaflow_temp
747
- Path to tmpfs mount for this step.
748
- persistent_volume_claims : Dict[str, str], optional, default None
749
- A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
750
- volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
751
- shared_memory: int, optional
752
- Shared memory size (in MiB) required for this step
753
- port: int, optional
754
- Port number to specify in the Kubernetes job object
755
- compute_pool : str, optional, default None
756
- Compute pool to be used for for this step.
757
- If not specified, any accessible compute pool within the perimeter is used.
758
- hostname_resolution_timeout: int, default 10 * 60
759
- Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
760
- Only applicable when @parallel is used.
761
- qos: str, default: Burstable
762
- Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
763
-
764
- security_context: Dict[str, Any], optional, default None
765
- Container security context. Applies to the task container. Allows the following keys:
766
- - privileged: bool, optional, default None
767
- - allow_privilege_escalation: bool, optional, default None
768
- - run_as_user: int, optional, default None
769
- - run_as_group: int, optional, default None
770
- - run_as_non_root: bool, optional, default None
626
+ vars : Dict[str, str], default {}
627
+ Dictionary of environment variables to set.
771
628
  """
772
629
  ...
773
630
 
774
- 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]]]:
631
+ @typing.overload
632
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
633
+ ...
634
+
635
+ @typing.overload
636
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
637
+ ...
638
+
639
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
775
640
  """
776
- Set up an S3 proxy that caches objects in an external, S3‑compatible bucket
777
- for S3 read and write requests.
778
-
779
- This decorator requires an integration in the Outerbounds platform that
780
- points to an external bucket. It affects S3 operations performed via
781
- Metaflow's `get_aws_client` and `S3` within a `@step`.
782
-
783
- Read operations
784
- ---------------
785
- All read operations pass through the proxy. If an object does not already
786
- exist in the external bucket, it is cached there. For example, if code reads
787
- from buckets `FOO` and `BAR` using the `S3` interface, objects from both
788
- buckets are cached in the external bucket.
789
-
790
- During task execution, all S3‑related read requests are routed through the
791
- proxy:
792
- - If the object is present in the external object store, the proxy
793
- streams it directly from there without accessing the requested origin
794
- bucket.
795
- - If the object is not present in the external storage, the proxy
796
- fetches it from the requested bucket, caches it in the external
797
- storage, and streams the response from the origin bucket.
798
-
799
- Warning
800
- -------
801
- All READ operations (e.g., GetObject, HeadObject) pass through the external
802
- bucket regardless of the bucket specified in user code. Even
803
- `S3(run=self)` and `S3(s3root="mybucketfoo")` requests go through the
804
- external bucket cache.
805
-
806
- Write operations
807
- ----------------
808
- Write behavior is controlled by the `write_mode` parameter, which determines
809
- whether writes also persist objects in the cache.
810
-
811
- `write_mode` values:
812
- - `origin-and-cache`: objects are written both to the cache and to their
813
- intended origin bucket.
814
- - `origin`: objects are written only to their intended origin bucket.
641
+ Specifies environment variables to be set prior to the execution of a step.
815
642
 
816
643
 
817
644
  Parameters
818
645
  ----------
819
- integration_name : str, optional
820
- [Outerbounds integration name](https://docs.outerbounds.com/outerbounds/configuring-secrets/#integrations-view)
821
- that holds the configuration for the external, S3‑compatible object
822
- storage bucket. If not specified, the only available S3 proxy
823
- integration in the namespace is used (fails if multiple exist).
824
- write_mode : str, optional
825
- Controls whether writes also go to the external bucket.
826
- - `origin` (default)
827
- - `origin-and-cache`
828
- debug : bool, optional
829
- Enables debug logging for proxy operations.
646
+ vars : Dict[str, str], default {}
647
+ Dictionary of environment variables to set.
830
648
  """
831
649
  ...
832
650
 
833
- def huggingface_hub(*, temp_dir_root: typing.Optional[str] = None, cache_scope: typing.Optional[str] = None, load: typing.Union[typing.List[str], typing.List[typing.Tuple[typing.Dict, str]], typing.List[typing.Tuple[str, str]], typing.List[typing.Dict], 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]]]:
651
+ @typing.overload
652
+ def app_deploy(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
834
653
  """
835
- Decorator that helps cache, version, and store models/datasets from the Hugging Face Hub.
654
+ Decorator prototype for all step decorators. This function gets specialized
655
+ and imported for all decorators types by _import_plugin_decorators().
656
+ """
657
+ ...
658
+
659
+ @typing.overload
660
+ def app_deploy(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
661
+ ...
662
+
663
+ def app_deploy(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
664
+ """
665
+ Decorator prototype for all step decorators. This function gets specialized
666
+ and imported for all decorators types by _import_plugin_decorators().
667
+ """
668
+ ...
669
+
670
+ @typing.overload
671
+ 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]]]:
672
+ """
673
+ Specifies the number of times the task corresponding
674
+ to a step needs to be retried.
836
675
 
837
- Examples
838
- --------
676
+ This decorator is useful for handling transient errors, such as networking issues.
677
+ If your task contains operations that can't be retried safely, e.g. database updates,
678
+ it is advisable to annotate it with `@retry(times=0)`.
839
679
 
840
- ```python
841
- # **Usage: creating references to models from the Hugging Face Hub that may be loaded in downstream steps**
842
- @huggingface_hub
843
- @step
844
- def pull_model_from_huggingface(self):
845
- # `current.huggingface_hub.snapshot_download` downloads the model from the Hugging Face Hub
846
- # and saves it in the backend storage based on the model's `repo_id`. If there exists a model
847
- # with the same `repo_id` in the backend storage, it will not download the model again. The return
848
- # value of the function is a reference to the model in the backend storage.
849
- # This reference can be used to load the model in the subsequent steps via `@model(load=["llama_model"])`
680
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
681
+ decorator will execute a no-op task after all retries have been exhausted,
682
+ ensuring that the flow execution can continue.
850
683
 
851
- self.model_id = "mistralai/Mistral-7B-Instruct-v0.1"
852
- self.llama_model = current.huggingface_hub.snapshot_download(
853
- repo_id=self.model_id,
854
- allow_patterns=["*.safetensors", "*.json", "tokenizer.*"],
855
- )
856
- self.next(self.train)
857
684
 
858
- # **Usage: explicitly loading models at runtime from the Hugging Face Hub or from cache (from Metaflow's datastore)**
859
- @huggingface_hub
860
- @step
861
- def run_training(self):
862
- # Temporary directory (auto-cleaned on exit)
863
- with current.huggingface_hub.load(
864
- repo_id="google-bert/bert-base-uncased",
865
- allow_patterns=["*.bin"],
866
- ) as local_path:
867
- # Use files under local_path
868
- train_model(local_path)
869
- ...
685
+ Parameters
686
+ ----------
687
+ times : int, default 3
688
+ Number of times to retry this task.
689
+ minutes_between_retries : int, default 2
690
+ Number of minutes between retries.
691
+ """
692
+ ...
693
+
694
+ @typing.overload
695
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
696
+ ...
697
+
698
+ @typing.overload
699
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
700
+ ...
701
+
702
+ 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):
703
+ """
704
+ Specifies the number of times the task corresponding
705
+ to a step needs to be retried.
870
706
 
871
- # **Usage: loading models directly from the Hugging Face Hub or from cache (from Metaflow's datastore)**
707
+ This decorator is useful for handling transient errors, such as networking issues.
708
+ If your task contains operations that can't be retried safely, e.g. database updates,
709
+ it is advisable to annotate it with `@retry(times=0)`.
872
710
 
873
- @huggingface_hub(load=["mistralai/Mistral-7B-Instruct-v0.1"])
874
- @step
875
- def pull_model_from_huggingface(self):
876
- path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
711
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
712
+ decorator will execute a no-op task after all retries have been exhausted,
713
+ ensuring that the flow execution can continue.
877
714
 
878
- @huggingface_hub(load=[("mistralai/Mistral-7B-Instruct-v0.1", "/my-directory"), ("myorg/mistral-lora", "/my-lora-directory")])
879
- @step
880
- def finetune_model(self):
881
- path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
882
- # path_to_model will be /my-directory
883
715
 
716
+ Parameters
717
+ ----------
718
+ times : int, default 3
719
+ Number of times to retry this task.
720
+ minutes_between_retries : int, default 2
721
+ Number of minutes between retries.
722
+ """
723
+ ...
724
+
725
+ @typing.overload
726
+ def timeout(*, seconds: int = 0, minutes: int = 0, hours: int = 0) -> 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]]]:
727
+ """
728
+ Specifies a timeout for your step.
884
729
 
885
- # Takes all the arguments passed to `snapshot_download`
886
- # except for `local_dir`
887
- @huggingface_hub(load=[
888
- {
889
- "repo_id": "mistralai/Mistral-7B-Instruct-v0.1",
890
- },
891
- {
892
- "repo_id": "myorg/mistral-lora",
893
- "repo_type": "model",
894
- },
895
- ])
896
- @step
897
- def finetune_model(self):
898
- path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
899
- # path_to_model will be /my-directory
900
- ```
730
+ This decorator is useful if this step may hang indefinitely.
901
731
 
732
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
733
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
734
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
902
735
 
903
- Parameters
904
- ----------
905
- temp_dir_root : str, optional
906
- The root directory that will hold the temporary directory where objects will be downloaded.
736
+ Note that all the values specified in parameters are added together so if you specify
737
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
907
738
 
908
- cache_scope : str, optional
909
- The scope of the cache. Can be `checkpoint` / `flow` / `global`.
910
- - `checkpoint` (default): All repos are stored like objects saved by `@checkpoint`.
911
- i.e., the cached path is derived from the namespace, flow, step, and Metaflow foreach iteration.
912
- Any repo downloaded under this scope will only be retrieved from the cache when the step runs under the same namespace in the same flow (at the same foreach index).
913
739
 
914
- - `flow`: All repos are cached under the flow, regardless of namespace.
915
- i.e., the cached path is derived solely from the flow name.
916
- When to use this mode: (1) Multiple users are executing the same flow and want shared access to the repos cached by the decorator. (2) Multiple versions of a flow are deployed, all needing access to the same repos cached by the decorator.
740
+ Parameters
741
+ ----------
742
+ seconds : int, default 0
743
+ Number of seconds to wait prior to timing out.
744
+ minutes : int, default 0
745
+ Number of minutes to wait prior to timing out.
746
+ hours : int, default 0
747
+ Number of hours to wait prior to timing out.
748
+ """
749
+ ...
750
+
751
+ @typing.overload
752
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
753
+ ...
754
+
755
+ @typing.overload
756
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
757
+ ...
758
+
759
+ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, seconds: int = 0, minutes: int = 0, hours: int = 0):
760
+ """
761
+ Specifies a timeout for your step.
917
762
 
918
- - `global`: All repos are cached under a globally static path.
919
- i.e., the base path of the cache is static and all repos are stored under it.
920
- When to use this mode:
921
- - All repos from the Hugging Face Hub need to be shared by users across all flow executions.
922
- - Each caching scope comes with its own trade-offs:
923
- - `checkpoint`:
924
- - Has explicit control over when caches are populated (controlled by the same flow that has the `@huggingface_hub` decorator) but ends up hitting the Hugging Face Hub more often if there are many users/namespaces/steps.
925
- - Since objects are written on a `namespace/flow/step` basis, the blast radius of a bad checkpoint is limited to a particular flow in a namespace.
926
- - `flow`:
927
- - Has less control over when caches are populated (can be written by any execution instance of a flow from any namespace) but results in more cache hits.
928
- - The blast radius of a bad checkpoint is limited to all runs of a particular flow.
929
- - It doesn't promote cache reuse across flows.
930
- - `global`:
931
- - Has no control over when caches are populated (can be written by any flow execution) but has the highest cache hit rate.
932
- - It promotes cache reuse across flows.
933
- - The blast radius of a bad checkpoint spans every flow that could be using a particular repo.
763
+ This decorator is useful if this step may hang indefinitely.
934
764
 
935
- load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
936
- The list of repos (models/datasets) to load.
765
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
766
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
767
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
937
768
 
938
- Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
769
+ Note that all the values specified in parameters are added together so if you specify
770
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
939
771
 
940
- - If repo (model/dataset) is not found in the datastore:
941
- - Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
942
- - Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
943
- - All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
944
772
 
945
- - If repo is found in the datastore:
946
- - Loads it directly from datastore to local path (can be temporary directory or specified path)
773
+ Parameters
774
+ ----------
775
+ seconds : int, default 0
776
+ Number of seconds to wait prior to timing out.
777
+ minutes : int, default 0
778
+ Number of minutes to wait prior to timing out.
779
+ hours : int, default 0
780
+ Number of hours to wait prior to timing out.
781
+ """
782
+ ...
783
+
784
+ @typing.overload
785
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
786
+ """
787
+ Decorator prototype for all step decorators. This function gets specialized
788
+ and imported for all decorators types by _import_plugin_decorators().
789
+ """
790
+ ...
791
+
792
+ @typing.overload
793
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
794
+ ...
795
+
796
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
797
+ """
798
+ Decorator prototype for all step decorators. This function gets specialized
799
+ and imported for all decorators types by _import_plugin_decorators().
947
800
  """
948
801
  ...
949
802
 
@@ -964,13 +817,72 @@ def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepF
964
817
  """
965
818
  ...
966
819
 
967
- def coreweave_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]]]:
820
+ 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]]]:
968
821
  """
969
- `@coreweave_s3_proxy` is a CoreWeave-specific S3 Proxy decorator for routing S3 requests through a local proxy service.
970
- It exists to make it easier for users to know that this decorator should only be used with
971
- a Neo Cloud like CoreWeave. The underlying mechanics of the decorator is the same as the `@s3_proxy`:
822
+ Specifies that this step should execute on DGX cloud.
823
+
824
+
825
+ Parameters
826
+ ----------
827
+ gpu : int
828
+ Number of GPUs to use.
829
+ gpu_type : str
830
+ Type of Nvidia GPU to use.
831
+ """
832
+ ...
833
+
834
+ 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]]]:
835
+ """
836
+ This decorator is used to run vllm APIs as Metaflow task sidecars.
837
+
838
+ User code call
839
+ --------------
840
+ @vllm(
841
+ model="...",
842
+ ...
843
+ )
844
+
845
+ Valid backend options
846
+ ---------------------
847
+ - 'local': Run as a separate process on the local task machine.
848
+
849
+ Valid model options
850
+ -------------------
851
+ Any HuggingFace model identifier, e.g. 'meta-llama/Llama-3.2-1B'
852
+
853
+ NOTE: vLLM's OpenAI-compatible server serves ONE model per server instance.
854
+ If you need multiple models, you must create multiple @vllm decorators.
972
855
 
973
856
 
857
+ Parameters
858
+ ----------
859
+ model: str
860
+ HuggingFace model identifier to be served by vLLM.
861
+ backend: str
862
+ Determines where and how to run the vLLM process.
863
+ openai_api_server: bool
864
+ Whether to use OpenAI-compatible API server mode (subprocess) instead of native engine.
865
+ Default is False (uses native engine).
866
+ Set to True for backward compatibility with existing code.
867
+ debug: bool
868
+ Whether to turn on verbose debugging logs.
869
+ card_refresh_interval: int
870
+ Interval in seconds for refreshing the vLLM status card.
871
+ Only used when openai_api_server=True.
872
+ max_retries: int
873
+ Maximum number of retries checking for vLLM server startup.
874
+ Only used when openai_api_server=True.
875
+ retry_alert_frequency: int
876
+ Frequency of alert logs for vLLM server startup retries.
877
+ Only used when openai_api_server=True.
878
+ engine_args : dict
879
+ Additional keyword arguments to pass to the vLLM engine.
880
+ For example, `tensor_parallel_size=2`.
881
+ """
882
+ ...
883
+
884
+ 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]]]:
885
+ """
974
886
  Set up an S3 proxy that caches objects in an external, S3‑compatible bucket
975
887
  for S3 read and write requests.
976
888
 
@@ -1028,25 +940,6 @@ def coreweave_s3_proxy(*, integration_name: typing.Optional[str] = None, write_m
1028
940
  """
1029
941
  ...
1030
942
 
1031
- @typing.overload
1032
- def app_deploy(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1033
- """
1034
- Decorator prototype for all step decorators. This function gets specialized
1035
- and imported for all decorators types by _import_plugin_decorators().
1036
- """
1037
- ...
1038
-
1039
- @typing.overload
1040
- def app_deploy(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1041
- ...
1042
-
1043
- def app_deploy(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
1044
- """
1045
- Decorator prototype for all step decorators. This function gets specialized
1046
- and imported for all decorators types by _import_plugin_decorators().
1047
- """
1048
- ...
1049
-
1050
943
  @typing.overload
1051
944
  def resources(*, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = 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]]]:
1052
945
  """
@@ -1127,112 +1020,218 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
1127
1020
  ...
1128
1021
 
1129
1022
  @typing.overload
1130
- 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]]]:
1023
+ def test_append_card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1131
1024
  """
1132
- Specifies the PyPI packages for the step.
1025
+ A simple decorator that demonstrates using CardDecoratorInjector
1026
+ to inject a card and render simple markdown content.
1027
+ """
1028
+ ...
1029
+
1030
+ @typing.overload
1031
+ def test_append_card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1032
+ ...
1033
+
1034
+ def test_append_card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
1035
+ """
1036
+ A simple decorator that demonstrates using CardDecoratorInjector
1037
+ to inject a card and render simple markdown content.
1038
+ """
1039
+ ...
1040
+
1041
+ @typing.overload
1042
+ def conda(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> 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]]]:
1043
+ """
1044
+ Specifies the Conda environment for the step.
1133
1045
 
1134
1046
  Information in this decorator will augment any
1135
- attributes set in the `@pyi_base` flow-level decorator. Hence,
1136
- you can use `@pypi_base` to set packages required by all
1137
- steps and use `@pypi` to specify step-specific overrides.
1047
+ attributes set in the `@conda_base` flow-level decorator. Hence,
1048
+ you can use `@conda_base` to set packages required by all
1049
+ steps and use `@conda` to specify step-specific overrides.
1138
1050
 
1139
1051
 
1140
1052
  Parameters
1141
1053
  ----------
1142
- packages : Dict[str, str], default: {}
1054
+ packages : Dict[str, str], default {}
1143
1055
  Packages to use for this step. The key is the name of the package
1144
1056
  and the value is the version to use.
1145
- python : str, optional, default: None
1057
+ libraries : Dict[str, str], default {}
1058
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1059
+ python : str, optional, default None
1146
1060
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1147
1061
  that the version used will correspond to the version of the Python interpreter used to start the run.
1062
+ disabled : bool, default False
1063
+ If set to True, disables @conda.
1148
1064
  """
1149
1065
  ...
1150
1066
 
1151
1067
  @typing.overload
1152
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1068
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1153
1069
  ...
1154
1070
 
1155
1071
  @typing.overload
1156
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1072
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1157
1073
  ...
1158
1074
 
1159
- 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):
1075
+ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
1160
1076
  """
1161
- Specifies the PyPI packages for the step.
1077
+ Specifies the Conda environment for the step.
1162
1078
 
1163
1079
  Information in this decorator will augment any
1164
- attributes set in the `@pyi_base` flow-level decorator. Hence,
1165
- you can use `@pypi_base` to set packages required by all
1166
- steps and use `@pypi` to specify step-specific overrides.
1080
+ attributes set in the `@conda_base` flow-level decorator. Hence,
1081
+ you can use `@conda_base` to set packages required by all
1082
+ steps and use `@conda` to specify step-specific overrides.
1167
1083
 
1168
1084
 
1169
1085
  Parameters
1170
1086
  ----------
1171
- packages : Dict[str, str], default: {}
1087
+ packages : Dict[str, str], default {}
1172
1088
  Packages to use for this step. The key is the name of the package
1173
1089
  and the value is the version to use.
1174
- python : str, optional, default: None
1090
+ libraries : Dict[str, str], default {}
1091
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1092
+ python : str, optional, default None
1175
1093
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1176
1094
  that the version used will correspond to the version of the Python interpreter used to start the run.
1095
+ disabled : bool, default False
1096
+ If set to True, disables @conda.
1177
1097
  """
1178
1098
  ...
1179
1099
 
1180
1100
  @typing.overload
1181
- def timeout(*, seconds: int = 0, minutes: int = 0, hours: int = 0) -> 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]]]:
1101
+ 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]]]:
1182
1102
  """
1183
- Specifies a timeout for your step.
1184
-
1185
- This decorator is useful if this step may hang indefinitely.
1186
-
1187
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1188
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
1189
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
1190
-
1191
- Note that all the values specified in parameters are added together so if you specify
1192
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1193
-
1103
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1194
1104
 
1195
- Parameters
1196
- ----------
1197
- seconds : int, default 0
1198
- Number of seconds to wait prior to timing out.
1199
- minutes : int, default 0
1200
- Number of minutes to wait prior to timing out.
1201
- hours : int, default 0
1202
- Number of hours to wait prior to timing out.
1105
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1106
+
1107
+
1108
+ Parameters
1109
+ ----------
1110
+ type : str, default 'default'
1111
+ Card type.
1112
+ id : str, optional, default None
1113
+ If multiple cards are present, use this id to identify this card.
1114
+ options : Dict[str, Any], default {}
1115
+ Options passed to the card. The contents depend on the card type.
1116
+ timeout : int, default 45
1117
+ Interrupt reporting if it takes more than this many seconds.
1203
1118
  """
1204
1119
  ...
1205
1120
 
1206
1121
  @typing.overload
1207
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1122
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1208
1123
  ...
1209
1124
 
1210
1125
  @typing.overload
1211
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1126
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1212
1127
  ...
1213
1128
 
1214
- def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, seconds: int = 0, minutes: int = 0, hours: int = 0):
1129
+ 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):
1215
1130
  """
1216
- Specifies a timeout for your step.
1131
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1217
1132
 
1218
- This decorator is useful if this step may hang indefinitely.
1133
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1219
1134
 
1220
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1221
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
1222
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
1223
1135
 
1224
- Note that all the values specified in parameters are added together so if you specify
1225
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1136
+ Parameters
1137
+ ----------
1138
+ type : str, default 'default'
1139
+ Card type.
1140
+ id : str, optional, default None
1141
+ If multiple cards are present, use this id to identify this card.
1142
+ options : Dict[str, Any], default {}
1143
+ Options passed to the card. The contents depend on the card type.
1144
+ timeout : int, default 45
1145
+ Interrupt reporting if it takes more than this many seconds.
1146
+ """
1147
+ ...
1148
+
1149
+ 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]]]:
1150
+ """
1151
+ Specifies that this step should execute on Kubernetes.
1226
1152
 
1227
1153
 
1228
1154
  Parameters
1229
1155
  ----------
1230
- seconds : int, default 0
1231
- Number of seconds to wait prior to timing out.
1232
- minutes : int, default 0
1233
- Number of minutes to wait prior to timing out.
1234
- hours : int, default 0
1235
- Number of hours to wait prior to timing out.
1156
+ cpu : int, default 1
1157
+ Number of CPUs required for this step. If `@resources` is
1158
+ also present, the maximum value from all decorators is used.
1159
+ memory : int, default 4096
1160
+ Memory size (in MB) required for this step. If
1161
+ `@resources` is also present, the maximum value from all decorators is
1162
+ used.
1163
+ disk : int, default 10240
1164
+ Disk size (in MB) required for this step. If
1165
+ `@resources` is also present, the maximum value from all decorators is
1166
+ used.
1167
+ image : str, optional, default None
1168
+ Docker image to use when launching on Kubernetes. If not specified, and
1169
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
1170
+ not, a default Docker image mapping to the current version of Python is used.
1171
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
1172
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
1173
+ image_pull_secrets: List[str], default []
1174
+ The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
1175
+ Kubernetes image pull secrets to use when pulling container images
1176
+ in Kubernetes.
1177
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
1178
+ Kubernetes service account to use when launching pod in Kubernetes.
1179
+ secrets : List[str], optional, default None
1180
+ Kubernetes secrets to use when launching pod in Kubernetes. These
1181
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
1182
+ in Metaflow configuration.
1183
+ node_selector: Union[Dict[str,str], str], optional, default None
1184
+ Kubernetes node selector(s) to apply to the pod running the task.
1185
+ Can be passed in as a comma separated string of values e.g.
1186
+ 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
1187
+ {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
1188
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
1189
+ Kubernetes namespace to use when launching pod in Kubernetes.
1190
+ gpu : int, optional, default None
1191
+ Number of GPUs required for this step. A value of zero implies that
1192
+ the scheduled node should not have GPUs.
1193
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
1194
+ The vendor of the GPUs to be used for this step.
1195
+ tolerations : List[Dict[str,str]], default []
1196
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
1197
+ Kubernetes tolerations to use when launching pod in Kubernetes.
1198
+ labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
1199
+ Kubernetes labels to use when launching pod in Kubernetes.
1200
+ annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
1201
+ Kubernetes annotations to use when launching pod in Kubernetes.
1202
+ use_tmpfs : bool, default False
1203
+ This enables an explicit tmpfs mount for this step.
1204
+ tmpfs_tempdir : bool, default True
1205
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
1206
+ tmpfs_size : int, optional, default: None
1207
+ The value for the size (in MiB) of the tmpfs mount for this step.
1208
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
1209
+ memory allocated for this step.
1210
+ tmpfs_path : str, optional, default /metaflow_temp
1211
+ Path to tmpfs mount for this step.
1212
+ persistent_volume_claims : Dict[str, str], optional, default None
1213
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
1214
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
1215
+ shared_memory: int, optional
1216
+ Shared memory size (in MiB) required for this step
1217
+ port: int, optional
1218
+ Port number to specify in the Kubernetes job object
1219
+ compute_pool : str, optional, default None
1220
+ Compute pool to be used for for this step.
1221
+ If not specified, any accessible compute pool within the perimeter is used.
1222
+ hostname_resolution_timeout: int, default 10 * 60
1223
+ Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
1224
+ Only applicable when @parallel is used.
1225
+ qos: str, default: Burstable
1226
+ Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
1227
+
1228
+ security_context: Dict[str, Any], optional, default None
1229
+ Container security context. Applies to the task container. Allows the following keys:
1230
+ - privileged: bool, optional, default None
1231
+ - allow_privilege_escalation: bool, optional, default None
1232
+ - run_as_user: int, optional, default None
1233
+ - run_as_group: int, optional, default None
1234
+ - run_as_non_root: bool, optional, default None
1236
1235
  """
1237
1236
  ...
1238
1237
 
@@ -1279,233 +1278,286 @@ def ollama(*, models: list, backend: str, force_pull: bool, cache_update_policy:
1279
1278
  """
1280
1279
  ...
1281
1280
 
1282
- @typing.overload
1283
- 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]]]:
1281
+ def huggingface_hub(*, temp_dir_root: typing.Optional[str] = None, cache_scope: typing.Optional[str] = None, load: typing.Union[typing.List[str], typing.List[typing.Tuple[typing.Dict, str]], typing.List[typing.Tuple[str, str]], typing.List[typing.Dict], 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]]]:
1284
1282
  """
1285
- Specifies secrets to be retrieved and injected as environment variables prior to
1286
- the execution of a step.
1283
+ Decorator that helps cache, version, and store models/datasets from the Hugging Face Hub.
1287
1284
 
1285
+ Examples
1286
+ --------
1288
1287
 
1289
- Parameters
1290
- ----------
1291
- sources : List[Union[str, Dict[str, Any]]], default: []
1292
- List of secret specs, defining how the secrets are to be retrieved
1293
- role : str, optional, default: None
1294
- Role to use for fetching secrets
1295
- """
1296
- ...
1297
-
1298
- @typing.overload
1299
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1300
- ...
1301
-
1302
- @typing.overload
1303
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1304
- ...
1305
-
1306
- 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):
1307
- """
1308
- Specifies secrets to be retrieved and injected as environment variables prior to
1309
- the execution of a step.
1288
+ ```python
1289
+ # **Usage: creating references to models from the Hugging Face Hub that may be loaded in downstream steps**
1290
+ @huggingface_hub
1291
+ @step
1292
+ def pull_model_from_huggingface(self):
1293
+ # `current.huggingface_hub.snapshot_download` downloads the model from the Hugging Face Hub
1294
+ # and saves it in the backend storage based on the model's `repo_id`. If there exists a model
1295
+ # with the same `repo_id` in the backend storage, it will not download the model again. The return
1296
+ # value of the function is a reference to the model in the backend storage.
1297
+ # This reference can be used to load the model in the subsequent steps via `@model(load=["llama_model"])`
1298
+
1299
+ self.model_id = "mistralai/Mistral-7B-Instruct-v0.1"
1300
+ self.llama_model = current.huggingface_hub.snapshot_download(
1301
+ repo_id=self.model_id,
1302
+ allow_patterns=["*.safetensors", "*.json", "tokenizer.*"],
1303
+ )
1304
+ self.next(self.train)
1305
+
1306
+ # **Usage: explicitly loading models at runtime from the Hugging Face Hub or from cache (from Metaflow's datastore)**
1307
+ @huggingface_hub
1308
+ @step
1309
+ def run_training(self):
1310
+ # Temporary directory (auto-cleaned on exit)
1311
+ with current.huggingface_hub.load(
1312
+ repo_id="google-bert/bert-base-uncased",
1313
+ allow_patterns=["*.bin"],
1314
+ ) as local_path:
1315
+ # Use files under local_path
1316
+ train_model(local_path)
1317
+ ...
1318
+
1319
+ # **Usage: loading models directly from the Hugging Face Hub or from cache (from Metaflow's datastore)**
1320
+
1321
+ @huggingface_hub(load=["mistralai/Mistral-7B-Instruct-v0.1"])
1322
+ @step
1323
+ def pull_model_from_huggingface(self):
1324
+ path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
1325
+
1326
+ @huggingface_hub(load=[("mistralai/Mistral-7B-Instruct-v0.1", "/my-directory"), ("myorg/mistral-lora", "/my-lora-directory")])
1327
+ @step
1328
+ def finetune_model(self):
1329
+ path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
1330
+ # path_to_model will be /my-directory
1331
+
1332
+
1333
+ # Takes all the arguments passed to `snapshot_download`
1334
+ # except for `local_dir`
1335
+ @huggingface_hub(load=[
1336
+ {
1337
+ "repo_id": "mistralai/Mistral-7B-Instruct-v0.1",
1338
+ },
1339
+ {
1340
+ "repo_id": "myorg/mistral-lora",
1341
+ "repo_type": "model",
1342
+ },
1343
+ ])
1344
+ @step
1345
+ def finetune_model(self):
1346
+ path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
1347
+ # path_to_model will be /my-directory
1348
+ ```
1310
1349
 
1311
1350
 
1312
1351
  Parameters
1313
1352
  ----------
1314
- sources : List[Union[str, Dict[str, Any]]], default: []
1315
- List of secret specs, defining how the secrets are to be retrieved
1316
- role : str, optional, default: None
1317
- Role to use for fetching secrets
1318
- """
1319
- ...
1320
-
1321
- @typing.overload
1322
- 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]]]:
1323
- """
1324
- Creates a human-readable report, a Metaflow Card, after this step completes.
1353
+ temp_dir_root : str, optional
1354
+ The root directory that will hold the temporary directory where objects will be downloaded.
1355
+
1356
+ cache_scope : str, optional
1357
+ The scope of the cache. Can be `checkpoint` / `flow` / `global`.
1358
+ - `checkpoint` (default): All repos are stored like objects saved by `@checkpoint`.
1359
+ i.e., the cached path is derived from the namespace, flow, step, and Metaflow foreach iteration.
1360
+ Any repo downloaded under this scope will only be retrieved from the cache when the step runs under the same namespace in the same flow (at the same foreach index).
1361
+
1362
+ - `flow`: All repos are cached under the flow, regardless of namespace.
1363
+ i.e., the cached path is derived solely from the flow name.
1364
+ When to use this mode: (1) Multiple users are executing the same flow and want shared access to the repos cached by the decorator. (2) Multiple versions of a flow are deployed, all needing access to the same repos cached by the decorator.
1365
+
1366
+ - `global`: All repos are cached under a globally static path.
1367
+ i.e., the base path of the cache is static and all repos are stored under it.
1368
+ When to use this mode:
1369
+ - All repos from the Hugging Face Hub need to be shared by users across all flow executions.
1370
+ - Each caching scope comes with its own trade-offs:
1371
+ - `checkpoint`:
1372
+ - Has explicit control over when caches are populated (controlled by the same flow that has the `@huggingface_hub` decorator) but ends up hitting the Hugging Face Hub more often if there are many users/namespaces/steps.
1373
+ - Since objects are written on a `namespace/flow/step` basis, the blast radius of a bad checkpoint is limited to a particular flow in a namespace.
1374
+ - `flow`:
1375
+ - Has less control over when caches are populated (can be written by any execution instance of a flow from any namespace) but results in more cache hits.
1376
+ - The blast radius of a bad checkpoint is limited to all runs of a particular flow.
1377
+ - It doesn't promote cache reuse across flows.
1378
+ - `global`:
1379
+ - Has no control over when caches are populated (can be written by any flow execution) but has the highest cache hit rate.
1380
+ - It promotes cache reuse across flows.
1381
+ - The blast radius of a bad checkpoint spans every flow that could be using a particular repo.
1325
1382
 
1326
- Note that you may add multiple `@card` decorators in a step with different parameters.
1383
+ load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
1384
+ The list of repos (models/datasets) to load.
1327
1385
 
1386
+ Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
1328
1387
 
1329
- Parameters
1330
- ----------
1331
- type : str, default 'default'
1332
- Card type.
1333
- id : str, optional, default None
1334
- If multiple cards are present, use this id to identify this card.
1335
- options : Dict[str, Any], default {}
1336
- Options passed to the card. The contents depend on the card type.
1337
- timeout : int, default 45
1338
- Interrupt reporting if it takes more than this many seconds.
1388
+ - If repo (model/dataset) is not found in the datastore:
1389
+ - Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
1390
+ - Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
1391
+ - All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
1392
+
1393
+ - If repo is found in the datastore:
1394
+ - Loads it directly from datastore to local path (can be temporary directory or specified path)
1339
1395
  """
1340
1396
  ...
1341
1397
 
1342
- @typing.overload
1343
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1344
- ...
1345
-
1346
- @typing.overload
1347
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1348
- ...
1349
-
1350
- 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):
1398
+ def coreweave_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]]]:
1351
1399
  """
1352
- Creates a human-readable report, a Metaflow Card, after this step completes.
1400
+ `@coreweave_s3_proxy` is a CoreWeave-specific S3 Proxy decorator for routing S3 requests through a local proxy service.
1401
+ It exists to make it easier for users to know that this decorator should only be used with
1402
+ a Neo Cloud like CoreWeave. The underlying mechanics of the decorator is the same as the `@s3_proxy`:
1353
1403
 
1354
- Note that you may add multiple `@card` decorators in a step with different parameters.
1355
1404
 
1405
+ Set up an S3 proxy that caches objects in an external, S3‑compatible bucket
1406
+ for S3 read and write requests.
1356
1407
 
1357
- Parameters
1358
- ----------
1359
- type : str, default 'default'
1360
- Card type.
1361
- id : str, optional, default None
1362
- If multiple cards are present, use this id to identify this card.
1363
- options : Dict[str, Any], default {}
1364
- Options passed to the card. The contents depend on the card type.
1365
- timeout : int, default 45
1366
- Interrupt reporting if it takes more than this many seconds.
1367
- """
1368
- ...
1369
-
1370
- 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]]]:
1371
- """
1372
- This decorator is used to run vllm APIs as Metaflow task sidecars.
1408
+ This decorator requires an integration in the Outerbounds platform that
1409
+ points to an external bucket. It affects S3 operations performed via
1410
+ Metaflow's `get_aws_client` and `S3` within a `@step`.
1373
1411
 
1374
- User code call
1375
- --------------
1376
- @vllm(
1377
- model="...",
1378
- ...
1379
- )
1412
+ Read operations
1413
+ ---------------
1414
+ All read operations pass through the proxy. If an object does not already
1415
+ exist in the external bucket, it is cached there. For example, if code reads
1416
+ from buckets `FOO` and `BAR` using the `S3` interface, objects from both
1417
+ buckets are cached in the external bucket.
1380
1418
 
1381
- Valid backend options
1382
- ---------------------
1383
- - 'local': Run as a separate process on the local task machine.
1419
+ During task execution, all S3‑related read requests are routed through the
1420
+ proxy:
1421
+ - If the object is present in the external object store, the proxy
1422
+ streams it directly from there without accessing the requested origin
1423
+ bucket.
1424
+ - If the object is not present in the external storage, the proxy
1425
+ fetches it from the requested bucket, caches it in the external
1426
+ storage, and streams the response from the origin bucket.
1384
1427
 
1385
- Valid model options
1386
- -------------------
1387
- Any HuggingFace model identifier, e.g. 'meta-llama/Llama-3.2-1B'
1428
+ Warning
1429
+ -------
1430
+ All READ operations (e.g., GetObject, HeadObject) pass through the external
1431
+ bucket regardless of the bucket specified in user code. Even
1432
+ `S3(run=self)` and `S3(s3root="mybucketfoo")` requests go through the
1433
+ external bucket cache.
1388
1434
 
1389
- NOTE: vLLM's OpenAI-compatible server serves ONE model per server instance.
1390
- If you need multiple models, you must create multiple @vllm decorators.
1435
+ Write operations
1436
+ ----------------
1437
+ Write behavior is controlled by the `write_mode` parameter, which determines
1438
+ whether writes also persist objects in the cache.
1439
+
1440
+ `write_mode` values:
1441
+ - `origin-and-cache`: objects are written both to the cache and to their
1442
+ intended origin bucket.
1443
+ - `origin`: objects are written only to their intended origin bucket.
1391
1444
 
1392
1445
 
1393
1446
  Parameters
1394
1447
  ----------
1395
- model: str
1396
- HuggingFace model identifier to be served by vLLM.
1397
- backend: str
1398
- Determines where and how to run the vLLM process.
1399
- openai_api_server: bool
1400
- Whether to use OpenAI-compatible API server mode (subprocess) instead of native engine.
1401
- Default is False (uses native engine).
1402
- Set to True for backward compatibility with existing code.
1403
- debug: bool
1404
- Whether to turn on verbose debugging logs.
1405
- card_refresh_interval: int
1406
- Interval in seconds for refreshing the vLLM status card.
1407
- Only used when openai_api_server=True.
1408
- max_retries: int
1409
- Maximum number of retries checking for vLLM server startup.
1410
- Only used when openai_api_server=True.
1411
- retry_alert_frequency: int
1412
- Frequency of alert logs for vLLM server startup retries.
1413
- Only used when openai_api_server=True.
1414
- engine_args : dict
1415
- Additional keyword arguments to pass to the vLLM engine.
1416
- For example, `tensor_parallel_size=2`.
1448
+ integration_name : str, optional
1449
+ [Outerbounds integration name](https://docs.outerbounds.com/outerbounds/configuring-secrets/#integrations-view)
1450
+ that holds the configuration for the external, S3‑compatible object
1451
+ storage bucket. If not specified, the only available S3 proxy
1452
+ integration in the namespace is used (fails if multiple exist).
1453
+ write_mode : str, optional
1454
+ Controls whether writes also go to the external bucket.
1455
+ - `origin` (default)
1456
+ - `origin-and-cache`
1457
+ debug : bool, optional
1458
+ Enables debug logging for proxy operations.
1417
1459
  """
1418
1460
  ...
1419
1461
 
1420
1462
  @typing.overload
1421
- def conda(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> 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]]]:
1463
+ 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]]]:
1422
1464
  """
1423
- Specifies the Conda environment for the step.
1465
+ Specifies the PyPI packages for the step.
1424
1466
 
1425
1467
  Information in this decorator will augment any
1426
- attributes set in the `@conda_base` flow-level decorator. Hence,
1427
- you can use `@conda_base` to set packages required by all
1428
- steps and use `@conda` to specify step-specific overrides.
1468
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
1469
+ you can use `@pypi_base` to set packages required by all
1470
+ steps and use `@pypi` to specify step-specific overrides.
1429
1471
 
1430
1472
 
1431
1473
  Parameters
1432
1474
  ----------
1433
- packages : Dict[str, str], default {}
1475
+ packages : Dict[str, str], default: {}
1434
1476
  Packages to use for this step. The key is the name of the package
1435
1477
  and the value is the version to use.
1436
- libraries : Dict[str, str], default {}
1437
- Supported for backward compatibility. When used with packages, packages will take precedence.
1438
- python : str, optional, default None
1478
+ python : str, optional, default: None
1439
1479
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1440
1480
  that the version used will correspond to the version of the Python interpreter used to start the run.
1441
- disabled : bool, default False
1442
- If set to True, disables @conda.
1443
1481
  """
1444
1482
  ...
1445
1483
 
1446
1484
  @typing.overload
1447
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1485
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1448
1486
  ...
1449
1487
 
1450
1488
  @typing.overload
1451
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1489
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1452
1490
  ...
1453
1491
 
1454
- def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
1492
+ 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):
1455
1493
  """
1456
- Specifies the Conda environment for the step.
1494
+ Specifies the PyPI packages for the step.
1457
1495
 
1458
1496
  Information in this decorator will augment any
1459
- attributes set in the `@conda_base` flow-level decorator. Hence,
1460
- you can use `@conda_base` to set packages required by all
1461
- steps and use `@conda` to specify step-specific overrides.
1497
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
1498
+ you can use `@pypi_base` to set packages required by all
1499
+ steps and use `@pypi` to specify step-specific overrides.
1462
1500
 
1463
1501
 
1464
1502
  Parameters
1465
1503
  ----------
1466
- packages : Dict[str, str], default {}
1504
+ packages : Dict[str, str], default: {}
1467
1505
  Packages to use for this step. The key is the name of the package
1468
1506
  and the value is the version to use.
1469
- libraries : Dict[str, str], default {}
1470
- Supported for backward compatibility. When used with packages, packages will take precedence.
1471
- python : str, optional, default None
1507
+ python : str, optional, default: None
1472
1508
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1473
1509
  that the version used will correspond to the version of the Python interpreter used to start the run.
1474
- disabled : bool, default False
1475
- If set to True, disables @conda.
1476
1510
  """
1477
1511
  ...
1478
1512
 
1479
1513
  @typing.overload
1480
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1514
+ 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]]:
1481
1515
  """
1482
- Decorator prototype for all step decorators. This function gets specialized
1483
- and imported for all decorators types by _import_plugin_decorators().
1516
+ Specifies the times when the flow should be run when running on a
1517
+ production scheduler.
1518
+
1519
+
1520
+ Parameters
1521
+ ----------
1522
+ hourly : bool, default False
1523
+ Run the workflow hourly.
1524
+ daily : bool, default True
1525
+ Run the workflow daily.
1526
+ weekly : bool, default False
1527
+ Run the workflow weekly.
1528
+ cron : str, optional, default None
1529
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1530
+ specified by this expression.
1531
+ timezone : str, optional, default None
1532
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1533
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1484
1534
  """
1485
1535
  ...
1486
1536
 
1487
1537
  @typing.overload
1488
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1489
- ...
1490
-
1491
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
1492
- """
1493
- Decorator prototype for all step decorators. This function gets specialized
1494
- and imported for all decorators types by _import_plugin_decorators().
1495
- """
1538
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1496
1539
  ...
1497
1540
 
1498
- 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]]]:
1541
+ 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):
1499
1542
  """
1500
- Specifies that this step should execute on DGX cloud.
1543
+ Specifies the times when the flow should be run when running on a
1544
+ production scheduler.
1501
1545
 
1502
1546
 
1503
1547
  Parameters
1504
1548
  ----------
1505
- gpu : int
1506
- Number of GPUs to use.
1507
- gpu_type : str
1508
- Type of Nvidia GPU to use.
1549
+ hourly : bool, default False
1550
+ Run the workflow hourly.
1551
+ daily : bool, default True
1552
+ Run the workflow daily.
1553
+ weekly : bool, default False
1554
+ Run the workflow weekly.
1555
+ cron : str, optional, default None
1556
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1557
+ specified by this expression.
1558
+ timezone : str, optional, default None
1559
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1560
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1509
1561
  """
1510
1562
  ...
1511
1563
 
@@ -1544,35 +1596,8 @@ def project(*, name: str, branch: typing.Optional[str] = None, production: bool
1544
1596
  """
1545
1597
  ...
1546
1598
 
1547
- @typing.overload
1548
- 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]]:
1549
- """
1550
- Specifies the Conda environment for all steps of the flow.
1551
-
1552
- Use `@conda_base` to set common libraries required by all
1553
- steps and use `@conda` to specify step-specific additions.
1554
-
1555
-
1556
- Parameters
1557
- ----------
1558
- packages : Dict[str, str], default {}
1559
- Packages to use for this flow. The key is the name of the package
1560
- and the value is the version to use.
1561
- libraries : Dict[str, str], default {}
1562
- Supported for backward compatibility. When used with packages, packages will take precedence.
1563
- python : str, optional, default None
1564
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1565
- that the version used will correspond to the version of the Python interpreter used to start the run.
1566
- disabled : bool, default False
1567
- If set to True, disables Conda.
1568
- """
1569
- ...
1570
-
1571
- @typing.overload
1572
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1573
- ...
1574
-
1575
- 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):
1599
+ @typing.overload
1600
+ 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]]:
1576
1601
  """
1577
1602
  Specifies the Conda environment for all steps of the flow.
1578
1603
 
@@ -1596,136 +1621,29 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
1596
1621
  ...
1597
1622
 
1598
1623
  @typing.overload
1599
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1600
- """
1601
- Specifies the PyPI packages for all steps of the flow.
1602
-
1603
- Use `@pypi_base` to set common packages required by all
1604
- steps and use `@pypi` to specify step-specific overrides.
1605
-
1606
- Parameters
1607
- ----------
1608
- packages : Dict[str, str], default: {}
1609
- Packages to use for this flow. The key is the name of the package
1610
- and the value is the version to use.
1611
- python : str, optional, default: None
1612
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1613
- that the version used will correspond to the version of the Python interpreter used to start the run.
1614
- """
1615
- ...
1616
-
1617
- @typing.overload
1618
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1624
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1619
1625
  ...
1620
1626
 
1621
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1627
+ 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):
1622
1628
  """
1623
- Specifies the PyPI packages for all steps of the flow.
1629
+ Specifies the Conda environment for all steps of the flow.
1630
+
1631
+ Use `@conda_base` to set common libraries required by all
1632
+ steps and use `@conda` to specify step-specific additions.
1624
1633
 
1625
- Use `@pypi_base` to set common packages required by all
1626
- steps and use `@pypi` to specify step-specific overrides.
1627
1634
 
1628
1635
  Parameters
1629
1636
  ----------
1630
- packages : Dict[str, str], default: {}
1637
+ packages : Dict[str, str], default {}
1631
1638
  Packages to use for this flow. The key is the name of the package
1632
1639
  and the value is the version to use.
1633
- python : str, optional, default: None
1640
+ libraries : Dict[str, str], default {}
1641
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1642
+ python : str, optional, default None
1634
1643
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1635
1644
  that the version used will correspond to the version of the Python interpreter used to start the run.
1636
- """
1637
- ...
1638
-
1639
- @typing.overload
1640
- 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]]:
1641
- """
1642
- Specifies the event(s) that this flow depends on.
1643
-
1644
- ```
1645
- @trigger(event='foo')
1646
- ```
1647
- or
1648
- ```
1649
- @trigger(events=['foo', 'bar'])
1650
- ```
1651
-
1652
- Additionally, you can specify the parameter mappings
1653
- to map event payload to Metaflow parameters for the flow.
1654
- ```
1655
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1656
- ```
1657
- or
1658
- ```
1659
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1660
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1661
- ```
1662
-
1663
- 'parameters' can also be a list of strings and tuples like so:
1664
- ```
1665
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1666
- ```
1667
- This is equivalent to:
1668
- ```
1669
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1670
- ```
1671
-
1672
-
1673
- Parameters
1674
- ----------
1675
- event : Union[str, Dict[str, Any]], optional, default None
1676
- Event dependency for this flow.
1677
- events : List[Union[str, Dict[str, Any]]], default []
1678
- Events dependency for this flow.
1679
- options : Dict[str, Any], default {}
1680
- Backend-specific configuration for tuning eventing behavior.
1681
- """
1682
- ...
1683
-
1684
- @typing.overload
1685
- def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1686
- ...
1687
-
1688
- 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] = {}):
1689
- """
1690
- Specifies the event(s) that this flow depends on.
1691
-
1692
- ```
1693
- @trigger(event='foo')
1694
- ```
1695
- or
1696
- ```
1697
- @trigger(events=['foo', 'bar'])
1698
- ```
1699
-
1700
- Additionally, you can specify the parameter mappings
1701
- to map event payload to Metaflow parameters for the flow.
1702
- ```
1703
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1704
- ```
1705
- or
1706
- ```
1707
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1708
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1709
- ```
1710
-
1711
- 'parameters' can also be a list of strings and tuples like so:
1712
- ```
1713
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1714
- ```
1715
- This is equivalent to:
1716
- ```
1717
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1718
- ```
1719
-
1720
-
1721
- Parameters
1722
- ----------
1723
- event : Union[str, Dict[str, Any]], optional, default None
1724
- Event dependency for this flow.
1725
- events : List[Union[str, Dict[str, Any]]], default []
1726
- Events dependency for this flow.
1727
- options : Dict[str, Any], default {}
1728
- Backend-specific configuration for tuning eventing behavior.
1645
+ disabled : bool, default False
1646
+ If set to True, disables Conda.
1729
1647
  """
1730
1648
  ...
1731
1649
 
@@ -1772,104 +1690,87 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
1772
1690
  """
1773
1691
  ...
1774
1692
 
1775
- @typing.overload
1776
- 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]]:
1693
+ 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]]:
1777
1694
  """
1778
- Specifies the flow(s) that this flow depends on.
1779
-
1780
- ```
1781
- @trigger_on_finish(flow='FooFlow')
1782
- ```
1783
- or
1784
- ```
1785
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1786
- ```
1787
- This decorator respects the @project decorator and triggers the flow
1788
- when upstream runs within the same namespace complete successfully
1789
-
1790
- Additionally, you can specify project aware upstream flow dependencies
1791
- by specifying the fully qualified project_flow_name.
1792
- ```
1793
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1794
- ```
1795
- or
1796
- ```
1797
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1798
- ```
1799
-
1800
- You can also specify just the project or project branch (other values will be
1801
- inferred from the current project or project branch):
1802
- ```
1803
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1804
- ```
1805
-
1806
- Note that `branch` is typically one of:
1807
- - `prod`
1808
- - `user.bob`
1809
- - `test.my_experiment`
1810
- - `prod.staging`
1695
+ 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)
1696
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1697
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1698
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1699
+ starts only after all sensors finish.
1811
1700
 
1812
1701
 
1813
1702
  Parameters
1814
1703
  ----------
1815
- flow : Union[str, Dict[str, str]], optional, default None
1816
- Upstream flow dependency for this flow.
1817
- flows : List[Union[str, Dict[str, str]]], default []
1818
- Upstream flow dependencies for this flow.
1819
- options : Dict[str, Any], default {}
1820
- Backend-specific configuration for tuning eventing behavior.
1704
+ timeout : int
1705
+ Time, in seconds before the task times out and fails. (Default: 3600)
1706
+ poke_interval : int
1707
+ Time in seconds that the job should wait in between each try. (Default: 60)
1708
+ mode : str
1709
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1710
+ exponential_backoff : bool
1711
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1712
+ pool : str
1713
+ the slot pool this task should run in,
1714
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1715
+ soft_fail : bool
1716
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1717
+ name : str
1718
+ Name of the sensor on Airflow
1719
+ description : str
1720
+ Description of sensor in the Airflow UI
1721
+ bucket_key : Union[str, List[str]]
1722
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1723
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1724
+ bucket_name : str
1725
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1726
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1727
+ wildcard_match : bool
1728
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1729
+ aws_conn_id : str
1730
+ a reference to the s3 connection on Airflow. (Default: None)
1731
+ verify : bool
1732
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1821
1733
  """
1822
1734
  ...
1823
1735
 
1824
1736
  @typing.overload
1825
- def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1826
- ...
1827
-
1828
- 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] = {}):
1737
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1829
1738
  """
1830
- Specifies the flow(s) that this flow depends on.
1831
-
1832
- ```
1833
- @trigger_on_finish(flow='FooFlow')
1834
- ```
1835
- or
1836
- ```
1837
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1838
- ```
1839
- This decorator respects the @project decorator and triggers the flow
1840
- when upstream runs within the same namespace complete successfully
1841
-
1842
- Additionally, you can specify project aware upstream flow dependencies
1843
- by specifying the fully qualified project_flow_name.
1844
- ```
1845
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1846
- ```
1847
- or
1848
- ```
1849
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1850
- ```
1739
+ Specifies the PyPI packages for all steps of the flow.
1851
1740
 
1852
- You can also specify just the project or project branch (other values will be
1853
- inferred from the current project or project branch):
1854
- ```
1855
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1856
- ```
1741
+ Use `@pypi_base` to set common packages required by all
1742
+ steps and use `@pypi` to specify step-specific overrides.
1857
1743
 
1858
- Note that `branch` is typically one of:
1859
- - `prod`
1860
- - `user.bob`
1861
- - `test.my_experiment`
1862
- - `prod.staging`
1744
+ Parameters
1745
+ ----------
1746
+ packages : Dict[str, str], default: {}
1747
+ Packages to use for this flow. The key is the name of the package
1748
+ and the value is the version to use.
1749
+ python : str, optional, default: None
1750
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1751
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1752
+ """
1753
+ ...
1754
+
1755
+ @typing.overload
1756
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1757
+ ...
1758
+
1759
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1760
+ """
1761
+ Specifies the PyPI packages for all steps of the flow.
1863
1762
 
1763
+ Use `@pypi_base` to set common packages required by all
1764
+ steps and use `@pypi` to specify step-specific overrides.
1864
1765
 
1865
1766
  Parameters
1866
1767
  ----------
1867
- flow : Union[str, Dict[str, str]], optional, default None
1868
- Upstream flow dependency for this flow.
1869
- flows : List[Union[str, Dict[str, str]]], default []
1870
- Upstream flow dependencies for this flow.
1871
- options : Dict[str, Any], default {}
1872
- Backend-specific configuration for tuning eventing behavior.
1768
+ packages : Dict[str, str], default: {}
1769
+ Packages to use for this flow. The key is the name of the package
1770
+ and the value is the version to use.
1771
+ python : str, optional, default: None
1772
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1773
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1873
1774
  """
1874
1775
  ...
1875
1776
 
@@ -1987,97 +1888,197 @@ def with_artifact_store(f: typing.Optional[typing.Type[FlowSpecDerived]] = None)
1987
1888
  """
1988
1889
  ...
1989
1890
 
1990
- 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]]:
1891
+ @typing.overload
1892
+ 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]]:
1991
1893
  """
1992
- 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)
1993
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1994
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1995
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1996
- starts only after all sensors finish.
1894
+ Specifies the flow(s) that this flow depends on.
1895
+
1896
+ ```
1897
+ @trigger_on_finish(flow='FooFlow')
1898
+ ```
1899
+ or
1900
+ ```
1901
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1902
+ ```
1903
+ This decorator respects the @project decorator and triggers the flow
1904
+ when upstream runs within the same namespace complete successfully
1905
+
1906
+ Additionally, you can specify project aware upstream flow dependencies
1907
+ by specifying the fully qualified project_flow_name.
1908
+ ```
1909
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1910
+ ```
1911
+ or
1912
+ ```
1913
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1914
+ ```
1915
+
1916
+ You can also specify just the project or project branch (other values will be
1917
+ inferred from the current project or project branch):
1918
+ ```
1919
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1920
+ ```
1921
+
1922
+ Note that `branch` is typically one of:
1923
+ - `prod`
1924
+ - `user.bob`
1925
+ - `test.my_experiment`
1926
+ - `prod.staging`
1997
1927
 
1998
1928
 
1999
1929
  Parameters
2000
1930
  ----------
2001
- timeout : int
2002
- Time, in seconds before the task times out and fails. (Default: 3600)
2003
- poke_interval : int
2004
- Time in seconds that the job should wait in between each try. (Default: 60)
2005
- mode : str
2006
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
2007
- exponential_backoff : bool
2008
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
2009
- pool : str
2010
- the slot pool this task should run in,
2011
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
2012
- soft_fail : bool
2013
- Set to true to mark the task as SKIPPED on failure. (Default: False)
2014
- name : str
2015
- Name of the sensor on Airflow
2016
- description : str
2017
- Description of sensor in the Airflow UI
2018
- bucket_key : Union[str, List[str]]
2019
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
2020
- When it's specified as a full s3:// url, please leave `bucket_name` as None
2021
- bucket_name : str
2022
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
2023
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
2024
- wildcard_match : bool
2025
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
2026
- aws_conn_id : str
2027
- a reference to the s3 connection on Airflow. (Default: None)
2028
- verify : bool
2029
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1931
+ flow : Union[str, Dict[str, str]], optional, default None
1932
+ Upstream flow dependency for this flow.
1933
+ flows : List[Union[str, Dict[str, str]]], default []
1934
+ Upstream flow dependencies for this flow.
1935
+ options : Dict[str, Any], default {}
1936
+ Backend-specific configuration for tuning eventing behavior.
2030
1937
  """
2031
1938
  ...
2032
1939
 
2033
1940
  @typing.overload
2034
- 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]]:
1941
+ def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1942
+ ...
1943
+
1944
+ 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] = {}):
2035
1945
  """
2036
- Specifies the times when the flow should be run when running on a
2037
- production scheduler.
1946
+ Specifies the flow(s) that this flow depends on.
1947
+
1948
+ ```
1949
+ @trigger_on_finish(flow='FooFlow')
1950
+ ```
1951
+ or
1952
+ ```
1953
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1954
+ ```
1955
+ This decorator respects the @project decorator and triggers the flow
1956
+ when upstream runs within the same namespace complete successfully
1957
+
1958
+ Additionally, you can specify project aware upstream flow dependencies
1959
+ by specifying the fully qualified project_flow_name.
1960
+ ```
1961
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1962
+ ```
1963
+ or
1964
+ ```
1965
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1966
+ ```
1967
+
1968
+ You can also specify just the project or project branch (other values will be
1969
+ inferred from the current project or project branch):
1970
+ ```
1971
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1972
+ ```
1973
+
1974
+ Note that `branch` is typically one of:
1975
+ - `prod`
1976
+ - `user.bob`
1977
+ - `test.my_experiment`
1978
+ - `prod.staging`
2038
1979
 
2039
1980
 
2040
1981
  Parameters
2041
1982
  ----------
2042
- hourly : bool, default False
2043
- Run the workflow hourly.
2044
- daily : bool, default True
2045
- Run the workflow daily.
2046
- weekly : bool, default False
2047
- Run the workflow weekly.
2048
- cron : str, optional, default None
2049
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
2050
- specified by this expression.
2051
- timezone : str, optional, default None
2052
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
2053
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1983
+ flow : Union[str, Dict[str, str]], optional, default None
1984
+ Upstream flow dependency for this flow.
1985
+ flows : List[Union[str, Dict[str, str]]], default []
1986
+ Upstream flow dependencies for this flow.
1987
+ options : Dict[str, Any], default {}
1988
+ Backend-specific configuration for tuning eventing behavior.
2054
1989
  """
2055
1990
  ...
2056
1991
 
2057
1992
  @typing.overload
2058
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1993
+ 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]]:
1994
+ """
1995
+ Specifies the event(s) that this flow depends on.
1996
+
1997
+ ```
1998
+ @trigger(event='foo')
1999
+ ```
2000
+ or
2001
+ ```
2002
+ @trigger(events=['foo', 'bar'])
2003
+ ```
2004
+
2005
+ Additionally, you can specify the parameter mappings
2006
+ to map event payload to Metaflow parameters for the flow.
2007
+ ```
2008
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
2009
+ ```
2010
+ or
2011
+ ```
2012
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
2013
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
2014
+ ```
2015
+
2016
+ 'parameters' can also be a list of strings and tuples like so:
2017
+ ```
2018
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
2019
+ ```
2020
+ This is equivalent to:
2021
+ ```
2022
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
2023
+ ```
2024
+
2025
+
2026
+ Parameters
2027
+ ----------
2028
+ event : Union[str, Dict[str, Any]], optional, default None
2029
+ Event dependency for this flow.
2030
+ events : List[Union[str, Dict[str, Any]]], default []
2031
+ Events dependency for this flow.
2032
+ options : Dict[str, Any], default {}
2033
+ Backend-specific configuration for tuning eventing behavior.
2034
+ """
2059
2035
  ...
2060
2036
 
2061
- 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):
2037
+ @typing.overload
2038
+ def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
2039
+ ...
2040
+
2041
+ 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] = {}):
2062
2042
  """
2063
- Specifies the times when the flow should be run when running on a
2064
- production scheduler.
2043
+ Specifies the event(s) that this flow depends on.
2044
+
2045
+ ```
2046
+ @trigger(event='foo')
2047
+ ```
2048
+ or
2049
+ ```
2050
+ @trigger(events=['foo', 'bar'])
2051
+ ```
2052
+
2053
+ Additionally, you can specify the parameter mappings
2054
+ to map event payload to Metaflow parameters for the flow.
2055
+ ```
2056
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
2057
+ ```
2058
+ or
2059
+ ```
2060
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
2061
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
2062
+ ```
2063
+
2064
+ 'parameters' can also be a list of strings and tuples like so:
2065
+ ```
2066
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
2067
+ ```
2068
+ This is equivalent to:
2069
+ ```
2070
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
2071
+ ```
2065
2072
 
2066
2073
 
2067
2074
  Parameters
2068
2075
  ----------
2069
- hourly : bool, default False
2070
- Run the workflow hourly.
2071
- daily : bool, default True
2072
- Run the workflow daily.
2073
- weekly : bool, default False
2074
- Run the workflow weekly.
2075
- cron : str, optional, default None
2076
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
2077
- specified by this expression.
2078
- timezone : str, optional, default None
2079
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
2080
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
2076
+ event : Union[str, Dict[str, Any]], optional, default None
2077
+ Event dependency for this flow.
2078
+ events : List[Union[str, Dict[str, Any]]], default []
2079
+ Events dependency for this flow.
2080
+ options : Dict[str, Any], default {}
2081
+ Backend-specific configuration for tuning eventing behavior.
2081
2082
  """
2082
2083
  ...
2083
2084