ob-metaflow-stubs 6.0.3.164__py2.py3-none-any.whl → 6.0.3.165__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 +520 -520
  2. metaflow-stubs/cards.pyi +1 -1
  3. metaflow-stubs/cli.pyi +1 -1
  4. metaflow-stubs/cli_components/__init__.pyi +1 -1
  5. metaflow-stubs/cli_components/utils.pyi +1 -1
  6. metaflow-stubs/client/__init__.pyi +1 -1
  7. metaflow-stubs/client/core.pyi +5 -5
  8. metaflow-stubs/client/filecache.pyi +1 -1
  9. metaflow-stubs/events.pyi +2 -2
  10. metaflow-stubs/exception.pyi +1 -1
  11. metaflow-stubs/flowspec.pyi +3 -3
  12. metaflow-stubs/generated_for.txt +1 -1
  13. metaflow-stubs/includefile.pyi +3 -3
  14. metaflow-stubs/info_file.pyi +1 -1
  15. metaflow-stubs/metadata_provider/__init__.pyi +1 -1
  16. metaflow-stubs/metadata_provider/heartbeat.pyi +1 -1
  17. metaflow-stubs/metadata_provider/metadata.pyi +1 -1
  18. metaflow-stubs/metadata_provider/util.pyi +1 -1
  19. metaflow-stubs/metaflow_config.pyi +1 -1
  20. metaflow-stubs/metaflow_current.pyi +128 -128
  21. metaflow-stubs/metaflow_git.pyi +1 -1
  22. metaflow-stubs/mf_extensions/__init__.pyi +1 -1
  23. metaflow-stubs/mf_extensions/obcheckpoint/__init__.pyi +1 -1
  24. metaflow-stubs/mf_extensions/obcheckpoint/plugins/__init__.pyi +1 -1
  25. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/__init__.pyi +1 -1
  26. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/__init__.pyi +1 -1
  27. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/async_cards.pyi +1 -1
  28. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/deco_injection_mixin.pyi +1 -1
  29. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/extra_components.pyi +1 -1
  30. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/__init__.pyi +1 -1
  31. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/__init__.pyi +1 -1
  32. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/checkpoint_lister.pyi +2 -2
  33. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/lineage_card.pyi +1 -1
  34. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/checkpoint_storage.pyi +3 -3
  35. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/constructors.pyi +1 -1
  36. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/core.pyi +2 -2
  37. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/decorator.pyi +4 -4
  38. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/exceptions.pyi +1 -1
  39. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/final_api.pyi +2 -2
  40. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/lineage.pyi +1 -1
  41. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/__init__.pyi +1 -1
  42. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/context.pyi +1 -1
  43. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/core.pyi +1 -1
  44. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/decorator.pyi +1 -1
  45. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/exceptions.pyi +1 -1
  46. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/task_utils.pyi +1 -1
  47. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi +1 -1
  48. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi +2 -2
  49. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/exceptions.pyi +1 -1
  50. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/__init__.pyi +1 -1
  51. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/decorator.pyi +2 -2
  52. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/__init__.pyi +1 -1
  53. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/core.pyi +1 -1
  54. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/exceptions.pyi +1 -1
  55. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/model_storage.pyi +2 -2
  56. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/__init__.pyi +1 -1
  57. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/flowspec_utils.pyi +1 -1
  58. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/general.pyi +1 -1
  59. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/identity_utils.pyi +1 -1
  60. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/__init__.pyi +1 -1
  61. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/base.pyi +1 -1
  62. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/tar.pyi +1 -1
  63. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +1 -1
  64. metaflow-stubs/mf_extensions/outerbounds/__init__.pyi +1 -1
  65. metaflow-stubs/mf_extensions/outerbounds/plugins/__init__.pyi +1 -1
  66. metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/__init__.pyi +1 -1
  67. metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/injector.pyi +1 -1
  68. metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/__init__.pyi +1 -1
  69. metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/coreweave.pyi +1 -1
  70. metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/nebius.pyi +1 -1
  71. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/__init__.pyi +1 -1
  72. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/ollama.pyi +1 -1
  73. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/__init__.pyi +1 -1
  74. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/snowflake.pyi +1 -1
  75. metaflow-stubs/mf_extensions/outerbounds/profilers/__init__.pyi +1 -1
  76. metaflow-stubs/mf_extensions/outerbounds/profilers/gpu.pyi +1 -1
  77. metaflow-stubs/mf_extensions/outerbounds/remote_config.pyi +1 -1
  78. metaflow-stubs/mf_extensions/outerbounds/toplevel/__init__.pyi +1 -1
  79. metaflow-stubs/mf_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.pyi +1 -1
  80. metaflow-stubs/multicore_utils.pyi +1 -1
  81. metaflow-stubs/parameters.pyi +3 -3
  82. metaflow-stubs/plugins/__init__.pyi +13 -13
  83. metaflow-stubs/plugins/airflow/__init__.pyi +1 -1
  84. metaflow-stubs/plugins/airflow/airflow_utils.pyi +1 -1
  85. metaflow-stubs/plugins/airflow/exception.pyi +1 -1
  86. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +1 -1
  87. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +1 -1
  88. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +1 -1
  89. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +1 -1
  90. metaflow-stubs/plugins/argo/__init__.pyi +1 -1
  91. metaflow-stubs/plugins/argo/argo_client.pyi +1 -1
  92. metaflow-stubs/plugins/argo/argo_events.pyi +1 -1
  93. metaflow-stubs/plugins/argo/argo_workflows.pyi +2 -2
  94. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +2 -2
  95. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +2 -2
  96. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -3
  97. metaflow-stubs/plugins/aws/__init__.pyi +1 -1
  98. metaflow-stubs/plugins/aws/aws_client.pyi +1 -1
  99. metaflow-stubs/plugins/aws/aws_utils.pyi +1 -1
  100. metaflow-stubs/plugins/aws/batch/__init__.pyi +1 -1
  101. metaflow-stubs/plugins/aws/batch/batch.pyi +1 -1
  102. metaflow-stubs/plugins/aws/batch/batch_client.pyi +1 -1
  103. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +1 -1
  104. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +1 -1
  105. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
  106. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +1 -1
  107. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +1 -1
  108. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +1 -1
  109. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +1 -1
  110. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +1 -1
  111. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +2 -2
  112. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +1 -1
  113. metaflow-stubs/plugins/azure/__init__.pyi +1 -1
  114. metaflow-stubs/plugins/azure/azure_credential.pyi +1 -1
  115. metaflow-stubs/plugins/azure/azure_exceptions.pyi +1 -1
  116. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +3 -3
  117. metaflow-stubs/plugins/azure/azure_utils.pyi +1 -1
  118. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +1 -1
  119. metaflow-stubs/plugins/azure/includefile_support.pyi +1 -1
  120. metaflow-stubs/plugins/cards/__init__.pyi +1 -1
  121. metaflow-stubs/plugins/cards/card_client.pyi +2 -2
  122. metaflow-stubs/plugins/cards/card_creator.pyi +1 -1
  123. metaflow-stubs/plugins/cards/card_datastore.pyi +1 -1
  124. metaflow-stubs/plugins/cards/card_decorator.pyi +1 -1
  125. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +1 -1
  126. metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
  127. metaflow-stubs/plugins/cards/card_modules/card.pyi +1 -1
  128. metaflow-stubs/plugins/cards/card_modules/components.pyi +2 -2
  129. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +1 -1
  130. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +1 -1
  131. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +1 -1
  132. metaflow-stubs/plugins/cards/card_resolver.pyi +1 -1
  133. metaflow-stubs/plugins/cards/component_serializer.pyi +1 -1
  134. metaflow-stubs/plugins/cards/exception.pyi +1 -1
  135. metaflow-stubs/plugins/catch_decorator.pyi +2 -2
  136. metaflow-stubs/plugins/datatools/__init__.pyi +1 -1
  137. metaflow-stubs/plugins/datatools/local.pyi +1 -1
  138. metaflow-stubs/plugins/datatools/s3/__init__.pyi +1 -1
  139. metaflow-stubs/plugins/datatools/s3/s3.pyi +3 -3
  140. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +1 -1
  141. metaflow-stubs/plugins/datatools/s3/s3util.pyi +1 -1
  142. metaflow-stubs/plugins/debug_logger.pyi +1 -1
  143. metaflow-stubs/plugins/debug_monitor.pyi +1 -1
  144. metaflow-stubs/plugins/environment_decorator.pyi +1 -1
  145. metaflow-stubs/plugins/events_decorator.pyi +1 -1
  146. metaflow-stubs/plugins/frameworks/__init__.pyi +1 -1
  147. metaflow-stubs/plugins/frameworks/pytorch.pyi +1 -1
  148. metaflow-stubs/plugins/gcp/__init__.pyi +1 -1
  149. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
  150. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +1 -1
  151. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +1 -1
  152. metaflow-stubs/plugins/gcp/gs_utils.pyi +1 -1
  153. metaflow-stubs/plugins/gcp/includefile_support.pyi +1 -1
  154. metaflow-stubs/plugins/kubernetes/__init__.pyi +1 -1
  155. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +1 -1
  156. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +1 -1
  157. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +1 -1
  158. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +1 -1
  159. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +1 -1
  160. metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +1 -1
  161. metaflow-stubs/plugins/ollama/__init__.pyi +2 -2
  162. metaflow-stubs/plugins/parallel_decorator.pyi +1 -1
  163. metaflow-stubs/plugins/perimeters.pyi +1 -1
  164. metaflow-stubs/plugins/project_decorator.pyi +1 -1
  165. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  166. metaflow-stubs/plugins/pypi/conda_decorator.pyi +1 -1
  167. metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
  168. metaflow-stubs/plugins/pypi/parsers.pyi +1 -1
  169. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +1 -1
  170. metaflow-stubs/plugins/pypi/pypi_environment.pyi +1 -1
  171. metaflow-stubs/plugins/pypi/utils.pyi +1 -1
  172. metaflow-stubs/plugins/resources_decorator.pyi +1 -1
  173. metaflow-stubs/plugins/retry_decorator.pyi +1 -1
  174. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  175. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
  176. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +1 -1
  177. metaflow-stubs/plugins/snowflake/__init__.pyi +1 -1
  178. metaflow-stubs/plugins/storage_executor.pyi +1 -1
  179. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  180. metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
  181. metaflow-stubs/plugins/uv/__init__.pyi +1 -1
  182. metaflow-stubs/plugins/uv/uv_environment.pyi +1 -1
  183. metaflow-stubs/profilers/__init__.pyi +1 -1
  184. metaflow-stubs/pylint_wrapper.pyi +1 -1
  185. metaflow-stubs/runner/__init__.pyi +1 -1
  186. metaflow-stubs/runner/deployer.pyi +29 -29
  187. metaflow-stubs/runner/deployer_impl.pyi +2 -2
  188. metaflow-stubs/runner/metaflow_runner.pyi +2 -2
  189. metaflow-stubs/runner/nbdeploy.pyi +1 -1
  190. metaflow-stubs/runner/nbrun.pyi +1 -1
  191. metaflow-stubs/runner/subprocess_manager.pyi +1 -1
  192. metaflow-stubs/runner/utils.pyi +1 -1
  193. metaflow-stubs/system/__init__.pyi +1 -1
  194. metaflow-stubs/system/system_logger.pyi +2 -2
  195. metaflow-stubs/system/system_monitor.pyi +1 -1
  196. metaflow-stubs/tagging_util.pyi +1 -1
  197. metaflow-stubs/tuple_util.pyi +1 -1
  198. metaflow-stubs/user_configs/__init__.pyi +1 -1
  199. metaflow-stubs/user_configs/config_decorators.pyi +5 -5
  200. metaflow-stubs/user_configs/config_options.pyi +2 -2
  201. metaflow-stubs/user_configs/config_parameters.pyi +5 -5
  202. {ob_metaflow_stubs-6.0.3.164.dist-info → ob_metaflow_stubs-6.0.3.165.dist-info}/METADATA +1 -1
  203. ob_metaflow_stubs-6.0.3.165.dist-info/RECORD +206 -0
  204. ob_metaflow_stubs-6.0.3.164.dist-info/RECORD +0 -206
  205. {ob_metaflow_stubs-6.0.3.164.dist-info → ob_metaflow_stubs-6.0.3.165.dist-info}/WHEEL +0 -0
  206. {ob_metaflow_stubs-6.0.3.164.dist-info → ob_metaflow_stubs-6.0.3.165.dist-info}/top_level.txt +0 -0
