ob-metaflow-stubs 2.11.4.8__py2.py3-none-any.whl → 2.11.8.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.
- metaflow-stubs/__init__.pyi +456 -432
- metaflow-stubs/cards.pyi +5 -5
- metaflow-stubs/cli.pyi +3 -3
- metaflow-stubs/client/__init__.pyi +4 -4
- metaflow-stubs/client/core.pyi +7 -7
- metaflow-stubs/client/filecache.pyi +3 -3
- metaflow-stubs/clone_util.pyi +31 -0
- 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/metadata/metadata.pyi +2 -2
- metaflow-stubs/metadata/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +6 -2
- metaflow-stubs/metaflow_current.pyi +18 -18
- metaflow-stubs/mflog/mflog.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/parameters.pyi +4 -4
- metaflow-stubs/plugins/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow.pyi +5 -3
- metaflow-stubs/plugins/airflow/airflow_cli.pyi +3 -3
- 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 +3 -3
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +4 -4
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +4 -4
- 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 +6 -4
- metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +4 -4
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +5 -5
- metaflow-stubs/plugins/aws/__init__.pyi +2 -2
- 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 +4 -4
- metaflow-stubs/plugins/aws/batch/batch_cli.pyi +4 -4
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +3 -3
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +4 -4
- 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/production_token.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +4 -4
- metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +4 -4
- 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/azure/__init__.pyi +5 -2
- metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
- 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_cli.pyi +5 -5
- 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 +3 -3
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.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 +3 -3
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +4 -4
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +3 -3
- metaflow-stubs/plugins/datatools/__init__.pyi +4 -4
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +4 -4
- metaflow-stubs/plugins/datatools/s3/s3.pyi +5 -5
- 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 +3 -3
- metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
- metaflow-stubs/plugins/frameworks/pytorch.pyi +4 -4
- metaflow-stubs/plugins/gcp/__init__.pyi +5 -2
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +73 -0
- 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/kubernetes.pyi +7 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +4 -4
- metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
- metaflow-stubs/plugins/package_cli.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
- metaflow-stubs/plugins/project_decorator.pyi +3 -3
- metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +3 -3
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +3 -3
- 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 +3 -3
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
- metaflow-stubs/plugins/storage_executor.pyi +2 -2
- metaflow-stubs/plugins/tag_cli.pyi +5 -5
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
- metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
- metaflow-stubs/procpoll.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- {ob_metaflow_stubs-2.11.4.8.dist-info → ob_metaflow_stubs-2.11.8.1.dist-info}/METADATA +2 -2
- ob_metaflow_stubs-2.11.8.1.dist-info/RECORD +133 -0
- {ob_metaflow_stubs-2.11.4.8.dist-info → ob_metaflow_stubs-2.11.8.1.dist-info}/WHEEL +1 -1
- ob_metaflow_stubs-2.11.4.8.dist-info/RECORD +0 -131
- {ob_metaflow_stubs-2.11.4.8.dist-info → ob_metaflow_stubs-2.11.8.1.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.11.
|
4
|
-
# Generated on 2024-03-
|
3
|
+
# MF version: 2.11.8.1 #
|
4
|
+
# Generated on 2024-03-29T12:39:58.338796 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
|
-
import metaflow.
|
12
|
-
import
|
11
|
+
import metaflow.metaflow_current
|
12
|
+
import typing
|
13
13
|
import io
|
14
14
|
import metaflow.events
|
15
|
-
import metaflow.datastore.inputs
|
16
15
|
import metaflow.plugins.datatools.s3.s3
|
16
|
+
import metaflow.datastore.inputs
|
17
17
|
import metaflow.client.core
|
18
|
-
import metaflow.metaflow_current
|
19
18
|
import metaflow._vendor.click.types
|
20
|
-
import
|
19
|
+
import datetime
|
20
|
+
import metaflow.parameters
|
21
21
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
22
22
|
StepFlag = typing.NewType("StepFlag", bool)
|
23
23
|
|
@@ -726,79 +726,92 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
726
726
|
...
|
727
727
|
|
728
728
|
@typing.overload
|
729
|
-
def
|
729
|
+
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]]]:
|
730
730
|
"""
|
731
|
-
Specifies
|
732
|
-
|
733
|
-
Use `@resources` to specify the resource requirements
|
734
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
735
|
-
|
736
|
-
You can choose the compute layer on the command line by executing e.g.
|
737
|
-
```
|
738
|
-
python myflow.py run --with batch
|
739
|
-
```
|
740
|
-
or
|
741
|
-
```
|
742
|
-
python myflow.py run --with kubernetes
|
743
|
-
```
|
744
|
-
which executes the flow on the desired system using the
|
745
|
-
requirements specified in `@resources`.
|
731
|
+
Specifies environment variables to be set prior to the execution of a step.
|
746
732
|
|
747
733
|
Parameters
|
748
734
|
----------
|
749
|
-
|
750
|
-
|
751
|
-
gpu : int, default 0
|
752
|
-
Number of GPUs required for this step.
|
753
|
-
disk : int, optional, default None
|
754
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
755
|
-
memory : int, default 4096
|
756
|
-
Memory size (in MB) required for this step.
|
757
|
-
shared_memory : int, optional, default None
|
758
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
759
|
-
This parameter maps to the `--shm-size` option in Docker.
|
735
|
+
vars : Dict[str, str], default {}
|
736
|
+
Dictionary of environment variables to set.
|
760
737
|
"""
|
761
738
|
...
|
762
739
|
|
763
740
|
@typing.overload
|
764
|
-
def
|
741
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
765
742
|
...
|
766
743
|
|
767
744
|
@typing.overload
|
768
|
-
def
|
745
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
769
746
|
...
|
770
747
|
|
771
|
-
def
|
748
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
772
749
|
"""
|
773
|
-
Specifies
|
774
|
-
|
775
|
-
Use `@resources` to specify the resource requirements
|
776
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
750
|
+
Specifies environment variables to be set prior to the execution of a step.
|
777
751
|
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
752
|
+
Parameters
|
753
|
+
----------
|
754
|
+
vars : Dict[str, str], default {}
|
755
|
+
Dictionary of environment variables to set.
|
756
|
+
"""
|
757
|
+
...
|
758
|
+
|
759
|
+
def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = "KUBERNETES_IMAGE_PULL_POLICY", service_account: str = "METAFLOW_KUBERNETES_SERVICE_ACCOUNT", secrets: typing.Optional[typing.List[str]] = None, namespace: str = "METAFLOW_KUBERNETES_NAMESPACE", gpu: typing.Optional[int] = None, gpu_vendor: str = "KUBERNETES_GPU_VENDOR", tolerations: typing.List[str] = [], 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, port: typing.Optional[int] = None, 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]]]:
|
760
|
+
"""
|
761
|
+
Specifies that this step should execute on Kubernetes.
|
788
762
|
|
789
763
|
Parameters
|
790
764
|
----------
|
791
765
|
cpu : int, default 1
|
792
|
-
Number of CPUs required for this step.
|
793
|
-
|
794
|
-
Number of GPUs required for this step.
|
795
|
-
disk : int, optional, default None
|
796
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
766
|
+
Number of CPUs required for this step. If `@resources` is
|
767
|
+
also present, the maximum value from all decorators is used.
|
797
768
|
memory : int, default 4096
|
798
|
-
Memory size (in MB) required for this step.
|
799
|
-
|
800
|
-
|
801
|
-
|
769
|
+
Memory size (in MB) required for this step. If
|
770
|
+
`@resources` is also present, the maximum value from all decorators is
|
771
|
+
used.
|
772
|
+
disk : int, default 10240
|
773
|
+
Disk size (in MB) required for this step. If
|
774
|
+
`@resources` is also present, the maximum value from all decorators is
|
775
|
+
used.
|
776
|
+
image : str, optional, default None
|
777
|
+
Docker image to use when launching on Kubernetes. If not specified, and
|
778
|
+
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
779
|
+
not, a default Docker image mapping to the current version of Python is used.
|
780
|
+
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
781
|
+
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
782
|
+
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
783
|
+
Kubernetes service account to use when launching pod in Kubernetes.
|
784
|
+
secrets : List[str], optional, default None
|
785
|
+
Kubernetes secrets to use when launching pod in Kubernetes. These
|
786
|
+
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
787
|
+
in Metaflow configuration.
|
788
|
+
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
789
|
+
Kubernetes namespace to use when launching pod in Kubernetes.
|
790
|
+
gpu : int, optional, default None
|
791
|
+
Number of GPUs required for this step. A value of zero implies that
|
792
|
+
the scheduled node should not have GPUs.
|
793
|
+
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
794
|
+
The vendor of the GPUs to be used for this step.
|
795
|
+
tolerations : List[str], default []
|
796
|
+
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
797
|
+
Kubernetes tolerations to use when launching pod in Kubernetes.
|
798
|
+
use_tmpfs : bool, default False
|
799
|
+
This enables an explicit tmpfs mount for this step.
|
800
|
+
tmpfs_tempdir : bool, default True
|
801
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
802
|
+
tmpfs_size : int, optional, default: None
|
803
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
804
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
805
|
+
memory allocated for this step.
|
806
|
+
tmpfs_path : str, optional, default /metaflow_temp
|
807
|
+
Path to tmpfs mount for this step.
|
808
|
+
persistent_volume_claims : Dict[str, str], optional, default None
|
809
|
+
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
810
|
+
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
811
|
+
port: int, optional
|
812
|
+
Number of the port to specify in the Kubernetes job object
|
813
|
+
shared_memory: int, optional
|
814
|
+
Shared memory size (in MiB) required for this steps
|
802
815
|
"""
|
803
816
|
...
|
804
817
|
|
@@ -859,55 +872,6 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
859
872
|
"""
|
860
873
|
...
|
861
874
|
|
862
|
-
@typing.overload
|
863
|
-
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]]]:
|
864
|
-
"""
|
865
|
-
Specifies the PyPI packages for the step.
|
866
|
-
|
867
|
-
Information in this decorator will augment any
|
868
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
869
|
-
you can use `@pypi_base` to set packages required by all
|
870
|
-
steps and use `@pypi` to specify step-specific overrides.
|
871
|
-
|
872
|
-
Parameters
|
873
|
-
----------
|
874
|
-
packages : Dict[str, str], default: {}
|
875
|
-
Packages to use for this step. The key is the name of the package
|
876
|
-
and the value is the version to use.
|
877
|
-
python : str, optional, default: None
|
878
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
879
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
880
|
-
"""
|
881
|
-
...
|
882
|
-
|
883
|
-
@typing.overload
|
884
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
885
|
-
...
|
886
|
-
|
887
|
-
@typing.overload
|
888
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
889
|
-
...
|
890
|
-
|
891
|
-
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):
|
892
|
-
"""
|
893
|
-
Specifies the PyPI packages for the step.
|
894
|
-
|
895
|
-
Information in this decorator will augment any
|
896
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
897
|
-
you can use `@pypi_base` to set packages required by all
|
898
|
-
steps and use `@pypi` to specify step-specific overrides.
|
899
|
-
|
900
|
-
Parameters
|
901
|
-
----------
|
902
|
-
packages : Dict[str, str], default: {}
|
903
|
-
Packages to use for this step. The key is the name of the package
|
904
|
-
and the value is the version to use.
|
905
|
-
python : str, optional, default: None
|
906
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
907
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
908
|
-
"""
|
909
|
-
...
|
910
|
-
|
911
875
|
@typing.overload
|
912
876
|
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]]]:
|
913
877
|
"""
|
@@ -966,38 +930,84 @@ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
966
930
|
...
|
967
931
|
|
968
932
|
@typing.overload
|
969
|
-
def
|
933
|
+
def resources(*, cpu: int = 1, gpu: int = 0, 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]]]:
|
970
934
|
"""
|
971
|
-
Specifies
|
935
|
+
Specifies the resources needed when executing this step.
|
936
|
+
|
937
|
+
Use `@resources` to specify the resource requirements
|
938
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
939
|
+
|
940
|
+
You can choose the compute layer on the command line by executing e.g.
|
941
|
+
```
|
942
|
+
python myflow.py run --with batch
|
943
|
+
```
|
944
|
+
or
|
945
|
+
```
|
946
|
+
python myflow.py run --with kubernetes
|
947
|
+
```
|
948
|
+
which executes the flow on the desired system using the
|
949
|
+
requirements specified in `@resources`.
|
972
950
|
|
973
951
|
Parameters
|
974
952
|
----------
|
975
|
-
|
976
|
-
|
953
|
+
cpu : int, default 1
|
954
|
+
Number of CPUs required for this step.
|
955
|
+
gpu : int, default 0
|
956
|
+
Number of GPUs required for this step.
|
957
|
+
disk : int, optional, default None
|
958
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
959
|
+
memory : int, default 4096
|
960
|
+
Memory size (in MB) required for this step.
|
961
|
+
shared_memory : int, optional, default None
|
962
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
963
|
+
This parameter maps to the `--shm-size` option in Docker.
|
977
964
|
"""
|
978
965
|
...
|
979
966
|
|
980
967
|
@typing.overload
|
981
|
-
def
|
968
|
+
def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
982
969
|
...
|
983
970
|
|
984
971
|
@typing.overload
|
985
|
-
def
|
972
|
+
def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
986
973
|
...
|
987
974
|
|
988
|
-
def
|
975
|
+
def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
|
989
976
|
"""
|
990
|
-
Specifies
|
977
|
+
Specifies the resources needed when executing this step.
|
978
|
+
|
979
|
+
Use `@resources` to specify the resource requirements
|
980
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
981
|
+
|
982
|
+
You can choose the compute layer on the command line by executing e.g.
|
983
|
+
```
|
984
|
+
python myflow.py run --with batch
|
985
|
+
```
|
986
|
+
or
|
987
|
+
```
|
988
|
+
python myflow.py run --with kubernetes
|
989
|
+
```
|
990
|
+
which executes the flow on the desired system using the
|
991
|
+
requirements specified in `@resources`.
|
991
992
|
|
992
993
|
Parameters
|
993
994
|
----------
|
994
|
-
|
995
|
-
|
995
|
+
cpu : int, default 1
|
996
|
+
Number of CPUs required for this step.
|
997
|
+
gpu : int, default 0
|
998
|
+
Number of GPUs required for this step.
|
999
|
+
disk : int, optional, default None
|
1000
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
1001
|
+
memory : int, default 4096
|
1002
|
+
Memory size (in MB) required for this step.
|
1003
|
+
shared_memory : int, optional, default None
|
1004
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
1005
|
+
This parameter maps to the `--shm-size` option in Docker.
|
996
1006
|
"""
|
997
1007
|
...
|
998
1008
|
|
999
1009
|
@typing.overload
|
1000
|
-
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, efa: int = 0) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
1010
|
+
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]]]:
|
1001
1011
|
"""
|
1002
1012
|
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
1003
1013
|
|
@@ -1038,7 +1048,8 @@ def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optio
|
|
1038
1048
|
necessary. A swappiness value of 100 causes pages to be swapped very
|
1039
1049
|
aggressively. Accepted values are whole numbers between 0 and 100.
|
1040
1050
|
use_tmpfs : bool, default False
|
1041
|
-
This enables an explicit tmpfs mount for this step.
|
1051
|
+
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
1052
|
+
not available on Fargate compute environments
|
1042
1053
|
tmpfs_tempdir : bool, default True
|
1043
1054
|
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
1044
1055
|
tmpfs_size : int, optional, default None
|
@@ -1049,8 +1060,19 @@ def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optio
|
|
1049
1060
|
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
1050
1061
|
inferentia : int, default 0
|
1051
1062
|
Number of Inferentia chips required for this step.
|
1063
|
+
trainium : int, default None
|
1064
|
+
Alias for inferentia. Use only one of the two.
|
1052
1065
|
efa : int, default 0
|
1053
1066
|
Number of elastic fabric adapter network devices to attach to container
|
1067
|
+
ephemeral_storage: int, default None
|
1068
|
+
The total amount, in GiB, of ephemeral storage to set for the task (21-200)
|
1069
|
+
This is only relevant for Fargate compute environments
|
1070
|
+
log_driver: str, optional, default None
|
1071
|
+
The log driver to use for the Amazon ECS container.
|
1072
|
+
log_options: List[str], optional, default None
|
1073
|
+
List of strings containing options for the chosen log driver. The configurable values
|
1074
|
+
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
1075
|
+
Example usage: ["awslogs-group:aws/batch/job"]
|
1054
1076
|
"""
|
1055
1077
|
...
|
1056
1078
|
|
@@ -1062,7 +1084,7 @@ def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Calla
|
|
1062
1084
|
def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1063
1085
|
...
|
1064
1086
|
|
1065
|
-
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, efa: int = 0):
|
1087
|
+
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):
|
1066
1088
|
"""
|
1067
1089
|
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
1068
1090
|
|
@@ -1103,7 +1125,8 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
1103
1125
|
necessary. A swappiness value of 100 causes pages to be swapped very
|
1104
1126
|
aggressively. Accepted values are whole numbers between 0 and 100.
|
1105
1127
|
use_tmpfs : bool, default False
|
1106
|
-
This enables an explicit tmpfs mount for this step.
|
1128
|
+
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
1129
|
+
not available on Fargate compute environments
|
1107
1130
|
tmpfs_tempdir : bool, default True
|
1108
1131
|
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
1109
1132
|
tmpfs_size : int, optional, default None
|
@@ -1114,108 +1137,27 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
1114
1137
|
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
1115
1138
|
inferentia : int, default 0
|
1116
1139
|
Number of Inferentia chips required for this step.
|
1140
|
+
trainium : int, default None
|
1141
|
+
Alias for inferentia. Use only one of the two.
|
1117
1142
|
efa : int, default 0
|
1118
1143
|
Number of elastic fabric adapter network devices to attach to container
|
1144
|
+
ephemeral_storage: int, default None
|
1145
|
+
The total amount, in GiB, of ephemeral storage to set for the task (21-200)
|
1146
|
+
This is only relevant for Fargate compute environments
|
1147
|
+
log_driver: str, optional, default None
|
1148
|
+
The log driver to use for the Amazon ECS container.
|
1149
|
+
log_options: List[str], optional, default None
|
1150
|
+
List of strings containing options for the chosen log driver. The configurable values
|
1151
|
+
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
1152
|
+
Example usage: ["awslogs-group:aws/batch/job"]
|
1119
1153
|
"""
|
1120
1154
|
...
|
1121
1155
|
|
1122
|
-
|
1156
|
+
@typing.overload
|
1157
|
+
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]]]:
|
1123
1158
|
"""
|
1124
|
-
Specifies
|
1125
|
-
|
1126
|
-
Parameters
|
1127
|
-
----------
|
1128
|
-
cpu : int, default 1
|
1129
|
-
Number of CPUs required for this step. If `@resources` is
|
1130
|
-
also present, the maximum value from all decorators is used.
|
1131
|
-
memory : int, default 4096
|
1132
|
-
Memory size (in MB) required for this step. If
|
1133
|
-
`@resources` is also present, the maximum value from all decorators is
|
1134
|
-
used.
|
1135
|
-
disk : int, default 10240
|
1136
|
-
Disk size (in MB) required for this step. If
|
1137
|
-
`@resources` is also present, the maximum value from all decorators is
|
1138
|
-
used.
|
1139
|
-
image : str, optional, default None
|
1140
|
-
Docker image to use when launching on Kubernetes. If not specified, and
|
1141
|
-
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
1142
|
-
not, a default Docker image mapping to the current version of Python is used.
|
1143
|
-
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
1144
|
-
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
1145
|
-
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
1146
|
-
Kubernetes service account to use when launching pod in Kubernetes.
|
1147
|
-
secrets : List[str], optional, default None
|
1148
|
-
Kubernetes secrets to use when launching pod in Kubernetes. These
|
1149
|
-
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
1150
|
-
in Metaflow configuration.
|
1151
|
-
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
1152
|
-
Kubernetes namespace to use when launching pod in Kubernetes.
|
1153
|
-
gpu : int, optional, default None
|
1154
|
-
Number of GPUs required for this step. A value of zero implies that
|
1155
|
-
the scheduled node should not have GPUs.
|
1156
|
-
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
1157
|
-
The vendor of the GPUs to be used for this step.
|
1158
|
-
tolerations : List[str], default []
|
1159
|
-
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
1160
|
-
Kubernetes tolerations to use when launching pod in Kubernetes.
|
1161
|
-
use_tmpfs : bool, default False
|
1162
|
-
This enables an explicit tmpfs mount for this step.
|
1163
|
-
tmpfs_tempdir : bool, default True
|
1164
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
1165
|
-
tmpfs_size : int, optional, default: None
|
1166
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
1167
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
1168
|
-
memory allocated for this step.
|
1169
|
-
tmpfs_path : str, optional, default /metaflow_temp
|
1170
|
-
Path to tmpfs mount for this step.
|
1171
|
-
persistent_volume_claims : Dict[str, str], optional, default None
|
1172
|
-
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
1173
|
-
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
1174
|
-
port: int, optional
|
1175
|
-
Number of the port to specify in the Kubernetes job object
|
1176
|
-
shared_memory: int, optional
|
1177
|
-
Shared memory size (in MiB) required for this steps
|
1178
|
-
"""
|
1179
|
-
...
|
1180
|
-
|
1181
|
-
@typing.overload
|
1182
|
-
def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
1183
|
-
"""
|
1184
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
1185
|
-
the execution of a step.
|
1186
|
-
|
1187
|
-
Parameters
|
1188
|
-
----------
|
1189
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
1190
|
-
List of secret specs, defining how the secrets are to be retrieved
|
1191
|
-
"""
|
1192
|
-
...
|
1193
|
-
|
1194
|
-
@typing.overload
|
1195
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1196
|
-
...
|
1197
|
-
|
1198
|
-
@typing.overload
|
1199
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1200
|
-
...
|
1201
|
-
|
1202
|
-
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]]] = []):
|
1203
|
-
"""
|
1204
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
1205
|
-
the execution of a step.
|
1206
|
-
|
1207
|
-
Parameters
|
1208
|
-
----------
|
1209
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
1210
|
-
List of secret specs, defining how the secrets are to be retrieved
|
1211
|
-
"""
|
1212
|
-
...
|
1213
|
-
|
1214
|
-
@typing.overload
|
1215
|
-
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]]]:
|
1216
|
-
"""
|
1217
|
-
Specifies the number of times the task corresponding
|
1218
|
-
to a step needs to be retried.
|
1159
|
+
Specifies the number of times the task corresponding
|
1160
|
+
to a step needs to be retried.
|
1219
1161
|
|
1220
1162
|
This decorator is useful for handling transient errors, such as networking issues.
|
1221
1163
|
If your task contains operations that can't be retried safely, e.g. database updates,
|
@@ -1265,51 +1207,51 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
1265
1207
|
...
|
1266
1208
|
|
1267
1209
|
@typing.overload
|
1268
|
-
def
|
1210
|
+
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]]]:
|
1269
1211
|
"""
|
1270
|
-
Specifies
|
1212
|
+
Specifies the PyPI packages for the step.
|
1271
1213
|
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1214
|
+
Information in this decorator will augment any
|
1215
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1216
|
+
you can use `@pypi_base` to set packages required by all
|
1217
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1276
1218
|
|
1277
1219
|
Parameters
|
1278
1220
|
----------
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1221
|
+
packages : Dict[str, str], default: {}
|
1222
|
+
Packages to use for this step. The key is the name of the package
|
1223
|
+
and the value is the version to use.
|
1224
|
+
python : str, optional, default: None
|
1225
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1226
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1285
1227
|
"""
|
1286
1228
|
...
|
1287
1229
|
|
1288
1230
|
@typing.overload
|
1289
|
-
def
|
1231
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1290
1232
|
...
|
1291
1233
|
|
1292
1234
|
@typing.overload
|
1293
|
-
def
|
1235
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1294
1236
|
...
|
1295
1237
|
|
1296
|
-
def
|
1238
|
+
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):
|
1297
1239
|
"""
|
1298
|
-
Specifies
|
1240
|
+
Specifies the PyPI packages for the step.
|
1299
1241
|
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1242
|
+
Information in this decorator will augment any
|
1243
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1244
|
+
you can use `@pypi_base` to set packages required by all
|
1245
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1304
1246
|
|
1305
1247
|
Parameters
|
1306
1248
|
----------
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1249
|
+
packages : Dict[str, str], default: {}
|
1250
|
+
Packages to use for this step. The key is the name of the package
|
1251
|
+
and the value is the version to use.
|
1252
|
+
python : str, optional, default: None
|
1253
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1254
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1313
1255
|
"""
|
1314
1256
|
...
|
1315
1257
|
|
@@ -1364,45 +1306,180 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
|
|
1364
1306
|
"""
|
1365
1307
|
...
|
1366
1308
|
|
1367
|
-
|
1309
|
+
@typing.overload
|
1310
|
+
def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
1368
1311
|
"""
|
1369
|
-
|
1370
|
-
|
1371
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1372
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1373
|
-
starts only after all sensors finish.
|
1312
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
1313
|
+
the execution of a step.
|
1374
1314
|
|
1375
1315
|
Parameters
|
1376
1316
|
----------
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
|
1317
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
1318
|
+
List of secret specs, defining how the secrets are to be retrieved
|
1319
|
+
"""
|
1320
|
+
...
|
1321
|
+
|
1322
|
+
@typing.overload
|
1323
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1324
|
+
...
|
1325
|
+
|
1326
|
+
@typing.overload
|
1327
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1328
|
+
...
|
1329
|
+
|
1330
|
+
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]]] = []):
|
1331
|
+
"""
|
1332
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
1333
|
+
the execution of a step.
|
1334
|
+
|
1335
|
+
Parameters
|
1336
|
+
----------
|
1337
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
1338
|
+
List of secret specs, defining how the secrets are to be retrieved
|
1339
|
+
"""
|
1340
|
+
...
|
1341
|
+
|
1342
|
+
@typing.overload
|
1343
|
+
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]]]:
|
1344
|
+
"""
|
1345
|
+
Specifies that the step will success under all circumstances.
|
1346
|
+
|
1347
|
+
The decorator will create an optional artifact, specified by `var`, which
|
1348
|
+
contains the exception raised. You can use it to detect the presence
|
1349
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
1350
|
+
are missing.
|
1351
|
+
|
1352
|
+
Parameters
|
1353
|
+
----------
|
1354
|
+
var : str, optional, default None
|
1355
|
+
Name of the artifact in which to store the caught exception.
|
1356
|
+
If not specified, the exception is not stored.
|
1357
|
+
print_exception : bool, default True
|
1358
|
+
Determines whether or not the exception is printed to
|
1359
|
+
stdout when caught.
|
1360
|
+
"""
|
1361
|
+
...
|
1362
|
+
|
1363
|
+
@typing.overload
|
1364
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1365
|
+
...
|
1366
|
+
|
1367
|
+
@typing.overload
|
1368
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1369
|
+
...
|
1370
|
+
|
1371
|
+
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):
|
1372
|
+
"""
|
1373
|
+
Specifies that the step will success under all circumstances.
|
1374
|
+
|
1375
|
+
The decorator will create an optional artifact, specified by `var`, which
|
1376
|
+
contains the exception raised. You can use it to detect the presence
|
1377
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
1378
|
+
are missing.
|
1379
|
+
|
1380
|
+
Parameters
|
1381
|
+
----------
|
1382
|
+
var : str, optional, default None
|
1383
|
+
Name of the artifact in which to store the caught exception.
|
1384
|
+
If not specified, the exception is not stored.
|
1385
|
+
print_exception : bool, default True
|
1386
|
+
Determines whether or not the exception is printed to
|
1387
|
+
stdout when caught.
|
1388
|
+
"""
|
1389
|
+
...
|
1390
|
+
|
1391
|
+
@typing.overload
|
1392
|
+
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]]:
|
1393
|
+
"""
|
1394
|
+
Specifies the event(s) that this flow depends on.
|
1395
|
+
|
1396
|
+
```
|
1397
|
+
@trigger(event='foo')
|
1398
|
+
```
|
1399
|
+
or
|
1400
|
+
```
|
1401
|
+
@trigger(events=['foo', 'bar'])
|
1402
|
+
```
|
1403
|
+
|
1404
|
+
Additionally, you can specify the parameter mappings
|
1405
|
+
to map event payload to Metaflow parameters for the flow.
|
1406
|
+
```
|
1407
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1408
|
+
```
|
1409
|
+
or
|
1410
|
+
```
|
1411
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1412
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1413
|
+
```
|
1414
|
+
|
1415
|
+
'parameters' can also be a list of strings and tuples like so:
|
1416
|
+
```
|
1417
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1418
|
+
```
|
1419
|
+
This is equivalent to:
|
1420
|
+
```
|
1421
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1422
|
+
```
|
1423
|
+
|
1424
|
+
Parameters
|
1425
|
+
----------
|
1426
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
1427
|
+
Event dependency for this flow.
|
1428
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
1429
|
+
Events dependency for this flow.
|
1430
|
+
options : Dict[str, Any], default {}
|
1431
|
+
Backend-specific configuration for tuning eventing behavior.
|
1432
|
+
|
1433
|
+
|
1434
|
+
"""
|
1435
|
+
...
|
1436
|
+
|
1437
|
+
@typing.overload
|
1438
|
+
def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1439
|
+
...
|
1440
|
+
|
1441
|
+
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] = {}):
|
1442
|
+
"""
|
1443
|
+
Specifies the event(s) that this flow depends on.
|
1444
|
+
|
1445
|
+
```
|
1446
|
+
@trigger(event='foo')
|
1447
|
+
```
|
1448
|
+
or
|
1449
|
+
```
|
1450
|
+
@trigger(events=['foo', 'bar'])
|
1451
|
+
```
|
1452
|
+
|
1453
|
+
Additionally, you can specify the parameter mappings
|
1454
|
+
to map event payload to Metaflow parameters for the flow.
|
1455
|
+
```
|
1456
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1457
|
+
```
|
1458
|
+
or
|
1459
|
+
```
|
1460
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1461
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1462
|
+
```
|
1463
|
+
|
1464
|
+
'parameters' can also be a list of strings and tuples like so:
|
1465
|
+
```
|
1466
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1467
|
+
```
|
1468
|
+
This is equivalent to:
|
1469
|
+
```
|
1470
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1471
|
+
```
|
1472
|
+
|
1473
|
+
Parameters
|
1474
|
+
----------
|
1475
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
1476
|
+
Event dependency for this flow.
|
1477
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
1478
|
+
Events dependency for this flow.
|
1479
|
+
options : Dict[str, Any], default {}
|
1480
|
+
Backend-specific configuration for tuning eventing behavior.
|
1481
|
+
|
1482
|
+
|
1406
1483
|
"""
|
1407
1484
|
...
|
1408
1485
|
|
@@ -1424,45 +1501,6 @@ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typ
|
|
1424
1501
|
"""
|
1425
1502
|
...
|
1426
1503
|
|
1427
|
-
@typing.overload
|
1428
|
-
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1429
|
-
"""
|
1430
|
-
Specifies the PyPI packages for all steps of the flow.
|
1431
|
-
|
1432
|
-
Use `@pypi_base` to set common packages required by all
|
1433
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1434
|
-
Parameters
|
1435
|
-
----------
|
1436
|
-
packages : Dict[str, str], default: {}
|
1437
|
-
Packages to use for this flow. The key is the name of the package
|
1438
|
-
and the value is the version to use.
|
1439
|
-
python : str, optional, default: None
|
1440
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1441
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1442
|
-
"""
|
1443
|
-
...
|
1444
|
-
|
1445
|
-
@typing.overload
|
1446
|
-
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1447
|
-
...
|
1448
|
-
|
1449
|
-
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1450
|
-
"""
|
1451
|
-
Specifies the PyPI packages for all steps of the flow.
|
1452
|
-
|
1453
|
-
Use `@pypi_base` to set common packages required by all
|
1454
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1455
|
-
Parameters
|
1456
|
-
----------
|
1457
|
-
packages : Dict[str, str], default: {}
|
1458
|
-
Packages to use for this flow. The key is the name of the package
|
1459
|
-
and the value is the version to use.
|
1460
|
-
python : str, optional, default: None
|
1461
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1462
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1463
|
-
"""
|
1464
|
-
...
|
1465
|
-
|
1466
1504
|
@typing.overload
|
1467
1505
|
def trigger_on_finish(*, flow: typing.Union[str, typing.Dict[str, str], None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1468
1506
|
"""
|
@@ -1566,101 +1604,6 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
1566
1604
|
"""
|
1567
1605
|
...
|
1568
1606
|
|
1569
|
-
@typing.overload
|
1570
|
-
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]]:
|
1571
|
-
"""
|
1572
|
-
Specifies the event(s) that this flow depends on.
|
1573
|
-
|
1574
|
-
```
|
1575
|
-
@trigger(event='foo')
|
1576
|
-
```
|
1577
|
-
or
|
1578
|
-
```
|
1579
|
-
@trigger(events=['foo', 'bar'])
|
1580
|
-
```
|
1581
|
-
|
1582
|
-
Additionally, you can specify the parameter mappings
|
1583
|
-
to map event payload to Metaflow parameters for the flow.
|
1584
|
-
```
|
1585
|
-
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1586
|
-
```
|
1587
|
-
or
|
1588
|
-
```
|
1589
|
-
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1590
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1591
|
-
```
|
1592
|
-
|
1593
|
-
'parameters' can also be a list of strings and tuples like so:
|
1594
|
-
```
|
1595
|
-
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1596
|
-
```
|
1597
|
-
This is equivalent to:
|
1598
|
-
```
|
1599
|
-
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1600
|
-
```
|
1601
|
-
|
1602
|
-
Parameters
|
1603
|
-
----------
|
1604
|
-
event : Union[str, Dict[str, Any]], optional, default None
|
1605
|
-
Event dependency for this flow.
|
1606
|
-
events : List[Union[str, Dict[str, Any]]], default []
|
1607
|
-
Events dependency for this flow.
|
1608
|
-
options : Dict[str, Any], default {}
|
1609
|
-
Backend-specific configuration for tuning eventing behavior.
|
1610
|
-
|
1611
|
-
|
1612
|
-
"""
|
1613
|
-
...
|
1614
|
-
|
1615
|
-
@typing.overload
|
1616
|
-
def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1617
|
-
...
|
1618
|
-
|
1619
|
-
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] = {}):
|
1620
|
-
"""
|
1621
|
-
Specifies the event(s) that this flow depends on.
|
1622
|
-
|
1623
|
-
```
|
1624
|
-
@trigger(event='foo')
|
1625
|
-
```
|
1626
|
-
or
|
1627
|
-
```
|
1628
|
-
@trigger(events=['foo', 'bar'])
|
1629
|
-
```
|
1630
|
-
|
1631
|
-
Additionally, you can specify the parameter mappings
|
1632
|
-
to map event payload to Metaflow parameters for the flow.
|
1633
|
-
```
|
1634
|
-
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1635
|
-
```
|
1636
|
-
or
|
1637
|
-
```
|
1638
|
-
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1639
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1640
|
-
```
|
1641
|
-
|
1642
|
-
'parameters' can also be a list of strings and tuples like so:
|
1643
|
-
```
|
1644
|
-
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1645
|
-
```
|
1646
|
-
This is equivalent to:
|
1647
|
-
```
|
1648
|
-
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1649
|
-
```
|
1650
|
-
|
1651
|
-
Parameters
|
1652
|
-
----------
|
1653
|
-
event : Union[str, Dict[str, Any]], optional, default None
|
1654
|
-
Event dependency for this flow.
|
1655
|
-
events : List[Union[str, Dict[str, Any]]], default []
|
1656
|
-
Events dependency for this flow.
|
1657
|
-
options : Dict[str, Any], default {}
|
1658
|
-
Backend-specific configuration for tuning eventing behavior.
|
1659
|
-
|
1660
|
-
|
1661
|
-
"""
|
1662
|
-
...
|
1663
|
-
|
1664
1607
|
@typing.overload
|
1665
1608
|
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]]:
|
1666
1609
|
"""
|
@@ -1710,6 +1653,87 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
|
|
1710
1653
|
"""
|
1711
1654
|
...
|
1712
1655
|
|
1656
|
+
@typing.overload
|
1657
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1658
|
+
"""
|
1659
|
+
Specifies the PyPI packages for all steps of the flow.
|
1660
|
+
|
1661
|
+
Use `@pypi_base` to set common packages required by all
|
1662
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1663
|
+
Parameters
|
1664
|
+
----------
|
1665
|
+
packages : Dict[str, str], default: {}
|
1666
|
+
Packages to use for this flow. The key is the name of the package
|
1667
|
+
and the value is the version to use.
|
1668
|
+
python : str, optional, default: None
|
1669
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1670
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1671
|
+
"""
|
1672
|
+
...
|
1673
|
+
|
1674
|
+
@typing.overload
|
1675
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1676
|
+
...
|
1677
|
+
|
1678
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1679
|
+
"""
|
1680
|
+
Specifies the PyPI packages for all steps of the flow.
|
1681
|
+
|
1682
|
+
Use `@pypi_base` to set common packages required by all
|
1683
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1684
|
+
Parameters
|
1685
|
+
----------
|
1686
|
+
packages : Dict[str, str], default: {}
|
1687
|
+
Packages to use for this flow. The key is the name of the package
|
1688
|
+
and the value is the version to use.
|
1689
|
+
python : str, optional, default: None
|
1690
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1691
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1692
|
+
"""
|
1693
|
+
...
|
1694
|
+
|
1695
|
+
def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, external_dag_id: str, external_task_ids: typing.List[str], allowed_states: typing.List[str], failed_states: typing.List[str], execution_delta: "datetime.timedelta", check_existence: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1696
|
+
"""
|
1697
|
+
The `@airflow_external_task_sensor` decorator attaches a Airflow [ExternalTaskSensor](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/sensors/external_task/index.html#airflow.sensors.external_task.ExternalTaskSensor) before the start step of the flow.
|
1698
|
+
This decorator only works when a flow is scheduled on Airflow and is compiled using `airflow create`. More than one `@airflow_external_task_sensor` can be added as a flow decorators. Adding more than one decorator will ensure that `start` step starts only after all sensors finish.
|
1699
|
+
|
1700
|
+
Parameters
|
1701
|
+
----------
|
1702
|
+
timeout : int
|
1703
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1704
|
+
poke_interval : int
|
1705
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1706
|
+
mode : str
|
1707
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1708
|
+
exponential_backoff : bool
|
1709
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1710
|
+
pool : str
|
1711
|
+
the slot pool this task should run in,
|
1712
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1713
|
+
soft_fail : bool
|
1714
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1715
|
+
name : str
|
1716
|
+
Name of the sensor on Airflow
|
1717
|
+
description : str
|
1718
|
+
Description of sensor in the Airflow UI
|
1719
|
+
external_dag_id : str
|
1720
|
+
The dag_id that contains the task you want to wait for.
|
1721
|
+
external_task_ids : List[str]
|
1722
|
+
The list of task_ids that you want to wait for.
|
1723
|
+
If None (default value) the sensor waits for the DAG. (Default: None)
|
1724
|
+
allowed_states : List[str]
|
1725
|
+
Iterable of allowed states, (Default: ['success'])
|
1726
|
+
failed_states : List[str]
|
1727
|
+
Iterable of failed or dis-allowed states. (Default: None)
|
1728
|
+
execution_delta : datetime.timedelta
|
1729
|
+
time difference with the previous execution to look at,
|
1730
|
+
the default is the same logical date as the current task or DAG. (Default: None)
|
1731
|
+
check_existence: bool
|
1732
|
+
Set to True to check if the external task exists or check if
|
1733
|
+
the DAG to wait for exists. (Default: True)
|
1734
|
+
"""
|
1735
|
+
...
|
1736
|
+
|
1713
1737
|
@typing.overload
|
1714
1738
|
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]]:
|
1715
1739
|
"""
|
@@ -1759,10 +1783,13 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
|
|
1759
1783
|
"""
|
1760
1784
|
...
|
1761
1785
|
|
1762
|
-
def
|
1786
|
+
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]]:
|
1763
1787
|
"""
|
1764
|
-
The `@
|
1765
|
-
This decorator only works when a flow is scheduled on Airflow
|
1788
|
+
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)
|
1789
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1790
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1791
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1792
|
+
starts only after all sensors finish.
|
1766
1793
|
|
1767
1794
|
Parameters
|
1768
1795
|
----------
|
@@ -1783,21 +1810,18 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
|
|
1783
1810
|
Name of the sensor on Airflow
|
1784
1811
|
description : str
|
1785
1812
|
Description of sensor in the Airflow UI
|
1786
|
-
|
1787
|
-
The
|
1788
|
-
|
1789
|
-
|
1790
|
-
|
1791
|
-
|
1792
|
-
|
1793
|
-
|
1794
|
-
|
1795
|
-
|
1796
|
-
|
1797
|
-
|
1798
|
-
check_existence: bool
|
1799
|
-
Set to True to check if the external task exists or check if
|
1800
|
-
the DAG to wait for exists. (Default: True)
|
1813
|
+
bucket_key : Union[str, List[str]]
|
1814
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1815
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1816
|
+
bucket_name : str
|
1817
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1818
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1819
|
+
wildcard_match : bool
|
1820
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1821
|
+
aws_conn_id : str
|
1822
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1823
|
+
verify : bool
|
1824
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1801
1825
|
"""
|
1802
1826
|
...
|
1803
1827
|
|