ob-metaflow-stubs 6.0.3.138__py2.py3-none-any.whl → 6.0.3.140__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 +853 -274
  2. metaflow-stubs/cards.pyi +2 -2
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/cli_components/__init__.pyi +2 -2
  5. metaflow-stubs/cli_components/utils.pyi +2 -2
  6. metaflow-stubs/client/__init__.pyi +2 -2
  7. metaflow-stubs/client/core.pyi +5 -5
  8. metaflow-stubs/client/filecache.pyi +3 -3
  9. metaflow-stubs/events.pyi +3 -3
  10. metaflow-stubs/exception.pyi +2 -2
  11. metaflow-stubs/flowspec.pyi +5 -5
  12. metaflow-stubs/generated_for.txt +1 -1
  13. metaflow-stubs/includefile.pyi +4 -4
  14. metaflow-stubs/info_file.pyi +2 -2
  15. metaflow-stubs/metadata_provider/__init__.pyi +2 -2
  16. metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
  17. metaflow-stubs/metadata_provider/metadata.pyi +2 -2
  18. metaflow-stubs/metadata_provider/util.pyi +2 -2
  19. metaflow-stubs/metaflow_config.pyi +2 -2
  20. metaflow-stubs/metaflow_current.pyi +118 -118
  21. metaflow-stubs/mf_extensions/__init__.pyi +2 -2
  22. metaflow-stubs/mf_extensions/obcheckpoint/__init__.pyi +2 -2
  23. metaflow-stubs/mf_extensions/obcheckpoint/plugins/__init__.pyi +2 -2
  24. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/__init__.pyi +2 -2
  25. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/__init__.pyi +2 -2
  26. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/async_cards.pyi +3 -3
  27. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/deco_injection_mixin.pyi +2 -2
  28. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/extra_components.pyi +4 -4
  29. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/__init__.pyi +2 -2
  30. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/__init__.pyi +2 -2
  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 +2 -2
  33. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/checkpoint_storage.pyi +5 -5
  34. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/constructors.pyi +2 -2
  35. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/core.pyi +6 -3
  36. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/decorator.pyi +55 -5
  37. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/exceptions.pyi +2 -2
  38. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/final_api.pyi +38 -13
  39. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/lineage.pyi +2 -2
  40. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/__init__.pyi +2 -2
  41. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/core.pyi +3 -3
  42. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/exceptions.pyi +2 -2
  43. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/task_utils.pyi +4 -4
  44. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi +2 -2
  45. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi +3 -3
  46. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/exceptions.pyi +2 -2
  47. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/__init__.pyi +2 -2
  48. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/decorator.pyi +2 -2
  49. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/__init__.pyi +2 -2
  50. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/core.pyi +3 -3
  51. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/exceptions.pyi +2 -2
  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 +2 -2
  54. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/flowspec_utils.pyi +2 -2
  55. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/general.pyi +2 -2
  56. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/identity_utils.pyi +3 -3
  57. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/__init__.pyi +2 -2
  58. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/base.pyi +2 -2
  59. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/tar.pyi +3 -3
  60. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +3 -3
  61. metaflow-stubs/mf_extensions/outerbounds/__init__.pyi +2 -2
  62. metaflow-stubs/mf_extensions/outerbounds/plugins/__init__.pyi +2 -2
  63. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/__init__.pyi +2 -2
  64. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/snowflake.pyi +2 -2
  65. metaflow-stubs/mf_extensions/outerbounds/profilers/__init__.pyi +2 -2
  66. metaflow-stubs/mf_extensions/outerbounds/profilers/gpu.pyi +2 -2
  67. metaflow-stubs/mf_extensions/outerbounds/remote_config.pyi +2 -2
  68. metaflow-stubs/mf_extensions/outerbounds/toplevel/__init__.pyi +2 -2
  69. metaflow-stubs/mf_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.pyi +2 -2
  70. metaflow-stubs/multicore_utils.pyi +2 -2
  71. metaflow-stubs/parameters.pyi +4 -4
  72. metaflow-stubs/plugins/__init__.pyi +12 -12
  73. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  74. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  75. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  76. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  77. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  78. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
  79. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
  80. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  81. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  82. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  83. metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -3
  84. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +2 -2
  85. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +5 -5
  86. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -3
  87. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  88. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  89. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  90. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  91. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  92. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  93. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  94. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  95. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
  96. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  97. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  98. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  99. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  100. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  101. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +4 -4
  102. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +4 -4
  103. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  104. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  105. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  106. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +3 -3
  107. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  108. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  109. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  110. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  111. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  112. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  113. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  114. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  115. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  116. metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
  117. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  118. metaflow-stubs/plugins/cards/card_modules/components.pyi +5 -5
  119. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  120. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  121. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  122. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  123. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  124. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  125. metaflow-stubs/plugins/catch_decorator.pyi +2 -2
  126. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  127. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  128. metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
  129. metaflow-stubs/plugins/datatools/s3/s3.pyi +3 -3
  130. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  131. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  132. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  133. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  134. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  135. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  136. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  137. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  138. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  139. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
  140. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  141. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  142. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  143. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  144. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  145. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +3 -3
  146. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  147. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  148. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
  149. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  150. metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
  151. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  152. metaflow-stubs/plugins/perimeters.pyi +2 -2
  153. metaflow-stubs/plugins/project_decorator.pyi +20 -2
  154. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  155. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  156. metaflow-stubs/plugins/pypi/conda_environment.pyi +5 -5
  157. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  158. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  159. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  160. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  161. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  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 +2 -2
  165. metaflow-stubs/plugins/snowflake/__init__.pyi +2 -2
  166. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  167. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  168. metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
  169. metaflow-stubs/profilers/__init__.pyi +2 -2
  170. metaflow-stubs/pylint_wrapper.pyi +2 -2
  171. metaflow-stubs/runner/__init__.pyi +2 -2
  172. metaflow-stubs/runner/deployer.pyi +30 -30
  173. metaflow-stubs/runner/deployer_impl.pyi +2 -2
  174. metaflow-stubs/runner/metaflow_runner.pyi +4 -4
  175. metaflow-stubs/runner/nbdeploy.pyi +2 -2
  176. metaflow-stubs/runner/nbrun.pyi +2 -2
  177. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  178. metaflow-stubs/runner/utils.pyi +3 -3
  179. metaflow-stubs/system/__init__.pyi +2 -2
  180. metaflow-stubs/system/system_logger.pyi +2 -2
  181. metaflow-stubs/system/system_monitor.pyi +2 -2
  182. metaflow-stubs/tagging_util.pyi +2 -2
  183. metaflow-stubs/tuple_util.pyi +2 -2
  184. metaflow-stubs/user_configs/__init__.pyi +2 -2
  185. metaflow-stubs/user_configs/config_decorators.pyi +5 -7
  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.138.dist-info → ob_metaflow_stubs-6.0.3.140.dist-info}/METADATA +1 -1
  189. ob_metaflow_stubs-6.0.3.140.dist-info/RECORD +192 -0
  190. ob_metaflow_stubs-6.0.3.138.dist-info/RECORD +0 -192
  191. {ob_metaflow_stubs-6.0.3.138.dist-info → ob_metaflow_stubs-6.0.3.140.dist-info}/WHEEL +0 -0
  192. {ob_metaflow_stubs-6.0.3.138.dist-info → ob_metaflow_stubs-6.0.3.140.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.13.9.2+obcheckpoint(0.1.7);ob(v1) #
4
- # Generated on 2025-02-03T21:17:39.682936 #
3
+ # MF version: 2.14.0.1+obcheckpoint(0.1.8);ob(v1) #
4
+ # Generated on 2025-02-11T20:37:27.195718 #
5
5
  ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -147,51 +147,81 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
147
147
  ...
148
148
 
149
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]]]:
150
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
151
151
  """
152
- Specifies the resources needed when executing this step.
152
+ Internal decorator to support Fast bakery
153
+ Parameters
154
+ ----------
155
+ """
156
+ ...
157
+
158
+ @typing.overload
159
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
160
+ ...
161
+
162
+ def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
163
+ """
164
+ Internal decorator to support Fast bakery
165
+ Parameters
166
+ ----------
167
+ """
168
+ ...
169
+
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]]]:
171
+ """
172
+ Decorator that helps cache, version and store models/datasets from huggingface hub.
153
173
 
154
- Use `@resources` to specify the resource requirements
155
- independently of the specific compute layer (`@batch`, `@kubernetes`).
156
174
 
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`.
175
+ Parameters
176
+ ----------
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.
182
+
183
+ Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
184
+
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
+
190
+ - If repo is found in the datastore:
191
+ - Loads it directly from datastore to local path (can be temporary directory or specified path)
167
192
  """