@@ -1,15 +1,15 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.15.11.1+obcheckpoint(0.2.1);ob(v1) #
4
- # Generated on 2025-05-07T07:24:19.774250 #
4
+ # Generated on 2025-05-08T08:48:06.309319 #
5
5
  ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
- import datetime
12
11
  import typing
12
+ import datetime
13
13
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
14
14
  StepFlag = typing.NewType("StepFlag", bool)
15
15
 
@@ -35,9 +35,9 @@ 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 tuple_util as tuple_util
39
38
  from . import cards as cards
40
39
  from . import metaflow_git as metaflow_git
40
+ from . import tuple_util as tuple_util
41
41
  from . import events as events
42
42
  from . import runner as runner
43
43
  from . import plugins as plugins
@@ -153,114 +153,6 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
153
153
  """
154
154
  ...
155
155
 
156
- @typing.overload
157
- 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]]]:
158
- """
159
- Enables checkpointing for a step.
160
-
161
-
162
-
163
- Parameters
164
- ----------
165
- load_policy : str, default: "fresh"
166
- The policy for loading the checkpoint. The following policies are supported:
167
- - "eager": Loads the the latest available checkpoint within the namespace.
168
- With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
169
- will be loaded at the start of the task.
170
- - "none": Do not load any checkpoint
171
- - "fresh": Loads the lastest checkpoint created within the running Task.
172
- This mode helps loading checkpoints across various retry attempts of the same task.
173
- With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
174
- created within the task will be loaded when the task is retries execution on failure.
175
-
176
- temp_dir_root : str, default: None
177
- The root directory under which `current.checkpoint.directory` will be created.
178
- """
179
- ...
180
-
181
- @typing.overload
182
- def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
183
- ...
184
-
185
- @typing.overload
186
- def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
187
- ...
188
-
189
- 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):
190
- """
191
- Enables checkpointing for a step.
192
-
193
-
194
-
195
- Parameters
196
- ----------
197
- load_policy : str, default: "fresh"
198
- The policy for loading the checkpoint. The following policies are supported:
199
- - "eager": Loads the the latest available checkpoint within the namespace.
200
- With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
201
- will be loaded at the start of the task.
202
- - "none": Do not load any checkpoint
203
- - "fresh": Loads the lastest checkpoint created within the running Task.
204
- This mode helps loading checkpoints across various retry attempts of the same task.
205
- With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
206
- created within the task will be loaded when the task is retries execution on failure.
207
-
208
- temp_dir_root : str, default: None
209
- The root directory under which `current.checkpoint.directory` will be created.
210
- """
211
- ...
212
-
213
- @typing.overload
214
- def pypi(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
215
- """
216
- Specifies the PyPI packages for the step.
217
-
218
- Information in this decorator will augment any
219
- attributes set in the `@pyi_base` flow-level decorator. Hence,
220
- you can use `@pypi_base` to set packages required by all
221
- steps and use `@pypi` to specify step-specific overrides.
222
-
223
-
224
- Parameters
225
- ----------
226
- packages : Dict[str, str], default: {}
227
- Packages to use for this step. The key is the name of the package
228
- and the value is the version to use.
229
- python : str, optional, default: None
230
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
231
- that the version used will correspond to the version of the Python interpreter used to start the run.
232
- """
233
- ...
234
-
235
- @typing.overload
236
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
237
- ...
238
-
239
- @typing.overload
240
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
241
- ...
242
-
243
- def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
244
- """
245
- Specifies the PyPI packages for the step.
246
-
247
- Information in this decorator will augment any
248
- attributes set in the `@pyi_base` flow-level decorator. Hence,
249
- you can use `@pypi_base` to set packages required by all
250
- steps and use `@pypi` to specify step-specific overrides.
251
-
252
-
253
- Parameters
254
- ----------
255
- packages : Dict[str, str], default: {}
256
- Packages to use for this step. The key is the name of the package
257
- and the value is the version to use.
258
- python : str, optional, default: None
259
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
260
- that the version used will correspond to the version of the Python interpreter used to start the run.
261
- """
262
- ...
263
-
264
156
  @typing.overload
265
157
  def resources(*, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
266
158
  """
