ob-metaflow-stubs 6.0.3.140__py2.py3-none-any.whl → 6.0.3.142__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. metaflow-stubs/__init__.pyi +490 -489
  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 +4 -4
  8. metaflow-stubs/client/filecache.pyi +1 -1
  9. metaflow-stubs/events.pyi +1 -1
  10. metaflow-stubs/exception.pyi +1 -1
  11. metaflow-stubs/flowspec.pyi +4 -4
  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 +84 -84
  21. metaflow-stubs/mf_extensions/__init__.pyi +1 -1
  22. metaflow-stubs/mf_extensions/obcheckpoint/__init__.pyi +1 -1
  23. metaflow-stubs/mf_extensions/obcheckpoint/plugins/__init__.pyi +1 -1
  24. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/__init__.pyi +1 -1
  25. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/__init__.pyi +1 -1
  26. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/async_cards.pyi +1 -1
  27. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/deco_injection_mixin.pyi +1 -1
  28. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/extra_components.pyi +2 -2
  29. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/__init__.pyi +1 -1
  30. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/__init__.pyi +1 -1
  31. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/checkpoint_lister.pyi +4 -4
  32. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/lineage_card.pyi +1 -1
  33. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/checkpoint_storage.pyi +4 -4
  34. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/constructors.pyi +1 -1
  35. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/core.pyi +3 -3
  36. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/decorator.pyi +3 -3
  37. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/exceptions.pyi +1 -1
  38. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/final_api.pyi +2 -2
  39. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/lineage.pyi +1 -1
  40. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/__init__.pyi +1 -1
  41. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/core.pyi +2 -2
  42. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/exceptions.pyi +1 -1
  43. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/task_utils.pyi +2 -2
  44. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi +1 -1
  45. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi +2 -2
  46. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/exceptions.pyi +1 -1
  47. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/__init__.pyi +1 -1
  48. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/decorator.pyi +1 -1
  49. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/__init__.pyi +1 -1
  50. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/core.pyi +2 -2
  51. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/exceptions.pyi +1 -1
  52. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/model_storage.pyi +4 -4
  53. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/__init__.pyi +1 -1
  54. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/flowspec_utils.pyi +1 -1
  55. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/general.pyi +1 -1
  56. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/identity_utils.pyi +1 -1
  57. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/__init__.pyi +1 -1
  58. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/base.pyi +1 -1
  59. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/tar.pyi +2 -2
  60. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +2 -2
  61. metaflow-stubs/mf_extensions/outerbounds/__init__.pyi +1 -1
  62. metaflow-stubs/mf_extensions/outerbounds/plugins/__init__.pyi +1 -1
  63. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/__init__.pyi +1 -1
  64. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/snowflake.pyi +1 -1
  65. metaflow-stubs/mf_extensions/outerbounds/profilers/__init__.pyi +1 -1
  66. metaflow-stubs/mf_extensions/outerbounds/profilers/gpu.pyi +1 -1
  67. metaflow-stubs/mf_extensions/outerbounds/remote_config.pyi +1 -1
  68. metaflow-stubs/mf_extensions/outerbounds/toplevel/__init__.pyi +1 -1
  69. metaflow-stubs/mf_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.pyi +1 -1
  70. metaflow-stubs/multicore_utils.pyi +1 -1
  71. metaflow-stubs/parameters.pyi +3 -3
  72. metaflow-stubs/plugins/__init__.pyi +10 -10
  73. metaflow-stubs/plugins/airflow/__init__.pyi +1 -1
  74. metaflow-stubs/plugins/airflow/airflow_utils.pyi +1 -1
  75. metaflow-stubs/plugins/airflow/exception.pyi +1 -1
  76. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +1 -1
  77. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +1 -1
  78. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +1 -1
  79. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +1 -1
  80. metaflow-stubs/plugins/argo/__init__.pyi +1 -1
  81. metaflow-stubs/plugins/argo/argo_client.pyi +1 -1
  82. metaflow-stubs/plugins/argo/argo_events.pyi +1 -1
  83. metaflow-stubs/plugins/argo/argo_workflows.pyi +1 -1
  84. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +2 -2
  85. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
  86. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +2 -2
  87. metaflow-stubs/plugins/aws/__init__.pyi +1 -1
  88. metaflow-stubs/plugins/aws/aws_client.pyi +1 -1
  89. metaflow-stubs/plugins/aws/aws_utils.pyi +1 -1
  90. metaflow-stubs/plugins/aws/batch/__init__.pyi +1 -1
  91. metaflow-stubs/plugins/aws/batch/batch.pyi +1 -1
  92. metaflow-stubs/plugins/aws/batch/batch_client.pyi +1 -1
  93. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +1 -1
  94. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +1 -1
  95. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
  96. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +1 -1
  97. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +1 -1
  98. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +1 -1
  99. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +1 -1
  100. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +1 -1
  101. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +3 -3
  102. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +3 -3
  103. metaflow-stubs/plugins/azure/__init__.pyi +1 -1
  104. metaflow-stubs/plugins/azure/azure_credential.pyi +1 -1
  105. metaflow-stubs/plugins/azure/azure_exceptions.pyi +1 -1
  106. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +3 -3
  107. metaflow-stubs/plugins/azure/azure_utils.pyi +1 -1
  108. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +1 -1
  109. metaflow-stubs/plugins/azure/includefile_support.pyi +1 -1
  110. metaflow-stubs/plugins/cards/__init__.pyi +1 -1
  111. metaflow-stubs/plugins/cards/card_client.pyi +2 -2
  112. metaflow-stubs/plugins/cards/card_creator.pyi +1 -1
  113. metaflow-stubs/plugins/cards/card_datastore.pyi +1 -1
  114. metaflow-stubs/plugins/cards/card_decorator.pyi +1 -1
  115. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +1 -1
  116. metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
  117. metaflow-stubs/plugins/cards/card_modules/card.pyi +1 -1
  118. metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
  119. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +1 -1
  120. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +1 -1
  121. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +1 -1
  122. metaflow-stubs/plugins/cards/card_resolver.pyi +1 -1
  123. metaflow-stubs/plugins/cards/component_serializer.pyi +1 -1
  124. metaflow-stubs/plugins/cards/exception.pyi +1 -1
  125. metaflow-stubs/plugins/catch_decorator.pyi +2 -2
  126. metaflow-stubs/plugins/datatools/__init__.pyi +1 -1
  127. metaflow-stubs/plugins/datatools/local.pyi +1 -1
  128. metaflow-stubs/plugins/datatools/s3/__init__.pyi +1 -1
  129. metaflow-stubs/plugins/datatools/s3/s3.pyi +3 -3
  130. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +1 -1
  131. metaflow-stubs/plugins/datatools/s3/s3util.pyi +1 -1
  132. metaflow-stubs/plugins/debug_logger.pyi +1 -1
  133. metaflow-stubs/plugins/debug_monitor.pyi +1 -1
  134. metaflow-stubs/plugins/environment_decorator.pyi +1 -1
  135. metaflow-stubs/plugins/events_decorator.pyi +1 -1
  136. metaflow-stubs/plugins/frameworks/__init__.pyi +1 -1
  137. metaflow-stubs/plugins/frameworks/pytorch.pyi +1 -1
  138. metaflow-stubs/plugins/gcp/__init__.pyi +1 -1
  139. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
  140. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +1 -1
  141. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +1 -1
  142. metaflow-stubs/plugins/gcp/gs_utils.pyi +1 -1
  143. metaflow-stubs/plugins/gcp/includefile_support.pyi +1 -1
  144. metaflow-stubs/plugins/kubernetes/__init__.pyi +1 -1
  145. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
  146. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +1 -1
  147. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +1 -1
  148. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +1 -1
  149. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +1 -1
  150. metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +1 -1
  151. metaflow-stubs/plugins/parallel_decorator.pyi +1 -1
  152. metaflow-stubs/plugins/perimeters.pyi +1 -1
  153. metaflow-stubs/plugins/project_decorator.pyi +1 -1
  154. metaflow-stubs/plugins/pypi/__init__.pyi +1 -1
  155. metaflow-stubs/plugins/pypi/conda_decorator.pyi +1 -1
  156. metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
  157. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +1 -1
  158. metaflow-stubs/plugins/pypi/pypi_environment.pyi +1 -1
  159. metaflow-stubs/plugins/pypi/utils.pyi +1 -1
  160. metaflow-stubs/plugins/resources_decorator.pyi +1 -1
  161. metaflow-stubs/plugins/retry_decorator.pyi +1 -1
  162. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  163. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
  164. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +1 -1
  165. metaflow-stubs/plugins/snowflake/__init__.pyi +1 -1
  166. metaflow-stubs/plugins/storage_executor.pyi +1 -1
  167. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +1 -1
  168. metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
  169. metaflow-stubs/profilers/__init__.pyi +1 -1
  170. metaflow-stubs/pylint_wrapper.pyi +1 -1
  171. metaflow-stubs/runner/__init__.pyi +1 -1
  172. metaflow-stubs/runner/deployer.pyi +6 -6
  173. metaflow-stubs/runner/deployer_impl.pyi +2 -2
  174. metaflow-stubs/runner/metaflow_runner.pyi +3 -3
  175. metaflow-stubs/runner/nbdeploy.pyi +1 -1
  176. metaflow-stubs/runner/nbrun.pyi +1 -1
  177. metaflow-stubs/runner/subprocess_manager.pyi +1 -1
  178. metaflow-stubs/runner/utils.pyi +2 -2
  179. metaflow-stubs/system/__init__.pyi +1 -1
  180. metaflow-stubs/system/system_logger.pyi +1 -1
  181. metaflow-stubs/system/system_monitor.pyi +1 -1
  182. metaflow-stubs/tagging_util.pyi +1 -1
  183. metaflow-stubs/tuple_util.pyi +1 -1
  184. metaflow-stubs/user_configs/__init__.pyi +1 -1
  185. metaflow-stubs/user_configs/config_decorators.pyi +4 -4
  186. metaflow-stubs/user_configs/config_options.pyi +3 -3
  187. metaflow-stubs/user_configs/config_parameters.pyi +6 -6
  188. {ob_metaflow_stubs-6.0.3.140.dist-info → ob_metaflow_stubs-6.0.3.142.dist-info}/METADATA +1 -1
  189. ob_metaflow_stubs-6.0.3.142.dist-info/RECORD +192 -0
  190. ob_metaflow_stubs-6.0.3.140.dist-info/RECORD +0 -192
  191. {ob_metaflow_stubs-6.0.3.140.dist-info → ob_metaflow_stubs-6.0.3.142.dist-info}/WHEEL +0 -0
  192. {ob_metaflow_stubs-6.0.3.140.dist-info → ob_metaflow_stubs-6.0.3.142.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.14.0.1+obcheckpoint(0.1.8);ob(v1) #
4
- # Generated on 2025-02-11T20:37:27.195718 #
4
+ # Generated on 2025-02-13T17:42:31.232300 #
5
5
  ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -35,8 +35,8 @@ 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
39
+ from . import tuple_util as tuple_util
40
40
  from . import events as events
41
41
  from . import runner as runner
42
42
  from . import plugins as plugins
@@ -146,6 +146,118 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
146
146
  """
147
147
  ...
148
148
 
149
+ @typing.overload
150
+ 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]]]:
151
+ """
152
+ Specifies the resources needed when executing this step.
153
+
154
+ Use `@resources` to specify the resource requirements
155
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
156
+
157
+ You can choose the compute layer on the command line by executing e.g.
158
+ ```
159
+ python myflow.py run --with batch
160
+ ```
161
+ or
162
+ ```
163
+ python myflow.py run --with kubernetes
164
+ ```
165
+ which executes the flow on the desired system using the
166
+ requirements specified in `@resources`.
167
+
168
+
169
+ Parameters
170
+ ----------
171
+ cpu : int, default 1
172
+ Number of CPUs required for this step.
173
+ gpu : int, optional, default None
174
+ Number of GPUs required for this step.
175
+ disk : int, optional, default None
176
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
177
+ memory : int, default 4096
178
+ Memory size (in MB) required for this step.
179
+ shared_memory : int, optional, default None
180
+ The value for the size (in MiB) of the /dev/shm volume for this step.
181
+ This parameter maps to the `--shm-size` option in Docker.
182
+ """
183
+ ...
184
+
185
+ @typing.overload
186
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
187
+ ...
188
+
189
+ @typing.overload
190
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
191
+ ...
192
+
193
+ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
194
+ """
195
+ Specifies the resources needed when executing this step.
196
+
197
+ Use `@resources` to specify the resource requirements
198
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
199
+
200
+ You can choose the compute layer on the command line by executing e.g.
201
+ ```
202
+ python myflow.py run --with batch
203
+ ```
204
+ or
205
+ ```
206
+ python myflow.py run --with kubernetes
207
+ ```
208
+ which executes the flow on the desired system using the
209
+ requirements specified in `@resources`.
210
+
211
+
212
+ Parameters
213
+ ----------
214
+ cpu : int, default 1
215
+ Number of CPUs required for this step.
216
+ gpu : int, optional, default None
217
+ Number of GPUs required for this step.
218
+ disk : int, optional, default None
219
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
220
+ memory : int, default 4096
221
+ Memory size (in MB) required for this step.
222
+ shared_memory : int, optional, default None
223
+ The value for the size (in MiB) of the /dev/shm volume for this step.
224
+ This parameter maps to the `--shm-size` option in Docker.
225
+ """
226
+ ...
227
+
228
+ 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]]]:
229
+ """
230
+ This decorator is used to run NIM containers in Metaflow tasks as sidecars.
231
+
232
+ User code call
233
+ -----------
234
+ @nim(
235
+ models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
236
+ backend='managed'
237
+ )
238
+
239
+ Valid backend options
240
+ ---------------------
241
+ - 'managed': Outerbounds selects a compute provider based on the model.
242
+
243
+ Valid model options
244
+ ----------------
245
+ - 'meta/llama3-8b-instruct': 8B parameter model
246
+ - 'meta/llama3-70b-instruct': 70B parameter model
247
+ - any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
248
+
249
+
250
+ Parameters
251
+ ----------
252
+ models: list[NIM]
253
+ List of NIM containers running models in sidecars.
254
+ backend: str
255
+ Compute provider to run the NIM container.
256
+ queue_timeout : int
257
+ Time to keep the job in NVCF's queue.
258
+ """
259
+ ...
260
+
149
261
  @typing.overload
150
262
  def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
151
263
  """
@@ -167,61 +279,89 @@ def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepF
167
279
  """
168
280
  ...
169
281
 
170
- 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]]]:
282
+ @typing.overload
283
+ def pypi(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
171
284
  """
172
- Decorator that helps cache, version and store models/datasets from huggingface hub.
285
+ Specifies the PyPI packages for the step.
286
+
287
+ Information in this decorator will augment any
288
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
289
+ you can use `@pypi_base` to set packages required by all
290
+ steps and use `@pypi` to specify step-specific overrides.
173
291
 
174
292
 
175
293
  Parameters
176
294
  ----------
177
- temp_dir_root : str, optional
178
- The root directory that will hold the temporary directory where objects will be downloaded.
179
-
180
- load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
181
- The list of repos (models/datasets) to load.
295
+ packages : Dict[str, str], default: {}
296
+ Packages to use for this step. The key is the name of the package
297
+ and the value is the version to use.
298
+ python : str, optional, default: None
299
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
300
+ that the version used will correspond to the version of the Python interpreter used to start the run.
301
+ """
302
+ ...
303
+
304
+ @typing.overload
305
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
306
+ ...
307
+
308
+ @typing.overload
309
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
310
+ ...
311
+
312
+ 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):
313
+ """
314
+ Specifies the PyPI packages for the step.
182
315
 
183
- Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
316
+ Information in this decorator will augment any
317
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
318
+ you can use `@pypi_base` to set packages required by all
319
+ steps and use `@pypi` to specify step-specific overrides.
184
320
 
185
- - If repo (model/dataset) is not found in the datastore:
186
- - Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
187
- - Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
188
- - All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
189
321
 
190
- - If repo is found in the datastore:
191
- - Loads it directly from datastore to local path (can be temporary directory or specified path)
322
+ Parameters
323
+ ----------
324
+ packages : Dict[str, str], default: {}
325
+ Packages to use for this step. The key is the name of the package
326
+ and the value is the version to use.
327
+ python : str, optional, default: None
328
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
329
+ that the version used will correspond to the version of the Python interpreter used to start the run.
192
330
  """
193
331
  ...
194
332
 
195
333
  @typing.overload
196
- 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]]]:
334
+ 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]]]:
197
335
  """
198
- Specifies environment variables to be set prior to the execution of a step.
336
+ Specifies secrets to be retrieved and injected as environment variables prior to
337
+ the execution of a step.
199
338
 
200
339
 
201
340
  Parameters
202
341
  ----------
203
- vars : Dict[str, str], default {}
204
- Dictionary of environment variables to set.
342
+ sources : List[Union[str, Dict[str, Any]]], default: []
343
+ List of secret specs, defining how the secrets are to be retrieved
205
344
  """
206
345
  ...
207
346
 
208
347
  @typing.overload
209
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
348
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
210
349
  ...
211
350
 
212
351
  @typing.overload
213
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
352
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
214
353
  ...
215
354
 
216
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
355
+ 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]]] = []):
217
356
  """
218
- Specifies environment variables to be set prior to the execution of a step.
357
+ Specifies secrets to be retrieved and injected as environment variables prior to
358
+ the execution of a step.
219
359
 
220
360
 
221
361
  Parameters
222
362
  ----------
223
- vars : Dict[str, str], default {}
224
- Dictionary of environment variables to set.
363
+ sources : List[Union[str, Dict[str, Any]]], default: []
364
+ List of secret specs, defining how the secrets are to be retrieved
225
365
  """
226
366
  ...
227
367
 
@@ -283,180 +423,115 @@ def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None
283
423
  ...
284
424
 
285
425
  @typing.overload
286
- 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]]]:
426
+ 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]]]:
287
427
  """
288
- Specifies a timeout for your step.
289
-
290
- This decorator is useful if this step may hang indefinitely.
428
+ Specifies the number of times the task corresponding
429
+ to a step needs to be retried.
291
430
 
292
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
293
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
294
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
431
+ This decorator is useful for handling transient errors, such as networking issues.
432
+ If your task contains operations that can't be retried safely, e.g. database updates,
433
+ it is advisable to annotate it with `@retry(times=0)`.
295
434
 
296
- Note that all the values specified in parameters are added together so if you specify
297
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
435
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
436
+ decorator will execute a no-op task after all retries have been exhausted,
437
+ ensuring that the flow execution can continue.
298
438
 
299
439
 
300
440
  Parameters
301
441
  ----------
302
- seconds : int, default 0
303
- Number of seconds to wait prior to timing out.
304
- minutes : int, default 0
305
- Number of minutes to wait prior to timing out.
306
- hours : int, default 0
307
- Number of hours to wait prior to timing out.
442
+ times : int, default 3
443
+ Number of times to retry this task.
444
+ minutes_between_retries : int, default 2
445
+ Number of minutes between retries.
308
446
  """
309
447
  ...
310
448
 
311
449
  @typing.overload
312
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
450
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
313
451
  ...
314
452
 
315
453
  @typing.overload
316
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
454
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
317
455
  ...
318
456
 
319
- 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):
457
+ 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):
320
458
  """
321
- Specifies a timeout for your step.
322
-
323
- This decorator is useful if this step may hang indefinitely.
459
+ Specifies the number of times the task corresponding
460
+ to a step needs to be retried.
324
461
 
325
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
326
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
327
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
462
+ This decorator is useful for handling transient errors, such as networking issues.
463
+ If your task contains operations that can't be retried safely, e.g. database updates,
464
+ it is advisable to annotate it with `@retry(times=0)`.
328
465
 
329
- Note that all the values specified in parameters are added together so if you specify
330
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
466
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
467
+ decorator will execute a no-op task after all retries have been exhausted,
468
+ ensuring that the flow execution can continue.
331
469
 
332
470
 
333
471
  Parameters
334
472
  ----------
335
- seconds : int, default 0
336
- Number of seconds to wait prior to timing out.
337
- minutes : int, default 0
338
- Number of minutes to wait prior to timing out.
339
- hours : int, default 0
340
- Number of hours to wait prior to timing out.
473
+ times : int, default 3
474
+ Number of times to retry this task.
475
+ minutes_between_retries : int, default 2
476
+ Number of minutes between retries.
341
477
  """
342
478
  ...
343
479
 
344
480
  @typing.overload
345
- 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]]]:
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]]]:
346
482
  """
347
- Creates a human-readable report, a Metaflow Card, after this step completes.
348
-
349
- Note that you may add multiple `@card` decorators in a step with different parameters.
483
+ Specifies environment variables to be set prior to the execution of a step.
350
484
 
351
485
 
352
486
  Parameters
353
487
  ----------
354
- type : str, default 'default'
355
- Card type.
356
- id : str, optional, default None
357
- If multiple cards are present, use this id to identify this card.
358
- options : Dict[str, Any], default {}
359
- Options passed to the card. The contents depend on the card type.
360
- timeout : int, default 45
361
- Interrupt reporting if it takes more than this many seconds.
488
+ vars : Dict[str, str], default {}
489
+ Dictionary of environment variables to set.
362
490
  """
363
491
  ...
364
492
 
365
493
  @typing.overload
366
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
494
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
367
495
  ...
368
496
 
369
497
  @typing.overload
370
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
498
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
371
499
  ...
372
500
 
373
- 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):
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] = {}):
374
502
  """
375
- Creates a human-readable report, a Metaflow Card, after this step completes.
376
-
377
- Note that you may add multiple `@card` decorators in a step with different parameters.
503
+ Specifies environment variables to be set prior to the execution of a step.
378
504
 
379
505
 
380
506
  Parameters
381
507
  ----------
382
- type : str, default 'default'
383
- Card type.
384
- id : str, optional, default None
385
- If multiple cards are present, use this id to identify this card.
386
- options : Dict[str, Any], default {}
387
- Options passed to the card. The contents depend on the card type.
388
- timeout : int, default 45
389
- Interrupt reporting if it takes more than this many seconds.
508
+ vars : Dict[str, str], default {}
509
+ Dictionary of environment variables to set.
390
510
  """
391
511
  ...
392
512
 
393
- @typing.overload
394
- 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]]]:
513
+ 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]]]:
395
514
  """
396
- Specifies the PyPI packages for the step.
397
-
398
- Information in this decorator will augment any
399
- attributes set in the `@pyi_base` flow-level decorator. Hence,
400
- you can use `@pypi_base` to set packages required by all
401
- steps and use `@pypi` to specify step-specific overrides.
515
+ Decorator that helps cache, version and store models/datasets from huggingface hub.
402
516
 
403
517
 
404
518
  Parameters
405
519
  ----------
406
- packages : Dict[str, str], default: {}
407
- Packages to use for this step. The key is the name of the package
408
- and the value is the version to use.
409
- python : str, optional, default: None
410
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
411
- that the version used will correspond to the version of the Python interpreter used to start the run.
412
- """
413
- ...
414
-
415
- @typing.overload
416
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
417
- ...
418
-
419
- @typing.overload
420
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
421
- ...
422
-
423
- 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):
424
- """
425
- Specifies the PyPI packages for the step.
520
+ temp_dir_root : str, optional
521
+ The root directory that will hold the temporary directory where objects will be downloaded.
426
522
 
427
- Information in this decorator will augment any
428
- attributes set in the `@pyi_base` flow-level decorator. Hence,
429
- you can use `@pypi_base` to set packages required by all
430
- steps and use `@pypi` to specify step-specific overrides.
523
+ load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
524
+ The list of repos (models/datasets) to load.
431
525
 
526
+ Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
432
527
 
433
- Parameters
434
- ----------
435
- packages : Dict[str, str], default: {}
436
- Packages to use for this step. The key is the name of the package
437
- and the value is the version to use.
438
- python : str, optional, default: None
439
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
440
- that the version used will correspond to the version of the Python interpreter used to start the run.
441
- """
442
- ...
443
-
444
- @typing.overload
445
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
446
- """
447
- Parameters
448
- ----------
449
- """
450
- ...
451
-
452
- @typing.overload
453
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
454
- ...
455
-
456
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
457
- """
458
- Parameters
459
- ----------
528
+ - If repo (model/dataset) is not found in the datastore:
529
+ - Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
530
+ - Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
531
+ - All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
532
+
533
+ - If repo is found in the datastore:
534
+ - Loads it directly from datastore to local path (can be temporary directory or specified path)
460
535
  """
461
536
  ...
462
537
 
@@ -519,6 +594,57 @@ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
519
594
  """
520
595
  ...
521
596
 
597
+ @typing.overload
598
+ 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]]]:
599
+ """
600
+ Specifies that the step will success under all circumstances.
601
+
602
+ The decorator will create an optional artifact, specified by `var`, which
603
+ contains the exception raised. You can use it to detect the presence
604
+ of errors, indicating that all happy-path artifacts produced by the step
605
+ are missing.
606
+
607
+
608
+ Parameters
609
+ ----------
610
+ var : str, optional, default None
611
+ Name of the artifact in which to store the caught exception.
612
+ If not specified, the exception is not stored.
613
+ print_exception : bool, default True
614
+ Determines whether or not the exception is printed to
615
+ stdout when caught.
616
+ """
617
+ ...
618
+
619
+ @typing.overload
620
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
621
+ ...
622
+
623
+ @typing.overload
624
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
625
+ ...
626
+
627
+ 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):
628
+ """
629
+ Specifies that the step will success under all circumstances.
630
+
631
+ The decorator will create an optional artifact, specified by `var`, which
632
+ contains the exception raised. You can use it to detect the presence
633
+ of errors, indicating that all happy-path artifacts produced by the step
634
+ are missing.
635
+
636
+
637
+ Parameters
638
+ ----------
639
+ var : str, optional, default None
640
+ Name of the artifact in which to store the caught exception.
641
+ If not specified, the exception is not stored.
642
+ print_exception : bool, default True
643
+ Determines whether or not the exception is printed to
644
+ stdout when caught.
645
+ """
646
+ ...
647
+
522
648
  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]]]:
523
649
  """
524
650
  Specifies that this step should execute on DGX cloud.
@@ -535,6 +661,25 @@ def nvidia(*, gpu: int, gpu_type: str, queue_timeout: int) -> typing.Callable[[t
535
661
  """
536
662
  ...
537
663
 
664
+ @typing.overload
665
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
666
+ """
667
+ Parameters
668
+ ----------
669
+ """
670
+ ...
671
+
672
+ @typing.overload
673
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
674
+ ...
675
+
676
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
677
+ """
678
+ Parameters
679
+ ----------
680
+ """
681
+ ...
682
+
538
683
  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]]]:
539
684
  """
540
685
  Specifies that this step should execute on Kubernetes.
@@ -613,222 +758,61 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
613
758
  ...
614
759
 
615
760
  @typing.overload
616
- 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]]]:
761
+ 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]]]:
617
762
  """
618
- Specifies the resources needed when executing this step.
763
+ Specifies a timeout for your step.
619
764
 
620
- Use `@resources` to specify the resource requirements
621
- independently of the specific compute layer (`@batch`, `@kubernetes`).
765
+ This decorator is useful if this step may hang indefinitely.
622
766
 
623
- You can choose the compute layer on the command line by executing e.g.
624
- ```
625
- python myflow.py run --with batch
626
- ```
627
- or
628
- ```
629
- python myflow.py run --with kubernetes
630
- ```
631
- which executes the flow on the desired system using the
632
- requirements specified in `@resources`.
767
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
768
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
769
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
770
+
771
+ Note that all the values specified in parameters are added together so if you specify
772
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
633
773
 
