ob-metaflow-stubs 5.0__py2.py3-none-any.whl → 5.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 +336 -336
- metaflow-stubs/cards.pyi +5 -5
- metaflow-stubs/cli.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +5 -5
- 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 +3 -3
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +5 -5
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +4 -4
- metaflow-stubs/metadata/metadata.pyi +3 -3
- metaflow-stubs/metadata/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +4 -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 +3 -3
- metaflow-stubs/plugins/__init__.pyi +3 -3
- metaflow-stubs/plugins/airflow/__init__.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 +2 -2
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
- 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 +45 -11
- metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +14 -14
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +5 -5
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +4 -4
- metaflow-stubs/plugins/aws/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_client.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/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_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +3 -3
- 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 +6 -6
- metaflow-stubs/plugins/cards/card_client.pyi +3 -3
- metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
- metaflow-stubs/plugins/cards/card_decorator.pyi +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/components.pyi +5 -5
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +3 -3
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +4 -4
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +3 -3
- metaflow-stubs/plugins/datatools/__init__.pyi +3 -3
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +3 -3
- metaflow-stubs/plugins/datatools/s3/s3.pyi +5 -5
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
- metaflow-stubs/plugins/debug_logger.pyi +2 -2
- metaflow-stubs/plugins/debug_monitor.pyi +2 -2
- metaflow-stubs/plugins/environment_decorator.pyi +2 -2
- metaflow-stubs/plugins/events_decorator.pyi +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 +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -4
- metaflow-stubs/plugins/logs_cli.pyi +3 -3
- 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 +3 -3
- metaflow-stubs/plugins/pypi/utils.pyi +2 -2
- metaflow-stubs/plugins/resources_decorator.pyi +2 -2
- metaflow-stubs/plugins/retry_decorator.pyi +2 -2
- metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
- metaflow-stubs/plugins/storage_executor.pyi +2 -2
- metaflow-stubs/plugins/tag_cli.pyi +5 -5
- 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 +3 -3
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- {ob_metaflow_stubs-5.0.dist-info → ob_metaflow_stubs-5.2.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-5.2.dist-info/RECORD +137 -0
- ob_metaflow_stubs-5.0.dist-info/RECORD +0 -137
- {ob_metaflow_stubs-5.0.dist-info → ob_metaflow_stubs-5.2.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-5.0.dist-info → ob_metaflow_stubs-5.2.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-08-
|
3
|
+
# MF version: 2.12.12.0+ob(v1) #
|
4
|
+
# Generated on 2024-08-14T18:23:51.845623 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -10,16 +10,16 @@ import typing
|
|
10
10
|
if typing.TYPE_CHECKING:
|
11
11
|
import metaflow.events
|
12
12
|
import metaflow.flowspec
|
13
|
-
import metaflow.parameters
|
14
|
-
import metaflow.metaflow_current
|
15
13
|
import io
|
14
|
+
import typing
|
15
|
+
import datetime
|
16
|
+
import metaflow.runner.metaflow_runner
|
16
17
|
import metaflow.client.core
|
18
|
+
import metaflow.plugins.datatools.s3.s3
|
19
|
+
import metaflow.metaflow_current
|
20
|
+
import metaflow.parameters
|
17
21
|
import metaflow.datastore.inputs
|
18
|
-
import metaflow.runner.metaflow_runner
|
19
|
-
import typing
|
20
22
|
import metaflow._vendor.click.types
|
21
|
-
import metaflow.plugins.datatools.s3.s3
|
22
|
-
import datetime
|
23
23
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
24
24
|
StepFlag = typing.NewType("StepFlag", bool)
|
25
25
|
|
@@ -784,37 +784,6 @@ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
784
784
|
"""
|
785
785
|
...
|
786
786
|
|
787
|
-
@typing.overload
|
788
|
-
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]]]:
|
789
|
-
"""
|
790
|
-
Specifies environment variables to be set prior to the execution of a step.
|
791
|
-
|
792
|
-
Parameters
|
793
|
-
----------
|
794
|
-
vars : Dict[str, str], default {}
|
795
|
-
Dictionary of environment variables to set.
|
796
|
-
"""
|
797
|
-
...
|
798
|
-
|
799
|
-
@typing.overload
|
800
|
-
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
801
|
-
...
|
802
|
-
|
803
|
-
@typing.overload
|
804
|
-
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
805
|
-
...
|
806
|
-
|
807
|
-
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
808
|
-
"""
|
809
|
-
Specifies environment variables to be set prior to the execution of a step.
|
810
|
-
|
811
|
-
Parameters
|
812
|
-
----------
|
813
|
-
vars : Dict[str, str], default {}
|
814
|
-
Dictionary of environment variables to set.
|
815
|
-
"""
|
816
|
-
...
|
817
|
-
|
818
787
|
@typing.overload
|
819
788
|
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]]]:
|
820
789
|
"""
|
@@ -864,57 +833,6 @@ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
|
|
864
833
|
"""
|
865
834
|
...
|
866
835
|
|
867
|
-
@typing.overload
|
868
|
-
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]]]:
|
869
|
-
"""
|
870
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
871
|
-
|
872
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
873
|
-
|
874
|
-
Parameters
|
875
|
-
----------
|
876
|
-
type : str, default 'default'
|
877
|
-
Card type.
|
878
|
-
id : str, optional, default None
|
879
|
-
If multiple cards are present, use this id to identify this card.
|
880
|
-
options : Dict[str, Any], default {}
|
881
|
-
Options passed to the card. The contents depend on the card type.
|
882
|
-
timeout : int, default 45
|
883
|
-
Interrupt reporting if it takes more than this many seconds.
|
884
|
-
|
885
|
-
|
886
|
-
"""
|
887
|
-
...
|
888
|
-
|
889
|
-
@typing.overload
|
890
|
-
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
891
|
-
...
|
892
|
-
|
893
|
-
@typing.overload
|
894
|
-
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
895
|
-
...
|
896
|
-
|
897
|
-
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):
|
898
|
-
"""
|
899
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
900
|
-
|
901
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
902
|
-
|
903
|
-
Parameters
|
904
|
-
----------
|
905
|
-
type : str, default 'default'
|
906
|
-
Card type.
|
907
|
-
id : str, optional, default None
|
908
|
-
If multiple cards are present, use this id to identify this card.
|
909
|
-
options : Dict[str, Any], default {}
|
910
|
-
Options passed to the card. The contents depend on the card type.
|
911
|
-
timeout : int, default 45
|
912
|
-
Interrupt reporting if it takes more than this many seconds.
|
913
|
-
|
914
|
-
|
915
|
-
"""
|
916
|
-
...
|
917
|
-
|
918
836
|
@typing.overload
|
919
837
|
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]]]:
|
920
838
|
"""
|
@@ -968,63 +886,6 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
968
886
|
"""
|
969
887
|
...
|
970
888
|
|
971
|
-
@typing.overload
|
972
|
-
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]]]:
|
973
|
-
"""
|
974
|
-
Specifies a timeout for your step.
|
975
|
-
|
976
|
-
This decorator is useful if this step may hang indefinitely.
|
977
|
-
|
978
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
979
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
980
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
981
|
-
|
982
|
-
Note that all the values specified in parameters are added together so if you specify
|
983
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
984
|
-
|
985
|
-
Parameters
|
986
|
-
----------
|
987
|
-
seconds : int, default 0
|
988
|
-
Number of seconds to wait prior to timing out.
|
989
|
-
minutes : int, default 0
|
990
|
-
Number of minutes to wait prior to timing out.
|
991
|
-
hours : int, default 0
|
992
|
-
Number of hours to wait prior to timing out.
|
993
|
-
"""
|
994
|
-
...
|
995
|
-
|
996
|
-
@typing.overload
|
997
|
-
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
998
|
-
...
|
999
|
-
|
1000
|
-
@typing.overload
|
1001
|
-
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1002
|
-
...
|
1003
|
-
|
1004
|
-
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):
|
1005
|
-
"""
|
1006
|
-
Specifies a timeout for your step.
|
1007
|
-
|
1008
|
-
This decorator is useful if this step may hang indefinitely.
|
1009
|
-
|
1010
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
1011
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
1012
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
1013
|
-
|
1014
|
-
Note that all the values specified in parameters are added together so if you specify
|
1015
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
1016
|
-
|
1017
|
-
Parameters
|
1018
|
-
----------
|
1019
|
-
seconds : int, default 0
|
1020
|
-
Number of seconds to wait prior to timing out.
|
1021
|
-
minutes : int, default 0
|
1022
|
-
Number of minutes to wait prior to timing out.
|
1023
|
-
hours : int, default 0
|
1024
|
-
Number of hours to wait prior to timing out.
|
1025
|
-
"""
|
1026
|
-
...
|
1027
|
-
|
1028
889
|
@typing.overload
|
1029
890
|
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]]]:
|
1030
891
|
"""
|
@@ -1210,6 +1071,57 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
|
|
1210
1071
|
"""
|
1211
1072
|
...
|
1212
1073
|
|
1074
|
+
@typing.overload
|
1075
|
+
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]]]:
|
1076
|
+
"""
|
1077
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
1078
|
+
|
1079
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1080
|
+
|
1081
|
+
Parameters
|
1082
|
+
----------
|
1083
|
+
type : str, default 'default'
|
1084
|
+
Card type.
|
1085
|
+
id : str, optional, default None
|
1086
|
+
If multiple cards are present, use this id to identify this card.
|
1087
|
+
options : Dict[str, Any], default {}
|
1088
|
+
Options passed to the card. The contents depend on the card type.
|
1089
|
+
timeout : int, default 45
|
1090
|
+
Interrupt reporting if it takes more than this many seconds.
|
1091
|
+
|
1092
|
+
|
1093
|
+
"""
|
1094
|
+
...
|
1095
|
+
|
1096
|
+
@typing.overload
|
1097
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1098
|
+
...
|
1099
|
+
|
1100
|
+
@typing.overload
|
1101
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1102
|
+
...
|
1103
|
+
|
1104
|
+
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):
|
1105
|
+
"""
|
1106
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
1107
|
+
|
1108
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1109
|
+
|
1110
|
+
Parameters
|
1111
|
+
----------
|
1112
|
+
type : str, default 'default'
|
1113
|
+
Card type.
|
1114
|
+
id : str, optional, default None
|
1115
|
+
If multiple cards are present, use this id to identify this card.
|
1116
|
+
options : Dict[str, Any], default {}
|
1117
|
+
Options passed to the card. The contents depend on the card type.
|
1118
|
+
timeout : int, default 45
|
1119
|
+
Interrupt reporting if it takes more than this many seconds.
|
1120
|
+
|
1121
|
+
|
1122
|
+
"""
|
1123
|
+
...
|
1124
|
+
|
1213
1125
|
@typing.overload
|
1214
1126
|
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1215
1127
|
"""
|
@@ -1262,76 +1174,225 @@ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
1262
1174
|
"""
|
1263
1175
|
...
|
1264
1176
|
|
1265
|
-
|
1177
|
+
@typing.overload
|
1178
|
+
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]]]:
|
1266
1179
|
"""
|
1267
|
-
|
1268
|
-
|
1269
|
-
User code call
|
1270
|
-
-----------
|
1271
|
-
@nim(
|
1272
|
-
models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
|
1273
|
-
backend='managed'
|
1274
|
-
)
|
1275
|
-
|
1276
|
-
Valid backend options
|
1277
|
-
---------------------
|
1278
|
-
- 'managed': Outerbounds selects a compute provider based on the model.
|
1279
|
-
- 🚧 'dataplane': Run in your account.
|
1280
|
-
|
1281
|
-
Valid model options
|
1282
|
-
----------------
|
1283
|
-
- 'meta/llama3-8b-instruct': 8B parameter model
|
1284
|
-
- 'meta/llama3-70b-instruct': 70B parameter model
|
1285
|
-
- Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
|
1180
|
+
Specifies environment variables to be set prior to the execution of a step.
|
1286
1181
|
|
1287
1182
|
Parameters
|
1288
1183
|
----------
|
1289
|
-
|
1290
|
-
|
1291
|
-
backend: str
|
1292
|
-
Compute provider to run the NIM container.
|
1184
|
+
vars : Dict[str, str], default {}
|
1185
|
+
Dictionary of environment variables to set.
|
1293
1186
|
"""
|
1294
1187
|
...
|
1295
1188
|
|
1296
|
-
|
1189
|
+
@typing.overload
|
1190
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1191
|
+
...
|
1192
|
+
|
1193
|
+
@typing.overload
|
1194
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1195
|
+
...
|
1196
|
+
|
1197
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
1297
1198
|
"""
|
1298
|
-
|
1299
|
-
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1300
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1301
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1302
|
-
starts only after all sensors finish.
|
1199
|
+
Specifies environment variables to be set prior to the execution of a step.
|
1303
1200
|
|
1304
1201
|
Parameters
|
1305
1202
|
----------
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1203
|
+
vars : Dict[str, str], default {}
|
1204
|
+
Dictionary of environment variables to set.
|
1205
|
+
"""
|
1206
|
+
...
|
1207
|
+
|
1208
|
+
@typing.overload
|
1209
|
+
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]]]:
|
1210
|
+
"""
|
1211
|
+
Specifies a timeout for your step.
|
1212
|
+
|
1213
|
+
This decorator is useful if this step may hang indefinitely.
|
1214
|
+
|
1215
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
1216
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
1217
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
1218
|
+
|
1219
|
+
Note that all the values specified in parameters are added together so if you specify
|
1220
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
1221
|
+
|
1222
|
+
Parameters
|
1223
|
+
----------
|
1224
|
+
seconds : int, default 0
|
1225
|
+
Number of seconds to wait prior to timing out.
|
1226
|
+
minutes : int, default 0
|
1227
|
+
Number of minutes to wait prior to timing out.
|
1228
|
+
hours : int, default 0
|
1229
|
+
Number of hours to wait prior to timing out.
|
1230
|
+
"""
|
1231
|
+
...
|
1232
|
+
|
1233
|
+
@typing.overload
|
1234
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1235
|
+
...
|
1236
|
+
|
1237
|
+
@typing.overload
|
1238
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1239
|
+
...
|
1240
|
+
|
1241
|
+
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):
|
1242
|
+
"""
|
1243
|
+
Specifies a timeout for your step.
|
1244
|
+
|
1245
|
+
This decorator is useful if this step may hang indefinitely.
|
1246
|
+
|
1247
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
1248
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
1249
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
1250
|
+
|
1251
|
+
Note that all the values specified in parameters are added together so if you specify
|
1252
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
1253
|
+
|
1254
|
+
Parameters
|
1255
|
+
----------
|
1256
|
+
seconds : int, default 0
|
1257
|
+
Number of seconds to wait prior to timing out.
|
1258
|
+
minutes : int, default 0
|
1259
|
+
Number of minutes to wait prior to timing out.
|
1260
|
+
hours : int, default 0
|
1261
|
+
Number of hours to wait prior to timing out.
|
1262
|
+
"""
|
1263
|
+
...
|
1264
|
+
|
1265
|
+
@typing.overload
|
1266
|
+
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]]:
|
1267
|
+
"""
|
1268
|
+
Specifies the event(s) that this flow depends on.
|
1269
|
+
|
1270
|
+
```
|
1271
|
+
@trigger(event='foo')
|
1272
|
+
```
|
1273
|
+
or
|
1274
|
+
```
|
1275
|
+
@trigger(events=['foo', 'bar'])
|
1276
|
+
```
|
1277
|
+
|
1278
|
+
Additionally, you can specify the parameter mappings
|
1279
|
+
to map event payload to Metaflow parameters for the flow.
|
1280
|
+
```
|
1281
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1282
|
+
```
|
1283
|
+
or
|
1284
|
+
```
|
1285
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1286
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1287
|
+
```
|
1288
|
+
|
1289
|
+
'parameters' can also be a list of strings and tuples like so:
|
1290
|
+
```
|
1291
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1292
|
+
```
|
1293
|
+
This is equivalent to:
|
1294
|
+
```
|
1295
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1296
|
+
```
|
1297
|
+
|
1298
|
+
Parameters
|
1299
|
+
----------
|
1300
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
1301
|
+
Event dependency for this flow.
|
1302
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
1303
|
+
Events dependency for this flow.
|
1304
|
+
options : Dict[str, Any], default {}
|
1305
|
+
Backend-specific configuration for tuning eventing behavior.
|
1306
|
+
|
1307
|
+
|
1308
|
+
"""
|
1309
|
+
...
|
1310
|
+
|
1311
|
+
@typing.overload
|
1312
|
+
def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1313
|
+
...
|
1314
|
+
|
1315
|
+
def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
|
1316
|
+
"""
|
1317
|
+
Specifies the event(s) that this flow depends on.
|
1318
|
+
|
1319
|
+
```
|
1320
|
+
@trigger(event='foo')
|
1321
|
+
```
|
1322
|
+
or
|
1323
|
+
```
|
1324
|
+
@trigger(events=['foo', 'bar'])
|
1325
|
+
```
|
1326
|
+
|
1327
|
+
Additionally, you can specify the parameter mappings
|
1328
|
+
to map event payload to Metaflow parameters for the flow.
|
1329
|
+
```
|
1330
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1331
|
+
```
|
1332
|
+
or
|
1333
|
+
```
|
1334
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1335
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1336
|
+
```
|
1337
|
+
|
1338
|
+
'parameters' can also be a list of strings and tuples like so:
|
1339
|
+
```
|
1340
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1341
|
+
```
|
1342
|
+
This is equivalent to:
|
1343
|
+
```
|
1344
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1345
|
+
```
|
1346
|
+
|
1347
|
+
Parameters
|
1348
|
+
----------
|
1349
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
1350
|
+
Event dependency for this flow.
|
1351
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
1352
|
+
Events dependency for this flow.
|
1353
|
+
options : Dict[str, Any], default {}
|
1354
|
+
Backend-specific configuration for tuning eventing behavior.
|
1355
|
+
|
1356
|
+
|
1357
|
+
"""
|
1358
|
+
...
|
1359
|
+
|
1360
|
+
@typing.overload
|
1361
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1362
|
+
"""
|
1363
|
+
Specifies the PyPI packages for all steps of the flow.
|
1364
|
+
|
1365
|
+
Use `@pypi_base` to set common packages required by all
|
1366
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1367
|
+
Parameters
|
1368
|
+
----------
|
1369
|
+
packages : Dict[str, str], default: {}
|
1370
|
+
Packages to use for this flow. The key is the name of the package
|
1371
|
+
and the value is the version to use.
|
1372
|
+
python : str, optional, default: None
|
1373
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1374
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1375
|
+
"""
|
1376
|
+
...
|
1377
|
+
|
1378
|
+
@typing.overload
|
1379
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1380
|
+
...
|
1381
|
+
|
1382
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1383
|
+
"""
|
1384
|
+
Specifies the PyPI packages for all steps of the flow.
|
1385
|
+
|
1386
|
+
Use `@pypi_base` to set common packages required by all
|
1387
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1388
|
+
Parameters
|
1389
|
+
----------
|
1390
|
+
packages : Dict[str, str], default: {}
|
1391
|
+
Packages to use for this flow. The key is the name of the package
|
1392
|
+
and the value is the version to use.
|
1393
|
+
python : str, optional, default: None
|
1394
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1395
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1335
1396
|
"""
|
1336
1397
|
...
|
1337
1398
|
|
@@ -1529,63 +1590,6 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
1529
1590
|
"""
|
1530
1591
|
...
|
1531
1592
|
|
1532
|
-
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1533
|
-
"""
|
1534
|
-
Specifies what flows belong to the same project.
|
1535
|
-
|
1536
|
-
A project-specific namespace is created for all flows that
|
1537
|
-
use the same `@project(name)`.
|
1538
|
-
|
1539
|
-
Parameters
|
1540
|
-
----------
|
1541
|
-
name : str
|
1542
|
-
Project name. Make sure that the name is unique amongst all
|
1543
|
-
projects that use the same production scheduler. The name may
|
1544
|
-
contain only lowercase alphanumeric characters and underscores.
|
1545
|
-
|
1546
|
-
|
1547
|
-
"""
|
1548
|
-
...
|
1549
|
-
|
1550
|
-
@typing.overload
|
1551
|
-
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1552
|
-
"""
|
1553
|
-
Specifies the PyPI packages for all steps of the flow.
|
1554
|
-
|
1555
|
-
Use `@pypi_base` to set common packages required by all
|
1556
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1557
|
-
Parameters
|
1558
|
-
----------
|
1559
|
-
packages : Dict[str, str], default: {}
|
1560
|
-
Packages to use for this flow. The key is the name of the package
|
1561
|
-
and the value is the version to use.
|
1562
|
-
python : str, optional, default: None
|
1563
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1564
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1565
|
-
"""
|
1566
|
-
...
|
1567
|
-
|
1568
|
-
@typing.overload
|
1569
|
-
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1570
|
-
...
|
1571
|
-
|
1572
|
-
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1573
|
-
"""
|
1574
|
-
Specifies the PyPI packages for all steps of the flow.
|
1575
|
-
|
1576
|
-
Use `@pypi_base` to set common packages required by all
|
1577
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1578
|
-
Parameters
|
1579
|
-
----------
|
1580
|
-
packages : Dict[str, str], default: {}
|
1581
|
-
Packages to use for this flow. The key is the name of the package
|
1582
|
-
and the value is the version to use.
|
1583
|
-
python : str, optional, default: None
|
1584
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1585
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1586
|
-
"""
|
1587
|
-
...
|
1588
|
-
|
1589
1593
|
@typing.overload
|
1590
1594
|
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]]:
|
1591
1595
|
"""
|
@@ -1635,98 +1639,94 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
|
|
1635
1639
|
"""
|
1636
1640
|
...
|
1637
1641
|
|
1638
|
-
|
1639
|
-
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]]:
|
1642
|
+
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1640
1643
|
"""
|
1641
|
-
Specifies
|
1642
|
-
|
1643
|
-
```
|
1644
|
-
@trigger(event='foo')
|
1645
|
-
```
|
1646
|
-
or
|
1647
|
-
```
|
1648
|
-
@trigger(events=['foo', 'bar'])
|
1649
|
-
```
|
1650
|
-
|
1651
|
-
Additionally, you can specify the parameter mappings
|
1652
|
-
to map event payload to Metaflow parameters for the flow.
|
1653
|
-
```
|
1654
|
-
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1655
|
-
```
|
1656
|
-
or
|
1657
|
-
```
|
1658
|
-
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1659
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1660
|
-
```
|
1644
|
+
Specifies what flows belong to the same project.
|
1661
1645
|
|
1662
|
-
|
1663
|
-
|
1664
|
-
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1665
|
-
```
|
1666
|
-
This is equivalent to:
|
1667
|
-
```
|
1668
|
-
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1669
|
-
```
|
1646
|
+
A project-specific namespace is created for all flows that
|
1647
|
+
use the same `@project(name)`.
|
1670
1648
|
|
1671
1649
|
Parameters
|
1672
1650
|
----------
|
1673
|
-
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
options : Dict[str, Any], default {}
|
1678
|
-
Backend-specific configuration for tuning eventing behavior.
|
1651
|
+
name : str
|
1652
|
+
Project name. Make sure that the name is unique amongst all
|
1653
|
+
projects that use the same production scheduler. The name may
|
1654
|
+
contain only lowercase alphanumeric characters and underscores.
|
1679
1655
|
|
1680
1656
|
|
1681
1657
|
"""
|
1682
1658
|
...
|
1683
1659
|
|
1684
|
-
|
1685
|
-
|
1660
|
+
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]]:
|
1661
|
+
"""
|
1662
|
+
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)
|
1663
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1664
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1665
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1666
|
+
starts only after all sensors finish.
|
1667
|
+
|
1668
|
+
Parameters
|
1669
|
+
----------
|
1670
|
+
timeout : int
|
1671
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1672
|
+
poke_interval : int
|
1673
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1674
|
+
mode : str
|
1675
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1676
|
+
exponential_backoff : bool
|
1677
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1678
|
+
pool : str
|
1679
|
+
the slot pool this task should run in,
|
1680
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1681
|
+
soft_fail : bool
|
1682
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1683
|
+
name : str
|
1684
|
+
Name of the sensor on Airflow
|
1685
|
+
description : str
|
1686
|
+
Description of sensor in the Airflow UI
|
1687
|
+
bucket_key : Union[str, List[str]]
|
1688
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1689
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1690
|
+
bucket_name : str
|
1691
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1692
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1693
|
+
wildcard_match : bool
|
1694
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1695
|
+
aws_conn_id : str
|
1696
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1697
|
+
verify : bool
|
1698
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1699
|
+
"""
|
1686
1700
|
...
|
1687
1701
|
|
1688
|
-
def
|
1702
|
+
def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1689
1703
|
"""
|
1690
|
-
|
1704
|
+
This decorator is used to run NIM containers in Metaflow tasks as sidecars.
|
1691
1705
|
|
1692
|
-
|
1693
|
-
|
1694
|
-
|
1695
|
-
|
1696
|
-
|
1697
|
-
|
1698
|
-
```
|
1706
|
+
User code call
|
1707
|
+
-----------
|
1708
|
+
@nim(
|
1709
|
+
models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
|
1710
|
+
backend='managed'
|
1711
|
+
)
|
1699
1712
|
|
1700
|
-
|
1701
|
-
|
1702
|
-
|
1703
|
-
|
1704
|
-
```
|
1705
|
-
or
|
1706
|
-
```
|
1707
|
-
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1708
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1709
|
-
```
|
1713
|
+
Valid backend options
|
1714
|
+
---------------------
|
1715
|
+
- 'managed': Outerbounds selects a compute provider based on the model.
|
1716
|
+
- 🚧 'dataplane': Run in your account.
|
1710
1717
|
|
1711
|
-
|
1712
|
-
|
1713
|
-
|
1714
|
-
|
1715
|
-
|
1716
|
-
```
|
1717
|
-
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1718
|
-
```
|
1718
|
+
Valid model options
|
1719
|
+
----------------
|
1720
|
+
- 'meta/llama3-8b-instruct': 8B parameter model
|
1721
|
+
- 'meta/llama3-70b-instruct': 70B parameter model
|
1722
|
+
- Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
|
1719
1723
|
|
1720
1724
|
Parameters
|
1721
1725
|
----------
|
1722
|
-
|
1723
|
-
|
1724
|
-
|
1725
|
-
|
1726
|
-
options : Dict[str, Any], default {}
|
1727
|
-
Backend-specific configuration for tuning eventing behavior.
|
1728
|
-
|
1729
|
-
|
1726
|
+
models: list[NIM]
|
1727
|
+
List of NIM containers running models in sidecars.
|
1728
|
+
backend: str
|
1729
|
+
Compute provider to run the NIM container.
|
1730
1730
|
"""
|
1731
1731
|
...
|
1732
1732
|
|