metaflow-stubs 2.17.3__py2.py3-none-any.whl → 2.17.5__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (166) hide show
  1. metaflow-stubs/__init__.pyi +537 -537
  2. metaflow-stubs/cards.pyi +2 -2
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/cli_components/__init__.pyi +2 -2
  5. metaflow-stubs/cli_components/utils.pyi +2 -2
  6. metaflow-stubs/client/__init__.pyi +2 -2
  7. metaflow-stubs/client/core.pyi +6 -6
  8. metaflow-stubs/client/filecache.pyi +2 -2
  9. metaflow-stubs/events.pyi +2 -2
  10. metaflow-stubs/exception.pyi +2 -2
  11. metaflow-stubs/flowspec.pyi +4 -4
  12. metaflow-stubs/generated_for.txt +1 -1
  13. metaflow-stubs/includefile.pyi +3 -3
  14. metaflow-stubs/meta_files.pyi +2 -2
  15. metaflow-stubs/metadata_provider/__init__.pyi +2 -2
  16. metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
  17. metaflow-stubs/metadata_provider/metadata.pyi +2 -2
  18. metaflow-stubs/metadata_provider/util.pyi +2 -2
  19. metaflow-stubs/metaflow_config.pyi +2 -2
  20. metaflow-stubs/metaflow_current.pyi +6 -6
  21. metaflow-stubs/metaflow_git.pyi +2 -2
  22. metaflow-stubs/multicore_utils.pyi +2 -2
  23. metaflow-stubs/packaging_sys/__init__.pyi +4 -4
  24. metaflow-stubs/packaging_sys/backend.pyi +4 -4
  25. metaflow-stubs/packaging_sys/distribution_support.pyi +4 -4
  26. metaflow-stubs/packaging_sys/tar_backend.pyi +4 -4
  27. metaflow-stubs/packaging_sys/utils.pyi +2 -2
  28. metaflow-stubs/packaging_sys/v1.pyi +2 -2
  29. metaflow-stubs/parameters.pyi +3 -3
  30. metaflow-stubs/plugins/__init__.pyi +13 -13
  31. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  32. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
  33. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  34. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  35. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  36. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  37. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
  38. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
  39. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  40. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  41. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  42. metaflow-stubs/plugins/argo/argo_workflows.pyi +5 -3
  43. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
  44. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
  45. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +2 -2
  46. metaflow-stubs/plugins/argo/exit_hooks.pyi +2 -2
  47. metaflow-stubs/plugins/aws/__init__.pyi +3 -3
  48. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  49. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  50. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  51. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  52. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  53. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  54. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  55. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
  56. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  57. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
  58. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  59. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  60. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  61. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  62. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
  63. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +3 -3
  64. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +3 -3
  65. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  66. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  67. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  68. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +3 -3
  69. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  70. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  71. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  72. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  73. metaflow-stubs/plugins/cards/card_client.pyi +2 -2
  74. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  75. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  76. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  77. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  78. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  79. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  80. metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
  81. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  82. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  83. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  84. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  85. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  86. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  87. metaflow-stubs/plugins/catch_decorator.pyi +3 -3
  88. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  89. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  90. metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
  91. metaflow-stubs/plugins/datatools/s3/s3.pyi +3 -3
  92. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  93. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  94. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  95. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  96. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  97. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  98. metaflow-stubs/plugins/exit_hook/__init__.pyi +2 -2
  99. metaflow-stubs/plugins/exit_hook/exit_hook_decorator.pyi +2 -2
  100. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  101. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  102. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  103. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
  104. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  105. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  106. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  107. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  108. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  109. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
  110. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  111. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  112. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
  113. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
  114. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  115. metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
  116. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  117. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  118. metaflow-stubs/plugins/pypi/__init__.pyi +3 -3
  119. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  120. metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
  121. metaflow-stubs/plugins/pypi/parsers.pyi +2 -2
  122. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  123. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  124. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  125. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  126. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  127. metaflow-stubs/plugins/secrets/__init__.pyi +3 -3
  128. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
  129. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  130. metaflow-stubs/plugins/secrets/secrets_func.pyi +2 -2
  131. metaflow-stubs/plugins/secrets/secrets_spec.pyi +2 -2
  132. metaflow-stubs/plugins/secrets/utils.pyi +2 -2
  133. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  134. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
  135. metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
  136. metaflow-stubs/plugins/uv/__init__.pyi +2 -2
  137. metaflow-stubs/plugins/uv/uv_environment.pyi +2 -2
  138. metaflow-stubs/pylint_wrapper.pyi +2 -2
  139. metaflow-stubs/runner/__init__.pyi +2 -2
  140. metaflow-stubs/runner/deployer.pyi +4 -4
  141. metaflow-stubs/runner/deployer_impl.pyi +3 -3
  142. metaflow-stubs/runner/metaflow_runner.pyi +3 -3
  143. metaflow-stubs/runner/nbdeploy.pyi +2 -2
  144. metaflow-stubs/runner/nbrun.pyi +2 -2
  145. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  146. metaflow-stubs/runner/utils.pyi +4 -4
  147. metaflow-stubs/system/__init__.pyi +2 -2
  148. metaflow-stubs/system/system_logger.pyi +2 -2
  149. metaflow-stubs/system/system_monitor.pyi +2 -2
  150. metaflow-stubs/tagging_util.pyi +2 -2
  151. metaflow-stubs/tuple_util.pyi +2 -2
  152. metaflow-stubs/user_configs/__init__.pyi +2 -2
  153. metaflow-stubs/user_configs/config_options.pyi +2 -2
  154. metaflow-stubs/user_configs/config_parameters.pyi +7 -7
  155. metaflow-stubs/user_decorators/__init__.pyi +2 -2
  156. metaflow-stubs/user_decorators/common.pyi +2 -2
  157. metaflow-stubs/user_decorators/mutable_flow.pyi +5 -5
  158. metaflow-stubs/user_decorators/mutable_step.pyi +4 -4
  159. metaflow-stubs/user_decorators/user_flow_decorator.pyi +4 -4
  160. metaflow-stubs/user_decorators/user_step_decorator.pyi +4 -4
  161. metaflow-stubs/version.pyi +2 -2
  162. {metaflow_stubs-2.17.3.dist-info → metaflow_stubs-2.17.5.dist-info}/METADATA +2 -2
  163. metaflow_stubs-2.17.5.dist-info/RECORD +166 -0
  164. metaflow_stubs-2.17.3.dist-info/RECORD +0 -166
  165. {metaflow_stubs-2.17.3.dist-info → metaflow_stubs-2.17.5.dist-info}/WHEEL +0 -0
  166. {metaflow_stubs-2.17.3.dist-info → metaflow_stubs-2.17.5.dist-info}/top_level.txt +0 -0
