metaflow-stubs 2.18.10__py2.py3-none-any.whl → 2.18.12__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 +502 -502
- 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 +2 -2
- metaflow-stubs/events.pyi +2 -2
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +3 -3
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +3 -3
- 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 +2 -2
- metaflow-stubs/metadata_provider/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -2
- metaflow-stubs/metaflow_current.pyi +5 -5
- metaflow-stubs/metaflow_git.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/packaging_sys/__init__.pyi +7 -7
- metaflow-stubs/packaging_sys/backend.pyi +2 -2
- metaflow-stubs/packaging_sys/distribution_support.pyi +3 -3
- metaflow-stubs/packaging_sys/tar_backend.pyi +5 -5
- metaflow-stubs/packaging_sys/utils.pyi +2 -2
- metaflow-stubs/packaging_sys/v1.pyi +3 -3
- metaflow-stubs/parameters.pyi +3 -3
- 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 +4 -4
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +2 -2
- metaflow-stubs/plugins/argo/exit_hooks.pyi +2 -2
- metaflow-stubs/plugins/aws/__init__.pyi +3 -3
- metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
- 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 +2 -2
- 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 +3 -3
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +3 -3
- 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 +4 -4
- 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 +2 -2
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +5 -3
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +17 -5
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +3 -3
- metaflow-stubs/plugins/cards/card_modules/json_viewer.pyi +3 -3
- 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 +2 -2
- 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 +3 -3
- 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 +4 -4
- 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 +2 -2
- 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/parsers.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 +6 -6
- 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 +4 -4
- 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 +2 -2
- metaflow-stubs/plugins/uv/__init__.pyi +2 -2
- metaflow-stubs/plugins/uv/uv_environment.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +33 -33
- metaflow-stubs/runner/deployer_impl.pyi +2 -2
- metaflow-stubs/runner/metaflow_runner.pyi +2 -2
- 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 +5 -5
- metaflow-stubs/system/__init__.pyi +2 -2
- metaflow-stubs/system/system_logger.pyi +2 -2
- 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 +2 -2
- metaflow-stubs/user_configs/config_parameters.pyi +6 -6
- metaflow-stubs/user_decorators/__init__.pyi +2 -2
- metaflow-stubs/user_decorators/common.pyi +2 -2
- metaflow-stubs/user_decorators/mutable_flow.pyi +4 -4
- metaflow-stubs/user_decorators/mutable_step.pyi +4 -4
- metaflow-stubs/user_decorators/user_flow_decorator.pyi +2 -2
- metaflow-stubs/user_decorators/user_step_decorator.pyi +4 -4
- metaflow-stubs/version.pyi +2 -2
- {metaflow_stubs-2.18.10.dist-info → metaflow_stubs-2.18.12.dist-info}/METADATA +2 -2
- metaflow_stubs-2.18.12.dist-info/RECORD +168 -0
- metaflow_stubs-2.18.10.dist-info/RECORD +0 -168
- {metaflow_stubs-2.18.10.dist-info → metaflow_stubs-2.18.12.dist-info}/WHEEL +0 -0
- {metaflow_stubs-2.18.10.dist-info → metaflow_stubs-2.18.12.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-10-
|
|
3
|
+
# MF version: 2.18.12 #
|
|
4
|
+
# Generated on 2025-10-15T20:44:18.181602 #
|
|
5
5
|
######################################################################################################
|
|
6
6
|
|
|
7
7
|
from __future__ import annotations
|
|
8
8
|
|
|
9
9
|
import typing
|
|
10
10
|
if typing.TYPE_CHECKING:
|
|
11
|
-
import typing
|
|
12
11
|
import datetime
|
|
12
|
+
import typing
|
|
13
13
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
|
14
14
|
StepFlag = typing.NewType("StepFlag", bool)
|
|
15
15
|
|
|
@@ -39,18 +39,18 @@ from .user_decorators.user_step_decorator import UserStepDecorator as UserStepDe
|
|
|
39
39
|
from .user_decorators.user_step_decorator import StepMutator as StepMutator
|
|
40
40
|
from .user_decorators.user_step_decorator import user_step_decorator as user_step_decorator
|
|
41
41
|
from .user_decorators.user_flow_decorator import FlowMutator as FlowMutator
|
|
42
|
-
from . import events as events
|
|
43
|
-
from . import metaflow_git as metaflow_git
|
|
44
42
|
from . import tuple_util as tuple_util
|
|
43
|
+
from . import metaflow_git as metaflow_git
|
|
44
|
+
from . import events as events
|
|
45
45
|
from . import runner as runner
|
|
46
46
|
from . import plugins as plugins
|
|
47
47
|
from .plugins.datatools.s3.s3 import S3 as S3
|
|
48
48
|
from . import includefile as includefile
|
|
49
49
|
from .includefile import IncludeFile as IncludeFile
|
|
50
|
-
from .plugins.
|
|
50
|
+
from .plugins.parsers import yaml_parser as yaml_parser
|
|
51
51
|
from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
|
|
52
|
+
from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
|
|
52
53
|
from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
|
|
53
|
-
from .plugins.parsers import yaml_parser as yaml_parser
|
|
54
54
|
from . import cards as cards
|
|
55
55
|
from . import client as client
|
|
56
56
|
from .client.core import namespace as namespace
|
|
@@ -259,128 +259,6 @@ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
|
259
259
|
"""
|
|
260
260
|
...
|
|
261
261
|
|
|
262
|
-
@typing.overload
|
|
263
|
-
def environment(*, vars: typing.Dict[str, str] = {}) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
|
264
|
-
"""
|
|
265
|
-
Specifies environment variables to be set prior to the execution of a step.
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
Parameters
|
|
269
|
-
----------
|
|
270
|
-
vars : Dict[str, str], default {}
|
|
271
|
-
Dictionary of environment variables to set.
|
|
272
|
-
"""
|
|
273
|
-
...
|
|
274
|
-
|
|
275
|
-
@typing.overload
|
|
276
|
-
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
277
|
-
...
|
|
278
|
-
|
|
279
|
-
@typing.overload
|
|
280
|
-
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
281
|
-
...
|
|
282
|
-
|
|
283
|
-
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
|
284
|
-
"""
|
|
285
|
-
Specifies environment variables to be set prior to the execution of a step.
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
Parameters
|
|
289
|
-
----------
|
|
290
|
-
vars : Dict[str, str], default {}
|
|
291
|
-
Dictionary of environment variables to set.
|
|
292
|
-
"""
|
|
293
|
-
...
|
|
294
|
-
|
|
295
|
-
def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', image_pull_secrets: typing.List[str] = [], service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[typing.Dict[str, str]] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable', security_context: typing.Optional[typing.Dict[str, typing.Any]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
|
296
|
-
"""
|
|
297
|
-
Specifies that this step should execute on Kubernetes.
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
Parameters
|
|
301
|
-
----------
|
|
302
|
-
cpu : int, default 1
|
|
303
|
-
Number of CPUs required for this step. If `@resources` is
|
|
304
|
-
also present, the maximum value from all decorators is used.
|
|
305
|
-
memory : int, default 4096
|
|
306
|
-
Memory size (in MB) required for this step. If
|
|
307
|
-
`@resources` is also present, the maximum value from all decorators is
|
|
308
|
-
used.
|
|
309
|
-
disk : int, default 10240
|
|
310
|
-
Disk size (in MB) required for this step. If
|
|
311
|
-
`@resources` is also present, the maximum value from all decorators is
|
|
312
|
-
used.
|
|
313
|
-
image : str, optional, default None
|
|
314
|
-
Docker image to use when launching on Kubernetes. If not specified, and
|
|
315
|
-
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
|
316
|
-
not, a default Docker image mapping to the current version of Python is used.
|
|
317
|
-
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
|
318
|
-
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
|
319
|
-
image_pull_secrets: List[str], default []
|
|
320
|
-
The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
|
|
321
|
-
Kubernetes image pull secrets to use when pulling container images
|
|
322
|
-
in Kubernetes.
|
|
323
|
-
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
|
324
|
-
Kubernetes service account to use when launching pod in Kubernetes.
|
|
325
|
-
secrets : List[str], optional, default None
|
|
326
|
-
Kubernetes secrets to use when launching pod in Kubernetes. These
|
|
327
|
-
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
|
328
|
-
in Metaflow configuration.
|
|
329
|
-
node_selector: Union[Dict[str,str], str], optional, default None
|
|
330
|
-
Kubernetes node selector(s) to apply to the pod running the task.
|
|
331
|
-
Can be passed in as a comma separated string of values e.g.
|
|
332
|
-
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
|
333
|
-
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
|
334
|
-
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
|
335
|
-
Kubernetes namespace to use when launching pod in Kubernetes.
|
|
336
|
-
gpu : int, optional, default None
|
|
337
|
-
Number of GPUs required for this step. A value of zero implies that
|
|
338
|
-
the scheduled node should not have GPUs.
|
|
339
|
-
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
|
340
|
-
The vendor of the GPUs to be used for this step.
|
|
341
|
-
tolerations : List[Dict[str,str]], default []
|
|
342
|
-
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
|
343
|
-
Kubernetes tolerations to use when launching pod in Kubernetes.
|
|
344
|
-
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
|
345
|
-
Kubernetes labels to use when launching pod in Kubernetes.
|
|
346
|
-
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
|
347
|
-
Kubernetes annotations to use when launching pod in Kubernetes.
|
|
348
|
-
use_tmpfs : bool, default False
|
|
349
|
-
This enables an explicit tmpfs mount for this step.
|
|
350
|
-
tmpfs_tempdir : bool, default True
|
|
351
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
|
352
|
-
tmpfs_size : int, optional, default: None
|
|
353
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
|
354
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
|
355
|
-
memory allocated for this step.
|
|
356
|
-
tmpfs_path : str, optional, default /metaflow_temp
|
|
357
|
-
Path to tmpfs mount for this step.
|
|
358
|
-
persistent_volume_claims : Dict[str, str], optional, default None
|
|
359
|
-
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
|
360
|
-
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
|
361
|
-
shared_memory: int, optional
|
|
362
|
-
Shared memory size (in MiB) required for this step
|
|
363
|
-
port: int, optional
|
|
364
|
-
Port number to specify in the Kubernetes job object
|
|
365
|
-
compute_pool : str, optional, default None
|
|
366
|
-
Compute pool to be used for for this step.
|
|
367
|
-
If not specified, any accessible compute pool within the perimeter is used.
|
|
368
|
-
hostname_resolution_timeout: int, default 10 * 60
|
|
369
|
-
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
|
370
|
-
Only applicable when @parallel is used.
|
|
371
|
-
qos: str, default: Burstable
|
|
372
|
-
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
|
373
|
-
|
|
374
|
-
security_context: Dict[str, Any], optional, default None
|
|
375
|
-
Container security context. Applies to the task container. Allows the following keys:
|
|
376
|
-
- privileged: bool, optional, default None
|
|
377
|
-
- allow_privilege_escalation: bool, optional, default None
|
|
378
|
-
- run_as_user: int, optional, default None
|
|
379
|
-
- run_as_group: int, optional, default None
|
|
380
|
-
- run_as_non_root: bool, optional, default None
|
|
381
|
-
"""
|
|
382
|
-
...
|
|
383
|
-
|
|
384
262
|
@typing.overload
|
|
385
263
|
def card(*, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
|
386
264
|
"""
|
|
@@ -431,147 +309,42 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
|
|
|
431
309
|
...
|
|
432
310
|
|
|
433
311
|
@typing.overload
|
|
434
|
-
def
|
|
312
|
+
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]]]:
|
|
435
313
|
"""
|
|
436
|
-
Specifies
|
|
437
|
-
|
|
438
|
-
Use `@resources` to specify the resource requirements
|
|
439
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
|
440
|
-
|
|
441
|
-
You can choose the compute layer on the command line by executing e.g.
|
|
442
|
-
```
|
|
443
|
-
python myflow.py run --with batch
|
|
444
|
-
```
|
|
445
|
-
or
|
|
446
|
-
```
|
|
447
|
-
python myflow.py run --with kubernetes
|
|
448
|
-
```
|
|
449
|
-
which executes the flow on the desired system using the
|
|
450
|
-
requirements specified in `@resources`.
|
|
314
|
+
Specifies environment variables to be set prior to the execution of a step.
|
|
451
315
|
|
|
452
316
|
|
|
453
317
|
Parameters
|
|
454
318
|
----------
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
gpu : int, optional, default None
|
|
458
|
-
Number of GPUs required for this step.
|
|
459
|
-
disk : int, optional, default None
|
|
460
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
|
461
|
-
memory : int, default 4096
|
|
462
|
-
Memory size (in MB) required for this step.
|
|
463
|
-
shared_memory : int, optional, default None
|
|
464
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
|
465
|
-
This parameter maps to the `--shm-size` option in Docker.
|
|
319
|
+
vars : Dict[str, str], default {}
|
|
320
|
+
Dictionary of environment variables to set.
|
|
466
321
|
"""
|
|
467
322
|
...
|
|
468
323
|
|
|
469
324
|
@typing.overload
|
|
470
|
-
def
|
|
325
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
471
326
|
...
|
|
472
327
|
|
|
473
328
|
@typing.overload
|
|
474
|
-
def
|
|
475
|
-
...
|
|
476
|
-
|
|
477
|
-
def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
|
|
478
|
-
"""
|
|
479
|
-
Specifies the resources needed when executing this step.
|
|
480
|
-
|
|
481
|
-
Use `@resources` to specify the resource requirements
|
|
482
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
|
483
|
-
|
|
484
|
-
You can choose the compute layer on the command line by executing e.g.
|
|
485
|
-
```
|
|
486
|
-
python myflow.py run --with batch
|
|
487
|
-
```
|
|
488
|
-
or
|
|
489
|
-
```
|
|
490
|
-
python myflow.py run --with kubernetes
|
|
491
|
-
```
|
|
492
|
-
which executes the flow on the desired system using the
|
|
493
|
-
requirements specified in `@resources`.
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
Parameters
|
|
497
|
-
----------
|
|
498
|
-
cpu : int, default 1
|
|
499
|
-
Number of CPUs required for this step.
|
|
500
|
-
gpu : int, optional, default None
|
|
501
|
-
Number of GPUs required for this step.
|
|
502
|
-
disk : int, optional, default None
|
|
503
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
|
504
|
-
memory : int, default 4096
|
|
505
|
-
Memory size (in MB) required for this step.
|
|
506
|
-
shared_memory : int, optional, default None
|
|
507
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
|
508
|
-
This parameter maps to the `--shm-size` option in Docker.
|
|
509
|
-
"""
|
|
329
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
510
330
|
...
|
|
511
331
|
|
|
512
|
-
|
|
513
|
-
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]]]:
|
|
332
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
|
514
333
|
"""
|
|
515
|
-
Specifies
|
|
516
|
-
|
|
517
|
-
Information in this decorator will augment any
|
|
518
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
|
519
|
-
you can use `@conda_base` to set packages required by all
|
|
520
|
-
steps and use `@conda` to specify step-specific overrides.
|
|
334
|
+
Specifies environment variables to be set prior to the execution of a step.
|
|
521
335
|
|
|
522
336
|
|
|
523
337
|
Parameters
|
|
524
338
|
----------
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
and the value is the version to use.
|
|
528
|
-
libraries : Dict[str, str], default {}
|
|
529
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
530
|
-
python : str, optional, default None
|
|
531
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
532
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
533
|
-
disabled : bool, default False
|
|
534
|
-
If set to True, disables @conda.
|
|
339
|
+
vars : Dict[str, str], default {}
|
|
340
|
+
Dictionary of environment variables to set.
|
|
535
341
|
"""
|
|
536
342
|
...
|
|
537
343
|
|
|
538
344
|
@typing.overload
|
|
539
|
-
def
|
|
540
|
-
...
|
|
541
|
-
|
|
542
|
-
@typing.overload
|
|
543
|
-
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
544
|
-
...
|
|
545
|
-
|
|
546
|
-
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):
|
|
345
|
+
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]]]:
|
|
547
346
|
"""
|
|
548
|
-
Specifies
|
|
549
|
-
|
|
550
|
-
Information in this decorator will augment any
|
|
551
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
|
552
|
-
you can use `@conda_base` to set packages required by all
|
|
553
|
-
steps and use `@conda` to specify step-specific overrides.
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
Parameters
|
|
557
|
-
----------
|
|
558
|
-
packages : Dict[str, str], default {}
|
|
559
|
-
Packages to use for this step. The key is the name of the package
|
|
560
|
-
and the value is the version to use.
|
|
561
|
-
libraries : Dict[str, str], default {}
|
|
562
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
563
|
-
python : str, optional, default None
|
|
564
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
565
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
566
|
-
disabled : bool, default False
|
|
567
|
-
If set to True, disables @conda.
|
|
568
|
-
"""
|
|
569
|
-
...
|
|
570
|
-
|
|
571
|
-
@typing.overload
|
|
572
|
-
def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = 'METAFLOW_BATCH_JOB_QUEUE', iam_role: str = 'METAFLOW_ECS_S3_ACCESS_IAM_ROLE', execution_role: str = 'METAFLOW_ECS_FARGATE_EXECUTION_ROLE', shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, aws_batch_tags: typing.Optional[typing.Dict[str, str]] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[str]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
|
573
|
-
"""
|
|
574
|
-
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
|
347
|
+
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
|
575
348
|
|
|
576
349
|
|
|
577
350
|
Parameters
|
|
@@ -743,92 +516,229 @@ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
|
743
516
|
...
|
|
744
517
|
|
|
745
518
|
@typing.overload
|
|
746
|
-
def
|
|
519
|
+
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]]]:
|
|
747
520
|
"""
|
|
748
|
-
Specifies
|
|
749
|
-
|
|
521
|
+
Specifies the Conda environment for the step.
|
|
522
|
+
|
|
523
|
+
Information in this decorator will augment any
|
|
524
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
|
525
|
+
you can use `@conda_base` to set packages required by all
|
|
526
|
+
steps and use `@conda` to specify step-specific overrides.
|
|
750
527
|
|
|
751
528
|
|
|
752
529
|
Parameters
|
|
753
530
|
----------
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
531
|
+
packages : Dict[str, str], default {}
|
|
532
|
+
Packages to use for this step. The key is the name of the package
|
|
533
|
+
and the value is the version to use.
|
|
534
|
+
libraries : Dict[str, str], default {}
|
|
535
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
536
|
+
python : str, optional, default None
|
|
537
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
538
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
539
|
+
disabled : bool, default False
|
|
540
|
+
If set to True, disables @conda.
|
|
758
541
|
"""
|
|
759
542
|
...
|
|
760
543
|
|
|
761
544
|
@typing.overload
|
|
762
|
-
def
|
|
545
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
763
546
|
...
|
|
764
547
|
|
|
765
548
|
@typing.overload
|
|
766
|
-
def
|
|
549
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
767
550
|
...
|
|
768
551
|
|
|
769
|
-
def
|
|
552
|
+
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):
|
|
770
553
|
"""
|
|
771
|
-
Specifies
|
|
772
|
-
|
|
554
|
+
Specifies the Conda environment for the step.
|
|
555
|
+
|
|
556
|
+
Information in this decorator will augment any
|
|
557
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
|
558
|
+
you can use `@conda_base` to set packages required by all
|
|
559
|
+
steps and use `@conda` to specify step-specific overrides.
|
|
773
560
|
|
|
774
561
|
|
|
775
562
|
Parameters
|
|
776
563
|
----------
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
564
|
+
packages : Dict[str, str], default {}
|
|
565
|
+
Packages to use for this step. The key is the name of the package
|
|
566
|
+
and the value is the version to use.
|
|
567
|
+
libraries : Dict[str, str], default {}
|
|
568
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
569
|
+
python : str, optional, default None
|
|
570
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
571
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
572
|
+
disabled : bool, default False
|
|
573
|
+
If set to True, disables @conda.
|
|
574
|
+
"""
|
|
575
|
+
...
|
|
576
|
+
|
|
577
|
+
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]]]:
|
|
578
|
+
"""
|
|
579
|
+
Specifies that this step should execute on Kubernetes.
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
Parameters
|
|
583
|
+
----------
|
|
584
|
+
cpu : int, default 1
|
|
585
|
+
Number of CPUs required for this step. If `@resources` is
|
|
586
|
+
also present, the maximum value from all decorators is used.
|
|
587
|
+
memory : int, default 4096
|
|
588
|
+
Memory size (in MB) required for this step. If
|
|
589
|
+
`@resources` is also present, the maximum value from all decorators is
|
|
590
|
+
used.
|
|
591
|
+
disk : int, default 10240
|
|
592
|
+
Disk size (in MB) required for this step. If
|
|
593
|
+
`@resources` is also present, the maximum value from all decorators is
|
|
594
|
+
used.
|
|
595
|
+
image : str, optional, default None
|
|
596
|
+
Docker image to use when launching on Kubernetes. If not specified, and
|
|
597
|
+
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
|
598
|
+
not, a default Docker image mapping to the current version of Python is used.
|
|
599
|
+
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
|
600
|
+
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
|
601
|
+
image_pull_secrets: List[str], default []
|
|
602
|
+
The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
|
|
603
|
+
Kubernetes image pull secrets to use when pulling container images
|
|
604
|
+
in Kubernetes.
|
|
605
|
+
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
|
606
|
+
Kubernetes service account to use when launching pod in Kubernetes.
|
|
607
|
+
secrets : List[str], optional, default None
|
|
608
|
+
Kubernetes secrets to use when launching pod in Kubernetes. These
|
|
609
|
+
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
|
610
|
+
in Metaflow configuration.
|
|
611
|
+
node_selector: Union[Dict[str,str], str], optional, default None
|
|
612
|
+
Kubernetes node selector(s) to apply to the pod running the task.
|
|
613
|
+
Can be passed in as a comma separated string of values e.g.
|
|
614
|
+
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
|
615
|
+
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
|
616
|
+
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
|
617
|
+
Kubernetes namespace to use when launching pod in Kubernetes.
|
|
618
|
+
gpu : int, optional, default None
|
|
619
|
+
Number of GPUs required for this step. A value of zero implies that
|
|
620
|
+
the scheduled node should not have GPUs.
|
|
621
|
+
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
|
622
|
+
The vendor of the GPUs to be used for this step.
|
|
623
|
+
tolerations : List[Dict[str,str]], default []
|
|
624
|
+
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
|
625
|
+
Kubernetes tolerations to use when launching pod in Kubernetes.
|
|
626
|
+
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
|
627
|
+
Kubernetes labels to use when launching pod in Kubernetes.
|
|
628
|
+
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
|
629
|
+
Kubernetes annotations to use when launching pod in Kubernetes.
|
|
630
|
+
use_tmpfs : bool, default False
|
|
631
|
+
This enables an explicit tmpfs mount for this step.
|
|
632
|
+
tmpfs_tempdir : bool, default True
|
|
633
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
|
634
|
+
tmpfs_size : int, optional, default: None
|
|
635
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
|
636
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
|
637
|
+
memory allocated for this step.
|
|
638
|
+
tmpfs_path : str, optional, default /metaflow_temp
|
|
639
|
+
Path to tmpfs mount for this step.
|
|
640
|
+
persistent_volume_claims : Dict[str, str], optional, default None
|
|
641
|
+
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
|
642
|
+
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
|
643
|
+
shared_memory: int, optional
|
|
644
|
+
Shared memory size (in MiB) required for this step
|
|
645
|
+
port: int, optional
|
|
646
|
+
Port number to specify in the Kubernetes job object
|
|
647
|
+
compute_pool : str, optional, default None
|
|
648
|
+
Compute pool to be used for for this step.
|
|
649
|
+
If not specified, any accessible compute pool within the perimeter is used.
|
|
650
|
+
hostname_resolution_timeout: int, default 10 * 60
|
|
651
|
+
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
|
652
|
+
Only applicable when @parallel is used.
|
|
653
|
+
qos: str, default: Burstable
|
|
654
|
+
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
|
655
|
+
|
|
656
|
+
security_context: Dict[str, Any], optional, default None
|
|
657
|
+
Container security context. Applies to the task container. Allows the following keys:
|
|
658
|
+
- privileged: bool, optional, default None
|
|
659
|
+
- allow_privilege_escalation: bool, optional, default None
|
|
660
|
+
- run_as_user: int, optional, default None
|
|
661
|
+
- run_as_group: int, optional, default None
|
|
662
|
+
- run_as_non_root: bool, optional, default None
|
|
781
663
|
"""
|
|
782
664
|
...
|
|
783
665
|
|
|
784
666
|
@typing.overload
|
|
785
|
-
def
|
|
667
|
+
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]]]:
|
|
786
668
|
"""
|
|
787
|
-
Specifies the
|
|
669
|
+
Specifies the resources needed when executing this step.
|
|
788
670
|
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
671
|
+
Use `@resources` to specify the resource requirements
|
|
672
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
|
673
|
+
|
|
674
|
+
You can choose the compute layer on the command line by executing e.g.
|
|
675
|
+
```
|
|
676
|
+
python myflow.py run --with batch
|
|
677
|
+
```
|
|
678
|
+
or
|
|
679
|
+
```
|
|
680
|
+
python myflow.py run --with kubernetes
|
|
681
|
+
```
|
|
682
|
+
which executes the flow on the desired system using the
|
|
683
|
+
requirements specified in `@resources`.
|
|
793
684
|
|
|
794
685
|
|
|
795
686
|
Parameters
|
|
796
687
|
----------
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
688
|
+
cpu : int, default 1
|
|
689
|
+
Number of CPUs required for this step.
|
|
690
|
+
gpu : int, optional, default None
|
|
691
|
+
Number of GPUs required for this step.
|
|
692
|
+
disk : int, optional, default None
|
|
693
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
|
694
|
+
memory : int, default 4096
|
|
695
|
+
Memory size (in MB) required for this step.
|
|
696
|
+
shared_memory : int, optional, default None
|
|
697
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
|
698
|
+
This parameter maps to the `--shm-size` option in Docker.
|
|
803
699
|
"""
|
|
804
700
|
...
|
|
805
701
|
|
|
806
702
|
@typing.overload
|
|
807
|
-
def
|
|
703
|
+
def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
808
704
|
...
|
|
809
705
|
|
|
810
706
|
@typing.overload
|
|
811
|
-
def
|
|
707
|
+
def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
812
708
|
...
|
|
813
709
|
|
|
814
|
-
def
|
|
710
|
+
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):
|
|
815
711
|
"""
|
|
816
|
-
Specifies the
|
|
712
|
+
Specifies the resources needed when executing this step.
|
|
817
713
|
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
714
|
+
Use `@resources` to specify the resource requirements
|
|
715
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
|
716
|
+
|
|
717
|
+
You can choose the compute layer on the command line by executing e.g.
|
|
718
|
+
```
|
|
719
|
+
python myflow.py run --with batch
|
|
720
|
+
```
|
|
721
|
+
or
|
|
722
|
+
```
|
|
723
|
+
python myflow.py run --with kubernetes
|
|
724
|
+
```
|
|
725
|
+
which executes the flow on the desired system using the
|
|
726
|
+
requirements specified in `@resources`.
|
|
822
727
|
|
|
823
728
|
|
|
824
729
|
Parameters
|
|
825
730
|
----------
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
731
|
+
cpu : int, default 1
|
|
732
|
+
Number of CPUs required for this step.
|
|
733
|
+
gpu : int, optional, default None
|
|
734
|
+
Number of GPUs required for this step.
|
|
735
|
+
disk : int, optional, default None
|
|
736
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
|
737
|
+
memory : int, default 4096
|
|
738
|
+
Memory size (in MB) required for this step.
|
|
739
|
+
shared_memory : int, optional, default None
|
|
740
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
|
741
|
+
This parameter maps to the `--shm-size` option in Docker.
|
|
832
742
|
"""
|
|
833
743
|
...
|
|
834
744
|
|
|
@@ -892,181 +802,92 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
|
892
802
|
...
|
|
893
803
|
|
|
894
804
|
@typing.overload
|
|
895
|
-
def
|
|
805
|
+
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]]]:
|
|
896
806
|
"""
|
|
897
|
-
Specifies the
|
|
807
|
+
Specifies the PyPI packages for the step.
|
|
898
808
|
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
```
|
|
904
|
-
@trigger(events=['foo', 'bar'])
|
|
905
|
-
```
|
|
906
|
-
|
|
907
|
-
Additionally, you can specify the parameter mappings
|
|
908
|
-
to map event payload to Metaflow parameters for the flow.
|
|
909
|
-
```
|
|
910
|
-
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
|
911
|
-
```
|
|
912
|
-
or
|
|
913
|
-
```
|
|
914
|
-
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
|
915
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
|
916
|
-
```
|
|
917
|
-
|
|
918
|
-
'parameters' can also be a list of strings and tuples like so:
|
|
919
|
-
```
|
|
920
|
-
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
|
921
|
-
```
|
|
922
|
-
This is equivalent to:
|
|
923
|
-
```
|
|
924
|
-
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
|
925
|
-
```
|
|
809
|
+
Information in this decorator will augment any
|
|
810
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
|
811
|
+
you can use `@pypi_base` to set packages required by all
|
|
812
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
926
813
|
|
|
927
814
|
|
|
928
815
|
Parameters
|
|
929
816
|
----------
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
817
|
+
packages : Dict[str, str], default: {}
|
|
818
|
+
Packages to use for this step. The key is the name of the package
|
|
819
|
+
and the value is the version to use.
|
|
820
|
+
python : str, optional, default: None
|
|
821
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
822
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
936
823
|
"""
|
|
937
824
|
...
|
|
938
825
|
|
|
939
826
|
@typing.overload
|
|
940
|
-
def
|
|
827
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
941
828
|
...
|
|
942
829
|
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
Specifies the event(s) that this flow depends on.
|
|
946
|
-
|
|
947
|
-
```
|
|
948
|
-
@trigger(event='foo')
|
|
949
|
-
```
|
|
950
|
-
or
|
|
951
|
-
```
|
|
952
|
-
@trigger(events=['foo', 'bar'])
|
|
953
|
-
```
|
|
954
|
-
|
|
955
|
-
Additionally, you can specify the parameter mappings
|
|
956
|
-
to map event payload to Metaflow parameters for the flow.
|
|
957
|
-
```
|
|
958
|
-
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
|
959
|
-
```
|
|
960
|
-
or
|
|
961
|
-
```
|
|
962
|
-
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
|
963
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
|
964
|
-
```
|
|
965
|
-
|
|
966
|
-
'parameters' can also be a list of strings and tuples like so:
|
|
967
|
-
```
|
|
968
|
-
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
|
969
|
-
```
|
|
970
|
-
This is equivalent to:
|
|
971
|
-
```
|
|
972
|
-
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
|
973
|
-
```
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
Parameters
|
|
977
|
-
----------
|
|
978
|
-
event : Union[str, Dict[str, Any]], optional, default None
|
|
979
|
-
Event dependency for this flow.
|
|
980
|
-
events : List[Union[str, Dict[str, Any]]], default []
|
|
981
|
-
Events dependency for this flow.
|
|
982
|
-
options : Dict[str, Any], default {}
|
|
983
|
-
Backend-specific configuration for tuning eventing behavior.
|
|
984
|
-
"""
|
|
830
|
+
@typing.overload
|
|
831
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
985
832
|
...
|
|
986
833
|
|
|
987
|
-
def
|
|
834
|
+
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):
|
|
988
835
|
"""
|
|
989
|
-
Specifies
|
|
836
|
+
Specifies the PyPI packages for the step.
|
|
990
837
|
|
|
991
|
-
|
|
992
|
-
|
|
838
|
+
Information in this decorator will augment any
|
|
839
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
|
840
|
+
you can use `@pypi_base` to set packages required by all
|
|
841
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
993
842
|
|
|
994
843
|
|
|
995
844
|
Parameters
|
|
996
845
|
----------
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
The branch to use. If not specified, the branch is set to
|
|
1004
|
-
`user.<username>` unless `production` is set to `True`. This can
|
|
1005
|
-
also be set on the command line using `--branch` as a top-level option.
|
|
1006
|
-
It is an error to specify `branch` in the decorator and on the command line.
|
|
1007
|
-
|
|
1008
|
-
production : bool, default False
|
|
1009
|
-
Whether or not the branch is the production branch. This can also be set on the
|
|
1010
|
-
command line using `--production` as a top-level option. It is an error to specify
|
|
1011
|
-
`production` in the decorator and on the command line.
|
|
1012
|
-
The project branch name will be:
|
|
1013
|
-
- if `branch` is specified:
|
|
1014
|
-
- if `production` is True: `prod.<branch>`
|
|
1015
|
-
- if `production` is False: `test.<branch>`
|
|
1016
|
-
- if `branch` is not specified:
|
|
1017
|
-
- if `production` is True: `prod`
|
|
1018
|
-
- if `production` is False: `user.<username>`
|
|
846
|
+
packages : Dict[str, str], default: {}
|
|
847
|
+
Packages to use for this step. The key is the name of the package
|
|
848
|
+
and the value is the version to use.
|
|
849
|
+
python : str, optional, default: None
|
|
850
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
851
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1019
852
|
"""
|
|
1020
853
|
...
|
|
1021
854
|
|
|
1022
855
|
@typing.overload
|
|
1023
|
-
def
|
|
856
|
+
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]]]:
|
|
1024
857
|
"""
|
|
1025
|
-
Specifies
|
|
1026
|
-
|
|
858
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
|
859
|
+
the execution of a step.
|
|
1027
860
|
|
|
1028
861
|
|
|
1029
862
|
Parameters
|
|
1030
863
|
----------
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
weekly : bool, default False
|
|
1036
|
-
Run the workflow weekly.
|
|
1037
|
-
cron : str, optional, default None
|
|
1038
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
|
1039
|
-
specified by this expression.
|
|
1040
|
-
timezone : str, optional, default None
|
|
1041
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
|
1042
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
|
864
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
|
865
|
+
List of secret specs, defining how the secrets are to be retrieved
|
|
866
|
+
role : str, optional, default: None
|
|
867
|
+
Role to use for fetching secrets
|
|
1043
868
|
"""
|
|
1044
869
|
...
|
|
1045
870
|
|
|
1046
871
|
@typing.overload
|
|
1047
|
-
def
|
|
872
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
1048
873
|
...
|
|
1049
874
|
|
|
1050
|
-
|
|
875
|
+
@typing.overload
|
|
876
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
877
|
+
...
|
|
878
|
+
|
|
879
|
+
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):
|
|
1051
880
|
"""
|
|
1052
|
-
Specifies
|
|
1053
|
-
|
|
881
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
|
882
|
+
the execution of a step.
|
|
1054
883
|
|
|
1055
884
|
|
|
1056
885
|
Parameters
|
|
1057
886
|
----------
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
weekly : bool, default False
|
|
1063
|
-
Run the workflow weekly.
|
|
1064
|
-
cron : str, optional, default None
|
|
1065
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
|
1066
|
-
specified by this expression.
|
|
1067
|
-
timezone : str, optional, default None
|
|
1068
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
|
1069
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
|
887
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
|
888
|
+
List of secret specs, defining how the secrets are to be retrieved
|
|
889
|
+
role : str, optional, default: None
|
|
890
|
+
Role to use for fetching secrets
|
|
1070
891
|
"""
|
|
1071
892
|
...
|
|
1072
893
|
|
|
@@ -1113,97 +934,44 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
|
|
|
1113
934
|
"""
|
|
1114
935
|
...
|
|
1115
936
|
|
|
1116
|
-
def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, bucket_key: typing.Union[str, typing.List[str]], bucket_name: str, wildcard_match: bool, aws_conn_id: str, verify: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
1117
|
-
"""
|
|
1118
|
-
The `@airflow_s3_key_sensor` decorator attaches a Airflow [S3KeySensor](https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/_api/airflow/providers/amazon/aws/sensors/s3/index.html#airflow.providers.amazon.aws.sensors.s3.S3KeySensor)
|
|
1119
|
-
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
|
1120
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
|
1121
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
|
1122
|
-
starts only after all sensors finish.
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
Parameters
|
|
1126
|
-
----------
|
|
1127
|
-
timeout : int
|
|
1128
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
|
1129
|
-
poke_interval : int
|
|
1130
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
|
1131
|
-
mode : str
|
|
1132
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
|
1133
|
-
exponential_backoff : bool
|
|
1134
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
|
1135
|
-
pool : str
|
|
1136
|
-
the slot pool this task should run in,
|
|
1137
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
|
1138
|
-
soft_fail : bool
|
|
1139
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
|
1140
|
-
name : str
|
|
1141
|
-
Name of the sensor on Airflow
|
|
1142
|
-
description : str
|
|
1143
|
-
Description of sensor in the Airflow UI
|
|
1144
|
-
bucket_key : Union[str, List[str]]
|
|
1145
|
-
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
|
1146
|
-
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
|
1147
|
-
bucket_name : str
|
|
1148
|
-
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
|
1149
|
-
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
|
1150
|
-
wildcard_match : bool
|
|
1151
|
-
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
|
1152
|
-
aws_conn_id : str
|
|
1153
|
-
a reference to the s3 connection on Airflow. (Default: None)
|
|
1154
|
-
verify : bool
|
|
1155
|
-
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
|
1156
|
-
"""
|
|
1157
|
-
...
|
|
1158
|
-
|
|
1159
937
|
@typing.overload
|
|
1160
|
-
def
|
|
938
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
1161
939
|
"""
|
|
1162
|
-
Specifies the
|
|
1163
|
-
|
|
1164
|
-
Use `@conda_base` to set common libraries required by all
|
|
1165
|
-
steps and use `@conda` to specify step-specific additions.
|
|
940
|
+
Specifies the PyPI packages for all steps of the flow.
|
|
1166
941
|
|
|
942
|
+
Use `@pypi_base` to set common packages required by all
|
|
943
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
1167
944
|
|
|
1168
945
|
Parameters
|
|
1169
946
|
----------
|
|
1170
|
-
packages : Dict[str, str], default {}
|
|
947
|
+
packages : Dict[str, str], default: {}
|
|
1171
948
|
Packages to use for this flow. The key is the name of the package
|
|
1172
949
|
and the value is the version to use.
|
|
1173
|
-
|
|
1174
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
1175
|
-
python : str, optional, default None
|
|
950
|
+
python : str, optional, default: None
|
|
1176
951
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1177
952
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1178
|
-
disabled : bool, default False
|
|
1179
|
-
If set to True, disables Conda.
|
|
1180
953
|
"""
|
|
1181
954
|
...
|
|
1182
955
|
|
|
1183
956
|
@typing.overload
|
|
1184
|
-
def
|
|
957
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1185
958
|
...
|
|
1186
959
|
|
|
1187
|
-
def
|
|
960
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
|
1188
961
|
"""
|
|
1189
|
-
Specifies the
|
|
1190
|
-
|
|
1191
|
-
Use `@conda_base` to set common libraries required by all
|
|
1192
|
-
steps and use `@conda` to specify step-specific additions.
|
|
962
|
+
Specifies the PyPI packages for all steps of the flow.
|
|
1193
963
|
|
|
964
|
+
Use `@pypi_base` to set common packages required by all
|
|
965
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
1194
966
|
|
|
1195
967
|
Parameters
|
|
1196
968
|
----------
|
|
1197
|
-
packages : Dict[str, str], default {}
|
|
969
|
+
packages : Dict[str, str], default: {}
|
|
1198
970
|
Packages to use for this flow. The key is the name of the package
|
|
1199
971
|
and the value is the version to use.
|
|
1200
|
-
|
|
1201
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
1202
|
-
python : str, optional, default None
|
|
972
|
+
python : str, optional, default: None
|
|
1203
973
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1204
974
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1205
|
-
disabled : bool, default False
|
|
1206
|
-
If set to True, disables Conda.
|
|
1207
975
|
"""
|
|
1208
976
|
...
|
|
1209
977
|
|
|
@@ -1309,43 +1077,275 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
|
1309
1077
|
...
|
|
1310
1078
|
|
|
1311
1079
|
@typing.overload
|
|
1312
|
-
def
|
|
1080
|
+
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]]:
|
|
1313
1081
|
"""
|
|
1314
|
-
Specifies the
|
|
1082
|
+
Specifies the times when the flow should be run when running on a
|
|
1083
|
+
production scheduler.
|
|
1315
1084
|
|
|
1316
|
-
Use `@pypi_base` to set common packages required by all
|
|
1317
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
1318
1085
|
|
|
1319
1086
|
Parameters
|
|
1320
1087
|
----------
|
|
1321
|
-
|
|
1088
|
+
hourly : bool, default False
|
|
1089
|
+
Run the workflow hourly.
|
|
1090
|
+
daily : bool, default True
|
|
1091
|
+
Run the workflow daily.
|
|
1092
|
+
weekly : bool, default False
|
|
1093
|
+
Run the workflow weekly.
|
|
1094
|
+
cron : str, optional, default None
|
|
1095
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
|
1096
|
+
specified by this expression.
|
|
1097
|
+
timezone : str, optional, default None
|
|
1098
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
|
1099
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
|
1100
|
+
"""
|
|
1101
|
+
...
|
|
1102
|
+
|
|
1103
|
+
@typing.overload
|
|
1104
|
+
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1105
|
+
...
|
|
1106
|
+
|
|
1107
|
+
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):
|
|
1108
|
+
"""
|
|
1109
|
+
Specifies the times when the flow should be run when running on a
|
|
1110
|
+
production scheduler.
|
|
1111
|
+
|
|
1112
|
+
|
|
1113
|
+
Parameters
|
|
1114
|
+
----------
|
|
1115
|
+
hourly : bool, default False
|
|
1116
|
+
Run the workflow hourly.
|
|
1117
|
+
daily : bool, default True
|
|
1118
|
+
Run the workflow daily.
|
|
1119
|
+
weekly : bool, default False
|
|
1120
|
+
Run the workflow weekly.
|
|
1121
|
+
cron : str, optional, default None
|
|
1122
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
|
1123
|
+
specified by this expression.
|
|
1124
|
+
timezone : str, optional, default None
|
|
1125
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
|
1126
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
|
1127
|
+
"""
|
|
1128
|
+
...
|
|
1129
|
+
|
|
1130
|
+
@typing.overload
|
|
1131
|
+
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]]:
|
|
1132
|
+
"""
|
|
1133
|
+
Specifies the Conda environment for all steps of the flow.
|
|
1134
|
+
|
|
1135
|
+
Use `@conda_base` to set common libraries required by all
|
|
1136
|
+
steps and use `@conda` to specify step-specific additions.
|
|
1137
|
+
|
|
1138
|
+
|
|
1139
|
+
Parameters
|
|
1140
|
+
----------
|
|
1141
|
+
packages : Dict[str, str], default {}
|
|
1322
1142
|
Packages to use for this flow. The key is the name of the package
|
|
1323
1143
|
and the value is the version to use.
|
|
1324
|
-
|
|
1144
|
+
libraries : Dict[str, str], default {}
|
|
1145
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
1146
|
+
python : str, optional, default None
|
|
1325
1147
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1326
1148
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1149
|
+
disabled : bool, default False
|
|
1150
|
+
If set to True, disables Conda.
|
|
1327
1151
|
"""
|
|
1328
1152
|
...
|
|
1329
1153
|
|
|
1330
1154
|
@typing.overload
|
|
1331
|
-
def
|
|
1155
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1332
1156
|
...
|
|
1333
1157
|
|
|
1334
|
-
def
|
|
1158
|
+
def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
|
1335
1159
|
"""
|
|
1336
|
-
Specifies the
|
|
1160
|
+
Specifies the Conda environment for all steps of the flow.
|
|
1161
|
+
|
|
1162
|
+
Use `@conda_base` to set common libraries required by all
|
|
1163
|
+
steps and use `@conda` to specify step-specific additions.
|
|
1337
1164
|
|
|
1338
|
-
Use `@pypi_base` to set common packages required by all
|
|
1339
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
1340
1165
|
|
|
1341
1166
|
Parameters
|
|
1342
1167
|
----------
|
|
1343
|
-
packages : Dict[str, str], default
|
|
1168
|
+
packages : Dict[str, str], default {}
|
|
1344
1169
|
Packages to use for this flow. The key is the name of the package
|
|
1345
1170
|
and the value is the version to use.
|
|
1346
|
-
|
|
1171
|
+
libraries : Dict[str, str], default {}
|
|
1172
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
1173
|
+
python : str, optional, default None
|
|
1347
1174
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1348
1175
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1176
|
+
disabled : bool, default False
|
|
1177
|
+
If set to True, disables Conda.
|
|
1178
|
+
"""
|
|
1179
|
+
...
|
|
1180
|
+
|
|
1181
|
+
@typing.overload
|
|
1182
|
+
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]]:
|
|
1183
|
+
"""
|
|
1184
|
+
Specifies the event(s) that this flow depends on.
|
|
1185
|
+
|
|
1186
|
+
```
|
|
1187
|
+
@trigger(event='foo')
|
|
1188
|
+
```
|
|
1189
|
+
or
|
|
1190
|
+
```
|
|
1191
|
+
@trigger(events=['foo', 'bar'])
|
|
1192
|
+
```
|
|
1193
|
+
|
|
1194
|
+
Additionally, you can specify the parameter mappings
|
|
1195
|
+
to map event payload to Metaflow parameters for the flow.
|
|
1196
|
+
```
|
|
1197
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
|
1198
|
+
```
|
|
1199
|
+
or
|
|
1200
|
+
```
|
|
1201
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
|
1202
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
|
1203
|
+
```
|
|
1204
|
+
|
|
1205
|
+
'parameters' can also be a list of strings and tuples like so:
|
|
1206
|
+
```
|
|
1207
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
|
1208
|
+
```
|
|
1209
|
+
This is equivalent to:
|
|
1210
|
+
```
|
|
1211
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
|
1212
|
+
```
|
|
1213
|
+
|
|
1214
|
+
|
|
1215
|
+
Parameters
|
|
1216
|
+
----------
|
|
1217
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
|
1218
|
+
Event dependency for this flow.
|
|
1219
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
|
1220
|
+
Events dependency for this flow.
|
|
1221
|
+
options : Dict[str, Any], default {}
|
|
1222
|
+
Backend-specific configuration for tuning eventing behavior.
|
|
1223
|
+
"""
|
|
1224
|
+
...
|
|
1225
|
+
|
|
1226
|
+
@typing.overload
|
|
1227
|
+
def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1228
|
+
...
|
|
1229
|
+
|
|
1230
|
+
def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
|
|
1231
|
+
"""
|
|
1232
|
+
Specifies the event(s) that this flow depends on.
|
|
1233
|
+
|
|
1234
|
+
```
|
|
1235
|
+
@trigger(event='foo')
|
|
1236
|
+
```
|
|
1237
|
+
or
|
|
1238
|
+
```
|
|
1239
|
+
@trigger(events=['foo', 'bar'])
|
|
1240
|
+
```
|
|
1241
|
+
|
|
1242
|
+
Additionally, you can specify the parameter mappings
|
|
1243
|
+
to map event payload to Metaflow parameters for the flow.
|
|
1244
|
+
```
|
|
1245
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
|
1246
|
+
```
|
|
1247
|
+
or
|
|
1248
|
+
```
|
|
1249
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
|
1250
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
|
1251
|
+
```
|
|
1252
|
+
|
|
1253
|
+
'parameters' can also be a list of strings and tuples like so:
|
|
1254
|
+
```
|
|
1255
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
|
1256
|
+
```
|
|
1257
|
+
This is equivalent to:
|
|
1258
|
+
```
|
|
1259
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
|
1260
|
+
```
|
|
1261
|
+
|
|
1262
|
+
|
|
1263
|
+
Parameters
|
|
1264
|
+
----------
|
|
1265
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
|
1266
|
+
Event dependency for this flow.
|
|
1267
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
|
1268
|
+
Events dependency for this flow.
|
|
1269
|
+
options : Dict[str, Any], default {}
|
|
1270
|
+
Backend-specific configuration for tuning eventing behavior.
|
|
1271
|
+
"""
|
|
1272
|
+
...
|
|
1273
|
+
|
|
1274
|
+
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]]:
|
|
1275
|
+
"""
|
|
1276
|
+
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)
|
|
1277
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
|
1278
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
|
1279
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
|
1280
|
+
starts only after all sensors finish.
|
|
1281
|
+
|
|
1282
|
+
|
|
1283
|
+
Parameters
|
|
1284
|
+
----------
|
|
1285
|
+
timeout : int
|
|
1286
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
|
1287
|
+
poke_interval : int
|
|
1288
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
|
1289
|
+
mode : str
|
|
1290
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
|
1291
|
+
exponential_backoff : bool
|
|
1292
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
|
1293
|
+
pool : str
|
|
1294
|
+
the slot pool this task should run in,
|
|
1295
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
|
1296
|
+
soft_fail : bool
|
|
1297
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
|
1298
|
+
name : str
|
|
1299
|
+
Name of the sensor on Airflow
|
|
1300
|
+
description : str
|
|
1301
|
+
Description of sensor in the Airflow UI
|
|
1302
|
+
bucket_key : Union[str, List[str]]
|
|
1303
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
|
1304
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
|
1305
|
+
bucket_name : str
|
|
1306
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
|
1307
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
|
1308
|
+
wildcard_match : bool
|
|
1309
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
|
1310
|
+
aws_conn_id : str
|
|
1311
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
|
1312
|
+
verify : bool
|
|
1313
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
|
1314
|
+
"""
|
|
1315
|
+
...
|
|
1316
|
+
|
|
1317
|
+
def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
1318
|
+
"""
|
|
1319
|
+
Specifies what flows belong to the same project.
|
|
1320
|
+
|
|
1321
|
+
A project-specific namespace is created for all flows that
|
|
1322
|
+
use the same `@project(name)`.
|
|
1323
|
+
|
|
1324
|
+
|
|
1325
|
+
Parameters
|
|
1326
|
+
----------
|
|
1327
|
+
name : str
|
|
1328
|
+
Project name. Make sure that the name is unique amongst all
|
|
1329
|
+
projects that use the same production scheduler. The name may
|
|
1330
|
+
contain only lowercase alphanumeric characters and underscores.
|
|
1331
|
+
|
|
1332
|
+
branch : Optional[str], default None
|
|
1333
|
+
The branch to use. If not specified, the branch is set to
|
|
1334
|
+
`user.<username>` unless `production` is set to `True`. This can
|
|
1335
|
+
also be set on the command line using `--branch` as a top-level option.
|
|
1336
|
+
It is an error to specify `branch` in the decorator and on the command line.
|
|
1337
|
+
|
|
1338
|
+
production : bool, default False
|
|
1339
|
+
Whether or not the branch is the production branch. This can also be set on the
|
|
1340
|
+
command line using `--production` as a top-level option. It is an error to specify
|
|
1341
|
+
`production` in the decorator and on the command line.
|
|
1342
|
+
The project branch name will be:
|
|
1343
|
+
- if `branch` is specified:
|
|
1344
|
+
- if `production` is True: `prod.<branch>`
|
|
1345
|
+
- if `production` is False: `test.<branch>`
|
|
1346
|
+
- if `branch` is not specified:
|
|
1347
|
+
- if `production` is True: `prod`
|
|
1348
|
+
- if `production` is False: `user.<username>`
|
|
1349
1349
|
"""
|
|
1350
1350
|
...
|
|
1351
1351
|
|