ob-metaflow-stubs 6.0.3.154__py2.py3-none-any.whl → 6.0.3.155rc0__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. metaflow-stubs/__init__.pyi +800 -685
  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 +6 -6
  8. metaflow-stubs/client/filecache.pyi +3 -3
  9. metaflow-stubs/events.pyi +2 -2
  10. metaflow-stubs/exception.pyi +2 -2
  11. metaflow-stubs/flowspec.pyi +4 -4
  12. metaflow-stubs/generated_for.txt +1 -1
  13. metaflow-stubs/includefile.pyi +5 -5
  14. metaflow-stubs/info_file.pyi +2 -2
  15. metaflow-stubs/metadata_provider/__init__.pyi +2 -2
  16. metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
  17. metaflow-stubs/metadata_provider/metadata.pyi +3 -3
  18. metaflow-stubs/metadata_provider/util.pyi +2 -2
  19. metaflow-stubs/metaflow_config.pyi +2 -2
  20. metaflow-stubs/metaflow_current.pyi +96 -96
  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 +2 -2
  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 +5 -5
  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 +7 -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 +11 -5
  36. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/decorator.pyi +7 -6
  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 +5 -3
  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/context.pyi +95 -0
  42. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/core.pyi +4 -8
  43. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/decorator.pyi +135 -0
  44. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/exceptions.pyi +2 -2
  45. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/task_utils.pyi +32 -4
  46. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi +2 -2
  47. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi +3 -3
  48. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/exceptions.pyi +2 -2
  49. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/__init__.pyi +2 -2
  50. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/decorator.pyi +3 -3
  51. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/__init__.pyi +2 -2
  52. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/core.pyi +3 -3
  53. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/exceptions.pyi +2 -2
  54. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/model_storage.pyi +4 -4
  55. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/__init__.pyi +2 -2
  56. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/flowspec_utils.pyi +2 -2
  57. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/general.pyi +2 -2
  58. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/identity_utils.pyi +2 -2
  59. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/__init__.pyi +2 -2
  60. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/base.pyi +2 -2
  61. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/tar.pyi +3 -3
  62. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +3 -3
  63. metaflow-stubs/mf_extensions/outerbounds/__init__.pyi +2 -2
  64. metaflow-stubs/mf_extensions/outerbounds/plugins/__init__.pyi +2 -2
  65. metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/__init__.pyi +2 -2
  66. metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/injector.pyi +2 -2
  67. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/__init__.pyi +2 -2
  68. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/ollama.pyi +2 -2
  69. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/__init__.pyi +2 -2
  70. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/snowflake.pyi +2 -2
  71. metaflow-stubs/mf_extensions/outerbounds/profilers/__init__.pyi +2 -2
  72. metaflow-stubs/mf_extensions/outerbounds/profilers/gpu.pyi +2 -2
  73. metaflow-stubs/mf_extensions/outerbounds/remote_config.pyi +2 -2
  74. metaflow-stubs/mf_extensions/outerbounds/toplevel/__init__.pyi +2 -2
  75. metaflow-stubs/mf_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.pyi +2 -2
  76. metaflow-stubs/multicore_utils.pyi +2 -2
  77. metaflow-stubs/parameters.pyi +5 -5
  78. metaflow-stubs/plugins/__init__.pyi +9 -9
  79. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  80. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  81. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  82. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  83. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  84. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
  85. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
  86. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  87. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  88. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  89. metaflow-stubs/plugins/argo/argo_workflows.pyi +4 -4
  90. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
  91. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +5 -5
  92. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -3
  93. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  94. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  95. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  96. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  97. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  98. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  99. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  100. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  101. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
  102. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  103. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  104. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  105. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  106. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  107. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +5 -5
  108. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +4 -4
  109. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  110. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  111. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  112. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +3 -3
  113. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  114. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  115. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  116. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  117. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  118. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  119. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  120. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  121. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  122. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  123. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  124. metaflow-stubs/plugins/cards/card_modules/components.pyi +5 -5
  125. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  126. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  127. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  128. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  129. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  130. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  131. metaflow-stubs/plugins/catch_decorator.pyi +3 -3
  132. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  133. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  134. metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
  135. metaflow-stubs/plugins/datatools/s3/s3.pyi +5 -5
  136. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  137. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  138. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  139. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  140. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  141. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  142. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  143. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  144. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  145. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
  146. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  147. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  148. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  149. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  150. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  151. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +3 -3
  152. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  153. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  154. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
  155. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  156. metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
  157. metaflow-stubs/plugins/ollama/__init__.pyi +3 -3
  158. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  159. metaflow-stubs/plugins/perimeters.pyi +2 -2
  160. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  161. metaflow-stubs/plugins/pypi/__init__.pyi +3 -3
  162. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  163. metaflow-stubs/plugins/pypi/conda_environment.pyi +5 -5
  164. metaflow-stubs/plugins/pypi/parsers.pyi +2 -2
  165. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  166. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  167. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  168. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  169. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  170. metaflow-stubs/plugins/secrets/__init__.pyi +3 -3
  171. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
  172. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  173. metaflow-stubs/plugins/snowflake/__init__.pyi +2 -2
  174. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  175. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  176. metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
  177. metaflow-stubs/profilers/__init__.pyi +2 -2
  178. metaflow-stubs/pylint_wrapper.pyi +2 -2
  179. metaflow-stubs/runner/__init__.pyi +2 -2
  180. metaflow-stubs/runner/deployer.pyi +30 -30
  181. metaflow-stubs/runner/deployer_impl.pyi +3 -3
  182. metaflow-stubs/runner/metaflow_runner.pyi +4 -4
  183. metaflow-stubs/runner/nbdeploy.pyi +2 -2
  184. metaflow-stubs/runner/nbrun.pyi +2 -2
  185. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  186. metaflow-stubs/runner/utils.pyi +3 -3
  187. metaflow-stubs/system/__init__.pyi +2 -2
  188. metaflow-stubs/system/system_logger.pyi +3 -3
  189. metaflow-stubs/system/system_monitor.pyi +2 -2
  190. metaflow-stubs/tagging_util.pyi +2 -2
  191. metaflow-stubs/tuple_util.pyi +2 -2
  192. metaflow-stubs/user_configs/__init__.pyi +2 -2
  193. metaflow-stubs/user_configs/config_decorators.pyi +6 -6
  194. metaflow-stubs/user_configs/config_options.pyi +4 -4
  195. metaflow-stubs/user_configs/config_parameters.pyi +6 -6
  196. {ob_metaflow_stubs-6.0.3.154.dist-info → ob_metaflow_stubs-6.0.3.155rc0.dist-info}/METADATA +1 -1
  197. ob_metaflow_stubs-6.0.3.155rc0.dist-info/RECORD +200 -0
  198. ob_metaflow_stubs-6.0.3.154.dist-info/RECORD +0 -198
  199. {ob_metaflow_stubs-6.0.3.154.dist-info → ob_metaflow_stubs-6.0.3.155rc0.dist-info}/WHEEL +0 -0
  200. {ob_metaflow_stubs-6.0.3.154.dist-info → ob_metaflow_stubs-6.0.3.155rc0.dist-info}/top_level.txt +0 -0
@@ -1,15 +1,15 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.15.7.2+obcheckpoint(0.1.9);ob(v1) #
4
- # Generated on 2025-04-10T22:13:15.011907 #
3
+ # MF version: 2.15.7.2+obcheckpoint(0.2.0);ob(v1) #
4
+ # Generated on 2025-04-14T19:55:43.556579 #
5
5
  ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
- import typing
12
11
  import datetime
12
+ import typing
13
13
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
14
14
  StepFlag = typing.NewType("StepFlag", bool)
15
15
 
@@ -66,6 +66,7 @@ from .runner.deployer import DeployedFlow as DeployedFlow
66
66
  from .runner.nbdeploy import NBDeployer as NBDeployer
67
67
  from .mf_extensions.obcheckpoint.plugins.machine_learning_utilities.checkpoints.final_api import Checkpoint as Checkpoint
68
68
  from .mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures import load_model as load_model
69
+ from .mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastore.context import artifact_store_from as artifact_store_from
69
70
  from .mf_extensions.outerbounds.toplevel.global_aliases_for_metaflow_package import get_aws_client as get_aws_client