@@ -341,185 +233,137 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
341
233
  ...
342
234
 
343
235
  @typing.overload
344
- def timeout(*, seconds: int = 0, minutes: int = 0, hours: int = 0) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
236
+ 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]]]:
345
237
  """
346
- Specifies a timeout for your step.
347
-
348
- This decorator is useful if this step may hang indefinitely.
349
-
350
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
351
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
352
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
353
-
354
- Note that all the values specified in parameters are added together so if you specify
355
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
238
+ Specifies secrets to be retrieved and injected as environment variables prior to
239
+ the execution of a step.
356
240
 
357
241
 
358
242
  Parameters
359
243
  ----------
360
- seconds : int, default 0
361
- Number of seconds to wait prior to timing out.
362
- minutes : int, default 0
363
- Number of minutes to wait prior to timing out.
364
- hours : int, default 0
365
- Number of hours to wait prior to timing out.
244
+ sources : List[Union[str, Dict[str, Any]]], default: []
245
+ List of secret specs, defining how the secrets are to be retrieved
366
246
  """
367
247
  ...
368
248
 
369
249
  @typing.overload
370
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
250
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
371
251
  ...
372
252
 
373
253
  @typing.overload
374
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
254
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
375
255
  ...
376
256
 
377
- def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, seconds: int = 0, minutes: int = 0, hours: int = 0):
257
+ 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]]] = []):
378
258
  """
379
- Specifies a timeout for your step.
380
-
381
- This decorator is useful if this step may hang indefinitely.
259
+ Specifies secrets to be retrieved and injected as environment variables prior to
260
+ the execution of a step.
382
261
 
383
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
384
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
385
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
386
262
 
387
- Note that all the values specified in parameters are added together so if you specify
388
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
263
+ Parameters
264
+ ----------
265
+ sources : List[Union[str, Dict[str, Any]]], default: []
266
+ List of secret specs, defining how the secrets are to be retrieved
267
+ """
268
+ ...
269
+
270
+ 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]]]:
271
+ """
272
+ Specifies that this step should execute on DGX cloud.
389
273
 
390
274
 
391
275
  Parameters
392
276
  ----------
393
- seconds : int, default 0
394
- Number of seconds to wait prior to timing out.
395
- minutes : int, default 0
396
- Number of minutes to wait prior to timing out.
397
- hours : int, default 0
398
- Number of hours to wait prior to timing out.
277
+ gpu : int
278
+ Number of GPUs to use.
279
+ gpu_type : str
280
+ Type of Nvidia GPU to use.
281
+ queue_timeout : int
282
+ Time to keep the job in NVCF's queue.
399
283
  """