168
193
  ...
169
194
 
170
195
  @typing.overload
171
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
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]]]:
197
+ """
198
+ Specifies environment variables to be set prior to the execution of a step.
199
+
200
+
201
+ Parameters
202
+ ----------
203
+ vars : Dict[str, str], default {}
204
+ Dictionary of environment variables to set.
205
+ """
172
206
  ...
173
207
 
174
208
  @typing.overload
175
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
209
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
176
210
  ...
177
211
 
178
- 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):
212
+ @typing.overload
213
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
214
+ ...
215
+
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] = {}):
179
217
  """
180
- Specifies the resources needed when executing this step.
218
+ Specifies environment variables to be set prior to the execution of a step.
181
219
 
182
- Use `@resources` to specify the resource requirements
183
- independently of the specific compute layer (`@batch`, `@kubernetes`).
184
220
 
185
- You can choose the compute layer on the command line by executing e.g.
186
- ```
187
- python myflow.py run --with batch
188
- ```
189
- or
190
- ```
191
- python myflow.py run --with kubernetes
192
- ```
193
- which executes the flow on the desired system using the
194
- requirements specified in `@resources`.
221
+ Parameters
222
+ ----------
223
+ vars : Dict[str, str], default {}
224
+ Dictionary of environment variables to set.
195
225
  """
