metaflow-stubs 2.15.8__py2.py3-none-any.whl → 2.15.10__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. metaflow-stubs/__init__.pyi +580 -572
  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 +5 -5
  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/info_file.pyi +2 -2
  15. metaflow-stubs/metadata_provider/__init__.pyi +2 -2
  16. metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
  17. metaflow-stubs/metadata_provider/metadata.pyi +2 -2
  18. metaflow-stubs/metadata_provider/util.pyi +2 -2
  19. metaflow-stubs/metaflow_config.pyi +2 -2
  20. metaflow-stubs/metaflow_current.pyi +18 -18
  21. metaflow-stubs/metaflow_git.pyi +2 -2
  22. metaflow-stubs/multicore_utils.pyi +2 -2
  23. metaflow-stubs/parameters.pyi +3 -3
  24. metaflow-stubs/plugins/__init__.pyi +13 -13
  25. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  26. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
  27. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  28. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  29. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  30. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  31. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
  32. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
  33. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  34. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  35. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  36. metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -3
  37. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +2 -2
  38. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
  39. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -3
  40. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  41. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  42. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  43. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  44. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  45. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  46. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  47. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  48. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
  49. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  50. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
  51. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  52. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  53. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  54. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  55. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
  56. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +3 -3
  57. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +2 -2
  58. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  59. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  60. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  61. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +3 -3
  62. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  63. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  64. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  65. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  66. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  67. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  68. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  69. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  70. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  71. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  72. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  73. metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
  74. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  75. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  76. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  77. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  78. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  79. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  80. metaflow-stubs/plugins/catch_decorator.pyi +2 -2
  81. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  82. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  83. metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
  84. metaflow-stubs/plugins/datatools/s3/s3.pyi +6 -3
  85. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  86. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  87. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  88. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  89. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  90. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  91. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  92. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  93. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  94. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
  95. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  96. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  97. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  98. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  99. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  100. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
  101. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +4 -4
  102. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  103. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +10 -2
  104. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
  105. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  106. metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
  107. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  108. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  109. metaflow-stubs/plugins/pypi/__init__.pyi +3 -3
  110. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  111. metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
  112. metaflow-stubs/plugins/pypi/parsers.pyi +2 -2
  113. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  114. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  115. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  116. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  117. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  118. metaflow-stubs/plugins/secrets/__init__.pyi +3 -3
  119. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
  120. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  121. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  122. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  123. metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
  124. metaflow-stubs/plugins/uv/__init__.pyi +2 -2
  125. metaflow-stubs/plugins/uv/uv_environment.pyi +2 -2
  126. metaflow-stubs/pylint_wrapper.pyi +2 -2
  127. metaflow-stubs/runner/__init__.pyi +2 -2
  128. metaflow-stubs/runner/deployer.pyi +29 -29
  129. metaflow-stubs/runner/deployer_impl.pyi +4 -4
  130. metaflow-stubs/runner/metaflow_runner.pyi +4 -4
  131. metaflow-stubs/runner/nbdeploy.pyi +2 -2
  132. metaflow-stubs/runner/nbrun.pyi +2 -2
  133. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  134. metaflow-stubs/runner/utils.pyi +4 -4
  135. metaflow-stubs/system/__init__.pyi +2 -2
  136. metaflow-stubs/system/system_logger.pyi +2 -2
  137. metaflow-stubs/system/system_monitor.pyi +2 -2
  138. metaflow-stubs/tagging_util.pyi +2 -2
  139. metaflow-stubs/tuple_util.pyi +2 -2
  140. metaflow-stubs/user_configs/__init__.pyi +2 -2
  141. metaflow-stubs/user_configs/config_decorators.pyi +6 -6
  142. metaflow-stubs/user_configs/config_options.pyi +2 -2
  143. metaflow-stubs/user_configs/config_parameters.pyi +5 -5
  144. metaflow-stubs/version.pyi +2 -2
  145. {metaflow_stubs-2.15.8.dist-info → metaflow_stubs-2.15.10.dist-info}/METADATA +2 -2
  146. metaflow_stubs-2.15.10.dist-info/RECORD +149 -0
  147. {metaflow_stubs-2.15.8.dist-info → metaflow_stubs-2.15.10.dist-info}/WHEEL +1 -1
  148. metaflow_stubs-2.15.8.dist-info/RECORD +0 -149
  149. {metaflow_stubs-2.15.8.dist-info → metaflow_stubs-2.15.10.dist-info}/top_level.txt +0 -0
@@ -1,15 +1,15 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.15.8 #
4
- # Generated on 2025-04-17T19:00:19.966511 #
3
+ # MF version: 2.15.10 #
4
+ # Generated on 2025-05-01T20:06:36.084744 #
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,17 +35,17 @@ from .user_configs.config_parameters import ConfigValue as ConfigValue
35
35
  from .user_configs.config_parameters import config_expr as config_expr
36
36
  from .user_configs.config_decorators import CustomFlowDecorator as CustomFlowDecorator
37
37
  from .user_configs.config_decorators import CustomStepDecorator as CustomStepDecorator
38
- from . import tuple_util as tuple_util
39
- from . import metaflow_git as metaflow_git
40
38
  from . import events as events
39
+ from . import metaflow_git as metaflow_git
40
+ from . import tuple_util as tuple_util
41
41
  from . import runner as runner
42
42
  from . import plugins as plugins
43
43
  from .plugins.datatools.s3.s3 import S3 as S3
44
44
  from . import includefile as includefile
45
45
  from .includefile import IncludeFile as IncludeFile
46
46
  from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
47
- from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
48
47
  from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
48
+ from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
49
49
  from . import cards as cards
50
50
  from . import client as client
51
51
  from .client.core import namespace as namespace
@@ -147,257 +147,180 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
147
147
  ...
148
148
 
149
149
  @typing.overload
150
- 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]]]:
150
+ 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]]]:
151
151
  """
152
- Specifies that the step will success under all circumstances.
152
+ Creates a human-readable report, a Metaflow Card, after this step completes.
153
153
 
154
- The decorator will create an optional artifact, specified by `var`, which
155
- contains the exception raised. You can use it to detect the presence
156
- of errors, indicating that all happy-path artifacts produced by the step
157
- are missing.
154
+ Note that you may add multiple `@card` decorators in a step with different parameters.
158
155
 
159
156
 
160
157
  Parameters
161
158
  ----------
162
- var : str, optional, default None
163
- Name of the artifact in which to store the caught exception.
164
- If not specified, the exception is not stored.
165
- print_exception : bool, default True
166
- Determines whether or not the exception is printed to
167
- stdout when caught.
159
+ type : str, default 'default'
160
+ Card type.
161
+ id : str, optional, default None
162
+ If multiple cards are present, use this id to identify this card.
163
+ options : Dict[str, Any], default {}
164
+ Options passed to the card. The contents depend on the card type.
165
+ timeout : int, default 45
166
+ Interrupt reporting if it takes more than this many seconds.
168
167
  """
