ob-metaflow-stubs 6.0.3.160__py2.py3-none-any.whl → 6.0.3.161__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.
Files changed (206) hide show
  1. metaflow-stubs/__init__.pyi +601 -592
  2. metaflow-stubs/cards.pyi +2 -2
  3. metaflow-stubs/cli.pyi +4 -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 +7 -7
  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 +4 -4
  12. metaflow-stubs/generated_for.txt +1 -1
  13. metaflow-stubs/includefile.pyi +5 -5
  14. metaflow-stubs/info_file.pyi +2 -2
  15. metaflow-stubs/metadata_provider/__init__.pyi +2 -2
  16. metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
  17. metaflow-stubs/metadata_provider/metadata.pyi +3 -3
  18. metaflow-stubs/metadata_provider/util.pyi +2 -2
  19. metaflow-stubs/metaflow_config.pyi +4 -2
  20. metaflow-stubs/metaflow_current.pyi +113 -113
  21. metaflow-stubs/metaflow_git.pyi +26 -0
  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 +4 -4
  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 +5 -5
  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 +2 -2
  43. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/core.pyi +2 -2
  44. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/decorator.pyi +2 -2
  45. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/exceptions.pyi +2 -2
  46. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/task_utils.pyi +3 -3
  47. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi +2 -2
  48. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi +3 -3
  49. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/exceptions.pyi +2 -2
  50. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/__init__.pyi +2 -2
  51. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/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 +3 -3
  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 +4 -4
  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 +2 -2
  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 +3 -3
  63. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +3 -3
  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/card_utilities/__init__.pyi +2 -2
  67. metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/injector.pyi +2 -2
  68. metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/__init__.pyi +2 -2
  69. metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/coreweave.pyi +2 -2
  70. metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/nebius.pyi +2 -2
  71. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/__init__.pyi +2 -2
  72. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/ollama.pyi +2 -2
  73. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/__init__.pyi +2 -2
  74. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/snowflake.pyi +2 -2
  75. metaflow-stubs/mf_extensions/outerbounds/profilers/__init__.pyi +2 -2
  76. metaflow-stubs/mf_extensions/outerbounds/profilers/gpu.pyi +2 -2
  77. metaflow-stubs/mf_extensions/outerbounds/remote_config.pyi +2 -2
  78. metaflow-stubs/mf_extensions/outerbounds/toplevel/__init__.pyi +2 -2
  79. metaflow-stubs/mf_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.pyi +2 -2
  80. metaflow-stubs/multicore_utils.pyi +2 -2
  81. metaflow-stubs/parameters.pyi +5 -5
  82. metaflow-stubs/plugins/__init__.pyi +12 -11
  83. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  84. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  85. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  86. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  87. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  88. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
  89. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
  90. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  91. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  92. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  93. metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -3
  94. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
  95. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +5 -5
  96. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -3
  97. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  98. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  99. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  100. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  101. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  102. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  103. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  104. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  105. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
  106. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  107. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  108. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  109. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  110. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  111. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +4 -4
  112. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +4 -4
  113. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  114. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  115. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  116. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +4 -4
  117. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  118. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  119. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  120. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  121. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  122. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  123. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  124. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  125. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  126. metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
  127. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  128. metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
  129. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  130. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  131. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  132. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  133. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  134. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  135. metaflow-stubs/plugins/catch_decorator.pyi +3 -3
  136. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  137. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  138. metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
  139. metaflow-stubs/plugins/datatools/s3/s3.pyi +9 -4
  140. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  141. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  142. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  143. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  144. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  145. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  146. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  147. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  148. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  149. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +4 -4
  150. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  151. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  152. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  153. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  154. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  155. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +3 -3
  156. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +4 -4
  157. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  158. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +10 -2
  159. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  160. metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
  161. metaflow-stubs/plugins/ollama/__init__.pyi +2 -2
  162. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  163. metaflow-stubs/plugins/perimeters.pyi +2 -2
  164. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  165. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  166. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  167. metaflow-stubs/plugins/pypi/conda_environment.pyi +6 -6
  168. metaflow-stubs/plugins/pypi/parsers.pyi +2 -2
  169. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  170. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  171. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  172. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  173. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  174. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  175. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
  176. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  177. metaflow-stubs/plugins/snowflake/__init__.pyi +2 -2
  178. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  179. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  180. metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
  181. metaflow-stubs/plugins/uv/__init__.pyi +11 -0
  182. metaflow-stubs/plugins/uv/uv_environment.pyi +36 -0
  183. metaflow-stubs/profilers/__init__.pyi +2 -2
  184. metaflow-stubs/pylint_wrapper.pyi +2 -2
  185. metaflow-stubs/runner/__init__.pyi +2 -2
  186. metaflow-stubs/runner/deployer.pyi +6 -6
  187. metaflow-stubs/runner/deployer_impl.pyi +4 -4
  188. metaflow-stubs/runner/metaflow_runner.pyi +5 -5
  189. metaflow-stubs/runner/nbdeploy.pyi +2 -2
  190. metaflow-stubs/runner/nbrun.pyi +2 -2
  191. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  192. metaflow-stubs/runner/utils.pyi +3 -3
  193. metaflow-stubs/system/__init__.pyi +2 -2
  194. metaflow-stubs/system/system_logger.pyi +3 -3
  195. metaflow-stubs/system/system_monitor.pyi +2 -2
  196. metaflow-stubs/tagging_util.pyi +2 -2
  197. metaflow-stubs/tuple_util.pyi +2 -2
  198. metaflow-stubs/user_configs/__init__.pyi +2 -2
  199. metaflow-stubs/user_configs/config_decorators.pyi +6 -6
  200. metaflow-stubs/user_configs/config_options.pyi +4 -4
  201. metaflow-stubs/user_configs/config_parameters.pyi +5 -5
  202. {ob_metaflow_stubs-6.0.3.160.dist-info → ob_metaflow_stubs-6.0.3.161.dist-info}/METADATA +1 -1
  203. ob_metaflow_stubs-6.0.3.161.dist-info/RECORD +206 -0
  204. ob_metaflow_stubs-6.0.3.160.dist-info/RECORD +0 -203
  205. {ob_metaflow_stubs-6.0.3.160.dist-info → ob_metaflow_stubs-6.0.3.161.dist-info}/WHEEL +0 -0
  206. {ob_metaflow_stubs-6.0.3.160.dist-info → ob_metaflow_stubs-6.0.3.161.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.15.7.2+obcheckpoint(0.2.1);ob(v1) #
4
- # Generated on 2025-05-01T00:24:18.378249 #
3
+ # MF version: 2.15.10.1+obcheckpoint(0.2.1);ob(v1) #
4
+ # Generated on 2025-05-05T20:26:16.823529 #
5
5
  ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -35,17 +35,18 @@ from .user_configs.config_parameters import ConfigValue as ConfigValue
35
35
  from .user_configs.config_parameters import config_expr as config_expr
36
36
  from .user_configs.config_decorators import CustomFlowDecorator as CustomFlowDecorator
37
37
  from .user_configs.config_decorators import CustomStepDecorator as CustomStepDecorator
38
+ from . import events as events
38
39
  from . import tuple_util as tuple_util
39
40
  from . import cards as cards
40
- from . import events as events
41
+ from . import metaflow_git as metaflow_git
41
42
  from . import runner as runner
42
43
  from . import plugins as plugins
43
44
  from .mf_extensions.outerbounds.toplevel.global_aliases_for_metaflow_package import S3 as S3
44
45
  from . import includefile as includefile
45
46
  from .includefile import IncludeFile as IncludeFile
46
- from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
47
- from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
48
47
  from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
48
+ from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
49
+ from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
49
50
  from . import client as client
50
51
  from .client.core import namespace as namespace
51
52
  from .client.core import get_namespace as get_namespace
@@ -153,148 +154,59 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
153
154
  ...
154
155
 
155
156
  @typing.overload
156
- 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]]]:
157
- """
158
- Specifies that the step will success under all circumstances.
159
-
160
- The decorator will create an optional artifact, specified by `var`, which
161
- contains the exception raised. You can use it to detect the presence
162
- of errors, indicating that all happy-path artifacts produced by the step
163
- are missing.
164
-
165
-
166
- Parameters
167
- ----------
168
- var : str, optional, default None
169
- Name of the artifact in which to store the caught exception.
170
- If not specified, the exception is not stored.
171
- print_exception : bool, default True
172
- Determines whether or not the exception is printed to
173
- stdout when caught.
174
- """
175
- ...
176
-
177
- @typing.overload
178
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
179
- ...
180
-
181
- @typing.overload
182
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
183
- ...
184
-
185
- 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):
157
+ 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]]]:
186
158
  """
187
- Specifies that the step will success under all circumstances.
159
+ Enables loading / saving of models within a step.
188
160
 
189
- The decorator will create an optional artifact, specified by `var`, which
190
- contains the exception raised. You can use it to detect the presence
191
- of errors, indicating that all happy-path artifacts produced by the step
192
- are missing.
193
161
 
194
162
 
195
163
  Parameters
196
164
  ----------
197
- var : str, optional, default None
198
- Name of the artifact in which to store the caught exception.
199
- If not specified, the exception is not stored.
200
- print_exception : bool, default True
201
- Determines whether or not the exception is printed to
202
- stdout when caught.
203
- """
204
- ...
205
-
206
- @typing.overload
207
- 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]]]:
208
- """
209
- Specifies the number of times the task corresponding
210
- to a step needs to be retried.
211
-
212
- This decorator is useful for handling transient errors, such as networking issues.
213
- If your task contains operations that can't be retried safely, e.g. database updates,
214
- it is advisable to annotate it with `@retry(times=0)`.
215
-
216
- This can be used in conjunction with the `@catch` decorator. The `@catch`
217
- decorator will execute a no-op task after all retries have been exhausted,
218
- ensuring that the flow execution can continue.
165
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
166
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
167
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
168
+ - `current.checkpoint`
169
+ - `current.model`
170
+ - `current.huggingface_hub`
219
171
 
172
+ 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
173
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
174
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
220
175
 
221
- Parameters
222
- ----------
223
- times : int, default 3
224
- Number of times to retry this task.
225
- minutes_between_retries : int, default 2
226
- Number of minutes between retries.
176
+ temp_dir_root : str, default: None
177
+ The root directory under which `current.model.loaded` will store loaded models
227
178
  """