196
226
  ...
197
227
 
@@ -199,6 +229,24 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
199
229
  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]]]:
200
230
  """
201
231
  Enables checkpointing for a step.
232
+
233
+
234
+
235
+ Parameters
236
+ ----------
237
+ load_policy : str, default: "fresh"
238
+ The policy for loading the checkpoint. The following policies are supported:
239
+ - "eager": Loads the the latest available checkpoint within the namespace.
240
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
241
+ will be loaded at the start of the task.
242
+ - "none": Do not load any checkpoint
243
+ - "fresh": Loads the lastest checkpoint created within the running Task.
244
+ This mode helps loading checkpoints across various retry attempts of the same task.
245
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
246
+ created within the task will be loaded when the task is retries execution on failure.
247
+
248
+ temp_dir_root : str, default: None
249
+ The root directory under which `current.checkpoint.directory` will be created.
202
250
  """
203
251
  ...
204
252
 
@@ -213,6 +261,83 @@ def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]
213
261
  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):
214
262
  """
215
263
  Enables checkpointing for a step.
264
+
265
+
266
+
267
+ Parameters
268
+ ----------
269
+ load_policy : str, default: "fresh"
270
+ The policy for loading the checkpoint. The following policies are supported:
271
+ - "eager": Loads the the latest available checkpoint within the namespace.
272
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
273
+ will be loaded at the start of the task.
274
+ - "none": Do not load any checkpoint
275
+ - "fresh": Loads the lastest checkpoint created within the running Task.
276
+ This mode helps loading checkpoints across various retry attempts of the same task.
277
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
278
+ created within the task will be loaded when the task is retries execution on failure.
279
+
280
+ temp_dir_root : str, default: None
281
+ The root directory under which `current.checkpoint.directory` will be created.
282
+ """
283
+ ...
284
+
285
+ @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]]]:
287
+ """
288
+ Specifies a timeout for your step.
289
+
290
+ This decorator is useful if this step may hang indefinitely.
291
+
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.
295
+
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.
298
+
299
+
300
+ Parameters
301
+ ----------
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.
308
+ """
309
+ ...
310
+
311
+ @typing.overload
312
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
313
+ ...
314
+
315
+ @typing.overload
316
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
317
+ ...
318
+
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):
320
+ """
321
+ Specifies a timeout for your step.
322
+
323
+ This decorator is useful if this step may hang indefinitely.
324
+
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.
328
+
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.
331
+
332
+
333
+ Parameters
334
+ ----------
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.
216
341
  """
217
342
  ...
218
343
 
@@ -222,6 +347,18 @@ def card(*, type: str = 'default', id: typing.Optional[str] = None, options: typ
222
347
  Creates a human-readable report, a Metaflow Card, after this step completes.
223
348
 
224
349
  Note that you may add multiple `@card` decorators in a step with different parameters.
350
+
351
+
352
+ Parameters
353
+ ----------
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.
225
362
  """
226
363
  ...
227
364
 
@@ -238,313 +375,770 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
238
375
  Creates a human-readable report, a Metaflow Card, after this step completes.
239
376
 
240
377
  Note that you may add multiple `@card` decorators in a step with different parameters.
378
+
379
+
380
+ Parameters
381
+ ----------
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.
241
390
  """
242
391
  ...
243
392
 
244
393
  @typing.overload
245
- 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]]]:
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]]]:
246
395
  """
247
- Specifies the number of times the task corresponding
248
- to a step needs to be retried.
396
+ Specifies the PyPI packages for the step.
249
397
 
250
- This decorator is useful for handling transient errors, such as networking issues.
251
- If your task contains operations that can't be retried safely, e.g. database updates,
252
- it is advisable to annotate it with `@retry(times=0)`.
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.
253
402
 
254
- This can be used in conjunction with the `@catch` decorator. The `@catch`
255
- decorator will execute a no-op task after all retries have been exhausted,
256
- ensuring that the flow execution can continue.
403
+
404
+ Parameters
405
+ ----------
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.
257
412
  """
258
413
  ...
259
414
 
260
415
  @typing.overload
261
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
416
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
262
417
  ...
263
418
 
264
419
  @typing.overload
265
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
420
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
266
421
  ...