70
71
  from .mf_extensions.outerbounds.plugins.snowflake.snowflake import Snowflake as Snowflake
71
72
  from . import cli_components as cli_components
@@ -150,129 +151,88 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
150
151
  ...
151
152
 
152
153
  @typing.overload
153
- 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]]]:
154
+ 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]]]:
154
155
  """
155
- Specifies secrets to be retrieved and injected as environment variables prior to
156
- the execution of a step.
156
+ Specifies the PyPI packages for the step.
157
+
158
+ Information in this decorator will augment any
159
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
160
+ you can use `@pypi_base` to set packages required by all
161
+ steps and use `@pypi` to specify step-specific overrides.
157
162
 
158
163
 
159
164
  Parameters
160
165
  ----------
161
- sources : List[Union[str, Dict[str, Any]]], default: []
162
- List of secret specs, defining how the secrets are to be retrieved
166
+ packages : Dict[str, str], default: {}
167
+ Packages to use for this step. The key is the name of the package
168
+ and the value is the version to use.
169
+ python : str, optional, default: None
170
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
171
+ that the version used will correspond to the version of the Python interpreter used to start the run.
163
172
  """
164
173
  ...
165
174
 
166
175
  @typing.overload
167
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
176
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
168
177
  ...
169
178
 
170
179
  @typing.overload
171
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
180
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
172
181
  ...
173
182
 
174
- 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]]] = []):
183
+ 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):
175
184
  """
176
- Specifies secrets to be retrieved and injected as environment variables prior to
177
- the execution of a step.
185
+ Specifies the PyPI packages for the step.
186
+
187
+ Information in this decorator will augment any
188
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
189
+ you can use `@pypi_base` to set packages required by all
190
+ steps and use `@pypi` to specify step-specific overrides.
178
191
 
179
192
 
180
193
  Parameters
181
194
  ----------
182
- sources : List[Union[str, Dict[str, Any]]], default: []
183
- List of secret specs, defining how the secrets are to be retrieved
184
- """
185
- ...
186
-
187
- @typing.overload
188
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
189
- """
190
- Decorator prototype for all step decorators. This function gets specialized
191
- and imported for all decorators types by _import_plugin_decorators().
192
- """
193
- ...
194
-
195
- @typing.overload
196
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
197
- ...
198
-
199
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
200
- """
201
- Decorator prototype for all step decorators. This function gets specialized
202
- and imported for all decorators types by _import_plugin_decorators().
195
+ packages : Dict[str, str], default: {}
196
+ Packages to use for this step. The key is the name of the package
197
+ and the value is the version to use.
198
+ python : str, optional, default: None
199
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
200
+ that the version used will correspond to the version of the Python interpreter used to start the run.
203
201
  """
204
202
  ...
205
203
 
206
204
  @typing.overload
207
- 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]]]:
205
+ 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]]]:
208
206
  """
209
- Enables loading / saving of models within a step.
210
-
207
+ Specifies secrets to be retrieved and injected as environment variables prior to
208
+ the execution of a step.
211
209
 
212
210
 
213
211
  Parameters
214
212
  ----------
215
- load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
216
- Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
217
- These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
218
- - `current.checkpoint`
219
- - `current.model`
220
- - `current.huggingface_hub`
221
-
222
- 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
223
- the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
224
- If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
225
-
226
- temp_dir_root : str, default: None
227
- The root directory under which `current.model.loaded` will store loaded models
213
+ sources : List[Union[str, Dict[str, Any]]], default: []
214
+ List of secret specs, defining how the secrets are to be retrieved
228
215
  """
229
216
  ...
230
217
 
231
218
  @typing.overload
232
- def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
219
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
233
220
  ...
234
221
 
235
222
  @typing.overload
236
- def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
237
- ...
238
-
239
- 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):
240
- """
241
- Enables loading / saving of models within a step.
242
-
243
-
244
-
245
- Parameters
246
- ----------
247
- load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
248
- Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
249
- These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
250
- - `current.checkpoint`
251
- - `current.model`
252
- - `current.huggingface_hub`
253
-
254
- 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
255
- the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
256
- If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
257
-
258
- temp_dir_root : str, default: None
259
- The root directory under which `current.model.loaded` will store loaded models
260
- """
223
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
261
224
  ...
262
225
 
263
- 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]]]:
226
+ 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]]] = []):
264
227
  """
265
- Specifies that this step should execute on DGX cloud.
228
+ Specifies secrets to be retrieved and injected as environment variables prior to
229
+ the execution of a step.
266
230
 
267
231
 
268
232
  Parameters
269
233
  ----------
270
- gpu : int
271
- Number of GPUs to use.
272
- gpu_type : str
273
- Type of Nvidia GPU to use.
274
- queue_timeout : int
275
- Time to keep the job in NVCF's queue.
234
+ sources : List[Union[str, Dict[str, Any]]], default: []
235
+ List of secret specs, defining how the secrets are to be retrieved
276
236
  """
277
237
  ...
278
238
 
@@ -331,39 +291,6 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
331
291
  """
332
292
  ...
333
293
 
334
- def nim(*, models: "list[NIM]", backend: str, queue_timeout: int) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
335
- """
336
- This decorator is used to run NIM containers in Metaflow tasks as sidecars.
337
-
338
- User code call
339
- -----------
340
- @nim(
341
- models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
342
- backend='managed'
343
- )
344
-
345
- Valid backend options
346
- ---------------------
347
- - 'managed': Outerbounds selects a compute provider based on the model.
348
-
349
- Valid model options
350
- ----------------
351
- - 'meta/llama3-8b-instruct': 8B parameter model
352
- - 'meta/llama3-70b-instruct': 70B parameter model
353
- - any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
354
-
355
-
356
- Parameters
357
- ----------
358
- models: list[NIM]
359
- List of NIM containers running models in sidecars.
360
- backend: str
361
- Compute provider to run the NIM container.
362
- queue_timeout : int
363
- Time to keep the job in NVCF's queue.
364
- """
365
- ...
366
-
367
294
  def app_deploy(*, app_port: int, app_name: str) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
368
295
  """
369
296
  Specifies that this step is used to deploy an instance of the app.
