ob-metaflow-stubs 6.0.3.177__py2.py3-none-any.whl → 6.0.3.178__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 (215) hide show
  1. metaflow-stubs/__init__.pyi +511 -507
  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 +26 -26
  8. metaflow-stubs/client/filecache.pyi +3 -3
  9. metaflow-stubs/events.pyi +6 -6
  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 +4 -4
  14. metaflow-stubs/info_file.pyi +2 -2
  15. metaflow-stubs/metadata_provider/__init__.pyi +2 -2
  16. metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
  17. metaflow-stubs/metadata_provider/metadata.pyi +2 -2
  18. metaflow-stubs/metadata_provider/util.pyi +2 -2
  19. metaflow-stubs/metaflow_config.pyi +4 -2
  20. metaflow-stubs/metaflow_current.pyi +133 -133
  21. metaflow-stubs/metaflow_git.pyi +2 -2
  22. metaflow-stubs/mf_extensions/__init__.pyi +2 -2
  23. metaflow-stubs/mf_extensions/obcheckpoint/__init__.pyi +2 -2
  24. metaflow-stubs/mf_extensions/obcheckpoint/plugins/__init__.pyi +2 -2
  25. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/__init__.pyi +2 -2
  26. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/__init__.pyi +2 -2
  27. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/async_cards.pyi +2 -2
  28. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/deco_injection_mixin.pyi +2 -2
  29. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/extra_components.pyi +3 -3
  30. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/__init__.pyi +2 -2
  31. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/__init__.pyi +2 -2
  32. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/checkpoint_lister.pyi +3 -3
  33. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/lineage_card.pyi +2 -2
  34. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/checkpoint_storage.pyi +4 -4
  35. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/constructors.pyi +2 -2
  36. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/core.pyi +4 -4
  37. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/decorator.pyi +3 -3
  38. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/exceptions.pyi +2 -2
  39. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/final_api.pyi +3 -3
  40. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/lineage.pyi +2 -2
  41. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/__init__.pyi +2 -2
  42. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/context.pyi +4 -4
  43. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/core.pyi +4 -4
  44. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/decorator.pyi +2 -2
  45. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/exceptions.pyi +2 -2
  46. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/task_utils.pyi +3 -3
  47. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi +2 -2
  48. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi +4 -4
  49. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/exceptions.pyi +2 -2
  50. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/__init__.pyi +2 -2
  51. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/decorator.pyi +3 -3
  52. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/__init__.pyi +2 -2
  53. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/core.pyi +3 -3
  54. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/exceptions.pyi +2 -2
  55. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/model_storage.pyi +3 -3
  56. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/__init__.pyi +2 -2
  57. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/flowspec_utils.pyi +2 -2
  58. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/general.pyi +2 -2
  59. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/identity_utils.pyi +3 -3
  60. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/__init__.pyi +2 -2
  61. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/base.pyi +2 -2
  62. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/tar.pyi +2 -2
  63. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +2 -2
  64. metaflow-stubs/mf_extensions/outerbounds/__init__.pyi +2 -2
  65. metaflow-stubs/mf_extensions/outerbounds/plugins/__init__.pyi +2 -2
  66. metaflow-stubs/mf_extensions/outerbounds/plugins/aws/__init__.pyi +2 -2
  67. metaflow-stubs/mf_extensions/outerbounds/plugins/aws/assume_role_decorator.pyi +2 -2
  68. metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/__init__.pyi +2 -2
  69. metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/async_cards.pyi +3 -3
  70. metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/injector.pyi +2 -2
  71. metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/__init__.pyi +2 -2
  72. metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/coreweave.pyi +2 -2
  73. metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/nebius.pyi +2 -2
  74. metaflow-stubs/mf_extensions/outerbounds/plugins/kubernetes/__init__.pyi +2 -2
  75. metaflow-stubs/mf_extensions/outerbounds/plugins/kubernetes/pod_killer.pyi +2 -2
  76. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/__init__.pyi +2 -2
  77. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/constants.pyi +2 -2
  78. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/exceptions.pyi +2 -2
  79. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/ollama.pyi +2 -2
  80. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/status_card.pyi +2 -2
  81. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/__init__.pyi +2 -2
  82. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/snowflake.pyi +2 -2
  83. metaflow-stubs/mf_extensions/outerbounds/profilers/__init__.pyi +2 -2
  84. metaflow-stubs/mf_extensions/outerbounds/profilers/gpu.pyi +2 -2
  85. metaflow-stubs/mf_extensions/outerbounds/remote_config.pyi +2 -2
  86. metaflow-stubs/mf_extensions/outerbounds/toplevel/__init__.pyi +2 -2
  87. metaflow-stubs/mf_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.pyi +2 -2
  88. metaflow-stubs/multicore_utils.pyi +2 -2
  89. metaflow-stubs/parameters.pyi +5 -5
  90. metaflow-stubs/plugins/__init__.pyi +10 -10
  91. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  92. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  93. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  94. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  95. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  96. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
  97. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
  98. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  99. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  100. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  101. metaflow-stubs/plugins/argo/argo_workflows.pyi +4 -2
  102. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
  103. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
  104. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -5
  105. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  106. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  107. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  108. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  109. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  110. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  111. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  112. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  113. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
  114. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  115. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  116. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  117. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  118. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  119. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +3 -3
  120. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +3 -3
  121. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  122. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  123. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  124. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +3 -3
  125. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  126. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  127. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  128. metaflow-stubs/plugins/cards/__init__.pyi +6 -6
  129. metaflow-stubs/plugins/cards/card_client.pyi +2 -2
  130. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  131. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  132. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  133. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  134. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  135. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  136. metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
  137. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  138. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  139. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  140. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  141. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  142. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  143. metaflow-stubs/plugins/catch_decorator.pyi +3 -3
  144. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  145. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  146. metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
  147. metaflow-stubs/plugins/datatools/s3/s3.pyi +14 -14
  148. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  149. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  150. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  151. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  152. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  153. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  154. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  155. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  156. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  157. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
  158. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  159. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  160. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  161. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  162. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  163. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
  164. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +4 -4
  165. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  166. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +8 -2
  167. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  168. metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
  169. metaflow-stubs/plugins/ollama/__init__.pyi +2 -2
  170. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  171. metaflow-stubs/plugins/perimeters.pyi +2 -2
  172. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  173. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  174. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  175. metaflow-stubs/plugins/pypi/conda_environment.pyi +3 -3
  176. metaflow-stubs/plugins/pypi/parsers.pyi +2 -2
  177. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  178. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  179. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  180. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  181. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  182. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  183. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
  184. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  185. metaflow-stubs/plugins/snowflake/__init__.pyi +2 -2
  186. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  187. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  188. metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
  189. metaflow-stubs/plugins/torchtune/__init__.pyi +2 -2
  190. metaflow-stubs/plugins/uv/__init__.pyi +2 -2
  191. metaflow-stubs/plugins/uv/uv_environment.pyi +2 -2
  192. metaflow-stubs/profilers/__init__.pyi +2 -2
  193. metaflow-stubs/pylint_wrapper.pyi +2 -2
  194. metaflow-stubs/runner/__init__.pyi +2 -2
  195. metaflow-stubs/runner/deployer.pyi +32 -29
  196. metaflow-stubs/runner/deployer_impl.pyi +6 -3
  197. metaflow-stubs/runner/metaflow_runner.pyi +6 -3
  198. metaflow-stubs/runner/nbdeploy.pyi +2 -2
  199. metaflow-stubs/runner/nbrun.pyi +2 -2
  200. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  201. metaflow-stubs/runner/utils.pyi +5 -2
  202. metaflow-stubs/system/__init__.pyi +2 -2
  203. metaflow-stubs/system/system_logger.pyi +2 -2
  204. metaflow-stubs/system/system_monitor.pyi +2 -2
  205. metaflow-stubs/tagging_util.pyi +2 -2
  206. metaflow-stubs/tuple_util.pyi +2 -2
  207. metaflow-stubs/user_configs/__init__.pyi +2 -2
  208. metaflow-stubs/user_configs/config_decorators.pyi +7 -7
  209. metaflow-stubs/user_configs/config_options.pyi +3 -3
  210. metaflow-stubs/user_configs/config_parameters.pyi +79 -19
  211. {ob_metaflow_stubs-6.0.3.177.dist-info → ob_metaflow_stubs-6.0.3.178.dist-info}/METADATA +1 -1
  212. ob_metaflow_stubs-6.0.3.178.dist-info/RECORD +215 -0
  213. ob_metaflow_stubs-6.0.3.177.dist-info/RECORD +0 -215
  214. {ob_metaflow_stubs-6.0.3.177.dist-info → ob_metaflow_stubs-6.0.3.178.dist-info}/WHEEL +0 -0
  215. {ob_metaflow_stubs-6.0.3.177.dist-info → ob_metaflow_stubs-6.0.3.178.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.15.14.1+obcheckpoint(0.2.1);ob(v1) #
4
- # Generated on 2025-06-10T19:56:51.889454 #
3
+ # MF version: 2.15.17.1+obcheckpoint(0.2.1);ob(v1) #
4
+ # Generated on 2025-06-13T18:34:09.309751 #
5
5
  ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -35,17 +35,17 @@ from .user_configs.config_parameters import ConfigValue as ConfigValue
35
35
  from .user_configs.config_parameters import config_expr as config_expr
36
36
  from .user_configs.config_decorators import CustomFlowDecorator as CustomFlowDecorator
37
37
  from .user_configs.config_decorators import CustomStepDecorator as CustomStepDecorator
38
- from . import cards as cards
39
38
  from . import tuple_util as tuple_util
40
- from . import metaflow_git as metaflow_git
39
+ from . import cards as cards
41
40
  from . import events as events
41
+ from . import metaflow_git as metaflow_git
42
42
  from . import runner as runner
43
43
  from . import plugins as plugins
44
44
  from .mf_extensions.outerbounds.toplevel.global_aliases_for_metaflow_package import S3 as S3
45
45
  from . import includefile as includefile
46
46
  from .includefile import IncludeFile as IncludeFile
47
- from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
48
47
  from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
48
+ from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
49
49
  from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
50
50
  from . import client as client
51
51
  from .client.core import namespace as namespace
@@ -154,74 +154,6 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
154
154
  """
155
155
  ...
156
156
 
157
- @typing.overload
158
- 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]]]:
159
- """
160
- Creates a human-readable report, a Metaflow Card, after this step completes.
161
-
162
- Note that you may add multiple `@card` decorators in a step with different parameters.
163
-
164
-
165
- Parameters
166
- ----------
167
- type : str, default 'default'
168
- Card type.
169
- id : str, optional, default None
170
- If multiple cards are present, use this id to identify this card.
171
- options : Dict[str, Any], default {}
172
- Options passed to the card. The contents depend on the card type.
173
- timeout : int, default 45
174
- Interrupt reporting if it takes more than this many seconds.
175
- """
176
- ...
177
-
178
- @typing.overload
179
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
180
- ...
181
-
182
- @typing.overload
183
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
184
- ...
185
-
186
- 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):
187
- """
188
- Creates a human-readable report, a Metaflow Card, after this step completes.
189
-
190
- Note that you may add multiple `@card` decorators in a step with different parameters.
191
-
192
-
193
- Parameters
194
- ----------
195
- type : str, default 'default'
196
- Card type.
197
- id : str, optional, default None
198
- If multiple cards are present, use this id to identify this card.
199
- options : Dict[str, Any], default {}
200
- Options passed to the card. The contents depend on the card type.
201
- timeout : int, default 45
202
- Interrupt reporting if it takes more than this many seconds.
203
- """
204
- ...
205
-
206
- @typing.overload
207
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
208
- """
209
- Decorator prototype for all step decorators. This function gets specialized
210
- and imported for all decorators types by _import_plugin_decorators().
211
- """
212
- ...
213
-
214
- @typing.overload
215
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
216
- ...
217
-
218
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
219
- """
220
- Decorator prototype for all step decorators. This function gets specialized
221
- and imported for all decorators types by _import_plugin_decorators().
222
- """
223
- ...
224
-
225
157
  @typing.overload
226
158
  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]]]:
227
159
  """
@@ -281,184 +213,20 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
281
213
  """
282
214
  ...
283
215
 
284
- def nvct(*, gpu: int, gpu_type: str) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
285
- """
286
- Specifies that this step should execute on DGX cloud.
287
-
288
-
289
- Parameters
290
- ----------
291
- gpu : int
292
- Number of GPUs to use.
293
- gpu_type : str
294
- Type of Nvidia GPU to use.
295
- """
296
- ...
297
-
298
- def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[str] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable', security_context: typing.Optional[typing.Dict[str, typing.Any]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
299
- """
300
- Specifies that this step should execute on Kubernetes.
301
-
302
-
303
- Parameters
304
- ----------
305
- cpu : int, default 1
306
- Number of CPUs required for this step. If `@resources` is
307
- also present, the maximum value from all decorators is used.
308
- memory : int, default 4096
309
- Memory size (in MB) required for this step. If
310
- `@resources` is also present, the maximum value from all decorators is
311
- used.
312
- disk : int, default 10240
313
- Disk size (in MB) required for this step. If
314
- `@resources` is also present, the maximum value from all decorators is
315
- used.
316
- image : str, optional, default None
317
- Docker image to use when launching on Kubernetes. If not specified, and
318
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
319
- not, a default Docker image mapping to the current version of Python is used.
320
- image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
321
- If given, the imagePullPolicy to be applied to the Docker image of the step.
322
- service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
323
- Kubernetes service account to use when launching pod in Kubernetes.
324
- secrets : List[str], optional, default None
325
- Kubernetes secrets to use when launching pod in Kubernetes. These
326
- secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
327
- in Metaflow configuration.
328
- node_selector: Union[Dict[str,str], str], optional, default None
329
- Kubernetes node selector(s) to apply to the pod running the task.
330
- Can be passed in as a comma separated string of values e.g.
331
- 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
332
- {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
333
- namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
334
- Kubernetes namespace to use when launching pod in Kubernetes.
335
- gpu : int, optional, default None
336
- Number of GPUs required for this step. A value of zero implies that
337
- the scheduled node should not have GPUs.
338
- gpu_vendor : str, default KUBERNETES_GPU_VENDOR
339
- The vendor of the GPUs to be used for this step.
340
- tolerations : List[str], default []
341
- The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
342
- Kubernetes tolerations to use when launching pod in Kubernetes.
343
- labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
344
- Kubernetes labels to use when launching pod in Kubernetes.
345
- annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
346
- Kubernetes annotations to use when launching pod in Kubernetes.
347
- use_tmpfs : bool, default False
348
- This enables an explicit tmpfs mount for this step.
349
- tmpfs_tempdir : bool, default True
350
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
351
- tmpfs_size : int, optional, default: None
352
- The value for the size (in MiB) of the tmpfs mount for this step.
353
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
354
- memory allocated for this step.
355
- tmpfs_path : str, optional, default /metaflow_temp
356
- Path to tmpfs mount for this step.
357
- persistent_volume_claims : Dict[str, str], optional, default None
358
- A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
359
- volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
360
- shared_memory: int, optional
361
- Shared memory size (in MiB) required for this step
362
- port: int, optional
363
- Port number to specify in the Kubernetes job object
364
- compute_pool : str, optional, default None
365
- Compute pool to be used for for this step.
366
- If not specified, any accessible compute pool within the perimeter is used.
367
- hostname_resolution_timeout: int, default 10 * 60
368
- Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
369
- Only applicable when @parallel is used.
370
- qos: str, default: Burstable
371
- Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
372
-
373
- security_context: Dict[str, Any], optional, default None
374
- Container security context. Applies to the task container. Allows the following keys:
375
- - privileged: bool, optional, default None
376
- - allow_privilege_escalation: bool, optional, default None
377
- - run_as_user: int, optional, default None
378
- - run_as_group: int, optional, default None
379
- - run_as_non_root: bool, optional, default None
380
- """
381
- ...
382
-
383
216
  @typing.overload
384
- 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]]]:
217
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
385
218
  """
386
- Enables checkpointing for a step.
387
-
388
-
389
-
390
- Parameters
391
- ----------
392
- load_policy : str, default: "fresh"
393
- The policy for loading the checkpoint. The following policies are supported:
394
- - "eager": Loads the the latest available checkpoint within the namespace.
395
- With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
396
- will be loaded at the start of the task.
397
- - "none": Do not load any checkpoint
398
- - "fresh": Loads the lastest checkpoint created within the running Task.
399
- This mode helps loading checkpoints across various retry attempts of the same task.
400
- With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
401
- created within the task will be loaded when the task is retries execution on failure.
402
-
403
- temp_dir_root : str, default: None
404
- The root directory under which `current.checkpoint.directory` will be created.
219
+ Internal decorator to support Fast bakery
405
220
  """
406
221
  ...
407
222
 
408
223
  @typing.overload
409
- def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
410
- ...
411
-
412
- @typing.overload
413
- def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
414
- ...
415
-
416
- 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):
417
- """
418
- Enables checkpointing for a step.
419
-
420
-
421
-
422
- Parameters
423
- ----------
424
- load_policy : str, default: "fresh"
425
- The policy for loading the checkpoint. The following policies are supported:
426
- - "eager": Loads the the latest available checkpoint within the namespace.
427
- With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
428
- will be loaded at the start of the task.
429
- - "none": Do not load any checkpoint
430
- - "fresh": Loads the lastest checkpoint created within the running Task.
431
- This mode helps loading checkpoints across various retry attempts of the same task.
432
- With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
433
- created within the task will be loaded when the task is retries execution on failure.
434
-
435
- temp_dir_root : str, default: None
436
- The root directory under which `current.checkpoint.directory` will be created.
437
- """
224
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
438
225
  ...
439
226
 
440
- 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]]]:
227
+ def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
441
228
  """
442
- Decorator that helps cache, version and store models/datasets from huggingface hub.
443
-
444
-
445
- Parameters
446
- ----------
447
- temp_dir_root : str, optional
448
- The root directory that will hold the temporary directory where objects will be downloaded.
449
-
450
- load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
451
- The list of repos (models/datasets) to load.
452
-
453
- Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
454
-
455
- - If repo (model/dataset) is not found in the datastore:
456
- - Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
457
- - Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
458
- - All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
459
-
460
- - If repo is found in the datastore:
461
- - Loads it directly from datastore to local path (can be temporary directory or specified path)
229
+ Internal decorator to support Fast bakery
462
230
  """
463
231
  ...
464
232
 
@@ -541,73 +309,126 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
541
309
  """
542
310
  ...
543
311
 
544
- 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]]]:
312
+ @typing.overload
313
+ 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]]]:
545
314
  """
546
- Specifies that this step is used to deploy an instance of the app.
547
- Requires that self.app_name, self.app_port, self.entrypoint and self.deployDir is set.
315
+ Specifies secrets to be retrieved and injected as environment variables prior to
316
+ the execution of a step.
548
317
 
549
318
 
550
319
  Parameters
551
320
  ----------
552
- app_port : int
553
- Number of GPUs to use.
554
- app_name : str
555
- Name of the app to deploy.
321
+ sources : List[Union[str, Dict[str, Any]]], default: []
322
+ List of secret specs, defining how the secrets are to be retrieved
556
323
  """
