ob-metaflow-stubs 3.1__py2.py3-none-any.whl → 3.2__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 +387 -387
- metaflow-stubs/cards.pyi +5 -5
- metaflow-stubs/cli.pyi +3 -3
- metaflow-stubs/client/__init__.pyi +3 -3
- metaflow-stubs/client/core.pyi +7 -7
- metaflow-stubs/client/filecache.pyi +2 -2
- metaflow-stubs/clone_util.pyi +2 -2
- 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 +10 -2
- metaflow-stubs/metaflow_current.pyi +5 -5
- metaflow-stubs/mflog/mflog.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/parameters.pyi +4 -4
- metaflow-stubs/plugins/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_cli.pyi +4 -4
- 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 +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +4 -4
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
- 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 +4 -4
- 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_credential.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
- metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/cards/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_cli.pyi +5 -5
- metaflow-stubs/plugins/cards/card_client.pyi +2 -2
- metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
- metaflow-stubs/plugins/cards/card_decorator.pyi +3 -3
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +5 -5
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +4 -4
- 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 +4 -4
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
- metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +10 -4
- metaflow-stubs/plugins/package_cli.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
- metaflow-stubs/plugins/perimeters.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 +2 -2
- metaflow-stubs/plugins/pypi/utils.pyi +2 -2
- metaflow-stubs/plugins/resources_decorator.pyi +2 -2
- metaflow-stubs/plugins/retry_decorator.pyi +2 -2
- metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
- metaflow-stubs/plugins/storage_executor.pyi +2 -2
- metaflow-stubs/plugins/tag_cli.pyi +5 -5
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
- metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
- metaflow-stubs/procpoll.pyi +2 -2
- metaflow-stubs/profilers/__init__.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- {ob_metaflow_stubs-3.1.dist-info → ob_metaflow_stubs-3.2.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-3.2.dist-info/RECORD +134 -0
- ob_metaflow_stubs-3.1.dist-info/RECORD +0 -134
- {ob_metaflow_stubs-3.1.dist-info → ob_metaflow_stubs-3.2.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-3.1.dist-info → ob_metaflow_stubs-3.2.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.1+ob(v1) #
|
4
|
+
# Generated on 2024-05-07T00:05:40.513974 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
|
-
import
|
11
|
+
import io
|
12
12
|
import metaflow.parameters
|
13
|
-
import metaflow.metaflow_current
|
14
13
|
import datetime
|
15
|
-
import metaflow._vendor.click.types
|
16
|
-
import metaflow.events
|
17
14
|
import typing
|
18
|
-
import
|
19
|
-
import metaflow.datastore.inputs
|
15
|
+
import metaflow.events
|
20
16
|
import metaflow.plugins.datatools.s3.s3
|
17
|
+
import metaflow.datastore.inputs
|
18
|
+
import metaflow.metaflow_current
|
19
|
+
import metaflow.client.core
|
20
|
+
import metaflow._vendor.click.types
|
21
21
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
22
22
|
StepFlag = typing.NewType("StepFlag", bool)
|
23
23
|
|
@@ -782,59 +782,6 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
782
782
|
"""
|
783
783
|
...
|
784
784
|
|
785
|
-
@typing.overload
|
786
|
-
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]]]:
|
787
|
-
"""
|
788
|
-
Specifies the number of times the task corresponding
|
789
|
-
to a step needs to be retried.
|
790
|
-
|
791
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
792
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
793
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
794
|
-
|
795
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
796
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
797
|
-
ensuring that the flow execution can continue.
|
798
|
-
|
799
|
-
Parameters
|
800
|
-
----------
|
801
|
-
times : int, default 3
|
802
|
-
Number of times to retry this task.
|
803
|
-
minutes_between_retries : int, default 2
|
804
|
-
Number of minutes between retries.
|
805
|
-
"""
|
806
|
-
...
|
807
|
-
|
808
|
-
@typing.overload
|
809
|
-
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
810
|
-
...
|
811
|
-
|
812
|
-
@typing.overload
|
813
|
-
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
814
|
-
...
|
815
|
-
|
816
|
-
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):
|
817
|
-
"""
|
818
|
-
Specifies the number of times the task corresponding
|
819
|
-
to a step needs to be retried.
|
820
|
-
|
821
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
822
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
823
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
824
|
-
|
825
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
826
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
827
|
-
ensuring that the flow execution can continue.
|
828
|
-
|
829
|
-
Parameters
|
830
|
-
----------
|
831
|
-
times : int, default 3
|
832
|
-
Number of times to retry this task.
|
833
|
-
minutes_between_retries : int, default 2
|
834
|
-
Number of minutes between retries.
|
835
|
-
"""
|
836
|
-
...
|
837
|
-
|
838
785
|
@typing.overload
|
839
786
|
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]]]:
|
840
787
|
"""
|
@@ -913,139 +860,135 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
913
860
|
...
|
914
861
|
|
915
862
|
@typing.overload
|
916
|
-
def
|
863
|
+
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]]]:
|
917
864
|
"""
|
918
|
-
Specifies the
|
865
|
+
Specifies the number of times the task corresponding
|
866
|
+
to a step needs to be retried.
|
919
867
|
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
868
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
869
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
870
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
871
|
+
|
872
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
873
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
874
|
+
ensuring that the flow execution can continue.
|
924
875
|
|
925
876
|
Parameters
|
926
877
|
----------
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
932
|
-
python : str, optional, default None
|
933
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
934
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
935
|
-
disabled : bool, default False
|
936
|
-
If set to True, disables @conda.
|
878
|
+
times : int, default 3
|
879
|
+
Number of times to retry this task.
|
880
|
+
minutes_between_retries : int, default 2
|
881
|
+
Number of minutes between retries.
|
937
882
|
"""
|
938
883
|
...
|
939
884
|
|
940
885
|
@typing.overload
|
941
|
-
def
|
886
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
942
887
|
...
|
943
888
|
|
944
889
|
@typing.overload
|
945
|
-
def
|
890
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
946
891
|
...
|
947
892
|
|
948
|
-
def
|
893
|
+
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):
|
949
894
|
"""
|
950
|
-
Specifies the
|
895
|
+
Specifies the number of times the task corresponding
|
896
|
+
to a step needs to be retried.
|
951
897
|
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
898
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
899
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
900
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
901
|
+
|
902
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
903
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
904
|
+
ensuring that the flow execution can continue.
|
956
905
|
|
957
906
|
Parameters
|
958
907
|
----------
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
964
|
-
python : str, optional, default None
|
965
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
966
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
967
|
-
disabled : bool, default False
|
968
|
-
If set to True, disables @conda.
|
908
|
+
times : int, default 3
|
909
|
+
Number of times to retry this task.
|
910
|
+
minutes_between_retries : int, default 2
|
911
|
+
Number of minutes between retries.
|
969
912
|
"""
|
970
913
|
...
|
971
914
|
|
972
915
|
@typing.overload
|
973
|
-
def
|
916
|
+
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]]]:
|
974
917
|
"""
|
975
|
-
Specifies
|
976
|
-
|
977
|
-
Information in this decorator will augment any
|
978
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
979
|
-
you can use `@pypi_base` to set packages required by all
|
980
|
-
steps and use `@pypi` to specify step-specific overrides.
|
918
|
+
Specifies environment variables to be set prior to the execution of a step.
|
981
919
|
|
982
920
|
Parameters
|
983
921
|
----------
|
984
|
-
|
985
|
-
|
986
|
-
and the value is the version to use.
|
987
|
-
python : str, optional, default: None
|
988
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
989
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
922
|
+
vars : Dict[str, str], default {}
|
923
|
+
Dictionary of environment variables to set.
|
990
924
|
"""
|
991
925
|
...
|
992
926
|
|
993
927
|
@typing.overload
|
994
|
-
def
|
928
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
995
929
|
...
|
996
930
|
|
997
931
|
@typing.overload
|
998
|
-
def
|
932
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
999
933
|
...
|
1000
934
|
|
1001
|
-
def
|
935
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
1002
936
|
"""
|
1003
|
-
Specifies
|
1004
|
-
|
1005
|
-
Information in this decorator will augment any
|
1006
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1007
|
-
you can use `@pypi_base` to set packages required by all
|
1008
|
-
steps and use `@pypi` to specify step-specific overrides.
|
937
|
+
Specifies environment variables to be set prior to the execution of a step.
|
1009
938
|
|
1010
939
|
Parameters
|
1011
940
|
----------
|
1012
|
-
|
1013
|
-
|
1014
|
-
and the value is the version to use.
|
1015
|
-
python : str, optional, default: None
|
1016
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1017
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
941
|
+
vars : Dict[str, str], default {}
|
942
|
+
Dictionary of environment variables to set.
|
1018
943
|
"""
|
1019
944
|
...
|
1020
945
|
|
1021
946
|
@typing.overload
|
1022
|
-
def
|
947
|
+
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]]]:
|
1023
948
|
"""
|
1024
|
-
Specifies
|
949
|
+
Specifies that the step will success under all circumstances.
|
950
|
+
|
951
|
+
The decorator will create an optional artifact, specified by `var`, which
|
952
|
+
contains the exception raised. You can use it to detect the presence
|
953
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
954
|
+
are missing.
|
1025
955
|
|
1026
956
|
Parameters
|
1027
957
|
----------
|
1028
|
-
|
1029
|
-
|
958
|
+
var : str, optional, default None
|
959
|
+
Name of the artifact in which to store the caught exception.
|
960
|
+
If not specified, the exception is not stored.
|
961
|
+
print_exception : bool, default True
|
962
|
+
Determines whether or not the exception is printed to
|
963
|
+
stdout when caught.
|
1030
964
|
"""
|
1031
965
|
...
|
1032
966
|
|
1033
967
|
@typing.overload
|
1034
|
-
def
|
968
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1035
969
|
...
|
1036
970
|
|
1037
971
|
@typing.overload
|
1038
|
-
def
|
972
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1039
973
|
...
|
1040
974
|
|
1041
|
-
def
|
975
|
+
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):
|
1042
976
|
"""
|
1043
|
-
Specifies
|
977
|
+
Specifies that the step will success under all circumstances.
|
978
|
+
|
979
|
+
The decorator will create an optional artifact, specified by `var`, which
|
980
|
+
contains the exception raised. You can use it to detect the presence
|
981
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
982
|
+
are missing.
|
1044
983
|
|
1045
984
|
Parameters
|
1046
985
|
----------
|
1047
|
-
|
1048
|
-
|
986
|
+
var : str, optional, default None
|
987
|
+
Name of the artifact in which to store the caught exception.
|
988
|
+
If not specified, the exception is not stored.
|
989
|
+
print_exception : bool, default True
|
990
|
+
Determines whether or not the exception is printed to
|
991
|
+
stdout when caught.
|
1049
992
|
"""
|
1050
993
|
...
|
1051
994
|
|
@@ -1109,182 +1052,108 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
|
|
1109
1052
|
...
|
1110
1053
|
|
1111
1054
|
@typing.overload
|
1112
|
-
def
|
1055
|
+
def pypi(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
1113
1056
|
"""
|
1114
|
-
Specifies
|
1057
|
+
Specifies the PyPI packages for the step.
|
1058
|
+
|
1059
|
+
Information in this decorator will augment any
|
1060
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1061
|
+
you can use `@pypi_base` to set packages required by all
|
1062
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1115
1063
|
|
1116
1064
|
Parameters
|
1117
1065
|
----------
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
memory : int, default 4096
|
1125
|
-
Memory size (in MB) required for this step. If
|
1126
|
-
`@resources` is also present, the maximum value from all decorators is
|
1127
|
-
used.
|
1128
|
-
image : str, optional, default None
|
1129
|
-
Docker image to use when launching on AWS Batch. If not specified, and
|
1130
|
-
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
1131
|
-
not, a default Docker image mapping to the current version of Python is used.
|
1132
|
-
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
1133
|
-
AWS Batch Job Queue to submit the job to.
|
1134
|
-
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
1135
|
-
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
1136
|
-
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
1137
|
-
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
1138
|
-
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
1139
|
-
shared_memory : int, optional, default None
|
1140
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
1141
|
-
This parameter maps to the `--shm-size` option in Docker.
|
1142
|
-
max_swap : int, optional, default None
|
1143
|
-
The total amount of swap memory (in MiB) a container can use for this
|
1144
|
-
step. This parameter is translated to the `--memory-swap` option in
|
1145
|
-
Docker where the value is the sum of the container memory plus the
|
1146
|
-
`max_swap` value.
|
1147
|
-
swappiness : int, optional, default None
|
1148
|
-
This allows you to tune memory swappiness behavior for this step.
|
1149
|
-
A swappiness value of 0 causes swapping not to happen unless absolutely
|
1150
|
-
necessary. A swappiness value of 100 causes pages to be swapped very
|
1151
|
-
aggressively. Accepted values are whole numbers between 0 and 100.
|
1152
|
-
use_tmpfs : bool, default False
|
1153
|
-
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
1154
|
-
not available on Fargate compute environments
|
1155
|
-
tmpfs_tempdir : bool, default True
|
1156
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
1157
|
-
tmpfs_size : int, optional, default None
|
1158
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
1159
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
1160
|
-
memory allocated for this step.
|
1161
|
-
tmpfs_path : str, optional, default None
|
1162
|
-
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
1163
|
-
inferentia : int, default 0
|
1164
|
-
Number of Inferentia chips required for this step.
|
1165
|
-
trainium : int, default None
|
1166
|
-
Alias for inferentia. Use only one of the two.
|
1167
|
-
efa : int, default 0
|
1168
|
-
Number of elastic fabric adapter network devices to attach to container
|
1169
|
-
ephemeral_storage: int, default None
|
1170
|
-
The total amount, in GiB, of ephemeral storage to set for the task (21-200)
|
1171
|
-
This is only relevant for Fargate compute environments
|
1172
|
-
log_driver: str, optional, default None
|
1173
|
-
The log driver to use for the Amazon ECS container.
|
1174
|
-
log_options: List[str], optional, default None
|
1175
|
-
List of strings containing options for the chosen log driver. The configurable values
|
1176
|
-
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
1177
|
-
Example usage: ["awslogs-group:aws/batch/job"]
|
1066
|
+
packages : Dict[str, str], default: {}
|
1067
|
+
Packages to use for this step. The key is the name of the package
|
1068
|
+
and the value is the version to use.
|
1069
|
+
python : str, optional, default: None
|
1070
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1071
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1178
1072
|
"""
|
1179
1073
|
...
|
1180
1074
|
|
1181
1075
|
@typing.overload
|
1182
|
-
def
|
1076
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1183
1077
|
...
|
1184
1078
|
|
1185
1079
|
@typing.overload
|
1186
|
-
def
|
1080
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1187
1081
|
...
|
1188
1082
|
|
1189
|
-
def
|
1083
|
+
def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1190
1084
|
"""
|
1191
|
-
Specifies
|
1085
|
+
Specifies the PyPI packages for the step.
|
1086
|
+
|
1087
|
+
Information in this decorator will augment any
|
1088
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1089
|
+
you can use `@pypi_base` to set packages required by all
|
1090
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1192
1091
|
|
1193
1092
|
Parameters
|
1194
1093
|
----------
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
memory : int, default 4096
|
1202
|
-
Memory size (in MB) required for this step. If
|
1203
|
-
`@resources` is also present, the maximum value from all decorators is
|
1204
|
-
used.
|
1205
|
-
image : str, optional, default None
|
1206
|
-
Docker image to use when launching on AWS Batch. If not specified, and
|
1207
|
-
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
1208
|
-
not, a default Docker image mapping to the current version of Python is used.
|
1209
|
-
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
1210
|
-
AWS Batch Job Queue to submit the job to.
|
1211
|
-
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
1212
|
-
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
1213
|
-
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
1214
|
-
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
1215
|
-
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
1216
|
-
shared_memory : int, optional, default None
|
1217
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
1218
|
-
This parameter maps to the `--shm-size` option in Docker.
|
1219
|
-
max_swap : int, optional, default None
|
1220
|
-
The total amount of swap memory (in MiB) a container can use for this
|
1221
|
-
step. This parameter is translated to the `--memory-swap` option in
|
1222
|
-
Docker where the value is the sum of the container memory plus the
|
1223
|
-
`max_swap` value.
|
1224
|
-
swappiness : int, optional, default None
|
1225
|
-
This allows you to tune memory swappiness behavior for this step.
|
1226
|
-
A swappiness value of 0 causes swapping not to happen unless absolutely
|
1227
|
-
necessary. A swappiness value of 100 causes pages to be swapped very
|
1228
|
-
aggressively. Accepted values are whole numbers between 0 and 100.
|
1229
|
-
use_tmpfs : bool, default False
|
1230
|
-
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
1231
|
-
not available on Fargate compute environments
|
1232
|
-
tmpfs_tempdir : bool, default True
|
1233
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
1234
|
-
tmpfs_size : int, optional, default None
|
1235
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
1236
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
1237
|
-
memory allocated for this step.
|
1238
|
-
tmpfs_path : str, optional, default None
|
1239
|
-
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
1240
|
-
inferentia : int, default 0
|
1241
|
-
Number of Inferentia chips required for this step.
|
1242
|
-
trainium : int, default None
|
1243
|
-
Alias for inferentia. Use only one of the two.
|
1244
|
-
efa : int, default 0
|
1245
|
-
Number of elastic fabric adapter network devices to attach to container
|
1246
|
-
ephemeral_storage: int, default None
|
1247
|
-
The total amount, in GiB, of ephemeral storage to set for the task (21-200)
|
1248
|
-
This is only relevant for Fargate compute environments
|
1249
|
-
log_driver: str, optional, default None
|
1250
|
-
The log driver to use for the Amazon ECS container.
|
1251
|
-
log_options: List[str], optional, default None
|
1252
|
-
List of strings containing options for the chosen log driver. The configurable values
|
1253
|
-
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
1254
|
-
Example usage: ["awslogs-group:aws/batch/job"]
|
1094
|
+
packages : Dict[str, str], default: {}
|
1095
|
+
Packages to use for this step. The key is the name of the package
|
1096
|
+
and the value is the version to use.
|
1097
|
+
python : str, optional, default: None
|
1098
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1099
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1255
1100
|
"""
|
1256
1101
|
...
|
1257
1102
|
|
1258
1103
|
@typing.overload
|
1259
|
-
def
|
1104
|
+
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]]]:
|
1260
1105
|
"""
|
1261
|
-
Specifies
|
1262
|
-
|
1106
|
+
Specifies the Conda environment for the step.
|
1107
|
+
|
1108
|
+
Information in this decorator will augment any
|
1109
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
1110
|
+
you can use `@conda_base` to set packages required by all
|
1111
|
+
steps and use `@conda` to specify step-specific overrides.
|
1263
1112
|
|
1264
1113
|
Parameters
|
1265
1114
|
----------
|
1266
|
-
|
1267
|
-
|
1115
|
+
packages : Dict[str, str], default {}
|
1116
|
+
Packages to use for this step. The key is the name of the package
|
1117
|
+
and the value is the version to use.
|
1118
|
+
libraries : Dict[str, str], default {}
|
1119
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1120
|
+
python : str, optional, default None
|
1121
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1122
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1123
|
+
disabled : bool, default False
|
1124
|
+
If set to True, disables @conda.
|
1268
1125
|
"""
|
1269
1126
|
...
|
1270
1127
|
|
1271
1128
|
@typing.overload
|
1272
|
-
def
|
1129
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1273
1130
|
...
|
1274
1131
|
|
1275
1132
|
@typing.overload
|
1276
|
-
def
|
1133
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1277
1134
|
...
|
1278
1135
|
|
1279
|
-
def
|
1136
|
+
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):
|
1280
1137
|
"""
|
1281
|
-
Specifies
|
1282
|
-
|
1138
|
+
Specifies the Conda environment for the step.
|
1139
|
+
|
1140
|
+
Information in this decorator will augment any
|
1141
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
1142
|
+
you can use `@conda_base` to set packages required by all
|
1143
|
+
steps and use `@conda` to specify step-specific overrides.
|
1283
1144
|
|
1284
1145
|
Parameters
|
1285
1146
|
----------
|
1286
|
-
|
1287
|
-
|
1147
|
+
packages : Dict[str, str], default {}
|
1148
|
+
Packages to use for this step. The key is the name of the package
|
1149
|
+
and the value is the version to use.
|
1150
|
+
libraries : Dict[str, str], default {}
|
1151
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1152
|
+
python : str, optional, default None
|
1153
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1154
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1155
|
+
disabled : bool, default False
|
1156
|
+
If set to True, disables @conda.
|
1288
1157
|
"""
|
1289
1158
|
...
|
1290
1159
|
|
@@ -1340,135 +1209,182 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
|
|
1340
1209
|
...
|
1341
1210
|
|
1342
1211
|
@typing.overload
|
1343
|
-
def
|
1212
|
+
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]]]:
|
1344
1213
|
"""
|
1345
|
-
Specifies
|
1346
|
-
|
1347
|
-
The decorator will create an optional artifact, specified by `var`, which
|
1348
|
-
contains the exception raised. You can use it to detect the presence
|
1349
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
1350
|
-
are missing.
|
1214
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
1215
|
+
the execution of a step.
|
1351
1216
|
|
1352
1217
|
Parameters
|
1353
1218
|
----------
|
1354
|
-
|
1355
|
-
|
1356
|
-
If not specified, the exception is not stored.
|
1357
|
-
print_exception : bool, default True
|
1358
|
-
Determines whether or not the exception is printed to
|
1359
|
-
stdout when caught.
|
1219
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
1220
|
+
List of secret specs, defining how the secrets are to be retrieved
|
1360
1221
|
"""
|
1361
1222
|
...
|
1362
1223
|
|
1363
1224
|
@typing.overload
|
1364
|
-
def
|
1225
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1365
1226
|
...
|
1366
1227
|
|
1367
1228
|
@typing.overload
|
1368
|
-
def
|
1229
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1369
1230
|
...
|
1370
1231
|
|
1371
|
-
def
|
1232
|
+
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]]] = []):
|
1372
1233
|
"""
|
1373
|
-
Specifies
|
1374
|
-
|
1375
|
-
The decorator will create an optional artifact, specified by `var`, which
|
1376
|
-
contains the exception raised. You can use it to detect the presence
|
1377
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
1378
|
-
are missing.
|
1234
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
1235
|
+
the execution of a step.
|
1379
1236
|
|
1380
1237
|
Parameters
|
1381
1238
|
----------
|
1382
|
-
|
1383
|
-
|
1384
|
-
If not specified, the exception is not stored.
|
1385
|
-
print_exception : bool, default True
|
1386
|
-
Determines whether or not the exception is printed to
|
1387
|
-
stdout when caught.
|
1239
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
1240
|
+
List of secret specs, defining how the secrets are to be retrieved
|
1388
1241
|
"""
|
1389
1242
|
...
|
1390
1243
|
|
1391
|
-
|
1244
|
+
@typing.overload
|
1245
|
+
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]]]:
|
1392
1246
|
"""
|
1393
|
-
|
1394
|
-
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1395
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1396
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1397
|
-
starts only after all sensors finish.
|
1247
|
+
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
1398
1248
|
|
1399
1249
|
Parameters
|
1400
1250
|
----------
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
|
1406
|
-
|
1407
|
-
|
1408
|
-
|
1409
|
-
|
1410
|
-
|
1411
|
-
|
1412
|
-
|
1413
|
-
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1251
|
+
cpu : int, default 1
|
1252
|
+
Number of CPUs required for this step. If `@resources` is
|
1253
|
+
also present, the maximum value from all decorators is used.
|
1254
|
+
gpu : int, default 0
|
1255
|
+
Number of GPUs required for this step. If `@resources` is
|
1256
|
+
also present, the maximum value from all decorators is used.
|
1257
|
+
memory : int, default 4096
|
1258
|
+
Memory size (in MB) required for this step. If
|
1259
|
+
`@resources` is also present, the maximum value from all decorators is
|
1260
|
+
used.
|
1261
|
+
image : str, optional, default None
|
1262
|
+
Docker image to use when launching on AWS Batch. If not specified, and
|
1263
|
+
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
1264
|
+
not, a default Docker image mapping to the current version of Python is used.
|
1265
|
+
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
1266
|
+
AWS Batch Job Queue to submit the job to.
|
1267
|
+
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
1268
|
+
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
1269
|
+
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
1270
|
+
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
1271
|
+
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
1272
|
+
shared_memory : int, optional, default None
|
1273
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
1274
|
+
This parameter maps to the `--shm-size` option in Docker.
|
1275
|
+
max_swap : int, optional, default None
|
1276
|
+
The total amount of swap memory (in MiB) a container can use for this
|
1277
|
+
step. This parameter is translated to the `--memory-swap` option in
|
1278
|
+
Docker where the value is the sum of the container memory plus the
|
1279
|
+
`max_swap` value.
|
1280
|
+
swappiness : int, optional, default None
|
1281
|
+
This allows you to tune memory swappiness behavior for this step.
|
1282
|
+
A swappiness value of 0 causes swapping not to happen unless absolutely
|
1283
|
+
necessary. A swappiness value of 100 causes pages to be swapped very
|
1284
|
+
aggressively. Accepted values are whole numbers between 0 and 100.
|
1285
|
+
use_tmpfs : bool, default False
|
1286
|
+
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
1287
|
+
not available on Fargate compute environments
|
1288
|
+
tmpfs_tempdir : bool, default True
|
1289
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
1290
|
+
tmpfs_size : int, optional, default None
|
1291
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
1292
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
1293
|
+
memory allocated for this step.
|
1294
|
+
tmpfs_path : str, optional, default None
|
1295
|
+
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
1296
|
+
inferentia : int, default 0
|
1297
|
+
Number of Inferentia chips required for this step.
|
1298
|
+
trainium : int, default None
|
1299
|
+
Alias for inferentia. Use only one of the two.
|
1300
|
+
efa : int, default 0
|
1301
|
+
Number of elastic fabric adapter network devices to attach to container
|
1302
|
+
ephemeral_storage: int, default None
|
1303
|
+
The total amount, in GiB, of ephemeral storage to set for the task (21-200)
|
1304
|
+
This is only relevant for Fargate compute environments
|
1305
|
+
log_driver: str, optional, default None
|
1306
|
+
The log driver to use for the Amazon ECS container.
|
1307
|
+
log_options: List[str], optional, default None
|
1308
|
+
List of strings containing options for the chosen log driver. The configurable values
|
1309
|
+
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
1310
|
+
Example usage: ["awslogs-group:aws/batch/job"]
|
1430
1311
|
"""
|
1431
1312
|
...
|
1432
1313
|
|
1433
|
-
|
1314
|
+
@typing.overload
|
1315
|
+
def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1316
|
+
...
|
1317
|
+
|
1318
|
+
@typing.overload
|
1319
|
+
def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1320
|
+
...
|
1321
|
+
|
1322
|
+
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):
|
1434
1323
|
"""
|
1435
|
-
|
1436
|
-
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.
|
1324
|
+
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
1437
1325
|
|
1438
1326
|
Parameters
|
1439
1327
|
----------
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
|
1470
|
-
|
1471
|
-
|
1328
|
+
cpu : int, default 1
|
1329
|
+
Number of CPUs required for this step. If `@resources` is
|
1330
|
+
also present, the maximum value from all decorators is used.
|
1331
|
+
gpu : int, default 0
|
1332
|
+
Number of GPUs required for this step. If `@resources` is
|
1333
|
+
also present, the maximum value from all decorators is used.
|
1334
|
+
memory : int, default 4096
|
1335
|
+
Memory size (in MB) required for this step. If
|
1336
|
+
`@resources` is also present, the maximum value from all decorators is
|
1337
|
+
used.
|
1338
|
+
image : str, optional, default None
|
1339
|
+
Docker image to use when launching on AWS Batch. If not specified, and
|
1340
|
+
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
1341
|
+
not, a default Docker image mapping to the current version of Python is used.
|
1342
|
+
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
1343
|
+
AWS Batch Job Queue to submit the job to.
|
1344
|
+
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
1345
|
+
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
1346
|
+
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
1347
|
+
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
1348
|
+
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
1349
|
+
shared_memory : int, optional, default None
|
1350
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
1351
|
+
This parameter maps to the `--shm-size` option in Docker.
|
1352
|
+
max_swap : int, optional, default None
|
1353
|
+
The total amount of swap memory (in MiB) a container can use for this
|
1354
|
+
step. This parameter is translated to the `--memory-swap` option in
|
1355
|
+
Docker where the value is the sum of the container memory plus the
|
1356
|
+
`max_swap` value.
|
1357
|
+
swappiness : int, optional, default None
|
1358
|
+
This allows you to tune memory swappiness behavior for this step.
|
1359
|
+
A swappiness value of 0 causes swapping not to happen unless absolutely
|
1360
|
+
necessary. A swappiness value of 100 causes pages to be swapped very
|
1361
|
+
aggressively. Accepted values are whole numbers between 0 and 100.
|
1362
|
+
use_tmpfs : bool, default False
|
1363
|
+
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
1364
|
+
not available on Fargate compute environments
|
1365
|
+
tmpfs_tempdir : bool, default True
|
1366
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
1367
|
+
tmpfs_size : int, optional, default None
|
1368
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
1369
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
1370
|
+
memory allocated for this step.
|
1371
|
+
tmpfs_path : str, optional, default None
|
1372
|
+
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
1373
|
+
inferentia : int, default 0
|
1374
|
+
Number of Inferentia chips required for this step.
|
1375
|
+
trainium : int, default None
|
1376
|
+
Alias for inferentia. Use only one of the two.
|
1377
|
+
efa : int, default 0
|
1378
|
+
Number of elastic fabric adapter network devices to attach to container
|
1379
|
+
ephemeral_storage: int, default None
|
1380
|
+
The total amount, in GiB, of ephemeral storage to set for the task (21-200)
|
1381
|
+
This is only relevant for Fargate compute environments
|
1382
|
+
log_driver: str, optional, default None
|
1383
|
+
The log driver to use for the Amazon ECS container.
|
1384
|
+
log_options: List[str], optional, default None
|
1385
|
+
List of strings containing options for the chosen log driver. The configurable values
|
1386
|
+
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
1387
|
+
Example usage: ["awslogs-group:aws/batch/job"]
|
1472
1388
|
"""
|
1473
1389
|
...
|
1474
1390
|
|
@@ -1575,24 +1491,6 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
1575
1491
|
"""
|
1576
1492
|
...
|
1577
1493
|
|
1578
|
-
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1579
|
-
"""
|
1580
|
-
Specifies what flows belong to the same project.
|
1581
|
-
|
1582
|
-
A project-specific namespace is created for all flows that
|
1583
|
-
use the same `@project(name)`.
|
1584
|
-
|
1585
|
-
Parameters
|
1586
|
-
----------
|
1587
|
-
name : str
|
1588
|
-
Project name. Make sure that the name is unique amongst all
|
1589
|
-
projects that use the same production scheduler. The name may
|
1590
|
-
contain only lowercase alphanumeric characters and underscores.
|
1591
|
-
|
1592
|
-
|
1593
|
-
"""
|
1594
|
-
...
|
1595
|
-
|
1596
1494
|
@typing.overload
|
1597
1495
|
def schedule(*, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1598
1496
|
"""
|
@@ -1776,6 +1674,108 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
1776
1674
|
"""
|
1777
1675
|
...
|
1778
1676
|
|
1677
|
+
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]]:
|
1678
|
+
"""
|
1679
|
+
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.
|
1680
|
+
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.
|
1681
|
+
|
1682
|
+
Parameters
|
1683
|
+
----------
|
1684
|
+
timeout : int
|
1685
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1686
|
+
poke_interval : int
|
1687
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1688
|
+
mode : str
|
1689
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1690
|
+
exponential_backoff : bool
|
1691
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1692
|
+
pool : str
|
1693
|
+
the slot pool this task should run in,
|
1694
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1695
|
+
soft_fail : bool
|
1696
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1697
|
+
name : str
|
1698
|
+
Name of the sensor on Airflow
|
1699
|
+
description : str
|
1700
|
+
Description of sensor in the Airflow UI
|
1701
|
+
external_dag_id : str
|
1702
|
+
The dag_id that contains the task you want to wait for.
|
1703
|
+
external_task_ids : List[str]
|
1704
|
+
The list of task_ids that you want to wait for.
|
1705
|
+
If None (default value) the sensor waits for the DAG. (Default: None)
|
1706
|
+
allowed_states : List[str]
|
1707
|
+
Iterable of allowed states, (Default: ['success'])
|
1708
|
+
failed_states : List[str]
|
1709
|
+
Iterable of failed or dis-allowed states. (Default: None)
|
1710
|
+
execution_delta : datetime.timedelta
|
1711
|
+
time difference with the previous execution to look at,
|
1712
|
+
the default is the same logical date as the current task or DAG. (Default: None)
|
1713
|
+
check_existence: bool
|
1714
|
+
Set to True to check if the external task exists or check if
|
1715
|
+
the DAG to wait for exists. (Default: True)
|
1716
|
+
"""
|
1717
|
+
...
|
1718
|
+
|
1719
|
+
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1720
|
+
"""
|
1721
|
+
Specifies what flows belong to the same project.
|
1722
|
+
|
1723
|
+
A project-specific namespace is created for all flows that
|
1724
|
+
use the same `@project(name)`.
|
1725
|
+
|
1726
|
+
Parameters
|
1727
|
+
----------
|
1728
|
+
name : str
|
1729
|
+
Project name. Make sure that the name is unique amongst all
|
1730
|
+
projects that use the same production scheduler. The name may
|
1731
|
+
contain only lowercase alphanumeric characters and underscores.
|
1732
|
+
|
1733
|
+
|
1734
|
+
"""
|
1735
|
+
...
|
1736
|
+
|
1737
|
+
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]]:
|
1738
|
+
"""
|
1739
|
+
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)
|
1740
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1741
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1742
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1743
|
+
starts only after all sensors finish.
|
1744
|
+
|
1745
|
+
Parameters
|
1746
|
+
----------
|
1747
|
+
timeout : int
|
1748
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1749
|
+
poke_interval : int
|
1750
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1751
|
+
mode : str
|
1752
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1753
|
+
exponential_backoff : bool
|
1754
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1755
|
+
pool : str
|
1756
|
+
the slot pool this task should run in,
|
1757
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1758
|
+
soft_fail : bool
|
1759
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1760
|
+
name : str
|
1761
|
+
Name of the sensor on Airflow
|
1762
|
+
description : str
|
1763
|
+
Description of sensor in the Airflow UI
|
1764
|
+
bucket_key : Union[str, List[str]]
|
1765
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1766
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1767
|
+
bucket_name : str
|
1768
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1769
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1770
|
+
wildcard_match : bool
|
1771
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1772
|
+
aws_conn_id : str
|
1773
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1774
|
+
verify : bool
|
1775
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1776
|
+
"""
|
1777
|
+
...
|
1778
|
+
|
1779
1779
|
@typing.overload
|
1780
1780
|
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]]:
|
1781
1781
|
"""
|