@@ -379,65 +306,6 @@ def app_deploy(*, app_port: int, app_name: str) -> typing.Callable[[typing.Union
379
306
  """
380
307
  ...
381
308
 
382
- @typing.overload
383
- 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]]]:
384
- """
385
- Specifies the Conda environment for the step.
386
-
387
- Information in this decorator will augment any
388
- attributes set in the `@conda_base` flow-level decorator. Hence,
389
- you can use `@conda_base` to set packages required by all
390
- steps and use `@conda` to specify step-specific overrides.
391
-
392
-
393
- Parameters
394
- ----------
395
- packages : Dict[str, str], default {}
396
- Packages to use for this step. The key is the name of the package
397
- and the value is the version to use.
398
- libraries : Dict[str, str], default {}
399
- Supported for backward compatibility. When used with packages, packages will take precedence.
400
- python : str, optional, default None
401
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
402
- that the version used will correspond to the version of the Python interpreter used to start the run.
403
- disabled : bool, default False
404
- If set to True, disables @conda.
405
- """
406
- ...
407
-
408
- @typing.overload
409
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
410
- ...
411
-
412
- @typing.overload
413
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
414
- ...
415
-
416
- 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):
417
- """
418
- Specifies the Conda environment for the step.
419
-
420
- Information in this decorator will augment any
421
- attributes set in the `@conda_base` flow-level decorator. Hence,
422
- you can use `@conda_base` to set packages required by all
423
- steps and use `@conda` to specify step-specific overrides.
424
-
425
-
426
- Parameters
427
- ----------
428
- packages : Dict[str, str], default {}
429
- Packages to use for this step. The key is the name of the package
430
- and the value is the version to use.
431
- libraries : Dict[str, str], default {}
432
- Supported for backward compatibility. When used with packages, packages will take precedence.
433
- python : str, optional, default None
434
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
435
- that the version used will correspond to the version of the Python interpreter used to start the run.
436
- disabled : bool, default False
437
- If set to True, disables @conda.
438
- """
439
- ...
440
-
441
309
  @typing.overload
442
310
  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]]]:
443
311
  """
@@ -497,113 +365,44 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
497
365
  """
498
366
  ...
499
367
 
500
- @typing.overload
501
- 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]]]:
368
+ 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]]]:
502
369
  """
503
- Specifies environment variables to be set prior to the execution of a step.
370
+ Decorator that helps cache, version and store models/datasets from huggingface hub.
504
371
 
505
372
 
506
373
  Parameters
507
374
  ----------
508
- vars : Dict[str, str], default {}
509
- Dictionary of environment variables to set.
375
+ temp_dir_root : str, optional
376
+ The root directory that will hold the temporary directory where objects will be downloaded.
377
+
378
+ load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
379
+ The list of repos (models/datasets) to load.
380
+
381
+ Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
382
+
383
+ - If repo (model/dataset) is not found in the datastore:
384
+ - Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
385
+ - Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
386
+ - All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
387
+
388
+ - If repo is found in the datastore:
389
+ - Loads it directly from datastore to local path (can be temporary directory or specified path)
510
390
  """
511
391
  ...
512
392
 
513
- @typing.overload
514
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
515
- ...
516
-
517
- @typing.overload
518
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
519
- ...
520
-
521
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
393
+ 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]]]:
522
394
  """
523
- Specifies environment variables to be set prior to the execution of a step.
395
+ Specifies that this step should execute on DGX cloud.
524
396
 
525
397
 
526
398
  Parameters
527
399
  ----------
528
- vars : Dict[str, str], default {}
529
- Dictionary of environment variables to set.
530
- """
531
- ...
532
-
533
- 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]]]:
534
- """
535
- Specifies that this step should execute on Kubernetes.
536
-
537
-
538
- Parameters
539
- ----------
540
- cpu : int, default 1
541
- Number of CPUs required for this step. If `@resources` is
542
- also present, the maximum value from all decorators is used.
543
- memory : int, default 4096
544
- Memory size (in MB) required for this step. If
545
- `@resources` is also present, the maximum value from all decorators is
546
- used.
547
- disk : int, default 10240
548
- Disk size (in MB) required for this step. If
549
- `@resources` is also present, the maximum value from all decorators is
550
- used.
551
- image : str, optional, default None
552
- Docker image to use when launching on Kubernetes. If not specified, and
553
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
554
- not, a default Docker image mapping to the current version of Python is used.
555
- image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
556
- If given, the imagePullPolicy to be applied to the Docker image of the step.
557
- service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
558
- Kubernetes service account to use when launching pod in Kubernetes.
559
- secrets : List[str], optional, default None
560
- Kubernetes secrets to use when launching pod in Kubernetes. These
561
- secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
562
- in Metaflow configuration.
563
- node_selector: Union[Dict[str,str], str], optional, default None
564
- Kubernetes node selector(s) to apply to the pod running the task.
565
- Can be passed in as a comma separated string of values e.g.
566
- 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
567
- {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
568
- namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
569
- Kubernetes namespace to use when launching pod in Kubernetes.
570
- gpu : int, optional, default None
571
- Number of GPUs required for this step. A value of zero implies that
572
- the scheduled node should not have GPUs.
573
- gpu_vendor : str, default KUBERNETES_GPU_VENDOR
574
- The vendor of the GPUs to be used for this step.
575
- tolerations : List[str], default []
576
- The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
577
- Kubernetes tolerations to use when launching pod in Kubernetes.
578
- labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
579
- Kubernetes labels to use when launching pod in Kubernetes.
580
- annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
581
- Kubernetes annotations to use when launching pod in Kubernetes.
582
- use_tmpfs : bool, default False
583
- This enables an explicit tmpfs mount for this step.
584
- tmpfs_tempdir : bool, default True
585
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
586
- tmpfs_size : int, optional, default: None
587
- The value for the size (in MiB) of the tmpfs mount for this step.
588
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
589
- memory allocated for this step.
590
- tmpfs_path : str, optional, default /metaflow_temp
591
- Path to tmpfs mount for this step.
592
- persistent_volume_claims : Dict[str, str], optional, default None
593
- A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
594
- volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
595
- shared_memory: int, optional
596
- Shared memory size (in MiB) required for this step
597
- port: int, optional
598
- Port number to specify in the Kubernetes job object
599
- compute_pool : str, optional, default None
600
- Compute pool to be used for for this step.
601
- If not specified, any accessible compute pool within the perimeter is used.
602
- hostname_resolution_timeout: int, default 10 * 60
603
- Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
604
- Only applicable when @parallel is used.
605
- qos: str, default: Burstable
606
- Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
400
+ gpu : int
401
+ Number of GPUs to use.
402
+ gpu_type : str
403
+ Type of Nvidia GPU to use.
404
+ queue_timeout : int
405
+ Time to keep the job in NVCF's queue.
607
406
  """
608
407
  ...
609
408
 
@@ -624,525 +423,550 @@ def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepF
624
423
  """
625
424
  ...
626
425
 
627
- @typing.overload
628
- def card(*, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
426
+ def ollama(*, models: "list[Ollama]", backend: str) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
629
427
  """
630
- Creates a human-readable report, a Metaflow Card, after this step completes.
428
+ This decorator is used to run Ollama APIs as Metaflow task sidecars.
631
429
 
632
- Note that you may add multiple `@card` decorators in a step with different parameters.
430
+ User code call
431
+ -----------
432
+ @ollama(
433
+ models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
434
+ backend='local'
435
+ )
436
+
437
+ Valid backend options
438
+ ---------------------
439
+ - 'local': Run as a separate process on the local task machine.
440
+ - (TODO) 'managed': Outerbounds hosts and selects compute provider.
441
+ - (TODO) 'remote': Spin up separate instance to serve Ollama models.
442
+
443
+ Valid model options
444
+ ----------------
445
+ - 'llama3.2'
446
+ - 'llama3.3'
447
+ - any model here https://ollama.com/search
633
448
 
634
449
 
635
450
  Parameters
636
451
  ----------
637
- type : str, default 'default'
638
- Card type.
639
- id : str, optional, default None
640
- If multiple cards are present, use this id to identify this card.
641
- options : Dict[str, Any], default {}
642
- Options passed to the card. The contents depend on the card type.
643
- timeout : int, default 45
644
- Interrupt reporting if it takes more than this many seconds.
452
+ models: list[Ollama]
453
+ List of Ollama containers running models in sidecars.
454
+ backend: str
455
+ Determines where and how to run the Ollama process.
645
456
  """
646
457
  ...
647
458
 
648
459
  @typing.overload
649
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
650
- ...
651
-
652
- @typing.overload
653
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
654
- ...
655
-
656
- def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
460
+ def conda(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
657
461
  """
658
- Creates a human-readable report, a Metaflow Card, after this step completes.
462
+ Specifies the Conda environment for the step.
659
463
 
660
- Note that you may add multiple `@card` decorators in a step with different parameters.
464
+ Information in this decorator will augment any
465
+ attributes set in the `@conda_base` flow-level decorator. Hence,
466
+ you can use `@conda_base` to set packages required by all
467
+ steps and use `@conda` to specify step-specific overrides.
661
468
 
662
469
 
663
470
  Parameters
664
471
  ----------
665
- type : str, default 'default'
666
- Card type.
667
- id : str, optional, default None
668
- If multiple cards are present, use this id to identify this card.
669
- options : Dict[str, Any], default {}
670
- Options passed to the card. The contents depend on the card type.
671
- timeout : int, default 45
672
- Interrupt reporting if it takes more than this many seconds.
472
+ packages : Dict[str, str], default {}
473
+ Packages to use for this step. The key is the name of the package
474
+ and the value is the version to use.
475
+ libraries : Dict[str, str], default {}
476
+ Supported for backward compatibility. When used with packages, packages will take precedence.
477
+ python : str, optional, default None
478
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
479
+ that the version used will correspond to the version of the Python interpreter used to start the run.
480
+ disabled : bool, default False
481
+ If set to True, disables @conda.
673
482
  """
674
483
  ...
675
484
 
676
- 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]]]:
485
+ @typing.overload
486
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
487
+ ...
488
+
489
+ @typing.overload
490
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
491
+ ...
492
+
493
+ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
677
494
  """
678
- Decorator that helps cache, version and store models/datasets from huggingface hub.
495
+ Specifies the Conda environment for the step.
496
+
497
+ Information in this decorator will augment any
498
+ attributes set in the `@conda_base` flow-level decorator. Hence,
499
+ you can use `@conda_base` to set packages required by all
500
+ steps and use `@conda` to specify step-specific overrides.
679
501
 
680
502
 
681
503
  Parameters
682
504
  ----------
683
- temp_dir_root : str, optional
684
- The root directory that will hold the temporary directory where objects will be downloaded.
685
-
686
- load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
687
- The list of repos (models/datasets) to load.
688
-
689
- Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
690
-
691
- - If repo (model/dataset) is not found in the datastore:
692
- - Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
693
- - Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
694
- - All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
695
-
696
- - If repo is found in the datastore:
697
- - Loads it directly from datastore to local path (can be temporary directory or specified path)
505
+ packages : Dict[str, str], default {}
506
+ Packages to use for this step. The key is the name of the package
507
+ and the value is the version to use.
508
+ libraries : Dict[str, str], default {}
509
+ Supported for backward compatibility. When used with packages, packages will take precedence.
510
+ python : str, optional, default None
511
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
512
+ that the version used will correspond to the version of the Python interpreter used to start the run.
513
+ disabled : bool, default False
514
+ If set to True, disables @conda.
698
515
  """
699
516
  ...
700
517
 
701
518
  @typing.overload
702
- 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]]]:
519
+ 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]]]:
703
520
  """
704
- Specifies the resources needed when executing this step.
705
-
706
- Use `@resources` to specify the resource requirements
707
- independently of the specific compute layer (`@batch`, `@kubernetes`).
521
+ Enables loading / saving of models within a step.
708
522
 
709
- You can choose the compute layer on the command line by executing e.g.
710
- ```
711
- python myflow.py run --with batch
712
- ```
713
- or
714
- ```
715
- python myflow.py run --with kubernetes
716
- ```
717
- which executes the flow on the desired system using the
718
- requirements specified in `@resources`.
719
523
 
720
524
 
721
525
  Parameters
722
526
  ----------
723
- cpu : int, default 1
724
- Number of CPUs required for this step.
725
- gpu : int, optional, default None
726
- Number of GPUs required for this step.
727
- disk : int, optional, default None
728
- Disk size (in MB) required for this step. Only applies on Kubernetes.
729
- memory : int, default 4096
730
- Memory size (in MB) required for this step.
731
- shared_memory : int, optional, default None
732
- The value for the size (in MiB) of the /dev/shm volume for this step.
733
- This parameter maps to the `--shm-size` option in Docker.
527
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
528
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
529
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
530
+ - `current.checkpoint`
531
+ - `current.model`
532
+ - `current.huggingface_hub`
533
+
534
+ 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
535
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
536
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
537
+
538
+ temp_dir_root : str, default: None
539
+ The root directory under which `current.model.loaded` will store loaded models
734
540
  """
