metaflow-stubs 2.18.8__py2.py3-none-any.whl → 2.18.10__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.

Potentially problematic release.


This version of metaflow-stubs might be problematic. Click here for more details.

Files changed (168) hide show
  1. metaflow-stubs/__init__.pyi +644 -643
  2. metaflow-stubs/cards.pyi +5 -2
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/cli_components/__init__.pyi +2 -2
  5. metaflow-stubs/cli_components/utils.pyi +2 -2
  6. metaflow-stubs/client/__init__.pyi +2 -2
  7. metaflow-stubs/client/core.pyi +5 -5
  8. metaflow-stubs/client/filecache.pyi +3 -3
  9. metaflow-stubs/events.pyi +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 +12 -5
  14. metaflow-stubs/meta_files.pyi +2 -2
  15. metaflow-stubs/metadata_provider/__init__.pyi +2 -2
  16. metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
  17. metaflow-stubs/metadata_provider/metadata.pyi +2 -2
  18. metaflow-stubs/metadata_provider/util.pyi +2 -2
  19. metaflow-stubs/metaflow_config.pyi +2 -2
  20. metaflow-stubs/metaflow_current.pyi +23 -23
  21. metaflow-stubs/metaflow_git.pyi +2 -2
  22. metaflow-stubs/multicore_utils.pyi +2 -2
  23. metaflow-stubs/packaging_sys/__init__.pyi +7 -7
  24. metaflow-stubs/packaging_sys/backend.pyi +5 -5
  25. metaflow-stubs/packaging_sys/distribution_support.pyi +3 -3
  26. metaflow-stubs/packaging_sys/tar_backend.pyi +6 -6
  27. metaflow-stubs/packaging_sys/utils.pyi +2 -2
  28. metaflow-stubs/packaging_sys/v1.pyi +2 -2
  29. metaflow-stubs/parameters.pyi +3 -3
  30. metaflow-stubs/plugins/__init__.pyi +13 -12
  31. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  32. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
  33. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  34. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  35. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  36. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  37. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
  38. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
  39. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  40. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  41. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  42. metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -3
  43. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +4 -4
  44. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
  45. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -3
  46. metaflow-stubs/plugins/argo/exit_hooks.pyi +2 -2
  47. metaflow-stubs/plugins/aws/__init__.pyi +3 -3
  48. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  49. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  50. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  51. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  52. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  53. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  54. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  55. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
  56. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  57. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
  58. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  59. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  60. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  61. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  62. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
  63. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +3 -3
  64. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +3 -3
  65. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  66. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  67. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  68. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +4 -4
  69. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  70. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  71. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  72. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  73. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  74. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  75. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  76. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  77. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +3 -2
  78. metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
  79. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  80. metaflow-stubs/plugins/cards/card_modules/components.pyi +166 -2
  81. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  82. metaflow-stubs/plugins/cards/card_modules/json_viewer.pyi +119 -0
  83. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  84. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  85. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  86. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  87. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  88. metaflow-stubs/plugins/catch_decorator.pyi +3 -3
  89. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  90. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  91. metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
  92. metaflow-stubs/plugins/datatools/s3/s3.pyi +3 -3
  93. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  94. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  95. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  96. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  97. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  98. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  99. metaflow-stubs/plugins/exit_hook/__init__.pyi +2 -2
  100. metaflow-stubs/plugins/exit_hook/exit_hook_decorator.pyi +2 -2
  101. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  102. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  103. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  104. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +4 -4
  105. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  106. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  107. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  108. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  109. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  110. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
  111. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  112. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  113. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
  114. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
  115. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  116. metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
  117. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  118. metaflow-stubs/plugins/parsers.pyi +25 -0
  119. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  120. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  121. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  122. metaflow-stubs/plugins/pypi/conda_environment.pyi +6 -6
  123. metaflow-stubs/plugins/pypi/parsers.pyi +2 -2
  124. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  125. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  126. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  127. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  128. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  129. metaflow-stubs/plugins/secrets/__init__.pyi +3 -3
  130. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
  131. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  132. metaflow-stubs/plugins/secrets/secrets_func.pyi +2 -2
  133. metaflow-stubs/plugins/secrets/secrets_spec.pyi +2 -2
  134. metaflow-stubs/plugins/secrets/utils.pyi +2 -2
  135. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  136. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
  137. metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
  138. metaflow-stubs/plugins/uv/__init__.pyi +2 -2
  139. metaflow-stubs/plugins/uv/uv_environment.pyi +2 -2
  140. metaflow-stubs/pylint_wrapper.pyi +2 -2
  141. metaflow-stubs/runner/__init__.pyi +2 -2
  142. metaflow-stubs/runner/deployer.pyi +4 -4
  143. metaflow-stubs/runner/deployer_impl.pyi +3 -3
  144. metaflow-stubs/runner/metaflow_runner.pyi +4 -4
  145. metaflow-stubs/runner/nbdeploy.pyi +2 -2
  146. metaflow-stubs/runner/nbrun.pyi +2 -2
  147. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  148. metaflow-stubs/runner/utils.pyi +4 -4
  149. metaflow-stubs/system/__init__.pyi +2 -2
  150. metaflow-stubs/system/system_logger.pyi +2 -2
  151. metaflow-stubs/system/system_monitor.pyi +2 -2
  152. metaflow-stubs/tagging_util.pyi +2 -2
  153. metaflow-stubs/tuple_util.pyi +2 -2
  154. metaflow-stubs/user_configs/__init__.pyi +2 -2
  155. metaflow-stubs/user_configs/config_options.pyi +2 -2
  156. metaflow-stubs/user_configs/config_parameters.pyi +5 -5
  157. metaflow-stubs/user_decorators/__init__.pyi +2 -2
  158. metaflow-stubs/user_decorators/common.pyi +2 -2
  159. metaflow-stubs/user_decorators/mutable_flow.pyi +5 -5
  160. metaflow-stubs/user_decorators/mutable_step.pyi +5 -5
  161. metaflow-stubs/user_decorators/user_flow_decorator.pyi +3 -3
  162. metaflow-stubs/user_decorators/user_step_decorator.pyi +4 -4
  163. metaflow-stubs/version.pyi +2 -2
  164. {metaflow_stubs-2.18.8.dist-info → metaflow_stubs-2.18.10.dist-info}/METADATA +2 -2
  165. metaflow_stubs-2.18.10.dist-info/RECORD +168 -0
  166. metaflow_stubs-2.18.8.dist-info/RECORD +0 -166
  167. {metaflow_stubs-2.18.8.dist-info → metaflow_stubs-2.18.10.dist-info}/WHEEL +0 -0
  168. {metaflow_stubs-2.18.8.dist-info → metaflow_stubs-2.18.10.dist-info}/top_level.txt +0 -0
@@ -1,15 +1,15 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.18.8 #
4
- # Generated on 2025-09-22T21:43:14.168437 #
3
+ # MF version: 2.18.10 #
4
+ # Generated on 2025-10-02T16:05:06.703542 #
5
5
  ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
- import datetime
12
11
  import typing
12
+ import datetime
13
13
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
14
14
  StepFlag = typing.NewType("StepFlag", bool)
15
15
 
@@ -39,17 +39,18 @@ from .user_decorators.user_step_decorator import UserStepDecorator as UserStepDe
39
39
  from .user_decorators.user_step_decorator import StepMutator as StepMutator