634
774
 
635
775
  Parameters
636
776
  ----------
637
- cpu : int, default 1
638
- Number of CPUs required for this step.
639
- gpu : int, optional, default None
640
- Number of GPUs required for this step.
641
- disk : int, optional, default None
642
- Disk size (in MB) required for this step. Only applies on Kubernetes.
643
- memory : int, default 4096
644
- Memory size (in MB) required for this step.
645
- shared_memory : int, optional, default None
646
- The value for the size (in MiB) of the /dev/shm volume for this step.
647
- This parameter maps to the `--shm-size` option in Docker.
777
+ seconds : int, default 0
778
+ Number of seconds to wait prior to timing out.
779
+ minutes : int, default 0
780
+ Number of minutes to wait prior to timing out.
781
+ hours : int, default 0
782
+ Number of hours to wait prior to timing out.
648
783
  """
649
784
  ...
650
785
 
651
786
  @typing.overload
652
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
787
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
653
788
  ...
654
789
 
655
790
  @typing.overload
656
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
791
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
657
792
  ...
658
793
 
659
- def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
794
+ 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):
660
795
  """
661
- Specifies the resources needed when executing this step.
796
+ Specifies a timeout for your step.
662
797
 
663
- Use `@resources` to specify the resource requirements
664
- independently of the specific compute layer (`@batch`, `@kubernetes`).
798
+ This decorator is useful if this step may hang indefinitely.
665
799
 
