ob-metaflow-stubs 4.8__py2.py3-none-any.whl → 4.9__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 +519 -519
- metaflow-stubs/cards.pyi +6 -6
- metaflow-stubs/cli.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +3 -3
- metaflow-stubs/client/core.pyi +7 -7
- 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 +6 -6
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +3 -3
- metaflow-stubs/metadata/metadata.pyi +3 -3
- metaflow-stubs/metadata/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -2
- metaflow-stubs/metaflow_current.pyi +36 -36
- metaflow-stubs/mflog/mflog.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/parameters.pyi +3 -3
- metaflow-stubs/plugins/__init__.pyi +3 -3
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow.pyi +3 -3
- metaflow-stubs/plugins/airflow/airflow_cli.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
- metaflow-stubs/plugins/airflow/exception.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +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 +7 -7
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +7 -7
- metaflow-stubs/plugins/argo/argo_workflows_deployer.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 +2 -2
- 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/aws/step_functions/step_functions_deployer.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_secret_manager_secrets_provider.pyi +3 -3
- 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 +2 -2
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +4 -4
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +3 -3
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +3 -3
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +2 -2
- metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3.pyi +7 -7
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
- metaflow-stubs/plugins/debug_logger.pyi +2 -2
- metaflow-stubs/plugins/debug_monitor.pyi +2 -2
- metaflow-stubs/plugins/environment_decorator.pyi +2 -2
- metaflow-stubs/plugins/events_decorator.pyi +2 -2
- metaflow-stubs/plugins/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/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 +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
- metaflow-stubs/plugins/logs_cli.pyi +2 -2
- 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 +2 -2
- metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +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 +2 -2
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
- metaflow-stubs/plugins/storage_executor.pyi +2 -2
- metaflow-stubs/plugins/tag_cli.pyi +4 -4
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
- metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
- metaflow-stubs/procpoll.pyi +2 -2
- metaflow-stubs/profilers/__init__.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +3 -3
- metaflow-stubs/runner/metaflow_runner.pyi +5 -5
- metaflow-stubs/runner/nbdeploy.pyi +2 -2
- metaflow-stubs/runner/nbrun.pyi +2 -2
- metaflow-stubs/runner/subprocess_manager.pyi +2 -2
- metaflow-stubs/runner/utils.pyi +2 -2
- metaflow-stubs/system/__init__.pyi +3 -3
- metaflow-stubs/system/system_logger.pyi +2 -2
- metaflow-stubs/system/system_monitor.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- {ob_metaflow_stubs-4.8.dist-info → ob_metaflow_stubs-4.9.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-4.9.dist-info/RECORD +150 -0
- ob_metaflow_stubs-4.8.dist-info/RECORD +0 -150
- {ob_metaflow_stubs-4.8.dist-info → ob_metaflow_stubs-4.9.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-4.8.dist-info → ob_metaflow_stubs-4.9.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-07-
|
3
|
+
# MF version: 2.12.10.1+ob(v1) #
|
4
|
+
# Generated on 2024-07-31T05:43:20.962506 #
|
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 metaflow.events
|
12
|
+
import metaflow.flowspec
|
13
|
+
import metaflow.metaflow_current
|
12
14
|
import metaflow._vendor.click.types
|
13
|
-
import
|
15
|
+
import metaflow.plugins.datatools.s3.s3
|
14
16
|
import metaflow.client.core
|
15
17
|
import metaflow.datastore.inputs
|
16
|
-
import
|
17
|
-
import metaflow.
|
18
|
+
import datetime
|
19
|
+
import metaflow.runner.metaflow_runner
|
20
|
+
import typing
|
18
21
|
import metaflow.parameters
|
19
22
|
import io
|
20
|
-
import metaflow.flowspec
|
21
|
-
import metaflow.runner.metaflow_runner
|
22
|
-
import metaflow.metaflow_current
|
23
23
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
24
24
|
StepFlag = typing.NewType("StepFlag", bool)
|
25
25
|
|
@@ -728,51 +728,33 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
728
728
|
...
|
729
729
|
|
730
730
|
@typing.overload
|
731
|
-
def
|
731
|
+
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]]]:
|
732
732
|
"""
|
733
|
-
Specifies
|
734
|
-
|
735
|
-
Information in this decorator will augment any
|
736
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
737
|
-
you can use `@pypi_base` to set packages required by all
|
738
|
-
steps and use `@pypi` to specify step-specific overrides.
|
733
|
+
Specifies environment variables to be set prior to the execution of a step.
|
739
734
|
|
740
735
|
Parameters
|
741
736
|
----------
|
742
|
-
|
743
|
-
|
744
|
-
and the value is the version to use.
|
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.
|
737
|
+
vars : Dict[str, str], default {}
|
738
|
+
Dictionary of environment variables to set.
|
748
739
|
"""
|
749
740
|
...
|
750
741
|
|
751
742
|
@typing.overload
|
752
|
-
def
|
743
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
753
744
|
...
|
754
745
|
|
755
746
|
@typing.overload
|
756
|
-
def
|
747
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
757
748
|
...
|
758
749
|
|
759
|
-
def
|
750
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
760
751
|
"""
|
761
|
-
Specifies
|
762
|
-
|
763
|
-
Information in this decorator will augment any
|
764
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
765
|
-
you can use `@pypi_base` to set packages required by all
|
766
|
-
steps and use `@pypi` to specify step-specific overrides.
|
752
|
+
Specifies environment variables to be set prior to the execution of a step.
|
767
753
|
|
768
754
|
Parameters
|
769
755
|
----------
|
770
|
-
|
771
|
-
|
772
|
-
and the value is the version to use.
|
773
|
-
python : str, optional, default: None
|
774
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
775
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
756
|
+
vars : Dict[str, str], default {}
|
757
|
+
Dictionary of environment variables to set.
|
776
758
|
"""
|
777
759
|
...
|
778
760
|
|
@@ -834,74 +816,110 @@ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
834
816
|
...
|
835
817
|
|
836
818
|
@typing.overload
|
837
|
-
def
|
819
|
+
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]]]:
|
838
820
|
"""
|
839
|
-
|
840
|
-
|
821
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
822
|
+
|
823
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
824
|
+
|
825
|
+
Parameters
|
826
|
+
----------
|
827
|
+
type : str, default 'default'
|
828
|
+
Card type.
|
829
|
+
id : str, optional, default None
|
830
|
+
If multiple cards are present, use this id to identify this card.
|
831
|
+
options : Dict[str, Any], default {}
|
832
|
+
Options passed to the card. The contents depend on the card type.
|
833
|
+
timeout : int, default 45
|
834
|
+
Interrupt reporting if it takes more than this many seconds.
|
835
|
+
|
836
|
+
|
841
837
|
"""
|
842
838
|
...
|
843
839
|
|
844
840
|
@typing.overload
|
845
|
-
def
|
841
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
846
842
|
...
|
847
843
|
|
848
|
-
|
844
|
+
@typing.overload
|
845
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
846
|
+
...
|
847
|
+
|
848
|
+
def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = "default", id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
|
849
849
|
"""
|
850
|
-
|
851
|
-
|
850
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
851
|
+
|
852
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
853
|
+
|
854
|
+
Parameters
|
855
|
+
----------
|
856
|
+
type : str, default 'default'
|
857
|
+
Card type.
|
858
|
+
id : str, optional, default None
|
859
|
+
If multiple cards are present, use this id to identify this card.
|
860
|
+
options : Dict[str, Any], default {}
|
861
|
+
Options passed to the card. The contents depend on the card type.
|
862
|
+
timeout : int, default 45
|
863
|
+
Interrupt reporting if it takes more than this many seconds.
|
864
|
+
|
865
|
+
|
852
866
|
"""
|
853
867
|
...
|
854
868
|
|
855
869
|
@typing.overload
|
856
|
-
def
|
870
|
+
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]]]:
|
857
871
|
"""
|
858
|
-
Specifies
|
859
|
-
to a step needs to be retried.
|
872
|
+
Specifies a timeout for your step.
|
860
873
|
|
861
|
-
This decorator is useful
|
862
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
863
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
874
|
+
This decorator is useful if this step may hang indefinitely.
|
864
875
|
|
865
|
-
This can be used in conjunction with the `@
|
866
|
-
|
867
|
-
|
876
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
877
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
878
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
879
|
+
|
880
|
+
Note that all the values specified in parameters are added together so if you specify
|
881
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
868
882
|
|
869
883
|
Parameters
|
870
884
|
----------
|
871
|
-
|
872
|
-
Number of
|
873
|
-
|
874
|
-
Number of minutes
|
885
|
+
seconds : int, default 0
|
886
|
+
Number of seconds to wait prior to timing out.
|
887
|
+
minutes : int, default 0
|
888
|
+
Number of minutes to wait prior to timing out.
|
889
|
+
hours : int, default 0
|
890
|
+
Number of hours to wait prior to timing out.
|
875
891
|
"""
|
876
892
|
...
|
877
893
|
|
878
894
|
@typing.overload
|
879
|
-
def
|
895
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
880
896
|
...
|
881
897
|
|
882
898
|
@typing.overload
|
883
|
-
def
|
899
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
884
900
|
...
|
885
901
|
|
886
|
-
def
|
902
|
+
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):
|
887
903
|
"""
|
888
|
-
Specifies
|
889
|
-
to a step needs to be retried.
|
904
|
+
Specifies a timeout for your step.
|
890
905
|
|
891
|
-
This decorator is useful
|
892
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
893
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
906
|
+
This decorator is useful if this step may hang indefinitely.
|
894
907
|
|
895
|
-
This can be used in conjunction with the `@
|
896
|
-
|
897
|
-
|
908
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
909
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
910
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
911
|
+
|
912
|
+
Note that all the values specified in parameters are added together so if you specify
|
913
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
898
914
|
|
899
915
|
Parameters
|
900
916
|
----------
|
901
|
-
|
902
|
-
Number of
|
903
|
-
|
904
|
-
Number of minutes
|
917
|
+
seconds : int, default 0
|
918
|
+
Number of seconds to wait prior to timing out.
|
919
|
+
minutes : int, default 0
|
920
|
+
Number of minutes to wait prior to timing out.
|
921
|
+
hours : int, default 0
|
922
|
+
Number of hours to wait prior to timing out.
|
905
923
|
"""
|
906
924
|
...
|
907
925
|
|
@@ -955,180 +973,107 @@ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
955
973
|
...
|
956
974
|
|
957
975
|
@typing.overload
|
958
|
-
def
|
976
|
+
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]]]:
|
959
977
|
"""
|
960
|
-
Specifies
|
978
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
979
|
+
the execution of a step.
|
961
980
|
|
962
981
|
Parameters
|
963
982
|
----------
|
964
|
-
|
965
|
-
|
966
|
-
also present, the maximum value from all decorators is used.
|
967
|
-
gpu : int, default 0
|
968
|
-
Number of GPUs required for this step. If `@resources` is
|
969
|
-
also present, the maximum value from all decorators is used.
|
970
|
-
memory : int, default 4096
|
971
|
-
Memory size (in MB) required for this step. If
|
972
|
-
`@resources` is also present, the maximum value from all decorators is
|
973
|
-
used.
|
974
|
-
image : str, optional, default None
|
975
|
-
Docker image to use when launching on AWS Batch. If not specified, and
|
976
|
-
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
977
|
-
not, a default Docker image mapping to the current version of Python is used.
|
978
|
-
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
979
|
-
AWS Batch Job Queue to submit the job to.
|
980
|
-
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
981
|
-
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
982
|
-
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
983
|
-
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
984
|
-
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
985
|
-
shared_memory : int, optional, default None
|
986
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
987
|
-
This parameter maps to the `--shm-size` option in Docker.
|
988
|
-
max_swap : int, optional, default None
|
989
|
-
The total amount of swap memory (in MiB) a container can use for this
|
990
|
-
step. This parameter is translated to the `--memory-swap` option in
|
991
|
-
Docker where the value is the sum of the container memory plus the
|
992
|
-
`max_swap` value.
|
993
|
-
swappiness : int, optional, default None
|
994
|
-
This allows you to tune memory swappiness behavior for this step.
|
995
|
-
A swappiness value of 0 causes swapping not to happen unless absolutely
|
996
|
-
necessary. A swappiness value of 100 causes pages to be swapped very
|
997
|
-
aggressively. Accepted values are whole numbers between 0 and 100.
|
998
|
-
use_tmpfs : bool, default False
|
999
|
-
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
1000
|
-
not available on Fargate compute environments
|
1001
|
-
tmpfs_tempdir : bool, default True
|
1002
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
1003
|
-
tmpfs_size : int, optional, default None
|
1004
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
1005
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
1006
|
-
memory allocated for this step.
|
1007
|
-
tmpfs_path : str, optional, default None
|
1008
|
-
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
1009
|
-
inferentia : int, default 0
|
1010
|
-
Number of Inferentia chips required for this step.
|
1011
|
-
trainium : int, default None
|
1012
|
-
Alias for inferentia. Use only one of the two.
|
1013
|
-
efa : int, default 0
|
1014
|
-
Number of elastic fabric adapter network devices to attach to container
|
1015
|
-
ephemeral_storage : int, default None
|
1016
|
-
The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
|
1017
|
-
This is only relevant for Fargate compute environments
|
1018
|
-
log_driver: str, optional, default None
|
1019
|
-
The log driver to use for the Amazon ECS container.
|
1020
|
-
log_options: List[str], optional, default None
|
1021
|
-
List of strings containing options for the chosen log driver. The configurable values
|
1022
|
-
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
1023
|
-
Example: [`awslogs-group:aws/batch/job`]
|
983
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
984
|
+
List of secret specs, defining how the secrets are to be retrieved
|
1024
985
|
"""
|
1025
986
|
...
|
1026
987
|
|
1027
988
|
@typing.overload
|
1028
|
-
def
|
989
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1029
990
|
...
|
1030
991
|
|
1031
992
|
@typing.overload
|
1032
|
-
def
|
993
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1033
994
|
...
|
1034
995
|
|
1035
|
-
def
|
996
|
+
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]]] = []):
|
1036
997
|
"""
|
1037
|
-
Specifies
|
998
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
999
|
+
the execution of a step.
|
1038
1000
|
|
1039
1001
|
Parameters
|
1040
1002
|
----------
|
1041
|
-
|
1042
|
-
|
1043
|
-
also present, the maximum value from all decorators is used.
|
1044
|
-
gpu : int, default 0
|
1045
|
-
Number of GPUs required for this step. If `@resources` is
|
1046
|
-
also present, the maximum value from all decorators is used.
|
1047
|
-
memory : int, default 4096
|
1048
|
-
Memory size (in MB) required for this step. If
|
1049
|
-
`@resources` is also present, the maximum value from all decorators is
|
1050
|
-
used.
|
1051
|
-
image : str, optional, default None
|
1052
|
-
Docker image to use when launching on AWS Batch. If not specified, and
|
1053
|
-
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
1054
|
-
not, a default Docker image mapping to the current version of Python is used.
|
1055
|
-
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
1056
|
-
AWS Batch Job Queue to submit the job to.
|
1057
|
-
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
1058
|
-
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
1059
|
-
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
1060
|
-
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
1061
|
-
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
1062
|
-
shared_memory : int, optional, default None
|
1063
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
1064
|
-
This parameter maps to the `--shm-size` option in Docker.
|
1065
|
-
max_swap : int, optional, default None
|
1066
|
-
The total amount of swap memory (in MiB) a container can use for this
|
1067
|
-
step. This parameter is translated to the `--memory-swap` option in
|
1068
|
-
Docker where the value is the sum of the container memory plus the
|
1069
|
-
`max_swap` value.
|
1070
|
-
swappiness : int, optional, default None
|
1071
|
-
This allows you to tune memory swappiness behavior for this step.
|
1072
|
-
A swappiness value of 0 causes swapping not to happen unless absolutely
|
1073
|
-
necessary. A swappiness value of 100 causes pages to be swapped very
|
1074
|
-
aggressively. Accepted values are whole numbers between 0 and 100.
|
1075
|
-
use_tmpfs : bool, default False
|
1076
|
-
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
1077
|
-
not available on Fargate compute environments
|
1078
|
-
tmpfs_tempdir : bool, default True
|
1079
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
1080
|
-
tmpfs_size : int, optional, default None
|
1081
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
1082
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
1083
|
-
memory allocated for this step.
|
1084
|
-
tmpfs_path : str, optional, default None
|
1085
|
-
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
1086
|
-
inferentia : int, default 0
|
1087
|
-
Number of Inferentia chips required for this step.
|
1088
|
-
trainium : int, default None
|
1089
|
-
Alias for inferentia. Use only one of the two.
|
1090
|
-
efa : int, default 0
|
1091
|
-
Number of elastic fabric adapter network devices to attach to container
|
1092
|
-
ephemeral_storage : int, default None
|
1093
|
-
The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
|
1094
|
-
This is only relevant for Fargate compute environments
|
1095
|
-
log_driver: str, optional, default None
|
1096
|
-
The log driver to use for the Amazon ECS container.
|
1097
|
-
log_options: List[str], optional, default None
|
1098
|
-
List of strings containing options for the chosen log driver. The configurable values
|
1099
|
-
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
1100
|
-
Example: [`awslogs-group:aws/batch/job`]
|
1003
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
1004
|
+
List of secret specs, defining how the secrets are to be retrieved
|
1101
1005
|
"""
|
1102
1006
|
...
|
1103
1007
|
|
1104
1008
|
@typing.overload
|
1105
|
-
def
|
1009
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1106
1010
|
"""
|
1107
|
-
|
1011
|
+
Decorator prototype for all step decorators. This function gets specialized
|
1012
|
+
and imported for all decorators types by _import_plugin_decorators().
|
1013
|
+
"""
|
1014
|
+
...
|
1015
|
+
|
1016
|
+
@typing.overload
|
1017
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1018
|
+
...
|
1019
|
+
|
1020
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
1021
|
+
"""
|
1022
|
+
Decorator prototype for all step decorators. This function gets specialized
|
1023
|
+
and imported for all decorators types by _import_plugin_decorators().
|
1024
|
+
"""
|
1025
|
+
...
|
1026
|
+
|
1027
|
+
@typing.overload
|
1028
|
+
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]]]:
|
1029
|
+
"""
|
1030
|
+
Specifies the number of times the task corresponding
|
1031
|
+
to a step needs to be retried.
|
1032
|
+
|
1033
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
1034
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
1035
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
1036
|
+
|
1037
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
1038
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
1039
|
+
ensuring that the flow execution can continue.
|
1108
1040
|
|
1109
1041
|
Parameters
|
1110
1042
|
----------
|
1111
|
-
|
1112
|
-
|
1043
|
+
times : int, default 3
|
1044
|
+
Number of times to retry this task.
|
1045
|
+
minutes_between_retries : int, default 2
|
1046
|
+
Number of minutes between retries.
|
1113
1047
|
"""
|
1114
1048
|
...
|
1115
1049
|
|
1116
1050
|
@typing.overload
|
1117
|
-
def
|
1051
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1118
1052
|
...
|
1119
1053
|
|
1120
1054
|
@typing.overload
|
1121
|
-
def
|
1055
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1122
1056
|
...
|
1123
1057
|
|
1124
|
-
def
|
1058
|
+
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):
|
1125
1059
|
"""
|
1126
|
-
Specifies
|
1060
|
+
Specifies the number of times the task corresponding
|
1061
|
+
to a step needs to be retried.
|
1062
|
+
|
1063
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
1064
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
1065
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
1066
|
+
|
1067
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
1068
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
1069
|
+
ensuring that the flow execution can continue.
|
1127
1070
|
|
1128
1071
|
Parameters
|
1129
1072
|
----------
|
1130
|
-
|
1131
|
-
|
1073
|
+
times : int, default 3
|
1074
|
+
Number of times to retry this task.
|
1075
|
+
minutes_between_retries : int, default 2
|
1076
|
+
Number of minutes between retries.
|
1132
1077
|
"""
|
1133
1078
|
...
|
1134
1079
|
|
@@ -1192,143 +1137,198 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
|
|
1192
1137
|
...
|
1193
1138
|
|
1194
1139
|
@typing.overload
|
1195
|
-
def
|
1140
|
+
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]]]:
|
1196
1141
|
"""
|
1197
|
-
Specifies
|
1198
|
-
the execution of a step.
|
1142
|
+
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
1199
1143
|
|
1200
1144
|
Parameters
|
1201
1145
|
----------
|
1202
|
-
|
1203
|
-
|
1146
|
+
cpu : int, default 1
|
1147
|
+
Number of CPUs required for this step. If `@resources` is
|
1148
|
+
also present, the maximum value from all decorators is used.
|
1149
|
+
gpu : int, default 0
|
1150
|
+
Number of GPUs required for this step. If `@resources` is
|
1151
|
+
also present, the maximum value from all decorators is used.
|
1152
|
+
memory : int, default 4096
|
1153
|
+
Memory size (in MB) required for this step. If
|
1154
|
+
`@resources` is also present, the maximum value from all decorators is
|
1155
|
+
used.
|
1156
|
+
image : str, optional, default None
|
1157
|
+
Docker image to use when launching on AWS Batch. If not specified, and
|
1158
|
+
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
1159
|
+
not, a default Docker image mapping to the current version of Python is used.
|
1160
|
+
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
1161
|
+
AWS Batch Job Queue to submit the job to.
|
1162
|
+
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
1163
|
+
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
1164
|
+
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
1165
|
+
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
1166
|
+
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
1167
|
+
shared_memory : int, optional, default None
|
1168
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
1169
|
+
This parameter maps to the `--shm-size` option in Docker.
|
1170
|
+
max_swap : int, optional, default None
|
1171
|
+
The total amount of swap memory (in MiB) a container can use for this
|
1172
|
+
step. This parameter is translated to the `--memory-swap` option in
|
1173
|
+
Docker where the value is the sum of the container memory plus the
|
1174
|
+
`max_swap` value.
|
1175
|
+
swappiness : int, optional, default None
|
1176
|
+
This allows you to tune memory swappiness behavior for this step.
|
1177
|
+
A swappiness value of 0 causes swapping not to happen unless absolutely
|
1178
|
+
necessary. A swappiness value of 100 causes pages to be swapped very
|
1179
|
+
aggressively. Accepted values are whole numbers between 0 and 100.
|
1180
|
+
use_tmpfs : bool, default False
|
1181
|
+
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
1182
|
+
not available on Fargate compute environments
|
1183
|
+
tmpfs_tempdir : bool, default True
|
1184
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
1185
|
+
tmpfs_size : int, optional, default None
|
1186
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
1187
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
1188
|
+
memory allocated for this step.
|
1189
|
+
tmpfs_path : str, optional, default None
|
1190
|
+
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
1191
|
+
inferentia : int, default 0
|
1192
|
+
Number of Inferentia chips required for this step.
|
1193
|
+
trainium : int, default None
|
1194
|
+
Alias for inferentia. Use only one of the two.
|
1195
|
+
efa : int, default 0
|
1196
|
+
Number of elastic fabric adapter network devices to attach to container
|
1197
|
+
ephemeral_storage : int, default None
|
1198
|
+
The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
|
1199
|
+
This is only relevant for Fargate compute environments
|
1200
|
+
log_driver: str, optional, default None
|
1201
|
+
The log driver to use for the Amazon ECS container.
|
1202
|
+
log_options: List[str], optional, default None
|
1203
|
+
List of strings containing options for the chosen log driver. The configurable values
|
1204
|
+
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
1205
|
+
Example: [`awslogs-group:aws/batch/job`]
|
1204
1206
|
"""
|
1205
1207
|
...
|
1206
1208
|
|
1207
1209
|
@typing.overload
|
1208
|
-
def
|
1210
|
+
def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1209
1211
|
...
|
1210
1212
|
|
1211
1213
|
@typing.overload
|
1212
|
-
def
|
1214
|
+
def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1213
1215
|
...
|
1214
1216
|
|
1215
|
-
def
|
1217
|
+
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):
|
1216
1218
|
"""
|
1217
|
-
Specifies
|
1218
|
-
the execution of a step.
|
1219
|
+
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
1219
1220
|
|
1220
1221
|
Parameters
|
1221
1222
|
----------
|
1222
|
-
|
1223
|
-
|
1223
|
+
cpu : int, default 1
|
1224
|
+
Number of CPUs required for this step. If `@resources` is
|
1225
|
+
also present, the maximum value from all decorators is used.
|
1226
|
+
gpu : int, default 0
|
1227
|
+
Number of GPUs required for this step. If `@resources` is
|
1228
|
+
also present, the maximum value from all decorators is used.
|
1229
|
+
memory : int, default 4096
|
1230
|
+
Memory size (in MB) required for this step. If
|
1231
|
+
`@resources` is also present, the maximum value from all decorators is
|
1232
|
+
used.
|
1233
|
+
image : str, optional, default None
|
1234
|
+
Docker image to use when launching on AWS Batch. If not specified, and
|
1235
|
+
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
1236
|
+
not, a default Docker image mapping to the current version of Python is used.
|
1237
|
+
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
1238
|
+
AWS Batch Job Queue to submit the job to.
|
1239
|
+
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
1240
|
+
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
1241
|
+
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
1242
|
+
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
1243
|
+
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
1244
|
+
shared_memory : int, optional, default None
|
1245
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
1246
|
+
This parameter maps to the `--shm-size` option in Docker.
|
1247
|
+
max_swap : int, optional, default None
|
1248
|
+
The total amount of swap memory (in MiB) a container can use for this
|
1249
|
+
step. This parameter is translated to the `--memory-swap` option in
|
1250
|
+
Docker where the value is the sum of the container memory plus the
|
1251
|
+
`max_swap` value.
|
1252
|
+
swappiness : int, optional, default None
|
1253
|
+
This allows you to tune memory swappiness behavior for this step.
|
1254
|
+
A swappiness value of 0 causes swapping not to happen unless absolutely
|
1255
|
+
necessary. A swappiness value of 100 causes pages to be swapped very
|
1256
|
+
aggressively. Accepted values are whole numbers between 0 and 100.
|
1257
|
+
use_tmpfs : bool, default False
|
1258
|
+
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
1259
|
+
not available on Fargate compute environments
|
1260
|
+
tmpfs_tempdir : bool, default True
|
1261
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
1262
|
+
tmpfs_size : int, optional, default None
|
1263
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
1264
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
1265
|
+
memory allocated for this step.
|
1266
|
+
tmpfs_path : str, optional, default None
|
1267
|
+
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
1268
|
+
inferentia : int, default 0
|
1269
|
+
Number of Inferentia chips required for this step.
|
1270
|
+
trainium : int, default None
|
1271
|
+
Alias for inferentia. Use only one of the two.
|
1272
|
+
efa : int, default 0
|
1273
|
+
Number of elastic fabric adapter network devices to attach to container
|
1274
|
+
ephemeral_storage : int, default None
|
1275
|
+
The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
|
1276
|
+
This is only relevant for Fargate compute environments
|
1277
|
+
log_driver: str, optional, default None
|
1278
|
+
The log driver to use for the Amazon ECS container.
|
1279
|
+
log_options: List[str], optional, default None
|
1280
|
+
List of strings containing options for the chosen log driver. The configurable values
|
1281
|
+
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
1282
|
+
Example: [`awslogs-group:aws/batch/job`]
|
1224
1283
|
"""
|
1225
1284
|
...
|
1226
1285
|
|
1227
1286
|
@typing.overload
|
1228
|
-
def
|
1287
|
+
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]]]:
|
1229
1288
|
"""
|
1230
|
-
Specifies
|
1231
|
-
|
1232
|
-
This decorator is useful if this step may hang indefinitely.
|
1233
|
-
|
1234
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
1235
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
1236
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
1289
|
+
Specifies the PyPI packages for the step.
|
1237
1290
|
|
1238
|
-
|
1239
|
-
|
1291
|
+
Information in this decorator will augment any
|
1292
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1293
|
+
you can use `@pypi_base` to set packages required by all
|
1294
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1240
1295
|
|
1241
1296
|
Parameters
|
1242
1297
|
----------
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1249
|
-
"""
|
1250
|
-
...
|
1251
|
-
|
1252
|
-
@typing.overload
|
1253
|
-
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1254
|
-
...
|
1255
|
-
|
1256
|
-
@typing.overload
|
1257
|
-
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1258
|
-
...
|
1259
|
-
|
1260
|
-
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):
|
1261
|
-
"""
|
1262
|
-
Specifies a timeout for your step.
|
1263
|
-
|
1264
|
-
This decorator is useful if this step may hang indefinitely.
|
1265
|
-
|
1266
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
1267
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
1268
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
1269
|
-
|
1270
|
-
Note that all the values specified in parameters are added together so if you specify
|
1271
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
1272
|
-
|
1273
|
-
Parameters
|
1274
|
-
----------
|
1275
|
-
seconds : int, default 0
|
1276
|
-
Number of seconds to wait prior to timing out.
|
1277
|
-
minutes : int, default 0
|
1278
|
-
Number of minutes to wait prior to timing out.
|
1279
|
-
hours : int, default 0
|
1280
|
-
Number of hours to wait prior to timing out.
|
1281
|
-
"""
|
1282
|
-
...
|
1283
|
-
|
1284
|
-
@typing.overload
|
1285
|
-
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]]]:
|
1286
|
-
"""
|
1287
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
1288
|
-
|
1289
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1290
|
-
|
1291
|
-
Parameters
|
1292
|
-
----------
|
1293
|
-
type : str, default 'default'
|
1294
|
-
Card type.
|
1295
|
-
id : str, optional, default None
|
1296
|
-
If multiple cards are present, use this id to identify this card.
|
1297
|
-
options : Dict[str, Any], default {}
|
1298
|
-
Options passed to the card. The contents depend on the card type.
|
1299
|
-
timeout : int, default 45
|
1300
|
-
Interrupt reporting if it takes more than this many seconds.
|
1301
|
-
|
1302
|
-
|
1298
|
+
packages : Dict[str, str], default: {}
|
1299
|
+
Packages to use for this step. The key is the name of the package
|
1300
|
+
and the value is the version to use.
|
1301
|
+
python : str, optional, default: None
|
1302
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1303
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1303
1304
|
"""
|
1304
1305
|
...
|
1305
1306
|
|
1306
1307
|
@typing.overload
|
1307
|
-
def
|
1308
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1308
1309
|
...
|
1309
1310
|
|
1310
1311
|
@typing.overload
|
1311
|
-
def
|
1312
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1312
1313
|
...
|
1313
1314
|
|
1314
|
-
def
|
1315
|
+
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):
|
1315
1316
|
"""
|
1316
|
-
|
1317
|
+
Specifies the PyPI packages for the step.
|
1317
1318
|
|
1318
|
-
|
1319
|
+
Information in this decorator will augment any
|
1320
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1321
|
+
you can use `@pypi_base` to set packages required by all
|
1322
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1319
1323
|
|
1320
1324
|
Parameters
|
1321
1325
|
----------
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
timeout : int, default 45
|
1329
|
-
Interrupt reporting if it takes more than this many seconds.
|
1330
|
-
|
1331
|
-
|
1326
|
+
packages : Dict[str, str], default: {}
|
1327
|
+
Packages to use for this step. The key is the name of the package
|
1328
|
+
and the value is the version to use.
|
1329
|
+
python : str, optional, default: None
|
1330
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1331
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1332
1332
|
"""
|
1333
1333
|
...
|
1334
1334
|
|
@@ -1409,6 +1409,185 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
1409
1409
|
"""
|
1410
1410
|
...
|
1411
1411
|
|
1412
|
+
def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1413
|
+
"""
|
1414
|
+
This decorator is used to run NIM containers in Metaflow tasks as sidecars.
|
1415
|
+
|
1416
|
+
User code call
|
1417
|
+
-----------
|
1418
|
+
@nim(
|
1419
|
+
models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
|
1420
|
+
backend='managed'
|
1421
|
+
)
|
1422
|
+
|
1423
|
+
Valid backend options
|
1424
|
+
---------------------
|
1425
|
+
- 'managed': Outerbounds selects a compute provider based on the model.
|
1426
|
+
- 🚧 'dataplane': Run in your account.
|
1427
|
+
|
1428
|
+
Valid model options
|
1429
|
+
----------------
|
1430
|
+
- 'meta/llama3-8b-instruct': 8B parameter model
|
1431
|
+
- 'meta/llama3-70b-instruct': 70B parameter model
|
1432
|
+
- Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
|
1433
|
+
|
1434
|
+
Parameters
|
1435
|
+
----------
|
1436
|
+
models: list[NIM]
|
1437
|
+
List of NIM containers running models in sidecars.
|
1438
|
+
backend: str
|
1439
|
+
Compute provider to run the NIM container.
|
1440
|
+
"""
|
1441
|
+
...
|
1442
|
+
|
1443
|
+
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1444
|
+
"""
|
1445
|
+
Specifies what flows belong to the same project.
|
1446
|
+
|
1447
|
+
A project-specific namespace is created for all flows that
|
1448
|
+
use the same `@project(name)`.
|
1449
|
+
|
1450
|
+
Parameters
|
1451
|
+
----------
|
1452
|
+
name : str
|
1453
|
+
Project name. Make sure that the name is unique amongst all
|
1454
|
+
projects that use the same production scheduler. The name may
|
1455
|
+
contain only lowercase alphanumeric characters and underscores.
|
1456
|
+
|
1457
|
+
|
1458
|
+
"""
|
1459
|
+
...
|
1460
|
+
|
1461
|
+
@typing.overload
|
1462
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1463
|
+
"""
|
1464
|
+
Specifies the PyPI packages for all steps of the flow.
|
1465
|
+
|
1466
|
+
Use `@pypi_base` to set common packages required by all
|
1467
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1468
|
+
Parameters
|
1469
|
+
----------
|
1470
|
+
packages : Dict[str, str], default: {}
|
1471
|
+
Packages to use for this flow. The key is the name of the package
|
1472
|
+
and the value is the version to use.
|
1473
|
+
python : str, optional, default: None
|
1474
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1475
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1476
|
+
"""
|
1477
|
+
...
|
1478
|
+
|
1479
|
+
@typing.overload
|
1480
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1481
|
+
...
|
1482
|
+
|
1483
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1484
|
+
"""
|
1485
|
+
Specifies the PyPI packages for all steps of the flow.
|
1486
|
+
|
1487
|
+
Use `@pypi_base` to set common packages required by all
|
1488
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1489
|
+
Parameters
|
1490
|
+
----------
|
1491
|
+
packages : Dict[str, str], default: {}
|
1492
|
+
Packages to use for this flow. The key is the name of the package
|
1493
|
+
and the value is the version to use.
|
1494
|
+
python : str, optional, default: None
|
1495
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1496
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1497
|
+
"""
|
1498
|
+
...
|
1499
|
+
|
1500
|
+
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]]:
|
1501
|
+
"""
|
1502
|
+
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)
|
1503
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1504
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1505
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1506
|
+
starts only after all sensors finish.
|
1507
|
+
|
1508
|
+
Parameters
|
1509
|
+
----------
|
1510
|
+
timeout : int
|
1511
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1512
|
+
poke_interval : int
|
1513
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1514
|
+
mode : str
|
1515
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1516
|
+
exponential_backoff : bool
|
1517
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1518
|
+
pool : str
|
1519
|
+
the slot pool this task should run in,
|
1520
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1521
|
+
soft_fail : bool
|
1522
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1523
|
+
name : str
|
1524
|
+
Name of the sensor on Airflow
|
1525
|
+
description : str
|
1526
|
+
Description of sensor in the Airflow UI
|
1527
|
+
bucket_key : Union[str, List[str]]
|
1528
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1529
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1530
|
+
bucket_name : str
|
1531
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1532
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1533
|
+
wildcard_match : bool
|
1534
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1535
|
+
aws_conn_id : str
|
1536
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1537
|
+
verify : bool
|
1538
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1539
|
+
"""
|
1540
|
+
...
|
1541
|
+
|
1542
|
+
@typing.overload
|
1543
|
+
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]]:
|
1544
|
+
"""
|
1545
|
+
Specifies the times when the flow should be run when running on a
|
1546
|
+
production scheduler.
|
1547
|
+
|
1548
|
+
Parameters
|
1549
|
+
----------
|
1550
|
+
hourly : bool, default False
|
1551
|
+
Run the workflow hourly.
|
1552
|
+
daily : bool, default True
|
1553
|
+
Run the workflow daily.
|
1554
|
+
weekly : bool, default False
|
1555
|
+
Run the workflow weekly.
|
1556
|
+
cron : str, optional, default None
|
1557
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1558
|
+
specified by this expression.
|
1559
|
+
timezone : str, optional, default None
|
1560
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1561
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1562
|
+
"""
|
1563
|
+
...
|
1564
|
+
|
1565
|
+
@typing.overload
|
1566
|
+
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1567
|
+
...
|
1568
|
+
|
1569
|
+
def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
|
1570
|
+
"""
|
1571
|
+
Specifies the times when the flow should be run when running on a
|
1572
|
+
production scheduler.
|
1573
|
+
|
1574
|
+
Parameters
|
1575
|
+
----------
|
1576
|
+
hourly : bool, default False
|
1577
|
+
Run the workflow hourly.
|
1578
|
+
daily : bool, default True
|
1579
|
+
Run the workflow daily.
|
1580
|
+
weekly : bool, default False
|
1581
|
+
Run the workflow weekly.
|
1582
|
+
cron : str, optional, default None
|
1583
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1584
|
+
specified by this expression.
|
1585
|
+
timezone : str, optional, default None
|
1586
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1587
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1588
|
+
"""
|
1589
|
+
...
|
1590
|
+
|
1412
1591
|
@typing.overload
|
1413
1592
|
def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1414
1593
|
"""
|
@@ -1504,42 +1683,45 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
1504
1683
|
"""
|
1505
1684
|
...
|
1506
1685
|
|
1507
|
-
|
1508
|
-
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1509
|
-
"""
|
1510
|
-
Specifies the PyPI packages for all steps of the flow.
|
1511
|
-
|
1512
|
-
Use `@pypi_base` to set common packages required by all
|
1513
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1514
|
-
Parameters
|
1515
|
-
----------
|
1516
|
-
packages : Dict[str, str], default: {}
|
1517
|
-
Packages to use for this flow. The key is the name of the package
|
1518
|
-
and the value is the version to use.
|
1519
|
-
python : str, optional, default: None
|
1520
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1521
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1522
|
-
"""
|
1523
|
-
...
|
1524
|
-
|
1525
|
-
@typing.overload
|
1526
|
-
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1527
|
-
...
|
1528
|
-
|
1529
|
-
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1686
|
+
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]]:
|
1530
1687
|
"""
|
1531
|
-
|
1688
|
+
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.
|
1689
|
+
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.
|
1532
1690
|
|
1533
|
-
Use `@pypi_base` to set common packages required by all
|
1534
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1535
1691
|
Parameters
|
1536
1692
|
----------
|
1537
|
-
|
1538
|
-
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1693
|
+
timeout : int
|
1694
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1695
|
+
poke_interval : int
|
1696
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1697
|
+
mode : str
|
1698
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1699
|
+
exponential_backoff : bool
|
1700
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1701
|
+
pool : str
|
1702
|
+
the slot pool this task should run in,
|
1703
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1704
|
+
soft_fail : bool
|
1705
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1706
|
+
name : str
|
1707
|
+
Name of the sensor on Airflow
|
1708
|
+
description : str
|
1709
|
+
Description of sensor in the Airflow UI
|
1710
|
+
external_dag_id : str
|
1711
|
+
The dag_id that contains the task you want to wait for.
|
1712
|
+
external_task_ids : List[str]
|
1713
|
+
The list of task_ids that you want to wait for.
|
1714
|
+
If None (default value) the sensor waits for the DAG. (Default: None)
|
1715
|
+
allowed_states : List[str]
|
1716
|
+
Iterable of allowed states, (Default: ['success'])
|
1717
|
+
failed_states : List[str]
|
1718
|
+
Iterable of failed or dis-allowed states. (Default: None)
|
1719
|
+
execution_delta : datetime.timedelta
|
1720
|
+
time difference with the previous execution to look at,
|
1721
|
+
the default is the same logical date as the current task or DAG. (Default: None)
|
1722
|
+
check_existence: bool
|
1723
|
+
Set to True to check if the external task exists or check if
|
1724
|
+
the DAG to wait for exists. (Default: True)
|
1543
1725
|
"""
|
1544
1726
|
...
|
1545
1727
|
|
@@ -1592,55 +1774,6 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
|
|
1592
1774
|
"""
|
1593
1775
|
...
|
1594
1776
|
|
1595
|
-
def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1596
|
-
"""
|
1597
|
-
This decorator is used to run NIM containers in Metaflow tasks as sidecars.
|
1598
|
-
|
1599
|
-
User code call
|
1600
|
-
-----------
|
1601
|
-
@nim(
|
1602
|
-
models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
|
1603
|
-
backend='managed'
|
1604
|
-
)
|
1605
|
-
|
1606
|
-
Valid backend options
|
1607
|
-
---------------------
|
1608
|
-
- 'managed': Outerbounds selects a compute provider based on the model.
|
1609
|
-
- 🚧 'dataplane': Run in your account.
|
1610
|
-
|
1611
|
-
Valid model options
|
1612
|
-
----------------
|
1613
|
-
- 'meta/llama3-8b-instruct': 8B parameter model
|
1614
|
-
- 'meta/llama3-70b-instruct': 70B parameter model
|
1615
|
-
- Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
|
1616
|
-
|
1617
|
-
Parameters
|
1618
|
-
----------
|
1619
|
-
models: list[NIM]
|
1620
|
-
List of NIM containers running models in sidecars.
|
1621
|
-
backend: str
|
1622
|
-
Compute provider to run the NIM container.
|
1623
|
-
"""
|
1624
|
-
...
|
1625
|
-
|
1626
|
-
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1627
|
-
"""
|
1628
|
-
Specifies what flows belong to the same project.
|
1629
|
-
|
1630
|
-
A project-specific namespace is created for all flows that
|
1631
|
-
use the same `@project(name)`.
|
1632
|
-
|
1633
|
-
Parameters
|
1634
|
-
----------
|
1635
|
-
name : str
|
1636
|
-
Project name. Make sure that the name is unique amongst all
|
1637
|
-
projects that use the same production scheduler. The name may
|
1638
|
-
contain only lowercase alphanumeric characters and underscores.
|
1639
|
-
|
1640
|
-
|
1641
|
-
"""
|
1642
|
-
...
|
1643
|
-
|
1644
1777
|
@typing.overload
|
1645
1778
|
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]]:
|
1646
1779
|
"""
|
@@ -1744,139 +1877,6 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
1744
1877
|
"""
|
1745
1878
|
...
|
1746
1879
|
|
1747
|
-
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]]:
|
1748
|
-
"""
|
1749
|
-
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.
|
1750
|
-
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.
|
1751
|
-
|
1752
|
-
Parameters
|
1753
|
-
----------
|
1754
|
-
timeout : int
|
1755
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
1756
|
-
poke_interval : int
|
1757
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
1758
|
-
mode : str
|
1759
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1760
|
-
exponential_backoff : bool
|
1761
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1762
|
-
pool : str
|
1763
|
-
the slot pool this task should run in,
|
1764
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1765
|
-
soft_fail : bool
|
1766
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1767
|
-
name : str
|
1768
|
-
Name of the sensor on Airflow
|
1769
|
-
description : str
|
1770
|
-
Description of sensor in the Airflow UI
|
1771
|
-
external_dag_id : str
|
1772
|
-
The dag_id that contains the task you want to wait for.
|
1773
|
-
external_task_ids : List[str]
|
1774
|
-
The list of task_ids that you want to wait for.
|
1775
|
-
If None (default value) the sensor waits for the DAG. (Default: None)
|
1776
|
-
allowed_states : List[str]
|
1777
|
-
Iterable of allowed states, (Default: ['success'])
|
1778
|
-
failed_states : List[str]
|
1779
|
-
Iterable of failed or dis-allowed states. (Default: None)
|
1780
|
-
execution_delta : datetime.timedelta
|
1781
|
-
time difference with the previous execution to look at,
|
1782
|
-
the default is the same logical date as the current task or DAG. (Default: None)
|
1783
|
-
check_existence: bool
|
1784
|
-
Set to True to check if the external task exists or check if
|
1785
|
-
the DAG to wait for exists. (Default: True)
|
1786
|
-
"""
|
1787
|
-
...
|
1788
|
-
|
1789
|
-
@typing.overload
|
1790
|
-
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]]:
|
1791
|
-
"""
|
1792
|
-
Specifies the times when the flow should be run when running on a
|
1793
|
-
production scheduler.
|
1794
|
-
|
1795
|
-
Parameters
|
1796
|
-
----------
|
1797
|
-
hourly : bool, default False
|
1798
|
-
Run the workflow hourly.
|
1799
|
-
daily : bool, default True
|
1800
|
-
Run the workflow daily.
|
1801
|
-
weekly : bool, default False
|
1802
|
-
Run the workflow weekly.
|
1803
|
-
cron : str, optional, default None
|
1804
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1805
|
-
specified by this expression.
|
1806
|
-
timezone : str, optional, default None
|
1807
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1808
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1809
|
-
"""
|
1810
|
-
...
|
1811
|
-
|
1812
|
-
@typing.overload
|
1813
|
-
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1814
|
-
...
|
1815
|
-
|
1816
|
-
def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
|
1817
|
-
"""
|
1818
|
-
Specifies the times when the flow should be run when running on a
|
1819
|
-
production scheduler.
|
1820
|
-
|
1821
|
-
Parameters
|
1822
|
-
----------
|
1823
|
-
hourly : bool, default False
|
1824
|
-
Run the workflow hourly.
|
1825
|
-
daily : bool, default True
|
1826
|
-
Run the workflow daily.
|
1827
|
-
weekly : bool, default False
|
1828
|
-
Run the workflow weekly.
|
1829
|
-
cron : str, optional, default None
|
1830
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1831
|
-
specified by this expression.
|
1832
|
-
timezone : str, optional, default None
|
1833
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1834
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1835
|
-
"""
|
1836
|
-
...
|
1837
|
-
|
1838
|
-
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]]:
|
1839
|
-
"""
|
1840
|
-
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)
|
1841
|
-
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1842
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1843
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1844
|
-
starts only after all sensors finish.
|
1845
|
-
|
1846
|
-
Parameters
|
1847
|
-
----------
|
1848
|
-
timeout : int
|
1849
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
1850
|
-
poke_interval : int
|
1851
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
1852
|
-
mode : str
|
1853
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1854
|
-
exponential_backoff : bool
|
1855
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1856
|
-
pool : str
|
1857
|
-
the slot pool this task should run in,
|
1858
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1859
|
-
soft_fail : bool
|
1860
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1861
|
-
name : str
|
1862
|
-
Name of the sensor on Airflow
|
1863
|
-
description : str
|
1864
|
-
Description of sensor in the Airflow UI
|
1865
|
-
bucket_key : Union[str, List[str]]
|
1866
|
-
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1867
|
-
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1868
|
-
bucket_name : str
|
1869
|
-
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1870
|
-
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1871
|
-
wildcard_match : bool
|
1872
|
-
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1873
|
-
aws_conn_id : str
|
1874
|
-
a reference to the s3 connection on Airflow. (Default: None)
|
1875
|
-
verify : bool
|
1876
|
-
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1877
|
-
"""
|
1878
|
-
...
|
1879
|
-
|
1880
1880
|
def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
|
1881
1881
|
"""
|
1882
1882
|
Switch namespace to the one provided.
|