@@ -1,15 +1,15 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.17.3 #
4
- # Generated on 2025-08-21T22:44:50.438086 #
3
+ # MF version: 2.17.5 #
4
+ # Generated on 2025-08-25T21:01:36.499633 #
5
5
  ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
- import datetime
12
11
  import typing
12
+ import datetime
13
13
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
14
14
  StepFlag = typing.NewType("StepFlag", bool)
15
15
 
@@ -39,16 +39,16 @@ from .user_decorators.user_step_decorator import UserStepDecorator as UserStepDe
39
39
  from .user_decorators.user_step_decorator import StepMutator as StepMutator
40
40
  from .user_decorators.user_step_decorator import user_step_decorator as user_step_decorator
41
41
  from .user_decorators.user_flow_decorator import FlowMutator as FlowMutator
42
- from . import metaflow_git as metaflow_git
43
42
  from . import tuple_util as tuple_util
43
+ from . import metaflow_git as metaflow_git
44
44
  from . import events as events
45
45
  from . import runner as runner
46
46
  from . import plugins as plugins
47
47
  from .plugins.datatools.s3.s3 import S3 as S3
48
48
  from . import includefile as includefile
49
49
  from .includefile import IncludeFile as IncludeFile
50
- from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
51
50
  from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
51
+ from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
52
52
  from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
53
53
  from . import cards as cards
54
54
  from . import client as client
@@ -153,240 +153,220 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
153
153
  ...
154
154
 
155
155
  @typing.overload
156
- 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]]]:
156
+ 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]]]:
157
157
  """
158
- Specifies that the step will success under all circumstances.
159
-
160
- The decorator will create an optional artifact, specified by `var`, which
161
- contains the exception raised. You can use it to detect the presence
162
- of errors, indicating that all happy-path artifacts produced by the step
163
- are missing.
158
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
164
159
 
165
160
 
166
161
  Parameters
167
162
  ----------
168
- var : str, optional, default None
169
- Name of the artifact in which to store the caught exception.
170
- If not specified, the exception is not stored.
171
- print_exception : bool, default True
172
- Determines whether or not the exception is printed to
173
- stdout when caught.
163
+ cpu : int, default 1
164
+ Number of CPUs required for this step. If `@resources` is
165
+ also present, the maximum value from all decorators is used.
166
+ gpu : int, default 0
167
+ Number of GPUs required for this step. If `@resources` is
168
+ also present, the maximum value from all decorators is used.
169
+ memory : int, default 4096
170
+ Memory size (in MB) required for this step. If
171
+ `@resources` is also present, the maximum value from all decorators is
172
+ used.
173
+ image : str, optional, default None
174
+ Docker image to use when launching on AWS Batch. If not specified, and
175
+ METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
176
+ not, a default Docker image mapping to the current version of Python is used.
177
+ queue : str, default METAFLOW_BATCH_JOB_QUEUE
178
+ AWS Batch Job Queue to submit the job to.
179
+ iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
180
+ AWS IAM role that AWS Batch container uses to access AWS cloud resources.
181
+ execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
182
+ AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
183
+ (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
184
+ shared_memory : int, optional, default None
185
+ The value for the size (in MiB) of the /dev/shm volume for this step.
186
+ This parameter maps to the `--shm-size` option in Docker.
187
+ max_swap : int, optional, default None
188
+ The total amount of swap memory (in MiB) a container can use for this
189
+ step. This parameter is translated to the `--memory-swap` option in
190
+ Docker where the value is the sum of the container memory plus the
191
+ `max_swap` value.
192
+ swappiness : int, optional, default None
193
+ This allows you to tune memory swappiness behavior for this step.
194
+ A swappiness value of 0 causes swapping not to happen unless absolutely
195
+ necessary. A swappiness value of 100 causes pages to be swapped very
196
+ aggressively. Accepted values are whole numbers between 0 and 100.
197
+ use_tmpfs : bool, default False
198
+ This enables an explicit tmpfs mount for this step. Note that tmpfs is
199
+ not available on Fargate compute environments
200
+ tmpfs_tempdir : bool, default True
201
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
202
+ tmpfs_size : int, optional, default None
203
+ The value for the size (in MiB) of the tmpfs mount for this step.
204
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
205
+ memory allocated for this step.
206
+ tmpfs_path : str, optional, default None
207
+ Path to tmpfs mount for this step. Defaults to /metaflow_temp.
208
+ inferentia : int, default 0
209
+ Number of Inferentia chips required for this step.
210
+ trainium : int, default None
211
+ Alias for inferentia. Use only one of the two.
212
+ efa : int, default 0
213
+ Number of elastic fabric adapter network devices to attach to container
214
+ ephemeral_storage : int, default None
215
+ The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
216
+ This is only relevant for Fargate compute environments
217
+ log_driver: str, optional, default None
218
+ The log driver to use for the Amazon ECS container.
219
+ log_options: List[str], optional, default None
220
+ List of strings containing options for the chosen log driver. The configurable values
221
+ depend on the `log driver` chosen. Validation of these options is not supported yet.
222
+ Example: [`awslogs-group:aws/batch/job`]
174
223
  """
175
224
  ...
176
225
 
177
226
  @typing.overload
178
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
227
+ def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
179
228
  ...
180
229
 
181
230
  @typing.overload
182
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
231
+ def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
183
232
  ...
184
233
 