666
- You can choose the compute layer on the command line by executing e.g.
667
- ```
668
- python myflow.py run --with batch
669
- ```
670
- or
671
- ```
672
- python myflow.py run --with kubernetes
673
- ```
674
- which executes the flow on the desired system using the
675
- requirements specified in `@resources`.
800
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
801
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
802
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
803
+
804
+ Note that all the values specified in parameters are added together so if you specify
805
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
676
806
 
677
807
 
678
808
  Parameters
679
809
  ----------
680
- cpu : int, default 1
681
- Number of CPUs required for this step.
682
- gpu : int, optional, default None
683
- Number of GPUs required for this step.
684
- disk : int, optional, default None
685
- Disk size (in MB) required for this step. Only applies on Kubernetes.
686
- memory : int, default 4096
687
- Memory size (in MB) required for this step.
688
- shared_memory : int, optional, default None
689
- The value for the size (in MiB) of the /dev/shm volume for this step.
690
- This parameter maps to the `--shm-size` option in Docker.
691
- """
692
- ...
693
-
694
- @typing.overload
695
- 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]]]:
696
- """
697
- Specifies that the step will success under all circumstances.
698
-
699
- The decorator will create an optional artifact, specified by `var`, which
700
- contains the exception raised. You can use it to detect the presence
701
- of errors, indicating that all happy-path artifacts produced by the step
702
- are missing.
703
-
704
-
705
- Parameters
706
- ----------
707
- var : str, optional, default None
708
- Name of the artifact in which to store the caught exception.
709
- If not specified, the exception is not stored.
710
- print_exception : bool, default True
711
- Determines whether or not the exception is printed to
712
- stdout when caught.
713
- """
714
- ...
715
-
716
- @typing.overload
717
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
718
- ...
719
-
720
- @typing.overload
721
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
722
- ...
723
-
724
- 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):
725
- """
726
- Specifies that the step will success under all circumstances.
727
-
728
- The decorator will create an optional artifact, specified by `var`, which
729
- contains the exception raised. You can use it to detect the presence
730
- of errors, indicating that all happy-path artifacts produced by the step
731
- are missing.
732
-
733
-
734
- Parameters
735
- ----------
736
- var : str, optional, default None
737
- Name of the artifact in which to store the caught exception.
738
- If not specified, the exception is not stored.
739
- print_exception : bool, default True
740
- Determines whether or not the exception is printed to
741
- stdout when caught.
742
- """
743
- ...
744
-
745
- @typing.overload
746
- 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]]]:
747
- """
748
- Specifies secrets to be retrieved and injected as environment variables prior to
749
- the execution of a step.
750
-
751
-
752
- Parameters
753
- ----------
754
- sources : List[Union[str, Dict[str, Any]]], default: []
755
- List of secret specs, defining how the secrets are to be retrieved
756
- """
757
- ...
758
-
759
- @typing.overload
760
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
761
- ...
762
-
763
- @typing.overload
764
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
765
- ...
766
-
767
- 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]]] = []):
768
- """
769
- Specifies secrets to be retrieved and injected as environment variables prior to
770
- the execution of a step.
771
-
772
-
773
- Parameters
774
- ----------
775
- sources : List[Union[str, Dict[str, Any]]], default: []
776
- List of secret specs, defining how the secrets are to be retrieved
777
- """
778
- ...
779
-
780
- @typing.overload
781
- 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]]]:
782
- """
783
- Specifies the number of times the task corresponding
784
- to a step needs to be retried.
785
-
786
- This decorator is useful for handling transient errors, such as networking issues.
787
- If your task contains operations that can't be retried safely, e.g. database updates,
788
- it is advisable to annotate it with `@retry(times=0)`.
789
-
790
- This can be used in conjunction with the `@catch` decorator. The `@catch`
791
- decorator will execute a no-op task after all retries have been exhausted,
792
- ensuring that the flow execution can continue.
793
-
794
-
795
- Parameters
796
- ----------
797
- times : int, default 3
798
- Number of times to retry this task.
799
- minutes_between_retries : int, default 2
800
- Number of minutes between retries.
801
- """
802
- ...
803
-
804
- @typing.overload
805
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
806
- ...
807
-
808
- @typing.overload
809
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
810
- ...
811
-
812
- 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):
813
- """
814
- Specifies the number of times the task corresponding
815
- to a step needs to be retried.
816
-
817
- This decorator is useful for handling transient errors, such as networking issues.
818
- If your task contains operations that can't be retried safely, e.g. database updates,
819
- it is advisable to annotate it with `@retry(times=0)`.
820
-
821
- This can be used in conjunction with the `@catch` decorator. The `@catch`
822
- decorator will execute a no-op task after all retries have been exhausted,
823
- ensuring that the flow execution can continue.
824
-
825
-
826
- Parameters
827
- ----------
828
- times : int, default 3
829
- Number of times to retry this task.
830
- minutes_between_retries : int, default 2
831
- Number of minutes between retries.
810
+ seconds : int, default 0
811
+ Number of seconds to wait prior to timing out.
812
+ minutes : int, default 0
813
+ Number of minutes to wait prior to timing out.
814
+ hours : int, default 0
815
+ Number of hours to wait prior to timing out.
832
816
  """
833
817
  ...
834
818
 
@@ -889,89 +873,52 @@ def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
889
873
  """