228
179
  ...
229
180
 
230
181
  @typing.overload
231
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
182
+ def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
232
183
  ...
233
184
 
234
185
  @typing.overload
235
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
186
+ def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
236
187
  ...
237
188
 
238
- 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):
189
+ 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):
239
190
  """
240
- Specifies the number of times the task corresponding
241
- to a step needs to be retried.
242
-
243
- This decorator is useful for handling transient errors, such as networking issues.
244
- If your task contains operations that can't be retried safely, e.g. database updates,
245
- it is advisable to annotate it with `@retry(times=0)`.
246
-
247
- This can be used in conjunction with the `@catch` decorator. The `@catch`
248
- decorator will execute a no-op task after all retries have been exhausted,
249
- ensuring that the flow execution can continue.
250
-
191
+ Enables loading / saving of models within a step.
251
192
 
252
- Parameters
253
- ----------
254
- times : int, default 3
255
- Number of times to retry this task.
256
- minutes_between_retries : int, default 2
257
- Number of minutes between retries.
258
- """
259
- ...
260
-
261
- 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]]]:
262
- """
263
- Decorator that helps cache, version and store models/datasets from huggingface hub.
264
193
 
265
194
 
266
195
  Parameters
267
196
  ----------
268
- temp_dir_root : str, optional
269
- The root directory that will hold the temporary directory where objects will be downloaded.
270
-
271
- load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
272
- The list of repos (models/datasets) to load.
273
-
274
- Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
275
-
276
- - If repo (model/dataset) is not found in the datastore:
277
- - Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
278
- - Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
279
- - All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
280
-
281
- - If repo is found in the datastore:
282
- - Loads it directly from datastore to local path (can be temporary directory or specified path)
283
- """
284
- ...
285
-
286
- def app_deploy(*, app_port: int, app_name: 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]]]:
287
- """
288
- Specifies that this step is used to deploy an instance of the app.
289
- Requires that self.app_name, self.app_port, self.entrypoint and self.deployDir is set.
197
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
198
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
199
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
200
+ - `current.checkpoint`
201
+ - `current.model`
202
+ - `current.huggingface_hub`
290
203
 
204
+ 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
205
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
206
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
291
207
 
292
- Parameters
293
- ----------
294
- app_port : int
295
- Number of GPUs to use.
296
- app_name : str
297
- Name of the app to deploy.
208
+ temp_dir_root : str, default: None
209
+ The root directory under which `current.model.loaded` will store loaded models
298
210
  """
299
211
  ...
300
212
 
@@ -357,213 +269,151 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
357
269
  """
358
270
  ...
359
271
 
360
- @typing.overload
361
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
362
- """
363
- Internal decorator to support Fast bakery
364
- """
365
- ...
366
-
367
- @typing.overload
368
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
369
- ...
370
-
371
- def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
272
+ def app_deploy(*, app_port: int, app_name: 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]]]:
372
273
  """
373
- Internal decorator to support Fast bakery
274
+ Specifies that this step is used to deploy an instance of the app.
275
+ Requires that self.app_name, self.app_port, self.entrypoint and self.deployDir is set.
276
+
277
+
278
+ Parameters
279
+ ----------
280
+ app_port : int
281
+ Number of GPUs to use.
282
+ app_name : str
283
+ Name of the app to deploy.
374
284
  """
375
285
  ...
376
286
 
377
287
  @typing.overload
378
- 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]]]:
288
+ 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]]]:
379
289
  """