185
- def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
234
+ 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):
186
235
  """
187
- Specifies that the step will success under all circumstances.
188
-
189
- The decorator will create an optional artifact, specified by `var`, which
190
- contains the exception raised. You can use it to detect the presence
191
- of errors, indicating that all happy-path artifacts produced by the step
192
- are missing.
236
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
193
237
 
194
238
 
195
239
  Parameters
196
240
  ----------
197
- var : str, optional, default None
198
- Name of the artifact in which to store the caught exception.
199
- If not specified, the exception is not stored.
200
- print_exception : bool, default True
201
- Determines whether or not the exception is printed to
202
- stdout when caught.
241
+ cpu : int, default 1
242
+ Number of CPUs required for this step. If `@resources` is
243
+ also present, the maximum value from all decorators is used.
244
+ gpu : int, default 0
245
+ Number of GPUs required for this step. If `@resources` is
246
+ also present, the maximum value from all decorators is used.
247
+ memory : int, default 4096
248
+ Memory size (in MB) required for this step. If
249
+ `@resources` is also present, the maximum value from all decorators is
250
+ used.
251
+ image : str, optional, default None
252
+ Docker image to use when launching on AWS Batch. If not specified, and
253
+ METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
254
+ not, a default Docker image mapping to the current version of Python is used.
255
+ queue : str, default METAFLOW_BATCH_JOB_QUEUE
256
+ AWS Batch Job Queue to submit the job to.
257
+ iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
258
+ AWS IAM role that AWS Batch container uses to access AWS cloud resources.
259
+ execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
260
+ AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
261
+ (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
262
+ shared_memory : int, optional, default None
263
+ The value for the size (in MiB) of the /dev/shm volume for this step.
264
+ This parameter maps to the `--shm-size` option in Docker.
265
+ max_swap : int, optional, default None
266
+ The total amount of swap memory (in MiB) a container can use for this
267
+ step. This parameter is translated to the `--memory-swap` option in
268
+ Docker where the value is the sum of the container memory plus the
269
+ `max_swap` value.
270
+ swappiness : int, optional, default None
271
+ This allows you to tune memory swappiness behavior for this step.
272
+ A swappiness value of 0 causes swapping not to happen unless absolutely
273
+ necessary. A swappiness value of 100 causes pages to be swapped very
274
+ aggressively. Accepted values are whole numbers between 0 and 100.
275
+ use_tmpfs : bool, default False
276
+ This enables an explicit tmpfs mount for this step. Note that tmpfs is
277
+ not available on Fargate compute environments
278
+ tmpfs_tempdir : bool, default True
279
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
280
+ tmpfs_size : int, optional, default None
281
+ The value for the size (in MiB) of the tmpfs mount for this step.
282
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
283
+ memory allocated for this step.
284
+ tmpfs_path : str, optional, default None
285
+ Path to tmpfs mount for this step. Defaults to /metaflow_temp.
286
+ inferentia : int, default 0
287
+ Number of Inferentia chips required for this step.
288
+ trainium : int, default None
289
+ Alias for inferentia. Use only one of the two.
290
+ efa : int, default 0
291
+ Number of elastic fabric adapter network devices to attach to container
292
+ ephemeral_storage : int, default None
293
+ The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
294
+ This is only relevant for Fargate compute environments
295
+ log_driver: str, optional, default None
296
+ The log driver to use for the Amazon ECS container.
297
+ log_options: List[str], optional, default None
298
+ List of strings containing options for the chosen log driver. The configurable values
299
+ depend on the `log driver` chosen. Validation of these options is not supported yet.
300
+ Example: [`awslogs-group:aws/batch/job`]
203
301
  """
204
302
  ...
205
303
 
206
304
  @typing.overload
207
- 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]]]:
305
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
208
306
  """
209
- Specifies a timeout for your step.
210
-
211
- This decorator is useful if this step may hang indefinitely.
212
-
213
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
214
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
215
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
216
-
217
- Note that all the values specified in parameters are added together so if you specify
218
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
219
-
220
-
221
- Parameters
222
- ----------
223
- seconds : int, default 0
224
- Number of seconds to wait prior to timing out.
225
- minutes : int, default 0
226
- Number of minutes to wait prior to timing out.
227
- hours : int, default 0
228
- Number of hours to wait prior to timing out.
307
+ Decorator prototype for all step decorators. This function gets specialized
308
+ and imported for all decorators types by _import_plugin_decorators().
229
309
  """
230
310
  ...
231
311
 
232
312
  @typing.overload
233
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
313
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
234
314
  ...
235
315
 
236
- @typing.overload
237
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
316
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
317
+ """
318
+ Decorator prototype for all step decorators. This function gets specialized
319
+ and imported for all decorators types by _import_plugin_decorators().
320
+ """
238
321
  ...
239
322
 
