metaflow-stubs 2.15.2__py2.py3-none-any.whl → 2.15.4__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. metaflow-stubs/__init__.pyi +596 -596
  2. metaflow-stubs/cards.pyi +2 -2
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/cli_components/__init__.pyi +2 -2
  5. metaflow-stubs/cli_components/utils.pyi +2 -2
  6. metaflow-stubs/client/__init__.pyi +2 -2
  7. metaflow-stubs/client/core.pyi +7 -7
  8. metaflow-stubs/client/filecache.pyi +2 -2
  9. metaflow-stubs/events.pyi +3 -3
  10. metaflow-stubs/exception.pyi +2 -2
  11. metaflow-stubs/flowspec.pyi +5 -5
  12. metaflow-stubs/generated_for.txt +1 -1
  13. metaflow-stubs/includefile.pyi +4 -4
  14. metaflow-stubs/info_file.pyi +2 -2
  15. metaflow-stubs/metadata_provider/__init__.pyi +2 -2
  16. metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
  17. metaflow-stubs/metadata_provider/metadata.pyi +3 -3
  18. metaflow-stubs/metadata_provider/util.pyi +2 -2
  19. metaflow-stubs/metaflow_config.pyi +2 -2
  20. metaflow-stubs/metaflow_current.pyi +23 -23
  21. metaflow-stubs/multicore_utils.pyi +2 -2
  22. metaflow-stubs/parameters.pyi +4 -4
  23. metaflow-stubs/plugins/__init__.pyi +18 -14
  24. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  25. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
  26. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  27. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  28. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  29. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  30. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
  31. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
  32. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  33. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  34. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  35. metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -3
  36. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +2 -2
  37. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +5 -5
  38. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -3
  39. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  40. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  41. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  42. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  43. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  44. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  45. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  46. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  47. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
  48. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  49. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
  50. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  51. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  52. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  53. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  54. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
  55. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +4 -4
  56. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +3 -3
  57. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  58. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  59. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  60. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +4 -4
  61. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  62. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  63. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  64. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  65. metaflow-stubs/plugins/cards/card_client.pyi +2 -2
  66. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  67. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  68. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  69. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  70. metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
  71. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  72. metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
  73. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  74. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  75. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  76. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  77. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  78. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  79. metaflow-stubs/plugins/catch_decorator.pyi +3 -3
  80. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  81. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  82. metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
  83. metaflow-stubs/plugins/datatools/s3/s3.pyi +5 -5
  84. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  85. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  86. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  87. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  88. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  89. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  90. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  91. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  92. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  93. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +4 -4
  94. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  95. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  96. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  97. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  98. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  99. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +3 -3
  100. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  101. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  102. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
  103. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
  104. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  105. metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
  106. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  107. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  108. metaflow-stubs/plugins/pypi/__init__.pyi +3 -3
  109. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  110. metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
  111. metaflow-stubs/plugins/pypi/parsers.pyi +2 -2
  112. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  113. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  114. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  115. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  116. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  117. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  118. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +4 -4
  119. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  120. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  121. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  122. metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
  123. metaflow-stubs/pylint_wrapper.pyi +2 -2
  124. metaflow-stubs/runner/__init__.pyi +2 -2
  125. metaflow-stubs/runner/deployer.pyi +31 -31
  126. metaflow-stubs/runner/deployer_impl.pyi +3 -3
  127. metaflow-stubs/runner/metaflow_runner.pyi +3 -3
  128. metaflow-stubs/runner/nbdeploy.pyi +2 -2
  129. metaflow-stubs/runner/nbrun.pyi +2 -2
  130. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  131. metaflow-stubs/runner/utils.pyi +4 -4
  132. metaflow-stubs/system/__init__.pyi +2 -2
  133. metaflow-stubs/system/system_logger.pyi +3 -3
  134. metaflow-stubs/system/system_monitor.pyi +2 -2
  135. metaflow-stubs/tagging_util.pyi +2 -2
  136. metaflow-stubs/tuple_util.pyi +2 -2
  137. metaflow-stubs/user_configs/__init__.pyi +2 -2
  138. metaflow-stubs/user_configs/config_decorators.pyi +6 -6
  139. metaflow-stubs/user_configs/config_options.pyi +4 -4
  140. metaflow-stubs/user_configs/config_parameters.pyi +6 -6
  141. metaflow-stubs/version.pyi +2 -2
  142. {metaflow_stubs-2.15.2.dist-info → metaflow_stubs-2.15.4.dist-info}/METADATA +2 -2
  143. metaflow_stubs-2.15.4.dist-info/RECORD +146 -0
  144. metaflow_stubs-2.15.2.dist-info/RECORD +0 -146
  145. {metaflow_stubs-2.15.2.dist-info → metaflow_stubs-2.15.4.dist-info}/WHEEL +0 -0
  146. {metaflow_stubs-2.15.2.dist-info → metaflow_stubs-2.15.4.dist-info}/top_level.txt +0 -0
@@ -1,15 +1,15 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.15.2 #
4
- # Generated on 2025-03-01T03:37:26.010128 #
3
+ # MF version: 2.15.4 #
4
+ # Generated on 2025-03-05T12:14:55.417380 #
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
 
@@ -35,15 +35,15 @@ from .user_configs.config_parameters import ConfigValue as ConfigValue
35
35
  from .user_configs.config_parameters import config_expr as config_expr
36
36
  from .user_configs.config_decorators import CustomFlowDecorator as CustomFlowDecorator
37
37
  from .user_configs.config_decorators import CustomStepDecorator as CustomStepDecorator
38
- from . import events as events
39
38
  from . import tuple_util as tuple_util
39
+ from . import events as events
40
40
  from . import runner as runner
41
41
  from . import plugins as plugins
42
42
  from .plugins.datatools.s3.s3 import S3 as S3
43
43
  from . import includefile as includefile
44
44
  from .includefile import IncludeFile as IncludeFile
45
- from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
46
45
  from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
46
+ from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
47
47
  from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
48
48
  from . import cards as cards
49
49
  from . import client as client