380
- Creates a human-readable report, a Metaflow Card, after this step completes.
290
+ Specifies that the step will success under all circumstances.
381
291
 
382
- Note that you may add multiple `@card` decorators in a step with different parameters.
292
+ The decorator will create an optional artifact, specified by `var`, which
293
+ contains the exception raised. You can use it to detect the presence
294
+ of errors, indicating that all happy-path artifacts produced by the step
295
+ are missing.
383
296
 
384
297
 
385
298
  Parameters
386
299
  ----------
387
- type : str, default 'default'
388
- Card type.
389
- id : str, optional, default None
390
- If multiple cards are present, use this id to identify this card.
391
- options : Dict[str, Any], default {}
392
- Options passed to the card. The contents depend on the card type.
393
- timeout : int, default 45
394
- Interrupt reporting if it takes more than this many seconds.
300
+ var : str, optional, default None
301
+ Name of the artifact in which to store the caught exception.
302
+ If not specified, the exception is not stored.
303
+ print_exception : bool, default True
304
+ Determines whether or not the exception is printed to
305
+ stdout when caught.
395
306
  """
396
307
  ...
397
308
 
398
309
  @typing.overload
399
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
310
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
400
311
  ...
401
312
 
402
313
  @typing.overload
403
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
314
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
404
315
  ...
405
316
 
406
- def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
317
+ 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):
407
318
  """
408
- Creates a human-readable report, a Metaflow Card, after this step completes.
319
+ Specifies that the step will success under all circumstances.
409
320
 
410
- Note that you may add multiple `@card` decorators in a step with different parameters.
321
+ The decorator will create an optional artifact, specified by `var`, which
322
+ contains the exception raised. You can use it to detect the presence
323
+ of errors, indicating that all happy-path artifacts produced by the step
324
+ are missing.
411
325
 
412
326
 
413
327
  Parameters
414
328
  ----------
415
- type : str, default 'default'
416
- Card type.
417
- id : str, optional, default None
418
- If multiple cards are present, use this id to identify this card.
419
- options : Dict[str, Any], default {}
420
- Options passed to the card. The contents depend on the card type.
421
- timeout : int, default 45
422
- Interrupt reporting if it takes more than this many seconds.
329
+ var : str, optional, default None
330
+ Name of the artifact in which to store the caught exception.
331
+ If not specified, the exception is not stored.
332
+ print_exception : bool, default True
333
+ Determines whether or not the exception is printed to
334
+ stdout when caught.
423
335
  """
424
336
  ...
425
337
 
426
- def nim(*, models: "list[NIM]", backend: 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]]]:
338
+ 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]]]:
427
339
  """
428
- This decorator is used to run NIM containers in Metaflow tasks as sidecars.
340
+ Decorator that helps cache, version and store models/datasets from huggingface hub.
429
341
 
430
- User code call
431
- -----------
432
- @nim(
433
- models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
434
- backend='managed'
435
- )
436
342
 
437
- Valid backend options
438
- ---------------------
439
- - 'managed': Outerbounds selects a compute provider based on the model.
343
+ Parameters
344
+ ----------
345
+ temp_dir_root : str, optional
346
+ The root directory that will hold the temporary directory where objects will be downloaded.
440
347
 
441
- Valid model options
442
- ----------------
443
- - 'meta/llama3-8b-instruct': 8B parameter model
444
- - 'meta/llama3-70b-instruct': 70B parameter model
445
- - any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
348
+ load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
349
+ The list of repos (models/datasets) to load.
446
350
 
351
+ Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
447
352
 
448
- Parameters
449
- ----------
450
- models: list[NIM]
451
- List of NIM containers running models in sidecars.
452
- backend: str
453
- Compute provider to run the NIM container.
454
- queue_timeout : int
455
- Time to keep the job in NVCF's queue.
353
+ - If repo (model/dataset) is not found in the datastore:
354
+ - Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
355
+ - Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
356
+ - All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
357
+
358
+ - If repo is found in the datastore:
359
+ - Loads it directly from datastore to local path (can be temporary directory or specified path)
456
360
  """
457
361
  ...
458
362
 
459
363
  @typing.overload
460
- def conda(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
364
+ 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]]]:
461
365
  """
462
- Specifies the Conda environment for the step.
366
+ Enables checkpointing for a step.
463
367
 
464
- Information in this decorator will augment any
465
- attributes set in the `@conda_base` flow-level decorator. Hence,
466
- you can use `@conda_base` to set packages required by all
467
- steps and use `@conda` to specify step-specific overrides.
468
368
 
469
369
 
470
370
  Parameters
471
371
  ----------
472
- packages : Dict[str, str], default {}
473
- Packages to use for this step. The key is the name of the package
474
- and the value is the version to use.
475
- libraries : Dict[str, str], default {}
476
- Supported for backward compatibility. When used with packages, packages will take precedence.
477
- python : str, optional, default None
478
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
479
- that the version used will correspond to the version of the Python interpreter used to start the run.
480
- disabled : bool, default False
481
- If set to True, disables @conda.
372
+ load_policy : str, default: "fresh"
373
+ The policy for loading the checkpoint. The following policies are supported:
374
+ - "eager": Loads the the latest available checkpoint within the namespace.
375
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
376
+ will be loaded at the start of the task.
377
+ - "none": Do not load any checkpoint
378
+ - "fresh": Loads the lastest checkpoint created within the running Task.
379
+ This mode helps loading checkpoints across various retry attempts of the same task.
380
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
381
+ created within the task will be loaded when the task is retries execution on failure.
382
+
383
+ temp_dir_root : str, default: None
384
+ The root directory under which `current.checkpoint.directory` will be created.
482
385
  """
483
386
  ...
484
387
 
485
388
  @typing.overload
486
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
389
+ def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
487
390
  ...
488
391
 
489
392
  @typing.overload
490
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
393
+ def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
491
394
  ...
492
395
 
493
- def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
396
+ 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):
494
397
  """
495
- Specifies the Conda environment for the step.
398
+ Enables checkpointing for a step.
496
399
 
497
- Information in this decorator will augment any
498
- attributes set in the `@conda_base` flow-level decorator. Hence,
499
- you can use `@conda_base` to set packages required by all
500
- steps and use `@conda` to specify step-specific overrides.
501
400
 
502
401
 
503
402
  Parameters
504
403
  ----------
