metaflow-stubs 2.18.0__py2.py3-none-any.whl → 2.18.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of metaflow-stubs might be problematic. Click here for more details.
- metaflow-stubs/__init__.pyi +492 -486
- metaflow-stubs/cards.pyi +2 -2
- metaflow-stubs/cli.pyi +2 -2
- metaflow-stubs/cli_components/__init__.pyi +2 -2
- metaflow-stubs/cli_components/utils.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +2 -2
- metaflow-stubs/client/core.pyi +5 -5
- metaflow-stubs/client/filecache.pyi +3 -3
- metaflow-stubs/events.pyi +3 -3
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +5 -5
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +4 -4
- metaflow-stubs/meta_files.pyi +2 -2
- metaflow-stubs/metadata_provider/__init__.pyi +2 -2
- metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
- metaflow-stubs/metadata_provider/metadata.pyi +3 -3
- metaflow-stubs/metadata_provider/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +4 -2
- metaflow-stubs/metaflow_current.pyi +17 -17
- metaflow-stubs/metaflow_git.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/packaging_sys/__init__.pyi +6 -6
- metaflow-stubs/packaging_sys/backend.pyi +3 -3
- metaflow-stubs/packaging_sys/distribution_support.pyi +5 -5
- metaflow-stubs/packaging_sys/tar_backend.pyi +4 -4
- metaflow-stubs/packaging_sys/utils.pyi +2 -2
- metaflow-stubs/packaging_sys/v1.pyi +4 -4
- metaflow-stubs/parameters.pyi +4 -4
- metaflow-stubs/plugins/__init__.pyi +13 -13
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
- metaflow-stubs/plugins/airflow/exception.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
- metaflow-stubs/plugins/argo/__init__.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +4 -4
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +4 -4
- metaflow-stubs/plugins/argo/exit_hooks.pyi +3 -3
- metaflow-stubs/plugins/aws/__init__.pyi +4 -4
- metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_utils.pyi +5 -2
- metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch.pyi +4 -4
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +8 -2
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +3 -3
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +4 -4
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +4 -4
- metaflow-stubs/plugins/azure/__init__.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
- metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/cards/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_client.pyi +3 -3
- metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
- metaflow-stubs/plugins/cards/card_decorator.pyi +3 -3
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +3 -3
- metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3.pyi +4 -4
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
- metaflow-stubs/plugins/debug_logger.pyi +2 -2
- metaflow-stubs/plugins/debug_monitor.pyi +2 -2
- metaflow-stubs/plugins/environment_decorator.pyi +2 -2
- metaflow-stubs/plugins/events_decorator.pyi +2 -2
- metaflow-stubs/plugins/exit_hook/__init__.pyi +2 -2
- metaflow-stubs/plugins/exit_hook/exit_hook_decorator.pyi +2 -2
- metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
- metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
- metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kube_utils.pyi +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
- metaflow-stubs/plugins/project_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
- metaflow-stubs/plugins/pypi/parsers.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
- metaflow-stubs/plugins/pypi/utils.pyi +2 -2
- metaflow-stubs/plugins/resources_decorator.pyi +2 -2
- metaflow-stubs/plugins/retry_decorator.pyi +2 -2
- metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
- metaflow-stubs/plugins/secrets/secrets_func.pyi +2 -2
- metaflow-stubs/plugins/secrets/secrets_spec.pyi +2 -2
- metaflow-stubs/plugins/secrets/utils.pyi +2 -2
- metaflow-stubs/plugins/storage_executor.pyi +2 -2
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
- metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
- metaflow-stubs/plugins/uv/__init__.pyi +2 -2
- metaflow-stubs/plugins/uv/uv_environment.pyi +3 -3
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +6 -6
- metaflow-stubs/runner/deployer_impl.pyi +3 -3
- metaflow-stubs/runner/metaflow_runner.pyi +4 -4
- metaflow-stubs/runner/nbdeploy.pyi +2 -2
- metaflow-stubs/runner/nbrun.pyi +2 -2
- metaflow-stubs/runner/subprocess_manager.pyi +2 -2
- metaflow-stubs/runner/utils.pyi +3 -3
- metaflow-stubs/system/__init__.pyi +2 -2
- metaflow-stubs/system/system_logger.pyi +3 -3
- metaflow-stubs/system/system_monitor.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- metaflow-stubs/user_configs/__init__.pyi +2 -2
- metaflow-stubs/user_configs/config_options.pyi +4 -4
- metaflow-stubs/user_configs/config_parameters.pyi +4 -4
- metaflow-stubs/user_decorators/__init__.pyi +2 -2
- metaflow-stubs/user_decorators/common.pyi +2 -2
- metaflow-stubs/user_decorators/mutable_flow.pyi +5 -5
- metaflow-stubs/user_decorators/mutable_step.pyi +5 -5
- metaflow-stubs/user_decorators/user_flow_decorator.pyi +4 -4
- metaflow-stubs/user_decorators/user_step_decorator.pyi +5 -5
- metaflow-stubs/version.pyi +2 -2
- {metaflow_stubs-2.18.0.dist-info → metaflow_stubs-2.18.1.dist-info}/METADATA +2 -2
- metaflow_stubs-2.18.1.dist-info/RECORD +166 -0
- metaflow_stubs-2.18.0.dist-info/RECORD +0 -166
- {metaflow_stubs-2.18.0.dist-info → metaflow_stubs-2.18.1.dist-info}/WHEEL +0 -0
- {metaflow_stubs-2.18.0.dist-info → metaflow_stubs-2.18.1.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
######################################################################################################
|
|
2
2
|
# Auto-generated Metaflow stub file #
|
|
3
|
-
# MF version: 2.18.
|
|
4
|
-
# Generated on 2025-08-
|
|
3
|
+
# MF version: 2.18.1 #
|
|
4
|
+
# Generated on 2025-08-29T13:35:56.240161 #
|
|
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
|
|
|
@@ -40,8 +40,8 @@ from .user_decorators.user_step_decorator import StepMutator as StepMutator
|
|
|
40
40
|
from .user_decorators.user_step_decorator import user_step_decorator as user_step_decorator
|
|
41
41
|
from .user_decorators.user_flow_decorator import FlowMutator as FlowMutator
|
|
42
42
|
from . import events as events
|
|
43
|
-
from . import metaflow_git as metaflow_git
|
|
44
43
|
from . import tuple_util as tuple_util
|
|
44
|
+
from . import metaflow_git as metaflow_git
|
|
45
45
|
from . import runner as runner
|
|
46
46
|
from . import plugins as plugins
|
|
47
47
|
from .plugins.datatools.s3.s3 import S3 as S3
|
|
@@ -153,121 +153,227 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
|
153
153
|
...
|
|
154
154
|
|
|
155
155
|
@typing.overload
|
|
156
|
-
def
|
|
156
|
+
def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = 'METAFLOW_BATCH_JOB_QUEUE', iam_role: str = 'METAFLOW_ECS_S3_ACCESS_IAM_ROLE', execution_role: str = 'METAFLOW_ECS_FARGATE_EXECUTION_ROLE', shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, aws_batch_tags: typing.Optional[typing.Dict[str, str]] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[str]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
|
157
157
|
"""
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
Parameters
|
|
162
|
+
----------
|
|
163
|
+
cpu : int, default 1
|
|
164
|
+
Number of CPUs required for this step. If `@resources` is
|
|
165
|
+
also present, the maximum value from all decorators is used.
|
|
166
|
+
gpu : int, default 0
|
|
167
|
+
Number of GPUs required for this step. If `@resources` is
|
|
168
|
+
also present, the maximum value from all decorators is used.
|
|
169
|
+
memory : int, default 4096
|
|
170
|
+
Memory size (in MB) required for this step. If
|
|
171
|
+
`@resources` is also present, the maximum value from all decorators is
|
|
172
|
+
used.
|
|
173
|
+
image : str, optional, default None
|
|
174
|
+
Docker image to use when launching on AWS Batch. If not specified, and
|
|
175
|
+
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
|
176
|
+
not, a default Docker image mapping to the current version of Python is used.
|
|
177
|
+
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
|
178
|
+
AWS Batch Job Queue to submit the job to.
|
|
179
|
+
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
|
180
|
+
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
|
181
|
+
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
|
182
|
+
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
|
183
|
+
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
|
184
|
+
shared_memory : int, optional, default None
|
|
185
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
|
186
|
+
This parameter maps to the `--shm-size` option in Docker.
|
|
187
|
+
max_swap : int, optional, default None
|
|
188
|
+
The total amount of swap memory (in MiB) a container can use for this
|
|
189
|
+
step. This parameter is translated to the `--memory-swap` option in
|
|
190
|
+
Docker where the value is the sum of the container memory plus the
|
|
191
|
+
`max_swap` value.
|
|
192
|
+
swappiness : int, optional, default None
|
|
193
|
+
This allows you to tune memory swappiness behavior for this step.
|
|
194
|
+
A swappiness value of 0 causes swapping not to happen unless absolutely
|
|
195
|
+
necessary. A swappiness value of 100 causes pages to be swapped very
|
|
196
|
+
aggressively. Accepted values are whole numbers between 0 and 100.
|
|
197
|
+
aws_batch_tags: Dict[str, str], optional, default None
|
|
198
|
+
Sets arbitrary AWS tags on the AWS Batch compute environment.
|
|
199
|
+
Set as string key-value pairs.
|
|
200
|
+
use_tmpfs : bool, default False
|
|
201
|
+
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
|
202
|
+
not available on Fargate compute environments
|
|
203
|
+
tmpfs_tempdir : bool, default True
|
|
204
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
|
205
|
+
tmpfs_size : int, optional, default None
|
|
206
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
|
207
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
|
208
|
+
memory allocated for this step.
|
|
209
|
+
tmpfs_path : str, optional, default None
|
|
210
|
+
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
|
211
|
+
inferentia : int, default 0
|
|
212
|
+
Number of Inferentia chips required for this step.
|
|
213
|
+
trainium : int, default None
|
|
214
|
+
Alias for inferentia. Use only one of the two.
|
|
215
|
+
efa : int, default 0
|
|
216
|
+
Number of elastic fabric adapter network devices to attach to container
|
|
217
|
+
ephemeral_storage : int, default None
|
|
218
|
+
The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
|
|
219
|
+
This is only relevant for Fargate compute environments
|
|
220
|
+
log_driver: str, optional, default None
|
|
221
|
+
The log driver to use for the Amazon ECS container.
|
|
222
|
+
log_options: List[str], optional, default None
|
|
223
|
+
List of strings containing options for the chosen log driver. The configurable values
|
|
224
|
+
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
|
225
|
+
Example: [`awslogs-group:aws/batch/job`]
|
|
160
226
|
"""
|
|
161
227
|
...
|
|
162
228
|
|
|
163
229
|
@typing.overload
|
|
164
|
-
def
|
|
230
|
+
def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
165
231
|
...
|
|
166
232
|
|
|
167
|
-
|
|
233
|
+
@typing.overload
|
|
234
|
+
def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
235
|
+
...
|
|
236
|
+
|
|
237
|
+
def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = 'METAFLOW_BATCH_JOB_QUEUE', iam_role: str = 'METAFLOW_ECS_S3_ACCESS_IAM_ROLE', execution_role: str = 'METAFLOW_ECS_FARGATE_EXECUTION_ROLE', shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, aws_batch_tags: typing.Optional[typing.Dict[str, str]] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[str]] = None):
|
|
168
238
|
"""
|
|
169
|
-
|
|
170
|
-
|
|
239
|
+
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
Parameters
|
|
243
|
+
----------
|
|
244
|
+
cpu : int, default 1
|
|
245
|
+
Number of CPUs required for this step. If `@resources` is
|
|
246
|
+
also present, the maximum value from all decorators is used.
|
|
247
|
+
gpu : int, default 0
|
|
248
|
+
Number of GPUs required for this step. If `@resources` is
|
|
249
|
+
also present, the maximum value from all decorators is used.
|
|
250
|
+
memory : int, default 4096
|
|
251
|
+
Memory size (in MB) required for this step. If
|
|
252
|
+
`@resources` is also present, the maximum value from all decorators is
|
|
253
|
+
used.
|
|
254
|
+
image : str, optional, default None
|
|
255
|
+
Docker image to use when launching on AWS Batch. If not specified, and
|
|
256
|
+
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
|
257
|
+
not, a default Docker image mapping to the current version of Python is used.
|
|
258
|
+
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
|
259
|
+
AWS Batch Job Queue to submit the job to.
|
|
260
|
+
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
|
261
|
+
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
|
262
|
+
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
|
263
|
+
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
|
264
|
+
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
|
265
|
+
shared_memory : int, optional, default None
|
|
266
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
|
267
|
+
This parameter maps to the `--shm-size` option in Docker.
|
|
268
|
+
max_swap : int, optional, default None
|
|
269
|
+
The total amount of swap memory (in MiB) a container can use for this
|
|
270
|
+
step. This parameter is translated to the `--memory-swap` option in
|
|
271
|
+
Docker where the value is the sum of the container memory plus the
|
|
272
|
+
`max_swap` value.
|
|
273
|
+
swappiness : int, optional, default None
|
|
274
|
+
This allows you to tune memory swappiness behavior for this step.
|
|
275
|
+
A swappiness value of 0 causes swapping not to happen unless absolutely
|
|
276
|
+
necessary. A swappiness value of 100 causes pages to be swapped very
|
|
277
|
+
aggressively. Accepted values are whole numbers between 0 and 100.
|
|
278
|
+
aws_batch_tags: Dict[str, str], optional, default None
|
|
279
|
+
Sets arbitrary AWS tags on the AWS Batch compute environment.
|
|
280
|
+
Set as string key-value pairs.
|
|
281
|
+
use_tmpfs : bool, default False
|
|
282
|
+
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
|
283
|
+
not available on Fargate compute environments
|
|
284
|
+
tmpfs_tempdir : bool, default True
|
|
285
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
|
286
|
+
tmpfs_size : int, optional, default None
|
|
287
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
|
288
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
|
289
|
+
memory allocated for this step.
|
|
290
|
+
tmpfs_path : str, optional, default None
|
|
291
|
+
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
|
292
|
+
inferentia : int, default 0
|
|
293
|
+
Number of Inferentia chips required for this step.
|
|
294
|
+
trainium : int, default None
|
|
295
|
+
Alias for inferentia. Use only one of the two.
|
|
296
|
+
efa : int, default 0
|
|
297
|
+
Number of elastic fabric adapter network devices to attach to container
|
|
298
|
+
ephemeral_storage : int, default None
|
|
299
|
+
The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
|
|
300
|
+
This is only relevant for Fargate compute environments
|
|
301
|
+
log_driver: str, optional, default None
|
|
302
|
+
The log driver to use for the Amazon ECS container.
|
|
303
|
+
log_options: List[str], optional, default None
|
|
304
|
+
List of strings containing options for the chosen log driver. The configurable values
|
|
305
|
+
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
|
306
|
+
Example: [`awslogs-group:aws/batch/job`]
|
|
171
307
|
"""
|
|
172
308
|
...
|
|
173
309
|
|
|
174
310
|
@typing.overload
|
|
175
|
-
def
|
|
311
|
+
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]]]:
|
|
176
312
|
"""
|
|
177
|
-
|
|
313
|
+
Specifies that the step will success under all circumstances.
|
|
178
314
|
|
|
179
|
-
|
|
315
|
+
The decorator will create an optional artifact, specified by `var`, which
|
|
316
|
+
contains the exception raised. You can use it to detect the presence
|
|
317
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
|
318
|
+
are missing.
|
|
180
319
|
|
|
181
320
|
|
|
182
321
|
Parameters
|
|
183
322
|
----------
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
timeout : int, default 45
|
|
191
|
-
Interrupt reporting if it takes more than this many seconds.
|
|
323
|
+
var : str, optional, default None
|
|
324
|
+
Name of the artifact in which to store the caught exception.
|
|
325
|
+
If not specified, the exception is not stored.
|
|
326
|
+
print_exception : bool, default True
|
|
327
|
+
Determines whether or not the exception is printed to
|
|
328
|
+
stdout when caught.
|
|
192
329
|
"""
|
|
193
330
|
...
|
|
194
331
|
|
|
195
332
|
@typing.overload
|
|
196
|
-
def
|
|
333
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
197
334
|
...
|
|
198
335
|
|
|
199
336
|
@typing.overload
|
|
200
|
-
def
|
|
337
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
201
338
|
...
|
|
202
339
|
|
|
203
|
-
def
|
|
340
|
+
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):
|
|
204
341
|
"""
|
|
205
|
-
|
|
342
|
+
Specifies that the step will success under all circumstances.
|
|
206
343
|
|
|
207
|
-
|
|
344
|
+
The decorator will create an optional artifact, specified by `var`, which
|
|
345
|
+
contains the exception raised. You can use it to detect the presence
|
|
346
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
|
347
|
+
are missing.
|
|
208
348
|
|
|
209
349
|
|
|
210
350
|
Parameters
|
|
211
351
|
----------
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
timeout : int, default 45
|
|
219
|
-
Interrupt reporting if it takes more than this many seconds.
|
|
352
|
+
var : str, optional, default None
|
|
353
|
+
Name of the artifact in which to store the caught exception.
|
|
354
|
+
If not specified, the exception is not stored.
|
|
355
|
+
print_exception : bool, default True
|
|
356
|
+
Determines whether or not the exception is printed to
|
|
357
|
+
stdout when caught.
|
|
220
358
|
"""
|
|
221
359
|
...
|
|
222
360
|
|
|
223
361
|
@typing.overload
|
|
224
|
-
def
|
|
362
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
225
363
|
"""
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
Information in this decorator will augment any
|
|
229
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
|
230
|
-
you can use `@pypi_base` to set packages required by all
|
|
231
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
Parameters
|
|
235
|
-
----------
|
|
236
|
-
packages : Dict[str, str], default: {}
|
|
237
|
-
Packages to use for this step. The key is the name of the package
|
|
238
|
-
and the value is the version to use.
|
|
239
|
-
python : str, optional, default: None
|
|
240
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
241
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
364
|
+
Decorator prototype for all step decorators. This function gets specialized
|
|
365
|
+
and imported for all decorators types by _import_plugin_decorators().
|
|
242
366
|
"""
|
|
243
367
|
...
|
|
244
368
|
|
|
245
369
|
@typing.overload
|
|
246
|
-
def
|
|
247
|
-
...
|
|
248
|
-
|
|
249
|
-
@typing.overload
|
|
250
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
370
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
251
371
|
...
|
|
252
372
|
|
|
253
|
-
def
|
|
373
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
|
254
374
|
"""
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
Information in this decorator will augment any
|
|
258
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
|
259
|
-
you can use `@pypi_base` to set packages required by all
|
|
260
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
Parameters
|
|
264
|
-
----------
|
|
265
|
-
packages : Dict[str, str], default: {}
|
|
266
|
-
Packages to use for this step. The key is the name of the package
|
|
267
|
-
and the value is the version to use.
|
|
268
|
-
python : str, optional, default: None
|
|
269
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
270
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
375
|
+
Decorator prototype for all step decorators. This function gets specialized
|
|
376
|
+
and imported for all decorators types by _import_plugin_decorators().
|
|
271
377
|
"""
|
|
272
378
|
...
|
|
273
379
|
|
|
@@ -331,35 +437,145 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
|
331
437
|
...
|
|
332
438
|
|
|
333
439
|
@typing.overload
|
|
334
|
-
def
|
|
440
|
+
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]]]:
|
|
335
441
|
"""
|
|
336
|
-
Specifies
|
|
442
|
+
Specifies the number of times the task corresponding
|
|
443
|
+
to a step needs to be retried.
|
|
444
|
+
|
|
445
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
|
446
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
|
447
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
|
448
|
+
|
|
449
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
|
450
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
|
451
|
+
ensuring that the flow execution can continue.
|
|
337
452
|
|
|
338
453
|
|
|
339
454
|
Parameters
|
|
340
455
|
----------
|
|
341
|
-
|
|
342
|
-
|
|
456
|
+
times : int, default 3
|
|
457
|
+
Number of times to retry this task.
|
|
458
|
+
minutes_between_retries : int, default 2
|
|
459
|
+
Number of minutes between retries.
|
|
343
460
|
"""
|
|
344
461
|
...
|
|
345
462
|
|
|
346
463
|
@typing.overload
|
|
347
|
-
def
|
|
464
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
348
465
|
...
|
|
349
466
|
|
|
350
467
|
@typing.overload
|
|
351
|
-
def
|
|
468
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
352
469
|
...
|
|
353
470
|
|
|
354
|
-
def
|
|
471
|
+
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):
|
|
355
472
|
"""
|
|
356
|
-
Specifies
|
|
473
|
+
Specifies the number of times the task corresponding
|
|
474
|
+
to a step needs to be retried.
|
|
475
|
+
|
|
476
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
|
477
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
|
478
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
|
479
|
+
|
|
480
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
|
481
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
|
482
|
+
ensuring that the flow execution can continue.
|
|
357
483
|
|
|
358
484
|
|
|
359
485
|
Parameters
|
|
360
486
|
----------
|
|
361
|
-
|
|
362
|
-
|
|
487
|
+
times : int, default 3
|
|
488
|
+
Number of times to retry this task.
|
|
489
|
+
minutes_between_retries : int, default 2
|
|
490
|
+
Number of minutes between retries.
|
|
491
|
+
"""
|
|
492
|
+
...
|
|
493
|
+
|
|
494
|
+
@typing.overload
|
|
495
|
+
def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
|
496
|
+
"""
|
|
497
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
|
498
|
+
the execution of a step.
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
Parameters
|
|
502
|
+
----------
|
|
503
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
|
504
|
+
List of secret specs, defining how the secrets are to be retrieved
|
|
505
|
+
role : str, optional, default: None
|
|
506
|
+
Role to use for fetching secrets
|
|
507
|
+
"""
|
|
508
|
+
...
|
|
509
|
+
|
|
510
|
+
@typing.overload
|
|
511
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
512
|
+
...
|
|
513
|
+
|
|
514
|
+
@typing.overload
|
|
515
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
516
|
+
...
|
|
517
|
+
|
|
518
|
+
def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None):
|
|
519
|
+
"""
|
|
520
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
|
521
|
+
the execution of a step.
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
Parameters
|
|
525
|
+
----------
|
|
526
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
|
527
|
+
List of secret specs, defining how the secrets are to be retrieved
|
|
528
|
+
role : str, optional, default: None
|
|
529
|
+
Role to use for fetching secrets
|
|
530
|
+
"""
|
|
531
|
+
...
|
|
532
|
+
|
|
533
|
+
@typing.overload
|
|
534
|
+
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]]]:
|
|
535
|
+
"""
|
|
536
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
|
537
|
+
|
|
538
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
Parameters
|
|
542
|
+
----------
|
|
543
|
+
type : str, default 'default'
|
|
544
|
+
Card type.
|
|
545
|
+
id : str, optional, default None
|
|
546
|
+
If multiple cards are present, use this id to identify this card.
|
|
547
|
+
options : Dict[str, Any], default {}
|
|
548
|
+
Options passed to the card. The contents depend on the card type.
|
|
549
|
+
timeout : int, default 45
|
|
550
|
+
Interrupt reporting if it takes more than this many seconds.
|
|
551
|
+
"""
|
|
552
|
+
...
|
|
553
|
+
|
|
554
|
+
@typing.overload
|
|
555
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
556
|
+
...
|
|
557
|
+
|
|
558
|
+
@typing.overload
|
|
559
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
560
|
+
...
|
|
561
|
+
|
|
562
|
+
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):
|
|
563
|
+
"""
|
|
564
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
|
565
|
+
|
|
566
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
Parameters
|
|
570
|
+
----------
|
|
571
|
+
type : str, default 'default'
|
|
572
|
+
Card type.
|
|
573
|
+
id : str, optional, default None
|
|
574
|
+
If multiple cards are present, use this id to identify this card.
|
|
575
|
+
options : Dict[str, Any], default {}
|
|
576
|
+
Options passed to the card. The contents depend on the card type.
|
|
577
|
+
timeout : int, default 45
|
|
578
|
+
Interrupt reporting if it takes more than this many seconds.
|
|
363
579
|
"""
|
|
364
580
|
...
|
|
365
581
|
|
|
@@ -442,65 +658,6 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
|
442
658
|
"""
|
|
443
659
|
...
|
|
444
660
|
|
|
445
|
-
@typing.overload
|
|
446
|
-
def conda(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
|
447
|
-
"""
|
|
448
|
-
Specifies the Conda environment for the step.
|
|
449
|
-
|
|
450
|
-
Information in this decorator will augment any
|
|
451
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
|
452
|
-
you can use `@conda_base` to set packages required by all
|
|
453
|
-
steps and use `@conda` to specify step-specific overrides.
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
Parameters
|
|
457
|
-
----------
|
|
458
|
-
packages : Dict[str, str], default {}
|
|
459
|
-
Packages to use for this step. The key is the name of the package
|
|
460
|
-
and the value is the version to use.
|
|
461
|
-
libraries : Dict[str, str], default {}
|
|
462
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
463
|
-
python : str, optional, default None
|
|
464
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
465
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
466
|
-
disabled : bool, default False
|
|
467
|
-
If set to True, disables @conda.
|
|
468
|
-
"""
|
|
469
|
-
...
|
|
470
|
-
|
|
471
|
-
@typing.overload
|
|
472
|
-
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
473
|
-
...
|
|
474
|
-
|
|
475
|
-
@typing.overload
|
|
476
|
-
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
477
|
-
...
|
|
478
|
-
|
|
479
|
-
def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
|
480
|
-
"""
|
|
481
|
-
Specifies the Conda environment for the step.
|
|
482
|
-
|
|
483
|
-
Information in this decorator will augment any
|
|
484
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
|
485
|
-
you can use `@conda_base` to set packages required by all
|
|
486
|
-
steps and use `@conda` to specify step-specific overrides.
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
Parameters
|
|
490
|
-
----------
|
|
491
|
-
packages : Dict[str, str], default {}
|
|
492
|
-
Packages to use for this step. The key is the name of the package
|
|
493
|
-
and the value is the version to use.
|
|
494
|
-
libraries : Dict[str, str], default {}
|
|
495
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
496
|
-
python : str, optional, default None
|
|
497
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
498
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
499
|
-
disabled : bool, default False
|
|
500
|
-
If set to True, disables @conda.
|
|
501
|
-
"""
|
|
502
|
-
...
|
|
503
|
-
|
|
504
661
|
def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', image_pull_secrets: typing.List[str] = [], service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[typing.Dict[str, str]] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable', security_context: typing.Optional[typing.Dict[str, typing.Any]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
|
505
662
|
"""
|
|
506
663
|
Specifies that this step should execute on Kubernetes.
|
|
@@ -591,337 +748,145 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
|
|
|
591
748
|
...
|
|
592
749
|
|
|
593
750
|
@typing.overload
|
|
594
|
-
def
|
|
595
|
-
"""
|
|
596
|
-
Specifies the number of times the task corresponding
|
|
597
|
-
to a step needs to be retried.
|
|
598
|
-
|
|
599
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
|
600
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
|
601
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
|
602
|
-
|
|
603
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
|
604
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
|
605
|
-
ensuring that the flow execution can continue.
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
Parameters
|
|
609
|
-
----------
|
|
610
|
-
times : int, default 3
|
|
611
|
-
Number of times to retry this task.
|
|
612
|
-
minutes_between_retries : int, default 2
|
|
613
|
-
Number of minutes between retries.
|
|
614
|
-
"""
|
|
615
|
-
...
|
|
616
|
-
|
|
617
|
-
@typing.overload
|
|
618
|
-
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
619
|
-
...
|
|
620
|
-
|
|
621
|
-
@typing.overload
|
|
622
|
-
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
623
|
-
...
|
|
624
|
-
|
|
625
|
-
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):
|
|
751
|
+
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]]]:
|
|
626
752
|
"""
|
|
627
|
-
Specifies the
|
|
628
|
-
to a step needs to be retried.
|
|
629
|
-
|
|
630
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
|
631
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
|
632
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
|
633
|
-
|
|
634
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
|
635
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
|
636
|
-
ensuring that the flow execution can continue.
|
|
637
|
-
|
|
753
|
+
Specifies the PyPI packages for the step.
|
|
638
754
|
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
minutes_between_retries : int, default 2
|
|
644
|
-
Number of minutes between retries.
|
|
645
|
-
"""
|
|
646
|
-
...
|
|
647
|
-
|
|
648
|
-
@typing.overload
|
|
649
|
-
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]]]:
|
|
650
|
-
"""
|
|
651
|
-
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
|
755
|
+
Information in this decorator will augment any
|
|
756
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
|
757
|
+
you can use `@pypi_base` to set packages required by all
|
|
758
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
652
759
|
|
|
653
760
|
|
|
654
761
|
Parameters
|
|
655
762
|
----------
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
memory : int, default 4096
|
|
663
|
-
Memory size (in MB) required for this step. If
|
|
664
|
-
`@resources` is also present, the maximum value from all decorators is
|
|
665
|
-
used.
|
|
666
|
-
image : str, optional, default None
|
|
667
|
-
Docker image to use when launching on AWS Batch. If not specified, and
|
|
668
|
-
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
|
669
|
-
not, a default Docker image mapping to the current version of Python is used.
|
|
670
|
-
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
|
671
|
-
AWS Batch Job Queue to submit the job to.
|
|
672
|
-
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
|
673
|
-
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
|
674
|
-
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
|
675
|
-
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
|
676
|
-
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
|
677
|
-
shared_memory : int, optional, default None
|
|
678
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
|
679
|
-
This parameter maps to the `--shm-size` option in Docker.
|
|
680
|
-
max_swap : int, optional, default None
|
|
681
|
-
The total amount of swap memory (in MiB) a container can use for this
|
|
682
|
-
step. This parameter is translated to the `--memory-swap` option in
|
|
683
|
-
Docker where the value is the sum of the container memory plus the
|
|
684
|
-
`max_swap` value.
|
|
685
|
-
swappiness : int, optional, default None
|
|
686
|
-
This allows you to tune memory swappiness behavior for this step.
|
|
687
|
-
A swappiness value of 0 causes swapping not to happen unless absolutely
|
|
688
|
-
necessary. A swappiness value of 100 causes pages to be swapped very
|
|
689
|
-
aggressively. Accepted values are whole numbers between 0 and 100.
|
|
690
|
-
use_tmpfs : bool, default False
|
|
691
|
-
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
|
692
|
-
not available on Fargate compute environments
|
|
693
|
-
tmpfs_tempdir : bool, default True
|
|
694
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
|
695
|
-
tmpfs_size : int, optional, default None
|
|
696
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
|
697
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
|
698
|
-
memory allocated for this step.
|
|
699
|
-
tmpfs_path : str, optional, default None
|
|
700
|
-
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
|
701
|
-
inferentia : int, default 0
|
|
702
|
-
Number of Inferentia chips required for this step.
|
|
703
|
-
trainium : int, default None
|
|
704
|
-
Alias for inferentia. Use only one of the two.
|
|
705
|
-
efa : int, default 0
|
|
706
|
-
Number of elastic fabric adapter network devices to attach to container
|
|
707
|
-
ephemeral_storage : int, default None
|
|
708
|
-
The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
|
|
709
|
-
This is only relevant for Fargate compute environments
|
|
710
|
-
log_driver: str, optional, default None
|
|
711
|
-
The log driver to use for the Amazon ECS container.
|
|
712
|
-
log_options: List[str], optional, default None
|
|
713
|
-
List of strings containing options for the chosen log driver. The configurable values
|
|
714
|
-
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
|
715
|
-
Example: [`awslogs-group:aws/batch/job`]
|
|
763
|
+
packages : Dict[str, str], default: {}
|
|
764
|
+
Packages to use for this step. The key is the name of the package
|
|
765
|
+
and the value is the version to use.
|
|
766
|
+
python : str, optional, default: None
|
|
767
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
768
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
716
769
|
"""
|
|
717
770
|
...
|
|
718
771
|
|
|
719
772
|
@typing.overload
|
|
720
|
-
def
|
|
773
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
721
774
|
...
|
|
722
775
|
|
|
723
776
|
@typing.overload
|
|
724
|
-
def
|
|
725
|
-
...
|
|
726
|
-
|
|
727
|
-
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):
|
|
728
|
-
"""
|
|
729
|
-
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
Parameters
|
|
733
|
-
----------
|
|
734
|
-
cpu : int, default 1
|
|
735
|
-
Number of CPUs required for this step. If `@resources` is
|
|
736
|
-
also present, the maximum value from all decorators is used.
|
|
737
|
-
gpu : int, default 0
|
|
738
|
-
Number of GPUs required for this step. If `@resources` is
|
|
739
|
-
also present, the maximum value from all decorators is used.
|
|
740
|
-
memory : int, default 4096
|
|
741
|
-
Memory size (in MB) required for this step. If
|
|
742
|
-
`@resources` is also present, the maximum value from all decorators is
|
|
743
|
-
used.
|
|
744
|
-
image : str, optional, default None
|
|
745
|
-
Docker image to use when launching on AWS Batch. If not specified, and
|
|
746
|
-
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
|
747
|
-
not, a default Docker image mapping to the current version of Python is used.
|
|
748
|
-
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
|
749
|
-
AWS Batch Job Queue to submit the job to.
|
|
750
|
-
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
|
751
|
-
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
|
752
|
-
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
|
753
|
-
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
|
754
|
-
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
|
755
|
-
shared_memory : int, optional, default None
|
|
756
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
|
757
|
-
This parameter maps to the `--shm-size` option in Docker.
|
|
758
|
-
max_swap : int, optional, default None
|
|
759
|
-
The total amount of swap memory (in MiB) a container can use for this
|
|
760
|
-
step. This parameter is translated to the `--memory-swap` option in
|
|
761
|
-
Docker where the value is the sum of the container memory plus the
|
|
762
|
-
`max_swap` value.
|
|
763
|
-
swappiness : int, optional, default None
|
|
764
|
-
This allows you to tune memory swappiness behavior for this step.
|
|
765
|
-
A swappiness value of 0 causes swapping not to happen unless absolutely
|
|
766
|
-
necessary. A swappiness value of 100 causes pages to be swapped very
|
|
767
|
-
aggressively. Accepted values are whole numbers between 0 and 100.
|
|
768
|
-
use_tmpfs : bool, default False
|
|
769
|
-
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
|
770
|
-
not available on Fargate compute environments
|
|
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 None
|
|
778
|
-
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
|
779
|
-
inferentia : int, default 0
|
|
780
|
-
Number of Inferentia chips required for this step.
|
|
781
|
-
trainium : int, default None
|
|
782
|
-
Alias for inferentia. Use only one of the two.
|
|
783
|
-
efa : int, default 0
|
|
784
|
-
Number of elastic fabric adapter network devices to attach to container
|
|
785
|
-
ephemeral_storage : int, default None
|
|
786
|
-
The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
|
|
787
|
-
This is only relevant for Fargate compute environments
|
|
788
|
-
log_driver: str, optional, default None
|
|
789
|
-
The log driver to use for the Amazon ECS container.
|
|
790
|
-
log_options: List[str], optional, default None
|
|
791
|
-
List of strings containing options for the chosen log driver. The configurable values
|
|
792
|
-
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
|
793
|
-
Example: [`awslogs-group:aws/batch/job`]
|
|
794
|
-
"""
|
|
777
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
795
778
|
...
|
|
796
779
|
|
|
797
|
-
|
|
798
|
-
def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
|
780
|
+
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):
|
|
799
781
|
"""
|
|
800
|
-
Specifies
|
|
801
|
-
the execution of a step.
|
|
802
|
-
|
|
782
|
+
Specifies the PyPI packages for the step.
|
|
803
783
|
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
role : str, optional, default: None
|
|
809
|
-
Role to use for fetching secrets
|
|
810
|
-
"""
|
|
811
|
-
...
|
|
812
|
-
|
|
813
|
-
@typing.overload
|
|
814
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
815
|
-
...
|
|
816
|
-
|
|
817
|
-
@typing.overload
|
|
818
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
819
|
-
...
|
|
820
|
-
|
|
821
|
-
def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None):
|
|
822
|
-
"""
|
|
823
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
|
824
|
-
the execution of a step.
|
|
784
|
+
Information in this decorator will augment any
|
|
785
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
|
786
|
+
you can use `@pypi_base` to set packages required by all
|
|
787
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
825
788
|
|
|
826
789
|
|
|
827
790
|
Parameters
|
|
828
791
|
----------
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
792
|
+
packages : Dict[str, str], default: {}
|
|
793
|
+
Packages to use for this step. The key is the name of the package
|
|
794
|
+
and the value is the version to use.
|
|
795
|
+
python : str, optional, default: None
|
|
796
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
797
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
833
798
|
"""
|
|
834
799
|
...
|
|
835
800
|
|
|
836
801
|
@typing.overload
|
|
837
|
-
def
|
|
802
|
+
def conda(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
|
838
803
|
"""
|
|
839
|
-
Specifies
|
|
804
|
+
Specifies the Conda environment for the step.
|
|
840
805
|
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
806
|
+
Information in this decorator will augment any
|
|
807
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
|
808
|
+
you can use `@conda_base` to set packages required by all
|
|
809
|
+
steps and use `@conda` to specify step-specific overrides.
|
|
845
810
|
|
|
846
811
|
|
|
847
812
|
Parameters
|
|
848
813
|
----------
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
814
|
+
packages : Dict[str, str], default {}
|
|
815
|
+
Packages to use for this step. The key is the name of the package
|
|
816
|
+
and the value is the version to use.
|
|
817
|
+
libraries : Dict[str, str], default {}
|
|
818
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
819
|
+
python : str, optional, default None
|
|
820
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
821
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
822
|
+
disabled : bool, default False
|
|
823
|
+
If set to True, disables @conda.
|
|
855
824
|
"""
|
|
856
825
|
...
|
|
857
826
|
|
|
858
827
|
@typing.overload
|
|
859
|
-
def
|
|
828
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
860
829
|
...
|
|
861
830
|
|
|
862
831
|
@typing.overload
|
|
863
|
-
def
|
|
832
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
864
833
|
...
|
|
865
834
|
|
|
866
|
-
def
|
|
835
|
+
def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
|
867
836
|
"""
|
|
868
|
-
Specifies
|
|
837
|
+
Specifies the Conda environment for the step.
|
|
869
838
|
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
839
|
+
Information in this decorator will augment any
|
|
840
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
|
841
|
+
you can use `@conda_base` to set packages required by all
|
|
842
|
+
steps and use `@conda` to specify step-specific overrides.
|
|
874
843
|
|
|
875
844
|
|
|
876
845
|
Parameters
|
|
877
846
|
----------
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
847
|
+
packages : Dict[str, str], default {}
|
|
848
|
+
Packages to use for this step. The key is the name of the package
|
|
849
|
+
and the value is the version to use.
|
|
850
|
+
libraries : Dict[str, str], default {}
|
|
851
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
852
|
+
python : str, optional, default None
|
|
853
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
854
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
855
|
+
disabled : bool, default False
|
|
856
|
+
If set to True, disables @conda.
|
|
884
857
|
"""
|
|
885
858
|
...
|
|
886
859
|
|
|
887
860
|
@typing.overload
|
|
888
|
-
def
|
|
861
|
+
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]]]:
|
|
889
862
|
"""
|
|
890
|
-
Specifies
|
|
863
|
+
Specifies environment variables to be set prior to the execution of a step.
|
|
891
864
|
|
|
892
|
-
Use `@pypi_base` to set common packages required by all
|
|
893
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
894
865
|
|
|
895
866
|
Parameters
|
|
896
867
|
----------
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
and the value is the version to use.
|
|
900
|
-
python : str, optional, default: None
|
|
901
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
902
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
868
|
+
vars : Dict[str, str], default {}
|
|
869
|
+
Dictionary of environment variables to set.
|
|
903
870
|
"""
|
|
904
871
|
...
|
|
905
872
|
|
|
906
873
|
@typing.overload
|
|
907
|
-
def
|
|
874
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
908
875
|
...
|
|
909
876
|
|
|
910
|
-
|
|
877
|
+
@typing.overload
|
|
878
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
879
|
+
...
|
|
880
|
+
|
|
881
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
|
911
882
|
"""
|
|
912
|
-
Specifies
|
|
883
|
+
Specifies environment variables to be set prior to the execution of a step.
|
|
913
884
|
|
|
914
|
-
Use `@pypi_base` to set common packages required by all
|
|
915
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
916
885
|
|
|
917
886
|
Parameters
|
|
918
887
|
----------
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
and the value is the version to use.
|
|
922
|
-
python : str, optional, default: None
|
|
923
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
924
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
888
|
+
vars : Dict[str, str], default {}
|
|
889
|
+
Dictionary of environment variables to set.
|
|
925
890
|
"""
|
|
926
891
|
...
|
|
927
892
|
|
|
@@ -968,41 +933,6 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
|
|
|
968
933
|
"""
|
|
969
934
|
...
|
|
970
935
|
|
|
971
|
-
def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
972
|
-
"""
|
|
973
|
-
Specifies what flows belong to the same project.
|
|
974
|
-
|
|
975
|
-
A project-specific namespace is created for all flows that
|
|
976
|
-
use the same `@project(name)`.
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
Parameters
|
|
980
|
-
----------
|
|
981
|
-
name : str
|
|
982
|
-
Project name. Make sure that the name is unique amongst all
|
|
983
|
-
projects that use the same production scheduler. The name may
|
|
984
|
-
contain only lowercase alphanumeric characters and underscores.
|
|
985
|
-
|
|
986
|
-
branch : Optional[str], default None
|
|
987
|
-
The branch to use. If not specified, the branch is set to
|
|
988
|
-
`user.<username>` unless `production` is set to `True`. This can
|
|
989
|
-
also be set on the command line using `--branch` as a top-level option.
|
|
990
|
-
It is an error to specify `branch` in the decorator and on the command line.
|
|
991
|
-
|
|
992
|
-
production : bool, default False
|
|
993
|
-
Whether or not the branch is the production branch. This can also be set on the
|
|
994
|
-
command line using `--production` as a top-level option. It is an error to specify
|
|
995
|
-
`production` in the decorator and on the command line.
|
|
996
|
-
The project branch name will be:
|
|
997
|
-
- if `branch` is specified:
|
|
998
|
-
- if `production` is True: `prod.<branch>`
|
|
999
|
-
- if `production` is False: `test.<branch>`
|
|
1000
|
-
- if `branch` is not specified:
|
|
1001
|
-
- if `production` is True: `prod`
|
|
1002
|
-
- if `production` is False: `user.<username>`
|
|
1003
|
-
"""
|
|
1004
|
-
...
|
|
1005
|
-
|
|
1006
936
|
@typing.overload
|
|
1007
937
|
def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
1008
938
|
"""
|
|
@@ -1147,49 +1077,6 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
|
|
|
1147
1077
|
"""
|
|
1148
1078
|
...
|
|
1149
1079
|
|
|
1150
|
-
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]]:
|
|
1151
|
-
"""
|
|
1152
|
-
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)
|
|
1153
|
-
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
|
1154
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
|
1155
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
|
1156
|
-
starts only after all sensors finish.
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
Parameters
|
|
1160
|
-
----------
|
|
1161
|
-
timeout : int
|
|
1162
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
|
1163
|
-
poke_interval : int
|
|
1164
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
|
1165
|
-
mode : str
|
|
1166
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
|
1167
|
-
exponential_backoff : bool
|
|
1168
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
|
1169
|
-
pool : str
|
|
1170
|
-
the slot pool this task should run in,
|
|
1171
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
|
1172
|
-
soft_fail : bool
|
|
1173
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
|
1174
|
-
name : str
|
|
1175
|
-
Name of the sensor on Airflow
|
|
1176
|
-
description : str
|
|
1177
|
-
Description of sensor in the Airflow UI
|
|
1178
|
-
bucket_key : Union[str, List[str]]
|
|
1179
|
-
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
|
1180
|
-
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
|
1181
|
-
bucket_name : str
|
|
1182
|
-
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
|
1183
|
-
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
|
1184
|
-
wildcard_match : bool
|
|
1185
|
-
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
|
1186
|
-
aws_conn_id : str
|
|
1187
|
-
a reference to the s3 connection on Airflow. (Default: None)
|
|
1188
|
-
verify : bool
|
|
1189
|
-
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
|
1190
|
-
"""
|
|
1191
|
-
...
|
|
1192
|
-
|
|
1193
1080
|
@typing.overload
|
|
1194
1081
|
def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
1195
1082
|
"""
|
|
@@ -1342,3 +1229,122 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
|
1342
1229
|
"""
|
|
1343
1230
|
...
|
|
1344
1231
|
|
|
1232
|
+
def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
1233
|
+
"""
|
|
1234
|
+
Specifies what flows belong to the same project.
|
|
1235
|
+
|
|
1236
|
+
A project-specific namespace is created for all flows that
|
|
1237
|
+
use the same `@project(name)`.
|
|
1238
|
+
|
|
1239
|
+
|
|
1240
|
+
Parameters
|
|
1241
|
+
----------
|
|
1242
|
+
name : str
|
|
1243
|
+
Project name. Make sure that the name is unique amongst all
|
|
1244
|
+
projects that use the same production scheduler. The name may
|
|
1245
|
+
contain only lowercase alphanumeric characters and underscores.
|
|
1246
|
+
|
|
1247
|
+
branch : Optional[str], default None
|
|
1248
|
+
The branch to use. If not specified, the branch is set to
|
|
1249
|
+
`user.<username>` unless `production` is set to `True`. This can
|
|
1250
|
+
also be set on the command line using `--branch` as a top-level option.
|
|
1251
|
+
It is an error to specify `branch` in the decorator and on the command line.
|
|
1252
|
+
|
|
1253
|
+
production : bool, default False
|
|
1254
|
+
Whether or not the branch is the production branch. This can also be set on the
|
|
1255
|
+
command line using `--production` as a top-level option. It is an error to specify
|
|
1256
|
+
`production` in the decorator and on the command line.
|
|
1257
|
+
The project branch name will be:
|
|
1258
|
+
- if `branch` is specified:
|
|
1259
|
+
- if `production` is True: `prod.<branch>`
|
|
1260
|
+
- if `production` is False: `test.<branch>`
|
|
1261
|
+
- if `branch` is not specified:
|
|
1262
|
+
- if `production` is True: `prod`
|
|
1263
|
+
- if `production` is False: `user.<username>`
|
|
1264
|
+
"""
|
|
1265
|
+
...
|
|
1266
|
+
|
|
1267
|
+
@typing.overload
|
|
1268
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
1269
|
+
"""
|
|
1270
|
+
Specifies the PyPI packages for all steps of the flow.
|
|
1271
|
+
|
|
1272
|
+
Use `@pypi_base` to set common packages required by all
|
|
1273
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
1274
|
+
|
|
1275
|
+
Parameters
|
|
1276
|
+
----------
|
|
1277
|
+
packages : Dict[str, str], default: {}
|
|
1278
|
+
Packages to use for this flow. The key is the name of the package
|
|
1279
|
+
and the value is the version to use.
|
|
1280
|
+
python : str, optional, default: None
|
|
1281
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1282
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1283
|
+
"""
|
|
1284
|
+
...
|
|
1285
|
+
|
|
1286
|
+
@typing.overload
|
|
1287
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1288
|
+
...
|
|
1289
|
+
|
|
1290
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
|
1291
|
+
"""
|
|
1292
|
+
Specifies the PyPI packages for all steps of the flow.
|
|
1293
|
+
|
|
1294
|
+
Use `@pypi_base` to set common packages required by all
|
|
1295
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
1296
|
+
|
|
1297
|
+
Parameters
|
|
1298
|
+
----------
|
|
1299
|
+
packages : Dict[str, str], default: {}
|
|
1300
|
+
Packages to use for this flow. The key is the name of the package
|
|
1301
|
+
and the value is the version to use.
|
|
1302
|
+
python : str, optional, default: None
|
|
1303
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1304
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1305
|
+
"""
|
|
1306
|
+
...
|
|
1307
|
+
|
|
1308
|
+
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]]:
|
|
1309
|
+
"""
|
|
1310
|
+
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)
|
|
1311
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
|
1312
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
|
1313
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
|
1314
|
+
starts only after all sensors finish.
|
|
1315
|
+
|
|
1316
|
+
|
|
1317
|
+
Parameters
|
|
1318
|
+
----------
|
|
1319
|
+
timeout : int
|
|
1320
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
|
1321
|
+
poke_interval : int
|
|
1322
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
|
1323
|
+
mode : str
|
|
1324
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
|
1325
|
+
exponential_backoff : bool
|
|
1326
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
|
1327
|
+
pool : str
|
|
1328
|
+
the slot pool this task should run in,
|
|
1329
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
|
1330
|
+
soft_fail : bool
|
|
1331
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
|
1332
|
+
name : str
|
|
1333
|
+
Name of the sensor on Airflow
|
|
1334
|
+
description : str
|
|
1335
|
+
Description of sensor in the Airflow UI
|
|
1336
|
+
bucket_key : Union[str, List[str]]
|
|
1337
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
|
1338
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
|
1339
|
+
bucket_name : str
|
|
1340
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
|
1341
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
|
1342
|
+
wildcard_match : bool
|
|
1343
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
|
1344
|
+
aws_conn_id : str
|
|
1345
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
|
1346
|
+
verify : bool
|
|
1347
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
|
1348
|
+
"""
|
|
1349
|
+
...
|
|
1350
|
+
|