40
40
  from .user_decorators.user_step_decorator import user_step_decorator as user_step_decorator
41
41
  from .user_decorators.user_flow_decorator import FlowMutator as FlowMutator
42
- from . import tuple_util as tuple_util
43
- from . import metaflow_git as metaflow_git
44
42
  from . import events as events
43
+ from . import metaflow_git as metaflow_git
44
+ from . import tuple_util as tuple_util
45
45
  from . import runner as runner
46
46
  from . import plugins as plugins
47
47
  from .plugins.datatools.s3.s3 import S3 as S3
48
48
  from . import includefile as includefile
49
49
  from .includefile import IncludeFile as IncludeFile
50
50
  from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
51
- from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
52
51
  from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
52
+ from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
53
+ from .plugins.parsers import yaml_parser as yaml_parser
53
54
  from . import cards as cards
54
55
  from . import client as client
55
56
  from .client.core import namespace as namespace
@@ -208,67 +209,92 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
208
209
  ...
209
210
 
210
211
  @typing.overload
211
- def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: 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]]]:
212
+ 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]]]:
212
213
  """
213
- Specifies secrets to be retrieved and injected as environment variables prior to
214
- the execution of a step.
214
+ Specifies that the step will success under all circumstances.
215
+
216
+ The decorator will create an optional artifact, specified by `var`, which
217
+ contains the exception raised. You can use it to detect the presence
218
+ of errors, indicating that all happy-path artifacts produced by the step
219
+ are missing.
215
220
 
216
221
 
217
222
  Parameters
218
223
  ----------
219
- sources : List[Union[str, Dict[str, Any]]], default: []
220
- List of secret specs, defining how the secrets are to be retrieved
221
- role : str, optional, default: None
222
- Role to use for fetching secrets
224
+ var : str, optional, default None
225
+ Name of the artifact in which to store the caught exception.
226
+ If not specified, the exception is not stored.
227
+ print_exception : bool, default True
228
+ Determines whether or not the exception is printed to
229
+ stdout when caught.
223
230
  """
224
231
  ...
225
232
 
226
233
  @typing.overload
227
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
234
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
228
235
  ...
229
236
 
230
237
  @typing.overload
231
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
238
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
232
239
  ...
233
240
 
234
- 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]]] = [], role: typing.Optional[str] = None):
241
+ 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):
235
242
  """
236
- Specifies secrets to be retrieved and injected as environment variables prior to
237
- the execution of a step.
243
+ Specifies that the step will success under all circumstances.
244
+
245
+ The decorator will create an optional artifact, specified by `var`, which
246
+ contains the exception raised. You can use it to detect the presence
247
+ of errors, indicating that all happy-path artifacts produced by the step
248
+ are missing.
238
249
 
239
250
 
240
251
  Parameters
241
252
  ----------
242
- sources : List[Union[str, Dict[str, Any]]], default: []
243
- List of secret specs, defining how the secrets are to be retrieved
244
- role : str, optional, default: None
245
- Role to use for fetching secrets
253
+ var : str, optional, default None
254
+ Name of the artifact in which to store the caught exception.
255
+ If not specified, the exception is not stored.
256
+ print_exception : bool, default True
257
+ Determines whether or not the exception is printed to
258
+ stdout when caught.
246
259
  """
247
260
  ...
248
261
 
249
262
  @typing.overload
250
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
263
+ 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]]]:
251
264
  """
252
- Decorator prototype for all step decorators. This function gets specialized
253
- and imported for all decorators types by _import_plugin_decorators().
265
+ Specifies environment variables to be set prior to the execution of a step.
266
+
267
+
268
+ Parameters
269
+ ----------
270
+ vars : Dict[str, str], default {}
271
+ Dictionary of environment variables to set.
254
272
  """
255
273
  ...
256
274
 
257
275
  @typing.overload
258
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
276
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
259
277
  ...
260
278
 
261
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
279
+ @typing.overload
280
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
281
+ ...
282
+
283
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
262
284
  """
263
- Decorator prototype for all step decorators. This function gets specialized
264
- and imported for all decorators types by _import_plugin_decorators().
285
+ Specifies environment variables to be set prior to the execution of a step.
286
+
287
+
288
+ Parameters
289
+ ----------
290
+ vars : Dict[str, str], default {}
291
+ Dictionary of environment variables to set.
265
292
  """
266
293
  ...
267
294
 