400
284
  ...
401
285
 
402
286
  @typing.overload
403
- 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]]]:
287
+ 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]]]:
404
288
  """
405
- Enables loading / saving of models within a step.
289
+ Specifies that the step will success under all circumstances.
406
290
 
291
+ The decorator will create an optional artifact, specified by `var`, which
292
+ contains the exception raised. You can use it to detect the presence
293
+ of errors, indicating that all happy-path artifacts produced by the step
294
+ are missing.
407
295
 
408
296
 
409
297
  Parameters
410
298
  ----------
411
- load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
412
- Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
413
- These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
414
- - `current.checkpoint`
415
- - `current.model`
416
- - `current.huggingface_hub`
417
-
418
- 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
419
- the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
420
- If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
421
-
422
- temp_dir_root : str, default: None
423
- The root directory under which `current.model.loaded` will store loaded models
299
+ var : str, optional, default None
300
+ Name of the artifact in which to store the caught exception.
301
+ If not specified, the exception is not stored.
302
+ print_exception : bool, default True
303
+ Determines whether or not the exception is printed to
304
+ stdout when caught.
424
305
  """
425
306
  ...
426
307
 
427
308
  @typing.overload
428
- def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
309
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
429
310
  ...
430
311
 
431
312
  @typing.overload
432
- def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
313
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
433
314
  ...
434
315
 
435
- 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):
316
+ 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):
436
317
  """
437
- Enables loading / saving of models within a step.
318
+ Specifies that the step will success under all circumstances.
438
319
 
320
+ The decorator will create an optional artifact, specified by `var`, which
321
+ contains the exception raised. You can use it to detect the presence
322
+ of errors, indicating that all happy-path artifacts produced by the step
323
+ are missing.
439
324
 
440
325
 
441
326
  Parameters
442
327
  ----------
443
- load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
444
- Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
445
- These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
446
- - `current.checkpoint`
447
- - `current.model`
448
- - `current.huggingface_hub`
449
-
450
- 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
451
- the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
452
- If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
453
-
454
- temp_dir_root : str, default: None
455
- The root directory under which `current.model.loaded` will store loaded models
328
+ var : str, optional, default None
329
+ Name of the artifact in which to store the caught exception.
330
+ If not specified, the exception is not stored.
331
+ print_exception : bool, default True
332
+ Determines whether or not the exception is printed to
333
+ stdout when caught.
456
334
  """
457
335
  ...
458
336
 
459
- 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]]]:
337
+ 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]]]:
460
338
  """
461
- Specifies that this step is used to deploy an instance of the app.
462
- Requires that self.app_name, self.app_port, self.entrypoint and self.deployDir is set.
339
+ This decorator is used to run NIM containers in Metaflow tasks as sidecars.
340
+
341
+ User code call
342
+ -----------
343
+ @nim(
344
+ models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
345
+ backend='managed'
346
+ )
347
+
348
+ Valid backend options
349
+ ---------------------
350
+ - 'managed': Outerbounds selects a compute provider based on the model.
351
+
352
+ Valid model options
353
+ ----------------
354
+ - 'meta/llama3-8b-instruct': 8B parameter model
355
+ - 'meta/llama3-70b-instruct': 70B parameter model
356
+ - any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
463
357
 
464
358
 
465
359
  Parameters
466
360
  ----------
467
- app_port : int
468
- Number of GPUs to use.
469
- app_name : str
470
- Name of the app to deploy.
471
- """
472
- ...
473
-
474
- @typing.overload
475
- def environment(*, vars: typing.Dict[str, str] = {}) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
476
- """
477
- Specifies environment variables to be set prior to the execution of a step.
478
-
479
-
480
- Parameters
481
- ----------
482
- vars : Dict[str, str], default {}
483
- Dictionary of environment variables to set.
484
- """
485
- ...
486
-
487
- @typing.overload
488
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
489
- ...
490
-
491
- @typing.overload
492
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
493
- ...
494
-
495
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
496
- """
497
- Specifies environment variables to be set prior to the execution of a step.
498
-
499
-
500
- Parameters
501
- ----------
502
- vars : Dict[str, str], default {}
503
- Dictionary of environment variables to set.
504
- """
505
- ...
506
-
507
- @typing.overload
508
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
509
- """
510
- Decorator prototype for all step decorators. This function gets specialized
511
- and imported for all decorators types by _import_plugin_decorators().
512
- """
513
- ...
514
-
515
- @typing.overload
516
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
517
- ...
518
-
519
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
520
- """
521
- Decorator prototype for all step decorators. This function gets specialized
522
- and imported for all decorators types by _import_plugin_decorators().
361
+ models: list[NIM]
362
+ List of NIM containers running models in sidecars.
363
+ backend: str
364
+ Compute provider to run the NIM container.
365
+ queue_timeout : int
366
+ Time to keep the job in NVCF's queue.
523
367
  """
524
368
  ...
525
369
 
@@ -583,142 +427,101 @@ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
583
427
  ...
584
428
 
585
429
  @typing.overload
586
- 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]]]:
430
+ 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]]]:
587
431
  """
588
- Specifies secrets to be retrieved and injected as environment variables prior to
589
- the execution of a step.
432
+ Specifies the PyPI packages for the step.
433
+
434
+ Information in this decorator will augment any
435
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
436
+ you can use `@pypi_base` to set packages required by all
437
+ steps and use `@pypi` to specify step-specific overrides.
590
438
 
591
439
 
592
440
  Parameters
593
441
  ----------
594
- sources : List[Union[str, Dict[str, Any]]], default: []
595
- List of secret specs, defining how the secrets are to be retrieved
442
+ packages : Dict[str, str], default: {}
443
+ Packages to use for this step. The key is the name of the package
444
+ and the value is the version to use.
445
+ python : str, optional, default: None
446
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
447
+ that the version used will correspond to the version of the Python interpreter used to start the run.
596
448
  """
597
449
  ...
598
450
 
599
451
  @typing.overload
600
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
452
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
601
453
  ...
602
454
 
603
455
  @typing.overload