505
- packages : Dict[str, str], default {}
506
- Packages to use for this step. The key is the name of the package
507
- and the value is the version to use.
508
- libraries : Dict[str, str], default {}
509
- Supported for backward compatibility. When used with packages, packages will take precedence.
510
- python : str, optional, default None
511
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
512
- that the version used will correspond to the version of the Python interpreter used to start the run.
513
- disabled : bool, default False
514
- If set to True, disables @conda.
515
- """
516
- ...
517
-
518
- def ollama(*, models: "list[Ollama]", backend: 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]]]:
519
- """
520
- This decorator is used to run Ollama APIs as Metaflow task sidecars.
521
-
522
- User code call
523
- -----------
524
- @ollama(
525
- models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
526
- backend='local'
527
- )
528
-
529
- Valid backend options
530
- ---------------------
531
- - 'local': Run as a separate process on the local task machine.
532
- - (TODO) 'managed': Outerbounds hosts and selects compute provider.
533
- - (TODO) 'remote': Spin up separate instance to serve Ollama models.
534
-
535
- Valid model options
536
- ----------------
537
- - 'llama3.2'
538
- - 'llama3.3'
539
- - any model here https://ollama.com/search
540
-
404
+ load_policy : str, default: "fresh"
405
+ The policy for loading the checkpoint. The following policies are supported:
406
+ - "eager": Loads the the latest available checkpoint within the namespace.
407
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
408
+ will be loaded at the start of the task.
409
+ - "none": Do not load any checkpoint
410
+ - "fresh": Loads the lastest checkpoint created within the running Task.
411
+ This mode helps loading checkpoints across various retry attempts of the same task.
412
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
413
+ created within the task will be loaded when the task is retries execution on failure.
541
414
 
542
- Parameters
543
- ----------
544
- models: list[Ollama]
545
- List of Ollama containers running models in sidecars.
546
- backend: str
547
- Determines where and how to run the Ollama process.
548
- """
549
- ...
550
-
551
- @typing.overload
552
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
553
- """
554
- Decorator prototype for all step decorators. This function gets specialized
555
- and imported for all decorators types by _import_plugin_decorators().
556
- """
557
- ...
558
-
559
- @typing.overload
560
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
561
- ...
562
-
563
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
564
- """
565
- Decorator prototype for all step decorators. This function gets specialized
566
- and imported for all decorators types by _import_plugin_decorators().
415
+ temp_dir_root : str, default: None
416
+ The root directory under which `current.checkpoint.directory` will be created.
567
417
  """
568
418
  ...
569
419
 
@@ -601,149 +451,252 @@ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], Non
601
451
  ...
602
452
 
603
453
  @typing.overload
604
- 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]]]:
454
+ 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]]]:
605
455
  """
606
- Enables checkpointing for a step.
456
+ Specifies the number of times the task corresponding
457
+ to a step needs to be retried.
607
458
 
459
+ This decorator is useful for handling transient errors, such as networking issues.
460
+ If your task contains operations that can't be retried safely, e.g. database updates,
461
+ it is advisable to annotate it with `@retry(times=0)`.
462
+
463
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
464
+ decorator will execute a no-op task after all retries have been exhausted,
465
+ ensuring that the flow execution can continue.
608
466
 
609
467
 
610
468
  Parameters
611
469
  ----------
612
- load_policy : str, default: "fresh"
613
- The policy for loading the checkpoint. The following policies are supported:
614
- - "eager": Loads the the latest available checkpoint within the namespace.
615
- With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
616
- will be loaded at the start of the task.
617
- - "none": Do not load any checkpoint
618
- - "fresh": Loads the lastest checkpoint created within the running Task.
619
- This mode helps loading checkpoints across various retry attempts of the same task.
620
- With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
621
- created within the task will be loaded when the task is retries execution on failure.
470
+ times : int, default 3
471
+ Number of times to retry this task.
472
+ minutes_between_retries : int, default 2
473
+ Number of minutes between retries.
474
+ """
475
+ ...
476
+
477
+ @typing.overload
478
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
479
+ ...
480
+
481
+ @typing.overload
482
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
483
+ ...
484
+
485
+ 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):
486
+ """
487
+ Specifies the number of times the task corresponding
488
+ to a step needs to be retried.
622
489
 
623
- temp_dir_root : str, default: None
624
- The root directory under which `current.checkpoint.directory` will be created.
490
+ This decorator is useful for handling transient errors, such as networking issues.
491
+ If your task contains operations that can't be retried safely, e.g. database updates,
492
+ it is advisable to annotate it with `@retry(times=0)`.
493
+
494
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
495
+ decorator will execute a no-op task after all retries have been exhausted,
496
+ ensuring that the flow execution can continue.
497
+
498
+
499
+ Parameters
500
+ ----------
501
+ times : int, default 3
502
+ Number of times to retry this task.
503
+ minutes_between_retries : int, default 2
504
+ Number of minutes between retries.
625
505
  """
626
506
  ...
627
507
 
628
508
  @typing.overload
629
- def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
509
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
510
+ """
511
+ Internal decorator to support Fast bakery
512
+ """
630
513
  ...
631
514
 
632
515
  @typing.overload
633
- def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
516
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
634
517
  ...
635
518
 
636
- 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):
519
+ def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
637
520
  """
638
- Enables checkpointing for a step.
521
+ Internal decorator to support Fast bakery
522
+ """
523
+ ...
524
+
525
+ def nim(*, models: "list[NIM]", backend: 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]]]:
526
+ """
527
+ This decorator is used to run NIM containers in Metaflow tasks as sidecars.
639
528
 
529
+ User code call
530
+ -----------
531
+ @nim(
532
+ models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
533
+ backend='managed'
534
+ )
535
+
536
+ Valid backend options
537
+ ---------------------
538
+ - 'managed': Outerbounds selects a compute provider based on the model.
539
+
540
+ Valid model options
541
+ ----------------
542
+ - 'meta/llama3-8b-instruct': 8B parameter model
543
+ - 'meta/llama3-70b-instruct': 70B parameter model
544
+ - any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
640
545
 
641
546
 
642
547
  Parameters
643
548
  ----------
644
- load_policy : str, default: "fresh"
645
- The policy for loading the checkpoint. The following policies are supported:
646
- - "eager": Loads the the latest available checkpoint within the namespace.
647
- With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
648
- will be loaded at the start of the task.
649
- - "none": Do not load any checkpoint
650
- - "fresh": Loads the lastest checkpoint created within the running Task.
651
- This mode helps loading checkpoints across various retry attempts of the same task.
652
- With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
653
- created within the task will be loaded when the task is retries execution on failure.
549
+ models: list[NIM]
550
+ List of NIM containers running models in sidecars.
551
+ backend: str
552
+ Compute provider to run the NIM container.
553
+ queue_timeout : int
554
+ Time to keep the job in NVCF's queue.
555
+ """
556
+ ...
557
+
558
+ def ollama(*, models: "list[Ollama]", backend: 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]]]:
559
+ """
560
+ This decorator is used to run Ollama APIs as Metaflow task sidecars.
654
561
 