268
- @typing.overload
269
- def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = 'METAFLOW_BATCH_JOB_QUEUE', iam_role: str = 'METAFLOW_ECS_S3_ACCESS_IAM_ROLE', execution_role: str = 'METAFLOW_ECS_FARGATE_EXECUTION_ROLE', shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, aws_batch_tags: typing.Optional[typing.Dict[str, str]] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[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]]]:
295
+ 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[typing.Dict[str, 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]]]:
270
296
  """
271
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
297
+ Specifies that this step should execute on Kubernetes.
272
298
 
273
299
 
274
300
  Parameters
@@ -276,147 +302,210 @@ def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optio
276
302
  cpu : int, default 1
277
303
  Number of CPUs required for this step. If `@resources` is
278
304
  also present, the maximum value from all decorators is used.
279
- gpu : int, default 0
280
- Number of GPUs required for this step. If `@resources` is
281
- also present, the maximum value from all decorators is used.
282
305
  memory : int, default 4096
283
306
  Memory size (in MB) required for this step. If
284
307
  `@resources` is also present, the maximum value from all decorators is
285
308
  used.
309
+ disk : int, default 10240
310
+ Disk size (in MB) required for this step. If
311
+ `@resources` is also present, the maximum value from all decorators is
312
+ used.
286
313
  image : str, optional, default None
287
- Docker image to use when launching on AWS Batch. If not specified, and
288
- METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
314
+ Docker image to use when launching on Kubernetes. If not specified, and
315
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
289
316
  not, a default Docker image mapping to the current version of Python is used.
290
- queue : str, default METAFLOW_BATCH_JOB_QUEUE
291
- AWS Batch Job Queue to submit the job to.
292
- iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
293
- AWS IAM role that AWS Batch container uses to access AWS cloud resources.
294
- execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
295
- AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
296
- (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
297
- shared_memory : int, optional, default None
298
- The value for the size (in MiB) of the /dev/shm volume for this step.
299
- This parameter maps to the `--shm-size` option in Docker.
300
- max_swap : int, optional, default None
301
- The total amount of swap memory (in MiB) a container can use for this
302
- step. This parameter is translated to the `--memory-swap` option in
303
- Docker where the value is the sum of the container memory plus the
304
- `max_swap` value.
305
- swappiness : int, optional, default None
306
- This allows you to tune memory swappiness behavior for this step.
307
- A swappiness value of 0 causes swapping not to happen unless absolutely
308
- necessary. A swappiness value of 100 causes pages to be swapped very
309
- aggressively. Accepted values are whole numbers between 0 and 100.
310
- aws_batch_tags: Dict[str, str], optional, default None
311
- Sets arbitrary AWS tags on the AWS Batch compute environment.
312
- Set as string key-value pairs.
317
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
318
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
319
+ image_pull_secrets: List[str], default []
320
+ The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
321
+ Kubernetes image pull secrets to use when pulling container images
322
+ in Kubernetes.
323
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
324
+ Kubernetes service account to use when launching pod in Kubernetes.
325
+ secrets : List[str], optional, default None
326
+ Kubernetes secrets to use when launching pod in Kubernetes. These
327
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
328
+ in Metaflow configuration.
329
+ node_selector: Union[Dict[str,str], str], optional, default None
330
+ Kubernetes node selector(s) to apply to the pod running the task.
331
+ Can be passed in as a comma separated string of values e.g.
332
+ 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
333
+ {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
334
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
335
+ Kubernetes namespace to use when launching pod in Kubernetes.
336
+ gpu : int, optional, default None
337
+ Number of GPUs required for this step. A value of zero implies that
338
+ the scheduled node should not have GPUs.
339
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
340
+ The vendor of the GPUs to be used for this step.
341
+ tolerations : List[Dict[str,str]], default []
342
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
343
+ Kubernetes tolerations to use when launching pod in Kubernetes.
344
+ labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
345
+ Kubernetes labels to use when launching pod in Kubernetes.
346
+ annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
347
+ Kubernetes annotations to use when launching pod in Kubernetes.
313
348
  use_tmpfs : bool, default False
314
- This enables an explicit tmpfs mount for this step. Note that tmpfs is
315
- not available on Fargate compute environments
349
+ This enables an explicit tmpfs mount for this step.
316
350
  tmpfs_tempdir : bool, default True
317
351
  sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
318
- tmpfs_size : int, optional, default None
352
+ tmpfs_size : int, optional, default: None
319
353
  The value for the size (in MiB) of the tmpfs mount for this step.
320
354
  This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
321
355
  memory allocated for this step.
322
- tmpfs_path : str, optional, default None
323
- Path to tmpfs mount for this step. Defaults to /metaflow_temp.
324
- inferentia : int, default 0
325
- Number of Inferentia chips required for this step.
326
- trainium : int, default None
327
- Alias for inferentia. Use only one of the two.
328
- efa : int, default 0
329
- Number of elastic fabric adapter network devices to attach to container
330
- ephemeral_storage : int, default None
331
- The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
332
- This is only relevant for Fargate compute environments
333
- log_driver: str, optional, default None
334
- The log driver to use for the Amazon ECS container.
335
- log_options: List[str], optional, default None
336
- List of strings containing options for the chosen log driver. The configurable values
337
- depend on the `log driver` chosen. Validation of these options is not supported yet.
338
- Example: [`awslogs-group:aws/batch/job`]
356
+ tmpfs_path : str, optional, default /metaflow_temp
357
+ Path to tmpfs mount for this step.
358
+ persistent_volume_claims : Dict[str, str], optional, default None
359
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
360
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
361
+ shared_memory: int, optional
362
+ Shared memory size (in MiB) required for this step
363
+ port: int, optional
364
+ Port number to specify in the Kubernetes job object
365
+ compute_pool : str, optional, default None
366
+ Compute pool to be used for for this step.
367
+ If not specified, any accessible compute pool within the perimeter is used.
368
+ hostname_resolution_timeout: int, default 10 * 60
369
+ Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
370
+ Only applicable when @parallel is used.
371
+ qos: str, default: Burstable
372
+ Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
373
+
374
+ security_context: Dict[str, Any], optional, default None
375
+ Container security context. Applies to the task container. Allows the following keys:
376
+ - privileged: bool, optional, default None
377
+ - allow_privilege_escalation: bool, optional, default None
378
+ - run_as_user: int, optional, default None
379
+ - run_as_group: int, optional, default None
380
+ - run_as_non_root: bool, optional, default None
339
381
  """
340
382
  ...
341
383
 
342
384
  @typing.overload
343
- def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
385
+ 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]]]:
386
+ """
387
+ Creates a human-readable report, a Metaflow Card, after this step completes.
388
+
389
+ Note that you may add multiple `@card` decorators in a step with different parameters.
390
+
391
+
392
+ Parameters
393
+ ----------
394
+ type : str, default 'default'
395
+ Card type.
396
+ id : str, optional, default None
397
+ If multiple cards are present, use this id to identify this card.
398
+ options : Dict[str, Any], default {}
399
+ Options passed to the card. The contents depend on the card type.
400
+ timeout : int, default 45
401
+ Interrupt reporting if it takes more than this many seconds.
402
+ """
344
403
  ...
345
404
 
346
405
  @typing.overload
347
- def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
406
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
348
407
  ...
349
408
 
350
- def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = 'METAFLOW_BATCH_JOB_QUEUE', iam_role: str = 'METAFLOW_ECS_S3_ACCESS_IAM_ROLE', execution_role: str = 'METAFLOW_ECS_FARGATE_EXECUTION_ROLE', shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, aws_batch_tags: typing.Optional[typing.Dict[str, str]] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[str]] = None):
409
+ @typing.overload
410
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
411
+ ...
412
+
413
+ 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):
351
414
  """
352
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
415
+ Creates a human-readable report, a Metaflow Card, after this step completes.
416
+
417
+ Note that you may add multiple `@card` decorators in a step with different parameters.
353
418
 
354
419
 
355
420
  Parameters
356
421
  ----------
357
- cpu : int, default 1
358
- Number of CPUs required for this step. If `@resources` is
359
- also present, the maximum value from all decorators is used.
360
- gpu : int, default 0
361
- Number of GPUs required for this step. If `@resources` is
362
- also present, the maximum value from all decorators is used.
363
- memory : int, default 4096
364
- Memory size (in MB) required for this step. If
365
- `@resources` is also present, the maximum value from all decorators is
366
- used.
367
- image : str, optional, default None
368
- Docker image to use when launching on AWS Batch. If not specified, and
369
- METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
370
- not, a default Docker image mapping to the current version of Python is used.
371
- queue : str, default METAFLOW_BATCH_JOB_QUEUE
372
- AWS Batch Job Queue to submit the job to.
373
- iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
374
- AWS IAM role that AWS Batch container uses to access AWS cloud resources.
375
- execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
376
- AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
377
- (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
378
- shared_memory : int, optional, default None
379
- The value for the size (in MiB) of the /dev/shm volume for this step.
380
- This parameter maps to the `--shm-size` option in Docker.
381
- max_swap : int, optional, default None
382
- The total amount of swap memory (in MiB) a container can use for this
383
- step. This parameter is translated to the `--memory-swap` option in
384
- Docker where the value is the sum of the container memory plus the
385
- `max_swap` value.
386
- swappiness : int, optional, default None
387
- This allows you to tune memory swappiness behavior for this step.
388
- A swappiness value of 0 causes swapping not to happen unless absolutely
389
- necessary. A swappiness value of 100 causes pages to be swapped very
390
- aggressively. Accepted values are whole numbers between 0 and 100.
391
- aws_batch_tags: Dict[str, str], optional, default None
392
- Sets arbitrary AWS tags on the AWS Batch compute environment.
393
- Set as string key-value pairs.
394
- use_tmpfs : bool, default False
395
- This enables an explicit tmpfs mount for this step. Note that tmpfs is
396
- not available on Fargate compute environments
397
- tmpfs_tempdir : bool, default True
398
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
399
- tmpfs_size : int, optional, default None
400
- The value for the size (in MiB) of the tmpfs mount for this step.
401
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
402
- memory allocated for this step.
403
- tmpfs_path : str, optional, default None
404
- Path to tmpfs mount for this step. Defaults to /metaflow_temp.
405
- inferentia : int, default 0
406
- Number of Inferentia chips required for this step.
407
- trainium : int, default None
408
- Alias for inferentia. Use only one of the two.
409
- efa : int, default 0
410
- Number of elastic fabric adapter network devices to attach to container
411
- ephemeral_storage : int, default None
412
- The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
413
- This is only relevant for Fargate compute environments
414
- log_driver: str, optional, default None
415
- The log driver to use for the Amazon ECS container.
416
- log_options: List[str], optional, default None
417
- List of strings containing options for the chosen log driver. The configurable values
418
- depend on the `log driver` chosen. Validation of these options is not supported yet.
419
- Example: [`awslogs-group:aws/batch/job`]
422
+ type : str, default 'default'
423
+ Card type.
424
+ id : str, optional, default None
425
+ If multiple cards are present, use this id to identify this card.
426
+ options : Dict[str, Any], default {}
427
+ Options passed to the card. The contents depend on the card type.
428
+ timeout : int, default 45
429
+ Interrupt reporting if it takes more than this many seconds.
430
+ """
431
+ ...
432
+
433
+ @typing.overload
434
+ 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]]]:
435
+ """
436
+ Specifies the resources needed when executing this step.
437
+
438
+ Use `@resources` to specify the resource requirements
439
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
440
+
441
+ You can choose the compute layer on the command line by executing e.g.
442
+ ```
443
+ python myflow.py run --with batch
444
+ ```
445
+ or
446
+ ```
447
+ python myflow.py run --with kubernetes
448
+ ```
449
+ which executes the flow on the desired system using the
450
+ requirements specified in `@resources`.
451
+
452
+
453
+ Parameters
454
+ ----------
455
+ cpu : int, default 1
456
+ Number of CPUs required for this step.
457
+ gpu : int, optional, default None
458
+ Number of GPUs required for this step.
459
+ disk : int, optional, default None
460
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
461
+ memory : int, default 4096
462
+ Memory size (in MB) required for this step.
463
+ shared_memory : int, optional, default None
464
+ The value for the size (in MiB) of the /dev/shm volume for this step.
465
+ This parameter maps to the `--shm-size` option in Docker.
466
+ """
467
+ ...
468
+
469
+ @typing.overload
470
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
471
+ ...
472
+
473
+ @typing.overload
474
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
475
+ ...
476
+
477
+ 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):
478
+ """
479
+ Specifies the resources needed when executing this step.
480
+
481
+ Use `@resources` to specify the resource requirements
482
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
483
+
484
+ You can choose the compute layer on the command line by executing e.g.
485
+ ```
486
+ python myflow.py run --with batch
487
+ ```
488
+ or
489
+ ```
490
+ python myflow.py run --with kubernetes
491
+ ```
492
+ which executes the flow on the desired system using the
493
+ requirements specified in `@resources`.
494
+
495
+
496
+ Parameters
497
+ ----------
498
+ cpu : int, default 1
499
+ Number of CPUs required for this step.
500
+ gpu : int, optional, default None
501
+ Number of GPUs required for this step.
502
+ disk : int, optional, default None
503
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
504
+ memory : int, default 4096
505
+ Memory size (in MB) required for this step.
506
+ shared_memory : int, optional, default None
507
+ The value for the size (in MiB) of the /dev/shm volume for this step.
508
+ This parameter maps to the `--shm-size` option in Docker.
420
509
  """