169
168
  ...
170
169
 
171
170
  @typing.overload
172
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
171
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
173
172
  ...
174
173
 
175
174
  @typing.overload
176
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
175
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
177
176
  ...
178
177
 
179
- 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):
178
+ 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):
180
179
  """
181
- Specifies that the step will success under all circumstances.
180
+ Creates a human-readable report, a Metaflow Card, after this step completes.
182
181
 
183
- The decorator will create an optional artifact, specified by `var`, which
184
- contains the exception raised. You can use it to detect the presence
185
- of errors, indicating that all happy-path artifacts produced by the step
186
- are missing.
182
+ Note that you may add multiple `@card` decorators in a step with different parameters.
187
183
 
188
184
 
189
185
  Parameters
190
186
  ----------
191
- var : str, optional, default None
192
- Name of the artifact in which to store the caught exception.
193
- If not specified, the exception is not stored.
194
- print_exception : bool, default True
195
- Determines whether or not the exception is printed to
196
- stdout when caught.
187
+ type : str, default 'default'
188
+ Card type.
189
+ id : str, optional, default None
190
+ If multiple cards are present, use this id to identify this card.
191
+ options : Dict[str, Any], default {}
192
+ Options passed to the card. The contents depend on the card type.
193
+ timeout : int, default 45
194
+ Interrupt reporting if it takes more than this many seconds.
197
195
  """
198
196
  ...
199
197
 
200
198
  @typing.overload
201
- 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]]]:
199
+ def pypi(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
202
200
  """
203
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
201
+ Specifies the PyPI packages for the step.
202
+
203
+ Information in this decorator will augment any
204
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
205
+ you can use `@pypi_base` to set packages required by all
206
+ steps and use `@pypi` to specify step-specific overrides.
204
207
 
205
208
 
206
209
  Parameters
207
210
  ----------
208
- cpu : int, default 1
209
- Number of CPUs required for this step. If `@resources` is
210
- also present, the maximum value from all decorators is used.
211
- gpu : int, default 0
212
- Number of GPUs required for this step. If `@resources` is
213
- also present, the maximum value from all decorators is used.
214
- memory : int, default 4096
215
- Memory size (in MB) required for this step. If
216
- `@resources` is also present, the maximum value from all decorators is
217
- used.
218
- image : str, optional, default None
219
- Docker image to use when launching on AWS Batch. If not specified, and
220
- METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
221
- not, a default Docker image mapping to the current version of Python is used.
222
- queue : str, default METAFLOW_BATCH_JOB_QUEUE
223
- AWS Batch Job Queue to submit the job to.
224
- iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
225
- AWS IAM role that AWS Batch container uses to access AWS cloud resources.
226
- execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
227
- AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
228
- (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
229
- shared_memory : int, optional, default None
230
- The value for the size (in MiB) of the /dev/shm volume for this step.
231
- This parameter maps to the `--shm-size` option in Docker.
232
- max_swap : int, optional, default None
233
- The total amount of swap memory (in MiB) a container can use for this
234
- step. This parameter is translated to the `--memory-swap` option in
235
- Docker where the value is the sum of the container memory plus the
236
- `max_swap` value.
237
- swappiness : int, optional, default None
238
- This allows you to tune memory swappiness behavior for this step.
239
- A swappiness value of 0 causes swapping not to happen unless absolutely
240
- necessary. A swappiness value of 100 causes pages to be swapped very
241
- aggressively. Accepted values are whole numbers between 0 and 100.
242
- use_tmpfs : bool, default False
243
- This enables an explicit tmpfs mount for this step. Note that tmpfs is
244
- not available on Fargate compute environments
245
- tmpfs_tempdir : bool, default True
246
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
247
- tmpfs_size : int, optional, default None
248
- The value for the size (in MiB) of the tmpfs mount for this step.
249
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
250
- memory allocated for this step.
251
- tmpfs_path : str, optional, default None
252
- Path to tmpfs mount for this step. Defaults to /metaflow_temp.
253
- inferentia : int, default 0
254
- Number of Inferentia chips required for this step.
255
- trainium : int, default None
256
- Alias for inferentia. Use only one of the two.
257
- efa : int, default 0
258
- Number of elastic fabric adapter network devices to attach to container
259
- ephemeral_storage : int, default None
260
- The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
261
- This is only relevant for Fargate compute environments
262
- log_driver: str, optional, default None
263
- The log driver to use for the Amazon ECS container.
264
- log_options: List[str], optional, default None
265
- List of strings containing options for the chosen log driver. The configurable values
266
- depend on the `log driver` chosen. Validation of these options is not supported yet.
267
- Example: [`awslogs-group:aws/batch/job`]
211
+ packages : Dict[str, str], default: {}
212
+ Packages to use for this step. The key is the name of the package
213
+ and the value is the version to use.
214
+ python : str, optional, default: None
215
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
216
+ that the version used will correspond to the version of the Python interpreter used to start the run.
268
217
  """
269
218
  ...
270
219
 
271
220
  @typing.overload
272
- def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
221
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
273
222
  ...
274
223
 
275
224
  @typing.overload
276
- def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
225
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
277
226
  ...
278
227
 
279
- 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):
228
+ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
280
229
  """
281
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
230
+ Specifies the PyPI packages for the step.
231
+
232
+ Information in this decorator will augment any
233
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
234
+ you can use `@pypi_base` to set packages required by all
235
+ steps and use `@pypi` to specify step-specific overrides.
282
236
 
283
237
 
284
238
  Parameters
285
239
  ----------
286
- cpu : int, default 1
287
- Number of CPUs required for this step. If `@resources` is
288
- also present, the maximum value from all decorators is used.
289
- gpu : int, default 0
290
- Number of GPUs required for this step. If `@resources` is
291
- also present, the maximum value from all decorators is used.
292
- memory : int, default 4096
293
- Memory size (in MB) required for this step. If
294
- `@resources` is also present, the maximum value from all decorators is
295
- used.
296
- image : str, optional, default None
297
- Docker image to use when launching on AWS Batch. If not specified, and
298
- METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
299
- not, a default Docker image mapping to the current version of Python is used.
300
- queue : str, default METAFLOW_BATCH_JOB_QUEUE
301
- AWS Batch Job Queue to submit the job to.
302
- iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
303
- AWS IAM role that AWS Batch container uses to access AWS cloud resources.
304
- execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
305
- AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
306
- (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
307
- shared_memory : int, optional, default None
308
- The value for the size (in MiB) of the /dev/shm volume for this step.
309
- This parameter maps to the `--shm-size` option in Docker.
310
- max_swap : int, optional, default None
311
- The total amount of swap memory (in MiB) a container can use for this
312
- step. This parameter is translated to the `--memory-swap` option in
313
- Docker where the value is the sum of the container memory plus the
314
- `max_swap` value.
315
- swappiness : int, optional, default None
316
- This allows you to tune memory swappiness behavior for this step.
317
- A swappiness value of 0 causes swapping not to happen unless absolutely
318
- necessary. A swappiness value of 100 causes pages to be swapped very
319
- aggressively. Accepted values are whole numbers between 0 and 100.
320
- use_tmpfs : bool, default False
321
- This enables an explicit tmpfs mount for this step. Note that tmpfs is
322
- not available on Fargate compute environments
323
- tmpfs_tempdir : bool, default True
324
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
325
- tmpfs_size : int, optional, default None
326
- The value for the size (in MiB) of the tmpfs mount for this step.
327
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
328
- memory allocated for this step.
329
- tmpfs_path : str, optional, default None
330
- Path to tmpfs mount for this step. Defaults to /metaflow_temp.
331
- inferentia : int, default 0
332
- Number of Inferentia chips required for this step.
333
- trainium : int, default None
334
- Alias for inferentia. Use only one of the two.
335
- efa : int, default 0
336
- Number of elastic fabric adapter network devices to attach to container
337
- ephemeral_storage : int, default None
338
- The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
339
- This is only relevant for Fargate compute environments
340
- log_driver: str, optional, default None
341
- The log driver to use for the Amazon ECS container.
342
- log_options: List[str], optional, default None
343
- List of strings containing options for the chosen log driver. The configurable values
344
- depend on the `log driver` chosen. Validation of these options is not supported yet.
345
- Example: [`awslogs-group:aws/batch/job`]
240
+ packages : Dict[str, str], default: {}
241
+ Packages to use for this step. The key is the name of the package
242
+ and the value is the version to use.
243
+ python : str, optional, default: None
244
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
245
+ that the version used will correspond to the version of the Python interpreter used to start the run.
346
246
  """