655
- temp_dir_root : str, default: None
656
- The root directory under which `current.checkpoint.directory` will be created.
562
+ User code call
563
+ -----------
564
+ @ollama(
565
+ models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
566
+ backend='local'
567
+ )
568
+
569
+ Valid backend options
570
+ ---------------------
571
+ - 'local': Run as a separate process on the local task machine.
572
+ - (TODO) 'managed': Outerbounds hosts and selects compute provider.
573
+ - (TODO) 'remote': Spin up separate instance to serve Ollama models.
574
+
575
+ Valid model options
576
+ ----------------
577
+ - 'llama3.2'
578
+ - 'llama3.3'
579
+ - any model here https://ollama.com/search
580
+
581
+
582
+ Parameters
583
+ ----------
584
+ models: list[Ollama]
585
+ List of Ollama containers running models in sidecars.
586
+ backend: str
587
+ Determines where and how to run the Ollama process.
657
588
  """
658
589
  ...
659
590
 
660
591
  @typing.overload
661
- def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []) -> 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]]]:
592
+ 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]]]:
662
593
  """
663
- Specifies secrets to be retrieved and injected as environment variables prior to
664
- the execution of a step.
594
+ Creates a human-readable report, a Metaflow Card, after this step completes.
595
+
596
+ Note that you may add multiple `@card` decorators in a step with different parameters.
665
597
 
666
598
 
667
599
  Parameters
668
600
  ----------
669
- sources : List[Union[str, Dict[str, Any]]], default: []
670
- List of secret specs, defining how the secrets are to be retrieved
601
+ type : str, default 'default'
602
+ Card type.
603
+ id : str, optional, default None
604
+ If multiple cards are present, use this id to identify this card.
605
+ options : Dict[str, Any], default {}
606
+ Options passed to the card. The contents depend on the card type.
607
+ timeout : int, default 45
608
+ Interrupt reporting if it takes more than this many seconds.
671
609
  """
672
610
  ...
673
611
 
674
612
  @typing.overload
675
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
613
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
676
614
  ...
677
615
 
678
616
  @typing.overload
679
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
617
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
680
618
  ...
681
619
 
682
- def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []):
620
+ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
683
621
  """
684
- Specifies secrets to be retrieved and injected as environment variables prior to
685
- the execution of a step.
622
+ Creates a human-readable report, a Metaflow Card, after this step completes.
623
+
624
+ Note that you may add multiple `@card` decorators in a step with different parameters.
686
625
 
687
626
 
688
627
  Parameters
689
628
  ----------
690
- sources : List[Union[str, Dict[str, Any]]], default: []
691
- List of secret specs, defining how the secrets are to be retrieved
629
+ type : str, default 'default'
630
+ Card type.
631
+ id : str, optional, default None
632
+ If multiple cards are present, use this id to identify this card.
633
+ options : Dict[str, Any], default {}
634
+ Options passed to the card. The contents depend on the card type.
635
+ timeout : int, default 45
636
+ Interrupt reporting if it takes more than this many seconds.
692
637
  """
693
638
  ...
694
639
 
695
640
  @typing.overload
696
- 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]]]:
641
+ def conda(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
697
642
  """
698
- Specifies the PyPI packages for the step.
643
+ Specifies the Conda environment for the step.
699
644
 
700
645
  Information in this decorator will augment any
701
- attributes set in the `@pyi_base` flow-level decorator. Hence,
702
- you can use `@pypi_base` to set packages required by all
703
- steps and use `@pypi` to specify step-specific overrides.
646
+ attributes set in the `@conda_base` flow-level decorator. Hence,
647
+ you can use `@conda_base` to set packages required by all
648
+ steps and use `@conda` to specify step-specific overrides.
704
649
 
705
650
 
706
651
  Parameters
707
652
  ----------
708
- packages : Dict[str, str], default: {}
653
+ packages : Dict[str, str], default {}
709
654
  Packages to use for this step. The key is the name of the package
710
655
  and the value is the version to use.
711
- python : str, optional, default: None
656
+ libraries : Dict[str, str], default {}
657
+ Supported for backward compatibility. When used with packages, packages will take precedence.
658
+ python : str, optional, default None
712
659
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
713
660
  that the version used will correspond to the version of the Python interpreter used to start the run.
661
+ disabled : bool, default False
662
+ If set to True, disables @conda.
714
663
  """
715
664
  ...
716
665
 
717
666
  @typing.overload
718
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
667
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
719
668
  ...
720
669
 
721
670
  @typing.overload
722
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
671
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
723
672
  ...
724
673
 
725
- 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):
674
+ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
726
675
  """
727
- Specifies the PyPI packages for the step.
676
+ Specifies the Conda environment for the step.
728
677
 
729
678
  Information in this decorator will augment any
730
- attributes set in the `@pyi_base` flow-level decorator. Hence,
731
- you can use `@pypi_base` to set packages required by all
732
- steps and use `@pypi` to specify step-specific overrides.
679
+ attributes set in the `@conda_base` flow-level decorator. Hence,
680
+ you can use `@conda_base` to set packages required by all
681
+ steps and use `@conda` to specify step-specific overrides.
733
682
 
734
683
 
735
684
  Parameters
736
685
  ----------
737
- packages : Dict[str, str], default: {}
686
+ packages : Dict[str, str], default {}
738
687
  Packages to use for this step. The key is the name of the package
739
688
  and the value is the version to use.
740
- python : str, optional, default: None
689
+ libraries : Dict[str, str], default {}
690
+ Supported for backward compatibility. When used with packages, packages will take precedence.
691
+ python : str, optional, default None
741
692
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
742
693
  that the version used will correspond to the version of the Python interpreter used to start the run.
694
+ disabled : bool, default False
695
+ If set to True, disables @conda.
743
696
  """
744
697
  ...
745
698
 
746
- def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', 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[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') -> 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]]]:
699
+ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', 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[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]]]:
747
700
  """
748
701
  Specifies that this step should execute on Kubernetes.
749
702
 
@@ -817,6 +770,84 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
817
770
  Only applicable when @parallel is used.
818
771
  qos: str, default: Burstable
819
772
  Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