604
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
605
- ...
606
-
607
- 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]]] = []):
608
- """
609
- Specifies secrets to be retrieved and injected as environment variables prior to
610
- the execution of a step.
611
-
612
-
613
- Parameters
614
- ----------
615
- sources : List[Union[str, Dict[str, Any]]], default: []
616
- List of secret specs, defining how the secrets are to be retrieved
617
- """
456
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
618
457
  ...
619
458
 
620
- 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]]]:
459
+ 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):
621
460
  """
622
- This decorator is used to run Ollama APIs as Metaflow task sidecars.
623
-
624
- User code call
625
- -----------
626
- @ollama(
627
- models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
628
- backend='local'
629
- )
630
-
631
- Valid backend options
632
- ---------------------
633
- - 'local': Run as a separate process on the local task machine.
634
- - (TODO) 'managed': Outerbounds hosts and selects compute provider.
635
- - (TODO) 'remote': Spin up separate instance to serve Ollama models.
461
+ Specifies the PyPI packages for the step.
636
462
 
637
- Valid model options
638
- ----------------
639
- - 'llama3.2'
640
- - 'llama3.3'
641
- - any model here https://ollama.com/search
463
+ Information in this decorator will augment any
464
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
465
+ you can use `@pypi_base` to set packages required by all
466
+ steps and use `@pypi` to specify step-specific overrides.
642
467
 
643
468
 
644
469
  Parameters
645
470
  ----------
646
- models: list[Ollama]
647
- List of Ollama containers running models in sidecars.
648
- backend: str
649
- Determines where and how to run the Ollama process.
471
+ packages : Dict[str, str], default: {}
472
+ Packages to use for this step. The key is the name of the package
473
+ and the value is the version to use.
474
+ python : str, optional, default: None
475
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
476
+ that the version used will correspond to the version of the Python interpreter used to start the run.
650
477
  """
651
478
  ...
652
479
 
653
- def nvct(*, gpu: int, gpu_type: str) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
480
+ @typing.overload
481
+ def environment(*, vars: typing.Dict[str, str] = {}) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
654
482
  """
655
- Specifies that this step should execute on DGX cloud.
483
+ Specifies environment variables to be set prior to the execution of a step.
656
484
 
657
485
 
658
486
  Parameters
659
487
  ----------
660
- gpu : int
661
- Number of GPUs to use.
662
- gpu_type : str
663
- Type of Nvidia GPU to use.
488
+ vars : Dict[str, str], default {}
489
+ Dictionary of environment variables to set.
664
490
  """
665
491
  ...
666
492
 
667
493
  @typing.overload
668
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
669
- """
670
- Internal decorator to support Fast bakery
671
- """
494
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
672
495
  ...
673
496
 
674
497
  @typing.overload
675
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
676
- ...
677
-
678
- def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
679
- """
680
- Internal decorator to support Fast bakery
681
- """
498
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
682
499
  ...
683
500
 
684
- 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]]]:
501
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
685
502
  """
686
- Specifies that this step should execute on DGX cloud.
503
+ Specifies environment variables to be set prior to the execution of a step.
687
504
 
688
505
 
689
506
  Parameters
690
507
  ----------
691
- gpu : int
692
- Number of GPUs to use.
693
- gpu_type : str
694
- Type of Nvidia GPU to use.
695
- queue_timeout : int
696
- Time to keep the job in NVCF's queue.
508
+ vars : Dict[str, str], default {}
509
+ Dictionary of environment variables to set.
697
510
  """
698
511
  ...
699
512
 
700
- 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]]]:
513
+ 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]]]:
701
514
  """
702
- Decorator that helps cache, version and store models/datasets from huggingface hub.
515
+ Specifies that this step is used to deploy an instance of the app.
516
+ Requires that self.app_name, self.app_port, self.entrypoint and self.deployDir is set.
703
517
 
704
518
 
705
519
  Parameters
706
520
  ----------
707
- temp_dir_root : str, optional
708
- The root directory that will hold the temporary directory where objects will be downloaded.
709
-
710
- load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
711
- The list of repos (models/datasets) to load.
712
-
713
- Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
714
-
715
- - If repo (model/dataset) is not found in the datastore:
716
- - Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
717
- - Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
718
- - All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
719
-
720
- - If repo is found in the datastore:
721
- - Loads it directly from datastore to local path (can be temporary directory or specified path)
521
+ app_port : int
522
+ Number of GPUs to use.
523
+ app_name : str
524
+ Name of the app to deploy.
722
525
  """
723
526
  ...
724
527
 
@@ -771,87 +574,47 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
771
574
  """
772
575
  ...
773
576
 
774
- 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]]]:
775
- """
776
- This decorator is used to run NIM containers in Metaflow tasks as sidecars.
777
-
778
- User code call
779
- -----------
780
- @nim(
781
- models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
782
- backend='managed'
783
- )
784
-
785
- Valid backend options
786
- ---------------------
787
- - 'managed': Outerbounds selects a compute provider based on the model.
788
-
789
- Valid model options
790
- ----------------
791
- - 'meta/llama3-8b-instruct': 8B parameter model
792
- - 'meta/llama3-70b-instruct': 70B parameter model
793
- - any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
794
-
795
-
796
- Parameters
797
- ----------
798
- models: list[NIM]
799
- List of NIM containers running models in sidecars.
800
- backend: str
801
- Compute provider to run the NIM container.
802
- queue_timeout : int
803
- Time to keep the job in NVCF's queue.
804
- """
805
- ...
806
-
807
577
  @typing.overload
808
- 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]]]:
578
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
809
579
  """
810
- Specifies that the step will success under all circumstances.
811
-
812
- The decorator will create an optional artifact, specified by `var`, which
813
- contains the exception raised. You can use it to detect the presence
814
- of errors, indicating that all happy-path artifacts produced by the step
815
- are missing.
816
-
817
-
818
- Parameters
819
- ----------
820
- var : str, optional, default None
821
- Name of the artifact in which to store the caught exception.
822
- If not specified, the exception is not stored.
823
- print_exception : bool, default True
824
- Determines whether or not the exception is printed to
825
- stdout when caught.
580
+ Decorator prototype for all step decorators. This function gets specialized
581
+ and imported for all decorators types by _import_plugin_decorators().
826
582
  """
827
583
  ...
828
584
 
829
585
  @typing.overload
830
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
586
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
831
587
  ...
832
588
 
833
- @typing.overload
834
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
589
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
590
+ """
591
+ Decorator prototype for all step decorators. This function gets specialized
592
+ and imported for all decorators types by _import_plugin_decorators().
593
+ """
835
594
  ...
836
595
 
837
- 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):
596
+ 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]]]:
838
597
  """