557
324
  ...
558
325
 
559
326
  @typing.overload
560
- def retry(*, times: int = 3, minutes_between_retries: int = 2) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
327
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
328
+ ...
329
+
330
+ @typing.overload
331
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
332
+ ...
333
+
334
+ 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]]] = []):
561
335
  """
562
- Specifies the number of times the task corresponding
563
- to a step needs to be retried.
336
+ Specifies secrets to be retrieved and injected as environment variables prior to
337
+ the execution of a step.
564
338
 
565
- This decorator is useful for handling transient errors, such as networking issues.
566
- If your task contains operations that can't be retried safely, e.g. database updates,
567
- it is advisable to annotate it with `@retry(times=0)`.
568
339
 
569
- This can be used in conjunction with the `@catch` decorator. The `@catch`
570
- decorator will execute a no-op task after all retries have been exhausted,
571
- ensuring that the flow execution can continue.
340
+ Parameters
341
+ ----------
342
+ sources : List[Union[str, Dict[str, Any]]], default: []
343
+ List of secret specs, defining how the secrets are to be retrieved
344
+ """
345
+ ...
346
+
347
+ @typing.overload
348
+ 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]]]:
349
+ """
350
+ Enables loading / saving of models within a step.
351
+
572
352
 
573
353
 
574
354
  Parameters
575
355
  ----------
576
- times : int, default 3
577
- Number of times to retry this task.
578
- minutes_between_retries : int, default 2
579
- Number of minutes between retries.
356
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
357
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
358
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
359
+ - `current.checkpoint`
360
+ - `current.model`
361
+ - `current.huggingface_hub`
362
+
363
+ 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
364
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
365
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
366
+
367
+ temp_dir_root : str, default: None
368
+ The root directory under which `current.model.loaded` will store loaded models
580
369
  """