@@ -200,6 +200,65 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
200
200
  """
201
201
  ...
202
202
 
203
+ @typing.overload
204
+ def conda(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
205
+ """
206
+ Specifies the Conda environment for the step.
207
+
208
+ Information in this decorator will augment any
209
+ attributes set in the `@conda_base` flow-level decorator. Hence,
210
+ you can use `@conda_base` to set packages required by all
211
+ steps and use `@conda` to specify step-specific overrides.
212
+
213
+
214
+ Parameters
215
+ ----------
216
+ packages : Dict[str, str], default {}
217
+ Packages to use for this step. The key is the name of the package
218
+ and the value is the version to use.
219
+ libraries : Dict[str, str], default {}
220
+ Supported for backward compatibility. When used with packages, packages will take precedence.
221
+ python : str, optional, default None
222
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
223
+ that the version used will correspond to the version of the Python interpreter used to start the run.
224
+ disabled : bool, default False
225
+ If set to True, disables @conda.
226
+ """
227
+ ...
228
+
229
+ @typing.overload
230
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
231
+ ...
232
+
233
+ @typing.overload
234
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
235
+ ...
236
+
237
+ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
238
+ """
239
+ Specifies the Conda environment for the step.
240
+
241
+ Information in this decorator will augment any
242
+ attributes set in the `@conda_base` flow-level decorator. Hence,
243
+ you can use `@conda_base` to set packages required by all
244
+ steps and use `@conda` to specify step-specific overrides.
245
+
246
+
247
+ Parameters
248
+ ----------
249
+ packages : Dict[str, str], default {}
250
+ Packages to use for this step. The key is the name of the package
251
+ and the value is the version to use.
252
+ libraries : Dict[str, str], default {}
253
+ Supported for backward compatibility. When used with packages, packages will take precedence.
254
+ python : str, optional, default None
255
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
256
+ that the version used will correspond to the version of the Python interpreter used to start the run.
257
+ disabled : bool, default False
258
+ If set to True, disables @conda.
259
+ """
260
+ ...
261
+
203
262
  @typing.overload
204
263
  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]]]:
205
264
  """
@@ -252,21 +311,61 @@ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
252
311
  ...
253
312
 
254
313
  @typing.overload
255
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
314
+ 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]]]:
256
315
  """
257
- Decorator prototype for all step decorators. This function gets specialized
258
- and imported for all decorators types by _import_plugin_decorators().
316
+ Specifies a timeout for your step.
317
+
318
+ This decorator is useful if this step may hang indefinitely.
319
+
320
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
321
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
322
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
323
+
324
+ Note that all the values specified in parameters are added together so if you specify
325
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
326
+
327
+
328
+ Parameters
329
+ ----------
330
+ seconds : int, default 0
331
+ Number of seconds to wait prior to timing out.
332
+ minutes : int, default 0
333
+ Number of minutes to wait prior to timing out.
334
+ hours : int, default 0
335
+ Number of hours to wait prior to timing out.
259
336
  """
260
337
  ...
261
338
 
262
339
  @typing.overload
263
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
340
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
264
341
  ...
265
342
 
266
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
343
+ @typing.overload
344
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
345
+ ...
346
+
347
+ 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):
267
348
  """
268
- Decorator prototype for all step decorators. This function gets specialized
269
- and imported for all decorators types by _import_plugin_decorators().
349
+ Specifies a timeout for your step.
350
+
351
+ This decorator is useful if this step may hang indefinitely.
352
+
353
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
354
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
355
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
356
+
357
+ Note that all the values specified in parameters are added together so if you specify
358
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
359
+
360
+
361
+ Parameters
362
+ ----------
363
+ seconds : int, default 0
364
+ Number of seconds to wait prior to timing out.
365
+ minutes : int, default 0
366
+ Number of minutes to wait prior to timing out.
367
+ hours : int, default 0
368
+ Number of hours to wait prior to timing out.
270
369
  """
271
370
  ...
272
371
 
@@ -322,304 +421,84 @@ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
322
421
  ...
323
422
 
324
423
  @typing.overload
325
- 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, 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]]]:
424
+ 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]]]:
326
425
  """
327
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
426
+ Specifies environment variables to be set prior to the execution of a step.
328
427
 
329
428
 
330
429
  Parameters
331
430
  ----------
332
- cpu : int, default 1
333
- Number of CPUs required for this step. If `@resources` is
334
- also present, the maximum value from all decorators is used.
335
- gpu : int, default 0
336
- Number of GPUs required for this step. If `@resources` is
337
- also present, the maximum value from all decorators is used.
338
- memory : int, default 4096
339
- Memory size (in MB) required for this step. If
340
- `@resources` is also present, the maximum value from all decorators is
341
- used.
342
- image : str, optional, default None
343
- Docker image to use when launching on AWS Batch. If not specified, and
344
- METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
345
- not, a default Docker image mapping to the current version of Python is used.
346
- queue : str, default METAFLOW_BATCH_JOB_QUEUE
347
- AWS Batch Job Queue to submit the job to.
348
- iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
349
- AWS IAM role that AWS Batch container uses to access AWS cloud resources.
350
- execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
351
- AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
352
- (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
353
- shared_memory : int, optional, default None
354
- The value for the size (in MiB) of the /dev/shm volume for this step.
355
- This parameter maps to the `--shm-size` option in Docker.
356
- max_swap : int, optional, default None
357
- The total amount of swap memory (in MiB) a container can use for this
358
- step. This parameter is translated to the `--memory-swap` option in
359
- Docker where the value is the sum of the container memory plus the
360
- `max_swap` value.
361
- swappiness : int, optional, default None
362
- This allows you to tune memory swappiness behavior for this step.
363
- A swappiness value of 0 causes swapping not to happen unless absolutely
364
- necessary. A swappiness value of 100 causes pages to be swapped very
365
- aggressively. Accepted values are whole numbers between 0 and 100.
366
- use_tmpfs : bool, default False
367
- This enables an explicit tmpfs mount for this step. Note that tmpfs is
368
- not available on Fargate compute environments
369
- tmpfs_tempdir : bool, default True
370
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
371
- tmpfs_size : int, optional, default None
372
- The value for the size (in MiB) of the tmpfs mount for this step.
373
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
374
- memory allocated for this step.
375
- tmpfs_path : str, optional, default None
376
- Path to tmpfs mount for this step. Defaults to /metaflow_temp.
377
- inferentia : int, default 0
378
- Number of Inferentia chips required for this step.
379
- trainium : int, default None
380
- Alias for inferentia. Use only one of the two.
381
- efa : int, default 0
382
- Number of elastic fabric adapter network devices to attach to container
383
- ephemeral_storage : int, default None
384
- The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
385
- This is only relevant for Fargate compute environments
386
- log_driver: str, optional, default None
387
- The log driver to use for the Amazon ECS container.
388
- log_options: List[str], optional, default None
389
- List of strings containing options for the chosen log driver. The configurable values
390
- depend on the `log driver` chosen. Validation of these options is not supported yet.
391
- Example: [`awslogs-group:aws/batch/job`]
431
+ vars : Dict[str, str], default {}
432
+ Dictionary of environment variables to set.
392
433
  """
393
434
  ...
394
435
 
395
436
  @typing.overload
396
- def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
437
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
397
438
  ...
398
439
 
399
440
  @typing.overload
400
- def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
441
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
401
442
  ...
402
443
 