890
874
  ...
891
875
 
892
- def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
876
+ @typing.overload
877
+ 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]]]:
893
878
  """
894
- Specifies what flows belong to the same project.
879
+ Creates a human-readable report, a Metaflow Card, after this step completes.
895
880
 
896
- A project-specific namespace is created for all flows that
897
- use the same `@project(name)`.
881
+ Note that you may add multiple `@card` decorators in a step with different parameters.
898
882
 
899
883
 
900
884
  Parameters
901
885
  ----------
902
- name : str
903
- Project name. Make sure that the name is unique amongst all
904
- projects that use the same production scheduler. The name may
905
- contain only lowercase alphanumeric characters and underscores.
906
-
907
- branch : Optional[str], default None
908
- The branch to use. If not specified, the branch is set to
909
- `user.<username>` unless `production` is set to `True`. This can
910
- also be set on the command line using `--branch` as a top-level option.
911
- It is an error to specify `branch` in the decorator and on the command line.
912
-
913
- production : bool, default False
914
- Whether or not the branch is the production branch. This can also be set on the
915
- command line using `--production` as a top-level option. It is an error to specify
916
- `production` in the decorator and on the command line.
917
- The project branch name will be:
918
- - if `branch` is specified:
919
- - if `production` is True: `prod.<branch>`
920
- - if `production` is False: `test.<branch>`
921
- - if `branch` is not specified:
922
- - if `production` is True: `prod`
923
- - if `production` is False: `user.<username>`
886
+ type : str, default 'default'
887
+ Card type.
888
+ id : str, optional, default None
889
+ If multiple cards are present, use this id to identify this card.
890
+ options : Dict[str, Any], default {}
891
+ Options passed to the card. The contents depend on the card type.
892
+ timeout : int, default 45
893
+ Interrupt reporting if it takes more than this many seconds.
924
894
  """