839
- Specifies that the step will success under all circumstances.
840
-
841
- The decorator will create an optional artifact, specified by `var`, which
842
- contains the exception raised. You can use it to detect the presence
843
- of errors, indicating that all happy-path artifacts produced by the step
844
- are missing.
598
+ Decorator that helps cache, version and store models/datasets from huggingface hub.
845
599
 
846
600
 
847
601
  Parameters
848
602
  ----------
849
- var : str, optional, default None
850
- Name of the artifact in which to store the caught exception.
851
- If not specified, the exception is not stored.
852
- print_exception : bool, default True
853
- Determines whether or not the exception is printed to
854
- stdout when caught.
603
+ temp_dir_root : str, optional
604
+ The root directory that will hold the temporary directory where objects will be downloaded.
605
+
606
+ load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
607
+ The list of repos (models/datasets) to load.
608
+
609
+ Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
610
+
611
+ - If repo (model/dataset) is not found in the datastore:
612
+ - Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
613
+ - Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
614
+ - All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
615
+
616
+ - If repo is found in the datastore:
617
+ - Loads it directly from datastore to local path (can be temporary directory or specified path)
855
618
  """
856
619
  ...
857
620
 
@@ -910,6 +673,113 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
910
673
  """
911
674
  ...
912
675
 
676
+ @typing.overload
677
+ 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]]]:
678
+ """
679
+ Enables loading / saving of models within a step.
680
+
681
+
682
+
683
+ Parameters
684
+ ----------
685
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
686
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
687
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
688
+ - `current.checkpoint`
689
+ - `current.model`
690
+ - `current.huggingface_hub`
691
+
692
+ 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
693
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
694
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
695
+
696
+ temp_dir_root : str, default: None
697
+ The root directory under which `current.model.loaded` will store loaded models
698
+ """
699
+ ...
700
+
701
+ @typing.overload
702
+ def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
703
+ ...
704
+
705
+ @typing.overload
706
+ def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
707
+ ...
708
+
709
+ 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):
710
+ """
711
+ Enables loading / saving of models within a step.
712
+
713
+
714
+
715
+ Parameters
716
+ ----------
717
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
718
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
719
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
720
+ - `current.checkpoint`
721
+ - `current.model`
722
+ - `current.huggingface_hub`
723
+
724
+ 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
725
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
726
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
727
+
728
+ temp_dir_root : str, default: None
729
+ The root directory under which `current.model.loaded` will store loaded models
730
+ """
731
+ ...
732
+
733
+ @typing.overload
734
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
735
+ """
736
+ Internal decorator to support Fast bakery
737
+ """
738
+ ...
739
+
740
+ @typing.overload
741
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
742
+ ...
743
+
744
+ def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
745
+ """
746
+ Internal decorator to support Fast bakery
747
+ """
748
+ ...
749
+
750
+ 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]]]:
751
+ """
752
+ This decorator is used to run Ollama APIs as Metaflow task sidecars.
753
+
754
+ User code call
755
+ -----------
756
+ @ollama(
757
+ models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
758
+ backend='local'
759
+ )
760
+
761
+ Valid backend options
762
+ ---------------------
763
+ - 'local': Run as a separate process on the local task machine.
764
+ - (TODO) 'managed': Outerbounds hosts and selects compute provider.
765
+ - (TODO) 'remote': Spin up separate instance to serve Ollama models.
766
+
767
+ Valid model options
768
+ ----------------
769
+ - 'llama3.2'
770
+ - 'llama3.3'
771
+ - any model here https://ollama.com/search
772
+
773
+
774
+ Parameters
775
+ ----------
776
+ models: list[Ollama]
777
+ List of Ollama containers running models in sidecars.
778
+ backend: str
779
+ Determines where and how to run the Ollama process.
780
+ """
781
+ ...
782
+
913
783
  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]]]:
914
784
  """
915
785
  Specifies that this step should execute on Kubernetes.
@@ -996,53 +866,167 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
996
866
  ...
997
867
 
998
868
  @typing.overload
999
- 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]]:
869
+ 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]]]:
1000
870
  """
1001
- Specifies the times when the flow should be run when running on a
1002
- production scheduler.
871
+ Enables checkpointing for a step.
872
+
1003
873
 
1004
874
 
1005
875
  Parameters
1006
876
  ----------
1007
- hourly : bool, default False
1008
- Run the workflow hourly.
1009
- daily : bool, default True
1010
- Run the workflow daily.
1011
- weekly : bool, default False
1012
- Run the workflow weekly.
1013
- cron : str, optional, default None
1014
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1015
- specified by this expression.
1016
- timezone : str, optional, default None
1017
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1018
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
877
+ load_policy : str, default: "fresh"
878
+ The policy for loading the checkpoint. The following policies are supported:
879
+ - "eager": Loads the the latest available checkpoint within the namespace.
880
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
881
+ will be loaded at the start of the task.
882
+ - "none": Do not load any checkpoint
883
+ - "fresh": Loads the lastest checkpoint created within the running Task.
884
+ This mode helps loading checkpoints across various retry attempts of the same task.
885
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
886
+ created within the task will be loaded when the task is retries execution on failure.
887
+
888
+ temp_dir_root : str, default: None
889
+ The root directory under which `current.checkpoint.directory` will be created.
1019
890
  """
1020
891
  ...
1021
892
 
1022
893
  @typing.overload
1023
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
894
+ def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1024
895
  ...
1025
896
 
1026
- def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
897
+ @typing.overload
898
+ def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
899
+ ...
900
+
901
+ 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):
1027
902
  """