267
422
 
268
- 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):
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):
269
424
  """
270
- Specifies the number of times the task corresponding
271
- to a step needs to be retried.
425
+ Specifies the PyPI packages for the step.
272
426
 
273
- This decorator is useful for handling transient errors, such as networking issues.
274
- If your task contains operations that can't be retried safely, e.g. database updates,
275
- it is advisable to annotate it with `@retry(times=0)`.
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.
276
431
 
277
- This can be used in conjunction with the `@catch` decorator. The `@catch`
278
- decorator will execute a no-op task after all retries have been exhausted,
279
- ensuring that the flow execution can continue.
432
+
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.
280
441
  """
281
442
  ...
282
443
 
283
444
  @typing.overload
284
- 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]]]:
445
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
285
446
  """
286
- Specifies that the step will success under all circumstances.
287
-
288
- The decorator will create an optional artifact, specified by `var`, which
289
- contains the exception raised. You can use it to detect the presence
290
- of errors, indicating that all happy-path artifacts produced by the step
291
- are missing.
447
+ Parameters
448
+ ----------
292
449
  """
293
450
  ...
294
451
 
295
452
  @typing.overload
296
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
453
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
297
454
  ...
298
455
 
299
- @typing.overload
300
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
456
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
457
+ """
458
+ Parameters
459
+ ----------
460
+ """
301
461
  ...
302
462
 
303
- 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):
463
+ @typing.overload
464
+ def conda(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
304
465
  """
305
- Specifies that the step will success under all circumstances.
466
+ Specifies the Conda environment for the step.
306
467
 
307
- The decorator will create an optional artifact, specified by `var`, which
308
- contains the exception raised. You can use it to detect the presence
309
- of errors, indicating that all happy-path artifacts produced by the step
310
- are missing.
468
+ Information in this decorator will augment any
469
+ attributes set in the `@conda_base` flow-level decorator. Hence,
470
+ you can use `@conda_base` to set packages required by all
471
+ steps and use `@conda` to specify step-specific overrides.
472
+
473
+
474
+ Parameters
475
+ ----------
476
+ packages : Dict[str, str], default {}
477
+ Packages to use for this step. The key is the name of the package
478
+ and the value is the version to use.
479
+ libraries : Dict[str, str], default {}
480
+ Supported for backward compatibility. When used with packages, packages will take precedence.
481
+ python : str, optional, default None
482
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
483
+ that the version used will correspond to the version of the Python interpreter used to start the run.
484
+ disabled : bool, default False
485
+ If set to True, disables @conda.
311
486
  """
312
487
  ...
313
488
 
314
489
  @typing.overload
315
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
490
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
491
+ ...
492
+
493
+ @typing.overload
494
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
495
+ ...
496
+
497
+ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
316
498
  """
317
- Internal decorator to support Fast bakery
499
+ Specifies the Conda environment for the step.
500
+
501
+ Information in this decorator will augment any
502
+ attributes set in the `@conda_base` flow-level decorator. Hence,
503
+ you can use `@conda_base` to set packages required by all
504
+ steps and use `@conda` to specify step-specific overrides.
505
+
506
+
507
+ Parameters
508
+ ----------
509
+ packages : Dict[str, str], default {}
510
+ Packages to use for this step. The key is the name of the package
511
+ and the value is the version to use.
512
+ libraries : Dict[str, str], default {}
513
+ Supported for backward compatibility. When used with packages, packages will take precedence.
514
+ python : str, optional, default None
515
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
516
+ that the version used will correspond to the version of the Python interpreter used to start the run.
517
+ disabled : bool, default False
518
+ If set to True, disables @conda.
318
519
  """
319
520
  ...
320
521
 
321
- @typing.overload
322
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
522
+ 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
+ """
524
+ Specifies that this step should execute on DGX cloud.
525
+
526
+
527
+ Parameters
528
+ ----------
529
+ gpu : int
530
+ Number of GPUs to use.
531
+ gpu_type : str
532
+ Type of Nvidia GPU to use.
533
+ queue_timeout : int
534
+ Time to keep the job in NVCF's queue.
535
+ """
323
536
  ...
324
537
 
325
- def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
538
+ 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]]]:
326
539
  """
327
- Internal decorator to support Fast bakery
540
+ Specifies that this step should execute on Kubernetes.
541
+
542
+
543
+ Parameters
544
+ ----------
545
+ cpu : int, default 1
546
+ Number of CPUs required for this step. If `@resources` is
547
+ also present, the maximum value from all decorators is used.
548
+ memory : int, default 4096
549
+ Memory size (in MB) required for this step. If
550
+ `@resources` is also present, the maximum value from all decorators is
551
+ used.
552
+ disk : int, default 10240
553
+ Disk size (in MB) required for this step. If
554
+ `@resources` is also present, the maximum value from all decorators is
555
+ used.
556
+ image : str, optional, default None
557
+ Docker image to use when launching on Kubernetes. If not specified, and
558
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
559
+ not, a default Docker image mapping to the current version of Python is used.
560
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
561
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
562
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
563
+ Kubernetes service account to use when launching pod in Kubernetes.
564
+ secrets : List[str], optional, default None
565
+ Kubernetes secrets to use when launching pod in Kubernetes. These
566
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
567
+ in Metaflow configuration.
568
+ node_selector: Union[Dict[str,str], str], optional, default None
569
+ Kubernetes node selector(s) to apply to the pod running the task.
570
+ Can be passed in as a comma separated string of values e.g.
571
+ 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
572
+ {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
573
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
574
+ Kubernetes namespace to use when launching pod in Kubernetes.
575
+ gpu : int, optional, default None
576
+ Number of GPUs required for this step. A value of zero implies that
577
+ the scheduled node should not have GPUs.
578
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
579
+ The vendor of the GPUs to be used for this step.
580
+ tolerations : List[str], default []
581
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
582
+ Kubernetes tolerations to use when launching pod in Kubernetes.
583
+ labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
584
+ Kubernetes labels to use when launching pod in Kubernetes.
585
+ annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
586
+ Kubernetes annotations to use when launching pod in Kubernetes.
587
+ use_tmpfs : bool, default False
588
+ This enables an explicit tmpfs mount for this step.
589
+ tmpfs_tempdir : bool, default True
590
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
591
+ tmpfs_size : int, optional, default: None
592
+ The value for the size (in MiB) of the tmpfs mount for this step.
593
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
594
+ memory allocated for this step.
595
+ tmpfs_path : str, optional, default /metaflow_temp
596
+ Path to tmpfs mount for this step.
597
+ persistent_volume_claims : Dict[str, str], optional, default None
598
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
599
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
600
+ shared_memory: int, optional
601
+ Shared memory size (in MiB) required for this step
602
+ port: int, optional
603
+ Port number to specify in the Kubernetes job object
604
+ compute_pool : str, optional, default None
605
+ Compute pool to be used for for this step.
606
+ If not specified, any accessible compute pool within the perimeter is used.
607
+ hostname_resolution_timeout: int, default 10 * 60
608
+ Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
609
+ Only applicable when @parallel is used.
610
+ qos: str, default: Burstable
611
+ Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
328
612
  """