403
- 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, 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):
444
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
404
445
  """
405
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
446
+ Specifies environment variables to be set prior to the execution of a step.
406
447
 
407
448
 
408
449
  Parameters
409
450
  ----------
410
- cpu : int, default 1
411
- Number of CPUs required for this step. If `@resources` is
412
- also present, the maximum value from all decorators is used.
413
- gpu : int, default 0
414
- Number of GPUs required for this step. If `@resources` is
415
- also present, the maximum value from all decorators is used.
416
- memory : int, default 4096
417
- Memory size (in MB) required for this step. If
418
- `@resources` is also present, the maximum value from all decorators is
419
- used.
420
- image : str, optional, default None
421
- Docker image to use when launching on AWS Batch. If not specified, and
422
- METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
423
- not, a default Docker image mapping to the current version of Python is used.
424
- queue : str, default METAFLOW_BATCH_JOB_QUEUE
425
- AWS Batch Job Queue to submit the job to.
426
- iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
427
- AWS IAM role that AWS Batch container uses to access AWS cloud resources.
428
- execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
429
- AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
430
- (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
431
- shared_memory : int, optional, default None
432
- The value for the size (in MiB) of the /dev/shm volume for this step.
433
- This parameter maps to the `--shm-size` option in Docker.
434
- max_swap : int, optional, default None
435
- The total amount of swap memory (in MiB) a container can use for this
436
- step. This parameter is translated to the `--memory-swap` option in
437
- Docker where the value is the sum of the container memory plus the
438
- `max_swap` value.
439
- swappiness : int, optional, default None
440
- This allows you to tune memory swappiness behavior for this step.
441
- A swappiness value of 0 causes swapping not to happen unless absolutely
442
- necessary. A swappiness value of 100 causes pages to be swapped very
443
- aggressively. Accepted values are whole numbers between 0 and 100.
444
- use_tmpfs : bool, default False
445
- This enables an explicit tmpfs mount for this step. Note that tmpfs is
446
- not available on Fargate compute environments
447
- tmpfs_tempdir : bool, default True
448
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
449
- tmpfs_size : int, optional, default None
450
- The value for the size (in MiB) of the tmpfs mount for this step.
451
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
452
- memory allocated for this step.
453
- tmpfs_path : str, optional, default None
454
- Path to tmpfs mount for this step. Defaults to /metaflow_temp.
455
- inferentia : int, default 0
456
- Number of Inferentia chips required for this step.
457
- trainium : int, default None
458
- Alias for inferentia. Use only one of the two.
459
- efa : int, default 0
460
- Number of elastic fabric adapter network devices to attach to container
461
- ephemeral_storage : int, default None
462
- The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
463
- This is only relevant for Fargate compute environments
464
- log_driver: str, optional, default None
465
- The log driver to use for the Amazon ECS container.
466
- log_options: List[str], optional, default None
467
- List of strings containing options for the chosen log driver. The configurable values
468
- depend on the `log driver` chosen. Validation of these options is not supported yet.
469
- Example: [`awslogs-group:aws/batch/job`]
451
+ vars : Dict[str, str], default {}
452
+ Dictionary of environment variables to set.
470
453
  """
471
454
  ...
472
455
 
473
456
  @typing.overload
474
- 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]]]:
475
- """
476
- Specifies a timeout for your step.
477
-
478
- This decorator is useful if this step may hang indefinitely.
479
-
480
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
481
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
482
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
483
-
484
- Note that all the values specified in parameters are added together so if you specify
485
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
486
-
487
-
488
- Parameters
489
- ----------
490
- seconds : int, default 0
491
- Number of seconds to wait prior to timing out.
492
- minutes : int, default 0
493
- Number of minutes to wait prior to timing out.
494
- hours : int, default 0
495
- Number of hours to wait prior to timing out.
496
- """
497
- ...
498
-
499
- @typing.overload
500
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
501
- ...
502
-
503
- @typing.overload
504
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
505
- ...
506
-
507
- 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):
508
- """
509
- Specifies a timeout for your step.
510
-
511
- This decorator is useful if this step may hang indefinitely.
512
-
513
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
514
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
515
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
516
-
517
- Note that all the values specified in parameters are added together so if you specify
518
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
519
-
520
-
521
- Parameters
522
- ----------
523
- seconds : int, default 0
524
- Number of seconds to wait prior to timing out.
525
- minutes : int, default 0
526
- Number of minutes to wait prior to timing out.
527
- hours : int, default 0
528
- Number of hours to wait prior to timing out.
529
- """
530
- ...
531
-
532
- @typing.overload
533
- def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
534
- """
535
- Specifies secrets to be retrieved and injected as environment variables prior to
536
- the execution of a step.
537
-
538
-
539
- Parameters
540
- ----------
541
- sources : List[Union[str, Dict[str, Any]]], default: []
542
- List of secret specs, defining how the secrets are to be retrieved
543
- """
544
- ...
545
-
546
- @typing.overload
547
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
548
- ...
549
-
550
- @typing.overload
551
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
552
- ...
553
-
554
- 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]]] = []):
555
- """
556
- Specifies secrets to be retrieved and injected as environment variables prior to
557
- the execution of a step.
558
-
559
-
560
- Parameters
561
- ----------
562
- sources : List[Union[str, Dict[str, Any]]], default: []
563
- List of secret specs, defining how the secrets are to be retrieved
564
- """
565
- ...
566
-
567
- @typing.overload
568
- def conda(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
457
+ 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]]]:
569
458
  """
570
- Specifies the Conda environment for the step.
459
+ Creates a human-readable report, a Metaflow Card, after this step completes.
571
460
 
572
- Information in this decorator will augment any
573
- attributes set in the `@conda_base` flow-level decorator. Hence,
574
- you can use `@conda_base` to set packages required by all
575
- steps and use `@conda` to specify step-specific overrides.
461
+ Note that you may add multiple `@card` decorators in a step with different parameters.
576
462
 
577
463
 
578
464
  Parameters
579
465
  ----------
580
- packages : Dict[str, str], default {}
581
- Packages to use for this step. The key is the name of the package
582
- and the value is the version to use.
583
- libraries : Dict[str, str], default {}
584
- Supported for backward compatibility. When used with packages, packages will take precedence.
585
- python : str, optional, default None
586
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
587
- that the version used will correspond to the version of the Python interpreter used to start the run.
588
- disabled : bool, default False
589
- If set to True, disables @conda.
466
+ type : str, default 'default'
467
+ Card type.
468
+ id : str, optional, default None
469
+ If multiple cards are present, use this id to identify this card.
470
+ options : Dict[str, Any], default {}
471
+ Options passed to the card. The contents depend on the card type.
472
+ timeout : int, default 45
473
+ Interrupt reporting if it takes more than this many seconds.
590
474
  """
591
475
  ...
592
476
 
593
477
  @typing.overload
594
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
478
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
595
479
  ...
596
480
 
597
481
  @typing.overload
598
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
482
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
599
483
  ...
600
484
 