773
+
774
+ security_context: Dict[str, Any], optional, default None
775
+ Container security context. Applies to the task container. Allows the following keys:
776
+ - privileged: bool, optional, default None
777
+ - allow_privilege_escalation: bool, optional, default None
778
+ - run_as_user: int, optional, default None
779
+ - run_as_group: int, optional, default None
780
+ - run_as_non_root: bool, optional, default None
781
+ """
782
+ ...
783
+
784
+ 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]]]:
785
+ """
786
+ Specifies that this step should execute on DGX cloud.
787
+
788
+
789
+ Parameters
790
+ ----------
791
+ gpu : int
792
+ Number of GPUs to use.
793
+ gpu_type : str
794
+ Type of Nvidia GPU to use.
795
+ queue_timeout : int
796
+ Time to keep the job in NVCF's queue.
797
+ """
798
+ ...
799
+
800
+ @typing.overload
801
+ def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []) -> 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]]]:
802
+ """
803
+ Specifies secrets to be retrieved and injected as environment variables prior to
804
+ the execution of a step.
805
+
806
+
807
+ Parameters
808
+ ----------
809
+ sources : List[Union[str, Dict[str, Any]]], default: []
810
+ List of secret specs, defining how the secrets are to be retrieved
811
+ """
812
+ ...
813
+
814
+ @typing.overload
815
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
816
+ ...
817
+
818
+ @typing.overload
819
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
820
+ ...
821
+
822
+ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []):
823
+ """
824
+ Specifies secrets to be retrieved and injected as environment variables prior to
825
+ the execution of a step.
826
+
827
+
828
+ Parameters
829
+ ----------
830
+ sources : List[Union[str, Dict[str, Any]]], default: []
831
+ List of secret specs, defining how the secrets are to be retrieved
832
+ """
833
+ ...
834
+
835
+ @typing.overload
836
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
837
+ """
838
+ Decorator prototype for all step decorators. This function gets specialized
839
+ and imported for all decorators types by _import_plugin_decorators().
840
+ """
841
+ ...
842
+
843
+ @typing.overload
844
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
845
+ ...
846
+
847
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
848
+ """
849
+ Decorator prototype for all step decorators. This function gets specialized
850
+ and imported for all decorators types by _import_plugin_decorators().
820
851
  """
821
852
  ...
822
853
 
@@ -900,75 +931,146 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
900
931
  ...
901
932
 
902
933
  @typing.overload
903
- 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]]]:
934
+ 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]]]:
904
935
  """
905
- Enables loading / saving of models within a step.
936
+ Specifies the PyPI packages for the step.
906
937
 
938
+ Information in this decorator will augment any
939
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
940
+ you can use `@pypi_base` to set packages required by all
941
+ steps and use `@pypi` to specify step-specific overrides.
907
942
 
908
943
 
909
944
  Parameters
910
945
  ----------
911
- load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
912
- Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
913
- These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
914
- - `current.checkpoint`
915
- - `current.model`
916
- - `current.huggingface_hub`
917
-
918
- 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
919
- the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
920
- If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
921
-
922
- temp_dir_root : str, default: None
923
- The root directory under which `current.model.loaded` will store loaded models
946
+ packages : Dict[str, str], default: {}
947
+ Packages to use for this step. The key is the name of the package
948
+ and the value is the version to use.
949
+ python : str, optional, default: None
950
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
951
+ that the version used will correspond to the version of the Python interpreter used to start the run.
924
952
  """
925
953
  ...
926
954
 
927
955
  @typing.overload
928
- def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
956
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
929
957
  ...
930
958
 
931
959
  @typing.overload
932
- def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
960
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
933
961
  ...
934
962
 
935
- 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):
963
+ 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):
936
964
  """
937
- Enables loading / saving of models within a step.
965
+ Specifies the PyPI packages for the step.
938
966
 
967
+ Information in this decorator will augment any
968
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
969
+ you can use `@pypi_base` to set packages required by all
970
+ steps and use `@pypi` to specify step-specific overrides.
939
971
 
940
972
 
941
973
  Parameters
942
974
  ----------
943
- load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
944
- Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
945
- These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
946
- - `current.checkpoint`
947
- - `current.model`
948
- - `current.huggingface_hub`
975
+ packages : Dict[str, str], default: {}
976
+ Packages to use for this step. The key is the name of the package
977
+ and the value is the version to use.
978
+ python : str, optional, default: None
979
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
980
+ that the version used will correspond to the version of the Python interpreter used to start the run.
981
+ """
982
+ ...
983
+
984
+ @typing.overload
985
+ 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]]:
986
+ """
987
+ Specifies the event(s) that this flow depends on.
949
988
 
950
- 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
951
- the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
952
- If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
989
+ ```
990
+ @trigger(event='foo')
991
+ ```
992
+ or
993
+ ```
994
+ @trigger(events=['foo', 'bar'])
995
+ ```
953
996
 
954
- temp_dir_root : str, default: None
955
- The root directory under which `current.model.loaded` will store loaded models
997
+ Additionally, you can specify the parameter mappings
998
+ to map event payload to Metaflow parameters for the flow.
999
+ ```
1000
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1001
+ ```
1002
+ or
1003
+ ```
1004
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1005
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1006
+ ```
1007
+
1008
+ 'parameters' can also be a list of strings and tuples like so:
1009
+ ```
1010
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1011
+ ```
1012
+ This is equivalent to:
1013
+ ```
1014
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1015
+ ```
1016
+
1017
+
1018
+ Parameters
1019
+ ----------
1020
+ event : Union[str, Dict[str, Any]], optional, default None
1021
+ Event dependency for this flow.
1022
+ events : List[Union[str, Dict[str, Any]]], default []
1023
+ Events dependency for this flow.
1024
+ options : Dict[str, Any], default {}
1025
+ Backend-specific configuration for tuning eventing behavior.
956
1026
  """
957
1027
  ...
958
1028
 
959
- 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]]]:
1029
+ @typing.overload
1030
+ def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1031
+ ...
1032
+
1033
+ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
960
1034
  """
961
- Specifies that this step should execute on DGX cloud.
1035
+ Specifies the event(s) that this flow depends on.
1036
+
1037
+ ```
1038
+ @trigger(event='foo')
1039
+ ```
1040
+ or
1041
+ ```
1042
+ @trigger(events=['foo', 'bar'])
1043
+ ```
1044
+
1045
+ Additionally, you can specify the parameter mappings
1046
+ to map event payload to Metaflow parameters for the flow.
1047
+ ```
1048
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1049
+ ```
1050
+ or
1051
+ ```
1052
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1053
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1054
+ ```
1055
+
1056
+ 'parameters' can also be a list of strings and tuples like so:
1057
+ ```
1058
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1059
+ ```
1060
+ This is equivalent to:
1061
+ ```
1062
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1063
+ ```
962
1064
 
963
1065
 
964
1066
  Parameters
965
1067
  ----------
966
- gpu : int
967
- Number of GPUs to use.
968
- gpu_type : str
969
- Type of Nvidia GPU to use.
970
- queue_timeout : int
971
- Time to keep the job in NVCF's queue.
1068
+ event : Union[str, Dict[str, Any]], optional, default None
1069
+ Event dependency for this flow.
1070
+ events : List[Union[str, Dict[str, Any]]], default []
1071
+ Events dependency for this flow.
1072
+ options : Dict[str, Any], default {}
1073
+ Backend-specific configuration for tuning eventing behavior.
972
1074
  """
973
1075
  ...
974
1076
 
@@ -1007,92 +1109,6 @@ def project(*, name: str, branch: typing.Optional[str] = None, production: bool
1007
1109
  """