735
541
  ...
736
542
 
737
543
  @typing.overload
738
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
544
+ def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
739
545
  ...
740
546
 
741
547
  @typing.overload
742
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
548
+ def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
743
549
  ...
744
550
 
745
- 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):
551
+ 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):
746
552
  """
747
- Specifies the resources needed when executing this step.
748
-
749
- Use `@resources` to specify the resource requirements
750
- independently of the specific compute layer (`@batch`, `@kubernetes`).
553
+ Enables loading / saving of models within a step.
751
554
 
752
- You can choose the compute layer on the command line by executing e.g.
753
- ```
754
- python myflow.py run --with batch
755
- ```
756
- or
757
- ```
758
- python myflow.py run --with kubernetes
759
- ```
760
- which executes the flow on the desired system using the
761
- requirements specified in `@resources`.
762
555
 
763
556
 
764
557
  Parameters
765
558
  ----------
766
- cpu : int, default 1
767
- Number of CPUs required for this step.
768
- gpu : int, optional, default None
769
- Number of GPUs required for this step.
770
- disk : int, optional, default None
771
- Disk size (in MB) required for this step. Only applies on Kubernetes.
772
- memory : int, default 4096
773
- Memory size (in MB) required for this step.
774
- shared_memory : int, optional, default None
775
- The value for the size (in MiB) of the /dev/shm volume for this step.
776
- This parameter maps to the `--shm-size` option in Docker.
777
- """
778
- ...
779
-
780
- def ollama(*, models: "list[Ollama]", backend: str) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
781
- """
782
- This decorator is used to run Ollama APIs as Metaflow task sidecars.
783
-
784
- User code call
785
- -----------
786
- @ollama(
787
- models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
788
- backend='local'
789
- )
790
-
791
- Valid backend options
792
- ---------------------
793
- - 'local': Run as a separate process on the local task machine.
794
- - (TODO) 'managed': Outerbounds hosts and selects compute provider.
795
- - (TODO) 'remote': Spin up separate instance to serve Ollama models.
796
-
797
- Valid model options
798
- ----------------
799
- - 'llama3.2'
800
- - 'llama3.3'
801
- - any model here https://ollama.com/search
559
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
560
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
561
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
562
+ - `current.checkpoint`
563
+ - `current.model`
564
+ - `current.huggingface_hub`
802
565
 
566
+ 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
567
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
568
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
803
569
 
804
- Parameters
805
- ----------
806
- models: list[Ollama]
807
- List of Ollama containers running models in sidecars.
808
- backend: str
809
- Determines where and how to run the Ollama process.
570
+ temp_dir_root : str, default: None
571
+ The root directory under which `current.model.loaded` will store loaded models
810
572
  """
811
573
  ...
812
574
 
813
575
  @typing.overload
814
- 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]]]:
576
+ 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]]]:
815
577
  """
816
- Enables checkpointing for a step.
817
-
578
+ Specifies environment variables to be set prior to the execution of a step.
818
579
 
819
580
 
820
581
  Parameters
821
582
  ----------
822
- load_policy : str, default: "fresh"
823
- The policy for loading the checkpoint. The following policies are supported:
824
- - "eager": Loads the the latest available checkpoint within the namespace.
825
- With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
826
- will be loaded at the start of the task.
827
- - "none": Do not load any checkpoint
828
- - "fresh": Loads the lastest checkpoint created within the running Task.
829
- This mode helps loading checkpoints across various retry attempts of the same task.
830
- With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
831
- created within the task will be loaded when the task is retries execution on failure.
832
-
833
- temp_dir_root : str, default: None
834
- The root directory under which `current.checkpoint.directory` will be created.
583
+ vars : Dict[str, str], default {}
584
+ Dictionary of environment variables to set.
835
585
  """
836
586
  ...
837
587
 
838
588
  @typing.overload
839
- def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
589
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
840
590
  ...
841
591
 
842
592
  @typing.overload
843
- def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
593
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
844
594
  ...
845
595
 
846
- 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):
596
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
847
597
  """
848
- Enables checkpointing for a step.
849
-
598
+ Specifies environment variables to be set prior to the execution of a step.
850
599
 
851
600
 
852
601
  Parameters
853
602
  ----------
854
- load_policy : str, default: "fresh"
855
- The policy for loading the checkpoint. The following policies are supported:
856
- - "eager": Loads the the latest available checkpoint within the namespace.
857
- With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
858
- will be loaded at the start of the task.
859
- - "none": Do not load any checkpoint
860
- - "fresh": Loads the lastest checkpoint created within the running Task.
861
- This mode helps loading checkpoints across various retry attempts of the same task.
862
- With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
863
- created within the task will be loaded when the task is retries execution on failure.
864
-
865
- temp_dir_root : str, default: None
866
- The root directory under which `current.checkpoint.directory` will be created.
603
+ vars : Dict[str, str], default {}
604
+ Dictionary of environment variables to set.
867
605
  """
868
606
  ...
869
607
 
870
608
  @typing.overload