421
510
  ...
422
511
 
@@ -480,283 +569,215 @@ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
480
569
  ...
481
570
 
482
571
  @typing.overload
483
- def environment(*, vars: typing.Dict[str, str] = {}) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
484
- """
485
- Specifies environment variables to be set prior to the execution of a step.
486
-
487
-
488
- Parameters
489
- ----------
490
- vars : Dict[str, str], default {}
491
- Dictionary of environment variables to set.
492
- """
493
- ...
494
-
495
- @typing.overload
496
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
497
- ...
498
-
499
- @typing.overload
500
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
501
- ...
502
-
503
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
504
- """
505
- Specifies environment variables to be set prior to the execution of a step.
506
-
507
-
508
- Parameters
509
- ----------
510
- vars : Dict[str, str], default {}
511
- Dictionary of environment variables to set.
512
- """
513
- ...
514
-
515
- @typing.overload
516
- 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]]]:
572
+ def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = 'METAFLOW_BATCH_JOB_QUEUE', iam_role: str = 'METAFLOW_ECS_S3_ACCESS_IAM_ROLE', execution_role: str = 'METAFLOW_ECS_FARGATE_EXECUTION_ROLE', shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, aws_batch_tags: typing.Optional[typing.Dict[str, str]] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[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]]]:
517
573
  """
518
- Specifies a timeout for your step.
519
-
520
- This decorator is useful if this step may hang indefinitely.
521
-
522
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
523
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
524
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
525
-
526
- Note that all the values specified in parameters are added together so if you specify
527
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
574
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
528
575
 
529
576
 
530
577
  Parameters
531
578
  ----------
532
- seconds : int, default 0
533
- Number of seconds to wait prior to timing out.
534
- minutes : int, default 0
535
- Number of minutes to wait prior to timing out.
536
- hours : int, default 0
537
- Number of hours to wait prior to timing out.
579
+ cpu : int, default 1
580
+ Number of CPUs required for this step. If `@resources` is
581
+ also present, the maximum value from all decorators is used.
582
+ gpu : int, default 0
583
+ Number of GPUs required for this step. If `@resources` is
584
+ also present, the maximum value from all decorators is used.
585
+ memory : int, default 4096
586
+ Memory size (in MB) required for this step. If
587
+ `@resources` is also present, the maximum value from all decorators is
588
+ used.
589
+ image : str, optional, default None
590
+ Docker image to use when launching on AWS Batch. If not specified, and
591
+ METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
592
+ not, a default Docker image mapping to the current version of Python is used.
593
+ queue : str, default METAFLOW_BATCH_JOB_QUEUE
594
+ AWS Batch Job Queue to submit the job to.
595
+ iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
596
+ AWS IAM role that AWS Batch container uses to access AWS cloud resources.
597
+ execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
598
+ AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
599
+ (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
600
+ shared_memory : int, optional, default None
601
+ The value for the size (in MiB) of the /dev/shm volume for this step.
602
+ This parameter maps to the `--shm-size` option in Docker.
603
+ max_swap : int, optional, default None
604
+ The total amount of swap memory (in MiB) a container can use for this
605
+ step. This parameter is translated to the `--memory-swap` option in
606
+ Docker where the value is the sum of the container memory plus the
607
+ `max_swap` value.
608
+ swappiness : int, optional, default None
609
+ This allows you to tune memory swappiness behavior for this step.
610
+ A swappiness value of 0 causes swapping not to happen unless absolutely
611
+ necessary. A swappiness value of 100 causes pages to be swapped very
612
+ aggressively. Accepted values are whole numbers between 0 and 100.
613
+ aws_batch_tags: Dict[str, str], optional, default None
614
+ Sets arbitrary AWS tags on the AWS Batch compute environment.
615
+ Set as string key-value pairs.
616
+ use_tmpfs : bool, default False
617
+ This enables an explicit tmpfs mount for this step. Note that tmpfs is
618
+ not available on Fargate compute environments
619
+ tmpfs_tempdir : bool, default True
620
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
621
+ tmpfs_size : int, optional, default None
622
+ The value for the size (in MiB) of the tmpfs mount for this step.
623
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
624
+ memory allocated for this step.
625
+ tmpfs_path : str, optional, default None
626
+ Path to tmpfs mount for this step. Defaults to /metaflow_temp.
627
+ inferentia : int, default 0
628
+ Number of Inferentia chips required for this step.
629
+ trainium : int, default None
630
+ Alias for inferentia. Use only one of the two.
631
+ efa : int, default 0
632
+ Number of elastic fabric adapter network devices to attach to container
633
+ ephemeral_storage : int, default None
634
+ The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
635
+ This is only relevant for Fargate compute environments
636
+ log_driver: str, optional, default None
637
+ The log driver to use for the Amazon ECS container.
638
+ log_options: List[str], optional, default None
639
+ List of strings containing options for the chosen log driver. The configurable values
640
+ depend on the `log driver` chosen. Validation of these options is not supported yet.
641
+ Example: [`awslogs-group:aws/batch/job`]
538
642
  """
