metaflow-stubs 2.11.4__py2.py3-none-any.whl → 2.11.6__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 +481 -457
- metaflow-stubs/cards.pyi +4 -4
- metaflow-stubs/cli.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +4 -4
- metaflow-stubs/client/core.pyi +7 -7
- metaflow-stubs/client/filecache.pyi +2 -2
- metaflow-stubs/clone_util.pyi +31 -0
- metaflow-stubs/events.pyi +2 -2
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +4 -4
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +4 -4
- metaflow-stubs/metadata/metadata.pyi +3 -3
- metaflow-stubs/metadata/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +4 -2
- metaflow-stubs/metaflow_current.pyi +4 -4
- 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 +3 -3
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow.pyi +4 -4
- 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 +2 -2
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +3 -3
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +3 -3
- 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_cli.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +2 -2
- 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 +3 -3
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/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 +3 -3
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
- metaflow-stubs/plugins/azure/__init__.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 +4 -4
- metaflow-stubs/plugins/cards/card_client.pyi +3 -3
- metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
- metaflow-stubs/plugins/cards/card_decorator.pyi +3 -3
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/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 +3 -3
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +3 -3
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +3 -3
- metaflow-stubs/plugins/datatools/__init__.pyi +3 -3
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +3 -3
- 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 +3 -3
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- 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 +2 -2
- 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 +3 -3
- 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 +2 -2
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
- metaflow-stubs/plugins/storage_executor.pyi +2 -2
- metaflow-stubs/plugins/tag_cli.pyi +4 -4
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
- metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
- metaflow-stubs/procpoll.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/version.pyi +2 -2
- {metaflow_stubs-2.11.4.dist-info → metaflow_stubs-2.11.6.dist-info}/METADATA +2 -2
- metaflow_stubs-2.11.6.dist-info/RECORD +132 -0
- {metaflow_stubs-2.11.4.dist-info → metaflow_stubs-2.11.6.dist-info}/WHEEL +1 -1
- metaflow_stubs-2.11.4.dist-info/RECORD +0 -131
- {metaflow_stubs-2.11.4.dist-info → metaflow_stubs-2.11.6.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-
|
3
|
+
# MF version: 2.11.6 #
|
4
|
+
# Generated on 2024-03-23T22:37:23.058784 #
|
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.events
|
12
|
-
import io
|
13
11
|
import metaflow.metaflow_current
|
14
|
-
import metaflow.plugins.datatools.s3.s3
|
15
|
-
import metaflow.client.core
|
16
12
|
import datetime
|
13
|
+
import metaflow.events
|
17
14
|
import metaflow.parameters
|
18
15
|
import typing
|
16
|
+
import metaflow.plugins.datatools.s3.s3
|
17
|
+
import io
|
19
18
|
import metaflow._vendor.click.types
|
20
19
|
import metaflow.datastore.inputs
|
20
|
+
import metaflow.client.core
|
21
21
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
22
22
|
StepFlag = typing.NewType("StepFlag", bool)
|
23
23
|
|
@@ -725,37 +725,6 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
725
725
|
"""
|
726
726
|
...
|
727
727
|
|
728
|
-
@typing.overload
|
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
|
-
"""
|
731
|
-
Specifies environment variables to be set prior to the execution of a step.
|
732
|
-
|
733
|
-
Parameters
|
734
|
-
----------
|
735
|
-
vars : Dict[str, str], default {}
|
736
|
-
Dictionary of environment variables to set.
|
737
|
-
"""
|
738
|
-
...
|
739
|
-
|
740
|
-
@typing.overload
|
741
|
-
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
742
|
-
...
|
743
|
-
|
744
|
-
@typing.overload
|
745
|
-
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
746
|
-
...
|
747
|
-
|
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] = {}):
|
749
|
-
"""
|
750
|
-
Specifies environment variables to be set prior to the execution of a step.
|
751
|
-
|
752
|
-
Parameters
|
753
|
-
----------
|
754
|
-
vars : Dict[str, str], default {}
|
755
|
-
Dictionary of environment variables to set.
|
756
|
-
"""
|
757
|
-
...
|
758
|
-
|
759
728
|
@typing.overload
|
760
729
|
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]]]:
|
761
730
|
"""
|
@@ -834,7 +803,87 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
834
803
|
...
|
835
804
|
|
836
805
|
@typing.overload
|
837
|
-
def
|
806
|
+
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]]]:
|
807
|
+
"""
|
808
|
+
Specifies that the step will success under all circumstances.
|
809
|
+
|
810
|
+
The decorator will create an optional artifact, specified by `var`, which
|
811
|
+
contains the exception raised. You can use it to detect the presence
|
812
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
813
|
+
are missing.
|
814
|
+
|
815
|
+
Parameters
|
816
|
+
----------
|
817
|
+
var : str, optional, default None
|
818
|
+
Name of the artifact in which to store the caught exception.
|
819
|
+
If not specified, the exception is not stored.
|
820
|
+
print_exception : bool, default True
|
821
|
+
Determines whether or not the exception is printed to
|
822
|
+
stdout when caught.
|
823
|
+
"""
|
824
|
+
...
|
825
|
+
|
826
|
+
@typing.overload
|
827
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
828
|
+
...
|
829
|
+
|
830
|
+
@typing.overload
|
831
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
832
|
+
...
|
833
|
+
|
834
|
+
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):
|
835
|
+
"""
|
836
|
+
Specifies that the step will success under all circumstances.
|
837
|
+
|
838
|
+
The decorator will create an optional artifact, specified by `var`, which
|
839
|
+
contains the exception raised. You can use it to detect the presence
|
840
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
841
|
+
are missing.
|
842
|
+
|
843
|
+
Parameters
|
844
|
+
----------
|
845
|
+
var : str, optional, default None
|
846
|
+
Name of the artifact in which to store the caught exception.
|
847
|
+
If not specified, the exception is not stored.
|
848
|
+
print_exception : bool, default True
|
849
|
+
Determines whether or not the exception is printed to
|
850
|
+
stdout when caught.
|
851
|
+
"""
|
852
|
+
...
|
853
|
+
|
854
|
+
@typing.overload
|
855
|
+
def environment(*, vars: typing.Dict[str, str] = {}) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
856
|
+
"""
|
857
|
+
Specifies environment variables to be set prior to the execution of a step.
|
858
|
+
|
859
|
+
Parameters
|
860
|
+
----------
|
861
|
+
vars : Dict[str, str], default {}
|
862
|
+
Dictionary of environment variables to set.
|
863
|
+
"""
|
864
|
+
...
|
865
|
+
|
866
|
+
@typing.overload
|
867
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
868
|
+
...
|
869
|
+
|
870
|
+
@typing.overload
|
871
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
872
|
+
...
|
873
|
+
|
874
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
875
|
+
"""
|
876
|
+
Specifies environment variables to be set prior to the execution of a step.
|
877
|
+
|
878
|
+
Parameters
|
879
|
+
----------
|
880
|
+
vars : Dict[str, str], default {}
|
881
|
+
Dictionary of environment variables to set.
|
882
|
+
"""
|
883
|
+
...
|
884
|
+
|
885
|
+
@typing.overload
|
886
|
+
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]]]:
|
838
887
|
"""
|
839
888
|
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
840
889
|
|
@@ -875,7 +924,8 @@ def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optio
|
|
875
924
|
necessary. A swappiness value of 100 causes pages to be swapped very
|
876
925
|
aggressively. Accepted values are whole numbers between 0 and 100.
|
877
926
|
use_tmpfs : bool, default False
|
878
|
-
This enables an explicit tmpfs mount for this step.
|
927
|
+
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
928
|
+
not available on Fargate compute environments
|
879
929
|
tmpfs_tempdir : bool, default True
|
880
930
|
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
881
931
|
tmpfs_size : int, optional, default None
|
@@ -886,8 +936,19 @@ def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optio
|
|
886
936
|
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
887
937
|
inferentia : int, default 0
|
888
938
|
Number of Inferentia chips required for this step.
|
939
|
+
trainium : int, default None
|
940
|
+
Alias for inferentia. Use only one of the two.
|
889
941
|
efa : int, default 0
|
890
942
|
Number of elastic fabric adapter network devices to attach to container
|
943
|
+
ephemeral_storage: int, default None
|
944
|
+
The total amount, in GiB, of ephemeral storage to set for the task (21-200)
|
945
|
+
This is only relevant for Fargate compute environments
|
946
|
+
log_driver: str, optional, default None
|
947
|
+
The log driver to use for the Amazon ECS container.
|
948
|
+
log_options: List[str], optional, default None
|
949
|
+
List of strings containing options for the chosen log driver. The configurable values
|
950
|
+
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
951
|
+
Example usage: ["awslogs-group:aws/batch/job"]
|
891
952
|
"""
|
892
953
|
...
|
893
954
|
|
@@ -899,7 +960,7 @@ def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Calla
|
|
899
960
|
def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
900
961
|
...
|
901
962
|
|
902
|
-
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):
|
963
|
+
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):
|
903
964
|
"""
|
904
965
|
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
905
966
|
|
@@ -940,7 +1001,8 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
940
1001
|
necessary. A swappiness value of 100 causes pages to be swapped very
|
941
1002
|
aggressively. Accepted values are whole numbers between 0 and 100.
|
942
1003
|
use_tmpfs : bool, default False
|
943
|
-
This enables an explicit tmpfs mount for this step.
|
1004
|
+
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
1005
|
+
not available on Fargate compute environments
|
944
1006
|
tmpfs_tempdir : bool, default True
|
945
1007
|
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
946
1008
|
tmpfs_size : int, optional, default None
|
@@ -951,41 +1013,76 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
951
1013
|
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
952
1014
|
inferentia : int, default 0
|
953
1015
|
Number of Inferentia chips required for this step.
|
1016
|
+
trainium : int, default None
|
1017
|
+
Alias for inferentia. Use only one of the two.
|
954
1018
|
efa : int, default 0
|
955
1019
|
Number of elastic fabric adapter network devices to attach to container
|
1020
|
+
ephemeral_storage: int, default None
|
1021
|
+
The total amount, in GiB, of ephemeral storage to set for the task (21-200)
|
1022
|
+
This is only relevant for Fargate compute environments
|
1023
|
+
log_driver: str, optional, default None
|
1024
|
+
The log driver to use for the Amazon ECS container.
|
1025
|
+
log_options: List[str], optional, default None
|
1026
|
+
List of strings containing options for the chosen log driver. The configurable values
|
1027
|
+
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
1028
|
+
Example usage: ["awslogs-group:aws/batch/job"]
|
956
1029
|
"""
|
957
1030
|
...
|
958
1031
|
|
959
|
-
|
960
|
-
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]]]:
|
961
|
-
"""
|
962
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
963
|
-
the execution of a step.
|
964
|
-
|
965
|
-
Parameters
|
966
|
-
----------
|
967
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
968
|
-
List of secret specs, defining how the secrets are to be retrieved
|
969
|
-
"""
|
970
|
-
...
|
971
|
-
|
972
|
-
@typing.overload
|
973
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
974
|
-
...
|
975
|
-
|
976
|
-
@typing.overload
|
977
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
978
|
-
...
|
979
|
-
|
980
|
-
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]]] = []):
|
1032
|
+
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, 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]]]:
|
981
1033
|
"""
|
982
|
-
Specifies
|
983
|
-
the execution of a step.
|
1034
|
+
Specifies that this step should execute on Kubernetes.
|
984
1035
|
|
985
1036
|
Parameters
|
986
1037
|
----------
|
987
|
-
|
988
|
-
|
1038
|
+
cpu : int, default 1
|
1039
|
+
Number of CPUs required for this step. If `@resources` is
|
1040
|
+
also present, the maximum value from all decorators is used.
|
1041
|
+
memory : int, default 4096
|
1042
|
+
Memory size (in MB) required for this step. If
|
1043
|
+
`@resources` is also present, the maximum value from all decorators is
|
1044
|
+
used.
|
1045
|
+
disk : int, default 10240
|
1046
|
+
Disk size (in MB) required for this step. If
|
1047
|
+
`@resources` is also present, the maximum value from all decorators is
|
1048
|
+
used.
|
1049
|
+
image : str, optional, default None
|
1050
|
+
Docker image to use when launching on Kubernetes. If not specified, and
|
1051
|
+
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
1052
|
+
not, a default Docker image mapping to the current version of Python is used.
|
1053
|
+
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
1054
|
+
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
1055
|
+
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
1056
|
+
Kubernetes service account to use when launching pod in Kubernetes.
|
1057
|
+
secrets : List[str], optional, default None
|
1058
|
+
Kubernetes secrets to use when launching pod in Kubernetes. These
|
1059
|
+
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
1060
|
+
in Metaflow configuration.
|
1061
|
+
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
1062
|
+
Kubernetes namespace to use when launching pod in Kubernetes.
|
1063
|
+
gpu : int, optional, default None
|
1064
|
+
Number of GPUs required for this step. A value of zero implies that
|
1065
|
+
the scheduled node should not have GPUs.
|
1066
|
+
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
1067
|
+
The vendor of the GPUs to be used for this step.
|
1068
|
+
tolerations : List[str], default []
|
1069
|
+
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
1070
|
+
Kubernetes tolerations to use when launching pod in Kubernetes.
|
1071
|
+
use_tmpfs : bool, default False
|
1072
|
+
This enables an explicit tmpfs mount for this step.
|
1073
|
+
tmpfs_tempdir : bool, default True
|
1074
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
1075
|
+
tmpfs_size : int, optional, default: None
|
1076
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
1077
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
1078
|
+
memory allocated for this step.
|
1079
|
+
tmpfs_path : str, optional, default /metaflow_temp
|
1080
|
+
Path to tmpfs mount for this step.
|
1081
|
+
persistent_volume_claims : Dict[str, str], optional, default None
|
1082
|
+
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
1083
|
+
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
1084
|
+
shared_memory: int, optional
|
1085
|
+
Shared memory size (in MiB) required for this step
|
989
1086
|
"""
|
990
1087
|
...
|
991
1088
|
|
@@ -1040,59 +1137,6 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
|
|
1040
1137
|
"""
|
1041
1138
|
...
|
1042
1139
|
|
1043
|
-
@typing.overload
|
1044
|
-
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]]]:
|
1045
|
-
"""
|
1046
|
-
Specifies the number of times the task corresponding
|
1047
|
-
to a step needs to be retried.
|
1048
|
-
|
1049
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
1050
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
1051
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
1052
|
-
|
1053
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
1054
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
1055
|
-
ensuring that the flow execution can continue.
|
1056
|
-
|
1057
|
-
Parameters
|
1058
|
-
----------
|
1059
|
-
times : int, default 3
|
1060
|
-
Number of times to retry this task.
|
1061
|
-
minutes_between_retries : int, default 2
|
1062
|
-
Number of minutes between retries.
|
1063
|
-
"""
|
1064
|
-
...
|
1065
|
-
|
1066
|
-
@typing.overload
|
1067
|
-
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1068
|
-
...
|
1069
|
-
|
1070
|
-
@typing.overload
|
1071
|
-
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1072
|
-
...
|
1073
|
-
|
1074
|
-
def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
|
1075
|
-
"""
|
1076
|
-
Specifies the number of times the task corresponding
|
1077
|
-
to a step needs to be retried.
|
1078
|
-
|
1079
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
1080
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
1081
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
1082
|
-
|
1083
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
1084
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
1085
|
-
ensuring that the flow execution can continue.
|
1086
|
-
|
1087
|
-
Parameters
|
1088
|
-
----------
|
1089
|
-
times : int, default 3
|
1090
|
-
Number of times to retry this task.
|
1091
|
-
minutes_between_retries : int, default 2
|
1092
|
-
Number of minutes between retries.
|
1093
|
-
"""
|
1094
|
-
...
|
1095
|
-
|
1096
1140
|
@typing.overload
|
1097
1141
|
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]]]:
|
1098
1142
|
"""
|
@@ -1151,59 +1195,55 @@ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
1151
1195
|
...
|
1152
1196
|
|
1153
1197
|
@typing.overload
|
1154
|
-
def
|
1198
|
+
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]]]:
|
1155
1199
|
"""
|
1156
|
-
Specifies
|
1200
|
+
Specifies the number of times the task corresponding
|
1201
|
+
to a step needs to be retried.
|
1157
1202
|
|
1158
|
-
This decorator is useful
|
1159
|
-
|
1160
|
-
|
1161
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
1162
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
1203
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
1204
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
1205
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
1163
1206
|
|
1164
|
-
|
1165
|
-
|
1207
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
1208
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
1209
|
+
ensuring that the flow execution can continue.
|
1166
1210
|
|
1167
1211
|
Parameters
|
1168
1212
|
----------
|
1169
|
-
|
1170
|
-
Number of
|
1171
|
-
|
1172
|
-
Number of minutes
|
1173
|
-
hours : int, default 0
|
1174
|
-
Number of hours to wait prior to timing out.
|
1213
|
+
times : int, default 3
|
1214
|
+
Number of times to retry this task.
|
1215
|
+
minutes_between_retries : int, default 2
|
1216
|
+
Number of minutes between retries.
|
1175
1217
|
"""
|
1176
1218
|
...
|
1177
1219
|
|
1178
1220
|
@typing.overload
|
1179
|
-
def
|
1221
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1180
1222
|
...
|
1181
1223
|
|
1182
1224
|
@typing.overload
|
1183
|
-
def
|
1225
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1184
1226
|
...
|
1185
1227
|
|
1186
|
-
def
|
1228
|
+
def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
|
1187
1229
|
"""
|
1188
|
-
Specifies
|
1189
|
-
|
1190
|
-
This decorator is useful if this step may hang indefinitely.
|
1230
|
+
Specifies the number of times the task corresponding
|
1231
|
+
to a step needs to be retried.
|
1191
1232
|
|
1192
|
-
This
|
1193
|
-
|
1194
|
-
|
1233
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
1234
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
1235
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
1195
1236
|
|
1196
|
-
|
1197
|
-
|
1237
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
1238
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
1239
|
+
ensuring that the flow execution can continue.
|
1198
1240
|
|
1199
1241
|
Parameters
|
1200
1242
|
----------
|
1201
|
-
|
1202
|
-
Number of
|
1203
|
-
|
1204
|
-
Number of minutes
|
1205
|
-
hours : int, default 0
|
1206
|
-
Number of hours to wait prior to timing out.
|
1243
|
+
times : int, default 3
|
1244
|
+
Number of times to retry this task.
|
1245
|
+
minutes_between_retries : int, default 2
|
1246
|
+
Number of minutes between retries.
|
1207
1247
|
"""
|
1208
1248
|
...
|
1209
1249
|
|
@@ -1257,344 +1297,92 @@ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
|
|
1257
1297
|
...
|
1258
1298
|
|
1259
1299
|
@typing.overload
|
1260
|
-
def
|
1300
|
+
def timeout(*, seconds: int = 0, minutes: int = 0, hours: int = 0) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
1261
1301
|
"""
|
1262
|
-
Specifies
|
1263
|
-
|
1264
|
-
The decorator will create an optional artifact, specified by `var`, which
|
1265
|
-
contains the exception raised. You can use it to detect the presence
|
1266
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
1267
|
-
are missing.
|
1302
|
+
Specifies a timeout for your step.
|
1268
1303
|
|
1269
|
-
|
1270
|
-
----------
|
1271
|
-
var : str, optional, default None
|
1272
|
-
Name of the artifact in which to store the caught exception.
|
1273
|
-
If not specified, the exception is not stored.
|
1274
|
-
print_exception : bool, default True
|
1275
|
-
Determines whether or not the exception is printed to
|
1276
|
-
stdout when caught.
|
1277
|
-
"""
|
1278
|
-
...
|
1279
|
-
|
1280
|
-
@typing.overload
|
1281
|
-
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1282
|
-
...
|
1283
|
-
|
1284
|
-
@typing.overload
|
1285
|
-
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1286
|
-
...
|
1287
|
-
|
1288
|
-
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):
|
1289
|
-
"""
|
1290
|
-
Specifies that the step will success under all circumstances.
|
1304
|
+
This decorator is useful if this step may hang indefinitely.
|
1291
1305
|
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
are missing.
|
1306
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
1307
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
1308
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
1296
1309
|
|
1297
|
-
|
1298
|
-
|
1299
|
-
var : str, optional, default None
|
1300
|
-
Name of the artifact in which to store the caught exception.
|
1301
|
-
If not specified, the exception is not stored.
|
1302
|
-
print_exception : bool, default True
|
1303
|
-
Determines whether or not the exception is printed to
|
1304
|
-
stdout when caught.
|
1305
|
-
"""
|
1306
|
-
...
|
1307
|
-
|
1308
|
-
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, 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]]]:
|
1309
|
-
"""
|
1310
|
-
Specifies that this step should execute on Kubernetes.
|
1310
|
+
Note that all the values specified in parameters are added together so if you specify
|
1311
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
1311
1312
|
|
1312
1313
|
Parameters
|
1313
1314
|
----------
|
1314
|
-
|
1315
|
-
Number of
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
used.
|
1321
|
-
disk : int, default 10240
|
1322
|
-
Disk size (in MB) required for this step. If
|
1323
|
-
`@resources` is also present, the maximum value from all decorators is
|
1324
|
-
used.
|
1325
|
-
image : str, optional, default None
|
1326
|
-
Docker image to use when launching on Kubernetes. If not specified, and
|
1327
|
-
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
1328
|
-
not, a default Docker image mapping to the current version of Python is used.
|
1329
|
-
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
1330
|
-
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
1331
|
-
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
1332
|
-
Kubernetes service account to use when launching pod in Kubernetes.
|
1333
|
-
secrets : List[str], optional, default None
|
1334
|
-
Kubernetes secrets to use when launching pod in Kubernetes. These
|
1335
|
-
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
1336
|
-
in Metaflow configuration.
|
1337
|
-
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
1338
|
-
Kubernetes namespace to use when launching pod in Kubernetes.
|
1339
|
-
gpu : int, optional, default None
|
1340
|
-
Number of GPUs required for this step. A value of zero implies that
|
1341
|
-
the scheduled node should not have GPUs.
|
1342
|
-
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
1343
|
-
The vendor of the GPUs to be used for this step.
|
1344
|
-
tolerations : List[str], default []
|
1345
|
-
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
1346
|
-
Kubernetes tolerations to use when launching pod in Kubernetes.
|
1347
|
-
use_tmpfs : bool, default False
|
1348
|
-
This enables an explicit tmpfs mount for this step.
|
1349
|
-
tmpfs_tempdir : bool, default True
|
1350
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
1351
|
-
tmpfs_size : int, optional, default: None
|
1352
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
1353
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
1354
|
-
memory allocated for this step.
|
1355
|
-
tmpfs_path : str, optional, default /metaflow_temp
|
1356
|
-
Path to tmpfs mount for this step.
|
1357
|
-
persistent_volume_claims : Dict[str, str], optional, default None
|
1358
|
-
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
1359
|
-
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
1360
|
-
shared_memory: int, optional
|
1361
|
-
Shared memory size (in MiB) required for this step
|
1315
|
+
seconds : int, default 0
|
1316
|
+
Number of seconds to wait prior to timing out.
|
1317
|
+
minutes : int, default 0
|
1318
|
+
Number of minutes to wait prior to timing out.
|
1319
|
+
hours : int, default 0
|
1320
|
+
Number of hours to wait prior to timing out.
|
1362
1321
|
"""
|
1363
1322
|
...
|
1364
1323
|
|
1365
1324
|
@typing.overload
|
1366
|
-
def
|
1367
|
-
"""
|
1368
|
-
Specifies the flow(s) that this flow depends on.
|
1369
|
-
|
1370
|
-
```
|
1371
|
-
@trigger_on_finish(flow='FooFlow')
|
1372
|
-
```
|
1373
|
-
or
|
1374
|
-
```
|
1375
|
-
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
1376
|
-
```
|
1377
|
-
This decorator respects the @project decorator and triggers the flow
|
1378
|
-
when upstream runs within the same namespace complete successfully
|
1379
|
-
|
1380
|
-
Additionally, you can specify project aware upstream flow dependencies
|
1381
|
-
by specifying the fully qualified project_flow_name.
|
1382
|
-
```
|
1383
|
-
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
1384
|
-
```
|
1385
|
-
or
|
1386
|
-
```
|
1387
|
-
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
1388
|
-
```
|
1389
|
-
|
1390
|
-
You can also specify just the project or project branch (other values will be
|
1391
|
-
inferred from the current project or project branch):
|
1392
|
-
```
|
1393
|
-
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
1394
|
-
```
|
1395
|
-
|
1396
|
-
Note that `branch` is typically one of:
|
1397
|
-
- `prod`
|
1398
|
-
- `user.bob`
|
1399
|
-
- `test.my_experiment`
|
1400
|
-
- `prod.staging`
|
1401
|
-
|
1402
|
-
Parameters
|
1403
|
-
----------
|
1404
|
-
flow : Union[str, Dict[str, str]], optional, default None
|
1405
|
-
Upstream flow dependency for this flow.
|
1406
|
-
flows : List[Union[str, Dict[str, str]]], default []
|
1407
|
-
Upstream flow dependencies for this flow.
|
1408
|
-
options : Dict[str, Any], default {}
|
1409
|
-
Backend-specific configuration for tuning eventing behavior.
|
1410
|
-
|
1411
|
-
|
1412
|
-
"""
|
1325
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1413
1326
|
...
|
1414
1327
|
|
1415
1328
|
@typing.overload
|
1416
|
-
def
|
1329
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1417
1330
|
...
|
1418
1331
|
|
1419
|
-
def
|
1332
|
+
def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, seconds: int = 0, minutes: int = 0, hours: int = 0):
|
1420
1333
|
"""
|
1421
|
-
Specifies
|
1422
|
-
|
1423
|
-
```
|
1424
|
-
@trigger_on_finish(flow='FooFlow')
|
1425
|
-
```
|
1426
|
-
or
|
1427
|
-
```
|
1428
|
-
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
1429
|
-
```
|
1430
|
-
This decorator respects the @project decorator and triggers the flow
|
1431
|
-
when upstream runs within the same namespace complete successfully
|
1432
|
-
|
1433
|
-
Additionally, you can specify project aware upstream flow dependencies
|
1434
|
-
by specifying the fully qualified project_flow_name.
|
1435
|
-
```
|
1436
|
-
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
1437
|
-
```
|
1438
|
-
or
|
1439
|
-
```
|
1440
|
-
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
1441
|
-
```
|
1442
|
-
|
1443
|
-
You can also specify just the project or project branch (other values will be
|
1444
|
-
inferred from the current project or project branch):
|
1445
|
-
```
|
1446
|
-
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
1447
|
-
```
|
1448
|
-
|
1449
|
-
Note that `branch` is typically one of:
|
1450
|
-
- `prod`
|
1451
|
-
- `user.bob`
|
1452
|
-
- `test.my_experiment`
|
1453
|
-
- `prod.staging`
|
1334
|
+
Specifies a timeout for your step.
|
1454
1335
|
|
1455
|
-
|
1456
|
-
----------
|
1457
|
-
flow : Union[str, Dict[str, str]], optional, default None
|
1458
|
-
Upstream flow dependency for this flow.
|
1459
|
-
flows : List[Union[str, Dict[str, str]]], default []
|
1460
|
-
Upstream flow dependencies for this flow.
|
1461
|
-
options : Dict[str, Any], default {}
|
1462
|
-
Backend-specific configuration for tuning eventing behavior.
|
1336
|
+
This decorator is useful if this step may hang indefinitely.
|
1463
1337
|
|
1338
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
1339
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
1340
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
1464
1341
|
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
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]]:
|
1469
|
-
"""
|
1470
|
-
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.
|
1471
|
-
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.
|
1342
|
+
Note that all the values specified in parameters are added together so if you specify
|
1343
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
1472
1344
|
|
1473
1345
|
Parameters
|
1474
1346
|
----------
|
1475
|
-
|
1476
|
-
|
1477
|
-
|
1478
|
-
|
1479
|
-
|
1480
|
-
|
1481
|
-
exponential_backoff : bool
|
1482
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1483
|
-
pool : str
|
1484
|
-
the slot pool this task should run in,
|
1485
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1486
|
-
soft_fail : bool
|
1487
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1488
|
-
name : str
|
1489
|
-
Name of the sensor on Airflow
|
1490
|
-
description : str
|
1491
|
-
Description of sensor in the Airflow UI
|
1492
|
-
external_dag_id : str
|
1493
|
-
The dag_id that contains the task you want to wait for.
|
1494
|
-
external_task_ids : List[str]
|
1495
|
-
The list of task_ids that you want to wait for.
|
1496
|
-
If None (default value) the sensor waits for the DAG. (Default: None)
|
1497
|
-
allowed_states : List[str]
|
1498
|
-
Iterable of allowed states, (Default: ['success'])
|
1499
|
-
failed_states : List[str]
|
1500
|
-
Iterable of failed or dis-allowed states. (Default: None)
|
1501
|
-
execution_delta : datetime.timedelta
|
1502
|
-
time difference with the previous execution to look at,
|
1503
|
-
the default is the same logical date as the current task or DAG. (Default: None)
|
1504
|
-
check_existence: bool
|
1505
|
-
Set to True to check if the external task exists or check if
|
1506
|
-
the DAG to wait for exists. (Default: True)
|
1347
|
+
seconds : int, default 0
|
1348
|
+
Number of seconds to wait prior to timing out.
|
1349
|
+
minutes : int, default 0
|
1350
|
+
Number of minutes to wait prior to timing out.
|
1351
|
+
hours : int, default 0
|
1352
|
+
Number of hours to wait prior to timing out.
|
1507
1353
|
"""
|
1508
1354
|
...
|
1509
1355
|
|
1510
1356
|
@typing.overload
|
1511
|
-
def
|
1357
|
+
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]]]:
|
1512
1358
|
"""
|
1513
|
-
Specifies
|
1514
|
-
|
1515
|
-
Use `@conda_base` to set common libraries required by all
|
1516
|
-
steps and use `@conda` to specify step-specific additions.
|
1359
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
1360
|
+
the execution of a step.
|
1517
1361
|
|
1518
1362
|
Parameters
|
1519
1363
|
----------
|
1520
|
-
|
1521
|
-
|
1522
|
-
and the value is the version to use.
|
1523
|
-
libraries : Dict[str, str], default {}
|
1524
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1525
|
-
python : str, optional, default None
|
1526
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1527
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1528
|
-
disabled : bool, default False
|
1529
|
-
If set to True, disables Conda.
|
1364
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
1365
|
+
List of secret specs, defining how the secrets are to be retrieved
|
1530
1366
|
"""
|
1531
1367
|
...
|
1532
1368
|
|
1533
1369
|
@typing.overload
|
1534
|
-
def
|
1370
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1535
1371
|
...
|
1536
1372
|
|
1537
|
-
|
1538
|
-
|
1539
|
-
Specifies the Conda environment for all steps of the flow.
|
1540
|
-
|
1541
|
-
Use `@conda_base` to set common libraries required by all
|
1542
|
-
steps and use `@conda` to specify step-specific additions.
|
1543
|
-
|
1544
|
-
Parameters
|
1545
|
-
----------
|
1546
|
-
packages : Dict[str, str], default {}
|
1547
|
-
Packages to use for this flow. The key is the name of the package
|
1548
|
-
and the value is the version to use.
|
1549
|
-
libraries : Dict[str, str], default {}
|
1550
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1551
|
-
python : str, optional, default None
|
1552
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1553
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1554
|
-
disabled : bool, default False
|
1555
|
-
If set to True, disables Conda.
|
1556
|
-
"""
|
1373
|
+
@typing.overload
|
1374
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1557
1375
|
...
|
1558
1376
|
|
1559
|
-
def
|
1377
|
+
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]]] = []):
|
1560
1378
|
"""
|
1561
|
-
|
1562
|
-
|
1563
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1564
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1565
|
-
starts only after all sensors finish.
|
1379
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
1380
|
+
the execution of a step.
|
1566
1381
|
|
1567
1382
|
Parameters
|
1568
1383
|
----------
|
1569
|
-
|
1570
|
-
|
1571
|
-
poke_interval : int
|
1572
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
1573
|
-
mode : str
|
1574
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1575
|
-
exponential_backoff : bool
|
1576
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1577
|
-
pool : str
|
1578
|
-
the slot pool this task should run in,
|
1579
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1580
|
-
soft_fail : bool
|
1581
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1582
|
-
name : str
|
1583
|
-
Name of the sensor on Airflow
|
1584
|
-
description : str
|
1585
|
-
Description of sensor in the Airflow UI
|
1586
|
-
bucket_key : Union[str, List[str]]
|
1587
|
-
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1588
|
-
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1589
|
-
bucket_name : str
|
1590
|
-
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1591
|
-
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1592
|
-
wildcard_match : bool
|
1593
|
-
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1594
|
-
aws_conn_id : str
|
1595
|
-
a reference to the s3 connection on Airflow. (Default: None)
|
1596
|
-
verify : bool
|
1597
|
-
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1384
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
1385
|
+
List of secret specs, defining how the secrets are to be retrieved
|
1598
1386
|
"""
|
1599
1387
|
...
|
1600
1388
|
|
@@ -1686,21 +1474,45 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
|
|
1686
1474
|
"""
|
1687
1475
|
...
|
1688
1476
|
|
1689
|
-
def
|
1477
|
+
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]]:
|
1690
1478
|
"""
|
1691
|
-
|
1692
|
-
|
1693
|
-
A project-specific namespace is created for all flows that
|
1694
|
-
use the same `@project(name)`.
|
1479
|
+
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.
|
1480
|
+
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.
|
1695
1481
|
|
1696
1482
|
Parameters
|
1697
1483
|
----------
|
1484
|
+
timeout : int
|
1485
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1486
|
+
poke_interval : int
|
1487
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1488
|
+
mode : str
|
1489
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1490
|
+
exponential_backoff : bool
|
1491
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1492
|
+
pool : str
|
1493
|
+
the slot pool this task should run in,
|
1494
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1495
|
+
soft_fail : bool
|
1496
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1698
1497
|
name : str
|
1699
|
-
|
1700
|
-
|
1701
|
-
|
1702
|
-
|
1703
|
-
|
1498
|
+
Name of the sensor on Airflow
|
1499
|
+
description : str
|
1500
|
+
Description of sensor in the Airflow UI
|
1501
|
+
external_dag_id : str
|
1502
|
+
The dag_id that contains the task you want to wait for.
|
1503
|
+
external_task_ids : List[str]
|
1504
|
+
The list of task_ids that you want to wait for.
|
1505
|
+
If None (default value) the sensor waits for the DAG. (Default: None)
|
1506
|
+
allowed_states : List[str]
|
1507
|
+
Iterable of allowed states, (Default: ['success'])
|
1508
|
+
failed_states : List[str]
|
1509
|
+
Iterable of failed or dis-allowed states. (Default: None)
|
1510
|
+
execution_delta : datetime.timedelta
|
1511
|
+
time difference with the previous execution to look at,
|
1512
|
+
the default is the same logical date as the current task or DAG. (Default: None)
|
1513
|
+
check_existence: bool
|
1514
|
+
Set to True to check if the external task exists or check if
|
1515
|
+
the DAG to wait for exists. (Default: True)
|
1704
1516
|
"""
|
1705
1517
|
...
|
1706
1518
|
|
@@ -1799,6 +1611,218 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
1799
1611
|
"""
|
1800
1612
|
...
|
1801
1613
|
|
1614
|
+
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]]:
|
1615
|
+
"""
|
1616
|
+
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)
|
1617
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1618
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1619
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1620
|
+
starts only after all sensors finish.
|
1621
|
+
|
1622
|
+
Parameters
|
1623
|
+
----------
|
1624
|
+
timeout : int
|
1625
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1626
|
+
poke_interval : int
|
1627
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1628
|
+
mode : str
|
1629
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1630
|
+
exponential_backoff : bool
|
1631
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1632
|
+
pool : str
|
1633
|
+
the slot pool this task should run in,
|
1634
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1635
|
+
soft_fail : bool
|
1636
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1637
|
+
name : str
|
1638
|
+
Name of the sensor on Airflow
|
1639
|
+
description : str
|
1640
|
+
Description of sensor in the Airflow UI
|
1641
|
+
bucket_key : Union[str, List[str]]
|
1642
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1643
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1644
|
+
bucket_name : str
|
1645
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1646
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1647
|
+
wildcard_match : bool
|
1648
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1649
|
+
aws_conn_id : str
|
1650
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1651
|
+
verify : bool
|
1652
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1653
|
+
"""
|
1654
|
+
...
|
1655
|
+
|
1656
|
+
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1657
|
+
"""
|
1658
|
+
Specifies what flows belong to the same project.
|
1659
|
+
|
1660
|
+
A project-specific namespace is created for all flows that
|
1661
|
+
use the same `@project(name)`.
|
1662
|
+
|
1663
|
+
Parameters
|
1664
|
+
----------
|
1665
|
+
name : str
|
1666
|
+
Project name. Make sure that the name is unique amongst all
|
1667
|
+
projects that use the same production scheduler. The name may
|
1668
|
+
contain only lowercase alphanumeric characters and underscores.
|
1669
|
+
|
1670
|
+
|
1671
|
+
"""
|
1672
|
+
...
|
1673
|
+
|
1674
|
+
@typing.overload
|
1675
|
+
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]]:
|
1676
|
+
"""
|
1677
|
+
Specifies the Conda environment for all steps of the flow.
|
1678
|
+
|
1679
|
+
Use `@conda_base` to set common libraries required by all
|
1680
|
+
steps and use `@conda` to specify step-specific additions.
|
1681
|
+
|
1682
|
+
Parameters
|
1683
|
+
----------
|
1684
|
+
packages : Dict[str, str], default {}
|
1685
|
+
Packages to use for this flow. The key is the name of the package
|
1686
|
+
and the value is the version to use.
|
1687
|
+
libraries : Dict[str, str], default {}
|
1688
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
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
|
+
disabled : bool, default False
|
1693
|
+
If set to True, disables Conda.
|
1694
|
+
"""
|
1695
|
+
...
|
1696
|
+
|
1697
|
+
@typing.overload
|
1698
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1699
|
+
...
|
1700
|
+
|
1701
|
+
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):
|
1702
|
+
"""
|
1703
|
+
Specifies the Conda environment for all steps of the flow.
|
1704
|
+
|
1705
|
+
Use `@conda_base` to set common libraries required by all
|
1706
|
+
steps and use `@conda` to specify step-specific additions.
|
1707
|
+
|
1708
|
+
Parameters
|
1709
|
+
----------
|
1710
|
+
packages : Dict[str, str], default {}
|
1711
|
+
Packages to use for this flow. The key is the name of the package
|
1712
|
+
and the value is the version to use.
|
1713
|
+
libraries : Dict[str, str], default {}
|
1714
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1715
|
+
python : str, optional, default None
|
1716
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1717
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1718
|
+
disabled : bool, default False
|
1719
|
+
If set to True, disables Conda.
|
1720
|
+
"""
|
1721
|
+
...
|
1722
|
+
|
1723
|
+
@typing.overload
|
1724
|
+
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]]:
|
1725
|
+
"""
|
1726
|
+
Specifies the flow(s) that this flow depends on.
|
1727
|
+
|
1728
|
+
```
|
1729
|
+
@trigger_on_finish(flow='FooFlow')
|
1730
|
+
```
|
1731
|
+
or
|
1732
|
+
```
|
1733
|
+
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
1734
|
+
```
|
1735
|
+
This decorator respects the @project decorator and triggers the flow
|
1736
|
+
when upstream runs within the same namespace complete successfully
|
1737
|
+
|
1738
|
+
Additionally, you can specify project aware upstream flow dependencies
|
1739
|
+
by specifying the fully qualified project_flow_name.
|
1740
|
+
```
|
1741
|
+
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
1742
|
+
```
|
1743
|
+
or
|
1744
|
+
```
|
1745
|
+
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
1746
|
+
```
|
1747
|
+
|
1748
|
+
You can also specify just the project or project branch (other values will be
|
1749
|
+
inferred from the current project or project branch):
|
1750
|
+
```
|
1751
|
+
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
1752
|
+
```
|
1753
|
+
|
1754
|
+
Note that `branch` is typically one of:
|
1755
|
+
- `prod`
|
1756
|
+
- `user.bob`
|
1757
|
+
- `test.my_experiment`
|
1758
|
+
- `prod.staging`
|
1759
|
+
|
1760
|
+
Parameters
|
1761
|
+
----------
|
1762
|
+
flow : Union[str, Dict[str, str]], optional, default None
|
1763
|
+
Upstream flow dependency for this flow.
|
1764
|
+
flows : List[Union[str, Dict[str, str]]], default []
|
1765
|
+
Upstream flow dependencies for this flow.
|
1766
|
+
options : Dict[str, Any], default {}
|
1767
|
+
Backend-specific configuration for tuning eventing behavior.
|
1768
|
+
|
1769
|
+
|
1770
|
+
"""
|
1771
|
+
...
|
1772
|
+
|
1773
|
+
@typing.overload
|
1774
|
+
def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1775
|
+
...
|
1776
|
+
|
1777
|
+
def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, 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] = {}):
|
1778
|
+
"""
|
1779
|
+
Specifies the flow(s) that this flow depends on.
|
1780
|
+
|
1781
|
+
```
|
1782
|
+
@trigger_on_finish(flow='FooFlow')
|
1783
|
+
```
|
1784
|
+
or
|
1785
|
+
```
|
1786
|
+
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
1787
|
+
```
|
1788
|
+
This decorator respects the @project decorator and triggers the flow
|
1789
|
+
when upstream runs within the same namespace complete successfully
|
1790
|
+
|
1791
|
+
Additionally, you can specify project aware upstream flow dependencies
|
1792
|
+
by specifying the fully qualified project_flow_name.
|
1793
|
+
```
|
1794
|
+
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
1795
|
+
```
|
1796
|
+
or
|
1797
|
+
```
|
1798
|
+
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
1799
|
+
```
|
1800
|
+
|
1801
|
+
You can also specify just the project or project branch (other values will be
|
1802
|
+
inferred from the current project or project branch):
|
1803
|
+
```
|
1804
|
+
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
1805
|
+
```
|
1806
|
+
|
1807
|
+
Note that `branch` is typically one of:
|
1808
|
+
- `prod`
|
1809
|
+
- `user.bob`
|
1810
|
+
- `test.my_experiment`
|
1811
|
+
- `prod.staging`
|
1812
|
+
|
1813
|
+
Parameters
|
1814
|
+
----------
|
1815
|
+
flow : Union[str, Dict[str, str]], optional, default None
|
1816
|
+
Upstream flow dependency for this flow.
|
1817
|
+
flows : List[Union[str, Dict[str, str]]], default []
|
1818
|
+
Upstream flow dependencies for this flow.
|
1819
|
+
options : Dict[str, Any], default {}
|
1820
|
+
Backend-specific configuration for tuning eventing behavior.
|
1821
|
+
|
1822
|
+
|
1823
|
+
"""
|
1824
|
+
...
|
1825
|
+
|
1802
1826
|
def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
|
1803
1827
|
"""
|
1804
1828
|
Switch namespace to the one provided.
|