871
- 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]]]:
609
+ 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]]]:
872
610
  """
873
- Specifies that the step will success under all circumstances.
611
+ Specifies the resources needed when executing this step.
874
612
 
875
- The decorator will create an optional artifact, specified by `var`, which
876
- contains the exception raised. You can use it to detect the presence
877
- of errors, indicating that all happy-path artifacts produced by the step
878
- are missing.
613
+ Use `@resources` to specify the resource requirements
614
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
615
+
616
+ You can choose the compute layer on the command line by executing e.g.
617
+ ```
618
+ python myflow.py run --with batch
619
+ ```
620
+ or
621
+ ```
622
+ python myflow.py run --with kubernetes
623
+ ```
624
+ which executes the flow on the desired system using the
625
+ requirements specified in `@resources`.
879
626
 
880
627
 
881
628
  Parameters
882
629
  ----------
883
- var : str, optional, default None
884
- Name of the artifact in which to store the caught exception.
885
- If not specified, the exception is not stored.
886
- print_exception : bool, default True
887
- Determines whether or not the exception is printed to
888
- stdout when caught.
630
+ cpu : int, default 1
631
+ Number of CPUs required for this step.
632
+ gpu : int, optional, default None
633
+ Number of GPUs required for this step.
634
+ disk : int, optional, default None
635
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
636
+ memory : int, default 4096
637
+ Memory size (in MB) required for this step.
638
+ shared_memory : int, optional, default None
639
+ The value for the size (in MiB) of the /dev/shm volume for this step.
640
+ This parameter maps to the `--shm-size` option in Docker.
889
641
  """
890
642
  ...
891
643
 
892
644
  @typing.overload
893
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
645
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
894
646
  ...
895
647
 
896
648
  @typing.overload
897
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
649
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
898
650
  ...
899
651
 
900
- 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):
652
+ 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):
901
653
  """
902
- Specifies that the step will success under all circumstances.
654
+ Specifies the resources needed when executing this step.
903
655
 
904
- The decorator will create an optional artifact, specified by `var`, which
905
- contains the exception raised. You can use it to detect the presence
906
- of errors, indicating that all happy-path artifacts produced by the step
907
- are missing.
656
+ Use `@resources` to specify the resource requirements
657
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
658
+
659
+ You can choose the compute layer on the command line by executing e.g.
660
+ ```
661
+ python myflow.py run --with batch
662
+ ```
663
+ or
664
+ ```
665
+ python myflow.py run --with kubernetes
666
+ ```
667
+ which executes the flow on the desired system using the
668
+ requirements specified in `@resources`.
908
669
 
909
670
 
910
671
  Parameters
911
672
  ----------
912
- var : str, optional, default None
913
- Name of the artifact in which to store the caught exception.
914
- If not specified, the exception is not stored.
915
- print_exception : bool, default True
916
- Determines whether or not the exception is printed to
917
- stdout when caught.
673
+ cpu : int, default 1
674
+ Number of CPUs required for this step.
675
+ gpu : int, optional, default None
676
+ Number of GPUs required for this step.
677
+ disk : int, optional, default None
678
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
679
+ memory : int, default 4096
680
+ Memory size (in MB) required for this step.
681
+ shared_memory : int, optional, default None
682
+ The value for the size (in MiB) of the /dev/shm volume for this step.
683
+ This parameter maps to the `--shm-size` option in Docker.
918
684
  """
919
685
  ...
920
686
 
921
- @typing.overload
922
- 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]]]:
687
+ def nim(*, models: "list[NIM]", backend: str, queue_timeout: int) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
923
688
  """
924
- Specifies the PyPI packages for the step.
689
+ This decorator is used to run NIM containers in Metaflow tasks as sidecars.
925
690
 
926
- Information in this decorator will augment any
927
- attributes set in the `@pyi_base` flow-level decorator. Hence,
928
- you can use `@pypi_base` to set packages required by all
929
- steps and use `@pypi` to specify step-specific overrides.
691
+ User code call
692
+ -----------
693
+ @nim(
694
+ models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
695
+ backend='managed'
696
+ )
697
+
698
+ Valid backend options
699
+ ---------------------
700
+ - 'managed': Outerbounds selects a compute provider based on the model.
701
+
702
+ Valid model options
703
+ ----------------
704
+ - 'meta/llama3-8b-instruct': 8B parameter model
705
+ - 'meta/llama3-70b-instruct': 70B parameter model
706
+ - any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
930
707
 
931
708
 
932
709
  Parameters
933
710
  ----------
934
- packages : Dict[str, str], default: {}
935
- Packages to use for this step. The key is the name of the package
936
- and the value is the version to use.
937
- python : str, optional, default: None
938
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
939
- that the version used will correspond to the version of the Python interpreter used to start the run.
711
+ models: list[NIM]
712
+ List of NIM containers running models in sidecars.
713
+ backend: str
714
+ Compute provider to run the NIM container.
715
+ queue_timeout : int
716
+ Time to keep the job in NVCF's queue.
940
717
  """
941
718
  ...
942
719
 
943
720
  @typing.overload
944
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
721
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
722
+ """
723
+ Decorator prototype for all step decorators. This function gets specialized
724
+ and imported for all decorators types by _import_plugin_decorators().
725
+ """
945
726
  ...
946
727
 
947
728
  @typing.overload
948
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
729
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
949
730
  ...
950
731
 
951
- 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):
732
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
952
733
  """
953
- Specifies the PyPI packages for the step.
954
-
955
- Information in this decorator will augment any
956
- attributes set in the `@pyi_base` flow-level decorator. Hence,
957
- you can use `@pypi_base` to set packages required by all
958
- steps and use `@pypi` to specify step-specific overrides.
734
+ Decorator prototype for all step decorators. This function gets specialized
735
+ and imported for all decorators types by _import_plugin_decorators().
736
+ """
737
+ ...
738
+
739
+ 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]]]:
740
+ """
741
+ Specifies that this step should execute on Kubernetes.
959
742
 
960
743
 
961
744
  Parameters
962
745
  ----------
963
- packages : Dict[str, str], default: {}
964
- Packages to use for this step. The key is the name of the package
965
- and the value is the version to use.
966
- python : str, optional, default: None
967
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
968
- that the version used will correspond to the version of the Python interpreter used to start the run.
746
+ cpu : int, default 1
747
+ Number of CPUs required for this step. If `@resources` is
748
+ also present, the maximum value from all decorators is used.
749
+ memory : int, default 4096
750
+ Memory size (in MB) required for this step. If
751
+ `@resources` is also present, the maximum value from all decorators is
752
+ used.
753
+ disk : int, default 10240
754
+ Disk size (in MB) required for this step. If
755
+ `@resources` is also present, the maximum value from all decorators is
756
+ used.
757
+ image : str, optional, default None
758
+ Docker image to use when launching on Kubernetes. If not specified, and
759
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
760
+ not, a default Docker image mapping to the current version of Python is used.
761
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
762
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
763
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
764
+ Kubernetes service account to use when launching pod in Kubernetes.
765
+ secrets : List[str], optional, default None
766
+ Kubernetes secrets to use when launching pod in Kubernetes. These
767
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
768
+ in Metaflow configuration.
769
+ node_selector: Union[Dict[str,str], str], optional, default None
770
+ Kubernetes node selector(s) to apply to the pod running the task.
771
+ Can be passed in as a comma separated string of values e.g.
772
+ 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
773
+ {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
774
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
775
+ Kubernetes namespace to use when launching pod in Kubernetes.
776
+ gpu : int, optional, default None
777
+ Number of GPUs required for this step. A value of zero implies that
778
+ the scheduled node should not have GPUs.
779
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
780
+ The vendor of the GPUs to be used for this step.
781
+ tolerations : List[str], default []
782
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
783
+ Kubernetes tolerations to use when launching pod in Kubernetes.
784
+ labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
785
+ Kubernetes labels to use when launching pod in Kubernetes.
786
+ annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
787
+ Kubernetes annotations to use when launching pod in Kubernetes.
788
+ use_tmpfs : bool, default False
789
+ This enables an explicit tmpfs mount for this step.
790
+ tmpfs_tempdir : bool, default True
791
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
792
+ tmpfs_size : int, optional, default: None
793
+ The value for the size (in MiB) of the tmpfs mount for this step.
794
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
795
+ memory allocated for this step.
796
+ tmpfs_path : str, optional, default /metaflow_temp
797
+ Path to tmpfs mount for this step.
798
+ persistent_volume_claims : Dict[str, str], optional, default None
799
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
800
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
801
+ shared_memory: int, optional
802
+ Shared memory size (in MiB) required for this step
803
+ port: int, optional
804
+ Port number to specify in the Kubernetes job object
805
+ compute_pool : str, optional, default None
806
+ Compute pool to be used for for this step.
807
+ If not specified, any accessible compute pool within the perimeter is used.
808
+ hostname_resolution_timeout: int, default 10 * 60
809
+ Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
810
+ Only applicable when @parallel is used.
811
+ qos: str, default: Burstable
812
+ Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
969
813
  """