601
- def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
485
+ 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):
602
486
  """
603
- Specifies the Conda environment for the step.
487
+ Creates a human-readable report, a Metaflow Card, after this step completes.
604
488
 
605
- Information in this decorator will augment any
606
- attributes set in the `@conda_base` flow-level decorator. Hence,
607
- you can use `@conda_base` to set packages required by all
608
- steps and use `@conda` to specify step-specific overrides.
489
+ Note that you may add multiple `@card` decorators in a step with different parameters.
609
490
 
610
491
 
611
492
  Parameters
612
493
  ----------
613
- packages : Dict[str, str], default {}
614
- Packages to use for this step. The key is the name of the package
615
- and the value is the version to use.
616
- libraries : Dict[str, str], default {}
617
- Supported for backward compatibility. When used with packages, packages will take precedence.
618
- python : str, optional, default None
619
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
620
- that the version used will correspond to the version of the Python interpreter used to start the run.
621
- disabled : bool, default False
622
- If set to True, disables @conda.
494
+ type : str, default 'default'
495
+ Card type.
496
+ id : str, optional, default None
497
+ If multiple cards are present, use this id to identify this card.
498
+ options : Dict[str, Any], default {}
499
+ Options passed to the card. The contents depend on the card type.
500
+ timeout : int, default 45
501
+ Interrupt reporting if it takes more than this many seconds.
623
502
  """
624
503
  ...
625
504
 
@@ -702,9 +581,29 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
702
581
  """
703
582
  ...
704
583
 
705
- def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[str] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable') -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
584
+ @typing.overload
585
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
706
586
  """
707
- Specifies that this step should execute on Kubernetes.
587
+ Decorator prototype for all step decorators. This function gets specialized
588
+ and imported for all decorators types by _import_plugin_decorators().
589
+ """
590
+ ...
591
+
592
+ @typing.overload
593
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
594
+ ...
595
+
596
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
597
+ """
598
+ Decorator prototype for all step decorators. This function gets specialized
599
+ and imported for all decorators types by _import_plugin_decorators().
600
+ """
601
+ ...
602
+
603
+ @typing.overload
604
+ 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, 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]]]:
605
+ """
606
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
708
607
 
709
608
 
710
609
  Parameters
@@ -712,341 +611,301 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
712
611
  cpu : int, default 1
713
612
  Number of CPUs required for this step. If `@resources` is
714
613
  also present, the maximum value from all decorators is used.
614
+ gpu : int, default 0
615
+ Number of GPUs required for this step. If `@resources` is
616
+ also present, the maximum value from all decorators is used.
715
617
  memory : int, default 4096
716
618
  Memory size (in MB) required for this step. If
717
619
  `@resources` is also present, the maximum value from all decorators is
718
620
  used.
719
- disk : int, default 10240
720
- Disk size (in MB) required for this step. If
721
- `@resources` is also present, the maximum value from all decorators is
722
- used.
723
621
  image : str, optional, default None
724
- Docker image to use when launching on Kubernetes. If not specified, and
725
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
622
+ Docker image to use when launching on AWS Batch. If not specified, and
623
+ METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
726
624
  not, a default Docker image mapping to the current version of Python is used.