1028
- Specifies the times when the flow should be run when running on a
1029
- production scheduler.
903
+ Enables checkpointing for a step.
904
+
905
+
906
+
907
+ Parameters
908
+ ----------
909
+ load_policy : str, default: "fresh"
910
+ The policy for loading the checkpoint. The following policies are supported:
911
+ - "eager": Loads the the latest available checkpoint within the namespace.
912
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
913
+ will be loaded at the start of the task.
914
+ - "none": Do not load any checkpoint
915
+ - "fresh": Loads the lastest checkpoint created within the running Task.
916
+ This mode helps loading checkpoints across various retry attempts of the same task.
917
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
918
+ created within the task will be loaded when the task is retries execution on failure.
919
+
920
+ temp_dir_root : str, default: None
921
+ The root directory under which `current.checkpoint.directory` will be created.
922
+ """
923
+ ...
924
+
925
+ def nvct(*, gpu: int, gpu_type: str) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
926
+ """
927
+ Specifies that this step should execute on DGX cloud.
928
+
929
+
930
+ Parameters
931
+ ----------
932
+ gpu : int
933
+ Number of GPUs to use.
934
+ gpu_type : str
935
+ Type of Nvidia GPU to use.
936
+ """
937
+ ...
938
+
939
+ @typing.overload
940
+ def timeout(*, seconds: int = 0, minutes: int = 0, hours: int = 0) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
941
+ """
942
+ Specifies a timeout for your step.
943
+
944
+ This decorator is useful if this step may hang indefinitely.
945
+
946
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
947
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
948
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
949
+
950
+ Note that all the values specified in parameters are added together so if you specify
951
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
952
+
953
+
954
+ Parameters
955
+ ----------
956
+ seconds : int, default 0
957
+ Number of seconds to wait prior to timing out.
958
+ minutes : int, default 0
959
+ Number of minutes to wait prior to timing out.
960
+ hours : int, default 0
961
+ Number of hours to wait prior to timing out.
962
+ """
963
+ ...
964
+
965
+ @typing.overload
966
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
967
+ ...
968
+
969
+ @typing.overload
970
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
971
+ ...
972
+
973
+ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, seconds: int = 0, minutes: int = 0, hours: int = 0):
974
+ """
975
+ Specifies a timeout for your step.
976
+
977
+ This decorator is useful if this step may hang indefinitely.
978
+
979
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
980
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
981
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
982
+
983
+ Note that all the values specified in parameters are added together so if you specify
984
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
985
+
986
+
987
+ Parameters
988
+ ----------
989
+ seconds : int, default 0
990
+ Number of seconds to wait prior to timing out.
991
+ minutes : int, default 0
992
+ Number of minutes to wait prior to timing out.
993
+ hours : int, default 0
994
+ Number of hours to wait prior to timing out.
995
+ """
996
+ ...
997
+
998
+ def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
999
+ """
1000
+ Specifies what flows belong to the same project.
1001
+
1002
+ A project-specific namespace is created for all flows that
1003
+ use the same `@project(name)`.
1030
1004
 
1031
1005
 
1032
1006
  Parameters
1033
1007
  ----------
1034
- hourly : bool, default False
1035
- Run the workflow hourly.
1036
- daily : bool, default True
1037
- Run the workflow daily.
1038
- weekly : bool, default False
1039
- Run the workflow weekly.
1040
- cron : str, optional, default None
1041
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1042
- specified by this expression.
1043
- timezone : str, optional, default None
1044
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1045
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1008
+ name : str
1009
+ Project name. Make sure that the name is unique amongst all
1010
+ projects that use the same production scheduler. The name may
1011
+ contain only lowercase alphanumeric characters and underscores.
1012
+
1013
+ branch : Optional[str], default None
1014
+ The branch to use. If not specified, the branch is set to
1015
+ `user.<username>` unless `production` is set to `True`. This can
1016
+ also be set on the command line using `--branch` as a top-level option.
1017
+ It is an error to specify `branch` in the decorator and on the command line.
1018
+
1019
+ production : bool, default False
1020
+ Whether or not the branch is the production branch. This can also be set on the
1021
+ command line using `--production` as a top-level option. It is an error to specify
1022
+ `production` in the decorator and on the command line.
1023
+ The project branch name will be:
1024
+ - if `branch` is specified:
1025
+ - if `production` is True: `prod.<branch>`
1026
+ - if `production` is False: `test.<branch>`
1027
+ - if `branch` is not specified:
1028
+ - if `production` is True: `prod`
1029
+ - if `production` is False: `user.<username>`
1046
1030
  """
1047
1031
  ...
1048
1032
 
@@ -1097,46 +1081,54 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
1097
1081
  """
1098
1082
  ...
1099
1083
 
1100
- 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]]:
1084
+ @typing.overload
1085
+ 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]]:
1101
1086
  """
1102
- 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.
1103
- 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.
1087
+ Specifies the times when the flow should be run when running on a
1088
+ production scheduler.
1104
1089
 
1105
1090
 
1106
1091
  Parameters
1107
1092
  ----------
1108
- timeout : int
1109
- Time, in seconds before the task times out and fails. (Default: 3600)
1110
- poke_interval : int
1111
- Time in seconds that the job should wait in between each try. (Default: 60)
1112
- mode : str
1113
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1114
- exponential_backoff : bool
1115
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1116
- pool : str
1117
- the slot pool this task should run in,
1118
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1119
- soft_fail : bool
1120
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1121
- name : str
1122
- Name of the sensor on Airflow
1123
- description : str
1124
- Description of sensor in the Airflow UI
1125
- external_dag_id : str
1126
- The dag_id that contains the task you want to wait for.
1127
- external_task_ids : List[str]
1128
- The list of task_ids that you want to wait for.
1129
- If None (default value) the sensor waits for the DAG. (Default: None)
1130
- allowed_states : List[str]
1131
- Iterable of allowed states, (Default: ['success'])
1132
- failed_states : List[str]
1133
- Iterable of failed or dis-allowed states. (Default: None)
1134
- execution_delta : datetime.timedelta
1135
- time difference with the previous execution to look at,
1136
- the default is the same logical date as the current task or DAG. (Default: None)
1137
- check_existence: bool
1138
- Set to True to check if the external task exists or check if
1139
- the DAG to wait for exists. (Default: True)
1093
+ hourly : bool, default False
1094
+ Run the workflow hourly.
1095
+ daily : bool, default True
1096
+ Run the workflow daily.
1097
+ weekly : bool, default False
1098
+ Run the workflow weekly.
1099
+ cron : str, optional, default None
1100
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1101
+ specified by this expression.
1102
+ timezone : str, optional, default None
1103
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1104
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1105
+ """
1106
+ ...
1107
+
1108
+ @typing.overload
1109
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1110
+ ...
1111
+
1112
+ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
1113
+ """
1114
+ Specifies the times when the flow should be run when running on a
1115
+ production scheduler.
1116
+
1117
+
1118
+ Parameters
1119
+ ----------
1120
+ hourly : bool, default False
1121
+ Run the workflow hourly.
1122
+ daily : bool, default True
1123
+ Run the workflow daily.
1124
+ weekly : bool, default False
1125
+ Run the workflow weekly.
1126
+ cron : str, optional, default None
1127
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1128
+ specified by this expression.
1129
+ timezone : str, optional, default None
1130
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1131
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1140
1132
  """