970
814
  ...
971
815
 
972
816
  @typing.overload
973
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
817
+ def card(*, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
974
818
  """
975
- Specifies the PyPI packages for all steps of the flow.
819
+ Creates a human-readable report, a Metaflow Card, after this step completes.
820
+
821
+ Note that you may add multiple `@card` decorators in a step with different parameters.
976
822
 
977
- Use `@pypi_base` to set common packages required by all
978
- steps and use `@pypi` to specify step-specific overrides.
979
823
 
980
824
  Parameters
981
825
  ----------
982
- packages : Dict[str, str], default: {}
983
- Packages to use for this flow. The key is the name of the package
984
- and the value is the version to use.
985
- python : str, optional, default: None
986
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
987
- that the version used will correspond to the version of the Python interpreter used to start the run.
826
+ type : str, default 'default'
827
+ Card type.
828
+ id : str, optional, default None
829
+ If multiple cards are present, use this id to identify this card.
830
+ options : Dict[str, Any], default {}
831
+ Options passed to the card. The contents depend on the card type.
832
+ timeout : int, default 45
833
+ Interrupt reporting if it takes more than this many seconds.
988
834
  """
989
835
  ...
990
836
 
991
837
  @typing.overload
992
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
838
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
839
+ ...
840
+
841
+ @typing.overload
842
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
843
+ ...
844
+
845
+ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
846
+ """
847
+ Creates a human-readable report, a Metaflow Card, after this step completes.
848
+
849
+ Note that you may add multiple `@card` decorators in a step with different parameters.
850
+
851
+
852
+ Parameters
853
+ ----------
854
+ type : str, default 'default'
855
+ Card type.
856
+ id : str, optional, default None
857
+ If multiple cards are present, use this id to identify this card.
858
+ options : Dict[str, Any], default {}
859
+ Options passed to the card. The contents depend on the card type.
860
+ timeout : int, default 45
861
+ Interrupt reporting if it takes more than this many seconds.
862
+ """
993
863
  ...
994
864
 
995
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
865
+ @typing.overload
866
+ 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]]]:
996
867
  """
997
- Specifies the PyPI packages for all steps of the flow.
868
+ Enables checkpointing for a step.
869
+
998
870
 
999
- Use `@pypi_base` to set common packages required by all
1000
- steps and use `@pypi` to specify step-specific overrides.
1001
871
 
1002
872
  Parameters
1003
873
  ----------
1004
- packages : Dict[str, str], default: {}
1005
- Packages to use for this flow. The key is the name of the package
1006
- and the value is the version to use.
1007
- python : str, optional, default: None
1008
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1009
- that the version used will correspond to the version of the Python interpreter used to start the run.
874
+ load_policy : str, default: "fresh"
875
+ The policy for loading the checkpoint. The following policies are supported:
876
+ - "eager": Loads the the latest available checkpoint within the namespace.
877
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
878
+ will be loaded at the start of the task.
879
+ - "none": Do not load any checkpoint
880
+ - "fresh": Loads the lastest checkpoint created within the running Task.
881
+ This mode helps loading checkpoints across various retry attempts of the same task.
882
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
883
+ created within the task will be loaded when the task is retries execution on failure.
884
+
885
+ temp_dir_root : str, default: None
886
+ The root directory under which `current.checkpoint.directory` will be created.
1010
887
  """
1011
888
  ...
1012
889
 
1013
- 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]]:
890
+ @typing.overload
891
+ def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
892
+ ...
893
+
894
+ @typing.overload
895
+ def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
896
+ ...
897
+
898
+ 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):
1014
899
  """
1015
- 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)
1016
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1017
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1018
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1019
- starts only after all sensors finish.
900
+ Enables checkpointing for a step.
901
+
1020
902
 
1021
903
 
1022
904
  Parameters
1023
905
  ----------
1024
- timeout : int
1025
- Time, in seconds before the task times out and fails. (Default: 3600)
1026
- poke_interval : int
1027
- Time in seconds that the job should wait in between each try. (Default: 60)
1028
- mode : str
1029
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1030
- exponential_backoff : bool
1031
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1032
- pool : str
1033
- the slot pool this task should run in,
1034
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1035
- soft_fail : bool
1036
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1037
- name : str
1038
- Name of the sensor on Airflow
1039
- description : str
1040
- Description of sensor in the Airflow UI
1041
- bucket_key : Union[str, List[str]]
1042
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1043
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1044
- bucket_name : str
1045
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1046
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1047
- wildcard_match : bool
1048
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1049
- aws_conn_id : str
1050
- a reference to the s3 connection on Airflow. (Default: None)
1051
- verify : bool
1052
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
906
+ load_policy : str, default: "fresh"
907
+ The policy for loading the checkpoint. The following policies are supported:
908
+ - "eager": Loads the the latest available checkpoint within the namespace.
909
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
910
+ will be loaded at the start of the task.
911
+ - "none": Do not load any checkpoint
912
+ - "fresh": Loads the lastest checkpoint created within the running Task.
913
+ This mode helps loading checkpoints across various retry attempts of the same task.
914
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
915
+ created within the task will be loaded when the task is retries execution on failure.
916
+
917
+ temp_dir_root : str, default: None
918
+ The root directory under which `current.checkpoint.directory` will be created.
1053
919
  """
1054
920
  ...
1055
921
 
1056
922
  @typing.overload
1057
- def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
923
+ 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]]]:
1058
924
  """
1059
- Specifies the event(s) that this flow depends on.
1060
-
1061
- ```
1062
- @trigger(event='foo')
1063
- ```
1064
- or
1065
- ```
1066
- @trigger(events=['foo', 'bar'])
1067
- ```
1068
-
1069
- Additionally, you can specify the parameter mappings
1070
- to map event payload to Metaflow parameters for the flow.
1071
- ```
1072
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1073
- ```
1074
- or
1075
- ```
1076
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1077
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1078
- ```
925
+ Specifies that the step will success under all circumstances.
1079
926
 
1080
- 'parameters' can also be a list of strings and tuples like so:
1081
- ```
1082
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1083
- ```
1084
- This is equivalent to:
1085
- ```
1086
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1087
- ```
927
+ The decorator will create an optional artifact, specified by `var`, which
928
+ contains the exception raised. You can use it to detect the presence
929
+ of errors, indicating that all happy-path artifacts produced by the step
930
+ are missing.
1088
931
 
1089
932
 
1090
933
  Parameters
1091
934
  ----------
1092
- event : Union[str, Dict[str, Any]], optional, default None
1093
- Event dependency for this flow.
1094
- events : List[Union[str, Dict[str, Any]]], default []
1095
- Events dependency for this flow.
1096
- options : Dict[str, Any], default {}
1097
- Backend-specific configuration for tuning eventing behavior.
935
+ var : str, optional, default None
936
+ Name of the artifact in which to store the caught exception.
937
+ If not specified, the exception is not stored.
938
+ print_exception : bool, default True
939
+ Determines whether or not the exception is printed to
940
+ stdout when caught.
1098
941
  """
1099
942
  ...
1100
943
 
1101
944
  @typing.overload
1102
- def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
945
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1103
946
  ...
1104
947
 