925
895
  ...
926
896
 
927
897
  @typing.overload
928
- 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]]:
929
- """
930
- Specifies the Conda environment for all steps of the flow.
931
-
932
- Use `@conda_base` to set common libraries required by all
933
- steps and use `@conda` to specify step-specific additions.
934
-
935
-
936
- Parameters
937
- ----------
938
- packages : Dict[str, str], default {}
939
- Packages to use for this flow. The key is the name of the package
940
- and the value is the version to use.
941
- libraries : Dict[str, str], default {}
942
- Supported for backward compatibility. When used with packages, packages will take precedence.
943
- python : str, optional, default None
944
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
945
- that the version used will correspond to the version of the Python interpreter used to start the run.
946
- disabled : bool, default False
947
- If set to True, disables Conda.
948
- """
898
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
949
899
  ...
950
900
 
951
901
  @typing.overload
952
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
902
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
953
903
  ...
954
904
 
955
- 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):
905
+ 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):
956
906
  """
957
- Specifies the Conda environment for all steps of the flow.
907
+ Creates a human-readable report, a Metaflow Card, after this step completes.
958
908
 
959
- Use `@conda_base` to set common libraries required by all
960
- steps and use `@conda` to specify step-specific additions.
909
+ Note that you may add multiple `@card` decorators in a step with different parameters.
961
910
 
962
911
 
963
912
  Parameters
964
913
  ----------
965
- packages : Dict[str, str], default {}
966
- Packages to use for this flow. The key is the name of the package
967
- and the value is the version to use.
968
- libraries : Dict[str, str], default {}
969
- Supported for backward compatibility. When used with packages, packages will take precedence.
970
- python : str, optional, default None
971
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
972
- that the version used will correspond to the version of the Python interpreter used to start the run.
973
- disabled : bool, default False
974
- If set to True, disables Conda.
914
+ type : str, default 'default'
915
+ Card type.
916
+ id : str, optional, default None
917
+ If multiple cards are present, use this id to identify this card.
918
+ options : Dict[str, Any], default {}
919
+ Options passed to the card. The contents depend on the card type.
920
+ timeout : int, default 45
921
+ Interrupt reporting if it takes more than this many seconds.
975
922
  """