329
613
  ...
330
614
 
331
615
  @typing.overload
332
- 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]]]:
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]]]:
333
617
  """
334
- Enables loading / saving of models within a step.
618
+ Specifies the resources needed when executing this step.
619
+
620
+ Use `@resources` to specify the resource requirements
621
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
622
+
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`.
633
+
634
+
635
+ Parameters
636
+ ----------
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.
335
648
  """
336
649
  ...
337
650
 
338
651
  @typing.overload
339
- def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
652
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
340
653
  ...
341
654
 
342
655
  @typing.overload
343
- def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
656
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
344
657
  ...
345
658
 
346
- 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):
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):
347
660
  """
348
- Enables loading / saving of models within a step.
661
+ Specifies the resources needed when executing this step.
662
+
663
+ Use `@resources` to specify the resource requirements
664
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
665
+
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`.
676
+
677
+
678
+ Parameters
679
+ ----------
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.
349
691
  """
350
692
  ...
351
693
 
352
694
  @typing.overload
353
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
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]]]:
354
696
  """
355
- Decorator prototype for all step decorators. This function gets specialized
356
- and imported for all decorators types by _import_plugin_decorators().
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.
357
713
  """
358
714
  ...
359
715
 
360
716
  @typing.overload
361
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
717
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
362
718
  ...
363
719
 
364
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
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):
365
725
  """
366
- Decorator prototype for all step decorators. This function gets specialized
367
- and imported for all decorators types by _import_plugin_decorators().
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.
368
742
  """
369
743
  ...
370
744
 
371
- 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]]]:
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]]]:
372
747
  """
373
- Specifies that this step should execute on Kubernetes.
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
374
756
  """
375
757
  ...
376
758
 
377
- 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]]]:
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]]] = []):
378
768
  """
379
- Specifies that this step should execute on DGX cloud.
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
380
777
  """
381
778
  ...
382
779
 
383
780
  @typing.overload
384
- 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]]]:
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]]]:
385
782
  """
386
- Specifies the PyPI packages for the step.
783
+ Specifies the number of times the task corresponding
784
+ to a step needs to be retried.
387
785
 
388
- Information in this decorator will augment any
389
- attributes set in the `@pyi_base` flow-level decorator. Hence,
390
- you can use `@pypi_base` to set packages required by all
391
- steps and use `@pypi` to specify step-specific overrides.
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.
392
801
  """