347
247
  ...
348
248
 
349
249
  @typing.overload
350
- def retry(*, times: int = 3, minutes_between_retries: int = 2) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
250
+ 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]]]:
351
251
  """
352
- Specifies the number of times the task corresponding
353
- to a step needs to be retried.
252
+ Specifies a timeout for your step.
354
253
 
355
- This decorator is useful for handling transient errors, such as networking issues.
356
- If your task contains operations that can't be retried safely, e.g. database updates,
357
- it is advisable to annotate it with `@retry(times=0)`.
254
+ This decorator is useful if this step may hang indefinitely.
358
255
 
359
- This can be used in conjunction with the `@catch` decorator. The `@catch`
360
- decorator will execute a no-op task after all retries have been exhausted,
361
- ensuring that the flow execution can continue.
256
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
257
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
258
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
259
+
260
+ Note that all the values specified in parameters are added together so if you specify
261
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
362
262
 
363
263
 
364
264
  Parameters
365
265
  ----------
366
- times : int, default 3
367
- Number of times to retry this task.
368
- minutes_between_retries : int, default 2
369
- Number of minutes between retries.
266
+ seconds : int, default 0
267
+ Number of seconds to wait prior to timing out.
268
+ minutes : int, default 0
269
+ Number of minutes to wait prior to timing out.
270
+ hours : int, default 0
271
+ Number of hours to wait prior to timing out.
370
272
  """
371
273
  ...
372
274
 
373
275
  @typing.overload
374
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
276
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
375
277
  ...
376
278
 
377
279
  @typing.overload
378
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
280
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
379
281
  ...
380
282
 
381
- def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
283
+ 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):
382
284
  """
383
- Specifies the number of times the task corresponding
384
- to a step needs to be retried.
285
+ Specifies a timeout for your step.
385
286
 
386
- This decorator is useful for handling transient errors, such as networking issues.
387
- If your task contains operations that can't be retried safely, e.g. database updates,
388
- it is advisable to annotate it with `@retry(times=0)`.
287
+ This decorator is useful if this step may hang indefinitely.
389
288
 
390
- This can be used in conjunction with the `@catch` decorator. The `@catch`
391
- decorator will execute a no-op task after all retries have been exhausted,
392
- ensuring that the flow execution can continue.
289
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
290
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
291
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
292
+
293
+ Note that all the values specified in parameters are added together so if you specify
294
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
393
295
 
394
296
 
395
297
  Parameters
396
298
  ----------
397
- times : int, default 3
398
- Number of times to retry this task.
399
- minutes_between_retries : int, default 2
400
- Number of minutes between retries.
299
+ seconds : int, default 0
300
+ Number of seconds to wait prior to timing out.
301
+ minutes : int, default 0
302
+ Number of minutes to wait prior to timing out.
303
+ hours : int, default 0
304
+ Number of hours to wait prior to timing out.
305
+ """
306
+ ...
307
+
308
+ @typing.overload
309
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
310
+ """
311
+ Decorator prototype for all step decorators. This function gets specialized
312
+ and imported for all decorators types by _import_plugin_decorators().
313
+ """
314
+ ...
315
+
316
+ @typing.overload
317
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
318
+ ...
319
+
320
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
321
+ """
322
+ Decorator prototype for all step decorators. This function gets specialized
323
+ and imported for all decorators types by _import_plugin_decorators().
401
324
  """
402
325
  ...
403
326
 
