ob-metaflow-stubs 6.0.9.1__py2.py3-none-any.whl → 6.0.9.2__py2.py3-none-any.whl

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

Potentially problematic release.


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

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