393
802
  ...
394
803
 
395
804
  @typing.overload
396
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
805
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
397
806
  ...
398
807
 
399
808
  @typing.overload
400
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
809
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
401
810
  ...
402
811
 
403
- 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):
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):
404
813
  """
405
- Specifies the PyPI packages for the step.
814
+ Specifies the number of times the task corresponding
815
+ to a step needs to be retried.
406
816
 
407
- Information in this decorator will augment any
408
- attributes set in the `@pyi_base` flow-level decorator. Hence,
409
- you can use `@pypi_base` to set packages required by all
410
- steps and use `@pypi` to specify step-specific overrides.
411
- """
412
- ...
413
-
414
- 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]]]:
415
- """
416
- Decorator that helps cache, version and store models/datasets from huggingface hub.
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.
417
832
  """
418
833
  ...
419
834
 
420
835
  @typing.overload
421
- 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]]]:
836
+ 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]]]:
422
837
  """
423
- Specifies a timeout for your step.
838
+ Enables loading / saving of models within a step.
424
839
 
425
- This decorator is useful if this step may hang indefinitely.
426
840
 
427
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
428
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
429
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
430
841
 
431
- Note that all the values specified in parameters are added together so if you specify
432
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
842
+ Parameters
843
+ ----------
844
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
845
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
846
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
847
+ - `current.checkpoint`
848
+ - `current.model`
849
+ - `current.huggingface_hub`
850
+
851
+ 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
852
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
853
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
854
+
855
+ temp_dir_root : str, default: None
856
+ The root directory under which `current.model.loaded` will store loaded models
433
857
  """
434
858
  ...
435
859
 
436
860
  @typing.overload
437
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
861
+ def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
438
862
  ...
439
863
 
440
864
  @typing.overload
441
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
865
+ def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
442
866
  ...
443
867
 
444
- 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):
868
+ 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):
445
869
  """
446
- Specifies a timeout for your step.
870
+ Enables loading / saving of models within a step.
447
871
 
448
- This decorator is useful if this step may hang indefinitely.
449
872
 
450
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
451
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
452
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
453
873
 
454
- Note that all the values specified in parameters are added together so if you specify
455
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
874
+ Parameters
875
+ ----------
876
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
877
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
878
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
879
+ - `current.checkpoint`
880
+ - `current.model`
881
+ - `current.huggingface_hub`
882
+
883
+ 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
884
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
885
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
886
+
887
+ temp_dir_root : str, default: None
888
+ The root directory under which `current.model.loaded` will store loaded models
889
+ """
890
+ ...
891
+
892
+ def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
893
+ """
894
+ Specifies what flows belong to the same project.
895
+
896
+ A project-specific namespace is created for all flows that
897
+ use the same `@project(name)`.
898
+
899
+
900
+ Parameters
901
+ ----------
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>`
456
924
  """
457
925
  ...
458
926
 
459
927
  @typing.overload
460
- 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]]]:
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]]:
461
929
  """
462
- Specifies secrets to be retrieved and injected as environment variables prior to
463
- the execution of a step.
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.
464
948
  """
465
949
  ...
466
950
 
467
951
  @typing.overload
468
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
469
- ...
470
-
471
- @typing.overload
472
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
952
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
473
953
  ...
474
954
 
475
- 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]]] = []):
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):
476
956
  """
477
- Specifies secrets to be retrieved and injected as environment variables prior to
478
- the execution of a step.
957
+ Specifies the Conda environment for all steps of the flow.
958
+
959
+ Use `@conda_base` to set common libraries required by all
960
+ steps and use `@conda` to specify step-specific additions.
961
+
962
+
963
+ Parameters
964
+ ----------
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.
479
975
  """
480
976
  ...
481
977
 
482
- @typing.overload
483
- 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]]]:
978
+ 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]]:
484
979
  """
485
- Specifies environment variables to be set prior to the execution of a step.
980
+ 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.
981
+ 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.
982
+
983
+
984
+ Parameters
985
+ ----------
986
+ timeout : int
987
+ Time, in seconds before the task times out and fails. (Default: 3600)
988
+ poke_interval : int
989
+ Time in seconds that the job should wait in between each try. (Default: 60)
990
+ mode : str
991
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
992
+ exponential_backoff : bool
993
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
994
+ pool : str
995
+ the slot pool this task should run in,
996
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
997
+ soft_fail : bool
998
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
999
+ name : str
1000
+ Name of the sensor on Airflow
1001
+ description : str
1002
+ Description of sensor in the Airflow UI
1003
+ external_dag_id : str
1004
+ The dag_id that contains the task you want to wait for.
1005
+ external_task_ids : List[str]
1006
+ The list of task_ids that you want to wait for.
1007
+ If None (default value) the sensor waits for the DAG. (Default: None)
1008
+ allowed_states : List[str]
1009
+ Iterable of allowed states, (Default: ['success'])
1010
+ failed_states : List[str]
1011
+ Iterable of failed or dis-allowed states. (Default: None)
1012
+ execution_delta : datetime.timedelta
1013
+ time difference with the previous execution to look at,
1014
+ the default is the same logical date as the current task or DAG. (Default: None)
1015
+ check_existence: bool
1016
+ Set to True to check if the external task exists or check if
1017
+ the DAG to wait for exists. (Default: True)
486
1018
  """