539
643
  ...
540
644
 
541
645
  @typing.overload
542
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
646
+ def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
543
647
  ...
544
648
 
545
649
  @typing.overload
546
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
650
+ def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
547
651
  ...
548
652
 
549
- def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, seconds: int = 0, minutes: int = 0, hours: int = 0):
653
+ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = 'METAFLOW_BATCH_JOB_QUEUE', iam_role: str = 'METAFLOW_ECS_S3_ACCESS_IAM_ROLE', execution_role: str = 'METAFLOW_ECS_FARGATE_EXECUTION_ROLE', shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, aws_batch_tags: typing.Optional[typing.Dict[str, str]] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[str]] = None):
550
654
  """
551
- Specifies a timeout for your step.
552
-
553
- This decorator is useful if this step may hang indefinitely.
554
-
555
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
556
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
557
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
558
-
559
- Note that all the values specified in parameters are added together so if you specify
560
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
655
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
561
656
 
562
657
 
563
658
  Parameters
564
659
  ----------
565
- seconds : int, default 0
566
- Number of seconds to wait prior to timing out.
567
- minutes : int, default 0
568
- Number of minutes to wait prior to timing out.
569
- hours : int, default 0
570
- Number of hours to wait prior to timing out.
660
+ cpu : int, default 1
661
+ Number of CPUs required for this step. If `@resources` is
662
+ also present, the maximum value from all decorators is used.
663
+ gpu : int, default 0
664
+ Number of GPUs required for this step. If `@resources` is
665
+ also present, the maximum value from all decorators is used.
666
+ memory : int, default 4096
667
+ Memory size (in MB) required for this step. If
668
+ `@resources` is also present, the maximum value from all decorators is
669
+ used.
670
+ image : str, optional, default None
671
+ Docker image to use when launching on AWS Batch. If not specified, and
672
+ METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
673
+ not, a default Docker image mapping to the current version of Python is used.
674
+ queue : str, default METAFLOW_BATCH_JOB_QUEUE
675
+ AWS Batch Job Queue to submit the job to.
676
+ iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
677
+ AWS IAM role that AWS Batch container uses to access AWS cloud resources.
678
+ execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
679
+ AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
680
+ (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
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.
684
+ max_swap : int, optional, default None
685
+ The total amount of swap memory (in MiB) a container can use for this
686
+ step. This parameter is translated to the `--memory-swap` option in
687
+ Docker where the value is the sum of the container memory plus the
688
+ `max_swap` value.
689
+ swappiness : int, optional, default None
690
+ This allows you to tune memory swappiness behavior for this step.
691
+ A swappiness value of 0 causes swapping not to happen unless absolutely
692
+ necessary. A swappiness value of 100 causes pages to be swapped very
693
+ aggressively. Accepted values are whole numbers between 0 and 100.
694
+ aws_batch_tags: Dict[str, str], optional, default None
695
+ Sets arbitrary AWS tags on the AWS Batch compute environment.
696
+ Set as string key-value pairs.
697
+ use_tmpfs : bool, default False
698
+ This enables an explicit tmpfs mount for this step. Note that tmpfs is
699
+ not available on Fargate compute environments
700
+ tmpfs_tempdir : bool, default True
701
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
702
+ tmpfs_size : int, optional, default None
703
+ The value for the size (in MiB) of the tmpfs mount for this step.
704
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
705
+ memory allocated for this step.
706
+ tmpfs_path : str, optional, default None
707
+ Path to tmpfs mount for this step. Defaults to /metaflow_temp.
708
+ inferentia : int, default 0
709
+ Number of Inferentia chips required for this step.
710
+ trainium : int, default None
711
+ Alias for inferentia. Use only one of the two.
712
+ efa : int, default 0
713
+ Number of elastic fabric adapter network devices to attach to container
714
+ ephemeral_storage : int, default None
715
+ The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
716
+ This is only relevant for Fargate compute environments
717
+ log_driver: str, optional, default None
718
+ The log driver to use for the Amazon ECS container.
719
+ log_options: List[str], optional, default None
720
+ List of strings containing options for the chosen log driver. The configurable values
721
+ depend on the `log driver` chosen. Validation of these options is not supported yet.
722
+ Example: [`awslogs-group:aws/batch/job`]
571
723
  """
572
724
  ...
573
725
 
574
726
  @typing.overload
575
- 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]]]:
727
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
576
728
  """
577
- Specifies that the step will success under all circumstances.
578
-
579
- The decorator will create an optional artifact, specified by `var`, which
580
- contains the exception raised. You can use it to detect the presence
581
- of errors, indicating that all happy-path artifacts produced by the step
582
- are missing.
583
-
584
-
585
- Parameters
586
- ----------
587
- var : str, optional, default None
588
- Name of the artifact in which to store the caught exception.
589
- If not specified, the exception is not stored.
590
- print_exception : bool, default True
591
- Determines whether or not the exception is printed to
592
- stdout when caught.
729
+ Decorator prototype for all step decorators. This function gets specialized
730
+ and imported for all decorators types by _import_plugin_decorators().
593
731
  """
594
732
  ...
595
733
 
596
734
  @typing.overload
597
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
598
- ...
599
-
600
- @typing.overload
601
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
735
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
602
736
  ...
603
737
 
604
- 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):
738
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
605
739
  """
606
- Specifies that the step will success under all circumstances.
607
-
608
- The decorator will create an optional artifact, specified by `var`, which
609
- contains the exception raised. You can use it to detect the presence
610
- of errors, indicating that all happy-path artifacts produced by the step
611
- are missing.
612
-
613
-
614
- Parameters
615
- ----------
616
- var : str, optional, default None
617
- Name of the artifact in which to store the caught exception.
618
- If not specified, the exception is not stored.
619
- print_exception : bool, default True
620
- Determines whether or not the exception is printed to
621
- stdout when caught.
740
+ Decorator prototype for all step decorators. This function gets specialized
741
+ and imported for all decorators types by _import_plugin_decorators().
622
742
  """
623
743
  ...
624
744
 
625
745
  @typing.overload
626
- 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]]]:
746
+ def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: 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]]]:
627
747
  """
628
- Creates a human-readable report, a Metaflow Card, after this step completes.
629
-
630
- Note that you may add multiple `@card` decorators in a step with different parameters.
748
+ Specifies secrets to be retrieved and injected as environment variables prior to
749
+ the execution of a step.
631
750
 
632
751
 
633
752
  Parameters
634
753
  ----------
635
- type : str, default 'default'
636
- Card type.
637
- id : str, optional, default None
638
- If multiple cards are present, use this id to identify this card.
639
- options : Dict[str, Any], default {}
640
- Options passed to the card. The contents depend on the card type.
641
- timeout : int, default 45
642
- Interrupt reporting if it takes more than this many seconds.
754
+ sources : List[Union[str, Dict[str, Any]]], default: []
755
+ List of secret specs, defining how the secrets are to be retrieved
756
+ role : str, optional, default: None
757
+ Role to use for fetching secrets
643
758
  """