1008
1110
  ...
1009
1111
 
1010
- 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]]:
1011
- """
1012
- 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)
1013
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1014
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1015
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1016
- starts only after all sensors finish.
1017
-
1018
-
1019
- Parameters
1020
- ----------
1021
- timeout : int
1022
- Time, in seconds before the task times out and fails. (Default: 3600)
1023
- poke_interval : int
1024
- Time in seconds that the job should wait in between each try. (Default: 60)
1025
- mode : str
1026
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1027
- exponential_backoff : bool
1028
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1029
- pool : str
1030
- the slot pool this task should run in,
1031
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1032
- soft_fail : bool
1033
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1034
- name : str
1035
- Name of the sensor on Airflow
1036
- description : str
1037
- Description of sensor in the Airflow UI
1038
- bucket_key : Union[str, List[str]]
1039
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1040
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1041
- bucket_name : str
1042
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1043
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1044
- wildcard_match : bool
1045
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1046
- aws_conn_id : str
1047
- a reference to the s3 connection on Airflow. (Default: None)
1048
- verify : bool
1049
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1050
- """
1051
- ...
1052
-
1053
- 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]]:
1054
- """
1055
- 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.
1056
- 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.
1057
-
1058
-
1059
- Parameters
1060
- ----------
1061
- timeout : int
1062
- Time, in seconds before the task times out and fails. (Default: 3600)
1063
- poke_interval : int
1064
- Time in seconds that the job should wait in between each try. (Default: 60)
1065
- mode : str
1066
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1067
- exponential_backoff : bool
1068
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1069
- pool : str
1070
- the slot pool this task should run in,
1071
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1072
- soft_fail : bool
1073
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1074
- name : str
1075
- Name of the sensor on Airflow
1076
- description : str
1077
- Description of sensor in the Airflow UI
1078
- external_dag_id : str
1079
- The dag_id that contains the task you want to wait for.
1080
- external_task_ids : List[str]
1081
- The list of task_ids that you want to wait for.
1082
- If None (default value) the sensor waits for the DAG. (Default: None)
1083
- allowed_states : List[str]
1084
- Iterable of allowed states, (Default: ['success'])
1085
- failed_states : List[str]
1086
- Iterable of failed or dis-allowed states. (Default: None)
1087
- execution_delta : datetime.timedelta
1088
- time difference with the previous execution to look at,
1089
- the default is the same logical date as the current task or DAG. (Default: None)
1090
- check_existence: bool
1091
- Set to True to check if the external task exists or check if
1092
- the DAG to wait for exists. (Default: True)
1093
- """
1094
- ...
1095
-
1096
1112
  def with_artifact_store(f: typing.Optional[typing.Type[FlowSpecDerived]] = None):
1097
1113
  """
1098
1114
  Allows setting external datastores to save data for the
@@ -1208,136 +1224,139 @@ def with_artifact_store(f: typing.Optional[typing.Type[FlowSpecDerived]] = None)
1208
1224
  ...
1209
1225
 
1210
1226
  @typing.overload
1211
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1227
+ 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]]:
1212
1228
  """
1213
- Specifies the PyPI packages for all steps of the flow.
1229
+ Specifies the Conda environment for all steps of the flow.
1230
+
1231
+ Use `@conda_base` to set common libraries required by all
1232
+ steps and use `@conda` to specify step-specific additions.
1214
1233
 
1215
- Use `@pypi_base` to set common packages required by all
1216
- steps and use `@pypi` to specify step-specific overrides.
1217
1234
 
1218
1235
  Parameters
1219
1236
  ----------
1220
- packages : Dict[str, str], default: {}
1237
+ packages : Dict[str, str], default {}
1221
1238
  Packages to use for this flow. The key is the name of the package
1222
1239
  and the value is the version to use.
1223
- python : str, optional, default: None
1240
+ libraries : Dict[str, str], default {}
1241
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1242
+ python : str, optional, default None
1224
1243
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1225
1244
  that the version used will correspond to the version of the Python interpreter used to start the run.
1245
+ disabled : bool, default False
1246
+ If set to True, disables Conda.
1226
1247
  """
1227
1248
  ...
1228
1249
 
1229
1250
  @typing.overload
1230
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1251
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1231
1252
  ...
1232
1253
 
1233
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1254
+ 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):
1234
1255
  """
1235
- Specifies the PyPI packages for all steps of the flow.
1256
+ Specifies the Conda environment for all steps of the flow.
1257
+
1258
+ Use `@conda_base` to set common libraries required by all
1259
+ steps and use `@conda` to specify step-specific additions.
1236
1260
 
1237
- Use `@pypi_base` to set common packages required by all
1238
- steps and use `@pypi` to specify step-specific overrides.
1239
1261
 
1240
1262
  Parameters
1241
1263
  ----------
1242
- packages : Dict[str, str], default: {}
1264
+ packages : Dict[str, str], default {}
1243
1265
  Packages to use for this flow. The key is the name of the package
1244
1266
  and the value is the version to use.
1245
- python : str, optional, default: None
1267
+ libraries : Dict[str, str], default {}
1268
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1269
+ python : str, optional, default None
1246
1270
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1247
1271
  that the version used will correspond to the version of the Python interpreter used to start the run.
1272
+ disabled : bool, default False
1273
+ If set to True, disables Conda.
1248
1274
  """
1249
1275
  ...
1250
1276
 
1251
- @typing.overload
1252
- 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]]:
1277
+ 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]]:
1253
1278
  """
1254
- Specifies the event(s) that this flow depends on.
1255
-
1256
- ```
1257
- @trigger(event='foo')
1258
- ```
1259
- or
1260
- ```
1261
- @trigger(events=['foo', 'bar'])
1262
- ```
1263
-
1264
- Additionally, you can specify the parameter mappings
1265
- to map event payload to Metaflow parameters for the flow.
1266
- ```
1267
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1268
- ```
1269
- or
1270
- ```
1271
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1272
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1273
- ```
1274
-
1275
- 'parameters' can also be a list of strings and tuples like so:
1276
- ```
1277
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1278
- ```
1279
- This is equivalent to:
1280
- ```
1281
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1282
- ```
1279
+ 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)
1280
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1281
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1282
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1283
+ starts only after all sensors finish.
1283
1284
 
1284
1285
 
1285
1286
  Parameters
1286
1287
  ----------