1141
1133
  ...
1142
1134
 
@@ -1254,38 +1246,44 @@ def with_artifact_store(f: typing.Optional[typing.Type[FlowSpecDerived]] = None)
1254
1246
  """
1255
1247
  ...
1256
1248
 
1257
- def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1249
+ @typing.overload
1250
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1258
1251
  """
1259
- Specifies what flows belong to the same project.
1260
-
1261
- A project-specific namespace is created for all flows that
1262
- use the same `@project(name)`.
1252
+ Specifies the PyPI packages for all steps of the flow.
1263
1253
 
1254
+ Use `@pypi_base` to set common packages required by all
1255
+ steps and use `@pypi` to specify step-specific overrides.
1264
1256
 
1265
1257
  Parameters
1266
1258
  ----------
1267
- name : str
1268
- Project name. Make sure that the name is unique amongst all
1269
- projects that use the same production scheduler. The name may
1270
- contain only lowercase alphanumeric characters and underscores.
1259
+ packages : Dict[str, str], default: {}
1260
+ Packages to use for this flow. The key is the name of the package
1261
+ and the value is the version to use.
1262
+ python : str, optional, default: None
1263
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1264
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1265
+ """
1266
+ ...
1267
+
1268
+ @typing.overload
1269
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1270
+ ...
1271
+
1272
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1273
+ """
1274
+ Specifies the PyPI packages for all steps of the flow.
1271
1275
 
1272
- branch : Optional[str], default None
1273
- The branch to use. If not specified, the branch is set to
1274
- `user.<username>` unless `production` is set to `True`. This can
1275
- also be set on the command line using `--branch` as a top-level option.
1276
- It is an error to specify `branch` in the decorator and on the command line.
1276
+ Use `@pypi_base` to set common packages required by all
1277
+ steps and use `@pypi` to specify step-specific overrides.
1277
1278
 
1278
- production : bool, default False
1279
- Whether or not the branch is the production branch. This can also be set on the
1280
- command line using `--production` as a top-level option. It is an error to specify
1281
- `production` in the decorator and on the command line.
1282
- The project branch name will be:
1283
- - if `branch` is specified:
1284
- - if `production` is True: `prod.<branch>`
1285
- - if `production` is False: `test.<branch>`
1286
- - if `branch` is not specified:
1287
- - if `production` is True: `prod`
1288
- - if `production` is False: `user.<username>`
1279
+ Parameters
1280
+ ----------
1281
+ packages : Dict[str, str], default: {}
1282
+ Packages to use for this flow. The key is the name of the package
1283
+ and the value is the version to use.
1284
+ python : str, optional, default: None
1285
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1286
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1289
1287
  """
1290
1288
  ...
1291
1289
 
@@ -1483,6 +1481,49 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1483
1481
  """
1484
1482
  ...
1485
1483
 
1484
+ 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]]:
1485
+ """
1486
+ 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.
1487
+ 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.
1488
+
1489
+
1490
+ Parameters
1491
+ ----------
1492
+ timeout : int
1493
+ Time, in seconds before the task times out and fails. (Default: 3600)
1494
+ poke_interval : int
1495
+ Time in seconds that the job should wait in between each try. (Default: 60)
1496
+ mode : str
1497
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1498
+ exponential_backoff : bool
1499
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1500
+ pool : str
1501
+ the slot pool this task should run in,
1502
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1503
+ soft_fail : bool
1504
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1505
+ name : str
1506
+ Name of the sensor on Airflow
1507
+ description : str
1508
+ Description of sensor in the Airflow UI
1509
+ external_dag_id : str
1510
+ The dag_id that contains the task you want to wait for.
1511
+ external_task_ids : List[str]
1512
+ The list of task_ids that you want to wait for.
1513
+ If None (default value) the sensor waits for the DAG. (Default: None)
1514
+ allowed_states : List[str]
1515
+ Iterable of allowed states, (Default: ['success'])
1516
+ failed_states : List[str]
1517
+ Iterable of failed or dis-allowed states. (Default: None)
1518
+ execution_delta : datetime.timedelta
1519
+ time difference with the previous execution to look at,
1520
+ the default is the same logical date as the current task or DAG. (Default: None)
1521
+ check_existence: bool
1522
+ Set to True to check if the external task exists or check if
1523
+ the DAG to wait for exists. (Default: True)
1524
+ """
1525
+ ...
1526
+
1486
1527
  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]]:
1487
1528
  """
1488
1529
  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)
@@ -1526,46 +1567,5 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
1526
1567
  """
1527
1568
  ...
1528
1569
 
1529
- @typing.overload
1530
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1531
- """
1532
- Specifies the PyPI packages for all steps of the flow.
1533
-
1534
- Use `@pypi_base` to set common packages required by all
1535
- steps and use `@pypi` to specify step-specific overrides.
1536
-
1537
- Parameters
1538
- ----------
1539
- packages : Dict[str, str], default: {}
1540
- Packages to use for this flow. The key is the name of the package
1541
- and the value is the version to use.
1542
- python : str, optional, default: None
1543
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1544
- that the version used will correspond to the version of the Python interpreter used to start the run.
1545
- """
1546
- ...
1547
-
1548
- @typing.overload
1549
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1550
- ...
1551
-
1552
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1553
- """
1554
- Specifies the PyPI packages for all steps of the flow.
1555
-
1556
- Use `@pypi_base` to set common packages required by all
1557
- steps and use `@pypi` to specify step-specific overrides.
1558
-
1559
- Parameters
1560
- ----------
1561
- packages : Dict[str, str], default: {}
1562
- Packages to use for this flow. The key is the name of the package
1563
- and the value is the version to use.
1564
- python : str, optional, default: None
1565
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1566
- that the version used will correspond to the version of the Python interpreter used to start the run.
1567
- """
1568
- ...
1569
-
1570
1570
  pkg_name: str
1571
1571