581
370
  ...
582
371
 
583
372
  @typing.overload
584
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
373
+ def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
585
374
  ...
586
375
 
587
376
  @typing.overload
588
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
377
+ def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
589
378
  ...
590
379
 
591
- def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
380
+ 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):
592
381
  """
593
- Specifies the number of times the task corresponding
594
- to a step needs to be retried.
382
+ Enables loading / saving of models within a step.
595
383
 
596
- This decorator is useful for handling transient errors, such as networking issues.
597
- If your task contains operations that can't be retried safely, e.g. database updates,
598
- it is advisable to annotate it with `@retry(times=0)`.
599
384
 
600
- This can be used in conjunction with the `@catch` decorator. The `@catch`
601
- decorator will execute a no-op task after all retries have been exhausted,
602
- ensuring that the flow execution can continue.
385
+
386
+ Parameters
387
+ ----------
388
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
389
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
390
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
391
+ - `current.checkpoint`
392
+ - `current.model`
393
+ - `current.huggingface_hub`
394
+
395
+ 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
396
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
397
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
398
+
399
+ temp_dir_root : str, default: None
400
+ The root directory under which `current.model.loaded` will store loaded models
401
+ """
402
+ ...
403
+
404
+ 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]]]:
405
+ """
406
+ Specifies that this step is used to deploy an instance of the app.
407
+ Requires that self.app_name, self.app_port, self.entrypoint and self.deployDir is set.
603
408
 
604
409
 
605
410
  Parameters
606
411
  ----------
607
- times : int, default 3
608
- Number of times to retry this task.
609
- minutes_between_retries : int, default 2
610
- Number of minutes between retries.
412
+ app_port : int
413
+ Number of GPUs to use.
414
+ app_name : str
415
+ Name of the app to deploy.
416
+ """
417
+ ...
418
+
419
+ 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]]]:
420
+ """
421
+ Specifies that this step should execute on DGX cloud.
422
+
423
+
424
+ Parameters
425
+ ----------
426
+ gpu : int
427
+ Number of GPUs to use.
428
+ gpu_type : str
429
+ Type of Nvidia GPU to use.
430
+ queue_timeout : int
431
+ Time to keep the job in NVCF's queue.
611
432
  """