240
- 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):
323
+ @typing.overload
324
+ def resources(*, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
241
325
  """
242
- Specifies a timeout for your step.
243
-
244
- This decorator is useful if this step may hang indefinitely.
326
+ Specifies the resources needed when executing this step.
245
327
 
246
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
247
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
248
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
328
+ Use `@resources` to specify the resource requirements
329
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
249
330
 
250
- Note that all the values specified in parameters are added together so if you specify
251
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
331
+ You can choose the compute layer on the command line by executing e.g.
332
+ ```
333
+ python myflow.py run --with batch
334
+ ```
335
+ or
336
+ ```
337
+ python myflow.py run --with kubernetes
338
+ ```
339
+ which executes the flow on the desired system using the
340
+ requirements specified in `@resources`.
252
341
 
253
342
 
254
343
  Parameters
255
344
  ----------
256
- seconds : int, default 0
257
- Number of seconds to wait prior to timing out.
258
- minutes : int, default 0
259
- Number of minutes to wait prior to timing out.
260
- hours : int, default 0
261
- Number of hours to wait prior to timing out.
345
+ cpu : int, default 1
346
+ Number of CPUs required for this step.
347
+ gpu : int, optional, default None
348
+ Number of GPUs required for this step.
349
+ disk : int, optional, default None
350
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
351
+ memory : int, default 4096
352
+ Memory size (in MB) required for this step.
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.
262
356
  """
263
357
  ...
264
358
 
265
359
  @typing.overload
266
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
267
- """
268
- Decorator prototype for all step decorators. This function gets specialized
269
- and imported for all decorators types by _import_plugin_decorators().
270
- """
360
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
271
361
  ...
272
362
 
273
363
  @typing.overload
274
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
275
- ...
276
-
277
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
278
- """
279
- Decorator prototype for all step decorators. This function gets specialized
280
- and imported for all decorators types by _import_plugin_decorators().
281
- """
364
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
282
365
  ...
283
366
 
284
- @typing.overload
285
- 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]]]:
367
+ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
286
368
  """
287
- Specifies the Conda environment for the step.
288
-
289
- Information in this decorator will augment any
290
- attributes set in the `@conda_base` flow-level decorator. Hence,
291
- you can use `@conda_base` to set packages required by all
292
- steps and use `@conda` to specify step-specific overrides.
293
-
294
-
295
- Parameters
296
- ----------
297
- packages : Dict[str, str], default {}
298
- Packages to use for this step. The key is the name of the package
299
- and the value is the version to use.
300
- libraries : Dict[str, str], default {}
301
- Supported for backward compatibility. When used with packages, packages will take precedence.
302
- python : str, optional, default None
303
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
304
- that the version used will correspond to the version of the Python interpreter used to start the run.
305
- disabled : bool, default False
306
- If set to True, disables @conda.
307
- """
308
- ...
309
-
310
- @typing.overload
311
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
312
- ...
313
-
314
- @typing.overload
315
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
316
- ...
317
-
318
- 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):
319
- """
320
- Specifies the Conda environment for the step.
321
-
322
- Information in this decorator will augment any
323
- attributes set in the `@conda_base` flow-level decorator. Hence,
324
- you can use `@conda_base` to set packages required by all
325
- steps and use `@conda` to specify step-specific overrides.
326
-
327
-
328
- Parameters
329
- ----------
330
- packages : Dict[str, str], default {}
331
- Packages to use for this step. The key is the name of the package
332
- and the value is the version to use.
333
- libraries : Dict[str, str], default {}
334
- Supported for backward compatibility. When used with packages, packages will take precedence.
335
- python : str, optional, default None
336
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
337
- that the version used will correspond to the version of the Python interpreter used to start the run.
338
- disabled : bool, default False
339
- If set to True, disables @conda.
340
- """
341
- ...
342
-
343
- @typing.overload
344
- def resources(*, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
345
- """
346
- Specifies the resources needed when executing this step.
347
-
348
- Use `@resources` to specify the resource requirements
349
- independently of the specific compute layer (`@batch`, `@kubernetes`).
350
-
351
- You can choose the compute layer on the command line by executing e.g.
352
- ```
353
- python myflow.py run --with batch
354
- ```
355
- or
356
- ```
357
- python myflow.py run --with kubernetes
358
- ```
359
- which executes the flow on the desired system using the
360
- requirements specified in `@resources`.
361
-
362
-
363
- Parameters
364
- ----------
365
- cpu : int, default 1
366
- Number of CPUs required for this step.
367
- gpu : int, optional, default None
368
- Number of GPUs required for this step.
369
- disk : int, optional, default None
370
- Disk size (in MB) required for this step. Only applies on Kubernetes.
371
- memory : int, default 4096
372
- Memory size (in MB) required for this step.
373
- shared_memory : int, optional, default None
374
- The value for the size (in MiB) of the /dev/shm volume for this step.
375
- This parameter maps to the `--shm-size` option in Docker.
376
- """
377
- ...
378
-
379
- @typing.overload
380
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
381
- ...
382
-
383
- @typing.overload
384
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
385
- ...
386
-
387
- def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
388
- """
389
- Specifies the resources needed when executing this step.
369
+ Specifies the resources needed when executing this step.
390
370
 
391
371
  Use `@resources` to specify the resource requirements
392
372
  independently of the specific compute layer (`@batch`, `@kubernetes`).
@@ -469,279 +449,112 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
469
449
  ...
470
450
 
471
451
  @typing.overload
472
- def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
452
+ 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]]]:
473
453
  """
474
- Specifies secrets to be retrieved and injected as environment variables prior to
475
- the execution of a step.
454
+ Specifies a timeout for your step.
455
+
456
+ This decorator is useful if this step may hang indefinitely.
457
+
458
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
459
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
460
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
461
+
462
+ Note that all the values specified in parameters are added together so if you specify
463
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
476
464
 
477
465
 
478
466
  Parameters
479
467
  ----------
480
- sources : List[Union[str, Dict[str, Any]]], default: []
481
- List of secret specs, defining how the secrets are to be retrieved
482
- role : str, optional, default: None
483
- Role to use for fetching secrets
468
+ seconds : int, default 0
469
+ Number of seconds to wait prior to timing out.
470
+ minutes : int, default 0
471
+ Number of minutes to wait prior to timing out.
472
+ hours : int, default 0
473
+ Number of hours to wait prior to timing out.
484
474
  """
485
475
  ...
486
476
 
487
477
  @typing.overload
488
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
478
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
489
479
  ...
490
480
 
491
481
  @typing.overload
492
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
493
- ...
494
-
495
- def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None):
496
- """
497
- Specifies secrets to be retrieved and injected as environment variables prior to
498
- the execution of a step.
499
-
500
-
501
- Parameters
502
- ----------
503
- sources : List[Union[str, Dict[str, Any]]], default: []
504
- List of secret specs, defining how the secrets are to be retrieved
505
- role : str, optional, default: None
506
- Role to use for fetching secrets
507
- """
482
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
508
483
  ...
509
484
 
510
- def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', image_pull_secrets: typing.List[str] = [], service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[typing.Dict[str, str]] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable', security_context: typing.Optional[typing.Dict[str, typing.Any]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
485
+ 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):
511
486
  """
512
- Specifies that this step should execute on Kubernetes.
487
+ Specifies a timeout for your step.
513
488
 
489
+ This decorator is useful if this step may hang indefinitely.
514
490
 
515
- Parameters
516
- ----------
517
- cpu : int, default 1
518
- Number of CPUs required for this step. If `@resources` is
519
- also present, the maximum value from all decorators is used.
520
- memory : int, default 4096
521
- Memory size (in MB) required for this step. If
522
- `@resources` is also present, the maximum value from all decorators is
523
- used.
524
- disk : int, default 10240
525
- Disk size (in MB) required for this step. If
526
- `@resources` is also present, the maximum value from all decorators is
527
- used.
528
- image : str, optional, default None
529
- Docker image to use when launching on Kubernetes. If not specified, and
530
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
531
- not, a default Docker image mapping to the current version of Python is used.
532
- image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
533
- If given, the imagePullPolicy to be applied to the Docker image of the step.
534
- image_pull_secrets: List[str], default []
535
- The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
536
- Kubernetes image pull secrets to use when pulling container images
537
- in Kubernetes.
538
- service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
539
- Kubernetes service account to use when launching pod in Kubernetes.
540
- secrets : List[str], optional, default None
541
- Kubernetes secrets to use when launching pod in Kubernetes. These
542
- secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
543
- in Metaflow configuration.
544
- node_selector: Union[Dict[str,str], str], optional, default None
545
- Kubernetes node selector(s) to apply to the pod running the task.
546
- Can be passed in as a comma separated string of values e.g.
547
- 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
548
- {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
549
- namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
550
- Kubernetes namespace to use when launching pod in Kubernetes.
551
- gpu : int, optional, default None
552
- Number of GPUs required for this step. A value of zero implies that
553
- the scheduled node should not have GPUs.
554
- gpu_vendor : str, default KUBERNETES_GPU_VENDOR
555
- The vendor of the GPUs to be used for this step.
556
- tolerations : List[Dict[str,str]], default []
557
- The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
558
- Kubernetes tolerations to use when launching pod in Kubernetes.
559
- labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
560
- Kubernetes labels to use when launching pod in Kubernetes.
561
- annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
562
- Kubernetes annotations to use when launching pod in Kubernetes.
563
- use_tmpfs : bool, default False
564
- This enables an explicit tmpfs mount for this step.
565
- tmpfs_tempdir : bool, default True
566
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
567
- tmpfs_size : int, optional, default: None
568
- The value for the size (in MiB) of the tmpfs mount for this step.
569
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
570
- memory allocated for this step.
571
- tmpfs_path : str, optional, default /metaflow_temp
572
- Path to tmpfs mount for this step.
573
- persistent_volume_claims : Dict[str, str], optional, default None
574
- A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
575
- volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
576
- shared_memory: int, optional
577
- Shared memory size (in MiB) required for this step
578
- port: int, optional
579
- Port number to specify in the Kubernetes job object
580
- compute_pool : str, optional, default None
581
- Compute pool to be used for for this step.
582
- If not specified, any accessible compute pool within the perimeter is used.
583
- hostname_resolution_timeout: int, default 10 * 60
584
- Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
585
- Only applicable when @parallel is used.
586
- qos: str, default: Burstable
587
- Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
491
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
492
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
493
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
588
494
 
589
- security_context: Dict[str, Any], optional, default None
590
- Container security context. Applies to the task container. Allows the following keys:
591
- - privileged: bool, optional, default None
592
- - allow_privilege_escalation: bool, optional, default None
593
- - run_as_user: int, optional, default None
594
- - run_as_group: int, optional, default None
595
- - run_as_non_root: bool, optional, default None
596
- """
597
- ...
598
-
599
- @typing.overload
600
- 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]]]:
601
- """
602
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
495
+ Note that all the values specified in parameters are added together so if you specify
496
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
603
497
 
604
498
 
605
- Parameters
606
- ----------
607
- cpu : int, default 1
608
- Number of CPUs required for this step. If `@resources` is
609
- also present, the maximum value from all decorators is used.
610
- gpu : int, default 0
611
- Number of GPUs required for this step. If `@resources` is
612
- also present, the maximum value from all decorators is used.
613
- memory : int, default 4096
614
- Memory size (in MB) required for this step. If
615
- `@resources` is also present, the maximum value from all decorators is
616
- used.
617
- image : str, optional, default None
618
- Docker image to use when launching on AWS Batch. If not specified, and
619
- METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
620
- not, a default Docker image mapping to the current version of Python is used.
621
- queue : str, default METAFLOW_BATCH_JOB_QUEUE
622
- AWS Batch Job Queue to submit the job to.
623
- iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
624
- AWS IAM role that AWS Batch container uses to access AWS cloud resources.
625
- execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
626
- AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
627
- (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
628
- shared_memory : int, optional, default None
629
- The value for the size (in MiB) of the /dev/shm volume for this step.
630
- This parameter maps to the `--shm-size` option in Docker.
631
- max_swap : int, optional, default None
632
- The total amount of swap memory (in MiB) a container can use for this
633
- step. This parameter is translated to the `--memory-swap` option in
634
- Docker where the value is the sum of the container memory plus the
635
- `max_swap` value.
636
- swappiness : int, optional, default None
637
- This allows you to tune memory swappiness behavior for this step.
638
- A swappiness value of 0 causes swapping not to happen unless absolutely
639
- necessary. A swappiness value of 100 causes pages to be swapped very
640
- aggressively. Accepted values are whole numbers between 0 and 100.
641
- use_tmpfs : bool, default False
642
- This enables an explicit tmpfs mount for this step. Note that tmpfs is
643
- not available on Fargate compute environments
644
- tmpfs_tempdir : bool, default True
645
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
646
- tmpfs_size : int, optional, default None
647
- The value for the size (in MiB) of the tmpfs mount for this step.
648
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
649
- memory allocated for this step.
650
- tmpfs_path : str, optional, default None
651
- Path to tmpfs mount for this step. Defaults to /metaflow_temp.
652
- inferentia : int, default 0
653
- Number of Inferentia chips required for this step.
654
- trainium : int, default None
655
- Alias for inferentia. Use only one of the two.
656
- efa : int, default 0
657
- Number of elastic fabric adapter network devices to attach to container
658
- ephemeral_storage : int, default None
659
- The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
660
- This is only relevant for Fargate compute environments
661
- log_driver: str, optional, default None
662
- The log driver to use for the Amazon ECS container.
663
- log_options: List[str], optional, default None
664
- List of strings containing options for the chosen log driver. The configurable values
665
- depend on the `log driver` chosen. Validation of these options is not supported yet.
666
- Example: [`awslogs-group:aws/batch/job`]
499
+ Parameters
500
+ ----------
501
+ seconds : int, default 0
502
+ Number of seconds to wait prior to timing out.
503
+ minutes : int, default 0
504
+ Number of minutes to wait prior to timing out.
505
+ hours : int, default 0
506
+ Number of hours to wait prior to timing out.
667
507
  """
668
508
  ...
669
509
 
670
510
  @typing.overload
671
- def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
511
+ 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]]]:
512
+ """
513
+ Specifies that the step will success under all circumstances.
514
+
515
+ The decorator will create an optional artifact, specified by `var`, which
516
+ contains the exception raised. You can use it to detect the presence
517
+ of errors, indicating that all happy-path artifacts produced by the step
518
+ are missing.
519
+
520
+
521
+ Parameters
522
+ ----------
523
+ var : str, optional, default None
524
+ Name of the artifact in which to store the caught exception.
525
+ If not specified, the exception is not stored.
526
+ print_exception : bool, default True
527
+ Determines whether or not the exception is printed to
528
+ stdout when caught.
529
+ """
672
530
  ...
673
531
 
674
532
  @typing.overload
675
- def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
533
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
676
534
  ...
677
535
 
678
- 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):
536
+ @typing.overload
537
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
538
+ ...
539
+
540
+ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
679
541
  """
680
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
542
+ Specifies that the step will success under all circumstances.
543
+
544
+ The decorator will create an optional artifact, specified by `var`, which
545
+ contains the exception raised. You can use it to detect the presence
546
+ of errors, indicating that all happy-path artifacts produced by the step
547
+ are missing.
681
548
 
682
549
 
683
550
  Parameters
684
551
  ----------
685
- cpu : int, default 1
686
- Number of CPUs required for this step. If `@resources` is
687
- also present, the maximum value from all decorators is used.
688
- gpu : int, default 0
689
- Number of GPUs required for this step. If `@resources` is
690
- also present, the maximum value from all decorators is used.
691
- memory : int, default 4096
692
- Memory size (in MB) required for this step. If
693
- `@resources` is also present, the maximum value from all decorators is
694
- used.
695
- image : str, optional, default None
696
- Docker image to use when launching on AWS Batch. If not specified, and
697
- METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
698
- not, a default Docker image mapping to the current version of Python is used.
699
- queue : str, default METAFLOW_BATCH_JOB_QUEUE
700
- AWS Batch Job Queue to submit the job to.
701
- iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
702
- AWS IAM role that AWS Batch container uses to access AWS cloud resources.
703
- execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
704
- AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
705
- (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
706
- shared_memory : int, optional, default None
707
- The value for the size (in MiB) of the /dev/shm volume for this step.
708
- This parameter maps to the `--shm-size` option in Docker.
709
- max_swap : int, optional, default None
710
- The total amount of swap memory (in MiB) a container can use for this
711
- step. This parameter is translated to the `--memory-swap` option in
712
- Docker where the value is the sum of the container memory plus the
713
- `max_swap` value.
714
- swappiness : int, optional, default None
715
- This allows you to tune memory swappiness behavior for this step.
716
- A swappiness value of 0 causes swapping not to happen unless absolutely
717
- necessary. A swappiness value of 100 causes pages to be swapped very
718
- aggressively. Accepted values are whole numbers between 0 and 100.
719
- use_tmpfs : bool, default False
720
- This enables an explicit tmpfs mount for this step. Note that tmpfs is
721
- not available on Fargate compute environments
722
- tmpfs_tempdir : bool, default True
723
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
724
- tmpfs_size : int, optional, default None
725
- The value for the size (in MiB) of the tmpfs mount for this step.
726
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
727
- memory allocated for this step.
728
- tmpfs_path : str, optional, default None
729
- Path to tmpfs mount for this step. Defaults to /metaflow_temp.
730
- inferentia : int, default 0
731
- Number of Inferentia chips required for this step.
732
- trainium : int, default None
733
- Alias for inferentia. Use only one of the two.
734
- efa : int, default 0
735
- Number of elastic fabric adapter network devices to attach to container
736
- ephemeral_storage : int, default None
737
- The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
738
- This is only relevant for Fargate compute environments
739
- log_driver: str, optional, default None
740
- The log driver to use for the Amazon ECS container.
741
- log_options: List[str], optional, default None
742
- List of strings containing options for the chosen log driver. The configurable values
743
- depend on the `log driver` chosen. Validation of these options is not supported yet.
744
- Example: [`awslogs-group:aws/batch/job`]
552
+ var : str, optional, default None
553
+ Name of the artifact in which to store the caught exception.
554
+ If not specified, the exception is not stored.
555
+ print_exception : bool, default True
556
+ Determines whether or not the exception is printed to
557
+ stdout when caught.
745
558
  """
746
559
  ...
747
560
 
@@ -851,6 +664,154 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
851
664
  """
852
665
  ...
853
666
 
667
+ @typing.overload
668
+ 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]]]:
669
+ """
670
+ Specifies the Conda environment for the step.
671
+
672
+ Information in this decorator will augment any
673
+ attributes set in the `@conda_base` flow-level decorator. Hence,
674
+ you can use `@conda_base` to set packages required by all
675
+ steps and use `@conda` to specify step-specific overrides.
676
+
677
+
678
+ Parameters
679
+ ----------
680
+ packages : Dict[str, str], default {}
681
+ Packages to use for this step. The key is the name of the package
682
+ and the value is the version to use.
683
+ libraries : Dict[str, str], default {}
684
+ Supported for backward compatibility. When used with packages, packages will take precedence.
685
+ python : str, optional, default None
686
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
687
+ that the version used will correspond to the version of the Python interpreter used to start the run.
688
+ disabled : bool, default False
689
+ If set to True, disables @conda.
690
+ """
691
+ ...
692
+
693
+ @typing.overload
694
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
695
+ ...
696
+
697
+ @typing.overload
698
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
699
+ ...
700
+
701
+ 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):
702
+ """
703
+ Specifies the Conda environment for the step.
704
+
705
+ Information in this decorator will augment any
706
+ attributes set in the `@conda_base` flow-level decorator. Hence,
707
+ you can use `@conda_base` to set packages required by all
708
+ steps and use `@conda` to specify step-specific overrides.
709
+
710
+
711
+ Parameters
712
+ ----------
713
+ packages : Dict[str, str], default {}
714
+ Packages to use for this step. The key is the name of the package
715
+ and the value is the version to use.
716
+ libraries : Dict[str, str], default {}
717
+ Supported for backward compatibility. When used with packages, packages will take precedence.
718
+ python : str, optional, default None
719
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
720
+ that the version used will correspond to the version of the Python interpreter used to start the run.
721
+ disabled : bool, default False
722
+ If set to True, disables @conda.
723
+ """
724
+ ...
725
+
726
+ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', image_pull_secrets: typing.List[str] = [], service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[typing.Dict[str, str]] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable', security_context: typing.Optional[typing.Dict[str, typing.Any]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
727
+ """
728
+ Specifies that this step should execute on Kubernetes.
729
+
730
+
731
+ Parameters
732
+ ----------
733
+ cpu : int, default 1
734
+ Number of CPUs required for this step. If `@resources` is
735
+ also present, the maximum value from all decorators is used.
736
+ memory : int, default 4096
737
+ Memory size (in MB) required for this step. If
738
+ `@resources` is also present, the maximum value from all decorators is
739
+ used.
740
+ disk : int, default 10240
741
+ Disk size (in MB) required for this step. If
742
+ `@resources` is also present, the maximum value from all decorators is
743
+ used.
744
+ image : str, optional, default None
745
+ Docker image to use when launching on Kubernetes. If not specified, and
746
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
747
+ not, a default Docker image mapping to the current version of Python is used.
748
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
749
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
750
+ image_pull_secrets: List[str], default []
751
+ The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
752
+ Kubernetes image pull secrets to use when pulling container images
753
+ in Kubernetes.
754
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
755
+ Kubernetes service account to use when launching pod in Kubernetes.
756
+ secrets : List[str], optional, default None
757
+ Kubernetes secrets to use when launching pod in Kubernetes. These
758
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
759
+ in Metaflow configuration.
760
+ node_selector: Union[Dict[str,str], str], optional, default None
761
+ Kubernetes node selector(s) to apply to the pod running the task.
762
+ Can be passed in as a comma separated string of values e.g.
763
+ 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
764
+ {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
765
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
766
+ Kubernetes namespace to use when launching pod in Kubernetes.
767
+ gpu : int, optional, default None
768
+ Number of GPUs required for this step. A value of zero implies that
769
+ the scheduled node should not have GPUs.
770
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
771
+ The vendor of the GPUs to be used for this step.
772
+ tolerations : List[Dict[str,str]], default []
773
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
774
+ Kubernetes tolerations to use when launching pod in Kubernetes.
775
+ labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
776
+ Kubernetes labels to use when launching pod in Kubernetes.
777
+ annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
778
+ Kubernetes annotations to use when launching pod in Kubernetes.
779
+ use_tmpfs : bool, default False
780
+ This enables an explicit tmpfs mount for this step.
781
+ tmpfs_tempdir : bool, default True
782
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
783
+ tmpfs_size : int, optional, default: None
784
+ The value for the size (in MiB) of the tmpfs mount for this step.
785
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
786
+ memory allocated for this step.
787
+ tmpfs_path : str, optional, default /metaflow_temp
788
+ Path to tmpfs mount for this step.
789
+ persistent_volume_claims : Dict[str, str], optional, default None
790
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
791
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
792
+ shared_memory: int, optional
793
+ Shared memory size (in MiB) required for this step
794
+ port: int, optional
795
+ Port number to specify in the Kubernetes job object
796
+ compute_pool : str, optional, default None
797
+ Compute pool to be used for for this step.
798
+ If not specified, any accessible compute pool within the perimeter is used.
799
+ hostname_resolution_timeout: int, default 10 * 60
800
+ Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
801
+ Only applicable when @parallel is used.
802
+ qos: str, default: Burstable
803
+ Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
804
+
805
+ security_context: Dict[str, Any], optional, default None
806
+ Container security context. Applies to the task container. Allows the following keys:
807
+ - privileged: bool, optional, default None
808
+ - allow_privilege_escalation: bool, optional, default None
809
+ - run_as_user: int, optional, default None
810
+ - run_as_group: int, optional, default None
811
+ - run_as_non_root: bool, optional, default None
812
+ """
813
+ ...
814
+
854
815
  @typing.overload
855
816
  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]]]:
856
817
  """
@@ -885,95 +846,41 @@ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], Non
885
846
  ...
886
847
 
887
848
  @typing.overload
888
- 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]]:
849
+ def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
889
850
  """
890
- Specifies the event(s) that this flow depends on.
891
-
892
- ```
893
- @trigger(event='foo')
894
- ```
895
- or
896
- ```
897
- @trigger(events=['foo', 'bar'])
898
- ```
899
-
900
- Additionally, you can specify the parameter mappings
901
- to map event payload to Metaflow parameters for the flow.
902
- ```
903
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
904
- ```
905
- or
906
- ```
907
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
908
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
909
- ```
910
-
911
- 'parameters' can also be a list of strings and tuples like so:
912
- ```
913
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
914
- ```
915
- This is equivalent to:
916
- ```
917
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
918
- ```
851
+ Specifies secrets to be retrieved and injected as environment variables prior to
852
+ the execution of a step.
919
853
 
920
854
 
921
855
  Parameters
922
856
  ----------
923
- event : Union[str, Dict[str, Any]], optional, default None
924
- Event dependency for this flow.
925
- events : List[Union[str, Dict[str, Any]]], default []
926
- Events dependency for this flow.
927
- options : Dict[str, Any], default {}
928
- Backend-specific configuration for tuning eventing behavior.
857
+ sources : List[Union[str, Dict[str, Any]]], default: []
858
+ List of secret specs, defining how the secrets are to be retrieved
859
+ role : str, optional, default: None
860
+ Role to use for fetching secrets
929
861
  """
930
862
  ...
931
863
 
932
864
  @typing.overload
933
- def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
865
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
934
866
  ...
935
867
 
936
- 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] = {}):
868
+ @typing.overload
869
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
870
+ ...
871
+
872
+ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None):
937
873
  """