644
759
  ...
645
760
 
646
761
  @typing.overload
647
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
762
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
648
763
  ...
649
764
 
650
765
  @typing.overload
651
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
652
- ...
653
-
654
- 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):
655
- """
656
- Creates a human-readable report, a Metaflow Card, after this step completes.
657
-
658
- Note that you may add multiple `@card` decorators in a step with different parameters.
659
-
660
-
661
- Parameters
662
- ----------
663
- type : str, default 'default'
664
- Card type.
665
- id : str, optional, default None
666
- If multiple cards are present, use this id to identify this card.
667
- options : Dict[str, Any], default {}
668
- Options passed to the card. The contents depend on the card type.
669
- timeout : int, default 45
670
- Interrupt reporting if it takes more than this many seconds.
671
- """
766
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
672
767
  ...
673
768
 
674
- 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[typing.Dict[str, 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]]]:
769
+ 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]]] = [], role: typing.Optional[str] = None):
675
770
  """
676
- Specifies that this step should execute on Kubernetes.
771
+ Specifies secrets to be retrieved and injected as environment variables prior to
772
+ the execution of a step.
677
773
 
678
774
 
679
775
  Parameters
680
776
  ----------
681
- cpu : int, default 1
682
- Number of CPUs required for this step. If `@resources` is
683
- also present, the maximum value from all decorators is used.
684
- memory : int, default 4096
685
- Memory size (in MB) required for this step. If
686
- `@resources` is also present, the maximum value from all decorators is
687
- used.
688
- disk : int, default 10240
689
- Disk size (in MB) required for this step. If
690
- `@resources` is also present, the maximum value from all decorators is
691
- used.
692
- image : str, optional, default None
693
- Docker image to use when launching on Kubernetes. If not specified, and
694
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
695
- not, a default Docker image mapping to the current version of Python is used.
696
- image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
697
- If given, the imagePullPolicy to be applied to the Docker image of the step.
698
- image_pull_secrets: List[str], default []
699
- The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
700
- Kubernetes image pull secrets to use when pulling container images
701
- in Kubernetes.
702
- service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
703
- Kubernetes service account to use when launching pod in Kubernetes.
704
- secrets : List[str], optional, default None
705
- Kubernetes secrets to use when launching pod in Kubernetes. These
706
- secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
707
- in Metaflow configuration.
708
- node_selector: Union[Dict[str,str], str], optional, default None
709
- Kubernetes node selector(s) to apply to the pod running the task.
710
- Can be passed in as a comma separated string of values e.g.
711
- 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
712
- {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
713
- namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
714
- Kubernetes namespace to use when launching pod in Kubernetes.
715
- gpu : int, optional, default None
716
- Number of GPUs required for this step. A value of zero implies that
717
- the scheduled node should not have GPUs.
718
- gpu_vendor : str, default KUBERNETES_GPU_VENDOR
719
- The vendor of the GPUs to be used for this step.
720
- tolerations : List[Dict[str,str]], default []
721
- The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
722
- Kubernetes tolerations to use when launching pod in Kubernetes.
723
- labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
724
- Kubernetes labels to use when launching pod in Kubernetes.
725
- annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
726
- Kubernetes annotations to use when launching pod in Kubernetes.
727
- use_tmpfs : bool, default False
728
- This enables an explicit tmpfs mount for this step.
729
- tmpfs_tempdir : bool, default True
730
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
731
- tmpfs_size : int, optional, default: None
732
- The value for the size (in MiB) of the tmpfs mount for this step.
733
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
734
- memory allocated for this step.
735
- tmpfs_path : str, optional, default /metaflow_temp
736
- Path to tmpfs mount for this step.
737
- persistent_volume_claims : Dict[str, str], optional, default None
738
- A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
739
- volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
740
- shared_memory: int, optional
741
- Shared memory size (in MiB) required for this step
742
- port: int, optional
743
- Port number to specify in the Kubernetes job object
744
- compute_pool : str, optional, default None
745
- Compute pool to be used for for this step.
746
- If not specified, any accessible compute pool within the perimeter is used.
747
- hostname_resolution_timeout: int, default 10 * 60
748
- Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
749
- Only applicable when @parallel is used.
750
- qos: str, default: Burstable
751
- Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
752
-
753
- security_context: Dict[str, Any], optional, default None
754
- Container security context. Applies to the task container. Allows the following keys:
755
- - privileged: bool, optional, default None
756
- - allow_privilege_escalation: bool, optional, default None
757
- - run_as_user: int, optional, default None
758
- - run_as_group: int, optional, default None
759
- - run_as_non_root: bool, optional, default None
777
+ sources : List[Union[str, Dict[str, Any]]], default: []
778
+ List of secret specs, defining how the secrets are to be retrieved
779
+ role : str, optional, default: None
780
+ Role to use for fetching secrets
760
781
  """
761
782
  ...
762
783
 
@@ -812,276 +833,61 @@ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
812
833
  ...
813
834
 
814
835
  @typing.overload
815
- 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]]]:
836
+ 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]]]:
816
837
  """
817
- Specifies the resources needed when executing this step.
838
+ Specifies a timeout for your step.
818
839
 
819
- Use `@resources` to specify the resource requirements
820
- independently of the specific compute layer (`@batch`, `@kubernetes`).
821
-
822
- You can choose the compute layer on the command line by executing e.g.
823
- ```
824
- python myflow.py run --with batch
825
- ```
826
- or
827
- ```
828
- python myflow.py run --with kubernetes
829
- ```
830
- which executes the flow on the desired system using the
831
- requirements specified in `@resources`.
832
-
833
-
834
- Parameters
835
- ----------
836
- cpu : int, default 1
837
- Number of CPUs required for this step.
838
- gpu : int, optional, default None
839
- Number of GPUs required for this step.
840
- disk : int, optional, default None
841
- Disk size (in MB) required for this step. Only applies on Kubernetes.
842
- memory : int, default 4096
843
- Memory size (in MB) required for this step.
844
- shared_memory : int, optional, default None
845
- The value for the size (in MiB) of the /dev/shm volume for this step.
846
- This parameter maps to the `--shm-size` option in Docker.
847
- """
848
- ...
849
-
850
- @typing.overload
851
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
852
- ...
853
-
854
- @typing.overload
855
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
856
- ...
857
-
858
- 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):
859
- """
860
- Specifies the resources needed when executing this step.
861
-
862
- Use `@resources` to specify the resource requirements
863
- independently of the specific compute layer (`@batch`, `@kubernetes`).
864
-
865
- You can choose the compute layer on the command line by executing e.g.
866
- ```
867
- python myflow.py run --with batch
868
- ```
869
- or
870
- ```
871
- python myflow.py run --with kubernetes
872
- ```
873
- which executes the flow on the desired system using the
874
- requirements specified in `@resources`.
875
-
876
-
877
- Parameters
878
- ----------
879
- cpu : int, default 1
880
- Number of CPUs required for this step.
881
- gpu : int, optional, default None
882
- Number of GPUs required for this step.
883
- disk : int, optional, default None
884
- Disk size (in MB) required for this step. Only applies on Kubernetes.
885
- memory : int, default 4096
886
- Memory size (in MB) required for this step.
887
- shared_memory : int, optional, default None
888
- The value for the size (in MiB) of the /dev/shm volume for this step.
889
- This parameter maps to the `--shm-size` option in Docker.
890
- """
891
- ...
892
-
893
- @typing.overload
894
- 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]]:
895
- """
896
- Specifies the times when the flow should be run when running on a
897
- production scheduler.
840
+ This decorator is useful if this step may hang indefinitely.
898
841
 
842
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
843
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
844
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
899
845
 
900
- Parameters
901
- ----------
902
- hourly : bool, default False
903
- Run the workflow hourly.
904
- daily : bool, default True
905
- Run the workflow daily.
906
- weekly : bool, default False
907
- Run the workflow weekly.
908
- cron : str, optional, default None
909
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
910
- specified by this expression.
911
- timezone : str, optional, default None
912
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
913
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
914
- """
915
- ...
916
-
917
- @typing.overload
918
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
919
- ...
920
-
921
- 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):
922
- """
923
- Specifies the times when the flow should be run when running on a
924
- production scheduler.
846
+ Note that all the values specified in parameters are added together so if you specify
847
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
925
848
 
926
849
 
927
850
  Parameters
928
851
  ----------
929
- hourly : bool, default False
930
- Run the workflow hourly.
931
- daily : bool, default True
932
- Run the workflow daily.
933
- weekly : bool, default False
934
- Run the workflow weekly.
935
- cron : str, optional, default None
936
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
937
- specified by this expression.
938
- timezone : str, optional, default None
939
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
940
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
852
+ seconds : int, default 0
853
+ Number of seconds to wait prior to timing out.
854
+ minutes : int, default 0
855
+ Number of minutes to wait prior to timing out.
856
+ hours : int, default 0
857
+ Number of hours to wait prior to timing out.
941
858
  """