612
433
  ...
613
434
 
@@ -655,54 +476,235 @@ def ollama(*, models: list, backend: str, force_pull: bool, cache_update_policy:
655
476
  ...
656
477
 
657
478
  @typing.overload
658
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
479
+ 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]]]:
659
480
  """
660
- Internal decorator to support Fast bakery
481
+ Creates a human-readable report, a Metaflow Card, after this step completes.
482
+
483
+ Note that you may add multiple `@card` decorators in a step with different parameters.
484
+
485
+
486
+ Parameters
487
+ ----------
488
+ type : str, default 'default'
489
+ Card type.
490
+ id : str, optional, default None
491
+ If multiple cards are present, use this id to identify this card.
492
+ options : Dict[str, Any], default {}
493
+ Options passed to the card. The contents depend on the card type.
494
+ timeout : int, default 45
495
+ Interrupt reporting if it takes more than this many seconds.
661
496
  """
662
497
  ...
663
498
 
664
499
  @typing.overload
665
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
500
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
666
501
  ...
667
502
 
668
- def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
503
+ @typing.overload
504
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
505
+ ...
506
+
507
+ 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):
669
508
  """
670
- Internal decorator to support Fast bakery
509
+ Creates a human-readable report, a Metaflow Card, after this step completes.
510
+
511
+ Note that you may add multiple `@card` decorators in a step with different parameters.
512
+
513
+
514
+ Parameters
515
+ ----------
516
+ type : str, default 'default'
517
+ Card type.
518
+ id : str, optional, default None
519
+ If multiple cards are present, use this id to identify this card.
520
+ options : Dict[str, Any], default {}
521
+ Options passed to the card. The contents depend on the card type.
522
+ timeout : int, default 45
523
+ Interrupt reporting if it takes more than this many seconds.
524
+ """
525
+ ...
526
+
527
+ 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]]]:
528
+ """
529
+ Decorator that helps cache, version and store models/datasets from huggingface hub.
530
+
531
+
532
+ Parameters
533
+ ----------
534
+ temp_dir_root : str, optional
535
+ The root directory that will hold the temporary directory where objects will be downloaded.
536
+
537
+ load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
538
+ The list of repos (models/datasets) to load.
539
+
540
+ Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
541
+
542
+ - If repo (model/dataset) is not found in the datastore:
543
+ - Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
544
+ - Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
545
+ - All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
546
+
547
+ - If repo is found in the datastore:
548
+ - Loads it directly from datastore to local path (can be temporary directory or specified path)
671
549
  """
