metaflow-stubs 2.11.13__py2.py3-none-any.whl → 2.11.14__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 +482 -482
- metaflow-stubs/cards.pyi +4 -4
- metaflow-stubs/cli.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +2 -2
- metaflow-stubs/client/core.pyi +6 -6
- metaflow-stubs/client/filecache.pyi +3 -3
- metaflow-stubs/clone_util.pyi +2 -2
- 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 +5 -5
- metaflow-stubs/metadata/metadata.pyi +2 -2
- metaflow-stubs/metadata/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -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 +2 -2
- 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 +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 +4 -4
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +4 -4
- 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 +2 -2
- metaflow-stubs/plugins/aws/batch/batch_cli.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
- 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 +2 -2
- 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 +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 +4 -4
- 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 +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 +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 +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 +6 -6
- 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 +4 -4
- 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 +4 -4
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
- metaflow-stubs/plugins/pypi/utils.pyi +2 -2
- metaflow-stubs/plugins/resources_decorator.pyi +2 -2
- metaflow-stubs/plugins/retry_decorator.pyi +2 -2
- metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +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 +4 -4
- 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
- metaflow-stubs/version.pyi +2 -2
- {metaflow_stubs-2.11.13.dist-info → metaflow_stubs-2.11.14.dist-info}/METADATA +2 -2
- metaflow_stubs-2.11.14.dist-info/RECORD +132 -0
- metaflow_stubs-2.11.13.dist-info/RECORD +0 -132
- {metaflow_stubs-2.11.13.dist-info → metaflow_stubs-2.11.14.dist-info}/WHEEL +0 -0
- {metaflow_stubs-2.11.13.dist-info → metaflow_stubs-2.11.14.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-05-
|
3
|
+
# MF version: 2.11.14 #
|
4
|
+
# Generated on 2024-05-06T23:56:19.351151 #
|
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.metaflow_current
|
12
|
+
import metaflow.datastore.inputs
|
11
13
|
import metaflow.plugins.datatools.s3.s3
|
12
14
|
import datetime
|
13
|
-
import io
|
14
|
-
import typing
|
15
|
-
import metaflow.client.core
|
16
15
|
import metaflow.parameters
|
16
|
+
import metaflow.client.core
|
17
|
+
import io
|
17
18
|
import metaflow._vendor.click.types
|
18
19
|
import metaflow.events
|
19
|
-
import
|
20
|
-
import metaflow.datastore.inputs
|
20
|
+
import typing
|
21
21
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
22
22
|
StepFlag = typing.NewType("StepFlag", bool)
|
23
23
|
|
@@ -725,96 +725,6 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
725
725
|
"""
|
726
726
|
...
|
727
727
|
|
728
|
-
@typing.overload
|
729
|
-
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]]]:
|
730
|
-
"""
|
731
|
-
Specifies the Conda environment for the step.
|
732
|
-
|
733
|
-
Information in this decorator will augment any
|
734
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
735
|
-
you can use `@conda_base` to set packages required by all
|
736
|
-
steps and use `@conda` to specify step-specific overrides.
|
737
|
-
|
738
|
-
Parameters
|
739
|
-
----------
|
740
|
-
packages : Dict[str, str], default {}
|
741
|
-
Packages to use for this step. The key is the name of the package
|
742
|
-
and the value is the version to use.
|
743
|
-
libraries : Dict[str, str], default {}
|
744
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
745
|
-
python : str, optional, default None
|
746
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
747
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
748
|
-
disabled : bool, default False
|
749
|
-
If set to True, disables @conda.
|
750
|
-
"""
|
751
|
-
...
|
752
|
-
|
753
|
-
@typing.overload
|
754
|
-
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
755
|
-
...
|
756
|
-
|
757
|
-
@typing.overload
|
758
|
-
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
759
|
-
...
|
760
|
-
|
761
|
-
def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
762
|
-
"""
|
763
|
-
Specifies the Conda environment for the step.
|
764
|
-
|
765
|
-
Information in this decorator will augment any
|
766
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
767
|
-
you can use `@conda_base` to set packages required by all
|
768
|
-
steps and use `@conda` to specify step-specific overrides.
|
769
|
-
|
770
|
-
Parameters
|
771
|
-
----------
|
772
|
-
packages : Dict[str, str], default {}
|
773
|
-
Packages to use for this step. The key is the name of the package
|
774
|
-
and the value is the version to use.
|
775
|
-
libraries : Dict[str, str], default {}
|
776
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
777
|
-
python : str, optional, default None
|
778
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
779
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
780
|
-
disabled : bool, default False
|
781
|
-
If set to True, disables @conda.
|
782
|
-
"""
|
783
|
-
...
|
784
|
-
|
785
|
-
@typing.overload
|
786
|
-
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]]]:
|
787
|
-
"""
|
788
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
789
|
-
the execution of a step.
|
790
|
-
|
791
|
-
Parameters
|
792
|
-
----------
|
793
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
794
|
-
List of secret specs, defining how the secrets are to be retrieved
|
795
|
-
"""
|
796
|
-
...
|
797
|
-
|
798
|
-
@typing.overload
|
799
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
800
|
-
...
|
801
|
-
|
802
|
-
@typing.overload
|
803
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
804
|
-
...
|
805
|
-
|
806
|
-
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]]] = []):
|
807
|
-
"""
|
808
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
809
|
-
the execution of a step.
|
810
|
-
|
811
|
-
Parameters
|
812
|
-
----------
|
813
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
814
|
-
List of secret specs, defining how the secrets are to be retrieved
|
815
|
-
"""
|
816
|
-
...
|
817
|
-
|
818
728
|
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, port: 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]]]:
|
819
729
|
"""
|
820
730
|
Specifies that this step should execute on Kubernetes.
|
@@ -875,92 +785,386 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
|
|
875
785
|
...
|
876
786
|
|
877
787
|
@typing.overload
|
878
|
-
def
|
788
|
+
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]]]:
|
879
789
|
"""
|
880
|
-
Specifies
|
790
|
+
Specifies a timeout for your step.
|
881
791
|
|
882
|
-
|
883
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
792
|
+
This decorator is useful if this step may hang indefinitely.
|
884
793
|
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
python myflow.py run --with kubernetes
|
892
|
-
```
|
893
|
-
which executes the flow on the desired system using the
|
894
|
-
requirements specified in `@resources`.
|
794
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
795
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
796
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
797
|
+
|
798
|
+
Note that all the values specified in parameters are added together so if you specify
|
799
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
895
800
|
|
896
801
|
Parameters
|
897
802
|
----------
|
898
|
-
|
899
|
-
Number of
|
900
|
-
|
901
|
-
Number of
|
902
|
-
|
903
|
-
|
904
|
-
memory : int, default 4096
|
905
|
-
Memory size (in MB) required for this step.
|
906
|
-
shared_memory : int, optional, default None
|
907
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
908
|
-
This parameter maps to the `--shm-size` option in Docker.
|
803
|
+
seconds : int, default 0
|
804
|
+
Number of seconds to wait prior to timing out.
|
805
|
+
minutes : int, default 0
|
806
|
+
Number of minutes to wait prior to timing out.
|
807
|
+
hours : int, default 0
|
808
|
+
Number of hours to wait prior to timing out.
|
909
809
|
"""
|
910
810
|
...
|
911
811
|
|
912
812
|
@typing.overload
|
913
|
-
def
|
813
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
914
814
|
...
|
915
815
|
|
916
816
|
@typing.overload
|
917
|
-
def
|
817
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
918
818
|
...
|
919
819
|
|
920
|
-
def
|
820
|
+
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):
|
921
821
|
"""
|
922
|
-
Specifies
|
822
|
+
Specifies a timeout for your step.
|
923
823
|
|
924
|
-
|
925
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
824
|
+
This decorator is useful if this step may hang indefinitely.
|
926
825
|
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
826
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
827
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
828
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
829
|
+
|
830
|
+
Note that all the values specified in parameters are added together so if you specify
|
831
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
832
|
+
|
833
|
+
Parameters
|
834
|
+
----------
|
835
|
+
seconds : int, default 0
|
836
|
+
Number of seconds to wait prior to timing out.
|
837
|
+
minutes : int, default 0
|
838
|
+
Number of minutes to wait prior to timing out.
|
839
|
+
hours : int, default 0
|
840
|
+
Number of hours to wait prior to timing out.
|
841
|
+
"""
|
842
|
+
...
|
843
|
+
|
844
|
+
@typing.overload
|
845
|
+
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]]]:
|
846
|
+
"""
|
847
|
+
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
937
848
|
|
938
849
|
Parameters
|
939
850
|
----------
|
940
851
|
cpu : int, default 1
|
941
|
-
Number of CPUs required for this step.
|
852
|
+
Number of CPUs required for this step. If `@resources` is
|
853
|
+
also present, the maximum value from all decorators is used.
|
942
854
|
gpu : int, default 0
|
943
|
-
Number of GPUs required for this step.
|
944
|
-
|
945
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
855
|
+
Number of GPUs required for this step. If `@resources` is
|
856
|
+
also present, the maximum value from all decorators is used.
|
946
857
|
memory : int, default 4096
|
947
|
-
Memory size (in MB) required for this step.
|
858
|
+
Memory size (in MB) required for this step. If
|
859
|
+
`@resources` is also present, the maximum value from all decorators is
|
860
|
+
used.
|
861
|
+
image : str, optional, default None
|
862
|
+
Docker image to use when launching on AWS Batch. If not specified, and
|
863
|
+
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
864
|
+
not, a default Docker image mapping to the current version of Python is used.
|
865
|
+
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
866
|
+
AWS Batch Job Queue to submit the job to.
|
867
|
+
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
868
|
+
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
869
|
+
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
870
|
+
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
871
|
+
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
948
872
|
shared_memory : int, optional, default None
|
949
873
|
The value for the size (in MiB) of the /dev/shm volume for this step.
|
950
874
|
This parameter maps to the `--shm-size` option in Docker.
|
875
|
+
max_swap : int, optional, default None
|
876
|
+
The total amount of swap memory (in MiB) a container can use for this
|
877
|
+
step. This parameter is translated to the `--memory-swap` option in
|
878
|
+
Docker where the value is the sum of the container memory plus the
|
879
|
+
`max_swap` value.
|
880
|
+
swappiness : int, optional, default None
|
881
|
+
This allows you to tune memory swappiness behavior for this step.
|
882
|
+
A swappiness value of 0 causes swapping not to happen unless absolutely
|
883
|
+
necessary. A swappiness value of 100 causes pages to be swapped very
|
884
|
+
aggressively. Accepted values are whole numbers between 0 and 100.
|
885
|
+
use_tmpfs : bool, default False
|
886
|
+
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
887
|
+
not available on Fargate compute environments
|
888
|
+
tmpfs_tempdir : bool, default True
|
889
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
890
|
+
tmpfs_size : int, optional, default None
|
891
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
892
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
893
|
+
memory allocated for this step.
|
894
|
+
tmpfs_path : str, optional, default None
|
895
|
+
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
896
|
+
inferentia : int, default 0
|
897
|
+
Number of Inferentia chips required for this step.
|
898
|
+
trainium : int, default None
|
899
|
+
Alias for inferentia. Use only one of the two.
|
900
|
+
efa : int, default 0
|
901
|
+
Number of elastic fabric adapter network devices to attach to container
|
902
|
+
ephemeral_storage: int, default None
|
903
|
+
The total amount, in GiB, of ephemeral storage to set for the task (21-200)
|
904
|
+
This is only relevant for Fargate compute environments
|
905
|
+
log_driver: str, optional, default None
|
906
|
+
The log driver to use for the Amazon ECS container.
|
907
|
+
log_options: List[str], optional, default None
|
908
|
+
List of strings containing options for the chosen log driver. The configurable values
|
909
|
+
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
910
|
+
Example usage: ["awslogs-group:aws/batch/job"]
|
951
911
|
"""
|
952
912
|
...
|
953
913
|
|
954
914
|
@typing.overload
|
955
|
-
def
|
915
|
+
def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
916
|
+
...
|
917
|
+
|
918
|
+
@typing.overload
|
919
|
+
def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
920
|
+
...
|
921
|
+
|
922
|
+
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):
|
956
923
|
"""
|
957
|
-
|
958
|
-
|
959
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
924
|
+
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
960
925
|
|
961
926
|
Parameters
|
962
927
|
----------
|
963
|
-
|
928
|
+
cpu : int, default 1
|
929
|
+
Number of CPUs required for this step. If `@resources` is
|
930
|
+
also present, the maximum value from all decorators is used.
|
931
|
+
gpu : int, default 0
|
932
|
+
Number of GPUs required for this step. If `@resources` is
|
933
|
+
also present, the maximum value from all decorators is used.
|
934
|
+
memory : int, default 4096
|
935
|
+
Memory size (in MB) required for this step. If
|
936
|
+
`@resources` is also present, the maximum value from all decorators is
|
937
|
+
used.
|
938
|
+
image : str, optional, default None
|
939
|
+
Docker image to use when launching on AWS Batch. If not specified, and
|
940
|
+
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
941
|
+
not, a default Docker image mapping to the current version of Python is used.
|
942
|
+
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
943
|
+
AWS Batch Job Queue to submit the job to.
|
944
|
+
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
945
|
+
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
946
|
+
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
947
|
+
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
948
|
+
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
949
|
+
shared_memory : int, optional, default None
|
950
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
951
|
+
This parameter maps to the `--shm-size` option in Docker.
|
952
|
+
max_swap : int, optional, default None
|
953
|
+
The total amount of swap memory (in MiB) a container can use for this
|
954
|
+
step. This parameter is translated to the `--memory-swap` option in
|
955
|
+
Docker where the value is the sum of the container memory plus the
|
956
|
+
`max_swap` value.
|
957
|
+
swappiness : int, optional, default None
|
958
|
+
This allows you to tune memory swappiness behavior for this step.
|
959
|
+
A swappiness value of 0 causes swapping not to happen unless absolutely
|
960
|
+
necessary. A swappiness value of 100 causes pages to be swapped very
|
961
|
+
aggressively. Accepted values are whole numbers between 0 and 100.
|
962
|
+
use_tmpfs : bool, default False
|
963
|
+
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
964
|
+
not available on Fargate compute environments
|
965
|
+
tmpfs_tempdir : bool, default True
|
966
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
967
|
+
tmpfs_size : int, optional, default None
|
968
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
969
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
970
|
+
memory allocated for this step.
|
971
|
+
tmpfs_path : str, optional, default None
|
972
|
+
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
973
|
+
inferentia : int, default 0
|
974
|
+
Number of Inferentia chips required for this step.
|
975
|
+
trainium : int, default None
|
976
|
+
Alias for inferentia. Use only one of the two.
|
977
|
+
efa : int, default 0
|
978
|
+
Number of elastic fabric adapter network devices to attach to container
|
979
|
+
ephemeral_storage: int, default None
|
980
|
+
The total amount, in GiB, of ephemeral storage to set for the task (21-200)
|
981
|
+
This is only relevant for Fargate compute environments
|
982
|
+
log_driver: str, optional, default None
|
983
|
+
The log driver to use for the Amazon ECS container.
|
984
|
+
log_options: List[str], optional, default None
|
985
|
+
List of strings containing options for the chosen log driver. The configurable values
|
986
|
+
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
987
|
+
Example usage: ["awslogs-group:aws/batch/job"]
|
988
|
+
"""
|
989
|
+
...
|
990
|
+
|
991
|
+
@typing.overload
|
992
|
+
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]]]:
|
993
|
+
"""
|
994
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
995
|
+
the execution of a step.
|
996
|
+
|
997
|
+
Parameters
|
998
|
+
----------
|
999
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
1000
|
+
List of secret specs, defining how the secrets are to be retrieved
|
1001
|
+
"""
|
1002
|
+
...
|
1003
|
+
|
1004
|
+
@typing.overload
|
1005
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1006
|
+
...
|
1007
|
+
|
1008
|
+
@typing.overload
|
1009
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1010
|
+
...
|
1011
|
+
|
1012
|
+
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]]] = []):
|
1013
|
+
"""
|
1014
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
1015
|
+
the execution of a step.
|
1016
|
+
|
1017
|
+
Parameters
|
1018
|
+
----------
|
1019
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
1020
|
+
List of secret specs, defining how the secrets are to be retrieved
|
1021
|
+
"""
|
1022
|
+
...
|
1023
|
+
|
1024
|
+
@typing.overload
|
1025
|
+
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]]]:
|
1026
|
+
"""
|
1027
|
+
Specifies the resources needed when executing this step.
|
1028
|
+
|
1029
|
+
Use `@resources` to specify the resource requirements
|
1030
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
1031
|
+
|
1032
|
+
You can choose the compute layer on the command line by executing e.g.
|
1033
|
+
```
|
1034
|
+
python myflow.py run --with batch
|
1035
|
+
```
|
1036
|
+
or
|
1037
|
+
```
|
1038
|
+
python myflow.py run --with kubernetes
|
1039
|
+
```
|
1040
|
+
which executes the flow on the desired system using the
|
1041
|
+
requirements specified in `@resources`.
|
1042
|
+
|
1043
|
+
Parameters
|
1044
|
+
----------
|
1045
|
+
cpu : int, default 1
|
1046
|
+
Number of CPUs required for this step.
|
1047
|
+
gpu : int, default 0
|
1048
|
+
Number of GPUs required for this step.
|
1049
|
+
disk : int, optional, default None
|
1050
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
1051
|
+
memory : int, default 4096
|
1052
|
+
Memory size (in MB) required for this step.
|
1053
|
+
shared_memory : int, optional, default None
|
1054
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
1055
|
+
This parameter maps to the `--shm-size` option in Docker.
|
1056
|
+
"""
|
1057
|
+
...
|
1058
|
+
|
1059
|
+
@typing.overload
|
1060
|
+
def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1061
|
+
...
|
1062
|
+
|
1063
|
+
@typing.overload
|
1064
|
+
def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1065
|
+
...
|
1066
|
+
|
1067
|
+
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):
|
1068
|
+
"""
|
1069
|
+
Specifies the resources needed when executing this step.
|
1070
|
+
|
1071
|
+
Use `@resources` to specify the resource requirements
|
1072
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
1073
|
+
|
1074
|
+
You can choose the compute layer on the command line by executing e.g.
|
1075
|
+
```
|
1076
|
+
python myflow.py run --with batch
|
1077
|
+
```
|
1078
|
+
or
|
1079
|
+
```
|
1080
|
+
python myflow.py run --with kubernetes
|
1081
|
+
```
|
1082
|
+
which executes the flow on the desired system using the
|
1083
|
+
requirements specified in `@resources`.
|
1084
|
+
|
1085
|
+
Parameters
|
1086
|
+
----------
|
1087
|
+
cpu : int, default 1
|
1088
|
+
Number of CPUs required for this step.
|
1089
|
+
gpu : int, default 0
|
1090
|
+
Number of GPUs required for this step.
|
1091
|
+
disk : int, optional, default None
|
1092
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
1093
|
+
memory : int, default 4096
|
1094
|
+
Memory size (in MB) required for this step.
|
1095
|
+
shared_memory : int, optional, default None
|
1096
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
1097
|
+
This parameter maps to the `--shm-size` option in Docker.
|
1098
|
+
"""
|
1099
|
+
...
|
1100
|
+
|
1101
|
+
@typing.overload
|
1102
|
+
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]]]:
|
1103
|
+
"""
|
1104
|
+
Specifies the Conda environment for the step.
|
1105
|
+
|
1106
|
+
Information in this decorator will augment any
|
1107
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
1108
|
+
you can use `@conda_base` to set packages required by all
|
1109
|
+
steps and use `@conda` to specify step-specific overrides.
|
1110
|
+
|
1111
|
+
Parameters
|
1112
|
+
----------
|
1113
|
+
packages : Dict[str, str], default {}
|
1114
|
+
Packages to use for this step. The key is the name of the package
|
1115
|
+
and the value is the version to use.
|
1116
|
+
libraries : Dict[str, str], default {}
|
1117
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1118
|
+
python : str, optional, default None
|
1119
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1120
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1121
|
+
disabled : bool, default False
|
1122
|
+
If set to True, disables @conda.
|
1123
|
+
"""
|
1124
|
+
...
|
1125
|
+
|
1126
|
+
@typing.overload
|
1127
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1128
|
+
...
|
1129
|
+
|
1130
|
+
@typing.overload
|
1131
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1132
|
+
...
|
1133
|
+
|
1134
|
+
def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
1135
|
+
"""
|
1136
|
+
Specifies the Conda environment for the step.
|
1137
|
+
|
1138
|
+
Information in this decorator will augment any
|
1139
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
1140
|
+
you can use `@conda_base` to set packages required by all
|
1141
|
+
steps and use `@conda` to specify step-specific overrides.
|
1142
|
+
|
1143
|
+
Parameters
|
1144
|
+
----------
|
1145
|
+
packages : Dict[str, str], default {}
|
1146
|
+
Packages to use for this step. The key is the name of the package
|
1147
|
+
and the value is the version to use.
|
1148
|
+
libraries : Dict[str, str], default {}
|
1149
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1150
|
+
python : str, optional, default None
|
1151
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1152
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1153
|
+
disabled : bool, default False
|
1154
|
+
If set to True, disables @conda.
|
1155
|
+
"""
|
1156
|
+
...
|
1157
|
+
|
1158
|
+
@typing.overload
|
1159
|
+
def card(*, type: str = "default", id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
1160
|
+
"""
|
1161
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
1162
|
+
|
1163
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1164
|
+
|
1165
|
+
Parameters
|
1166
|
+
----------
|
1167
|
+
type : str, default 'default'
|
964
1168
|
Card type.
|
965
1169
|
id : str, optional, default None
|
966
1170
|
If multiple cards are present, use this id to identify this card.
|
@@ -1185,206 +1389,41 @@ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], Non
|
|
1185
1389
|
...
|
1186
1390
|
|
1187
1391
|
@typing.overload
|
1188
|
-
def
|
1392
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1189
1393
|
"""
|
1190
|
-
Specifies
|
1394
|
+
Specifies the PyPI packages for all steps of the flow.
|
1191
1395
|
|
1396
|
+
Use `@pypi_base` to set common packages required by all
|
1397
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1192
1398
|
Parameters
|
1193
1399
|
----------
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
memory : int, default 4096
|
1201
|
-
Memory size (in MB) required for this step. If
|
1202
|
-
`@resources` is also present, the maximum value from all decorators is
|
1203
|
-
used.
|
1204
|
-
image : str, optional, default None
|
1205
|
-
Docker image to use when launching on AWS Batch. If not specified, and
|
1206
|
-
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
1207
|
-
not, a default Docker image mapping to the current version of Python is used.
|
1208
|
-
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
1209
|
-
AWS Batch Job Queue to submit the job to.
|
1210
|
-
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
1211
|
-
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
1212
|
-
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
1213
|
-
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
1214
|
-
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
1215
|
-
shared_memory : int, optional, default None
|
1216
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
1217
|
-
This parameter maps to the `--shm-size` option in Docker.
|
1218
|
-
max_swap : int, optional, default None
|
1219
|
-
The total amount of swap memory (in MiB) a container can use for this
|
1220
|
-
step. This parameter is translated to the `--memory-swap` option in
|
1221
|
-
Docker where the value is the sum of the container memory plus the
|
1222
|
-
`max_swap` value.
|
1223
|
-
swappiness : int, optional, default None
|
1224
|
-
This allows you to tune memory swappiness behavior for this step.
|
1225
|
-
A swappiness value of 0 causes swapping not to happen unless absolutely
|
1226
|
-
necessary. A swappiness value of 100 causes pages to be swapped very
|
1227
|
-
aggressively. Accepted values are whole numbers between 0 and 100.
|
1228
|
-
use_tmpfs : bool, default False
|
1229
|
-
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
1230
|
-
not available on Fargate compute environments
|
1231
|
-
tmpfs_tempdir : bool, default True
|
1232
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
1233
|
-
tmpfs_size : int, optional, default None
|
1234
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
1235
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
1236
|
-
memory allocated for this step.
|
1237
|
-
tmpfs_path : str, optional, default None
|
1238
|
-
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
1239
|
-
inferentia : int, default 0
|
1240
|
-
Number of Inferentia chips required for this step.
|
1241
|
-
trainium : int, default None
|
1242
|
-
Alias for inferentia. Use only one of the two.
|
1243
|
-
efa : int, default 0
|
1244
|
-
Number of elastic fabric adapter network devices to attach to container
|
1245
|
-
ephemeral_storage: int, default None
|
1246
|
-
The total amount, in GiB, of ephemeral storage to set for the task (21-200)
|
1247
|
-
This is only relevant for Fargate compute environments
|
1248
|
-
log_driver: str, optional, default None
|
1249
|
-
The log driver to use for the Amazon ECS container.
|
1250
|
-
log_options: List[str], optional, default None
|
1251
|
-
List of strings containing options for the chosen log driver. The configurable values
|
1252
|
-
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
1253
|
-
Example usage: ["awslogs-group:aws/batch/job"]
|
1254
|
-
"""
|
1255
|
-
...
|
1256
|
-
|
1257
|
-
@typing.overload
|
1258
|
-
def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1259
|
-
...
|
1260
|
-
|
1261
|
-
@typing.overload
|
1262
|
-
def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1263
|
-
...
|
1264
|
-
|
1265
|
-
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):
|
1266
|
-
"""
|
1267
|
-
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
1268
|
-
|
1269
|
-
Parameters
|
1270
|
-
----------
|
1271
|
-
cpu : int, default 1
|
1272
|
-
Number of CPUs required for this step. If `@resources` is
|
1273
|
-
also present, the maximum value from all decorators is used.
|
1274
|
-
gpu : int, default 0
|
1275
|
-
Number of GPUs required for this step. If `@resources` is
|
1276
|
-
also present, the maximum value from all decorators is used.
|
1277
|
-
memory : int, default 4096
|
1278
|
-
Memory size (in MB) required for this step. If
|
1279
|
-
`@resources` is also present, the maximum value from all decorators is
|
1280
|
-
used.
|
1281
|
-
image : str, optional, default None
|
1282
|
-
Docker image to use when launching on AWS Batch. If not specified, and
|
1283
|
-
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
1284
|
-
not, a default Docker image mapping to the current version of Python is used.
|
1285
|
-
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
1286
|
-
AWS Batch Job Queue to submit the job to.
|
1287
|
-
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
1288
|
-
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
1289
|
-
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
1290
|
-
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
1291
|
-
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
1292
|
-
shared_memory : int, optional, default None
|
1293
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
1294
|
-
This parameter maps to the `--shm-size` option in Docker.
|
1295
|
-
max_swap : int, optional, default None
|
1296
|
-
The total amount of swap memory (in MiB) a container can use for this
|
1297
|
-
step. This parameter is translated to the `--memory-swap` option in
|
1298
|
-
Docker where the value is the sum of the container memory plus the
|
1299
|
-
`max_swap` value.
|
1300
|
-
swappiness : int, optional, default None
|
1301
|
-
This allows you to tune memory swappiness behavior for this step.
|
1302
|
-
A swappiness value of 0 causes swapping not to happen unless absolutely
|
1303
|
-
necessary. A swappiness value of 100 causes pages to be swapped very
|
1304
|
-
aggressively. Accepted values are whole numbers between 0 and 100.
|
1305
|
-
use_tmpfs : bool, default False
|
1306
|
-
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
1307
|
-
not available on Fargate compute environments
|
1308
|
-
tmpfs_tempdir : bool, default True
|
1309
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
1310
|
-
tmpfs_size : int, optional, default None
|
1311
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
1312
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
1313
|
-
memory allocated for this step.
|
1314
|
-
tmpfs_path : str, optional, default None
|
1315
|
-
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
1316
|
-
inferentia : int, default 0
|
1317
|
-
Number of Inferentia chips required for this step.
|
1318
|
-
trainium : int, default None
|
1319
|
-
Alias for inferentia. Use only one of the two.
|
1320
|
-
efa : int, default 0
|
1321
|
-
Number of elastic fabric adapter network devices to attach to container
|
1322
|
-
ephemeral_storage: int, default None
|
1323
|
-
The total amount, in GiB, of ephemeral storage to set for the task (21-200)
|
1324
|
-
This is only relevant for Fargate compute environments
|
1325
|
-
log_driver: str, optional, default None
|
1326
|
-
The log driver to use for the Amazon ECS container.
|
1327
|
-
log_options: List[str], optional, default None
|
1328
|
-
List of strings containing options for the chosen log driver. The configurable values
|
1329
|
-
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
1330
|
-
Example usage: ["awslogs-group:aws/batch/job"]
|
1331
|
-
"""
|
1332
|
-
...
|
1333
|
-
|
1334
|
-
@typing.overload
|
1335
|
-
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]]]:
|
1336
|
-
"""
|
1337
|
-
Specifies a timeout for your step.
|
1338
|
-
|
1339
|
-
This decorator is useful if this step may hang indefinitely.
|
1340
|
-
|
1341
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
1342
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
1343
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
1344
|
-
|
1345
|
-
Note that all the values specified in parameters are added together so if you specify
|
1346
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
1347
|
-
|
1348
|
-
Parameters
|
1349
|
-
----------
|
1350
|
-
seconds : int, default 0
|
1351
|
-
Number of seconds to wait prior to timing out.
|
1352
|
-
minutes : int, default 0
|
1353
|
-
Number of minutes to wait prior to timing out.
|
1354
|
-
hours : int, default 0
|
1355
|
-
Number of hours to wait prior to timing out.
|
1400
|
+
packages : Dict[str, str], default: {}
|
1401
|
+
Packages to use for this flow. The key is the name of the package
|
1402
|
+
and the value is the version to use.
|
1403
|
+
python : str, optional, default: None
|
1404
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1405
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1356
1406
|
"""
|
1357
1407
|
...
|
1358
1408
|
|
1359
1409
|
@typing.overload
|
1360
|
-
def
|
1361
|
-
...
|
1362
|
-
|
1363
|
-
@typing.overload
|
1364
|
-
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1410
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1365
1411
|
...
|
1366
1412
|
|
1367
|
-
def
|
1413
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1368
1414
|
"""
|
1369
|
-
Specifies
|
1370
|
-
|
1371
|
-
This decorator is useful if this step may hang indefinitely.
|
1372
|
-
|
1373
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
1374
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
1375
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
1376
|
-
|
1377
|
-
Note that all the values specified in parameters are added together so if you specify
|
1378
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
1415
|
+
Specifies the PyPI packages for all steps of the flow.
|
1379
1416
|
|
1417
|
+
Use `@pypi_base` to set common packages required by all
|
1418
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1380
1419
|
Parameters
|
1381
1420
|
----------
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1421
|
+
packages : Dict[str, str], default: {}
|
1422
|
+
Packages to use for this flow. The key is the name of the package
|
1423
|
+
and the value is the version to use.
|
1424
|
+
python : str, optional, default: None
|
1425
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1426
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1388
1427
|
"""
|
1389
1428
|
...
|
1390
1429
|
|
@@ -1532,63 +1571,6 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
|
|
1532
1571
|
"""
|
1533
1572
|
...
|
1534
1573
|
|
1535
|
-
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1536
|
-
"""
|
1537
|
-
Specifies what flows belong to the same project.
|
1538
|
-
|
1539
|
-
A project-specific namespace is created for all flows that
|
1540
|
-
use the same `@project(name)`.
|
1541
|
-
|
1542
|
-
Parameters
|
1543
|
-
----------
|
1544
|
-
name : str
|
1545
|
-
Project name. Make sure that the name is unique amongst all
|
1546
|
-
projects that use the same production scheduler. The name may
|
1547
|
-
contain only lowercase alphanumeric characters and underscores.
|
1548
|
-
|
1549
|
-
|
1550
|
-
"""
|
1551
|
-
...
|
1552
|
-
|
1553
|
-
@typing.overload
|
1554
|
-
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1555
|
-
"""
|
1556
|
-
Specifies the PyPI packages for all steps of the flow.
|
1557
|
-
|
1558
|
-
Use `@pypi_base` to set common packages required by all
|
1559
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1560
|
-
Parameters
|
1561
|
-
----------
|
1562
|
-
packages : Dict[str, str], default: {}
|
1563
|
-
Packages to use for this flow. The key is the name of the package
|
1564
|
-
and the value is the version to use.
|
1565
|
-
python : str, optional, default: None
|
1566
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1567
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1568
|
-
"""
|
1569
|
-
...
|
1570
|
-
|
1571
|
-
@typing.overload
|
1572
|
-
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1573
|
-
...
|
1574
|
-
|
1575
|
-
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1576
|
-
"""
|
1577
|
-
Specifies the PyPI packages for all steps of the flow.
|
1578
|
-
|
1579
|
-
Use `@pypi_base` to set common packages required by all
|
1580
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1581
|
-
Parameters
|
1582
|
-
----------
|
1583
|
-
packages : Dict[str, str], default: {}
|
1584
|
-
Packages to use for this flow. The key is the name of the package
|
1585
|
-
and the value is the version to use.
|
1586
|
-
python : str, optional, default: None
|
1587
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1588
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1589
|
-
"""
|
1590
|
-
...
|
1591
|
-
|
1592
1574
|
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]]:
|
1593
1575
|
"""
|
1594
1576
|
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.
|
@@ -1631,97 +1613,6 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
|
|
1631
1613
|
"""
|
1632
1614
|
...
|
1633
1615
|
|
1634
|
-
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]]:
|
1635
|
-
"""
|
1636
|
-
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)
|
1637
|
-
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1638
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1639
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1640
|
-
starts only after all sensors finish.
|
1641
|
-
|
1642
|
-
Parameters
|
1643
|
-
----------
|
1644
|
-
timeout : int
|
1645
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
1646
|
-
poke_interval : int
|
1647
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
1648
|
-
mode : str
|
1649
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1650
|
-
exponential_backoff : bool
|
1651
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1652
|
-
pool : str
|
1653
|
-
the slot pool this task should run in,
|
1654
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1655
|
-
soft_fail : bool
|
1656
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1657
|
-
name : str
|
1658
|
-
Name of the sensor on Airflow
|
1659
|
-
description : str
|
1660
|
-
Description of sensor in the Airflow UI
|
1661
|
-
bucket_key : Union[str, List[str]]
|
1662
|
-
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1663
|
-
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1664
|
-
bucket_name : str
|
1665
|
-
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1666
|
-
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1667
|
-
wildcard_match : bool
|
1668
|
-
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1669
|
-
aws_conn_id : str
|
1670
|
-
a reference to the s3 connection on Airflow. (Default: None)
|
1671
|
-
verify : bool
|
1672
|
-
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1673
|
-
"""
|
1674
|
-
...
|
1675
|
-
|
1676
|
-
@typing.overload
|
1677
|
-
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]]:
|
1678
|
-
"""
|
1679
|
-
Specifies the Conda environment for all steps of the flow.
|
1680
|
-
|
1681
|
-
Use `@conda_base` to set common libraries required by all
|
1682
|
-
steps and use `@conda` to specify step-specific additions.
|
1683
|
-
|
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
|
-
libraries : Dict[str, str], default {}
|
1690
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1691
|
-
python : str, optional, default None
|
1692
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1693
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1694
|
-
disabled : bool, default False
|
1695
|
-
If set to True, disables Conda.
|
1696
|
-
"""
|
1697
|
-
...
|
1698
|
-
|
1699
|
-
@typing.overload
|
1700
|
-
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1701
|
-
...
|
1702
|
-
|
1703
|
-
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):
|
1704
|
-
"""
|
1705
|
-
Specifies the Conda environment for all steps of the flow.
|
1706
|
-
|
1707
|
-
Use `@conda_base` to set common libraries required by all
|
1708
|
-
steps and use `@conda` to specify step-specific additions.
|
1709
|
-
|
1710
|
-
Parameters
|
1711
|
-
----------
|
1712
|
-
packages : Dict[str, str], default {}
|
1713
|
-
Packages to use for this flow. The key is the name of the package
|
1714
|
-
and the value is the version to use.
|
1715
|
-
libraries : Dict[str, str], default {}
|
1716
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1717
|
-
python : str, optional, default None
|
1718
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1719
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1720
|
-
disabled : bool, default False
|
1721
|
-
If set to True, disables Conda.
|
1722
|
-
"""
|
1723
|
-
...
|
1724
|
-
|
1725
1616
|
@typing.overload
|
1726
1617
|
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]]:
|
1727
1618
|
"""
|
@@ -1825,6 +1716,115 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
1825
1716
|
"""
|
1826
1717
|
...
|
1827
1718
|
|
1719
|
+
@typing.overload
|
1720
|
+
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]]:
|
1721
|
+
"""
|
1722
|
+
Specifies the Conda environment for all steps of the flow.
|
1723
|
+
|
1724
|
+
Use `@conda_base` to set common libraries required by all
|
1725
|
+
steps and use `@conda` to specify step-specific additions.
|
1726
|
+
|
1727
|
+
Parameters
|
1728
|
+
----------
|
1729
|
+
packages : Dict[str, str], default {}
|
1730
|
+
Packages to use for this flow. The key is the name of the package
|
1731
|
+
and the value is the version to use.
|
1732
|
+
libraries : Dict[str, str], default {}
|
1733
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1734
|
+
python : str, optional, default None
|
1735
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1736
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1737
|
+
disabled : bool, default False
|
1738
|
+
If set to True, disables Conda.
|
1739
|
+
"""
|
1740
|
+
...
|
1741
|
+
|
1742
|
+
@typing.overload
|
1743
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1744
|
+
...
|
1745
|
+
|
1746
|
+
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):
|
1747
|
+
"""
|
1748
|
+
Specifies the Conda environment for all steps of the flow.
|
1749
|
+
|
1750
|
+
Use `@conda_base` to set common libraries required by all
|
1751
|
+
steps and use `@conda` to specify step-specific additions.
|
1752
|
+
|
1753
|
+
Parameters
|
1754
|
+
----------
|
1755
|
+
packages : Dict[str, str], default {}
|
1756
|
+
Packages to use for this flow. The key is the name of the package
|
1757
|
+
and the value is the version to use.
|
1758
|
+
libraries : Dict[str, str], default {}
|
1759
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1760
|
+
python : str, optional, default None
|
1761
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1762
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1763
|
+
disabled : bool, default False
|
1764
|
+
If set to True, disables Conda.
|
1765
|
+
"""
|
1766
|
+
...
|
1767
|
+
|
1768
|
+
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]]:
|
1769
|
+
"""
|
1770
|
+
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)
|
1771
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1772
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1773
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1774
|
+
starts only after all sensors finish.
|
1775
|
+
|
1776
|
+
Parameters
|
1777
|
+
----------
|
1778
|
+
timeout : int
|
1779
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1780
|
+
poke_interval : int
|
1781
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1782
|
+
mode : str
|
1783
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1784
|
+
exponential_backoff : bool
|
1785
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1786
|
+
pool : str
|
1787
|
+
the slot pool this task should run in,
|
1788
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1789
|
+
soft_fail : bool
|
1790
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1791
|
+
name : str
|
1792
|
+
Name of the sensor on Airflow
|
1793
|
+
description : str
|
1794
|
+
Description of sensor in the Airflow UI
|
1795
|
+
bucket_key : Union[str, List[str]]
|
1796
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1797
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1798
|
+
bucket_name : str
|
1799
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1800
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1801
|
+
wildcard_match : bool
|
1802
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1803
|
+
aws_conn_id : str
|
1804
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1805
|
+
verify : bool
|
1806
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1807
|
+
"""
|
1808
|
+
...
|
1809
|
+
|
1810
|
+
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1811
|
+
"""
|
1812
|
+
Specifies what flows belong to the same project.
|
1813
|
+
|
1814
|
+
A project-specific namespace is created for all flows that
|
1815
|
+
use the same `@project(name)`.
|
1816
|
+
|
1817
|
+
Parameters
|
1818
|
+
----------
|
1819
|
+
name : str
|
1820
|
+
Project name. Make sure that the name is unique amongst all
|
1821
|
+
projects that use the same production scheduler. The name may
|
1822
|
+
contain only lowercase alphanumeric characters and underscores.
|
1823
|
+
|
1824
|
+
|
1825
|
+
"""
|
1826
|
+
...
|
1827
|
+
|
1828
1828
|
def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
|
1829
1829
|
"""
|
1830
1830
|
Switch namespace to the one provided.
|