942
859
  ...
943
860
 
944
861
  @typing.overload
945
- 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]]:
946
- """
947
- Specifies the flow(s) that this flow depends on.
948
-
949
- ```
950
- @trigger_on_finish(flow='FooFlow')
951
- ```
952
- or
953
- ```
954
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
955
- ```
956
- This decorator respects the @project decorator and triggers the flow
957
- when upstream runs within the same namespace complete successfully
958
-
959
- Additionally, you can specify project aware upstream flow dependencies
960
- by specifying the fully qualified project_flow_name.
961
- ```
962
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
963
- ```
964
- or
965
- ```
966
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
967
- ```
968
-
969
- You can also specify just the project or project branch (other values will be
970
- inferred from the current project or project branch):
971
- ```
972
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
973
- ```
974
-
975
- Note that `branch` is typically one of:
976
- - `prod`
977
- - `user.bob`
978
- - `test.my_experiment`
979
- - `prod.staging`
980
-
981
-
982
- Parameters
983
- ----------
984
- flow : Union[str, Dict[str, str]], optional, default None
985
- Upstream flow dependency for this flow.
986
- flows : List[Union[str, Dict[str, str]]], default []
987
- Upstream flow dependencies for this flow.
988
- options : Dict[str, Any], default {}
989
- Backend-specific configuration for tuning eventing behavior.
990
- """
862
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
991
863
  ...
992
864
 
993
865
  @typing.overload
994
- def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
995
- ...
996
-
997
- def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, 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] = {}):
998
- """
999
- Specifies the flow(s) that this flow depends on.
1000
-
1001
- ```
1002
- @trigger_on_finish(flow='FooFlow')
1003
- ```
1004
- or
1005
- ```
1006
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1007
- ```
1008
- This decorator respects the @project decorator and triggers the flow
1009
- when upstream runs within the same namespace complete successfully
1010
-
1011
- Additionally, you can specify project aware upstream flow dependencies
1012
- by specifying the fully qualified project_flow_name.
1013
- ```
1014
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1015
- ```
1016
- or
1017
- ```
1018
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1019
- ```
1020
-
1021
- You can also specify just the project or project branch (other values will be
1022
- inferred from the current project or project branch):
1023
- ```
1024
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1025
- ```
1026
-
1027
- Note that `branch` is typically one of:
1028
- - `prod`
1029
- - `user.bob`
1030
- - `test.my_experiment`
1031
- - `prod.staging`
1032
-
1033
-
1034
- Parameters
1035
- ----------
1036
- flow : Union[str, Dict[str, str]], optional, default None
1037
- Upstream flow dependency for this flow.
1038
- flows : List[Union[str, Dict[str, str]]], default []
1039
- Upstream flow dependencies for this flow.
1040
- options : Dict[str, Any], default {}
1041
- Backend-specific configuration for tuning eventing behavior.
1042
- """
866
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1043
867
  ...
1044
868
 
1045
- 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]]:
869
+ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, seconds: int = 0, minutes: int = 0, hours: int = 0):
1046
870
  """
1047
- 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)
1048
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1049
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1050
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1051
- starts only after all sensors finish.
1052
-
1053
-
1054
- Parameters
1055
- ----------
1056
- timeout : int
1057
- Time, in seconds before the task times out and fails. (Default: 3600)
1058
- poke_interval : int
1059
- Time in seconds that the job should wait in between each try. (Default: 60)
1060
- mode : str
1061
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1062
- exponential_backoff : bool
1063
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1064
- pool : str
1065
- the slot pool this task should run in,
1066
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1067
- soft_fail : bool
1068
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1069
- name : str
1070
- Name of the sensor on Airflow
1071
- description : str
1072
- Description of sensor in the Airflow UI
1073
- bucket_key : Union[str, List[str]]
1074
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1075
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1076
- bucket_name : str
1077
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1078
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1079
- wildcard_match : bool
1080
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1081
- aws_conn_id : str
1082
- a reference to the s3 connection on Airflow. (Default: None)
1083
- verify : bool
1084
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
871
+ Specifies a timeout for your step.
872
+
873
+ This decorator is useful if this step may hang indefinitely.
874
+
875
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
876
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
877
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
878
+
879
+ Note that all the values specified in parameters are added together so if you specify
880
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
881
+
882
+
883
+ Parameters
884
+ ----------
885
+ seconds : int, default 0
886
+ Number of seconds to wait prior to timing out.
887
+ minutes : int, default 0
888
+ Number of minutes to wait prior to timing out.
889
+ hours : int, default 0
890
+ Number of hours to wait prior to timing out.
1085
891
  """
1086
892
  ...
1087
893
 
@@ -1214,43 +1020,53 @@ def project(*, name: str, branch: typing.Optional[str] = None, production: bool
1214
1020
  ...
1215
1021
 
1216
1022
  @typing.overload
1217
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1023
+ 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]]:
1218
1024
  """
1219
- Specifies the PyPI packages for all steps of the flow.
1025
+ Specifies the times when the flow should be run when running on a
1026
+ production scheduler.
1220
1027
 
1221
- Use `@pypi_base` to set common packages required by all
1222
- steps and use `@pypi` to specify step-specific overrides.
1223
1028
 
1224
1029
  Parameters
1225
1030
  ----------
1226
- packages : Dict[str, str], default: {}
1227
- Packages to use for this flow. The key is the name of the package
1228
- and the value is the version to use.
1229
- python : str, optional, default: None
1230
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1231
- that the version used will correspond to the version of the Python interpreter used to start the run.
1031
+ hourly : bool, default False
1032
+ Run the workflow hourly.
1033
+ daily : bool, default True
1034
+ Run the workflow daily.
1035
+ weekly : bool, default False
1036
+ Run the workflow weekly.
1037
+ cron : str, optional, default None
1038
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1039
+ specified by this expression.
1040
+ timezone : str, optional, default None
1041
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1042
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1232
1043
  """