1105
- def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
948
+ @typing.overload
949
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
950
+ ...
951
+
952
+ 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):
1106
953
  """
1107
- Specifies the event(s) that this flow depends on.
1108
-
1109
- ```
1110
- @trigger(event='foo')
1111
- ```
1112
- or
1113
- ```
1114
- @trigger(events=['foo', 'bar'])
1115
- ```
1116
-
1117
- Additionally, you can specify the parameter mappings
1118
- to map event payload to Metaflow parameters for the flow.
1119
- ```
1120
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1121
- ```
1122
- or
1123
- ```
1124
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1125
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1126
- ```
954
+ Specifies that the step will success under all circumstances.
1127
955
 
1128
- 'parameters' can also be a list of strings and tuples like so:
1129
- ```
1130
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1131
- ```
1132
- This is equivalent to:
1133
- ```
1134
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1135
- ```
956
+ The decorator will create an optional artifact, specified by `var`, which
957
+ contains the exception raised. You can use it to detect the presence
958
+ of errors, indicating that all happy-path artifacts produced by the step
959
+ are missing.
1136
960
 
1137
961
 
1138
962
  Parameters
1139
963
  ----------
1140
- event : Union[str, Dict[str, Any]], optional, default None
1141
- Event dependency for this flow.
1142
- events : List[Union[str, Dict[str, Any]]], default []
1143
- Events dependency for this flow.
1144
- options : Dict[str, Any], default {}
1145
- Backend-specific configuration for tuning eventing behavior.
964
+ var : str, optional, default None
965
+ Name of the artifact in which to store the caught exception.
966
+ If not specified, the exception is not stored.
967
+ print_exception : bool, default True
968
+ Determines whether or not the exception is printed to
969
+ stdout when caught.
1146
970
  """
1147
971
  ...
1148
972
 
@@ -1198,88 +1022,95 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
1198
1022
  ...
1199
1023
 
1200
1024
  @typing.overload
1201
- 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]]:
1025
+ def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1202
1026
  """
1203
- Specifies the times when the flow should be run when running on a
1204
- production scheduler.
1027
+ Specifies the event(s) that this flow depends on.
1205
1028
 
1029
+ ```
1030
+ @trigger(event='foo')
1031
+ ```
1032
+ or
1033
+ ```
1034
+ @trigger(events=['foo', 'bar'])
1035
+ ```
1206
1036
 
1207
- Parameters
1208
- ----------
1209
- hourly : bool, default False
1210
- Run the workflow hourly.
1211
- daily : bool, default True
1212
- Run the workflow daily.
1213
- weekly : bool, default False
1214
- Run the workflow weekly.
1215
- cron : str, optional, default None
1216
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1217
- specified by this expression.
1218
- timezone : str, optional, default None
1219
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1220
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1221
- """
1222
- ...
1223
-
1224
- @typing.overload
1225
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1226
- ...
1227
-
1228
- 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):
1229
- """
1230
- Specifies the times when the flow should be run when running on a
1231
- production scheduler.
1037
+ Additionally, you can specify the parameter mappings
1038
+ to map event payload to Metaflow parameters for the flow.
1039
+ ```
1040
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1041
+ ```
1042
+ or
1043
+ ```
1044
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1045
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1046
+ ```
1232
1047
 
1048
+ 'parameters' can also be a list of strings and tuples like so:
1049
+ ```
1050
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1051
+ ```
1052
+ This is equivalent to:
1053
+ ```
1054
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1055
+ ```
1233
1056
 
1234
- Parameters
1235
- ----------
1236
- hourly : bool, default False
1237
- Run the workflow hourly.
1238
- daily : bool, default True
1239
- Run the workflow daily.
1240
- weekly : bool, default False
1241
- Run the workflow weekly.
1242
- cron : str, optional, default None
1243
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1244
- specified by this expression.
1245
- timezone : str, optional, default None
1246
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1247
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1057
+
1058
+ Parameters
1059
+ ----------
1060
+ event : Union[str, Dict[str, Any]], optional, default None
1061
+ Event dependency for this flow.
1062
+ events : List[Union[str, Dict[str, Any]]], default []
1063
+ Events dependency for this flow.
1064
+ options : Dict[str, Any], default {}
1065
+ Backend-specific configuration for tuning eventing behavior.
1248
1066
  """
1249
1067
  ...
1250
1068
 
1251
- def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1069
+ @typing.overload
1070
+ def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1071
+ ...
1072
+
1073
+ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
1252
1074
  """
1253
- Specifies what flows belong to the same project.
1075
+ Specifies the event(s) that this flow depends on.
1254
1076
 
1255
- A project-specific namespace is created for all flows that
1256
- use the same `@project(name)`.
1077
+ ```
1078
+ @trigger(event='foo')
1079
+ ```
1080
+ or
1081
+ ```
1082
+ @trigger(events=['foo', 'bar'])
1083
+ ```
1257
1084
 
1085
+ Additionally, you can specify the parameter mappings
1086
+ to map event payload to Metaflow parameters for the flow.
1087
+ ```
1088
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1089
+ ```
1090
+ or
1091
+ ```
1092
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1093
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1094
+ ```
1258
1095
 
1259
- Parameters
1260
- ----------
1261
- name : str
1262
- Project name. Make sure that the name is unique amongst all
1263
- projects that use the same production scheduler. The name may
1264
- contain only lowercase alphanumeric characters and underscores.
1096
+ 'parameters' can also be a list of strings and tuples like so:
1097
+ ```
1098
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1099
+ ```
1100
+ This is equivalent to:
1101
+ ```
1102
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1103
+ ```
1265
1104
 
1266
- branch : Optional[str], default None
1267
- The branch to use. If not specified, the branch is set to
1268
- `user.<username>` unless `production` is set to `True`. This can
1269
- also be set on the command line using `--branch` as a top-level option.
1270
- It is an error to specify `branch` in the decorator and on the command line.
1271
1105
 
1272
- production : bool, default False
1273
- Whether or not the branch is the production branch. This can also be set on the
1274
- command line using `--production` as a top-level option. It is an error to specify
1275
- `production` in the decorator and on the command line.
1276
- The project branch name will be:
1277
- - if `branch` is specified:
1278
- - if `production` is True: `prod.<branch>`
1279
- - if `production` is False: `test.<branch>`
1280
- - if `branch` is not specified:
1281
- - if `production` is True: `prod`
1282
- - if `production` is False: `user.<username>`
1106
+ Parameters
1107
+ ----------
1108
+ event : Union[str, Dict[str, Any]], optional, default None
1109
+ Event dependency for this flow.
1110
+ events : List[Union[str, Dict[str, Any]]], default []
1111
+ Events dependency for this flow.
1112
+ options : Dict[str, Any], default {}
1113
+ Backend-specific configuration for tuning eventing behavior.
1283
1114
  """
1284
1115
  ...
1285
1116
 
