ob-metaflow-stubs 5.2__py2.py3-none-any.whl → 5.3__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 +520 -500
- metaflow-stubs/cards.pyi +5 -5
- metaflow-stubs/cli.pyi +3 -3
- metaflow-stubs/client/__init__.pyi +3 -3
- metaflow-stubs/client/core.pyi +6 -6
- metaflow-stubs/client/filecache.pyi +3 -3
- metaflow-stubs/clone_util.pyi +2 -2
- metaflow-stubs/events.pyi +2 -2
- 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 +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 +4 -4
- metaflow-stubs/plugins/__init__.pyi +2 -2
- 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 +3 -3
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +3 -3
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +3 -3
- metaflow-stubs/plugins/argo/__init__.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows.pyi +4 -6
- 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 +19 -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 +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 +2 -2
- 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 +19 -4
- 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 +2 -2
- metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
- metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/cards/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_cli.pyi +4 -4
- metaflow-stubs/plugins/cards/card_client.pyi +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 +3 -3
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +3 -3
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +3 -3
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +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 +4 -4
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
- metaflow-stubs/plugins/debug_logger.pyi +2 -2
- metaflow-stubs/plugins/debug_monitor.pyi +2 -2
- metaflow-stubs/plugins/environment_decorator.pyi +2 -2
- metaflow-stubs/plugins/events_decorator.pyi +3 -3
- metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
- metaflow-stubs/plugins/frameworks/pytorch.pyi +4 -4
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
- metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +7 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +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 +3 -3
- metaflow-stubs/plugins/perimeters.pyi +2 -2
- metaflow-stubs/plugins/project_decorator.pyi +3 -3
- metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +3 -3
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +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 +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 +3 -3
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
- metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
- metaflow-stubs/procpoll.pyi +2 -2
- metaflow-stubs/profilers/__init__.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +20 -5
- metaflow-stubs/runner/metaflow_runner.pyi +6 -6
- 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 +4 -4
- metaflow-stubs/system/system_logger.pyi +3 -3
- 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.2.dist-info → ob_metaflow_stubs-5.3.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-5.3.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.3.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-5.2.dist-info → ob_metaflow_stubs-5.3.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.15.1+ob(v1) #
|
4
|
+
# Generated on 2024-08-22T21:03:01.630360 #
|
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
11
|
import metaflow.flowspec
|
12
|
+
import metaflow.parameters
|
13
|
+
import metaflow.plugins.datatools.s3.s3
|
13
14
|
import io
|
14
|
-
import typing
|
15
15
|
import datetime
|
16
|
-
import metaflow.
|
17
|
-
import metaflow.client.core
|
18
|
-
import metaflow.plugins.datatools.s3.s3
|
19
|
-
import metaflow.metaflow_current
|
20
|
-
import metaflow.parameters
|
16
|
+
import metaflow.events
|
21
17
|
import metaflow.datastore.inputs
|
18
|
+
import metaflow.metaflow_current
|
19
|
+
import metaflow.client.core
|
20
|
+
import metaflow.runner.metaflow_runner
|
22
21
|
import metaflow._vendor.click.types
|
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,161 +728,108 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
728
728
|
...
|
729
729
|
|
730
730
|
@typing.overload
|
731
|
-
def
|
731
|
+
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]]]:
|
732
732
|
"""
|
733
|
-
Specifies the
|
733
|
+
Specifies that the step will success under all circumstances.
|
734
734
|
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
735
|
+
The decorator will create an optional artifact, specified by `var`, which
|
736
|
+
contains the exception raised. You can use it to detect the presence
|
737
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
738
|
+
are missing.
|
739
739
|
|
740
740
|
Parameters
|
741
741
|
----------
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
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.
|
742
|
+
var : str, optional, default None
|
743
|
+
Name of the artifact in which to store the caught exception.
|
744
|
+
If not specified, the exception is not stored.
|
745
|
+
print_exception : bool, default True
|
746
|
+
Determines whether or not the exception is printed to
|
747
|
+
stdout when caught.
|
752
748
|
"""
|
753
749
|
...
|
754
750
|
|
755
751
|
@typing.overload
|
756
|
-
def
|
752
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
757
753
|
...
|
758
754
|
|
759
755
|
@typing.overload
|
760
|
-
def
|
761
|
-
...
|
762
|
-
|
763
|
-
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):
|
764
|
-
"""
|
765
|
-
Specifies the Conda environment for the step.
|
766
|
-
|
767
|
-
Information in this decorator will augment any
|
768
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
769
|
-
you can use `@conda_base` to set packages required by all
|
770
|
-
steps and use `@conda` to specify step-specific overrides.
|
771
|
-
|
772
|
-
Parameters
|
773
|
-
----------
|
774
|
-
packages : Dict[str, str], default {}
|
775
|
-
Packages to use for this step. The key is the name of the package
|
776
|
-
and the value is the version to use.
|
777
|
-
libraries : Dict[str, str], default {}
|
778
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
779
|
-
python : str, optional, default None
|
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.
|
784
|
-
"""
|
756
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
785
757
|
...
|
786
758
|
|
787
|
-
|
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]]]:
|
759
|
+
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):
|
789
760
|
"""
|
790
|
-
Specifies the
|
761
|
+
Specifies that the step will success under all circumstances.
|
791
762
|
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
763
|
+
The decorator will create an optional artifact, specified by `var`, which
|
764
|
+
contains the exception raised. You can use it to detect the presence
|
765
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
766
|
+
are missing.
|
796
767
|
|
797
768
|
Parameters
|
798
769
|
----------
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
770
|
+
var : str, optional, default None
|
771
|
+
Name of the artifact in which to store the caught exception.
|
772
|
+
If not specified, the exception is not stored.
|
773
|
+
print_exception : bool, default True
|
774
|
+
Determines whether or not the exception is printed to
|
775
|
+
stdout when caught.
|
805
776
|
"""
|
806
777
|
...
|
807
778
|
|
808
779
|
@typing.overload
|
809
|
-
def
|
810
|
-
...
|
811
|
-
|
812
|
-
@typing.overload
|
813
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
814
|
-
...
|
815
|
-
|
816
|
-
def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
780
|
+
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]]]:
|
817
781
|
"""
|
818
|
-
Specifies
|
819
|
-
|
820
|
-
Information in this decorator will augment any
|
821
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
822
|
-
you can use `@pypi_base` to set packages required by all
|
823
|
-
steps and use `@pypi` to specify step-specific overrides.
|
782
|
+
Specifies a timeout for your step.
|
824
783
|
|
825
|
-
|
826
|
-
----------
|
827
|
-
packages : Dict[str, str], default: {}
|
828
|
-
Packages to use for this step. The key is the name of the package
|
829
|
-
and the value is the version to use.
|
830
|
-
python : str, optional, default: None
|
831
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
832
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
833
|
-
"""
|
834
|
-
...
|
835
|
-
|
836
|
-
@typing.overload
|
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]]]:
|
838
|
-
"""
|
839
|
-
Specifies the number of times the task corresponding
|
840
|
-
to a step needs to be retried.
|
784
|
+
This decorator is useful if this step may hang indefinitely.
|
841
785
|
|
842
|
-
This
|
843
|
-
|
844
|
-
|
786
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
787
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
788
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
845
789
|
|
846
|
-
|
847
|
-
decorator will
|
848
|
-
ensuring that the flow execution can continue.
|
790
|
+
Note that all the values specified in parameters are added together so if you specify
|
791
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
849
792
|
|
850
793
|
Parameters
|
851
794
|
----------
|
852
|
-
|
853
|
-
Number of
|
854
|
-
|
855
|
-
Number of minutes
|
795
|
+
seconds : int, default 0
|
796
|
+
Number of seconds to wait prior to timing out.
|
797
|
+
minutes : int, default 0
|
798
|
+
Number of minutes to wait prior to timing out.
|
799
|
+
hours : int, default 0
|
800
|
+
Number of hours to wait prior to timing out.
|
856
801
|
"""
|
857
802
|
...
|
858
803
|
|
859
804
|
@typing.overload
|
860
|
-
def
|
805
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
861
806
|
...
|
862
807
|
|
863
808
|
@typing.overload
|
864
|
-
def
|
809
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
865
810
|
...
|
866
811
|
|
867
|
-
def
|
812
|
+
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):
|
868
813
|
"""
|
869
|
-
Specifies
|
870
|
-
to a step needs to be retried.
|
814
|
+
Specifies a timeout for your step.
|
871
815
|
|
872
|
-
This decorator is useful
|
873
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
874
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
816
|
+
This decorator is useful if this step may hang indefinitely.
|
875
817
|
|
876
|
-
This can be used in conjunction with the `@
|
877
|
-
|
878
|
-
|
818
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
819
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
820
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
821
|
+
|
822
|
+
Note that all the values specified in parameters are added together so if you specify
|
823
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
879
824
|
|
880
825
|
Parameters
|
881
826
|
----------
|
882
|
-
|
883
|
-
Number of
|
884
|
-
|
885
|
-
Number of minutes
|
827
|
+
seconds : int, default 0
|
828
|
+
Number of seconds to wait prior to timing out.
|
829
|
+
minutes : int, default 0
|
830
|
+
Number of minutes to wait prior to timing out.
|
831
|
+
hours : int, default 0
|
832
|
+
Number of hours to wait prior to timing out.
|
886
833
|
"""
|
887
834
|
...
|
888
835
|
|
@@ -963,56 +910,7 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
963
910
|
"""
|
964
911
|
...
|
965
912
|
|
966
|
-
|
967
|
-
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]]]:
|
968
|
-
"""
|
969
|
-
Specifies that the step will success under all circumstances.
|
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.
|
984
|
-
"""
|
985
|
-
...
|
986
|
-
|
987
|
-
@typing.overload
|
988
|
-
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
989
|
-
...
|
990
|
-
|
991
|
-
@typing.overload
|
992
|
-
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
993
|
-
...
|
994
|
-
|
995
|
-
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):
|
996
|
-
"""
|
997
|
-
Specifies that the step will success under all circumstances.
|
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.
|
1012
|
-
"""
|
1013
|
-
...
|
1014
|
-
|
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]]]:
|
913
|
+
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
914
|
"""
|
1017
915
|
Specifies that this step should execute on Kubernetes.
|
1018
916
|
|
@@ -1068,70 +966,22 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
|
|
1068
966
|
Shared memory size (in MiB) required for this step
|
1069
967
|
port: int, optional
|
1070
968
|
Port number to specify in the Kubernetes job object
|
969
|
+
compute_pool : str, optional, default None
|
970
|
+
Compute pool to be used for for this step.
|
971
|
+
If not specified, any accessible compute pool within the perimeter is used.
|
1071
972
|
"""
|
1072
973
|
...
|
1073
974
|
|
1074
975
|
@typing.overload
|
1075
|
-
def
|
976
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1076
977
|
"""
|
1077
|
-
|
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
|
-
|
978
|
+
Decorator prototype for all step decorators. This function gets specialized
|
979
|
+
and imported for all decorators types by _import_plugin_decorators().
|
1093
980
|
"""
|
1094
981
|
...
|
1095
982
|
|
1096
983
|
@typing.overload
|
1097
|
-
def
|
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
|
-
|
1125
|
-
@typing.overload
|
1126
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
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]:
|
984
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1135
985
|
...
|
1136
986
|
|
1137
987
|
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
@@ -1174,6 +1024,63 @@ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
1174
1024
|
"""
|
1175
1025
|
...
|
1176
1026
|
|
1027
|
+
@typing.overload
|
1028
|
+
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]]]:
|
1029
|
+
"""
|
1030
|
+
Specifies the Conda environment for the step.
|
1031
|
+
|
1032
|
+
Information in this decorator will augment any
|
1033
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
1034
|
+
you can use `@conda_base` to set packages required by all
|
1035
|
+
steps and use `@conda` to specify step-specific overrides.
|
1036
|
+
|
1037
|
+
Parameters
|
1038
|
+
----------
|
1039
|
+
packages : Dict[str, str], default {}
|
1040
|
+
Packages to use for this step. The key is the name of the package
|
1041
|
+
and the value is the version to use.
|
1042
|
+
libraries : Dict[str, str], default {}
|
1043
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1044
|
+
python : str, optional, default None
|
1045
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1046
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1047
|
+
disabled : bool, default False
|
1048
|
+
If set to True, disables @conda.
|
1049
|
+
"""
|
1050
|
+
...
|
1051
|
+
|
1052
|
+
@typing.overload
|
1053
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1054
|
+
...
|
1055
|
+
|
1056
|
+
@typing.overload
|
1057
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1058
|
+
...
|
1059
|
+
|
1060
|
+
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):
|
1061
|
+
"""
|
1062
|
+
Specifies the Conda environment for the step.
|
1063
|
+
|
1064
|
+
Information in this decorator will augment any
|
1065
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
1066
|
+
you can use `@conda_base` to set packages required by all
|
1067
|
+
steps and use `@conda` to specify step-specific overrides.
|
1068
|
+
|
1069
|
+
Parameters
|
1070
|
+
----------
|
1071
|
+
packages : Dict[str, str], default {}
|
1072
|
+
Packages to use for this step. The key is the name of the package
|
1073
|
+
and the value is the version to use.
|
1074
|
+
libraries : Dict[str, str], default {}
|
1075
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1076
|
+
python : str, optional, default None
|
1077
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1078
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1079
|
+
disabled : bool, default False
|
1080
|
+
If set to True, disables @conda.
|
1081
|
+
"""
|
1082
|
+
...
|
1083
|
+
|
1177
1084
|
@typing.overload
|
1178
1085
|
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
1086
|
"""
|
@@ -1206,101 +1113,218 @@ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], Non
|
|
1206
1113
|
...
|
1207
1114
|
|
1208
1115
|
@typing.overload
|
1209
|
-
def
|
1116
|
+
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]]]:
|
1210
1117
|
"""
|
1211
|
-
Specifies
|
1118
|
+
Specifies the PyPI packages for the step.
|
1212
1119
|
|
1213
|
-
|
1120
|
+
Information in this decorator will augment any
|
1121
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1122
|
+
you can use `@pypi_base` to set packages required by all
|
1123
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1214
1124
|
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1125
|
+
Parameters
|
1126
|
+
----------
|
1127
|
+
packages : Dict[str, str], default: {}
|
1128
|
+
Packages to use for this step. The key is the name of the package
|
1129
|
+
and the value is the version to use.
|
1130
|
+
python : str, optional, default: None
|
1131
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1132
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1133
|
+
"""
|
1134
|
+
...
|
1135
|
+
|
1136
|
+
@typing.overload
|
1137
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1138
|
+
...
|
1139
|
+
|
1140
|
+
@typing.overload
|
1141
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1142
|
+
...
|
1143
|
+
|
1144
|
+
def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1145
|
+
"""
|
1146
|
+
Specifies the PyPI packages for the step.
|
1218
1147
|
|
1219
|
-
|
1220
|
-
|
1148
|
+
Information in this decorator will augment any
|
1149
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1150
|
+
you can use `@pypi_base` to set packages required by all
|
1151
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1221
1152
|
|
1222
1153
|
Parameters
|
1223
1154
|
----------
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1155
|
+
packages : Dict[str, str], default: {}
|
1156
|
+
Packages to use for this step. The key is the name of the package
|
1157
|
+
and the value is the version to use.
|
1158
|
+
python : str, optional, default: None
|
1159
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1160
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1230
1161
|
"""
|
1231
1162
|
...
|
1232
1163
|
|
1233
1164
|
@typing.overload
|
1234
|
-
def
|
1165
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1166
|
+
"""
|
1167
|
+
Internal decorator to support Fast bakery
|
1168
|
+
"""
|
1235
1169
|
...
|
1236
1170
|
|
1237
1171
|
@typing.overload
|
1238
|
-
def
|
1172
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1239
1173
|
...
|
1240
1174
|
|
1241
|
-
def
|
1175
|
+
def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
1242
1176
|
"""
|
1243
|
-
|
1177
|
+
Internal decorator to support Fast bakery
|
1178
|
+
"""
|
1179
|
+
...
|
1180
|
+
|
1181
|
+
@typing.overload
|
1182
|
+
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]]]:
|
1183
|
+
"""
|
1184
|
+
Specifies the number of times the task corresponding
|
1185
|
+
to a step needs to be retried.
|
1244
1186
|
|
1245
|
-
This decorator is useful
|
1187
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
1188
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
1189
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
1246
1190
|
|
1247
|
-
This can be used in conjunction with the `@
|
1248
|
-
|
1249
|
-
|
1191
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
1192
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
1193
|
+
ensuring that the flow execution can continue.
|
1250
1194
|
|
1251
|
-
|
1252
|
-
|
1195
|
+
Parameters
|
1196
|
+
----------
|
1197
|
+
times : int, default 3
|
1198
|
+
Number of times to retry this task.
|
1199
|
+
minutes_between_retries : int, default 2
|
1200
|
+
Number of minutes between retries.
|
1201
|
+
"""
|
1202
|
+
...
|
1203
|
+
|
1204
|
+
@typing.overload
|
1205
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1206
|
+
...
|
1207
|
+
|
1208
|
+
@typing.overload
|
1209
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1210
|
+
...
|
1211
|
+
|
1212
|
+
def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
|
1213
|
+
"""
|
1214
|
+
Specifies the number of times the task corresponding
|
1215
|
+
to a step needs to be retried.
|
1216
|
+
|
1217
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
1218
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
1219
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
1220
|
+
|
1221
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
1222
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
1223
|
+
ensuring that the flow execution can continue.
|
1253
1224
|
|
1254
1225
|
Parameters
|
1255
1226
|
----------
|
1256
|
-
|
1257
|
-
Number of
|
1258
|
-
|
1259
|
-
Number of minutes
|
1260
|
-
hours : int, default 0
|
1261
|
-
Number of hours to wait prior to timing out.
|
1227
|
+
times : int, default 3
|
1228
|
+
Number of times to retry this task.
|
1229
|
+
minutes_between_retries : int, default 2
|
1230
|
+
Number of minutes between retries.
|
1262
1231
|
"""
|
1263
1232
|
...
|
1264
1233
|
|
1265
1234
|
@typing.overload
|
1266
|
-
def
|
1235
|
+
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]]]:
|
1267
1236
|
"""
|
1268
|
-
|
1237
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
1238
|
+
|
1239
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1240
|
+
|
1241
|
+
Parameters
|
1242
|
+
----------
|
1243
|
+
type : str, default 'default'
|
1244
|
+
Card type.
|
1245
|
+
id : str, optional, default None
|
1246
|
+
If multiple cards are present, use this id to identify this card.
|
1247
|
+
options : Dict[str, Any], default {}
|
1248
|
+
Options passed to the card. The contents depend on the card type.
|
1249
|
+
timeout : int, default 45
|
1250
|
+
Interrupt reporting if it takes more than this many seconds.
|
1251
|
+
|
1252
|
+
|
1253
|
+
"""
|
1254
|
+
...
|
1255
|
+
|
1256
|
+
@typing.overload
|
1257
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1258
|
+
...
|
1259
|
+
|
1260
|
+
@typing.overload
|
1261
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1262
|
+
...
|
1263
|
+
|
1264
|
+
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):
|
1265
|
+
"""
|
1266
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
1267
|
+
|
1268
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1269
|
+
|
1270
|
+
Parameters
|
1271
|
+
----------
|
1272
|
+
type : str, default 'default'
|
1273
|
+
Card type.
|
1274
|
+
id : str, optional, default None
|
1275
|
+
If multiple cards are present, use this id to identify this card.
|
1276
|
+
options : Dict[str, Any], default {}
|
1277
|
+
Options passed to the card. The contents depend on the card type.
|
1278
|
+
timeout : int, default 45
|
1279
|
+
Interrupt reporting if it takes more than this many seconds.
|
1280
|
+
|
1281
|
+
|
1282
|
+
"""
|
1283
|
+
...
|
1284
|
+
|
1285
|
+
@typing.overload
|
1286
|
+
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]]:
|
1287
|
+
"""
|
1288
|
+
Specifies the flow(s) that this flow depends on.
|
1269
1289
|
|
1270
1290
|
```
|
1271
|
-
@
|
1291
|
+
@trigger_on_finish(flow='FooFlow')
|
1272
1292
|
```
|
1273
1293
|
or
|
1274
1294
|
```
|
1275
|
-
@
|
1295
|
+
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
1276
1296
|
```
|
1297
|
+
This decorator respects the @project decorator and triggers the flow
|
1298
|
+
when upstream runs within the same namespace complete successfully
|
1277
1299
|
|
1278
|
-
Additionally, you can specify
|
1279
|
-
|
1300
|
+
Additionally, you can specify project aware upstream flow dependencies
|
1301
|
+
by specifying the fully qualified project_flow_name.
|
1280
1302
|
```
|
1281
|
-
@
|
1303
|
+
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
1282
1304
|
```
|
1283
1305
|
or
|
1284
1306
|
```
|
1285
|
-
@
|
1286
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1307
|
+
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
1287
1308
|
```
|
1288
1309
|
|
1289
|
-
|
1290
|
-
|
1291
|
-
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1292
|
-
```
|
1293
|
-
This is equivalent to:
|
1310
|
+
You can also specify just the project or project branch (other values will be
|
1311
|
+
inferred from the current project or project branch):
|
1294
1312
|
```
|
1295
|
-
@
|
1313
|
+
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
1296
1314
|
```
|
1297
1315
|
|
1316
|
+
Note that `branch` is typically one of:
|
1317
|
+
- `prod`
|
1318
|
+
- `user.bob`
|
1319
|
+
- `test.my_experiment`
|
1320
|
+
- `prod.staging`
|
1321
|
+
|
1298
1322
|
Parameters
|
1299
1323
|
----------
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1324
|
+
flow : Union[str, Dict[str, str]], optional, default None
|
1325
|
+
Upstream flow dependency for this flow.
|
1326
|
+
flows : List[Union[str, Dict[str, str]]], default []
|
1327
|
+
Upstream flow dependencies for this flow.
|
1304
1328
|
options : Dict[str, Any], default {}
|
1305
1329
|
Backend-specific configuration for tuning eventing behavior.
|
1306
1330
|
|
@@ -1309,47 +1333,51 @@ def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = No
|
|
1309
1333
|
...
|
1310
1334
|
|
1311
1335
|
@typing.overload
|
1312
|
-
def
|
1336
|
+
def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1313
1337
|
...
|
1314
1338
|
|
1315
|
-
def
|
1339
|
+
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
1340
|
"""
|
1317
|
-
Specifies the
|
1341
|
+
Specifies the flow(s) that this flow depends on.
|
1318
1342
|
|
1319
1343
|
```
|
1320
|
-
@
|
1344
|
+
@trigger_on_finish(flow='FooFlow')
|
1321
1345
|
```
|
1322
1346
|
or
|
1323
1347
|
```
|
1324
|
-
@
|
1348
|
+
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
1325
1349
|
```
|
1350
|
+
This decorator respects the @project decorator and triggers the flow
|
1351
|
+
when upstream runs within the same namespace complete successfully
|
1326
1352
|
|
1327
|
-
Additionally, you can specify
|
1328
|
-
|
1353
|
+
Additionally, you can specify project aware upstream flow dependencies
|
1354
|
+
by specifying the fully qualified project_flow_name.
|
1329
1355
|
```
|
1330
|
-
@
|
1356
|
+
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
1331
1357
|
```
|
1332
1358
|
or
|
1333
1359
|
```
|
1334
|
-
@
|
1335
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1360
|
+
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
1336
1361
|
```
|
1337
1362
|
|
1338
|
-
|
1339
|
-
|
1340
|
-
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1341
|
-
```
|
1342
|
-
This is equivalent to:
|
1363
|
+
You can also specify just the project or project branch (other values will be
|
1364
|
+
inferred from the current project or project branch):
|
1343
1365
|
```
|
1344
|
-
@
|
1366
|
+
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
1345
1367
|
```
|
1346
1368
|
|
1369
|
+
Note that `branch` is typically one of:
|
1370
|
+
- `prod`
|
1371
|
+
- `user.bob`
|
1372
|
+
- `test.my_experiment`
|
1373
|
+
- `prod.staging`
|
1374
|
+
|
1347
1375
|
Parameters
|
1348
1376
|
----------
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1377
|
+
flow : Union[str, Dict[str, str]], optional, default None
|
1378
|
+
Upstream flow dependency for this flow.
|
1379
|
+
flows : List[Union[str, Dict[str, str]]], default []
|
1380
|
+
Upstream flow dependencies for this flow.
|
1353
1381
|
options : Dict[str, Any], default {}
|
1354
1382
|
Backend-specific configuration for tuning eventing behavior.
|
1355
1383
|
|
@@ -1357,49 +1385,44 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
1357
1385
|
"""
|
1358
1386
|
...
|
1359
1387
|
|
1360
|
-
|
1361
|
-
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1388
|
+
def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1362
1389
|
"""
|
1363
|
-
|
1390
|
+
This decorator is used to run NIM containers in Metaflow tasks as sidecars.
|
1364
1391
|
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
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.
|
1392
|
+
User code call
|
1393
|
+
-----------
|
1394
|
+
@nim(
|
1395
|
+
models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
|
1396
|
+
backend='managed'
|
1397
|
+
)
|
1398
|
+
|
1399
|
+
Valid backend options
|
1400
|
+
---------------------
|
1401
|
+
- 'managed': Outerbounds selects a compute provider based on the model.
|
1402
|
+
- 🚧 'dataplane': Run in your account.
|
1403
|
+
|
1404
|
+
Valid model options
|
1405
|
+
----------------
|
1406
|
+
- 'meta/llama3-8b-instruct': 8B parameter model
|
1407
|
+
- 'meta/llama3-70b-instruct': 70B parameter model
|
1408
|
+
- Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
|
1385
1409
|
|
1386
|
-
Use `@pypi_base` to set common packages required by all
|
1387
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1388
1410
|
Parameters
|
1389
1411
|
----------
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
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.
|
1412
|
+
models: list[NIM]
|
1413
|
+
List of NIM containers running models in sidecars.
|
1414
|
+
backend: str
|
1415
|
+
Compute provider to run the NIM container.
|
1396
1416
|
"""
|
1397
1417
|
...
|
1398
1418
|
|
1399
|
-
def
|
1419
|
+
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]]:
|
1400
1420
|
"""
|
1401
|
-
The `@
|
1402
|
-
This decorator only works when a flow is scheduled on Airflow
|
1421
|
+
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)
|
1422
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1423
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1424
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1425
|
+
starts only after all sensors finish.
|
1403
1426
|
|
1404
1427
|
Parameters
|
1405
1428
|
----------
|
@@ -1420,116 +1443,109 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
|
|
1420
1443
|
Name of the sensor on Airflow
|
1421
1444
|
description : str
|
1422
1445
|
Description of sensor in the Airflow UI
|
1423
|
-
|
1424
|
-
The
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1435
|
-
check_existence: bool
|
1436
|
-
Set to True to check if the external task exists or check if
|
1437
|
-
the DAG to wait for exists. (Default: True)
|
1446
|
+
bucket_key : Union[str, List[str]]
|
1447
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1448
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1449
|
+
bucket_name : str
|
1450
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1451
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1452
|
+
wildcard_match : bool
|
1453
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1454
|
+
aws_conn_id : str
|
1455
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1456
|
+
verify : bool
|
1457
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1438
1458
|
"""
|
1439
1459
|
...
|
1440
1460
|
|
1441
1461
|
@typing.overload
|
1442
|
-
def
|
1462
|
+
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]]:
|
1443
1463
|
"""
|
1444
|
-
Specifies the
|
1445
|
-
|
1464
|
+
Specifies the Conda environment for all steps of the flow.
|
1465
|
+
|
1466
|
+
Use `@conda_base` to set common libraries required by all
|
1467
|
+
steps and use `@conda` to specify step-specific additions.
|
1446
1468
|
|
1447
1469
|
Parameters
|
1448
1470
|
----------
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1460
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1471
|
+
packages : Dict[str, str], default {}
|
1472
|
+
Packages to use for this flow. The key is the name of the package
|
1473
|
+
and the value is the version to use.
|
1474
|
+
libraries : Dict[str, str], default {}
|
1475
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1476
|
+
python : str, optional, default None
|
1477
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1478
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1479
|
+
disabled : bool, default False
|
1480
|
+
If set to True, disables Conda.
|
1461
1481
|
"""
|
1462
1482
|
...
|
1463
1483
|
|
1464
1484
|
@typing.overload
|
1465
|
-
def
|
1485
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1466
1486
|
...
|
1467
1487
|
|
1468
|
-
def
|
1469
|
-
"""
|
1470
|
-
Specifies the
|
1471
|
-
|
1472
|
-
|
1473
|
-
|
1474
|
-
|
1475
|
-
|
1476
|
-
|
1477
|
-
|
1478
|
-
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1488
|
+
def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
1489
|
+
"""
|
1490
|
+
Specifies the Conda environment for all steps of the flow.
|
1491
|
+
|
1492
|
+
Use `@conda_base` to set common libraries required by all
|
1493
|
+
steps and use `@conda` to specify step-specific additions.
|
1494
|
+
|
1495
|
+
Parameters
|
1496
|
+
----------
|
1497
|
+
packages : Dict[str, str], default {}
|
1498
|
+
Packages to use for this flow. The key is the name of the package
|
1499
|
+
and the value is the version to use.
|
1500
|
+
libraries : Dict[str, str], default {}
|
1501
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1502
|
+
python : str, optional, default None
|
1503
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1504
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1505
|
+
disabled : bool, default False
|
1506
|
+
If set to True, disables Conda.
|
1487
1507
|
"""
|
1488
1508
|
...
|
1489
1509
|
|
1490
1510
|
@typing.overload
|
1491
|
-
def
|
1511
|
+
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]]:
|
1492
1512
|
"""
|
1493
|
-
Specifies the
|
1513
|
+
Specifies the event(s) that this flow depends on.
|
1494
1514
|
|
1495
1515
|
```
|
1496
|
-
@
|
1516
|
+
@trigger(event='foo')
|
1497
1517
|
```
|
1498
1518
|
or
|
1499
1519
|
```
|
1500
|
-
@
|
1520
|
+
@trigger(events=['foo', 'bar'])
|
1501
1521
|
```
|
1502
|
-
This decorator respects the @project decorator and triggers the flow
|
1503
|
-
when upstream runs within the same namespace complete successfully
|
1504
1522
|
|
1505
|
-
Additionally, you can specify
|
1506
|
-
|
1523
|
+
Additionally, you can specify the parameter mappings
|
1524
|
+
to map event payload to Metaflow parameters for the flow.
|
1507
1525
|
```
|
1508
|
-
@
|
1526
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1509
1527
|
```
|
1510
1528
|
or
|
1511
1529
|
```
|
1512
|
-
@
|
1530
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1531
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1513
1532
|
```
|
1514
1533
|
|
1515
|
-
|
1516
|
-
inferred from the current project or project branch):
|
1534
|
+
'parameters' can also be a list of strings and tuples like so:
|
1517
1535
|
```
|
1518
|
-
@
|
1536
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1537
|
+
```
|
1538
|
+
This is equivalent to:
|
1539
|
+
```
|
1540
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1519
1541
|
```
|
1520
|
-
|
1521
|
-
Note that `branch` is typically one of:
|
1522
|
-
- `prod`
|
1523
|
-
- `user.bob`
|
1524
|
-
- `test.my_experiment`
|
1525
|
-
- `prod.staging`
|
1526
1542
|
|
1527
1543
|
Parameters
|
1528
1544
|
----------
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1532
|
-
|
1545
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
1546
|
+
Event dependency for this flow.
|
1547
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
1548
|
+
Events dependency for this flow.
|
1533
1549
|
options : Dict[str, Any], default {}
|
1534
1550
|
Backend-specific configuration for tuning eventing behavior.
|
1535
1551
|
|
@@ -1538,51 +1554,47 @@ def trigger_on_finish(*, flow: typing.Union[str, typing.Dict[str, str], None] =
|
|
1538
1554
|
...
|
1539
1555
|
|
1540
1556
|
@typing.overload
|
1541
|
-
def
|
1557
|
+
def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1542
1558
|
...
|
1543
1559
|
|
1544
|
-
def
|
1560
|
+
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] = {}):
|
1545
1561
|
"""
|
1546
|
-
Specifies the
|
1562
|
+
Specifies the event(s) that this flow depends on.
|
1547
1563
|
|
1548
1564
|
```
|
1549
|
-
@
|
1565
|
+
@trigger(event='foo')
|
1550
1566
|
```
|
1551
1567
|
or
|
1552
1568
|
```
|
1553
|
-
@
|
1569
|
+
@trigger(events=['foo', 'bar'])
|
1554
1570
|
```
|
1555
|
-
This decorator respects the @project decorator and triggers the flow
|
1556
|
-
when upstream runs within the same namespace complete successfully
|
1557
1571
|
|
1558
|
-
Additionally, you can specify
|
1559
|
-
|
1572
|
+
Additionally, you can specify the parameter mappings
|
1573
|
+
to map event payload to Metaflow parameters for the flow.
|
1560
1574
|
```
|
1561
|
-
@
|
1575
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1562
1576
|
```
|
1563
1577
|
or
|
1564
1578
|
```
|
1565
|
-
@
|
1579
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1580
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1566
1581
|
```
|
1567
1582
|
|
1568
|
-
|
1569
|
-
inferred from the current project or project branch):
|
1583
|
+
'parameters' can also be a list of strings and tuples like so:
|
1570
1584
|
```
|
1571
|
-
@
|
1585
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1586
|
+
```
|
1587
|
+
This is equivalent to:
|
1588
|
+
```
|
1589
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1572
1590
|
```
|
1573
|
-
|
1574
|
-
Note that `branch` is typically one of:
|
1575
|
-
- `prod`
|
1576
|
-
- `user.bob`
|
1577
|
-
- `test.my_experiment`
|
1578
|
-
- `prod.staging`
|
1579
1591
|
|
1580
1592
|
Parameters
|
1581
1593
|
----------
|
1582
|
-
|
1583
|
-
|
1584
|
-
|
1585
|
-
|
1594
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
1595
|
+
Event dependency for this flow.
|
1596
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
1597
|
+
Events dependency for this flow.
|
1586
1598
|
options : Dict[str, Any], default {}
|
1587
1599
|
Backend-specific configuration for tuning eventing behavior.
|
1588
1600
|
|
@@ -1591,51 +1603,51 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
1591
1603
|
...
|
1592
1604
|
|
1593
1605
|
@typing.overload
|
1594
|
-
def
|
1606
|
+
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]]:
|
1595
1607
|
"""
|
1596
|
-
Specifies the
|
1597
|
-
|
1598
|
-
Use `@conda_base` to set common libraries required by all
|
1599
|
-
steps and use `@conda` to specify step-specific additions.
|
1608
|
+
Specifies the times when the flow should be run when running on a
|
1609
|
+
production scheduler.
|
1600
1610
|
|
1601
1611
|
Parameters
|
1602
1612
|
----------
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
+
hourly : bool, default False
|
1614
|
+
Run the workflow hourly.
|
1615
|
+
daily : bool, default True
|
1616
|
+
Run the workflow daily.
|
1617
|
+
weekly : bool, default False
|
1618
|
+
Run the workflow weekly.
|
1619
|
+
cron : str, optional, default None
|
1620
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1621
|
+
specified by this expression.
|
1622
|
+
timezone : str, optional, default None
|
1623
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1624
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1613
1625
|
"""
|
1614
1626
|
...
|
1615
1627
|
|
1616
1628
|
@typing.overload
|
1617
|
-
def
|
1629
|
+
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1618
1630
|
...
|
1619
1631
|
|
1620
|
-
def
|
1632
|
+
def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
|
1621
1633
|
"""
|
1622
|
-
Specifies the
|
1623
|
-
|
1624
|
-
Use `@conda_base` to set common libraries required by all
|
1625
|
-
steps and use `@conda` to specify step-specific additions.
|
1634
|
+
Specifies the times when the flow should be run when running on a
|
1635
|
+
production scheduler.
|
1626
1636
|
|
1627
1637
|
Parameters
|
1628
1638
|
----------
|
1629
|
-
|
1630
|
-
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
1635
|
-
|
1636
|
-
|
1637
|
-
|
1638
|
-
|
1639
|
+
hourly : bool, default False
|
1640
|
+
Run the workflow hourly.
|
1641
|
+
daily : bool, default True
|
1642
|
+
Run the workflow daily.
|
1643
|
+
weekly : bool, default False
|
1644
|
+
Run the workflow weekly.
|
1645
|
+
cron : str, optional, default None
|
1646
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1647
|
+
specified by this expression.
|
1648
|
+
timezone : str, optional, default None
|
1649
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1650
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1639
1651
|
"""
|
1640
1652
|
...
|
1641
1653
|
|
@@ -1657,13 +1669,10 @@ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typ
|
|
1657
1669
|
"""
|
1658
1670
|
...
|
1659
1671
|
|
1660
|
-
def
|
1672
|
+
def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, external_dag_id: str, external_task_ids: typing.List[str], allowed_states: typing.List[str], failed_states: typing.List[str], execution_delta: "datetime.timedelta", check_existence: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1661
1673
|
"""
|
1662
|
-
The `@
|
1663
|
-
|
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.
|
1674
|
+
The `@airflow_external_task_sensor` decorator attaches a Airflow [ExternalTaskSensor](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/sensors/external_task/index.html#airflow.sensors.external_task.ExternalTaskSensor) before the start step of the flow.
|
1675
|
+
This decorator only works when a flow is scheduled on Airflow and is compiled using `airflow create`. More than one `@airflow_external_task_sensor` can be added as a flow decorators. Adding more than one decorator will ensure that `start` step starts only after all sensors finish.
|
1667
1676
|
|
1668
1677
|
Parameters
|
1669
1678
|
----------
|
@@ -1684,49 +1693,60 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
|
|
1684
1693
|
Name of the sensor on Airflow
|
1685
1694
|
description : str
|
1686
1695
|
Description of sensor in the Airflow UI
|
1687
|
-
|
1688
|
-
The
|
1689
|
-
|
1690
|
-
|
1691
|
-
|
1692
|
-
|
1693
|
-
|
1694
|
-
|
1695
|
-
|
1696
|
-
|
1697
|
-
|
1698
|
-
|
1696
|
+
external_dag_id : str
|
1697
|
+
The dag_id that contains the task you want to wait for.
|
1698
|
+
external_task_ids : List[str]
|
1699
|
+
The list of task_ids that you want to wait for.
|
1700
|
+
If None (default value) the sensor waits for the DAG. (Default: None)
|
1701
|
+
allowed_states : List[str]
|
1702
|
+
Iterable of allowed states, (Default: ['success'])
|
1703
|
+
failed_states : List[str]
|
1704
|
+
Iterable of failed or dis-allowed states. (Default: None)
|
1705
|
+
execution_delta : datetime.timedelta
|
1706
|
+
time difference with the previous execution to look at,
|
1707
|
+
the default is the same logical date as the current task or DAG. (Default: None)
|
1708
|
+
check_existence: bool
|
1709
|
+
Set to True to check if the external task exists or check if
|
1710
|
+
the DAG to wait for exists. (Default: True)
|
1699
1711
|
"""
|
1700
1712
|
...
|
1701
1713
|
|
1702
|
-
|
1714
|
+
@typing.overload
|
1715
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1703
1716
|
"""
|
1704
|
-
|
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
|
+
Specifies the PyPI packages for all steps of the flow.
|
1717
1718
|
|
1718
|
-
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
|
1719
|
+
Use `@pypi_base` to set common packages required by all
|
1720
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1721
|
+
Parameters
|
1722
|
+
----------
|
1723
|
+
packages : Dict[str, str], default: {}
|
1724
|
+
Packages to use for this flow. The key is the name of the package
|
1725
|
+
and the value is the version to use.
|
1726
|
+
python : str, optional, default: None
|
1727
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1728
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1729
|
+
"""
|
1730
|
+
...
|
1731
|
+
|
1732
|
+
@typing.overload
|
1733
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1734
|
+
...
|
1735
|
+
|
1736
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1737
|
+
"""
|
1738
|
+
Specifies the PyPI packages for all steps of the flow.
|
1723
1739
|
|
1740
|
+
Use `@pypi_base` to set common packages required by all
|
1741
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1724
1742
|
Parameters
|
1725
1743
|
----------
|
1726
|
-
|
1727
|
-
|
1728
|
-
|
1729
|
-
|
1744
|
+
packages : Dict[str, str], default: {}
|
1745
|
+
Packages to use for this flow. The key is the name of the package
|
1746
|
+
and the value is the version to use.
|
1747
|
+
python : str, optional, default: None
|
1748
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1749
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1730
1750
|
"""
|
1731
1751
|
...
|
1732
1752
|
|
@@ -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
|
"""
|