976
923
  ...
977
924
 
@@ -1019,126 +966,88 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
1019
966
  ...
1020
967
 
1021
968
  @typing.overload
1022
- 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]]:
969
+ 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]]:
1023
970
  """
1024
- Specifies the times when the flow should be run when running on a
1025
- production scheduler.
971
+ Specifies the Conda environment for all steps of the flow.
972
+
973
+ Use `@conda_base` to set common libraries required by all
974
+ steps and use `@conda` to specify step-specific additions.
1026
975
 
1027
976
 
1028
977
  Parameters
1029
978
  ----------
1030
- hourly : bool, default False
1031
- Run the workflow hourly.
1032
- daily : bool, default True
1033
- Run the workflow daily.
1034
- weekly : bool, default False
1035
- Run the workflow weekly.
1036
- cron : str, optional, default None
1037
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1038
- specified by this expression.
1039
- timezone : str, optional, default None
1040
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1041
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
979
+ packages : Dict[str, str], default {}
980
+ Packages to use for this flow. The key is the name of the package
981
+ and the value is the version to use.
982
+ libraries : Dict[str, str], default {}
983
+ Supported for backward compatibility. When used with packages, packages will take precedence.
984
+ python : str, optional, default None
985
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
986
+ that the version used will correspond to the version of the Python interpreter used to start the run.
987
+ disabled : bool, default False
988
+ If set to True, disables Conda.
1042
989
  """
1043
990
  ...
1044
991
 
1045
992
  @typing.overload
1046
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1047
- ...
1048
-
1049
- 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):
1050
- """
1051
- Specifies the times when the flow should be run when running on a
1052
- production scheduler.
1053
-
1054
-
1055
- Parameters
1056
- ----------
1057
- hourly : bool, default False
1058
- Run the workflow hourly.
1059
- daily : bool, default True
1060
- Run the workflow daily.
1061
- weekly : bool, default False
1062
- Run the workflow weekly.
1063
- cron : str, optional, default None
1064
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1065
- specified by this expression.
1066
- timezone : str, optional, default None
1067
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1068
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1069
- """
993
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1070
994
  ...
1071
995
 