487
1019
  ...
488
1020
 
489
1021
  @typing.overload
490
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
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]]:
1023
+ """
1024
+ Specifies the times when the flow should be run when running on a
1025
+ production scheduler.
1026
+
1027
+
1028
+ Parameters
1029
+ ----------
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).
1042
+ """
491
1043
  ...
492
1044
 
493
1045
  @typing.overload
494
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1046
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
495
1047
  ...
496
1048
 
497
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
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):
498
1050
  """
499
- Specifies environment variables to be set prior to the execution of a step.
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).
500
1069
  """
501
1070
  ...
502
1071
 
503
- @typing.overload
504
- def conda(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1072
+ def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
505
1073
  """
506
- Specifies the Conda environment for the step.
1074
+ This decorator is used to run NIM containers in Metaflow tasks as sidecars.
507
1075
 
508
- Information in this decorator will augment any
509
- attributes set in the `@conda_base` flow-level decorator. Hence,
510
- you can use `@conda_base` to set packages required by all
511
- steps and use `@conda` to specify step-specific overrides.
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.
1087
+
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
1093
+
1094
+
1095
+ Parameters
1096
+ ----------
1097
+ models: list[NIM]
1098
+ List of NIM containers running models in sidecars.
1099
+ backend: str
1100
+ Compute provider to run the NIM container.
512
1101
  """
513
1102
  ...
514
1103
 
515
1104
  @typing.overload
516
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
517
- ...
518
-
519
- @typing.overload
520
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
521
- ...
522
-
523
- def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
1105
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
524
1106
  """
525
- Specifies the Conda environment for the step.
1107
+ Specifies the PyPI packages for all steps of the flow.
526
1108
 
527
- Information in this decorator will augment any
528
- attributes set in the `@conda_base` flow-level decorator. Hence,
529
- you can use `@conda_base` to set packages required by all
530
- steps and use `@conda` to specify step-specific overrides.
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: {}
1115
+ Packages to use for this flow. The key is the name of the package
1116
+ and the value is the version to use.
1117
+ python : str, optional, default: None
1118
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1119
+ that the version used will correspond to the version of the Python interpreter used to start the run.
531
1120
  """
532
1121
  ...
533
1122
 
534
- 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]]:
535
- """
536
- 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)
537
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
538
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
539
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
540
- starts only after all sensors finish.
541
- """
1123
+ @typing.overload
1124
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
542
1125
  ...
543
1126
 
544
- 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]]:
1127
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
545
1128
  """
546
- 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.
547
- 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.
1129
+ Specifies the PyPI packages for all steps of the flow.
1130
+
1131
+ Use `@pypi_base` to set common packages required by all
1132
+ steps and use `@pypi` to specify step-specific overrides.
1133
+
1134
+ Parameters
1135
+ ----------
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.
548
1142
  """
549
1143
  ...
550
1144
 
@@ -580,6 +1174,16 @@ def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = No
580
1174
  ```
581
1175
  @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
582
1176
  ```