672
550
  ...
673
551
 
674
552
  @typing.overload
675
- 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]]]:
553
+ 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]]]:
676
554
  """
677
- Specifies secrets to be retrieved and injected as environment variables prior to
678
- the execution of a step.
555
+ Specifies environment variables to be set prior to the execution of a step.
679
556
 
680
557
 
681
558
  Parameters
682
559
  ----------
683
- sources : List[Union[str, Dict[str, Any]]], default: []
684
- List of secret specs, defining how the secrets are to be retrieved
560
+ vars : Dict[str, str], default {}
561
+ Dictionary of environment variables to set.
685
562
  """
686
563
  ...
687
564
 
688
565
  @typing.overload
689
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
566
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
690
567
  ...
691
568
 
692
569
  @typing.overload
693
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
570
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
694
571
  ...
695
572
 
696
- 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]]] = []):
573
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
697
574
  """
698
- Specifies secrets to be retrieved and injected as environment variables prior to
699
- the execution of a step.
575
+ Specifies environment variables to be set prior to the execution of a step.
700
576
 
701
577
 
702
578
  Parameters
703
579
  ----------
704
- sources : List[Union[str, Dict[str, Any]]], default: []
705
- List of secret specs, defining how the secrets are to be retrieved
580
+ vars : Dict[str, str], default {}
581
+ Dictionary of environment variables to set.
582
+ """
583
+ ...
584
+
585
+ @typing.overload
586
+ 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]]]:
587
+ """
588
+ Enables checkpointing for a step.
589
+
590
+
591
+
592
+ Parameters
593
+ ----------
594
+ load_policy : str, default: "fresh"
595
+ The policy for loading the checkpoint. The following policies are supported:
596
+ - "eager": Loads the the latest available checkpoint within the namespace.
597
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
598
+ will be loaded at the start of the task.
599
+ - "none": Do not load any checkpoint
600
+ - "fresh": Loads the lastest checkpoint created within the running Task.
601
+ This mode helps loading checkpoints across various retry attempts of the same task.
602
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
603
+ created within the task will be loaded when the task is retries execution on failure.
604
+
605
+ temp_dir_root : str, default: None
606
+ The root directory under which `current.checkpoint.directory` will be created.
607
+ """
608
+ ...
609
+
610
+ @typing.overload
611
+ def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
612
+ ...
613
+
614
+ @typing.overload
615
+ def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
616
+ ...
617
+
618
+ 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):
619
+ """
620
+ Enables checkpointing for a step.
621
+
622
+
623
+
624
+ Parameters
625
+ ----------
626
+ load_policy : str, default: "fresh"
627
+ The policy for loading the checkpoint. The following policies are supported:
628
+ - "eager": Loads the the latest available checkpoint within the namespace.
629
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
630
+ will be loaded at the start of the task.
631
+ - "none": Do not load any checkpoint
632
+ - "fresh": Loads the lastest checkpoint created within the running Task.
633
+ This mode helps loading checkpoints across various retry attempts of the same task.
634
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
635
+ created within the task will be loaded when the task is retries execution on failure.
636
+
637
+ temp_dir_root : str, default: None
638
+ The root directory under which `current.checkpoint.directory` will be created.
639
+ """
640
+ ...
641
+
642
+ def nvct(*, gpu: int, gpu_type: str) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
643
+ """
644
+ Specifies that this step should execute on DGX cloud.
645
+
646
+
647
+ Parameters
648
+ ----------
649
+ gpu : int
650
+ Number of GPUs to use.
651
+ gpu_type : str
652
+ Type of Nvidia GPU to use.
653
+ """
654
+ ...
655
+
656
+ @typing.overload
657
+ def retry(*, times: int = 3, minutes_between_retries: int = 2) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
658
+ """
659
+ Specifies the number of times the task corresponding
660
+ to a step needs to be retried.
661
+
662
+ This decorator is useful for handling transient errors, such as networking issues.
663
+ If your task contains operations that can't be retried safely, e.g. database updates,
664
+ it is advisable to annotate it with `@retry(times=0)`.
665
+
666
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
667
+ decorator will execute a no-op task after all retries have been exhausted,
668
+ ensuring that the flow execution can continue.
669
+
670
+
671
+ Parameters
672
+ ----------
673
+ times : int, default 3
674
+ Number of times to retry this task.
675
+ minutes_between_retries : int, default 2
676
+ Number of minutes between retries.
677
+ """
678
+ ...
679
+
680
+ @typing.overload
681
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
682
+ ...
683
+
684
+ @typing.overload
685
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
686
+ ...
687
+
688
+ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
689
+ """
690
+ Specifies the number of times the task corresponding
691
+ to a step needs to be retried.
692
+
693
+ This decorator is useful for handling transient errors, such as networking issues.
694
+ If your task contains operations that can't be retried safely, e.g. database updates,
695
+ it is advisable to annotate it with `@retry(times=0)`.
696
+
697
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
698
+ decorator will execute a no-op task after all retries have been exhausted,
699
+ ensuring that the flow execution can continue.
700
+
701
+
702
+ Parameters
703
+ ----------
704
+ times : int, default 3
705
+ Number of times to retry this task.
706
+ minutes_between_retries : int, default 2
707
+ Number of minutes between retries.
706
708
  """