1233
1044
  ...
1234
1045
 
1235
1046
  @typing.overload
1236
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1047
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1237
1048
  ...
1238
1049
 
1239
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1050
+ 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):
1240
1051
  """
1241
- Specifies the PyPI packages for all steps of the flow.
1052
+ Specifies the times when the flow should be run when running on a
1053
+ production scheduler.
1242
1054
 
1243
- Use `@pypi_base` to set common packages required by all
1244
- steps and use `@pypi` to specify step-specific overrides.
1245
1055
 
1246
1056
  Parameters
1247
1057
  ----------
1248
- packages : Dict[str, str], default: {}
1249
- Packages to use for this flow. The key is the name of the package
1250
- and the value is the version to use.
1251
- python : str, optional, default: None
1252
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1253
- that the version used will correspond to the version of the Python interpreter used to start the run.
1058
+ hourly : bool, default False
1059
+ Run the workflow hourly.
1060
+ daily : bool, default True
1061
+ Run the workflow daily.
1062
+ weekly : bool, default False
1063
+ Run the workflow weekly.
1064
+ cron : str, optional, default None
1065
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1066
+ specified by this expression.
1067
+ timezone : str, optional, default None
1068
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1069
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1254
1070
  """
1255
1071
  ...
1256
1072
 
@@ -1297,6 +1113,49 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
1297
1113
  """
1298
1114
  ...
1299
1115
 
1116
+ 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]]:
1117
+ """
1118
+ 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)
1119
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1120
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1121
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1122
+ starts only after all sensors finish.
1123
+
1124
+
1125
+ Parameters
1126
+ ----------
1127
+ timeout : int
1128
+ Time, in seconds before the task times out and fails. (Default: 3600)
1129
+ poke_interval : int
1130
+ Time in seconds that the job should wait in between each try. (Default: 60)
1131
+ mode : str
1132
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1133
+ exponential_backoff : bool
1134
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1135
+ pool : str
1136
+ the slot pool this task should run in,
1137
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1138
+ soft_fail : bool
1139
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1140
+ name : str
1141
+ Name of the sensor on Airflow
1142
+ description : str
1143
+ Description of sensor in the Airflow UI
1144
+ bucket_key : Union[str, List[str]]
1145
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1146
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1147
+ bucket_name : str
1148
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1149
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1150
+ wildcard_match : bool
1151
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1152
+ aws_conn_id : str
1153
+ a reference to the s3 connection on Airflow. (Default: None)
1154
+ verify : bool
1155
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1156
+ """
1157
+ ...
1158
+
1300
1159
  @typing.overload
1301
1160
  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]]:
1302
1161
  """
@@ -1348,3 +1207,145 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
1348
1207
  """
1349
1208
  ...
1350
1209
 
1210
+ @typing.overload
1211
+ 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]]:
1212
+ """
1213
+ Specifies the flow(s) that this flow depends on.
1214
+
1215
+ ```
1216
+ @trigger_on_finish(flow='FooFlow')
1217
+ ```
1218
+ or
1219
+ ```
1220
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1221
+ ```
1222
+ This decorator respects the @project decorator and triggers the flow
1223
+ when upstream runs within the same namespace complete successfully
1224
+
1225
+ Additionally, you can specify project aware upstream flow dependencies
1226
+ by specifying the fully qualified project_flow_name.
1227
+ ```
1228
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1229
+ ```
1230
+ or
1231
+ ```
1232
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1233
+ ```
1234
+
1235
+ You can also specify just the project or project branch (other values will be
1236
+ inferred from the current project or project branch):
1237
+ ```
1238
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1239
+ ```
1240
+
1241
+ Note that `branch` is typically one of:
1242
+ - `prod`
1243
+ - `user.bob`
1244
+ - `test.my_experiment`
1245
+ - `prod.staging`
1246
+
1247
+
1248
+ Parameters
1249
+ ----------
1250
+ flow : Union[str, Dict[str, str]], optional, default None
1251
+ Upstream flow dependency for this flow.
1252
+ flows : List[Union[str, Dict[str, str]]], default []
1253
+ Upstream flow dependencies for this flow.
1254
+ options : Dict[str, Any], default {}
1255
+ Backend-specific configuration for tuning eventing behavior.
1256
+ """
1257
+ ...
1258
+
1259
+ @typing.overload
1260
+ def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1261
+ ...
1262
+
1263
+ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, 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] = {}):
1264
+ """
1265
+ Specifies the flow(s) that this flow depends on.
1266
+
1267
+ ```
1268
+ @trigger_on_finish(flow='FooFlow')
1269
+ ```
1270
+ or
1271
+ ```
1272
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1273
+ ```
1274
+ This decorator respects the @project decorator and triggers the flow
1275
+ when upstream runs within the same namespace complete successfully
1276
+
1277
+ Additionally, you can specify project aware upstream flow dependencies
1278
+ by specifying the fully qualified project_flow_name.
1279
+ ```
1280
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1281
+ ```
1282
+ or
1283
+ ```
1284
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1285
+ ```
1286
+
1287
+ You can also specify just the project or project branch (other values will be
1288
+ inferred from the current project or project branch):
1289
+ ```
1290
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1291
+ ```
1292
+
1293
+ Note that `branch` is typically one of:
1294
+ - `prod`
1295
+ - `user.bob`
1296
+ - `test.my_experiment`
1297
+ - `prod.staging`
1298
+
1299
+
1300
+ Parameters
1301
+ ----------
1302
+ flow : Union[str, Dict[str, str]], optional, default None
1303
+ Upstream flow dependency for this flow.
1304
+ flows : List[Union[str, Dict[str, str]]], default []
1305
+ Upstream flow dependencies for this flow.
1306
+ options : Dict[str, Any], default {}
1307
+ Backend-specific configuration for tuning eventing behavior.
1308
+ """
1309
+ ...
1310
+
1311
+ @typing.overload
1312
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1313
+ """
1314
+ Specifies the PyPI packages for all steps of the flow.
1315
+
1316
+ Use `@pypi_base` to set common packages required by all
1317
+ steps and use `@pypi` to specify step-specific overrides.
1318
+
1319
+ Parameters
1320
+ ----------
1321
+ packages : Dict[str, str], default: {}
1322
+ Packages to use for this flow. The key is the name of the package
1323
+ and the value is the version to use.
1324
+ python : str, optional, default: None
1325
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1326
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1327
+ """
1328
+ ...
1329
+
1330
+ @typing.overload
1331
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1332
+ ...
1333
+
1334
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1335
+ """
1336
+ Specifies the PyPI packages for all steps of the flow.
1337
+
1338
+ Use `@pypi_base` to set common packages required by all
1339
+ steps and use `@pypi` to specify step-specific overrides.
1340
+
1341
+ Parameters
1342
+ ----------
1343
+ packages : Dict[str, str], default: {}
1344
+ Packages to use for this flow. The key is the name of the package
1345
+ and the value is the version to use.
1346
+ python : str, optional, default: None
1347
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1348
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1349
+ """
1350
+ ...
1351
+