938
- Specifies the event(s) that this flow depends on.
939
-
940
- ```
941
- @trigger(event='foo')
942
- ```
943
- or
944
- ```
945
- @trigger(events=['foo', 'bar'])
946
- ```
947
-
948
- Additionally, you can specify the parameter mappings
949
- to map event payload to Metaflow parameters for the flow.
950
- ```
951
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
952
- ```
953
- or
954
- ```
955
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
956
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
957
- ```
958
-
959
- 'parameters' can also be a list of strings and tuples like so:
960
- ```
961
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
962
- ```
963
- This is equivalent to:
964
- ```
965
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
966
- ```
874
+ Specifies secrets to be retrieved and injected as environment variables prior to
875
+ the execution of a step.
967
876
 
968
877
 
969
878
  Parameters
970
879
  ----------
971
- event : Union[str, Dict[str, Any]], optional, default None
972
- Event dependency for this flow.
973
- events : List[Union[str, Dict[str, Any]]], default []
974
- Events dependency for this flow.
975
- options : Dict[str, Any], default {}
976
- Backend-specific configuration for tuning eventing behavior.
880
+ sources : List[Union[str, Dict[str, Any]]], default: []
881
+ List of secret specs, defining how the secrets are to be retrieved
882
+ role : str, optional, default: None
883
+ Role to use for fetching secrets
977
884
  """
978
885
  ...
979
886
 
@@ -1028,41 +935,6 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
1028
935
  """