707
709
  ...
708
710
 
@@ -757,6 +759,25 @@ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
757
759
  """
758
760
  ...
759
761
 
762
+ @typing.overload
763
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
764
+ """
765
+ Decorator prototype for all step decorators. This function gets specialized
766
+ and imported for all decorators types by _import_plugin_decorators().
767
+ """
768
+ ...
769
+
770
+ @typing.overload
771
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
772
+ ...
773
+
774
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
775
+ """
776
+ Decorator prototype for all step decorators. This function gets specialized
777
+ and imported for all decorators types by _import_plugin_decorators().
778
+ """
779
+ ...
780
+
760
781
  @typing.overload
761
782
  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]]]:
762
783
  """
@@ -808,109 +829,92 @@ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
808
829
  """
809
830
  ...
810
831
 
811
- @typing.overload
812
- 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]]]:
813
- """
814
- Specifies environment variables to be set prior to the execution of a step.
815
-
816
-
817
- Parameters
818
- ----------
819
- vars : Dict[str, str], default {}
820
- Dictionary of environment variables to set.
821
- """
822
- ...
823
-
824
- @typing.overload
825
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
826
- ...
827
-
828
- @typing.overload
829
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
830
- ...
831
-
832
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
833
- """
834
- Specifies environment variables to be set prior to the execution of a step.
835
-
836
-
837
- Parameters
838
- ----------
839
- vars : Dict[str, str], default {}
840
- Dictionary of environment variables to set.
841
- """
842
- ...
843
-
844
- @typing.overload
845
- 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]]]:
846
- """
847
- Enables loading / saving of models within a step.
848
-
849
-
850
-
851
- Parameters
852
- ----------
853
- load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
854
- Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
855
- These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
856
- - `current.checkpoint`
857
- - `current.model`
858
- - `current.huggingface_hub`
859
-
860
- 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
861
- the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
862
- If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
863
-
864
- temp_dir_root : str, default: None
865
- The root directory under which `current.model.loaded` will store loaded models
866
- """
867
- ...
868
-
869
- @typing.overload
870
- def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
871
- ...
872
-
873
- @typing.overload
874
- def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
875
- ...
876
-
877
- 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):
832
+ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', image_pull_secrets: typing.List[str] = [], service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[str] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable', security_context: typing.Optional[typing.Dict[str, typing.Any]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
878
833
  """
879
- Enables loading / saving of models within a step.
880
-
834
+ Specifies that this step should execute on Kubernetes.
881
835
 
882
836
 
883
837
  Parameters
884
838
  ----------