1287
- event : Union[str, Dict[str, Any]], optional, default None
1288
- Event dependency for this flow.
1289
- events : List[Union[str, Dict[str, Any]]], default []
1290
- Events dependency for this flow.
1291
- options : Dict[str, Any], default {}
1292
- Backend-specific configuration for tuning eventing behavior.
1288
+ timeout : int
1289
+ Time, in seconds before the task times out and fails. (Default: 3600)
1290
+ poke_interval : int
1291
+ Time in seconds that the job should wait in between each try. (Default: 60)
1292
+ mode : str
1293
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1294
+ exponential_backoff : bool
1295
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1296
+ pool : str
1297
+ the slot pool this task should run in,
1298
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1299
+ soft_fail : bool
1300
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1301
+ name : str
1302
+ Name of the sensor on Airflow
1303
+ description : str
1304
+ Description of sensor in the Airflow UI
1305
+ bucket_key : Union[str, List[str]]
1306
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1307
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1308
+ bucket_name : str
1309
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1310
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1311
+ wildcard_match : bool
1312
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1313
+ aws_conn_id : str
1314
+ a reference to the s3 connection on Airflow. (Default: None)
1315
+ verify : bool
1316
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1293
1317
  """
1294
1318
  ...
1295
1319
 
1296
- @typing.overload
1297
- def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1298
- ...
1299
-
1300
- def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
1320
+ 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]]:
1301
1321
  """
1302
- Specifies the event(s) that this flow depends on.
1303
-
1304
- ```
1305
- @trigger(event='foo')
1306
- ```
1307
- or
1308
- ```
1309
- @trigger(events=['foo', 'bar'])
1310
- ```
1311
-
1312
- Additionally, you can specify the parameter mappings
1313
- to map event payload to Metaflow parameters for the flow.
1314
- ```
1315
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1316
- ```
1317
- or
1318
- ```
1319
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1320
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1321
- ```
1322
-
1323
- 'parameters' can also be a list of strings and tuples like so:
1324
- ```
1325
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1326
- ```
1327
- This is equivalent to:
1328
- ```
1329
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1330
- ```
1322
+ 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.
1323
+ 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.
1331
1324
 
1332
1325
 
1333
1326
  Parameters
1334
1327
  ----------
1335
- event : Union[str, Dict[str, Any]], optional, default None
1336
- Event dependency for this flow.
1337
- events : List[Union[str, Dict[str, Any]]], default []
1338
- Events dependency for this flow.
1339
- options : Dict[str, Any], default {}
1340
- Backend-specific configuration for tuning eventing behavior.
1328
+ timeout : int
1329
+ Time, in seconds before the task times out and fails. (Default: 3600)
1330
+ poke_interval : int
1331
+ Time in seconds that the job should wait in between each try. (Default: 60)
1332
+ mode : str
1333
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1334
+ exponential_backoff : bool
1335
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1336
+ pool : str
1337
+ the slot pool this task should run in,
1338
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1339
+ soft_fail : bool
1340
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1341
+ name : str
1342
+ Name of the sensor on Airflow
1343
+ description : str
1344
+ Description of sensor in the Airflow UI
1345
+ external_dag_id : str
1346
+ The dag_id that contains the task you want to wait for.
1347
+ external_task_ids : List[str]
1348
+ The list of task_ids that you want to wait for.
1349
+ If None (default value) the sensor waits for the DAG. (Default: None)
1350
+ allowed_states : List[str]
1351
+ Iterable of allowed states, (Default: ['success'])
1352
+ failed_states : List[str]
1353
+ Iterable of failed or dis-allowed states. (Default: None)
1354
+ execution_delta : datetime.timedelta
1355
+ time difference with the previous execution to look at,
1356
+ the default is the same logical date as the current task or DAG. (Default: None)
1357
+ check_existence: bool
1358
+ Set to True to check if the external task exists or check if
1359
+ the DAG to wait for exists. (Default: True)
1341
1360
  """
1342
1361
  ...
1343
1362
 
@@ -1442,57 +1461,6 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
1442
1461
  """
1443
1462
  ...
1444
1463
 
1445
- @typing.overload
1446
- 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]]:
1447
- """
1448
- Specifies the Conda environment for all steps of the flow.
1449
-
1450
- Use `@conda_base` to set common libraries required by all
1451
- steps and use `@conda` to specify step-specific additions.
1452
-
1453
-
1454
- Parameters
1455
- ----------
1456
- packages : Dict[str, str], default {}
1457
- Packages to use for this flow. The key is the name of the package
1458
- and the value is the version to use.
1459
- libraries : Dict[str, str], default {}
1460
- Supported for backward compatibility. When used with packages, packages will take precedence.
1461
- python : str, optional, default None
1462
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1463
- that the version used will correspond to the version of the Python interpreter used to start the run.
1464
- disabled : bool, default False
1465
- If set to True, disables Conda.
1466
- """
1467
- ...
1468
-
1469
- @typing.overload
1470
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1471
- ...
1472
-
1473
- 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):
1474
- """
1475
- Specifies the Conda environment for all steps of the flow.
1476
-
1477
- Use `@conda_base` to set common libraries required by all
1478
- steps and use `@conda` to specify step-specific additions.
1479
-
1480
-
1481
- Parameters
1482
- ----------
1483
- packages : Dict[str, str], default {}
1484
- Packages to use for this flow. The key is the name of the package
1485
- and the value is the version to use.
1486
- libraries : Dict[str, str], default {}
1487
- Supported for backward compatibility. When used with packages, packages will take precedence.
1488
- python : str, optional, default None
1489
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1490
- that the version used will correspond to the version of the Python interpreter used to start the run.
1491
- disabled : bool, default False
1492
- If set to True, disables Conda.
1493
- """
1494
- ...
1495
-
1496
1464
  @typing.overload
1497
1465
  def schedule(*, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1498
1466
  """
@@ -1544,5 +1512,46 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
1544
1512
  """
1545
1513
  ...
1546
1514
 
1515
+ @typing.overload
1516
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1517
+ """
1518
+ Specifies the PyPI packages for all steps of the flow.
1519
+
1520
+ Use `@pypi_base` to set common packages required by all
1521
+ steps and use `@pypi` to specify step-specific overrides.
1522
+
1523
+ Parameters
1524
+ ----------
1525
+ packages : Dict[str, str], default: {}
1526
+ Packages to use for this flow. The key is the name of the package
1527
+ and the value is the version to use.
1528
+ python : str, optional, default: None
1529
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1530
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1531
+ """
1532
+ ...
1533
+
1534
+ @typing.overload
1535
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1536
+ ...
1537
+
1538
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1539
+ """
1540
+ Specifies the PyPI packages for all steps of the flow.
1541
+
1542
+ Use `@pypi_base` to set common packages required by all
1543
+ steps and use `@pypi` to specify step-specific overrides.
1544
+
1545
+ Parameters
1546
+ ----------
1547
+ packages : Dict[str, str], default: {}
1548
+ Packages to use for this flow. The key is the name of the package
1549
+ and the value is the version to use.
1550
+ python : str, optional, default: None
1551
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1552
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1553
+ """
1554
+ ...
1555
+
1547
1556
  pkg_name: str
1548
1557