1177
+
1178
+
1179
+ Parameters
1180
+ ----------
1181
+ event : Union[str, Dict[str, Any]], optional, default None
1182
+ Event dependency for this flow.
1183
+ events : List[Union[str, Dict[str, Any]]], default []
1184
+ Events dependency for this flow.
1185
+ options : Dict[str, Any], default {}
1186
+ Backend-specific configuration for tuning eventing behavior.
583
1187
  """
584
1188
  ...
585
1189
 
@@ -618,104 +1222,16 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
618
1222
  ```
619
1223
  @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
620
1224
  ```
621
- """
622
- ...
623
-
624
- @typing.overload
625
- 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]]:
626
- """
627
- Specifies the times when the flow should be run when running on a
628
- production scheduler.
629
- """
630
- ...
631
-
632
- @typing.overload
633
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
634
- ...
635
-
636
- 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):
637
- """
638
- Specifies the times when the flow should be run when running on a
639
- production scheduler.
640
- """
641
- ...
642
-
643
- def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
644
- """
645
- This decorator is used to run NIM containers in Metaflow tasks as sidecars.
646
-
647
- User code call
648
- -----------
649
- @nim(
650
- models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
651
- backend='managed'
652
- )
653
-
654
- Valid backend options
655
- ---------------------
656
- - 'managed': Outerbounds selects a compute provider based on the model.
657
- - 🚧 'dataplane': Run in your account.
658
-
659
- Valid model options
660
- ----------------
661
- - 'meta/llama3-8b-instruct': 8B parameter model
662
- - 'meta/llama3-70b-instruct': 70B parameter model
663
- - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
664
- """
665
- ...
666
-
667
- def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
668
- """
669
- Specifies what flows belong to the same project.
670
-
671
- A project-specific namespace is created for all flows that
672
- use the same `@project(name)`.
673
- """
674
- ...
675
-
676
- @typing.overload
677
- 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]]:
678
- """
679
- Specifies the Conda environment for all steps of the flow.
680
-
681
- Use `@conda_base` to set common libraries required by all
682
- steps and use `@conda` to specify step-specific additions.
683
- """
684
- ...
685
-
686
- @typing.overload
687
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
688
- ...
689
-
690
- 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):
691
- """
692
- Specifies the Conda environment for all steps of the flow.
693
1225
 
694
- Use `@conda_base` to set common libraries required by all
695
- steps and use `@conda` to specify step-specific additions.
696
- """
697
- ...
698
-
699
- @typing.overload
700
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
701
- """
702
- Specifies the PyPI packages for all steps of the flow.
703
-
704
- Use `@pypi_base` to set common packages required by all
705
- steps and use `@pypi` to specify step-specific overrides.
706
- """
707
- ...
708
-
709
- @typing.overload
710
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
711
- ...
712
-
713
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
714
- """
715
- Specifies the PyPI packages for all steps of the flow.
716
1226
 
717
- Use `@pypi_base` to set common packages required by all
718
- steps and use `@pypi` to specify step-specific overrides.
1227
+ Parameters
1228
+ ----------
1229
+ event : Union[str, Dict[str, Any]], optional, default None
1230
+ Event dependency for this flow.
1231
+ events : List[Union[str, Dict[str, Any]]], default []
1232
+ Events dependency for this flow.
1233
+ options : Dict[str, Any], default {}
1234
+ Backend-specific configuration for tuning eventing behavior.
719
1235
  """
720
1236
  ...
721
1237
 
@@ -755,6 +1271,16 @@ def trigger_on_finish(*, flow: typing.Union[typing.Dict[str, str], str, None] =
755
1271
  - `user.bob`
756
1272
  - `test.my_experiment`
757
1273
  - `prod.staging`
1274
+
1275
+
1276
+ Parameters
1277
+ ----------
1278
+ flow : Union[str, Dict[str, str]], optional, default None
1279
+ Upstream flow dependency for this flow.
1280
+ flows : List[Union[str, Dict[str, str]]], default []
1281
+ Upstream flow dependencies for this flow.
1282
+ options : Dict[str, Any], default {}
1283
+ Backend-specific configuration for tuning eventing behavior.
758
1284
  """
759
1285
  ...
760
1286
 
@@ -797,6 +1323,59 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
797
1323
  - `user.bob`
798
1324
  - `test.my_experiment`
799
1325
  - `prod.staging`
1326
+
1327
+
1328
+ Parameters
1329
+ ----------
1330
+ flow : Union[str, Dict[str, str]], optional, default None
1331
+ Upstream flow dependency for this flow.
1332
+ flows : List[Union[str, Dict[str, str]]], default []
1333
+ Upstream flow dependencies for this flow.
1334
+ options : Dict[str, Any], default {}
1335
+ Backend-specific configuration for tuning eventing behavior.
1336
+ """
1337
+ ...
1338
+
1339
+ 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]]:
1340
+ """
1341
+ 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)
1342
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1343
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1344
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1345
+ starts only after all sensors finish.
1346
+
1347
+
1348
+ Parameters
1349
+ ----------
1350
+ timeout : int
1351
+ Time, in seconds before the task times out and fails. (Default: 3600)
1352
+ poke_interval : int
1353
+ Time in seconds that the job should wait in between each try. (Default: 60)
1354
+ mode : str
1355
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1356
+ exponential_backoff : bool
1357
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1358
+ pool : str
1359
+ the slot pool this task should run in,
1360
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1361
+ soft_fail : bool
1362
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1363
+ name : str
1364
+ Name of the sensor on Airflow
1365
+ description : str
1366
+ Description of sensor in the Airflow UI
1367
+ bucket_key : Union[str, List[str]]
1368
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1369
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1370
+ bucket_name : str
1371
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1372
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1373
+ wildcard_match : bool
1374
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1375
+ aws_conn_id : str
1376
+ a reference to the s3 connection on Airflow. (Default: None)
1377
+ verify : bool
1378
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
800
1379
  """
801
1380
  ...
802
1381