885
- load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
886
- Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
887
- These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
888
- - `current.checkpoint`
889
- - `current.model`
890
- - `current.huggingface_hub`
891
-
892
- 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
893
- the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
894
- If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
895
-
896
- temp_dir_root : str, default: None
897
- The root directory under which `current.model.loaded` will store loaded models
898
- """
899
- ...
900
-
901
- 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]]]:
902
- """
903
- Specifies that this step should execute on DGX cloud.
904
-
839
+ cpu : int, default 1
840
+ Number of CPUs required for this step. If `@resources` is
841
+ also present, the maximum value from all decorators is used.
842
+ memory : int, default 4096
843
+ Memory size (in MB) required for this step. If
844
+ `@resources` is also present, the maximum value from all decorators is
845
+ used.
846
+ disk : int, default 10240
847
+ Disk size (in MB) required for this step. If
848
+ `@resources` is also present, the maximum value from all decorators is
849
+ used.
850
+ image : str, optional, default None
851
+ Docker image to use when launching on Kubernetes. If not specified, and
852
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
853
+ not, a default Docker image mapping to the current version of Python is used.
854
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
855
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
856
+ image_pull_secrets: List[str], default []
857
+ The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
858
+ Kubernetes image pull secrets to use when pulling container images
859
+ in Kubernetes.
860
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
861
+ Kubernetes service account to use when launching pod in Kubernetes.
862
+ secrets : List[str], optional, default None
863
+ Kubernetes secrets to use when launching pod in Kubernetes. These
864
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
865
+ in Metaflow configuration.
866
+ node_selector: Union[Dict[str,str], str], optional, default None
867
+ Kubernetes node selector(s) to apply to the pod running the task.
868
+ Can be passed in as a comma separated string of values e.g.
869
+ 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
870
+ {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
871
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
872
+ Kubernetes namespace to use when launching pod in Kubernetes.
873
+ gpu : int, optional, default None
874
+ Number of GPUs required for this step. A value of zero implies that
875
+ the scheduled node should not have GPUs.
876
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
877
+ The vendor of the GPUs to be used for this step.
878
+ tolerations : List[str], default []
879
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
880
+ Kubernetes tolerations to use when launching pod in Kubernetes.
881
+ labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
882
+ Kubernetes labels to use when launching pod in Kubernetes.
883
+ annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
884
+ Kubernetes annotations to use when launching pod in Kubernetes.
885
+ use_tmpfs : bool, default False
886
+ This enables an explicit tmpfs mount for this step.
887
+ tmpfs_tempdir : bool, default True
888
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
889
+ tmpfs_size : int, optional, default: None
890
+ The value for the size (in MiB) of the tmpfs mount for this step.
891
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
892
+ memory allocated for this step.
893
+ tmpfs_path : str, optional, default /metaflow_temp
894
+ Path to tmpfs mount for this step.
895
+ persistent_volume_claims : Dict[str, str], optional, default None
896
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
897
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
898
+ shared_memory: int, optional
899
+ Shared memory size (in MiB) required for this step
900
+ port: int, optional
901
+ Port number to specify in the Kubernetes job object
902
+ compute_pool : str, optional, default None
903
+ Compute pool to be used for for this step.
904
+ If not specified, any accessible compute pool within the perimeter is used.
905
+ hostname_resolution_timeout: int, default 10 * 60
906
+ Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
907
+ Only applicable when @parallel is used.
908
+ qos: str, default: Burstable
909
+ Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
905
910
 
906
- Parameters
907
- ----------
908
- gpu : int
909
- Number of GPUs to use.
910
- gpu_type : str
911
- Type of Nvidia GPU to use.
912
- queue_timeout : int
913
- Time to keep the job in NVCF's queue.
911
+ security_context: Dict[str, Any], optional, default None
912
+ Container security context. Applies to the task container. Allows the following keys:
913
+ - privileged: bool, optional, default None
914
+ - allow_privilege_escalation: bool, optional, default None
915
+ - run_as_user: int, optional, default None
916
+ - run_as_group: int, optional, default None
917
+ - run_as_non_root: bool, optional, default None
914
918
  """
915
919
  ...
916
920
 
@@ -1087,6 +1091,47 @@ def with_artifact_store(f: typing.Optional[typing.Type[FlowSpecDerived]] = None)
1087
1091
  """
1088
1092
  ...
1089
1093
 
1094
+ @typing.overload
1095
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1096
+ """
1097
+ Specifies the PyPI packages for all steps of the flow.
1098
+
1099
+ Use `@pypi_base` to set common packages required by all
1100
+ steps and use `@pypi` to specify step-specific overrides.
1101
+
1102
+ Parameters
1103
+ ----------
1104
+ packages : Dict[str, str], default: {}
1105
+ Packages to use for this flow. The key is the name of the package
1106
+ and the value is the version to use.
1107
+ python : str, optional, default: None
1108
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1109
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1110
+ """
1111
+ ...
1112
+
1113
+ @typing.overload
1114
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1115
+ ...
1116
+
1117
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1118
+ """
1119
+ Specifies the PyPI packages for all steps of the flow.
1120
+
1121
+ Use `@pypi_base` to set common packages required by all
1122
+ steps and use `@pypi` to specify step-specific overrides.
1123
+
1124
+ Parameters
1125
+ ----------
1126
+ packages : Dict[str, str], default: {}
1127
+ Packages to use for this flow. The key is the name of the package
1128
+ and the value is the version to use.
1129
+ python : str, optional, default: None
1130
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1131
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1132
+ """
1133
+ ...
1134
+
1090
1135
  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]]:
1091
1136
  """
1092
1137
  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)
@@ -1130,38 +1175,54 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
1130
1175
  """
1131
1176
  ...
1132
1177
 
1133
- def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1178
+ @typing.overload
1179
+ def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1134
1180
  """
1135
- Specifies what flows belong to the same project.
1181
+ Specifies the Conda environment for all steps of the flow.
1136
1182
 
1137
- A project-specific namespace is created for all flows that
1138
- use the same `@project(name)`.
1183
+ Use `@conda_base` to set common libraries required by all
1184
+ steps and use `@conda` to specify step-specific additions.
1139
1185
 
1140
1186
 
1141
1187
  Parameters
1142
1188
  ----------
1143
- name : str
1144
- Project name. Make sure that the name is unique amongst all
1145
- projects that use the same production scheduler. The name may
1146
- contain only lowercase alphanumeric characters and underscores.
1189
+ packages : Dict[str, str], default {}
1190
+ Packages to use for this flow. The key is the name of the package
1191
+ and the value is the version to use.
1192
+ libraries : Dict[str, str], default {}
1193
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1194
+ python : str, optional, default None
1195
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1196
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1197
+ disabled : bool, default False
1198
+ If set to True, disables Conda.
1199
+ """
1200
+ ...
1201
+
1202
+ @typing.overload
1203
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1204
+ ...
1205
+
1206
+ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
1207
+ """
1208
+ Specifies the Conda environment for all steps of the flow.
1147
1209
 
1148
- branch : Optional[str], default None
1149
- The branch to use. If not specified, the branch is set to
1150
- `user.<username>` unless `production` is set to `True`. This can
1151
- also be set on the command line using `--branch` as a top-level option.
1152
- It is an error to specify `branch` in the decorator and on the command line.
1210
+ Use `@conda_base` to set common libraries required by all
1211
+ steps and use `@conda` to specify step-specific additions.
1153
1212
 
1154
- production : bool, default False
1155
- Whether or not the branch is the production branch. This can also be set on the
1156
- command line using `--production` as a top-level option. It is an error to specify
1157
- `production` in the decorator and on the command line.
1158
- The project branch name will be:
1159
- - if `branch` is specified:
1160
- - if `production` is True: `prod.<branch>`
1161
- - if `production` is False: `test.<branch>`
1162
- - if `branch` is not specified:
1163
- - if `production` is True: `prod`
1164
- - if `production` is False: `user.<username>`
1213
+
1214
+ Parameters
1215
+ ----------
1216
+ packages : Dict[str, str], default {}
1217
+ Packages to use for this flow. The key is the name of the package
1218
+ and the value is the version to use.
1219
+ libraries : Dict[str, str], default {}
1220
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1221
+ python : str, optional, default None
1222
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1223
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1224
+ disabled : bool, default False
1225
+ If set to True, disables Conda.
1165
1226
  """
