ob-metaflow-stubs 5.2__py2.py3-none-any.whl → 5.4__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 +473 -453
- metaflow-stubs/cards.pyi +6 -6
- metaflow-stubs/cli.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +4 -4
- metaflow-stubs/client/core.pyi +7 -7
- metaflow-stubs/client/filecache.pyi +2 -2
- metaflow-stubs/clone_util.pyi +2 -2
- metaflow-stubs/events.pyi +2 -2
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +6 -6
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +2 -2
- metaflow-stubs/metadata/metadata.pyi +3 -3
- metaflow-stubs/metadata/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +22 -6
- metaflow-stubs/metaflow_current.pyi +24 -24
- 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 +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 +5 -7
- metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +8 -6
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +6 -6
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +20 -5
- metaflow-stubs/plugins/aws/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_utils.pyi +5 -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/batch/batch_decorator.pyi +145 -0
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
- 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 +20 -5
- 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 +4 -4
- metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
- metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/cards/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_cli.pyi +5 -5
- metaflow-stubs/plugins/cards/card_client.pyi +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 +3 -3
- metaflow-stubs/plugins/cards/card_modules/card.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 +4 -4
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +3 -3
- 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 +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 +2 -2
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +4 -4
- 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 +6 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
- 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 +3 -3
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +6 -2
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
- metaflow-stubs/plugins/pypi/utils.pyi +2 -2
- metaflow-stubs/plugins/resources_decorator.pyi +2 -2
- metaflow-stubs/plugins/retry_decorator.pyi +2 -2
- metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
- metaflow-stubs/plugins/storage_executor.pyi +2 -2
- metaflow-stubs/plugins/tag_cli.pyi +4 -4
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
- metaflow-stubs/plugins/timeout_decorator.pyi +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 +22 -7
- metaflow-stubs/runner/metaflow_runner.pyi +4 -4
- metaflow-stubs/runner/nbdeploy.pyi +4 -4
- metaflow-stubs/runner/nbrun.pyi +4 -4
- 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 +3 -3
- 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-5.2.dist-info → ob_metaflow_stubs-5.4.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-5.4.dist-info/RECORD +138 -0
- ob_metaflow_stubs-5.2.dist-info/RECORD +0 -137
- {ob_metaflow_stubs-5.2.dist-info → ob_metaflow_stubs-5.4.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-5.2.dist-info → ob_metaflow_stubs-5.4.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-08-
|
3
|
+
# MF version: 2.12.16.1+ob(v1) #
|
4
|
+
# Generated on 2024-08-26T23:03:56.776768 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
|
-
import metaflow.events
|
12
|
-
import metaflow.flowspec
|
13
11
|
import io
|
14
|
-
import typing
|
15
|
-
import datetime
|
16
|
-
import metaflow.runner.metaflow_runner
|
17
12
|
import metaflow.client.core
|
13
|
+
import metaflow._vendor.click.types
|
14
|
+
import metaflow.parameters
|
18
15
|
import metaflow.plugins.datatools.s3.s3
|
16
|
+
import metaflow.events
|
17
|
+
import datetime
|
19
18
|
import metaflow.metaflow_current
|
20
|
-
import metaflow.
|
19
|
+
import metaflow.runner.metaflow_runner
|
21
20
|
import metaflow.datastore.inputs
|
22
|
-
import metaflow.
|
21
|
+
import metaflow.flowspec
|
22
|
+
import typing
|
23
23
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
24
24
|
StepFlag = typing.NewType("StepFlag", bool)
|
25
25
|
|
@@ -728,59 +728,82 @@ 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
|
733
|
+
Specifies environment variables to be set prior to the execution of a step.
|
734
734
|
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
735
|
+
Parameters
|
736
|
+
----------
|
737
|
+
vars : Dict[str, str], default {}
|
738
|
+
Dictionary of environment variables to set.
|
739
|
+
"""
|
740
|
+
...
|
741
|
+
|
742
|
+
@typing.overload
|
743
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
744
|
+
...
|
745
|
+
|
746
|
+
@typing.overload
|
747
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
748
|
+
...
|
749
|
+
|
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] = {}):
|
751
|
+
"""
|
752
|
+
Specifies environment variables to be set prior to the execution of a step.
|
739
753
|
|
740
754
|
Parameters
|
741
755
|
----------
|
742
|
-
|
743
|
-
|
744
|
-
and the value is the version to use.
|
745
|
-
libraries : Dict[str, str], default {}
|
746
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
747
|
-
python : str, optional, default None
|
748
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
749
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
750
|
-
disabled : bool, default False
|
751
|
-
If set to True, disables @conda.
|
756
|
+
vars : Dict[str, str], default {}
|
757
|
+
Dictionary of environment variables to set.
|
752
758
|
"""
|
753
759
|
...
|
754
760
|
|
755
761
|
@typing.overload
|
756
|
-
def
|
762
|
+
def catch(*, var: typing.Optional[str] = None, print_exception: bool = True) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
763
|
+
"""
|
764
|
+
Specifies that the step will success under all circumstances.
|
765
|
+
|
766
|
+
The decorator will create an optional artifact, specified by `var`, which
|
767
|
+
contains the exception raised. You can use it to detect the presence
|
768
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
769
|
+
are missing.
|
770
|
+
|
771
|
+
Parameters
|
772
|
+
----------
|
773
|
+
var : str, optional, default None
|
774
|
+
Name of the artifact in which to store the caught exception.
|
775
|
+
If not specified, the exception is not stored.
|
776
|
+
print_exception : bool, default True
|
777
|
+
Determines whether or not the exception is printed to
|
778
|
+
stdout when caught.
|
779
|
+
"""
|
757
780
|
...
|
758
781
|
|
759
782
|
@typing.overload
|
760
|
-
def
|
783
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
761
784
|
...
|
762
785
|
|
763
|
-
|
786
|
+
@typing.overload
|
787
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
788
|
+
...
|
789
|
+
|
790
|
+
def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
|
764
791
|
"""
|
765
|
-
Specifies the
|
792
|
+
Specifies that the step will success under all circumstances.
|
766
793
|
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
794
|
+
The decorator will create an optional artifact, specified by `var`, which
|
795
|
+
contains the exception raised. You can use it to detect the presence
|
796
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
797
|
+
are missing.
|
771
798
|
|
772
799
|
Parameters
|
773
800
|
----------
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
781
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
782
|
-
disabled : bool, default False
|
783
|
-
If set to True, disables @conda.
|
801
|
+
var : str, optional, default None
|
802
|
+
Name of the artifact in which to store the caught exception.
|
803
|
+
If not specified, the exception is not stored.
|
804
|
+
print_exception : bool, default True
|
805
|
+
Determines whether or not the exception is printed to
|
806
|
+
stdout when caught.
|
784
807
|
"""
|
785
808
|
...
|
786
809
|
|
@@ -833,6 +856,96 @@ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
|
|
833
856
|
"""
|
834
857
|
...
|
835
858
|
|
859
|
+
@typing.overload
|
860
|
+
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]]]:
|
861
|
+
"""
|
862
|
+
Specifies a timeout for your step.
|
863
|
+
|
864
|
+
This decorator is useful if this step may hang indefinitely.
|
865
|
+
|
866
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
867
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
868
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
869
|
+
|
870
|
+
Note that all the values specified in parameters are added together so if you specify
|
871
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
872
|
+
|
873
|
+
Parameters
|
874
|
+
----------
|
875
|
+
seconds : int, default 0
|
876
|
+
Number of seconds to wait prior to timing out.
|
877
|
+
minutes : int, default 0
|
878
|
+
Number of minutes to wait prior to timing out.
|
879
|
+
hours : int, default 0
|
880
|
+
Number of hours to wait prior to timing out.
|
881
|
+
"""
|
882
|
+
...
|
883
|
+
|
884
|
+
@typing.overload
|
885
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
886
|
+
...
|
887
|
+
|
888
|
+
@typing.overload
|
889
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
890
|
+
...
|
891
|
+
|
892
|
+
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):
|
893
|
+
"""
|
894
|
+
Specifies a timeout for your step.
|
895
|
+
|
896
|
+
This decorator is useful if this step may hang indefinitely.
|
897
|
+
|
898
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
899
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
900
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
901
|
+
|
902
|
+
Note that all the values specified in parameters are added together so if you specify
|
903
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
904
|
+
|
905
|
+
Parameters
|
906
|
+
----------
|
907
|
+
seconds : int, default 0
|
908
|
+
Number of seconds to wait prior to timing out.
|
909
|
+
minutes : int, default 0
|
910
|
+
Number of minutes to wait prior to timing out.
|
911
|
+
hours : int, default 0
|
912
|
+
Number of hours to wait prior to timing out.
|
913
|
+
"""
|
914
|
+
...
|
915
|
+
|
916
|
+
@typing.overload
|
917
|
+
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]]]:
|
918
|
+
"""
|
919
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
920
|
+
the execution of a step.
|
921
|
+
|
922
|
+
Parameters
|
923
|
+
----------
|
924
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
925
|
+
List of secret specs, defining how the secrets are to be retrieved
|
926
|
+
"""
|
927
|
+
...
|
928
|
+
|
929
|
+
@typing.overload
|
930
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
931
|
+
...
|
932
|
+
|
933
|
+
@typing.overload
|
934
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
935
|
+
...
|
936
|
+
|
937
|
+
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]]] = []):
|
938
|
+
"""
|
939
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
940
|
+
the execution of a step.
|
941
|
+
|
942
|
+
Parameters
|
943
|
+
----------
|
944
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
945
|
+
List of secret specs, defining how the secrets are to be retrieved
|
946
|
+
"""
|
947
|
+
...
|
948
|
+
|
836
949
|
@typing.overload
|
837
950
|
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]]]:
|
838
951
|
"""
|
@@ -886,6 +999,63 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
886
999
|
"""
|
887
1000
|
...
|
888
1001
|
|
1002
|
+
@typing.overload
|
1003
|
+
def conda(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
1004
|
+
"""
|
1005
|
+
Specifies the Conda environment for the step.
|
1006
|
+
|
1007
|
+
Information in this decorator will augment any
|
1008
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
1009
|
+
you can use `@conda_base` to set packages required by all
|
1010
|
+
steps and use `@conda` to specify step-specific overrides.
|
1011
|
+
|
1012
|
+
Parameters
|
1013
|
+
----------
|
1014
|
+
packages : Dict[str, str], default {}
|
1015
|
+
Packages to use for this step. The key is the name of the package
|
1016
|
+
and the value is the version to use.
|
1017
|
+
libraries : Dict[str, str], default {}
|
1018
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1019
|
+
python : str, optional, default None
|
1020
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1021
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1022
|
+
disabled : bool, default False
|
1023
|
+
If set to True, disables @conda.
|
1024
|
+
"""
|
1025
|
+
...
|
1026
|
+
|
1027
|
+
@typing.overload
|
1028
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1029
|
+
...
|
1030
|
+
|
1031
|
+
@typing.overload
|
1032
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1033
|
+
...
|
1034
|
+
|
1035
|
+
def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
1036
|
+
"""
|
1037
|
+
Specifies the Conda environment for the step.
|
1038
|
+
|
1039
|
+
Information in this decorator will augment any
|
1040
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
1041
|
+
you can use `@conda_base` to set packages required by all
|
1042
|
+
steps and use `@conda` to specify step-specific overrides.
|
1043
|
+
|
1044
|
+
Parameters
|
1045
|
+
----------
|
1046
|
+
packages : Dict[str, str], default {}
|
1047
|
+
Packages to use for this step. The key is the name of the package
|
1048
|
+
and the value is the version to use.
|
1049
|
+
libraries : Dict[str, str], default {}
|
1050
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1051
|
+
python : str, optional, default None
|
1052
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1053
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1054
|
+
disabled : bool, default False
|
1055
|
+
If set to True, disables @conda.
|
1056
|
+
"""
|
1057
|
+
...
|
1058
|
+
|
889
1059
|
@typing.overload
|
890
1060
|
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]]]:
|
891
1061
|
"""
|
@@ -964,55 +1134,42 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
964
1134
|
...
|
965
1135
|
|
966
1136
|
@typing.overload
|
967
|
-
def
|
1137
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
968
1138
|
"""
|
969
|
-
|
970
|
-
|
971
|
-
The decorator will create an optional artifact, specified by `var`, which
|
972
|
-
contains the exception raised. You can use it to detect the presence
|
973
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
974
|
-
are missing.
|
975
|
-
|
976
|
-
Parameters
|
977
|
-
----------
|
978
|
-
var : str, optional, default None
|
979
|
-
Name of the artifact in which to store the caught exception.
|
980
|
-
If not specified, the exception is not stored.
|
981
|
-
print_exception : bool, default True
|
982
|
-
Determines whether or not the exception is printed to
|
983
|
-
stdout when caught.
|
1139
|
+
Internal decorator to support Fast bakery
|
984
1140
|
"""
|
985
1141
|
...
|
986
1142
|
|
987
1143
|
@typing.overload
|
988
|
-
def
|
1144
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1145
|
+
...
|
1146
|
+
|
1147
|
+
def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
1148
|
+
"""
|
1149
|
+
Internal decorator to support Fast bakery
|
1150
|
+
"""
|
989
1151
|
...
|
990
1152
|
|
991
1153
|
@typing.overload
|
992
|
-
def
|
1154
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1155
|
+
"""
|
1156
|
+
Decorator prototype for all step decorators. This function gets specialized
|
1157
|
+
and imported for all decorators types by _import_plugin_decorators().
|
1158
|
+
"""
|
993
1159
|
...
|
994
1160
|
|
995
|
-
|
1161
|
+
@typing.overload
|
1162
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1163
|
+
...
|
1164
|
+
|
1165
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
996
1166
|
"""
|
997
|
-
|
998
|
-
|
999
|
-
The decorator will create an optional artifact, specified by `var`, which
|
1000
|
-
contains the exception raised. You can use it to detect the presence
|
1001
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
1002
|
-
are missing.
|
1003
|
-
|
1004
|
-
Parameters
|
1005
|
-
----------
|
1006
|
-
var : str, optional, default None
|
1007
|
-
Name of the artifact in which to store the caught exception.
|
1008
|
-
If not specified, the exception is not stored.
|
1009
|
-
print_exception : bool, default True
|
1010
|
-
Determines whether or not the exception is printed to
|
1011
|
-
stdout when caught.
|
1167
|
+
Decorator prototype for all step decorators. This function gets specialized
|
1168
|
+
and imported for all decorators types by _import_plugin_decorators().
|
1012
1169
|
"""
|
1013
1170
|
...
|
1014
1171
|
|
1015
|
-
def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = "KUBERNETES_IMAGE_PULL_POLICY", service_account: str = "METAFLOW_KUBERNETES_SERVICE_ACCOUNT", secrets: typing.Optional[typing.List[str]] = None, namespace: str = "METAFLOW_KUBERNETES_NAMESPACE", gpu: typing.Optional[int] = None, gpu_vendor: str = "KUBERNETES_GPU_VENDOR", tolerations: typing.List[str] = [], use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = "/metaflow_temp", persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
1172
|
+
def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = "KUBERNETES_IMAGE_PULL_POLICY", service_account: str = "METAFLOW_KUBERNETES_SERVICE_ACCOUNT", secrets: typing.Optional[typing.List[str]] = None, namespace: str = "METAFLOW_KUBERNETES_NAMESPACE", gpu: typing.Optional[int] = None, gpu_vendor: str = "KUBERNETES_GPU_VENDOR", tolerations: typing.List[str] = [], use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = "/metaflow_temp", persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: 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]]]:
|
1016
1173
|
"""
|
1017
1174
|
Specifies that this step should execute on Kubernetes.
|
1018
1175
|
|
@@ -1068,6 +1225,9 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
|
|
1068
1225
|
Shared memory size (in MiB) required for this step
|
1069
1226
|
port: int, optional
|
1070
1227
|
Port number to specify in the Kubernetes job object
|
1228
|
+
compute_pool : str, optional, default None
|
1229
|
+
Compute pool to be used for for this step.
|
1230
|
+
If not specified, any accessible compute pool within the perimeter is used.
|
1071
1231
|
"""
|
1072
1232
|
...
|
1073
1233
|
|
@@ -1123,184 +1283,87 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
|
|
1123
1283
|
...
|
1124
1284
|
|
1125
1285
|
@typing.overload
|
1126
|
-
def
|
1127
|
-
"""
|
1128
|
-
Decorator prototype for all step decorators. This function gets specialized
|
1129
|
-
and imported for all decorators types by _import_plugin_decorators().
|
1130
|
-
"""
|
1131
|
-
...
|
1132
|
-
|
1133
|
-
@typing.overload
|
1134
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1135
|
-
...
|
1136
|
-
|
1137
|
-
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
1138
|
-
"""
|
1139
|
-
Decorator prototype for all step decorators. This function gets specialized
|
1140
|
-
and imported for all decorators types by _import_plugin_decorators().
|
1141
|
-
"""
|
1142
|
-
...
|
1143
|
-
|
1144
|
-
@typing.overload
|
1145
|
-
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]]]:
|
1146
|
-
"""
|
1147
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
1148
|
-
the execution of a step.
|
1149
|
-
|
1150
|
-
Parameters
|
1151
|
-
----------
|
1152
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
1153
|
-
List of secret specs, defining how the secrets are to be retrieved
|
1154
|
-
"""
|
1155
|
-
...
|
1156
|
-
|
1157
|
-
@typing.overload
|
1158
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1159
|
-
...
|
1160
|
-
|
1161
|
-
@typing.overload
|
1162
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1163
|
-
...
|
1164
|
-
|
1165
|
-
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]]] = []):
|
1166
|
-
"""
|
1167
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
1168
|
-
the execution of a step.
|
1169
|
-
|
1170
|
-
Parameters
|
1171
|
-
----------
|
1172
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
1173
|
-
List of secret specs, defining how the secrets are to be retrieved
|
1174
|
-
"""
|
1175
|
-
...
|
1176
|
-
|
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]]]:
|
1179
|
-
"""
|
1180
|
-
Specifies environment variables to be set prior to the execution of a step.
|
1181
|
-
|
1182
|
-
Parameters
|
1183
|
-
----------
|
1184
|
-
vars : Dict[str, str], default {}
|
1185
|
-
Dictionary of environment variables to set.
|
1186
|
-
"""
|
1187
|
-
...
|
1188
|
-
|
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] = {}):
|
1198
|
-
"""
|
1199
|
-
Specifies environment variables to be set prior to the execution of a step.
|
1200
|
-
|
1201
|
-
Parameters
|
1202
|
-
----------
|
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]]]:
|
1286
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1210
1287
|
"""
|
1211
|
-
Specifies
|
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.
|
1288
|
+
Specifies the PyPI packages for all steps of the flow.
|
1221
1289
|
|
1290
|
+
Use `@pypi_base` to set common packages required by all
|
1291
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1222
1292
|
Parameters
|
1223
1293
|
----------
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1294
|
+
packages : Dict[str, str], default: {}
|
1295
|
+
Packages to use for this flow. The key is the name of the package
|
1296
|
+
and the value is the version to use.
|
1297
|
+
python : str, optional, default: None
|
1298
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1299
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1230
1300
|
"""
|
1231
1301
|
...
|
1232
1302
|
|
1233
1303
|
@typing.overload
|
1234
|
-
def
|
1235
|
-
...
|
1236
|
-
|
1237
|
-
@typing.overload
|
1238
|
-
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1304
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1239
1305
|
...
|
1240
1306
|
|
1241
|
-
def
|
1307
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1242
1308
|
"""
|
1243
|
-
Specifies
|
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.
|
1309
|
+
Specifies the PyPI packages for all steps of the flow.
|
1253
1310
|
|
1311
|
+
Use `@pypi_base` to set common packages required by all
|
1312
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1254
1313
|
Parameters
|
1255
1314
|
----------
|
1256
|
-
|
1257
|
-
|
1258
|
-
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1315
|
+
packages : Dict[str, str], default: {}
|
1316
|
+
Packages to use for this flow. The key is the name of the package
|
1317
|
+
and the value is the version to use.
|
1318
|
+
python : str, optional, default: None
|
1319
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1320
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1262
1321
|
"""
|
1263
1322
|
...
|
1264
1323
|
|
1265
1324
|
@typing.overload
|
1266
|
-
def
|
1325
|
+
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]]:
|
1267
1326
|
"""
|
1268
|
-
Specifies the
|
1327
|
+
Specifies the flow(s) that this flow depends on.
|
1269
1328
|
|
1270
1329
|
```
|
1271
|
-
@
|
1330
|
+
@trigger_on_finish(flow='FooFlow')
|
1272
1331
|
```
|
1273
1332
|
or
|
1274
1333
|
```
|
1275
|
-
@
|
1334
|
+
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
1276
1335
|
```
|
1336
|
+
This decorator respects the @project decorator and triggers the flow
|
1337
|
+
when upstream runs within the same namespace complete successfully
|
1277
1338
|
|
1278
|
-
Additionally, you can specify
|
1279
|
-
|
1339
|
+
Additionally, you can specify project aware upstream flow dependencies
|
1340
|
+
by specifying the fully qualified project_flow_name.
|
1280
1341
|
```
|
1281
|
-
@
|
1342
|
+
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
1282
1343
|
```
|
1283
1344
|
or
|
1284
1345
|
```
|
1285
|
-
@
|
1286
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1346
|
+
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
1287
1347
|
```
|
1288
1348
|
|
1289
|
-
|
1290
|
-
|
1291
|
-
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1292
|
-
```
|
1293
|
-
This is equivalent to:
|
1349
|
+
You can also specify just the project or project branch (other values will be
|
1350
|
+
inferred from the current project or project branch):
|
1294
1351
|
```
|
1295
|
-
@
|
1352
|
+
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
1296
1353
|
```
|
1297
1354
|
|
1355
|
+
Note that `branch` is typically one of:
|
1356
|
+
- `prod`
|
1357
|
+
- `user.bob`
|
1358
|
+
- `test.my_experiment`
|
1359
|
+
- `prod.staging`
|
1360
|
+
|
1298
1361
|
Parameters
|
1299
1362
|
----------
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1363
|
+
flow : Union[str, Dict[str, str]], optional, default None
|
1364
|
+
Upstream flow dependency for this flow.
|
1365
|
+
flows : List[Union[str, Dict[str, str]]], default []
|
1366
|
+
Upstream flow dependencies for this flow.
|
1304
1367
|
options : Dict[str, Any], default {}
|
1305
1368
|
Backend-specific configuration for tuning eventing behavior.
|
1306
1369
|
|
@@ -1309,35 +1372,127 @@ def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = No
|
|
1309
1372
|
...
|
1310
1373
|
|
1311
1374
|
@typing.overload
|
1312
|
-
def
|
1375
|
+
def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1313
1376
|
...
|
1314
1377
|
|
1315
|
-
def
|
1378
|
+
def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, flow: typing.Union[str, typing.Dict[str, str], None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}):
|
1316
1379
|
"""
|
1317
|
-
Specifies the
|
1380
|
+
Specifies the flow(s) that this flow depends on.
|
1318
1381
|
|
1319
1382
|
```
|
1320
|
-
@
|
1383
|
+
@trigger_on_finish(flow='FooFlow')
|
1321
1384
|
```
|
1322
1385
|
or
|
1323
1386
|
```
|
1324
|
-
@
|
1387
|
+
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
1325
1388
|
```
|
1389
|
+
This decorator respects the @project decorator and triggers the flow
|
1390
|
+
when upstream runs within the same namespace complete successfully
|
1326
1391
|
|
1327
|
-
Additionally, you can specify
|
1328
|
-
|
1392
|
+
Additionally, you can specify project aware upstream flow dependencies
|
1393
|
+
by specifying the fully qualified project_flow_name.
|
1329
1394
|
```
|
1330
|
-
@
|
1395
|
+
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
1331
1396
|
```
|
1332
1397
|
or
|
1333
1398
|
```
|
1334
|
-
@
|
1335
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1399
|
+
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
1336
1400
|
```
|
1337
1401
|
|
1338
|
-
|
1402
|
+
You can also specify just the project or project branch (other values will be
|
1403
|
+
inferred from the current project or project branch):
|
1339
1404
|
```
|
1340
|
-
@
|
1405
|
+
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
1406
|
+
```
|
1407
|
+
|
1408
|
+
Note that `branch` is typically one of:
|
1409
|
+
- `prod`
|
1410
|
+
- `user.bob`
|
1411
|
+
- `test.my_experiment`
|
1412
|
+
- `prod.staging`
|
1413
|
+
|
1414
|
+
Parameters
|
1415
|
+
----------
|
1416
|
+
flow : Union[str, Dict[str, str]], optional, default None
|
1417
|
+
Upstream flow dependency for this flow.
|
1418
|
+
flows : List[Union[str, Dict[str, str]]], default []
|
1419
|
+
Upstream flow dependencies for this flow.
|
1420
|
+
options : Dict[str, Any], default {}
|
1421
|
+
Backend-specific configuration for tuning eventing behavior.
|
1422
|
+
|
1423
|
+
|
1424
|
+
"""
|
1425
|
+
...
|
1426
|
+
|
1427
|
+
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]]:
|
1428
|
+
"""
|
1429
|
+
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)
|
1430
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1431
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1432
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1433
|
+
starts only after all sensors finish.
|
1434
|
+
|
1435
|
+
Parameters
|
1436
|
+
----------
|
1437
|
+
timeout : int
|
1438
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1439
|
+
poke_interval : int
|
1440
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1441
|
+
mode : str
|
1442
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1443
|
+
exponential_backoff : bool
|
1444
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1445
|
+
pool : str
|
1446
|
+
the slot pool this task should run in,
|
1447
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1448
|
+
soft_fail : bool
|
1449
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1450
|
+
name : str
|
1451
|
+
Name of the sensor on Airflow
|
1452
|
+
description : str
|
1453
|
+
Description of sensor in the Airflow UI
|
1454
|
+
bucket_key : Union[str, List[str]]
|
1455
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1456
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1457
|
+
bucket_name : str
|
1458
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1459
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1460
|
+
wildcard_match : bool
|
1461
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1462
|
+
aws_conn_id : str
|
1463
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1464
|
+
verify : bool
|
1465
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1466
|
+
"""
|
1467
|
+
...
|
1468
|
+
|
1469
|
+
@typing.overload
|
1470
|
+
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]]:
|
1471
|
+
"""
|
1472
|
+
Specifies the event(s) that this flow depends on.
|
1473
|
+
|
1474
|
+
```
|
1475
|
+
@trigger(event='foo')
|
1476
|
+
```
|
1477
|
+
or
|
1478
|
+
```
|
1479
|
+
@trigger(events=['foo', 'bar'])
|
1480
|
+
```
|
1481
|
+
|
1482
|
+
Additionally, you can specify the parameter mappings
|
1483
|
+
to map event payload to Metaflow parameters for the flow.
|
1484
|
+
```
|
1485
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1486
|
+
```
|
1487
|
+
or
|
1488
|
+
```
|
1489
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1490
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1491
|
+
```
|
1492
|
+
|
1493
|
+
'parameters' can also be a list of strings and tuples like so:
|
1494
|
+
```
|
1495
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1341
1496
|
```
|
1342
1497
|
This is equivalent to:
|
1343
1498
|
```
|
@@ -1358,41 +1513,69 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
1358
1513
|
...
|
1359
1514
|
|
1360
1515
|
@typing.overload
|
1361
|
-
def
|
1516
|
+
def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1517
|
+
...
|
1518
|
+
|
1519
|
+
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] = {}):
|
1362
1520
|
"""
|
1363
|
-
Specifies the
|
1521
|
+
Specifies the event(s) that this flow depends on.
|
1522
|
+
|
1523
|
+
```
|
1524
|
+
@trigger(event='foo')
|
1525
|
+
```
|
1526
|
+
or
|
1527
|
+
```
|
1528
|
+
@trigger(events=['foo', 'bar'])
|
1529
|
+
```
|
1530
|
+
|
1531
|
+
Additionally, you can specify the parameter mappings
|
1532
|
+
to map event payload to Metaflow parameters for the flow.
|
1533
|
+
```
|
1534
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1535
|
+
```
|
1536
|
+
or
|
1537
|
+
```
|
1538
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1539
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1540
|
+
```
|
1541
|
+
|
1542
|
+
'parameters' can also be a list of strings and tuples like so:
|
1543
|
+
```
|
1544
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1545
|
+
```
|
1546
|
+
This is equivalent to:
|
1547
|
+
```
|
1548
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1549
|
+
```
|
1364
1550
|
|
1365
|
-
Use `@pypi_base` to set common packages required by all
|
1366
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1367
1551
|
Parameters
|
1368
1552
|
----------
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1553
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
1554
|
+
Event dependency for this flow.
|
1555
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
1556
|
+
Events dependency for this flow.
|
1557
|
+
options : Dict[str, Any], default {}
|
1558
|
+
Backend-specific configuration for tuning eventing behavior.
|
1559
|
+
|
1560
|
+
|
1375
1561
|
"""
|
1376
1562
|
...
|
1377
1563
|
|
1378
|
-
|
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):
|
1564
|
+
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1383
1565
|
"""
|
1384
|
-
Specifies
|
1566
|
+
Specifies what flows belong to the same project.
|
1567
|
+
|
1568
|
+
A project-specific namespace is created for all flows that
|
1569
|
+
use the same `@project(name)`.
|
1385
1570
|
|
1386
|
-
Use `@pypi_base` to set common packages required by all
|
1387
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1388
1571
|
Parameters
|
1389
1572
|
----------
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1573
|
+
name : str
|
1574
|
+
Project name. Make sure that the name is unique amongst all
|
1575
|
+
projects that use the same production scheduler. The name may
|
1576
|
+
contain only lowercase alphanumeric characters and underscores.
|
1577
|
+
|
1578
|
+
|
1396
1579
|
"""
|
1397
1580
|
...
|
1398
1581
|
|
@@ -1438,6 +1621,37 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
|
|
1438
1621
|
"""
|
1439
1622
|
...
|
1440
1623
|
|
1624
|
+
def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1625
|
+
"""
|
1626
|
+
This decorator is used to run NIM containers in Metaflow tasks as sidecars.
|
1627
|
+
|
1628
|
+
User code call
|
1629
|
+
-----------
|
1630
|
+
@nim(
|
1631
|
+
models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
|
1632
|
+
backend='managed'
|
1633
|
+
)
|
1634
|
+
|
1635
|
+
Valid backend options
|
1636
|
+
---------------------
|
1637
|
+
- 'managed': Outerbounds selects a compute provider based on the model.
|
1638
|
+
- 🚧 'dataplane': Run in your account.
|
1639
|
+
|
1640
|
+
Valid model options
|
1641
|
+
----------------
|
1642
|
+
- 'meta/llama3-8b-instruct': 8B parameter model
|
1643
|
+
- 'meta/llama3-70b-instruct': 70B parameter model
|
1644
|
+
- Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
|
1645
|
+
|
1646
|
+
Parameters
|
1647
|
+
----------
|
1648
|
+
models: list[NIM]
|
1649
|
+
List of NIM containers running models in sidecars.
|
1650
|
+
backend: str
|
1651
|
+
Compute provider to run the NIM container.
|
1652
|
+
"""
|
1653
|
+
...
|
1654
|
+
|
1441
1655
|
@typing.overload
|
1442
1656
|
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]]:
|
1443
1657
|
"""
|
@@ -1487,109 +1701,6 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
|
|
1487
1701
|
"""
|
1488
1702
|
...
|
1489
1703
|
|
1490
|
-
@typing.overload
|
1491
|
-
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]]:
|
1492
|
-
"""
|
1493
|
-
Specifies the flow(s) that this flow depends on.
|
1494
|
-
|
1495
|
-
```
|
1496
|
-
@trigger_on_finish(flow='FooFlow')
|
1497
|
-
```
|
1498
|
-
or
|
1499
|
-
```
|
1500
|
-
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
1501
|
-
```
|
1502
|
-
This decorator respects the @project decorator and triggers the flow
|
1503
|
-
when upstream runs within the same namespace complete successfully
|
1504
|
-
|
1505
|
-
Additionally, you can specify project aware upstream flow dependencies
|
1506
|
-
by specifying the fully qualified project_flow_name.
|
1507
|
-
```
|
1508
|
-
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
1509
|
-
```
|
1510
|
-
or
|
1511
|
-
```
|
1512
|
-
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
1513
|
-
```
|
1514
|
-
|
1515
|
-
You can also specify just the project or project branch (other values will be
|
1516
|
-
inferred from the current project or project branch):
|
1517
|
-
```
|
1518
|
-
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
1519
|
-
```
|
1520
|
-
|
1521
|
-
Note that `branch` is typically one of:
|
1522
|
-
- `prod`
|
1523
|
-
- `user.bob`
|
1524
|
-
- `test.my_experiment`
|
1525
|
-
- `prod.staging`
|
1526
|
-
|
1527
|
-
Parameters
|
1528
|
-
----------
|
1529
|
-
flow : Union[str, Dict[str, str]], optional, default None
|
1530
|
-
Upstream flow dependency for this flow.
|
1531
|
-
flows : List[Union[str, Dict[str, str]]], default []
|
1532
|
-
Upstream flow dependencies for this flow.
|
1533
|
-
options : Dict[str, Any], default {}
|
1534
|
-
Backend-specific configuration for tuning eventing behavior.
|
1535
|
-
|
1536
|
-
|
1537
|
-
"""
|
1538
|
-
...
|
1539
|
-
|
1540
|
-
@typing.overload
|
1541
|
-
def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1542
|
-
...
|
1543
|
-
|
1544
|
-
def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, flow: typing.Union[str, typing.Dict[str, str], None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}):
|
1545
|
-
"""
|
1546
|
-
Specifies the flow(s) that this flow depends on.
|
1547
|
-
|
1548
|
-
```
|
1549
|
-
@trigger_on_finish(flow='FooFlow')
|
1550
|
-
```
|
1551
|
-
or
|
1552
|
-
```
|
1553
|
-
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
1554
|
-
```
|
1555
|
-
This decorator respects the @project decorator and triggers the flow
|
1556
|
-
when upstream runs within the same namespace complete successfully
|
1557
|
-
|
1558
|
-
Additionally, you can specify project aware upstream flow dependencies
|
1559
|
-
by specifying the fully qualified project_flow_name.
|
1560
|
-
```
|
1561
|
-
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
1562
|
-
```
|
1563
|
-
or
|
1564
|
-
```
|
1565
|
-
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
1566
|
-
```
|
1567
|
-
|
1568
|
-
You can also specify just the project or project branch (other values will be
|
1569
|
-
inferred from the current project or project branch):
|
1570
|
-
```
|
1571
|
-
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
1572
|
-
```
|
1573
|
-
|
1574
|
-
Note that `branch` is typically one of:
|
1575
|
-
- `prod`
|
1576
|
-
- `user.bob`
|
1577
|
-
- `test.my_experiment`
|
1578
|
-
- `prod.staging`
|
1579
|
-
|
1580
|
-
Parameters
|
1581
|
-
----------
|
1582
|
-
flow : Union[str, Dict[str, str]], optional, default None
|
1583
|
-
Upstream flow dependency for this flow.
|
1584
|
-
flows : List[Union[str, Dict[str, str]]], default []
|
1585
|
-
Upstream flow dependencies for this flow.
|
1586
|
-
options : Dict[str, Any], default {}
|
1587
|
-
Backend-specific configuration for tuning eventing behavior.
|
1588
|
-
|
1589
|
-
|
1590
|
-
"""
|
1591
|
-
...
|
1592
|
-
|
1593
1704
|
@typing.overload
|
1594
1705
|
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]]:
|
1595
1706
|
"""
|
@@ -1639,97 +1750,6 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
|
|
1639
1750
|
"""
|
1640
1751
|
...
|
1641
1752
|
|
1642
|
-
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1643
|
-
"""
|
1644
|
-
Specifies what flows belong to the same project.
|
1645
|
-
|
1646
|
-
A project-specific namespace is created for all flows that
|
1647
|
-
use the same `@project(name)`.
|
1648
|
-
|
1649
|
-
Parameters
|
1650
|
-
----------
|
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.
|
1655
|
-
|
1656
|
-
|
1657
|
-
"""
|
1658
|
-
...
|
1659
|
-
|
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
|
-
"""
|
1700
|
-
...
|
1701
|
-
|
1702
|
-
def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1703
|
-
"""
|
1704
|
-
This decorator is used to run NIM containers in Metaflow tasks as sidecars.
|
1705
|
-
|
1706
|
-
User code call
|
1707
|
-
-----------
|
1708
|
-
@nim(
|
1709
|
-
models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
|
1710
|
-
backend='managed'
|
1711
|
-
)
|
1712
|
-
|
1713
|
-
Valid backend options
|
1714
|
-
---------------------
|
1715
|
-
- 'managed': Outerbounds selects a compute provider based on the model.
|
1716
|
-
- 🚧 'dataplane': Run in your account.
|
1717
|
-
|
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
|
1723
|
-
|
1724
|
-
Parameters
|
1725
|
-
----------
|
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
|
-
"""
|
1731
|
-
...
|
1732
|
-
|
1733
1753
|
def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
|
1734
1754
|
"""
|
1735
1755
|
Switch namespace to the one provided.
|
@@ -2681,7 +2701,7 @@ class DataArtifact(metaflow.client.core.MetaflowObject, metaclass=type):
|
|
2681
2701
|
...
|
2682
2702
|
|
2683
2703
|
class Runner(object, metaclass=type):
|
2684
|
-
def __init__(self, flow_file: str, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, cwd: typing.Optional[str] = None, **kwargs):
|
2704
|
+
def __init__(self, flow_file: str, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, cwd: typing.Optional[str] = None, file_read_timeout: int = 3600, **kwargs):
|
2685
2705
|
...
|
2686
2706
|
def __enter__(self) -> metaflow.runner.metaflow_runner.Runner:
|
2687
2707
|
...
|
@@ -2773,7 +2793,7 @@ class Runner(object, metaclass=type):
|
|
2773
2793
|
...
|
2774
2794
|
|
2775
2795
|
class NBRunner(object, metaclass=type):
|
2776
|
-
def __init__(self, flow, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, base_dir: str = "/tmp", **kwargs):
|
2796
|
+
def __init__(self, flow, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, base_dir: str = "/tmp", file_read_timeout: int = 3600, **kwargs):
|
2777
2797
|
...
|
2778
2798
|
def nbrun(self, **kwargs):
|
2779
2799
|
"""
|
@@ -2879,7 +2899,7 @@ class NBRunner(object, metaclass=type):
|
|
2879
2899
|
...
|
2880
2900
|
|
2881
2901
|
class Deployer(object, metaclass=type):
|
2882
|
-
def __init__(self, flow_file: str, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, cwd: typing.Optional[str] = None, **kwargs):
|
2902
|
+
def __init__(self, flow_file: str, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, cwd: typing.Optional[str] = None, file_read_timeout: int = 3600, **kwargs):
|
2883
2903
|
...
|
2884
2904
|
def _Deployer__make_function(self, deployer_class):
|
2885
2905
|
"""
|
@@ -2899,7 +2919,7 @@ class Deployer(object, metaclass=type):
|
|
2899
2919
|
...
|
2900
2920
|
|
2901
2921
|
class NBDeployer(object, metaclass=type):
|
2902
|
-
def __init__(self, flow, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, base_dir: str = "/tmp", **kwargs):
|
2922
|
+
def __init__(self, flow, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, base_dir: str = "/tmp", file_read_timeout: int = 3600, **kwargs):
|
2903
2923
|
...
|
2904
2924
|
def cleanup(self):
|
2905
2925
|
"""
|