@@ -460,491 +383,490 @@ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
460
383
  """
461
384
  ...
462
385
 
463
- 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]]]:
464
- """
465
- Specifies that this step should execute on Kubernetes.
466
-
467
-
468
- Parameters
469
- ----------
470
- cpu : int, default 1
471
- Number of CPUs required for this step. If `@resources` is
472
- also present, the maximum value from all decorators is used.
473
- memory : int, default 4096
474
- Memory size (in MB) required for this step. If
475
- `@resources` is also present, the maximum value from all decorators is
476
- used.
477
- disk : int, default 10240
478
- Disk size (in MB) required for this step. If
479
- `@resources` is also present, the maximum value from all decorators is
480
- used.
481
- image : str, optional, default None
482
- Docker image to use when launching on Kubernetes. If not specified, and
483
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
484
- not, a default Docker image mapping to the current version of Python is used.
485
- image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
486
- If given, the imagePullPolicy to be applied to the Docker image of the step.
487
- service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
488
- Kubernetes service account to use when launching pod in Kubernetes.
489
- secrets : List[str], optional, default None
490
- Kubernetes secrets to use when launching pod in Kubernetes. These
491
- secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
492
- in Metaflow configuration.
493
- node_selector: Union[Dict[str,str], str], optional, default None
494
- Kubernetes node selector(s) to apply to the pod running the task.
495
- Can be passed in as a comma separated string of values e.g.
496
- 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
497
- {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
498
- namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
499
- Kubernetes namespace to use when launching pod in Kubernetes.
500
- gpu : int, optional, default None
501
- Number of GPUs required for this step. A value of zero implies that
502
- the scheduled node should not have GPUs.
503
- gpu_vendor : str, default KUBERNETES_GPU_VENDOR
504
- The vendor of the GPUs to be used for this step.
505
- tolerations : List[str], default []
506
- The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
507
- Kubernetes tolerations to use when launching pod in Kubernetes.
508
- labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
509
- Kubernetes labels to use when launching pod in Kubernetes.
510
- annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
511
- Kubernetes annotations to use when launching pod in Kubernetes.
512
- use_tmpfs : bool, default False
513
- This enables an explicit tmpfs mount for this step.
514
- tmpfs_tempdir : bool, default True
515
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
516
- tmpfs_size : int, optional, default: None
517
- The value for the size (in MiB) of the tmpfs mount for this step.
518
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
519
- memory allocated for this step.
520
- tmpfs_path : str, optional, default /metaflow_temp
521
- Path to tmpfs mount for this step.
522
- persistent_volume_claims : Dict[str, str], optional, default None
523
- A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
524
- volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
525
- shared_memory: int, optional
526
- Shared memory size (in MiB) required for this step
527
- port: int, optional
528
- Port number to specify in the Kubernetes job object
529
- compute_pool : str, optional, default None
530
- Compute pool to be used for for this step.
531
- If not specified, any accessible compute pool within the perimeter is used.
532
- hostname_resolution_timeout: int, default 10 * 60
533
- Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
534
- Only applicable when @parallel is used.
535
- qos: str, default: Burstable
536
- Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
537
- """
538
- ...
539
-
540
386
  @typing.overload
541
- 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]]]:
387
+ 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]]]:
542
388
  """
543
- Specifies a timeout for your step.
544
-
545
- This decorator is useful if this step may hang indefinitely.
389
+ Specifies the resources needed when executing this step.
546
390
 
547
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
548
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
549
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
391
+ Use `@resources` to specify the resource requirements
392
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
550
393
 
551
- Note that all the values specified in parameters are added together so if you specify
552
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
394
+ You can choose the compute layer on the command line by executing e.g.
395
+ ```
396
+ python myflow.py run --with batch
397
+ ```
398
+ or
399
+ ```
400
+ python myflow.py run --with kubernetes
401
+ ```
402
+ which executes the flow on the desired system using the
403
+ requirements specified in `@resources`.
553
404
 
554
405
 
555
406
  Parameters
556
407
  ----------
557
- seconds : int, default 0
558
- Number of seconds to wait prior to timing out.
559
- minutes : int, default 0
560
- Number of minutes to wait prior to timing out.
561
- hours : int, default 0
562
- Number of hours to wait prior to timing out.
408
+ cpu : int, default 1
409
+ Number of CPUs required for this step.
410
+ gpu : int, optional, default None
411
+ Number of GPUs required for this step.
412
+ disk : int, optional, default None
413
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
414
+ memory : int, default 4096
415
+ Memory size (in MB) required for this step.
416
+ shared_memory : int, optional, default None
417
+ The value for the size (in MiB) of the /dev/shm volume for this step.
418
+ This parameter maps to the `--shm-size` option in Docker.
563
419
  """
564
420
  ...
565
421
 
566
422
  @typing.overload
567
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
423
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
568
424
  ...
569
425
 
570
426
  @typing.overload
571
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
427
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
572
428
  ...
573
429
 
574
- 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):
430
+ 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):
575
431
  """
576
- Specifies a timeout for your step.
577
-
578
- This decorator is useful if this step may hang indefinitely.
432
+ Specifies the resources needed when executing this step.
579
433
 
580
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
581
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
582
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
434
+ Use `@resources` to specify the resource requirements
435
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
583
436
 
584
- Note that all the values specified in parameters are added together so if you specify
585
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
437
+ You can choose the compute layer on the command line by executing e.g.
438
+ ```
439
+ python myflow.py run --with batch
440
+ ```
441
+ or
442
+ ```
443
+ python myflow.py run --with kubernetes
444
+ ```
445
+ which executes the flow on the desired system using the
446
+ requirements specified in `@resources`.
586
447
 
587
448
 
588
449
  Parameters
589
450
  ----------
590
- seconds : int, default 0
591
- Number of seconds to wait prior to timing out.
592
- minutes : int, default 0
593
- Number of minutes to wait prior to timing out.
594
- hours : int, default 0
595
- Number of hours to wait prior to timing out.
451
+ cpu : int, default 1
452
+ Number of CPUs required for this step.
453
+ gpu : int, optional, default None
454
+ Number of GPUs required for this step.
455
+ disk : int, optional, default None
456
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
457
+ memory : int, default 4096
458
+ Memory size (in MB) required for this step.
459
+ shared_memory : int, optional, default None
460
+ The value for the size (in MiB) of the /dev/shm volume for this step.
461
+ This parameter maps to the `--shm-size` option in Docker.
596
462
  """
597
463
  ...
598
464
 
599
465
  @typing.overload
600
- 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]]]:
466
+ 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]]]:
601
467
  """
602
- Specifies secrets to be retrieved and injected as environment variables prior to
603
- the execution of a step.
468
+ Specifies that the step will success under all circumstances.
469
+
470
+ The decorator will create an optional artifact, specified by `var`, which
471
+ contains the exception raised. You can use it to detect the presence
472
+ of errors, indicating that all happy-path artifacts produced by the step
473
+ are missing.
604
474
 
605
475
 
606
476
  Parameters
607
477
  ----------
608
- sources : List[Union[str, Dict[str, Any]]], default: []
609
- List of secret specs, defining how the secrets are to be retrieved
478
+ var : str, optional, default None
479
+ Name of the artifact in which to store the caught exception.
480
+ If not specified, the exception is not stored.
481
+ print_exception : bool, default True
482
+ Determines whether or not the exception is printed to
483
+ stdout when caught.
610
484
  """
611
485
  ...
612
486
 
613
487
  @typing.overload
614
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
488
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
615
489
  ...
616
490
 
617
491
  @typing.overload
618
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
492
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
619
493
  ...
620
494
 
621
- 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]]] = []):
495
+ 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):
622
496
  """
623
- Specifies secrets to be retrieved and injected as environment variables prior to
624
- the execution of a step.
497
+ Specifies that the step will success under all circumstances.
498
+
499
+ The decorator will create an optional artifact, specified by `var`, which
500
+ contains the exception raised. You can use it to detect the presence
501
+ of errors, indicating that all happy-path artifacts produced by the step
502
+ are missing.
625
503
 
626
504
 
627
505
  Parameters
628
506
  ----------
629
- sources : List[Union[str, Dict[str, Any]]], default: []
630
- List of secret specs, defining how the secrets are to be retrieved
507
+ var : str, optional, default None
508
+ Name of the artifact in which to store the caught exception.
509
+ If not specified, the exception is not stored.
510
+ print_exception : bool, default True
511
+ Determines whether or not the exception is printed to
512
+ stdout when caught.
631
513
  """
632
514
  ...
633
515
 
634
516
  @typing.overload
635
- 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]]]:
517
+ 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]]]:
636
518
  """
637
- Creates a human-readable report, a Metaflow Card, after this step completes.
638
-
639
- Note that you may add multiple `@card` decorators in a step with different parameters.
519
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
640
520
 
641
521
 
642
522
  Parameters
643
523
  ----------
644
- type : str, default 'default'
645
- Card type.
646
- id : str, optional, default None
647
- If multiple cards are present, use this id to identify this card.
648
- options : Dict[str, Any], default {}
649
- Options passed to the card. The contents depend on the card type.
650
- timeout : int, default 45
651
- Interrupt reporting if it takes more than this many seconds.
652
- """
653
- ...
654
-
655
- @typing.overload
656
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
657
- ...
658
-
659
- @typing.overload
660
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
661
- ...
662
-
663
- 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):
664
- """
665
- Creates a human-readable report, a Metaflow Card, after this step completes.
666
-
667
- Note that you may add multiple `@card` decorators in a step with different parameters.
668
-
669
-
670
- Parameters
671
- ----------
672
- type : str, default 'default'
673
- Card type.
674
- id : str, optional, default None
675
- If multiple cards are present, use this id to identify this card.
676
- options : Dict[str, Any], default {}
677
- Options passed to the card. The contents depend on the card type.
678
- timeout : int, default 45
679
- Interrupt reporting if it takes more than this many seconds.
524
+ cpu : int, default 1
525
+ Number of CPUs required for this step. If `@resources` is
526
+ also present, the maximum value from all decorators is used.
527
+ gpu : int, default 0
528
+ Number of GPUs required for this step. If `@resources` is
529
+ also present, the maximum value from all decorators is used.
530
+ memory : int, default 4096
531
+ Memory size (in MB) required for this step. If
532
+ `@resources` is also present, the maximum value from all decorators is
533
+ used.
534
+ image : str, optional, default None
535
+ Docker image to use when launching on AWS Batch. If not specified, and
536
+ METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
537
+ not, a default Docker image mapping to the current version of Python is used.
538
+ queue : str, default METAFLOW_BATCH_JOB_QUEUE
539
+ AWS Batch Job Queue to submit the job to.
540
+ iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
541
+ AWS IAM role that AWS Batch container uses to access AWS cloud resources.
542
+ execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
543
+ AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
544
+ (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
545
+ shared_memory : int, optional, default None
546
+ The value for the size (in MiB) of the /dev/shm volume for this step.
547
+ This parameter maps to the `--shm-size` option in Docker.
548
+ max_swap : int, optional, default None
549
+ The total amount of swap memory (in MiB) a container can use for this
550
+ step. This parameter is translated to the `--memory-swap` option in
551
+ Docker where the value is the sum of the container memory plus the
552
+ `max_swap` value.
553
+ swappiness : int, optional, default None
554
+ This allows you to tune memory swappiness behavior for this step.
555
+ A swappiness value of 0 causes swapping not to happen unless absolutely
556
+ necessary. A swappiness value of 100 causes pages to be swapped very
557
+ aggressively. Accepted values are whole numbers between 0 and 100.
558
+ use_tmpfs : bool, default False
559
+ This enables an explicit tmpfs mount for this step. Note that tmpfs is
560
+ not available on Fargate compute environments
561
+ tmpfs_tempdir : bool, default True
562
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
563
+ tmpfs_size : int, optional, default None
564
+ The value for the size (in MiB) of the tmpfs mount for this step.
565
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
566
+ memory allocated for this step.
567
+ tmpfs_path : str, optional, default None
568
+ Path to tmpfs mount for this step. Defaults to /metaflow_temp.
569
+ inferentia : int, default 0
570
+ Number of Inferentia chips required for this step.
571
+ trainium : int, default None
572
+ Alias for inferentia. Use only one of the two.
573
+ efa : int, default 0
574
+ Number of elastic fabric adapter network devices to attach to container
575
+ ephemeral_storage : int, default None
576
+ The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
577
+ This is only relevant for Fargate compute environments
578
+ log_driver: str, optional, default None
579
+ The log driver to use for the Amazon ECS container.
580
+ log_options: List[str], optional, default None
581
+ List of strings containing options for the chosen log driver. The configurable values
582
+ depend on the `log driver` chosen. Validation of these options is not supported yet.
583
+ Example: [`awslogs-group:aws/batch/job`]
680
584
  """
681
585
  ...
682
586
 
683
587
  @typing.overload
684
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
685
- """
686
- Decorator prototype for all step decorators. This function gets specialized
687
- and imported for all decorators types by _import_plugin_decorators().
688
- """
588
+ def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
689
589
  ...
690
590
 
691
591
  @typing.overload
692
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
693
- ...
694
-
695
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
696
- """
697
- Decorator prototype for all step decorators. This function gets specialized
698
- and imported for all decorators types by _import_plugin_decorators().
699
- """
592
+ def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
700
593
  ...
701
594
 
702
- @typing.overload
703
- def pypi(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
595
+ 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):
704
596
  """
705
- Specifies the PyPI packages for the step.
706
-
707
- Information in this decorator will augment any
708
- attributes set in the `@pyi_base` flow-level decorator. Hence,
709
- you can use `@pypi_base` to set packages required by all
710
- steps and use `@pypi` to specify step-specific overrides.
597
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
711
598
 
712
599
 
713
600
  Parameters
714
601
  ----------
715
- packages : Dict[str, str], default: {}
716
- Packages to use for this step. The key is the name of the package
717
- and the value is the version to use.
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.
602
+ cpu : int, default 1
603
+ Number of CPUs required for this step. If `@resources` is
604
+ also present, the maximum value from all decorators is used.
605
+ gpu : int, default 0
606
+ Number of GPUs required for this step. If `@resources` is
607
+ also present, the maximum value from all decorators is used.
608
+ memory : int, default 4096
609
+ Memory size (in MB) required for this step. If
610
+ `@resources` is also present, the maximum value from all decorators is
611
+ used.
612
+ image : str, optional, default None
613
+ Docker image to use when launching on AWS Batch. If not specified, and
614
+ METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
615
+ not, a default Docker image mapping to the current version of Python is used.
616
+ queue : str, default METAFLOW_BATCH_JOB_QUEUE
617
+ AWS Batch Job Queue to submit the job to.
618
+ iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
619
+ AWS IAM role that AWS Batch container uses to access AWS cloud resources.
620
+ execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
621
+ AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
622
+ (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
623
+ shared_memory : int, optional, default None
624
+ The value for the size (in MiB) of the /dev/shm volume for this step.
625
+ This parameter maps to the `--shm-size` option in Docker.
626
+ max_swap : int, optional, default None
627
+ The total amount of swap memory (in MiB) a container can use for this
628
+ step. This parameter is translated to the `--memory-swap` option in
629
+ Docker where the value is the sum of the container memory plus the
630
+ `max_swap` value.
631
+ swappiness : int, optional, default None
632
+ This allows you to tune memory swappiness behavior for this step.
633
+ A swappiness value of 0 causes swapping not to happen unless absolutely
634
+ necessary. A swappiness value of 100 causes pages to be swapped very
635
+ aggressively. Accepted values are whole numbers between 0 and 100.
636
+ use_tmpfs : bool, default False
637
+ This enables an explicit tmpfs mount for this step. Note that tmpfs is
638
+ not available on Fargate compute environments
639
+ tmpfs_tempdir : bool, default True
640
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
641
+ tmpfs_size : int, optional, default None
642
+ The value for the size (in MiB) of the tmpfs mount for this step.
643
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
644
+ memory allocated for this step.
645
+ tmpfs_path : str, optional, default None
646
+ Path to tmpfs mount for this step. Defaults to /metaflow_temp.
647
+ inferentia : int, default 0
648
+ Number of Inferentia chips required for this step.
649
+ trainium : int, default None
650
+ Alias for inferentia. Use only one of the two.
651
+ efa : int, default 0
652
+ Number of elastic fabric adapter network devices to attach to container
653
+ ephemeral_storage : int, default None
654
+ The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
655
+ This is only relevant for Fargate compute environments
656
+ log_driver: str, optional, default None
657
+ The log driver to use for the Amazon ECS container.
658
+ log_options: List[str], optional, default None
659
+ List of strings containing options for the chosen log driver. The configurable values
660
+ depend on the `log driver` chosen. Validation of these options is not supported yet.
661
+ Example: [`awslogs-group:aws/batch/job`]
721
662
  """
722
663
  ...
723
664
 
724
665
  @typing.overload
725
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
726
- ...
727
-
728
- @typing.overload
729
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
730
- ...
731
-
732
- def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
666
+ def retry(*, times: int = 3, minutes_between_retries: int = 2) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
733
667
  """
734
- Specifies the PyPI packages for the step.
735
-
736
- Information in this decorator will augment any
737
- attributes set in the `@pyi_base` flow-level decorator. Hence,
738
- you can use `@pypi_base` to set packages required by all
739
- steps and use `@pypi` to specify step-specific overrides.
668
+ Specifies the number of times the task corresponding
669
+ to a step needs to be retried.
740
670
 
671
+ This decorator is useful for handling transient errors, such as networking issues.
672
+ If your task contains operations that can't be retried safely, e.g. database updates,
673
+ it is advisable to annotate it with `@retry(times=0)`.
741
674
 
742
- Parameters
743
- ----------
744
- packages : Dict[str, str], default: {}
745
- Packages to use for this step. The key is the name of the package
746
- and the value is the version to use.
747
- python : str, optional, default: None
748
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
749
- that the version used will correspond to the version of the Python interpreter used to start the run.
750
- """
751
- ...
752
-
753
- @typing.overload
754
- 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]]]:
755
- """
756
- Specifies environment variables to be set prior to the execution of a step.
675
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
676
+ decorator will execute a no-op task after all retries have been exhausted,
677
+ ensuring that the flow execution can continue.
757
678
 
758
679
 
759
680
  Parameters
760
681
  ----------
761
- vars : Dict[str, str], default {}
762
- Dictionary of environment variables to set.
682
+ times : int, default 3
683
+ Number of times to retry this task.
684
+ minutes_between_retries : int, default 2
685
+ Number of minutes between retries.
763
686
  """
764
687
  ...
765
688
 
766
689
  @typing.overload
767
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
690
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
768
691
  ...
769
692
 
770
693
  @typing.overload
771
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
694
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
772
695
  ...
773
696
 
774
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
697
+ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
775
698
  """
776
- Specifies environment variables to be set prior to the execution of a step.
699
+ Specifies the number of times the task corresponding
700
+ to a step needs to be retried.
701
+
702
+ This decorator is useful for handling transient errors, such as networking issues.
703
+ If your task contains operations that can't be retried safely, e.g. database updates,
704
+ it is advisable to annotate it with `@retry(times=0)`.
705
+
706
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
707
+ decorator will execute a no-op task after all retries have been exhausted,
708
+ ensuring that the flow execution can continue.
777
709
 
778
710
 
779
711
  Parameters
780
712
  ----------
781
- vars : Dict[str, str], default {}
782
- Dictionary of environment variables to set.
713
+ times : int, default 3
714
+ Number of times to retry this task.
715
+ minutes_between_retries : int, default 2
716
+ Number of minutes between retries.
783
717
  """
784
718
  ...
785
719
 
786
- @typing.overload
787
- 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]]]:
720
+ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[str] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable', security_context: typing.Optional[typing.Dict[str, typing.Any]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
788
721
  """
789
- Specifies the resources needed when executing this step.
790
-
791
- Use `@resources` to specify the resource requirements
792
- independently of the specific compute layer (`@batch`, `@kubernetes`).
793
-
794
- You can choose the compute layer on the command line by executing e.g.
795
- ```
796
- python myflow.py run --with batch
797
- ```
798
- or
799
- ```
800
- python myflow.py run --with kubernetes
801
- ```
802
- which executes the flow on the desired system using the
803
- requirements specified in `@resources`.
722
+ Specifies that this step should execute on Kubernetes.
804
723
 
805
724
 
806
725
  Parameters
807
726
  ----------
808
727
  cpu : int, default 1
809
- Number of CPUs required for this step.
810
- gpu : int, optional, default None
811
- Number of GPUs required for this step.
812
- disk : int, optional, default None
813
- Disk size (in MB) required for this step. Only applies on Kubernetes.
728
+ Number of CPUs required for this step. If `@resources` is
729
+ also present, the maximum value from all decorators is used.
814
730
  memory : int, default 4096
815
- Memory size (in MB) required for this step.
816
- shared_memory : int, optional, default None
817
- The value for the size (in MiB) of the /dev/shm volume for this step.
818
- This parameter maps to the `--shm-size` option in Docker.
731
+ Memory size (in MB) required for this step. If
732
+ `@resources` is also present, the maximum value from all decorators is
733
+ used.
734
+ disk : int, default 10240
735
+ Disk size (in MB) required for this step. If
736
+ `@resources` is also present, the maximum value from all decorators is
737
+ used.
738
+ image : str, optional, default None
739
+ Docker image to use when launching on Kubernetes. If not specified, and
740
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
741
+ not, a default Docker image mapping to the current version of Python is used.
742
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
743
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
744
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
745
+ Kubernetes service account to use when launching pod in Kubernetes.
746
+ secrets : List[str], optional, default None
747
+ Kubernetes secrets to use when launching pod in Kubernetes. These
748
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
749
+ in Metaflow configuration.
750
+ node_selector: Union[Dict[str,str], str], optional, default None
751
+ Kubernetes node selector(s) to apply to the pod running the task.
752
+ Can be passed in as a comma separated string of values e.g.
753
+ 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
754
+ {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
755
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
756
+ Kubernetes namespace to use when launching pod in Kubernetes.
757
+ gpu : int, optional, default None
758
+ Number of GPUs required for this step. A value of zero implies that
759
+ the scheduled node should not have GPUs.
760
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
761
+ The vendor of the GPUs to be used for this step.
762
+ tolerations : List[str], default []
763
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
764
+ Kubernetes tolerations to use when launching pod in Kubernetes.
765
+ labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
766
+ Kubernetes labels to use when launching pod in Kubernetes.
767
+ annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
768
+ Kubernetes annotations to use when launching pod in Kubernetes.
769
+ use_tmpfs : bool, default False
770
+ This enables an explicit tmpfs mount for this step.
771
+ tmpfs_tempdir : bool, default True
772
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
773
+ tmpfs_size : int, optional, default: None
774
+ The value for the size (in MiB) of the tmpfs mount for this step.
775
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
776
+ memory allocated for this step.
777
+ tmpfs_path : str, optional, default /metaflow_temp
778
+ Path to tmpfs mount for this step.
779
+ persistent_volume_claims : Dict[str, str], optional, default None
780
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
781
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
782
+ shared_memory: int, optional
783
+ Shared memory size (in MiB) required for this step
784
+ port: int, optional
785
+ Port number to specify in the Kubernetes job object
786
+ compute_pool : str, optional, default None
787
+ Compute pool to be used for for this step.
788
+ If not specified, any accessible compute pool within the perimeter is used.
789
+ hostname_resolution_timeout: int, default 10 * 60
790
+ Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
791
+ Only applicable when @parallel is used.
792
+ qos: str, default: Burstable
793
+ Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
794
+
795
+ security_context: Dict[str, Any], optional, default None
796
+ Container security context. Applies to the task container. Allows the following keys:
797
+ - privileged: bool, optional, default None
798
+ - allow_privilege_escalation: bool, optional, default None
799
+ - run_as_user: int, optional, default None
800
+ - run_as_group: int, optional, default None
801
+ - run_as_non_root: bool, optional, default None
819
802
  """
820
803
  ...
821
804
 
822
805
  @typing.overload
823
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
824
- ...
825
-
826
- @typing.overload
827
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
828
- ...
829
-
830
- 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):
806
+ 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]]]:
831
807
  """
832
- Specifies the resources needed when executing this step.
833
-
834
- Use `@resources` to specify the resource requirements
835
- independently of the specific compute layer (`@batch`, `@kubernetes`).
836
-
837
- You can choose the compute layer on the command line by executing e.g.
838
- ```
839
- python myflow.py run --with batch
840
- ```
841
- or
842
- ```
843
- python myflow.py run --with kubernetes
844
- ```
845
- which executes the flow on the desired system using the
846
- requirements specified in `@resources`.
808
+ Specifies secrets to be retrieved and injected as environment variables prior to
809
+ the execution of a step.
847
810
 
848
811
 
849
812
  Parameters
850
813
  ----------
851
- cpu : int, default 1
852
- Number of CPUs required for this step.
853
- gpu : int, optional, default None
854
- Number of GPUs required for this step.
855
- disk : int, optional, default None
856
- Disk size (in MB) required for this step. Only applies on Kubernetes.
857
- memory : int, default 4096
858
- Memory size (in MB) required for this step.
859
- shared_memory : int, optional, default None
860
- The value for the size (in MiB) of the /dev/shm volume for this step.
861
- This parameter maps to the `--shm-size` option in Docker.
814
+ sources : List[Union[str, Dict[str, Any]]], default: []
815
+ List of secret specs, defining how the secrets are to be retrieved
862
816
  """
863
817
  ...
864
818
 
865
- def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
819
+ @typing.overload
820
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
821
+ ...
822
+
823
+ @typing.overload
824
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
825
+ ...
826
+
827
+ 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]]] = []):
866
828
  """
867
- Specifies what flows belong to the same project.
868
-
869
- A project-specific namespace is created for all flows that
870
- use the same `@project(name)`.
829
+ Specifies secrets to be retrieved and injected as environment variables prior to
830
+ the execution of a step.
871
831
 
872
832
 
873
833
  Parameters
874
834
  ----------
875
- name : str
876
- Project name. Make sure that the name is unique amongst all
877
- projects that use the same production scheduler. The name may
878
- contain only lowercase alphanumeric characters and underscores.
879
-
880
- branch : Optional[str], default None
881
- The branch to use. If not specified, the branch is set to
882
- `user.<username>` unless `production` is set to `True`. This can
883
- also be set on the command line using `--branch` as a top-level option.
884
- It is an error to specify `branch` in the decorator and on the command line.
885
-
886
- production : bool, default False
887
- Whether or not the branch is the production branch. This can also be set on the
888
- command line using `--production` as a top-level option. It is an error to specify
889
- `production` in the decorator and on the command line.
890
- The project branch name will be:
891
- - if `branch` is specified:
892
- - if `production` is True: `prod.<branch>`
893
- - if `production` is False: `test.<branch>`
894
- - if `branch` is not specified:
895
- - if `production` is True: `prod`
896
- - if `production` is False: `user.<username>`
835
+ sources : List[Union[str, Dict[str, Any]]], default: []
836
+ List of secret specs, defining how the secrets are to be retrieved
897
837
  """
898
838
  ...
899
839
 
900
840
  @typing.overload
901
- 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]]:
841
+ 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]]]:
902
842
  """
903
- Specifies the times when the flow should be run when running on a
904
- production scheduler.
843
+ Specifies environment variables to be set prior to the execution of a step.
905
844
 
906
845
 
907
846
  Parameters
908
847
  ----------
909
- hourly : bool, default False
910
- Run the workflow hourly.
911
- daily : bool, default True
912
- Run the workflow daily.
913
- weekly : bool, default False
914
- Run the workflow weekly.
915
- cron : str, optional, default None
916
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
917
- specified by this expression.
918
- timezone : str, optional, default None
919
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
920
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
848
+ vars : Dict[str, str], default {}
849
+ Dictionary of environment variables to set.
921
850
  """
922
851
  ...
923
852
 
924
853
  @typing.overload
925
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
854
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
926
855
  ...
927
856
 
928
- 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):
857
+ @typing.overload
858
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
859
+ ...
860
+
861
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
929
862
  """
930
- Specifies the times when the flow should be run when running on a
931
- production scheduler.
863
+ Specifies environment variables to be set prior to the execution of a step.
932
864
 
933
865
 
934
866
  Parameters
935
867
  ----------
936
- hourly : bool, default False
937
- Run the workflow hourly.
938
- daily : bool, default True
939
- Run the workflow daily.
940
- weekly : bool, default False
941
- Run the workflow weekly.
942
- cron : str, optional, default None
943
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
944
- specified by this expression.
945
- timezone : str, optional, default None
946
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
947
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
868
+ vars : Dict[str, str], default {}
869
+ Dictionary of environment variables to set.
948
870
  """
949
871
  ...
950
872
 
@@ -1092,49 +1014,6 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
1092
1014
  """
1093
1015
  ...
1094
1016
 
1095
- 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]]:
1096
- """
1097
- 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)
1098
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1099
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1100
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1101
- starts only after all sensors finish.
1102
-
1103
-
1104
- Parameters
1105
- ----------
1106
- timeout : int
1107
- Time, in seconds before the task times out and fails. (Default: 3600)
1108
- poke_interval : int
1109
- Time in seconds that the job should wait in between each try. (Default: 60)
1110
- mode : str
1111
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1112
- exponential_backoff : bool
1113
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1114
- pool : str
1115
- the slot pool this task should run in,
1116
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1117
- soft_fail : bool
1118
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1119
- name : str
1120
- Name of the sensor on Airflow
1121
- description : str
1122
- Description of sensor in the Airflow UI
1123
- bucket_key : Union[str, List[str]]
1124
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1125
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1126
- bucket_name : str
1127
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1128
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1129
- wildcard_match : bool
1130
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1131
- aws_conn_id : str
1132
- a reference to the s3 connection on Airflow. (Default: None)
1133
- verify : bool
1134
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1135
- """
1136
- ...
1137
-
1138
1017
  @typing.overload
1139
1018
  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]]:
1140
1019
  """
@@ -1236,6 +1115,41 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
1236
1115
  """
1237
1116
  ...
1238
1117
 
1118
+ def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1119
+ """
1120
+ Specifies what flows belong to the same project.
1121
+
1122
+ A project-specific namespace is created for all flows that
1123
+ use the same `@project(name)`.
1124
+
1125
+
1126
+ Parameters
1127
+ ----------
1128
+ name : str
1129
+ Project name. Make sure that the name is unique amongst all
1130
+ projects that use the same production scheduler. The name may
1131
+ contain only lowercase alphanumeric characters and underscores.
1132
+
1133
+ branch : Optional[str], default None
1134
+ The branch to use. If not specified, the branch is set to
1135
+ `user.<username>` unless `production` is set to `True`. This can
1136
+ also be set on the command line using `--branch` as a top-level option.
1137
+ It is an error to specify `branch` in the decorator and on the command line.
1138
+
1139
+ production : bool, default False
1140
+ Whether or not the branch is the production branch. This can also be set on the
1141
+ command line using `--production` as a top-level option. It is an error to specify
1142
+ `production` in the decorator and on the command line.
1143
+ The project branch name will be:
1144
+ - if `branch` is specified:
1145
+ - if `production` is True: `prod.<branch>`
1146
+ - if `production` is False: `test.<branch>`
1147
+ - if `branch` is not specified:
1148
+ - if `production` is True: `prod`
1149
+ - if `production` is False: `user.<username>`
1150
+ """
1151
+ ...
1152
+
1239
1153
  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]]:
1240
1154
  """
1241
1155
  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.
@@ -1279,6 +1193,49 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
1279
1193
  """
1280
1194
  ...
1281
1195
 
1196
+ 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]]:
1197
+ """
1198
+ 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)
1199
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1200
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1201
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1202
+ starts only after all sensors finish.
1203
+
1204
+
1205
+ Parameters
1206
+ ----------
1207
+ timeout : int
1208
+ Time, in seconds before the task times out and fails. (Default: 3600)
1209
+ poke_interval : int
1210
+ Time in seconds that the job should wait in between each try. (Default: 60)
1211
+ mode : str
1212
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1213
+ exponential_backoff : bool
1214
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1215
+ pool : str
1216
+ the slot pool this task should run in,
1217
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1218
+ soft_fail : bool
1219
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1220
+ name : str
1221
+ Name of the sensor on Airflow
1222
+ description : str
1223
+ Description of sensor in the Airflow UI
1224
+ bucket_key : Union[str, List[str]]
1225
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1226
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1227
+ bucket_name : str
1228
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1229
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1230
+ wildcard_match : bool
1231
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1232
+ aws_conn_id : str
1233
+ a reference to the s3 connection on Airflow. (Default: None)
1234
+ verify : bool
1235
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1236
+ """
1237
+ ...
1238
+
1282
1239
  @typing.overload