1029
936
  ...
1030
937
 
1031
- def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1032
- """
1033
- Specifies what flows belong to the same project.
1034
-
1035
- A project-specific namespace is created for all flows that
1036
- use the same `@project(name)`.
1037
-
1038
-
1039
- Parameters
1040
- ----------
1041
- name : str
1042
- Project name. Make sure that the name is unique amongst all
1043
- projects that use the same production scheduler. The name may
1044
- contain only lowercase alphanumeric characters and underscores.
1045
-
1046
- branch : Optional[str], default None
1047
- The branch to use. If not specified, the branch is set to
1048
- `user.<username>` unless `production` is set to `True`. This can
1049
- also be set on the command line using `--branch` as a top-level option.
1050
- It is an error to specify `branch` in the decorator and on the command line.
1051
-
1052
- production : bool, default False
1053
- Whether or not the branch is the production branch. This can also be set on the
1054
- command line using `--production` as a top-level option. It is an error to specify
1055
- `production` in the decorator and on the command line.
1056
- The project branch name will be:
1057
- - if `branch` is specified:
1058
- - if `production` is True: `prod.<branch>`
1059
- - if `production` is False: `test.<branch>`
1060
- - if `branch` is not specified:
1061
- - if `production` is True: `prod`
1062
- - if `production` is False: `user.<username>`
1063
- """
1064
- ...
1065
-
1066
938
  @typing.overload