727
- image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
728
- If given, the imagePullPolicy to be applied to the Docker image of the step.
729
- service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
730
- Kubernetes service account to use when launching pod in Kubernetes.
731
- secrets : List[str], optional, default None
732
- Kubernetes secrets to use when launching pod in Kubernetes. These
733
- secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
734
- in Metaflow configuration.
735
- node_selector: Union[Dict[str,str], str], optional, default None
736
- Kubernetes node selector(s) to apply to the pod running the task.
737
- Can be passed in as a comma separated string of values e.g.
738
- 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
739
- {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
740
- namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
741
- Kubernetes namespace to use when launching pod in Kubernetes.
742
- gpu : int, optional, default None
743
- Number of GPUs required for this step. A value of zero implies that
744
- the scheduled node should not have GPUs.
745
- gpu_vendor : str, default KUBERNETES_GPU_VENDOR
746
- The vendor of the GPUs to be used for this step.
747
- tolerations : List[str], default []
748
- The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
749
- Kubernetes tolerations to use when launching pod in Kubernetes.
750
- labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
751
- Kubernetes labels to use when launching pod in Kubernetes.
752
- annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
753
- Kubernetes annotations to use when launching pod in Kubernetes.
625
+ queue : str, default METAFLOW_BATCH_JOB_QUEUE
626
+ AWS Batch Job Queue to submit the job to.
627
+ iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
628
+ AWS IAM role that AWS Batch container uses to access AWS cloud resources.
629
+ execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
630
+ AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
631
+ (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
632
+ shared_memory : int, optional, default None
633
+ The value for the size (in MiB) of the /dev/shm volume for this step.
634
+ This parameter maps to the `--shm-size` option in Docker.
635
+ max_swap : int, optional, default None
636
+ The total amount of swap memory (in MiB) a container can use for this
637
+ step. This parameter is translated to the `--memory-swap` option in
638
+ Docker where the value is the sum of the container memory plus the
639
+ `max_swap` value.
640
+ swappiness : int, optional, default None
641
+ This allows you to tune memory swappiness behavior for this step.
642
+ A swappiness value of 0 causes swapping not to happen unless absolutely
643
+ necessary. A swappiness value of 100 causes pages to be swapped very
644
+ aggressively. Accepted values are whole numbers between 0 and 100.
754
645
  use_tmpfs : bool, default False
755
- This enables an explicit tmpfs mount for this step.
646
+ This enables an explicit tmpfs mount for this step. Note that tmpfs is
647
+ not available on Fargate compute environments
756
648
  tmpfs_tempdir : bool, default True
757
649
  sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
758
- tmpfs_size : int, optional, default: None
650
+ tmpfs_size : int, optional, default None
759
651
  The value for the size (in MiB) of the tmpfs mount for this step.
760
652
  This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
761
653
  memory allocated for this step.
762
- tmpfs_path : str, optional, default /metaflow_temp
763
- Path to tmpfs mount for this step.
764
- persistent_volume_claims : Dict[str, str], optional, default None
765
- A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
766
- volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
767
- shared_memory: int, optional
768
- Shared memory size (in MiB) required for this step
769
- port: int, optional
770
- Port number to specify in the Kubernetes job object
771
- compute_pool : str, optional, default None
772
- Compute pool to be used for for this step.
773
- If not specified, any accessible compute pool within the perimeter is used.
774
- hostname_resolution_timeout: int, default 10 * 60
775
- Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
776
- Only applicable when @parallel is used.
777
- qos: str, default: Burstable
778
- Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
779
- """
780
- ...
781
-
782
- @typing.overload
783
- 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]]]:
784
- """
785
- Creates a human-readable report, a Metaflow Card, after this step completes.
786
-
787
- Note that you may add multiple `@card` decorators in a step with different parameters.
788
-
789
-
790
- Parameters
791
- ----------
792
- type : str, default 'default'
793
- Card type.
794
- id : str, optional, default None
795
- If multiple cards are present, use this id to identify this card.
796
- options : Dict[str, Any], default {}
797
- Options passed to the card. The contents depend on the card type.
798
- timeout : int, default 45
799
- Interrupt reporting if it takes more than this many seconds.
654
+ tmpfs_path : str, optional, default None
655
+ Path to tmpfs mount for this step. Defaults to /metaflow_temp.
656
+ inferentia : int, default 0
657
+ Number of Inferentia chips required for this step.
658
+ trainium : int, default None
659
+ Alias for inferentia. Use only one of the two.
660
+ efa : int, default 0
661
+ Number of elastic fabric adapter network devices to attach to container
662
+ ephemeral_storage : int, default None
663
+ The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
664
+ This is only relevant for Fargate compute environments
665
+ log_driver: str, optional, default None
666
+ The log driver to use for the Amazon ECS container.
667
+ log_options: List[str], optional, default None
668
+ List of strings containing options for the chosen log driver. The configurable values
669
+ depend on the `log driver` chosen. Validation of these options is not supported yet.
670
+ Example: [`awslogs-group:aws/batch/job`]
800
671
  """
801
672
  ...
802
673
 
803
674
  @typing.overload
804
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
675
+ def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
805
676
  ...
806
677
 
807
678
  @typing.overload
808
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
679
+ def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
809
680
  ...
810
681
 
811
- 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):
682
+ 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, 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):
812
683
  """
813
- Creates a human-readable report, a Metaflow Card, after this step completes.
814
-
815
- Note that you may add multiple `@card` decorators in a step with different parameters.
684
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
816
685
 
817
686
 
818
687
  Parameters
819
688
  ----------
820
- type : str, default 'default'
821
- Card type.
822
- id : str, optional, default None
823
- If multiple cards are present, use this id to identify this card.
824
- options : Dict[str, Any], default {}
825
- Options passed to the card. The contents depend on the card type.
826
- timeout : int, default 45
827
- Interrupt reporting if it takes more than this many seconds.
689
+ cpu : int, default 1
690
+ Number of CPUs required for this step. If `@resources` is
691
+ also present, the maximum value from all decorators is used.
692
+ gpu : int, default 0
693
+ Number of GPUs required for this step. If `@resources` is
694
+ also present, the maximum value from all decorators is used.
695
+ memory : int, default 4096
696
+ Memory size (in MB) required for this step. If
697
+ `@resources` is also present, the maximum value from all decorators is
698
+ used.
699
+ image : str, optional, default None
700
+ Docker image to use when launching on AWS Batch. If not specified, and
701
+ METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
702
+ not, a default Docker image mapping to the current version of Python is used.
703
+ queue : str, default METAFLOW_BATCH_JOB_QUEUE
704
+ AWS Batch Job Queue to submit the job to.
705
+ iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
706
+ AWS IAM role that AWS Batch container uses to access AWS cloud resources.
707
+ execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
708
+ AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
709
+ (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
710
+ shared_memory : int, optional, default None
711
+ The value for the size (in MiB) of the /dev/shm volume for this step.
712
+ This parameter maps to the `--shm-size` option in Docker.
713
+ max_swap : int, optional, default None
714
+ The total amount of swap memory (in MiB) a container can use for this
715
+ step. This parameter is translated to the `--memory-swap` option in
716
+ Docker where the value is the sum of the container memory plus the
717
+ `max_swap` value.
718
+ swappiness : int, optional, default None
719
+ This allows you to tune memory swappiness behavior for this step.
720
+ A swappiness value of 0 causes swapping not to happen unless absolutely
721
+ necessary. A swappiness value of 100 causes pages to be swapped very
722
+ aggressively. Accepted values are whole numbers between 0 and 100.
723
+ use_tmpfs : bool, default False
724
+ This enables an explicit tmpfs mount for this step. Note that tmpfs is
725
+ not available on Fargate compute environments
726
+ tmpfs_tempdir : bool, default True
727
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
728
+ tmpfs_size : int, optional, default None
729
+ The value for the size (in MiB) of the tmpfs mount for this step.
730
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
731
+ memory allocated for this step.
732
+ tmpfs_path : str, optional, default None
733
+ Path to tmpfs mount for this step. Defaults to /metaflow_temp.
734
+ inferentia : int, default 0
735
+ Number of Inferentia chips required for this step.
736
+ trainium : int, default None
737
+ Alias for inferentia. Use only one of the two.
738
+ efa : int, default 0
739
+ Number of elastic fabric adapter network devices to attach to container
740
+ ephemeral_storage : int, default None
741
+ The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
742
+ This is only relevant for Fargate compute environments
743
+ log_driver: str, optional, default None
744
+ The log driver to use for the Amazon ECS container.
745
+ log_options: List[str], optional, default None
746
+ List of strings containing options for the chosen log driver. The configurable values
747
+ depend on the `log driver` chosen. Validation of these options is not supported yet.
748
+ Example: [`awslogs-group:aws/batch/job`]
828
749
  """
829
750
  ...
830
751
 
831
- @typing.overload
832
- 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]]]:
752
+ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[str] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable') -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
833
753
  """
834
- Specifies environment variables to be set prior to the execution of a step.
754
+ Specifies that this step should execute on Kubernetes.
835
755
 
836
756
 
837
757
  Parameters
838
758
  ----------
839
- vars : Dict[str, str], default {}
840
- Dictionary of environment variables to set.
759
+ cpu : int, default 1
760
+ Number of CPUs required for this step. If `@resources` is
761
+ also present, the maximum value from all decorators is used.
762
+ memory : int, default 4096
763
+ Memory size (in MB) required for this step. If
764
+ `@resources` is also present, the maximum value from all decorators is
765
+ used.
766
+ disk : int, default 10240
767
+ Disk size (in MB) required for this step. If
768
+ `@resources` is also present, the maximum value from all decorators is
769
+ used.
770
+ image : str, optional, default None
771
+ Docker image to use when launching on Kubernetes. If not specified, and
772
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
773
+ not, a default Docker image mapping to the current version of Python is used.
774
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
775
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
776
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
777
+ Kubernetes service account to use when launching pod in Kubernetes.
778
+ secrets : List[str], optional, default None
779
+ Kubernetes secrets to use when launching pod in Kubernetes. These
780
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
781
+ in Metaflow configuration.
782
+ node_selector: Union[Dict[str,str], str], optional, default None
783
+ Kubernetes node selector(s) to apply to the pod running the task.
784
+ Can be passed in as a comma separated string of values e.g.
785
+ 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
786
+ {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
787
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
788
+ Kubernetes namespace to use when launching pod in Kubernetes.
789
+ gpu : int, optional, default None
790
+ Number of GPUs required for this step. A value of zero implies that
791
+ the scheduled node should not have GPUs.
792
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
793
+ The vendor of the GPUs to be used for this step.
794
+ tolerations : List[str], default []
795
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
796
+ Kubernetes tolerations to use when launching pod in Kubernetes.
797
+ labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
798
+ Kubernetes labels to use when launching pod in Kubernetes.
799
+ annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
800
+ Kubernetes annotations to use when launching pod in Kubernetes.
801
+ use_tmpfs : bool, default False
802
+ This enables an explicit tmpfs mount for this step.
803
+ tmpfs_tempdir : bool, default True
804
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
805
+ tmpfs_size : int, optional, default: None
806
+ The value for the size (in MiB) of the tmpfs mount for this step.
807
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
808
+ memory allocated for this step.
809
+ tmpfs_path : str, optional, default /metaflow_temp
810
+ Path to tmpfs mount for this step.
811
+ persistent_volume_claims : Dict[str, str], optional, default None
812
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
813
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
814
+ shared_memory: int, optional
815
+ Shared memory size (in MiB) required for this step
816
+ port: int, optional
817
+ Port number to specify in the Kubernetes job object
818
+ compute_pool : str, optional, default None
819
+ Compute pool to be used for for this step.
820
+ If not specified, any accessible compute pool within the perimeter is used.
821
+ hostname_resolution_timeout: int, default 10 * 60
822
+ Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
823
+ Only applicable when @parallel is used.
824
+ qos: str, default: Burstable
825
+ Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
841
826
  """
842
827
  ...
843
828
 
844
829
  @typing.overload
845
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
846
- ...
847
-
848
- @typing.overload
849
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
850
- ...
851
-
852
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
830
+ def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
853
831
  """
854
- Specifies environment variables to be set prior to the execution of a step.
832
+ Specifies secrets to be retrieved and injected as environment variables prior to
833
+ the execution of a step.
855
834
 
856
835
 
857
836
  Parameters
858
837
  ----------
859
- vars : Dict[str, str], default {}
860
- Dictionary of environment variables to set.
838
+ sources : List[Union[str, Dict[str, Any]]], default: []
839
+ List of secret specs, defining how the secrets are to be retrieved
861
840
  """
862
841
  ...
863
842
 
864
843
  @typing.overload
865
- 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]]:
866
- """
867
- Specifies the times when the flow should be run when running on a
868
- production scheduler.
869
-
870
-
871
- Parameters
872
- ----------
873
- hourly : bool, default False
874
- Run the workflow hourly.
875
- daily : bool, default True
876
- Run the workflow daily.
877
- weekly : bool, default False
878
- Run the workflow weekly.
879
- cron : str, optional, default None
880
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
881
- specified by this expression.
882
- timezone : str, optional, default None
883
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
884
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
885
- """
844
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
886
845
  ...
887
846
 
888
847
  @typing.overload
889
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
848
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
890
849
  ...
891
850
 
892
- 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):
851
+ 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]]] = []):
893
852
  """
894
- Specifies the times when the flow should be run when running on a
895
- production scheduler.
853
+ Specifies secrets to be retrieved and injected as environment variables prior to
854
+ the execution of a step.
896
855
 
897
856
 
898
857
  Parameters
899
858
  ----------
900
- hourly : bool, default False
901
- Run the workflow hourly.
902
- daily : bool, default True
903
- Run the workflow daily.
904
- weekly : bool, default False
905
- Run the workflow weekly.
906
- cron : str, optional, default None
907
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
908
- specified by this expression.
909
- timezone : str, optional, default None
910
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
911
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
859
+ sources : List[Union[str, Dict[str, Any]]], default: []
860
+ List of secret specs, defining how the secrets are to be retrieved
912
861
  """
913
862
  ...
914
863
 
915
864
  @typing.overload
916
- def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
865
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
917
866
  """
918
- Specifies the event(s) that this flow depends on.
919
-
920
- ```
921
- @trigger(event='foo')
922
- ```
923
- or
924
- ```
925
- @trigger(events=['foo', 'bar'])
926
- ```
927
-
928
- Additionally, you can specify the parameter mappings
929
- to map event payload to Metaflow parameters for the flow.
930
- ```
931
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
932
- ```
933
- or
934
- ```
935
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
936
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
937
- ```
938
-
939
- 'parameters' can also be a list of strings and tuples like so:
940
- ```
941
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
942
- ```
943
- This is equivalent to:
944
- ```
945
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
946
- ```
867
+ Specifies the PyPI packages for all steps of the flow.
947
868
 
869
+ Use `@pypi_base` to set common packages required by all
870
+ steps and use `@pypi` to specify step-specific overrides.
948
871
 
949
872
  Parameters
950
873
  ----------
951
- event : Union[str, Dict[str, Any]], optional, default None
952
- Event dependency for this flow.
953
- events : List[Union[str, Dict[str, Any]]], default []
954
- Events dependency for this flow.
955
- options : Dict[str, Any], default {}
956
- Backend-specific configuration for tuning eventing behavior.
874
+ packages : Dict[str, str], default: {}
875
+ Packages to use for this flow. The key is the name of the package
876
+ and the value is the version to use.
877
+ python : str, optional, default: None
878
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
879
+ that the version used will correspond to the version of the Python interpreter used to start the run.
957
880
  """
958
881
  ...
959
882
 
960
883
  @typing.overload
961
- def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
962
- ...
963
-
964
- def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
965
- """
966
- Specifies the event(s) that this flow depends on.
967
-
968
- ```
969
- @trigger(event='foo')
970
- ```
971
- or
972
- ```
973
- @trigger(events=['foo', 'bar'])
974
- ```
975
-
976
- Additionally, you can specify the parameter mappings
977
- to map event payload to Metaflow parameters for the flow.
978
- ```
979
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
980
- ```
981
- or
982
- ```
983
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
984
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
985
- ```
986
-
987
- 'parameters' can also be a list of strings and tuples like so:
988
- ```
989
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
990
- ```
991
- This is equivalent to:
992
- ```
993
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
994
- ```
995
-
996
-
997
- Parameters
998
- ----------
999
- event : Union[str, Dict[str, Any]], optional, default None
1000
- Event dependency for this flow.
1001
- events : List[Union[str, Dict[str, Any]]], default []
1002
- Events dependency for this flow.
1003
- options : Dict[str, Any], default {}
1004
- Backend-specific configuration for tuning eventing behavior.
1005
- """
884
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1006
885
  ...
1007
886
 
1008
- def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
887
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1009
888
  """
1010
- Specifies what flows belong to the same project.
1011
-
1012
- A project-specific namespace is created for all flows that
1013
- use the same `@project(name)`.
889
+ Specifies the PyPI packages for all steps of the flow.
1014
890
 
891
+ Use `@pypi_base` to set common packages required by all
892
+ steps and use `@pypi` to specify step-specific overrides.
1015
893
 
1016
894
  Parameters
1017
895
  ----------
1018
- name : str
1019
- Project name. Make sure that the name is unique amongst all
1020
- projects that use the same production scheduler. The name may
1021
- contain only lowercase alphanumeric characters and underscores.
1022
-
1023
- branch : Optional[str], default None
1024
- The branch to use. If not specified, the branch is set to
1025
- `user.<username>` unless `production` is set to `True`. This can
1026
- also be set on the command line using `--branch` as a top-level option.
1027
- It is an error to specify `branch` in the decorator and on the command line.
1028
-
1029
- production : bool, default False
1030
- Whether or not the branch is the production branch. This can also be set on the
1031
- command line using `--production` as a top-level option. It is an error to specify
1032
- `production` in the decorator and on the command line.
1033
- The project branch name will be:
1034
- - if `branch` is specified:
1035
- - if `production` is True: `prod.<branch>`
1036
- - if `production` is False: `test.<branch>`
1037
- - if `branch` is not specified:
1038
- - if `production` is True: `prod`
1039
- - if `production` is False: `user.<username>`
896
+ packages : Dict[str, str], default: {}
897
+ Packages to use for this flow. The key is the name of the package
898
+ and the value is the version to use.
899
+ python : str, optional, default: None
900
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
901
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1040
902
  """
1041
903
  ...
1042
904
 
1043
- 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]]:
905
+ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, external_dag_id: str, external_task_ids: typing.List[str], allowed_states: typing.List[str], failed_states: typing.List[str], execution_delta: "datetime.timedelta", check_existence: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1044
906
  """
1045
- 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)
1046
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1047
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1048
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1049
- starts only after all sensors finish.
907
+ The `@airflow_external_task_sensor` decorator attaches a Airflow [ExternalTaskSensor](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/sensors/external_task/index.html#airflow.sensors.external_task.ExternalTaskSensor) before the start step of the flow.
908
+ This decorator only works when a flow is scheduled on Airflow and is compiled using `airflow create`. More than one `@airflow_external_task_sensor` can be added as a flow decorators. Adding more than one decorator will ensure that `start` step starts only after all sensors finish.
1050
909
 
1051
910
 
1052
911
  Parameters
@@ -1068,25 +927,31 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
1068
927
  Name of the sensor on Airflow
1069
928
  description : str
1070
929
  Description of sensor in the Airflow UI
1071
- bucket_key : Union[str, List[str]]
1072
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1073
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1074
- bucket_name : str
1075
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1076
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1077
- wildcard_match : bool
1078
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1079
- aws_conn_id : str
1080
- a reference to the s3 connection on Airflow. (Default: None)
1081
- verify : bool
1082
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
930
+ external_dag_id : str
931
+ The dag_id that contains the task you want to wait for.
932
+ external_task_ids : List[str]
933
+ The list of task_ids that you want to wait for.
934
+ If None (default value) the sensor waits for the DAG. (Default: None)
935
+ allowed_states : List[str]
936
+ Iterable of allowed states, (Default: ['success'])
937
+ failed_states : List[str]
938
+ Iterable of failed or dis-allowed states. (Default: None)
939
+ execution_delta : datetime.timedelta
940
+ time difference with the previous execution to look at,
941
+ the default is the same logical date as the current task or DAG. (Default: None)
942
+ check_existence: bool
943
+ Set to True to check if the external task exists or check if
944
+ the DAG to wait for exists. (Default: True)
1083
945
  """
1084
946
  ...
1085
947
 
1086
- def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, external_dag_id: str, external_task_ids: typing.List[str], allowed_states: typing.List[str], failed_states: typing.List[str], execution_delta: "datetime.timedelta", check_existence: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
948
+ 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]]:
1087
949
  """
1088
- The `@airflow_external_task_sensor` decorator attaches a Airflow [ExternalTaskSensor](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/sensors/external_task/index.html#airflow.sensors.external_task.ExternalTaskSensor) before the start step of the flow.
1089
- This decorator only works when a flow is scheduled on Airflow and is compiled using `airflow create`. More than one `@airflow_external_task_sensor` can be added as a flow decorators. Adding more than one decorator will ensure that `start` step starts only after all sensors finish.
950
+ 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)
951
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
952
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
953
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
954
+ starts only after all sensors finish.
1090
955
 
1091
956
 
1092
957
  Parameters
@@ -1108,72 +973,69 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
1108
973
  Name of the sensor on Airflow
1109
974
  description : str
1110
975
  Description of sensor in the Airflow UI
1111
- external_dag_id : str
1112
- The dag_id that contains the task you want to wait for.
1113
- external_task_ids : List[str]
1114
- The list of task_ids that you want to wait for.
1115
- If None (default value) the sensor waits for the DAG. (Default: None)
1116
- allowed_states : List[str]
1117
- Iterable of allowed states, (Default: ['success'])
1118
- failed_states : List[str]
1119
- Iterable of failed or dis-allowed states. (Default: None)
1120
- execution_delta : datetime.timedelta
1121
- time difference with the previous execution to look at,
1122
- the default is the same logical date as the current task or DAG. (Default: None)
1123
- check_existence: bool
1124
- Set to True to check if the external task exists or check if
1125
- the DAG to wait for exists. (Default: True)
976
+ bucket_key : Union[str, List[str]]
977
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
978
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
979
+ bucket_name : str
980
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
981
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
982
+ wildcard_match : bool
983
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
984
+ aws_conn_id : str
985
+ a reference to the s3 connection on Airflow. (Default: None)
986
+ verify : bool
987
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1126
988
  """
1127
989
  ...
1128
990
 
1129
991
  @typing.overload
1130
- 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]]:
992
+ 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]]:
1131
993
  """
1132
- Specifies the Conda environment for all steps of the flow.
1133
-
1134
- Use `@conda_base` to set common libraries required by all
1135
- steps and use `@conda` to specify step-specific additions.
994
+ Specifies the times when the flow should be run when running on a
995
+ production scheduler.
1136
996
 
1137
997
 
1138
998
  Parameters
1139
999
  ----------
1140
- packages : Dict[str, str], default {}
1141
- Packages to use for this flow. The key is the name of the package
1142
- and the value is the version to use.
1143
- libraries : Dict[str, str], default {}
1144
- Supported for backward compatibility. When used with packages, packages will take precedence.
1145
- python : str, optional, default None
1146
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1147
- that the version used will correspond to the version of the Python interpreter used to start the run.
1148
- disabled : bool, default False
1149
- If set to True, disables Conda.
1000
+ hourly : bool, default False
1001
+ Run the workflow hourly.
1002
+ daily : bool, default True
1003
+ Run the workflow daily.
1004
+ weekly : bool, default False
1005
+ Run the workflow weekly.
1006
+ cron : str, optional, default None
1007
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1008
+ specified by this expression.
1009
+ timezone : str, optional, default None
1010
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1011
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1150
1012
  """
1151
1013
  ...
1152
1014
 
1153
1015
  @typing.overload
1154
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1016
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1155
1017
  ...
1156
1018
 
1157
- def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
1019
+ 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):
1158
1020
  """
1159
- Specifies the Conda environment for all steps of the flow.
1160
-
1161
- Use `@conda_base` to set common libraries required by all
1162
- steps and use `@conda` to specify step-specific additions.
1021
+ Specifies the times when the flow should be run when running on a
1022
+ production scheduler.
1163
1023
 
1164
1024
 
1165
1025
  Parameters
1166
1026
  ----------
1167
- packages : Dict[str, str], default {}
1168
- Packages to use for this flow. The key is the name of the package
1169
- and the value is the version to use.
1170
- libraries : Dict[str, str], default {}
1171
- Supported for backward compatibility. When used with packages, packages will take precedence.
1172
- python : str, optional, default None
1173
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1174
- that the version used will correspond to the version of the Python interpreter used to start the run.
1175
- disabled : bool, default False
1176
- If set to True, disables Conda.
1027
+ hourly : bool, default False
1028
+ Run the workflow hourly.
1029
+ daily : bool, default True
1030
+ Run the workflow daily.
1031
+ weekly : bool, default False
1032
+ Run the workflow weekly.
1033
+ cron : str, optional, default None
1034
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1035
+ specified by this expression.
1036
+ timezone : str, optional, default None
1037
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1038
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1177
1039
  """
1178
1040
  ...
1179
1041
 
@@ -1278,44 +1140,182 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
1278
1140
  """
1279
1141
  ...
1280
1142
 
1143
+ def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1144
+ """
1145
+ Specifies what flows belong to the same project.
1146
+
1147
+ A project-specific namespace is created for all flows that
1148
+ use the same `@project(name)`.
1149
+
1150
+
1151
+ Parameters
1152
+ ----------
1153
+ name : str
1154
+ Project name. Make sure that the name is unique amongst all
1155
+ projects that use the same production scheduler. The name may
1156
+ contain only lowercase alphanumeric characters and underscores.
1157
+
1158
+ branch : Optional[str], default None
1159
+ The branch to use. If not specified, the branch is set to
1160
+ `user.<username>` unless `production` is set to `True`. This can
1161
+ also be set on the command line using `--branch` as a top-level option.
1162
+ It is an error to specify `branch` in the decorator and on the command line.
1163
+
1164
+ production : bool, default False
1165
+ Whether or not the branch is the production branch. This can also be set on the
1166
+ command line using `--production` as a top-level option. It is an error to specify
1167
+ `production` in the decorator and on the command line.
1168
+ The project branch name will be:
1169
+ - if `branch` is specified:
1170
+ - if `production` is True: `prod.<branch>`
1171
+ - if `production` is False: `test.<branch>`
1172
+ - if `branch` is not specified:
1173
+ - if `production` is True: `prod`
1174
+ - if `production` is False: `user.<username>`
1175
+ """
1176
+ ...
1177
+
1281
1178
  @typing.overload
1282
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1179
+ def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1283
1180
  """
1284
- Specifies the PyPI packages for all steps of the flow.
1181
+ Specifies the event(s) that this flow depends on.
1182
+
1183
+ ```
1184
+ @trigger(event='foo')
1185
+ ```
1186
+ or
1187
+ ```
1188
+ @trigger(events=['foo', 'bar'])
1189
+ ```
1190
+
1191
+ Additionally, you can specify the parameter mappings
1192
+ to map event payload to Metaflow parameters for the flow.
1193
+ ```
1194
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1195
+ ```
1196
+ or
1197
+ ```
1198
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1199
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1200
+ ```
1201
+
1202
+ 'parameters' can also be a list of strings and tuples like so:
1203
+ ```
1204
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1205
+ ```
1206
+ This is equivalent to:
1207
+ ```
1208
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1209
+ ```
1285
1210
 
1286
- Use `@pypi_base` to set common packages required by all
1287
- steps and use `@pypi` to specify step-specific overrides.
1288
1211
 
1289
1212
  Parameters
1290
1213
  ----------
1291
- packages : Dict[str, str], default: {}
1214
+ event : Union[str, Dict[str, Any]], optional, default None
1215
+ Event dependency for this flow.
1216
+ events : List[Union[str, Dict[str, Any]]], default []
1217
+ Events dependency for this flow.
1218
+ options : Dict[str, Any], default {}
1219
+ Backend-specific configuration for tuning eventing behavior.
1220
+ """
1221
+ ...
1222
+
1223
+ @typing.overload
1224
+ def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1225
+ ...
1226
+
1227
+ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
1228
+ """
1229
+ Specifies the event(s) that this flow depends on.
1230
+
1231
+ ```
1232
+ @trigger(event='foo')
1233
+ ```
1234
+ or
1235
+ ```
1236
+ @trigger(events=['foo', 'bar'])
1237
+ ```
1238
+
1239
+ Additionally, you can specify the parameter mappings
1240
+ to map event payload to Metaflow parameters for the flow.
1241
+ ```
1242
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1243
+ ```
1244
+ or
1245
+ ```
1246
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1247
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1248
+ ```
1249
+
1250
+ 'parameters' can also be a list of strings and tuples like so:
1251
+ ```
1252
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1253
+ ```
1254
+ This is equivalent to:
1255
+ ```
1256
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1257
+ ```
1258
+
1259
+
1260
+ Parameters
1261
+ ----------
1262
+ event : Union[str, Dict[str, Any]], optional, default None
1263
+ Event dependency for this flow.
1264
+ events : List[Union[str, Dict[str, Any]]], default []
1265
+ Events dependency for this flow.
1266
+ options : Dict[str, Any], default {}
1267
+ Backend-specific configuration for tuning eventing behavior.
1268
+ """
1269
+ ...
1270
+
1271
+ @typing.overload
1272
+ 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]]:
1273
+ """
1274
+ Specifies the Conda environment for all steps of the flow.
1275
+
1276
+ Use `@conda_base` to set common libraries required by all
1277
+ steps and use `@conda` to specify step-specific additions.
1278
+
1279
+
1280
+ Parameters
1281
+ ----------
1282
+ packages : Dict[str, str], default {}
1292
1283
  Packages to use for this flow. The key is the name of the package
1293
1284
  and the value is the version to use.
1294
- python : str, optional, default: None
1285
+ libraries : Dict[str, str], default {}
1286
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1287
+ python : str, optional, default None
1295
1288
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1296
1289
  that the version used will correspond to the version of the Python interpreter used to start the run.
1290
+ disabled : bool, default False
1291
+ If set to True, disables Conda.
1297
1292
  """
1298
1293
  ...
1299
1294
 
1300
1295
  @typing.overload
1301
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1296
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1302
1297
  ...
1303
1298
 
1304
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1299
+ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
1305
1300
  """
1306
- Specifies the PyPI packages for all steps of the flow.
1301
+ Specifies the Conda environment for all steps of the flow.
1302
+
1303
+ Use `@conda_base` to set common libraries required by all
1304
+ steps and use `@conda` to specify step-specific additions.
1307
1305
 
1308
- Use `@pypi_base` to set common packages required by all
1309
- steps and use `@pypi` to specify step-specific overrides.
1310
1306
 
1311
1307
  Parameters
1312
1308
  ----------
1313
- packages : Dict[str, str], default: {}
1309
+ packages : Dict[str, str], default {}
1314
1310
  Packages to use for this flow. The key is the name of the package
1315
1311
  and the value is the version to use.
1316
- python : str, optional, default: None
1312
+ libraries : Dict[str, str], default {}
1313
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1314
+ python : str, optional, default None
1317
1315
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1318
1316
  that the version used will correspond to the version of the Python interpreter used to start the run.
1317
+ disabled : bool, default False
1318
+ If set to True, disables Conda.
1319
1319
  """
1320
1320
  ...
1321
1321