1166
1227
  ...
1167
1228
 
@@ -1208,57 +1269,6 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
1208
1269
  """
1209
1270
  ...
1210
1271
 
1211
- @typing.overload
1212
- def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1213
- """
1214
- Specifies the Conda environment for all steps of the flow.
1215
-
1216
- Use `@conda_base` to set common libraries required by all
1217
- steps and use `@conda` to specify step-specific additions.
1218
-
1219
-
1220
- Parameters
1221
- ----------
1222
- packages : Dict[str, str], default {}
1223
- Packages to use for this flow. The key is the name of the package
1224
- and the value is the version to use.
1225
- libraries : Dict[str, str], default {}
1226
- Supported for backward compatibility. When used with packages, packages will take precedence.
1227
- python : str, optional, default None
1228
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1229
- that the version used will correspond to the version of the Python interpreter used to start the run.
1230
- disabled : bool, default False
1231
- If set to True, disables Conda.
1232
- """
1233
- ...
1234
-
1235
- @typing.overload
1236
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1237
- ...
1238
-
1239
- def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
1240
- """
1241
- Specifies the Conda environment for all steps of the flow.
1242
-
1243
- Use `@conda_base` to set common libraries required by all
1244
- steps and use `@conda` to specify step-specific additions.
1245
-
1246
-
1247
- Parameters
1248
- ----------
1249
- packages : Dict[str, str], default {}
1250
- Packages to use for this flow. The key is the name of the package
1251
- and the value is the version to use.
1252
- libraries : Dict[str, str], default {}
1253
- Supported for backward compatibility. When used with packages, packages will take precedence.
1254
- python : str, optional, default None
1255
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1256
- that the version used will correspond to the version of the Python interpreter used to start the run.
1257
- disabled : bool, default False
1258
- If set to True, disables Conda.
1259
- """
1260
- ...
1261
-
1262
1272
  @typing.overload
1263
1273
  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]]:
1264
1274
  """
@@ -1310,6 +1320,41 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
1310
1320
  """
1311
1321
  ...
1312
1322
 
1323
+ def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1324
+ """
1325
+ Specifies what flows belong to the same project.
1326
+
1327
+ A project-specific namespace is created for all flows that
1328
+ use the same `@project(name)`.
1329
+
1330
+
1331
+ Parameters
1332
+ ----------
1333
+ name : str
1334
+ Project name. Make sure that the name is unique amongst all
1335
+ projects that use the same production scheduler. The name may
1336
+ contain only lowercase alphanumeric characters and underscores.
1337
+
1338
+ branch : Optional[str], default None
1339
+ The branch to use. If not specified, the branch is set to
1340
+ `user.<username>` unless `production` is set to `True`. This can
1341
+ also be set on the command line using `--branch` as a top-level option.
1342
+ It is an error to specify `branch` in the decorator and on the command line.
1343
+
1344
+ production : bool, default False
1345
+ Whether or not the branch is the production branch. This can also be set on the
1346
+ command line using `--production` as a top-level option. It is an error to specify
1347
+ `production` in the decorator and on the command line.
1348
+ The project branch name will be:
1349
+ - if `branch` is specified:
1350
+ - if `production` is True: `prod.<branch>`
1351
+ - if `production` is False: `test.<branch>`
1352
+ - if `branch` is not specified:
1353
+ - if `production` is True: `prod`
1354
+ - if `production` is False: `user.<username>`
1355
+ """
1356
+ ...
1357
+
1313
1358
  @typing.overload
1314
1359
  def trigger_on_finish(*, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1315
1360
  """
@@ -1504,46 +1549,5 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1504
1549
  """
1505
1550
  ...
1506
1551
 
1507
- @typing.overload
1508
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1509
- """
1510
- Specifies the PyPI packages for all steps of the flow.
1511
-
1512
- Use `@pypi_base` to set common packages required by all
1513
- steps and use `@pypi` to specify step-specific overrides.
1514
-
1515
- Parameters
1516
- ----------
1517
- packages : Dict[str, str], default: {}
1518
- Packages to use for this flow. The key is the name of the package
1519
- and the value is the version to use.
1520
- python : str, optional, default: None
1521
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1522
- that the version used will correspond to the version of the Python interpreter used to start the run.
1523
- """
1524
- ...
1525
-
1526
- @typing.overload
1527
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1528
- ...
1529
-
1530
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1531
- """
1532
- Specifies the PyPI packages for all steps of the flow.
1533
-
1534
- Use `@pypi_base` to set common packages required by all
1535
- steps and use `@pypi` to specify step-specific overrides.
1536
-
1537
- Parameters
1538
- ----------
1539
- packages : Dict[str, str], default: {}
1540
- Packages to use for this flow. The key is the name of the package
1541
- and the value is the version to use.
1542
- python : str, optional, default: None
1543
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1544
- that the version used will correspond to the version of the Python interpreter used to start the run.
1545
- """
1546
- ...
1547
-
1548
1552
  pkg_name: str
1549
1553