@@ -1384,6 +1215,247 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
1384
1215
  """
1385
1216
  ...
1386
1217
 
1218
+ def with_artifact_store(f: typing.Optional[typing.Type[FlowSpecDerived]] = None):
1219
+ """
1220
+ Allows setting external datastores to save data for the
1221
+ `@checkpoint`/`@model`/`@huggingface_hub` decorators.
1222
+
1223
+ This decorator is useful when users wish to save data to a different datastore
1224
+ than what is configured in Metaflow. This can be for variety of reasons:
1225
+
1226
+ 1. Data security: The objects needs to be stored in a bucket (object storage) that is not accessible by other flows.
1227
+ 2. Data Locality: The location where the task is executing is not located in the same region as the datastore.
1228
+ - Example: Metaflow datastore lives in US East, but the task is executing in Finland datacenters.
1229
+ 3. Data Lifecycle Policies: The objects need to be archived / managed separately from the Metaflow managed objects.
1230
+ - Example: Flow is training very large models that need to be stored separately and will be deleted more aggressively than the Metaflow managed objects.
1231
+
1232
+ Usage:
1233
+ ----------
1234
+
1235
+ - Using a custom IAM role to access the datastore.
1236
+
1237
+ ```python
1238
+ @with_artifact_store(
1239
+ type="s3",
1240
+ config=lambda: {
1241
+ "root": "s3://my-bucket-foo/path/to/root",
1242
+ "role_arn": ROLE,
1243
+ },
1244
+ )
1245
+ class MyFlow(FlowSpec):
1246
+
1247
+ @checkpoint
1248
+ @step
1249
+ def start(self):
1250
+ with open("my_file.txt", "w") as f:
1251
+ f.write("Hello, World!")
1252
+ self.external_bucket_checkpoint = current.checkpoint.save("my_file.txt")
1253
+ self.next(self.end)
1254
+
1255
+ ```
1256
+
1257
+ - Using credentials to access the s3-compatible datastore.
1258
+
1259
+ ```python
1260
+ @with_artifact_store(
1261
+ type="s3",
1262
+ config=lambda: {
1263
+ "root": "s3://my-bucket-foo/path/to/root",
1264
+ "client_params": {
1265
+ "aws_access_key_id": os.environ.get("MY_CUSTOM_ACCESS_KEY"),
1266
+ "aws_secret_access_key": os.environ.get("MY_CUSTOM_SECRET_KEY"),
1267
+ },
1268
+ },
1269
+ )
1270
+ class MyFlow(FlowSpec):
1271
+
1272
+ @checkpoint
1273
+ @step
1274
+ def start(self):
1275
+ with open("my_file.txt", "w") as f:
1276
+ f.write("Hello, World!")
1277
+ self.external_bucket_checkpoint = current.checkpoint.save("my_file.txt")
1278
+ self.next(self.end)
1279
+
1280
+ ```
1281
+
1282
+ - Accessing objects stored in external datastores after task execution.
1283
+
1284
+ ```python
1285
+ run = Run("CheckpointsTestsFlow/8992")
1286
+ with artifact_store_from(run=run, config={
1287
+ "client_params": {
1288
+ "aws_access_key_id": os.environ.get("MY_CUSTOM_ACCESS_KEY"),
1289
+ "aws_secret_access_key": os.environ.get("MY_CUSTOM_SECRET_KEY"),
1290
+ },
1291
+ }):
1292
+ with Checkpoint() as cp:
1293
+ latest = cp.list(
1294
+ task=run["start"].task
1295
+ )[0]
1296
+ print(latest)
1297
+ cp.load(
1298
+ latest,
1299
+ "test-checkpoints"
1300
+ )
1301
+
1302
+ task = Task("TorchTuneFlow/8484/train/53673")
1303
+ with artifact_store_from(run=run, config={
1304
+ "client_params": {
1305
+ "aws_access_key_id": os.environ.get("MY_CUSTOM_ACCESS_KEY"),
1306
+ "aws_secret_access_key": os.environ.get("MY_CUSTOM_SECRET_KEY"),
1307
+ },
1308
+ }):
1309
+ load_model(
1310
+ task.data.model_ref,
1311
+ "test-models"
1312
+ )
1313
+ ```
1314
+ Parameters:
1315
+ ----------
1316
+
1317
+ type: str
1318
+ The type of the datastore. Can be one of 's3', 'gcs', 'azure' or any other supported metaflow Datastore.
1319
+
1320
+ config: dict or Callable
1321
+ Dictionary of configuration options for the datastore. The following keys are required:
1322
+ - root: The root path in the datastore where the data will be saved. (needs to be in the format expected by the datastore)
1323
+ - example: 's3://bucket-name/path/to/root'
1324
+ - example: 'gs://bucket-name/path/to/root'
1325
+ - example: 'https://myblockacc.blob.core.windows.net/metaflow/'
1326
+ - role_arn (optional): AWS IAM role to access s3 bucket (only when `type` is 's3')
1327
+ - session_vars (optional): AWS session variables to access s3 bucket (only when `type` is 's3')
1328
+ - client_params (optional): AWS client parameters to access s3 bucket (only when `type` is 's3')
1329
+ """
1330
+ ...
1331
+
1332
+ def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1333
+ """
1334
+ Specifies what flows belong to the same project.
1335
+
1336
+ A project-specific namespace is created for all flows that
1337
+ use the same `@project(name)`.
1338
+
1339
+
1340
+ Parameters
1341
+ ----------
1342
+ name : str
1343
+ Project name. Make sure that the name is unique amongst all
1344
+ projects that use the same production scheduler. The name may
1345
+ contain only lowercase alphanumeric characters and underscores.
1346
+
1347
+ branch : Optional[str], default None
1348
+ The branch to use. If not specified, the branch is set to
1349
+ `user.<username>` unless `production` is set to `True`. This can
1350
+ also be set on the command line using `--branch` as a top-level option.
1351
+ It is an error to specify `branch` in the decorator and on the command line.
1352
+
1353
+ production : bool, default False
1354
+ Whether or not the branch is the production branch. This can also be set on the
1355
+ command line using `--production` as a top-level option. It is an error to specify
1356
+ `production` in the decorator and on the command line.
1357
+ The project branch name will be:
1358
+ - if `branch` is specified:
1359
+ - if `production` is True: `prod.<branch>`
1360
+ - if `production` is False: `test.<branch>`
1361
+ - if `branch` is not specified:
1362
+ - if `production` is True: `prod`
1363
+ - if `production` is False: `user.<username>`
1364
+ """
1365
+ ...
1366
+
1367
+ @typing.overload
1368
+ 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]]:
1369
+ """
1370
+ Specifies the times when the flow should be run when running on a
1371
+ production scheduler.
1372
+
1373
+
1374
+ Parameters
1375
+ ----------
1376
+ hourly : bool, default False
1377
+ Run the workflow hourly.
1378
+ daily : bool, default True
1379
+ Run the workflow daily.
1380
+ weekly : bool, default False
1381
+ Run the workflow weekly.
1382
+ cron : str, optional, default None
1383
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1384
+ specified by this expression.
1385
+ timezone : str, optional, default None
1386
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1387
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1388
+ """
1389
+ ...
1390
+
1391
+ @typing.overload
1392
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1393
+ ...
1394
+
1395
+ 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):
1396
+ """
1397
+ Specifies the times when the flow should be run when running on a
1398
+ production scheduler.
1399
+
1400
+
1401
+ Parameters
1402
+ ----------
1403
+ hourly : bool, default False
1404
+ Run the workflow hourly.
1405
+ daily : bool, default True
1406
+ Run the workflow daily.
1407
+ weekly : bool, default False
1408
+ Run the workflow weekly.
1409
+ cron : str, optional, default None
1410
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1411
+ specified by this expression.
1412
+ timezone : str, optional, default None
1413
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1414
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1415
+ """
1416
+ ...
1417
+
1418
+ @typing.overload
1419
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1420
+ """
1421
+ Specifies the PyPI packages for all steps of the flow.
1422
+
1423
+ Use `@pypi_base` to set common packages required by all
1424
+ steps and use `@pypi` to specify step-specific overrides.
1425
+
1426
+ Parameters
1427
+ ----------
1428
+ packages : Dict[str, str], default: {}
1429
+ Packages to use for this flow. The key is the name of the package
1430
+ and the value is the version to use.
1431
+ python : str, optional, default: None
1432
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1433
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1434
+ """
1435
+ ...
1436
+
1437
+ @typing.overload
1438
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1439
+ ...
1440
+
1441
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1442
+ """
1443
+ Specifies the PyPI packages for all steps of the flow.
1444
+
1445
+ Use `@pypi_base` to set common packages required by all
1446
+ steps and use `@pypi` to specify step-specific overrides.
1447
+
1448
+ Parameters
1449
+ ----------
1450
+ packages : Dict[str, str], default: {}
1451
+ Packages to use for this flow. The key is the name of the package
1452
+ and the value is the version to use.
1453
+ python : str, optional, default: None
1454
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1455
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1456
+ """
1457
+ ...
1458
+
1387
1459
  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]]:
1388
1460
  """
1389
1461
  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.
@@ -1427,5 +1499,48 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
1427
1499
  """
1428
1500
  ...
1429
1501
 
1502
+ 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]]:
1503
+ """
1504
+ 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)
1505
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1506
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1507
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1508
+ starts only after all sensors finish.
1509
+
1510
+
1511
+ Parameters
1512
+ ----------
1513
+ timeout : int
1514
+ Time, in seconds before the task times out and fails. (Default: 3600)
1515
+ poke_interval : int
1516
+ Time in seconds that the job should wait in between each try. (Default: 60)
1517
+ mode : str
1518
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1519
+ exponential_backoff : bool
1520
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1521
+ pool : str
1522
+ the slot pool this task should run in,
1523
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1524
+ soft_fail : bool
1525
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1526
+ name : str
1527
+ Name of the sensor on Airflow
1528
+ description : str
1529
+ Description of sensor in the Airflow UI
1530
+ bucket_key : Union[str, List[str]]
1531
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1532
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1533
+ bucket_name : str
1534
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1535
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1536
+ wildcard_match : bool
1537
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1538
+ aws_conn_id : str
1539
+ a reference to the s3 connection on Airflow. (Default: None)
1540
+ verify : bool
1541
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1542
+ """
1543
+ ...
1544
+
1430
1545
  pkg_name: str
1431
1546