1283
1240
  def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1284
1241
  """
@@ -1320,3 +1277,54 @@ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packag
1320
1277
  """
1321
1278
  ...
1322
1279
 
1280
+ @typing.overload
1281
+ 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]]:
1282
+ """
1283
+ Specifies the times when the flow should be run when running on a
1284
+ production scheduler.
1285
+
1286
+
1287
+ Parameters
1288
+ ----------
1289
+ hourly : bool, default False
1290
+ Run the workflow hourly.
1291
+ daily : bool, default True
1292
+ Run the workflow daily.
1293
+ weekly : bool, default False
1294
+ Run the workflow weekly.
1295
+ cron : str, optional, default None
1296
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1297
+ specified by this expression.
1298
+ timezone : str, optional, default None
1299
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1300
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1301
+ """
1302
+ ...
1303
+
1304
+ @typing.overload
1305
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1306
+ ...
1307
+
1308
+ 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):
1309
+ """
1310
+ Specifies the times when the flow should be run when running on a
1311
+ production scheduler.
1312
+
1313
+
1314
+ Parameters
1315
+ ----------
1316
+ hourly : bool, default False
1317
+ Run the workflow hourly.
1318
+ daily : bool, default True
1319
+ Run the workflow daily.
1320
+ weekly : bool, default False
1321
+ Run the workflow weekly.
1322
+ cron : str, optional, default None
1323
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1324
+ specified by this expression.
1325
+ timezone : str, optional, default None
1326
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1327
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1328
+ """
1329
+ ...
1330
+