1072
- def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
996
+ 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):
1073
997
  """
1074
- This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1075
-
1076
- User code call
1077
- -----------
1078
- @nim(
1079
- models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1080
- backend='managed'
1081
- )
1082
-
1083
- Valid backend options
1084
- ---------------------
1085
- - 'managed': Outerbounds selects a compute provider based on the model.
1086
- - 🚧 'dataplane': Run in your account.
998
+ Specifies the Conda environment for all steps of the flow.
1087
999
 
1088
- Valid model options
1089
- ----------------
1090
- - 'meta/llama3-8b-instruct': 8B parameter model
1091
- - 'meta/llama3-70b-instruct': 70B parameter model
1092
- - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1000
+ Use `@conda_base` to set common libraries required by all
1001
+ steps and use `@conda` to specify step-specific additions.
1093
1002
 
1094
1003
 
1095
1004
  Parameters
1096
1005
  ----------
1097
- models: list[NIM]
1098
- List of NIM containers running models in sidecars.
1099
- backend: str
1100
- Compute provider to run the NIM container.
1101
- """
1102
- ...
1103
-
1104
- @typing.overload
1105
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1106
- """
1107
- Specifies the PyPI packages for all steps of the flow.
1108
-
1109
- Use `@pypi_base` to set common packages required by all
1110
- steps and use `@pypi` to specify step-specific overrides.
1111
-
1112
- Parameters
1113
- ----------
1114
- packages : Dict[str, str], default: {}
1006
+ packages : Dict[str, str], default {}
1115
1007
  Packages to use for this flow. The key is the name of the package
1116
1008
  and the value is the version to use.
1117
- python : str, optional, default: None
1009
+ libraries : Dict[str, str], default {}
1010
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1011
+ python : str, optional, default None
1118
1012
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1119
1013
  that the version used will correspond to the version of the Python interpreter used to start the run.
1014
+ disabled : bool, default False
1015
+ If set to True, disables Conda.
1120
1016
  """
1121
1017
  ...
1122
1018
 
1123
- @typing.overload
1124
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1125
- ...
1126
-
1127
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1019
+ def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1128
1020
  """
1129
- Specifies the PyPI packages for all steps of the flow.
1021
+ Specifies what flows belong to the same project.
1022
+
1023
+ A project-specific namespace is created for all flows that
1024
+ use the same `@project(name)`.
1130
1025
 
1131
- Use `@pypi_base` to set common packages required by all
1132
- steps and use `@pypi` to specify step-specific overrides.
1133
1026
 
1134
1027
  Parameters
1135
1028
  ----------
1136
- packages : Dict[str, str], default: {}
1137
- Packages to use for this flow. The key is the name of the package
1138
- and the value is the version to use.
1139
- python : str, optional, default: None
1140
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1141
- that the version used will correspond to the version of the Python interpreter used to start the run.
1029
+ name : str
1030
+ Project name. Make sure that the name is unique amongst all
1031
+ projects that use the same production scheduler. The name may
1032
+ contain only lowercase alphanumeric characters and underscores.
1033
+
1034
+ branch : Optional[str], default None
1035
+ The branch to use. If not specified, the branch is set to
1036
+ `user.<username>` unless `production` is set to `True`. This can
1037
+ also be set on the command line using `--branch` as a top-level option.
1038
+ It is an error to specify `branch` in the decorator and on the command line.
1039
+
1040
+ production : bool, default False
1041
+ Whether or not the branch is the production branch. This can also be set on the
1042
+ command line using `--production` as a top-level option. It is an error to specify
1043
+ `production` in the decorator and on the command line.
1044
+ The project branch name will be:
1045
+ - if `branch` is specified:
1046
+ - if `production` is True: `prod.<branch>`
1047
+ - if `production` is False: `test.<branch>`
1048
+ - if `branch` is not specified:
1049
+ - if `production` is True: `prod`
1050
+ - if `production` is False: `user.<username>`
1142
1051
  """
1143
1052
  ...
1144
1053
 
@@ -1235,6 +1144,98 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1235
1144
  """
1236
1145
  ...
1237
1146
 
1147
+ @typing.overload
1148
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1149
+ """
1150
+ Specifies the PyPI packages for all steps of the flow.
1151
+
1152
+ Use `@pypi_base` to set common packages required by all
1153
+ steps and use `@pypi` to specify step-specific overrides.
1154
+
1155
+ Parameters
1156
+ ----------
1157
+ packages : Dict[str, str], default: {}
1158
+ Packages to use for this flow. The key is the name of the package
1159
+ and the value is the version to use.
1160
+ python : str, optional, default: None
1161
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1162
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1163
+ """
1164
+ ...
1165
+
1166
+ @typing.overload
1167
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1168
+ ...
1169
+
1170
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1171
+ """
1172
+ Specifies the PyPI packages for all steps of the flow.
1173
+
1174
+ Use `@pypi_base` to set common packages required by all
1175
+ steps and use `@pypi` to specify step-specific overrides.
1176
+
1177
+ Parameters
1178
+ ----------
1179
+ packages : Dict[str, str], default: {}
1180
+ Packages to use for this flow. The key is the name of the package
1181
+ and the value is the version to use.
1182
+ python : str, optional, default: None
1183
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1184
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1185
+ """
1186
+ ...
1187
+
1188
+ @typing.overload
1189
+ 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]]:
1190
+ """
1191
+ Specifies the times when the flow should be run when running on a
1192
+ production scheduler.
1193
+
1194
+
1195
+ Parameters
1196
+ ----------
1197
+ hourly : bool, default False
1198
+ Run the workflow hourly.
1199
+ daily : bool, default True
1200
+ Run the workflow daily.
1201
+ weekly : bool, default False
1202
+ Run the workflow weekly.
1203
+ cron : str, optional, default None
1204
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1205
+ specified by this expression.
1206
+ timezone : str, optional, default None
1207
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1208
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1209
+ """
1210
+ ...
1211
+
1212
+ @typing.overload
1213
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1214
+ ...
1215
+
1216
+ 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):
1217
+ """
1218
+ Specifies the times when the flow should be run when running on a
1219
+ production scheduler.
1220
+
1221
+
1222
+ Parameters
1223
+ ----------
1224
+ hourly : bool, default False
1225
+ Run the workflow hourly.
1226
+ daily : bool, default True
1227
+ Run the workflow daily.
1228
+ weekly : bool, default False
1229
+ Run the workflow weekly.
1230
+ cron : str, optional, default None
1231
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1232
+ specified by this expression.
1233
+ timezone : str, optional, default None
1234
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1235
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1236
+ """
1237
+ ...
1238
+
1238
1239
  @typing.overload
1239
1240
  def trigger_on_finish(*, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1240
1241
  """