1067
939
  def trigger_on_finish(*, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1068
940
  """
@@ -1164,6 +1036,41 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
1164
1036
  """
1165
1037
  ...
1166
1038
 
1039
+ def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1040
+ """
1041
+ Specifies what flows belong to the same project.
1042
+
1043
+ A project-specific namespace is created for all flows that
1044
+ use the same `@project(name)`.
1045
+
1046
+
1047
+ Parameters
1048
+ ----------
1049
+ name : str
1050
+ Project name. Make sure that the name is unique amongst all
1051
+ projects that use the same production scheduler. The name may
1052
+ contain only lowercase alphanumeric characters and underscores.
1053
+
1054
+ branch : Optional[str], default None
1055
+ The branch to use. If not specified, the branch is set to
1056
+ `user.<username>` unless `production` is set to `True`. This can
1057
+ also be set on the command line using `--branch` as a top-level option.
1058
+ It is an error to specify `branch` in the decorator and on the command line.
1059
+
1060
+ production : bool, default False
1061
+ Whether or not the branch is the production branch. This can also be set on the
1062
+ command line using `--production` as a top-level option. It is an error to specify
1063
+ `production` in the decorator and on the command line.
1064
+ The project branch name will be:
1065
+ - if `branch` is specified:
1066
+ - if `production` is True: `prod.<branch>`
1067
+ - if `production` is False: `test.<branch>`
1068
+ - if `branch` is not specified:
1069
+ - if `production` is True: `prod`
1070
+ - if `production` is False: `user.<username>`
1071
+ """
1072
+ ...
1073
+
1167
1074
  @typing.overload
1168
1075
  def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1169
1076
  """
@@ -1248,6 +1155,99 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
1248
1155
  """
1249
1156
  ...
1250
1157
 
1158
+ @typing.overload
1159
+ 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]]:
1160
+ """
1161
+ Specifies the event(s) that this flow depends on.
1162
+
1163
+ ```
1164
+ @trigger(event='foo')
1165
+ ```
1166
+ or
1167
+ ```
1168
+ @trigger(events=['foo', 'bar'])
1169
+ ```
1170
+
1171
+ Additionally, you can specify the parameter mappings
1172
+ to map event payload to Metaflow parameters for the flow.
1173
+ ```
1174
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1175
+ ```
1176
+ or
1177
+ ```
1178
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1179
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1180
+ ```
1181
+
1182
+ 'parameters' can also be a list of strings and tuples like so:
1183
+ ```
1184
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1185
+ ```
1186
+ This is equivalent to:
1187
+ ```
1188
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1189
+ ```
1190
+
1191
+
1192
+ Parameters
1193
+ ----------
1194
+ event : Union[str, Dict[str, Any]], optional, default None
1195
+ Event dependency for this flow.
1196
+ events : List[Union[str, Dict[str, Any]]], default []
1197
+ Events dependency for this flow.
1198
+ options : Dict[str, Any], default {}
1199
+ Backend-specific configuration for tuning eventing behavior.
1200
+ """
1201
+ ...
1202
+
1203
+ @typing.overload
1204
+ def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1205
+ ...
1206
+
1207
+ 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] = {}):
1208
+ """
1209
+ Specifies the event(s) that this flow depends on.
1210
+
1211
+ ```
1212
+ @trigger(event='foo')
1213
+ ```
1214
+ or
1215
+ ```
1216
+ @trigger(events=['foo', 'bar'])
1217
+ ```
1218
+
1219
+ Additionally, you can specify the parameter mappings
1220
+ to map event payload to Metaflow parameters for the flow.
1221
+ ```
1222
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1223
+ ```
1224
+ or
1225
+ ```
1226
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1227
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1228
+ ```
1229
+
1230
+ 'parameters' can also be a list of strings and tuples like so:
1231
+ ```
1232
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1233
+ ```
1234
+ This is equivalent to:
1235
+ ```
1236
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1237
+ ```
1238
+
1239
+
1240
+ Parameters
1241
+ ----------
1242
+ event : Union[str, Dict[str, Any]], optional, default None
1243
+ Event dependency for this flow.
1244
+ events : List[Union[str, Dict[str, Any]]], default []
1245
+ Events dependency for this flow.
1246
+ options : Dict[str, Any], default {}
1247
+ Backend-specific configuration for tuning eventing behavior.
1248
+ """
1249
+ ...
1250
+
1251
1251
  @typing.overload
1252
1252
  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]]:
1253
1253
  """