metaflow-stubs 2.12.6__py2.py3-none-any.whl → 2.12.8__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 +544 -544
- metaflow-stubs/cards.pyi +6 -6
- metaflow-stubs/cli.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +3 -3
- metaflow-stubs/client/core.pyi +7 -7
- metaflow-stubs/client/filecache.pyi +3 -3
- metaflow-stubs/clone_util.pyi +2 -2
- metaflow-stubs/events.pyi +2 -2
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +4 -4
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +3 -3
- metaflow-stubs/metadata/metadata.pyi +3 -3
- metaflow-stubs/metadata/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -2
- metaflow-stubs/metaflow_current.pyi +4 -4
- metaflow-stubs/mflog/mflog.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/parameters.pyi +2 -2
- metaflow-stubs/plugins/__init__.pyi +3 -3
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_cli.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
- metaflow-stubs/plugins/airflow/exception.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
- metaflow-stubs/plugins/argo/__init__.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows.pyi +4 -4
- metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +4 -4
- metaflow-stubs/plugins/aws/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_cli.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/production_token.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +3 -3
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
- metaflow-stubs/plugins/azure/__init__.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
- metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/cards/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_cli.pyi +4 -4
- metaflow-stubs/plugins/cards/card_client.pyi +2 -2
- metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
- metaflow-stubs/plugins/cards/card_decorator.pyi +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/chevron/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +3 -3
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +2 -2
- metaflow-stubs/plugins/datatools/__init__.pyi +3 -3
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +3 -3
- metaflow-stubs/plugins/datatools/s3/s3.pyi +6 -6
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
- metaflow-stubs/plugins/debug_logger.pyi +2 -2
- metaflow-stubs/plugins/debug_monitor.pyi +2 -2
- metaflow-stubs/plugins/environment_decorator.pyi +2 -2
- metaflow-stubs/plugins/events_decorator.pyi +2 -2
- metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
- metaflow-stubs/plugins/frameworks/pytorch.pyi +3 -3
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
- metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
- 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/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 +2 -2
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +3 -3
- metaflow-stubs/plugins/pypi/utils.pyi +2 -2
- metaflow-stubs/plugins/resources_decorator.pyi +2 -2
- metaflow-stubs/plugins/retry_decorator.pyi +2 -2
- metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +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 +5 -5
- 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/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/metaflow_runner.pyi +4 -4
- metaflow-stubs/runner/nbrun.pyi +2 -2
- metaflow-stubs/runner/subprocess_manager.pyi +2 -2
- metaflow-stubs/system/__init__.pyi +112 -0
- metaflow-stubs/system/system_logger.pyi +51 -0
- metaflow-stubs/system/system_monitor.pyi +73 -0
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- metaflow-stubs/version.pyi +2 -2
- {metaflow_stubs-2.12.6.dist-info → metaflow_stubs-2.12.8.dist-info}/METADATA +2 -2
- metaflow_stubs-2.12.8.dist-info/RECORD +145 -0
- {metaflow_stubs-2.12.6.dist-info → metaflow_stubs-2.12.8.dist-info}/WHEEL +1 -1
- metaflow_stubs-2.12.6.dist-info/RECORD +0 -142
- {metaflow_stubs-2.12.6.dist-info → metaflow_stubs-2.12.8.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-07-
|
3
|
+
# MF version: 2.12.8 #
|
4
|
+
# Generated on 2024-07-16T15:51:55.346854 #
|
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.parameters
|
12
|
-
import metaflow.flowspec
|
13
|
-
import datetime
|
14
|
-
import metaflow.datastore.inputs
|
15
11
|
import metaflow.plugins.datatools.s3.s3
|
16
|
-
import metaflow.client.core
|
17
|
-
import metaflow.events
|
18
12
|
import metaflow.runner.metaflow_runner
|
13
|
+
import metaflow.datastore.inputs
|
14
|
+
import metaflow.flowspec
|
19
15
|
import metaflow._vendor.click.types
|
20
|
-
import
|
16
|
+
import datetime
|
21
17
|
import metaflow.metaflow_current
|
18
|
+
import metaflow.events
|
19
|
+
import typing
|
20
|
+
import metaflow.client.core
|
21
|
+
import metaflow.parameters
|
22
22
|
import io
|
23
23
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
24
24
|
StepFlag = typing.NewType("StepFlag", bool)
|
@@ -728,204 +728,79 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
728
728
|
...
|
729
729
|
|
730
730
|
@typing.overload
|
731
|
-
def
|
732
|
-
"""
|
733
|
-
Specifies the number of times the task corresponding
|
734
|
-
to a step needs to be retried.
|
735
|
-
|
736
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
737
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
738
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
739
|
-
|
740
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
741
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
742
|
-
ensuring that the flow execution can continue.
|
743
|
-
|
744
|
-
Parameters
|
745
|
-
----------
|
746
|
-
times : int, default 3
|
747
|
-
Number of times to retry this task.
|
748
|
-
minutes_between_retries : int, default 2
|
749
|
-
Number of minutes between retries.
|
750
|
-
"""
|
751
|
-
...
|
752
|
-
|
753
|
-
@typing.overload
|
754
|
-
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
755
|
-
...
|
756
|
-
|
757
|
-
@typing.overload
|
758
|
-
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
759
|
-
...
|
760
|
-
|
761
|
-
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):
|
731
|
+
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]]]:
|
762
732
|
"""
|
763
|
-
Specifies the
|
764
|
-
to a step needs to be retried.
|
765
|
-
|
766
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
767
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
768
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
769
|
-
|
770
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
771
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
772
|
-
ensuring that the flow execution can continue.
|
733
|
+
Specifies the resources needed when executing this step.
|
773
734
|
|
774
|
-
|
775
|
-
|
776
|
-
times : int, default 3
|
777
|
-
Number of times to retry this task.
|
778
|
-
minutes_between_retries : int, default 2
|
779
|
-
Number of minutes between retries.
|
780
|
-
"""
|
781
|
-
...
|
782
|
-
|
783
|
-
@typing.overload
|
784
|
-
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]]]:
|
785
|
-
"""
|
786
|
-
Specifies the Conda environment for the step.
|
735
|
+
Use `@resources` to specify the resource requirements
|
736
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
787
737
|
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
738
|
+
You can choose the compute layer on the command line by executing e.g.
|
739
|
+
```
|
740
|
+
python myflow.py run --with batch
|
741
|
+
```
|
742
|
+
or
|
743
|
+
```
|
744
|
+
python myflow.py run --with kubernetes
|
745
|
+
```
|
746
|
+
which executes the flow on the desired system using the
|
747
|
+
requirements specified in `@resources`.
|
792
748
|
|
793
749
|
Parameters
|
794
750
|
----------
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
751
|
+
cpu : int, default 1
|
752
|
+
Number of CPUs required for this step.
|
753
|
+
gpu : int, default 0
|
754
|
+
Number of GPUs required for this step.
|
755
|
+
disk : int, optional, default None
|
756
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
757
|
+
memory : int, default 4096
|
758
|
+
Memory size (in MB) required for this step.
|
759
|
+
shared_memory : int, optional, default None
|
760
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
761
|
+
This parameter maps to the `--shm-size` option in Docker.
|
805
762
|
"""
|
806
763
|
...
|
807
764
|
|
808
765
|
@typing.overload
|
809
|
-
def
|
766
|
+
def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
810
767
|
...
|
811
768
|
|
812
769
|
@typing.overload
|
813
|
-
def
|
814
|
-
...
|
815
|
-
|
816
|
-
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):
|
817
|
-
"""
|
818
|
-
Specifies the Conda environment for the step.
|
819
|
-
|
820
|
-
Information in this decorator will augment any
|
821
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
822
|
-
you can use `@conda_base` to set packages required by all
|
823
|
-
steps and use `@conda` to specify step-specific overrides.
|
824
|
-
|
825
|
-
Parameters
|
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
|
-
libraries : Dict[str, str], default {}
|
831
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
832
|
-
python : str, optional, default None
|
833
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
834
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
835
|
-
disabled : bool, default False
|
836
|
-
If set to True, disables @conda.
|
837
|
-
"""
|
770
|
+
def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
838
771
|
...
|
839
772
|
|
840
|
-
|
841
|
-
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]]]:
|
773
|
+
def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
|
842
774
|
"""
|
843
|
-
Specifies
|
844
|
-
the execution of a step.
|
775
|
+
Specifies the resources needed when executing this step.
|
845
776
|
|
846
|
-
|
847
|
-
|
848
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
849
|
-
List of secret specs, defining how the secrets are to be retrieved
|
850
|
-
"""
|
851
|
-
...
|
852
|
-
|
853
|
-
@typing.overload
|
854
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
855
|
-
...
|
856
|
-
|
857
|
-
@typing.overload
|
858
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
859
|
-
...
|
860
|
-
|
861
|
-
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]]] = []):
|
862
|
-
"""
|
863
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
864
|
-
the execution of a step.
|
777
|
+
Use `@resources` to specify the resource requirements
|
778
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
865
779
|
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
780
|
+
You can choose the compute layer on the command line by executing e.g.
|
781
|
+
```
|
782
|
+
python myflow.py run --with batch
|
783
|
+
```
|
784
|
+
or
|
785
|
+
```
|
786
|
+
python myflow.py run --with kubernetes
|
787
|
+
```
|
788
|
+
which executes the flow on the desired system using the
|
789
|
+
requirements specified in `@resources`.
|
876
790
|
|
877
791
|
Parameters
|
878
792
|
----------
|
879
793
|
cpu : int, default 1
|
880
|
-
Number of CPUs required for this step.
|
881
|
-
|
794
|
+
Number of CPUs required for this step.
|
795
|
+
gpu : int, default 0
|
796
|
+
Number of GPUs required for this step.
|
797
|
+
disk : int, optional, default None
|
798
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
882
799
|
memory : int, default 4096
|
883
|
-
Memory size (in MB) required for this step.
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
Disk size (in MB) required for this step. If
|
888
|
-
`@resources` is also present, the maximum value from all decorators is
|
889
|
-
used.
|
890
|
-
image : str, optional, default None
|
891
|
-
Docker image to use when launching on Kubernetes. If not specified, and
|
892
|
-
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
893
|
-
not, a default Docker image mapping to the current version of Python is used.
|
894
|
-
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
895
|
-
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
896
|
-
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
897
|
-
Kubernetes service account to use when launching pod in Kubernetes.
|
898
|
-
secrets : List[str], optional, default None
|
899
|
-
Kubernetes secrets to use when launching pod in Kubernetes. These
|
900
|
-
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
901
|
-
in Metaflow configuration.
|
902
|
-
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
903
|
-
Kubernetes namespace to use when launching pod in Kubernetes.
|
904
|
-
gpu : int, optional, default None
|
905
|
-
Number of GPUs required for this step. A value of zero implies that
|
906
|
-
the scheduled node should not have GPUs.
|
907
|
-
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
908
|
-
The vendor of the GPUs to be used for this step.
|
909
|
-
tolerations : List[str], default []
|
910
|
-
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
911
|
-
Kubernetes tolerations to use when launching pod in Kubernetes.
|
912
|
-
use_tmpfs : bool, default False
|
913
|
-
This enables an explicit tmpfs mount for this step.
|
914
|
-
tmpfs_tempdir : bool, default True
|
915
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
916
|
-
tmpfs_size : int, optional, default: None
|
917
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
918
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
919
|
-
memory allocated for this step.
|
920
|
-
tmpfs_path : str, optional, default /metaflow_temp
|
921
|
-
Path to tmpfs mount for this step.
|
922
|
-
persistent_volume_claims : Dict[str, str], optional, default None
|
923
|
-
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
924
|
-
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
925
|
-
shared_memory: int, optional
|
926
|
-
Shared memory size (in MiB) required for this step
|
927
|
-
port: int, optional
|
928
|
-
Port number to specify in the Kubernetes job object
|
800
|
+
Memory size (in MB) required for this step.
|
801
|
+
shared_memory : int, optional, default None
|
802
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
803
|
+
This parameter maps to the `--shm-size` option in Docker.
|
929
804
|
"""
|
930
805
|
...
|
931
806
|
|
@@ -987,210 +862,51 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
987
862
|
...
|
988
863
|
|
989
864
|
@typing.overload
|
990
|
-
def
|
865
|
+
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]]]:
|
991
866
|
"""
|
992
|
-
Specifies the
|
867
|
+
Specifies that the step will success under all circumstances.
|
993
868
|
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
```
|
999
|
-
python myflow.py run --with batch
|
1000
|
-
```
|
1001
|
-
or
|
1002
|
-
```
|
1003
|
-
python myflow.py run --with kubernetes
|
1004
|
-
```
|
1005
|
-
which executes the flow on the desired system using the
|
1006
|
-
requirements specified in `@resources`.
|
1007
|
-
|
1008
|
-
Parameters
|
1009
|
-
----------
|
1010
|
-
cpu : int, default 1
|
1011
|
-
Number of CPUs required for this step.
|
1012
|
-
gpu : int, default 0
|
1013
|
-
Number of GPUs required for this step.
|
1014
|
-
disk : int, optional, default None
|
1015
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
1016
|
-
memory : int, default 4096
|
1017
|
-
Memory size (in MB) required for this step.
|
1018
|
-
shared_memory : int, optional, default None
|
1019
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
1020
|
-
This parameter maps to the `--shm-size` option in Docker.
|
1021
|
-
"""
|
1022
|
-
...
|
1023
|
-
|
1024
|
-
@typing.overload
|
1025
|
-
def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1026
|
-
...
|
1027
|
-
|
1028
|
-
@typing.overload
|
1029
|
-
def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1030
|
-
...
|
1031
|
-
|
1032
|
-
def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
|
1033
|
-
"""
|
1034
|
-
Specifies the resources needed when executing this step.
|
1035
|
-
|
1036
|
-
Use `@resources` to specify the resource requirements
|
1037
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
1038
|
-
|
1039
|
-
You can choose the compute layer on the command line by executing e.g.
|
1040
|
-
```
|
1041
|
-
python myflow.py run --with batch
|
1042
|
-
```
|
1043
|
-
or
|
1044
|
-
```
|
1045
|
-
python myflow.py run --with kubernetes
|
1046
|
-
```
|
1047
|
-
which executes the flow on the desired system using the
|
1048
|
-
requirements specified in `@resources`.
|
1049
|
-
|
1050
|
-
Parameters
|
1051
|
-
----------
|
1052
|
-
cpu : int, default 1
|
1053
|
-
Number of CPUs required for this step.
|
1054
|
-
gpu : int, default 0
|
1055
|
-
Number of GPUs required for this step.
|
1056
|
-
disk : int, optional, default None
|
1057
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
1058
|
-
memory : int, default 4096
|
1059
|
-
Memory size (in MB) required for this step.
|
1060
|
-
shared_memory : int, optional, default None
|
1061
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
1062
|
-
This parameter maps to the `--shm-size` option in Docker.
|
1063
|
-
"""
|
1064
|
-
...
|
1065
|
-
|
1066
|
-
@typing.overload
|
1067
|
-
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]]]:
|
1068
|
-
"""
|
1069
|
-
Specifies the PyPI packages for the step.
|
1070
|
-
|
1071
|
-
Information in this decorator will augment any
|
1072
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1073
|
-
you can use `@pypi_base` to set packages required by all
|
1074
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1075
|
-
|
1076
|
-
Parameters
|
1077
|
-
----------
|
1078
|
-
packages : Dict[str, str], default: {}
|
1079
|
-
Packages to use for this step. The key is the name of the package
|
1080
|
-
and the value is the version to use.
|
1081
|
-
python : str, optional, default: None
|
1082
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1083
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1084
|
-
"""
|
1085
|
-
...
|
1086
|
-
|
1087
|
-
@typing.overload
|
1088
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1089
|
-
...
|
1090
|
-
|
1091
|
-
@typing.overload
|
1092
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1093
|
-
...
|
1094
|
-
|
1095
|
-
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):
|
1096
|
-
"""
|
1097
|
-
Specifies the PyPI packages for the step.
|
1098
|
-
|
1099
|
-
Information in this decorator will augment any
|
1100
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1101
|
-
you can use `@pypi_base` to set packages required by all
|
1102
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1103
|
-
|
1104
|
-
Parameters
|
1105
|
-
----------
|
1106
|
-
packages : Dict[str, str], default: {}
|
1107
|
-
Packages to use for this step. The key is the name of the package
|
1108
|
-
and the value is the version to use.
|
1109
|
-
python : str, optional, default: None
|
1110
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1111
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1112
|
-
"""
|
1113
|
-
...
|
1114
|
-
|
1115
|
-
@typing.overload
|
1116
|
-
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]]]:
|
1117
|
-
"""
|
1118
|
-
Specifies environment variables to be set prior to the execution of a step.
|
1119
|
-
|
1120
|
-
Parameters
|
1121
|
-
----------
|
1122
|
-
vars : Dict[str, str], default {}
|
1123
|
-
Dictionary of environment variables to set.
|
1124
|
-
"""
|
1125
|
-
...
|
1126
|
-
|
1127
|
-
@typing.overload
|
1128
|
-
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1129
|
-
...
|
1130
|
-
|
1131
|
-
@typing.overload
|
1132
|
-
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1133
|
-
...
|
1134
|
-
|
1135
|
-
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
1136
|
-
"""
|
1137
|
-
Specifies environment variables to be set prior to the execution of a step.
|
1138
|
-
|
1139
|
-
Parameters
|
1140
|
-
----------
|
1141
|
-
vars : Dict[str, str], default {}
|
1142
|
-
Dictionary of environment variables to set.
|
1143
|
-
"""
|
1144
|
-
...
|
1145
|
-
|
1146
|
-
@typing.overload
|
1147
|
-
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]]]:
|
1148
|
-
"""
|
1149
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
1150
|
-
|
1151
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
869
|
+
The decorator will create an optional artifact, specified by `var`, which
|
870
|
+
contains the exception raised. You can use it to detect the presence
|
871
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
872
|
+
are missing.
|
1152
873
|
|
1153
874
|
Parameters
|
1154
875
|
----------
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
timeout : int, default 45
|
1162
|
-
Interrupt reporting if it takes more than this many seconds.
|
1163
|
-
|
1164
|
-
|
876
|
+
var : str, optional, default None
|
877
|
+
Name of the artifact in which to store the caught exception.
|
878
|
+
If not specified, the exception is not stored.
|
879
|
+
print_exception : bool, default True
|
880
|
+
Determines whether or not the exception is printed to
|
881
|
+
stdout when caught.
|
1165
882
|
"""
|
1166
883
|
...
|
1167
884
|
|
1168
885
|
@typing.overload
|
1169
|
-
def
|
886
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1170
887
|
...
|
1171
888
|
|
1172
889
|
@typing.overload
|
1173
|
-
def
|
890
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1174
891
|
...
|
1175
892
|
|
1176
|
-
def
|
893
|
+
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):
|
1177
894
|
"""
|
1178
|
-
|
895
|
+
Specifies that the step will success under all circumstances.
|
1179
896
|
|
1180
|
-
|
897
|
+
The decorator will create an optional artifact, specified by `var`, which
|
898
|
+
contains the exception raised. You can use it to detect the presence
|
899
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
900
|
+
are missing.
|
1181
901
|
|
1182
902
|
Parameters
|
1183
903
|
----------
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1190
|
-
timeout : int, default 45
|
1191
|
-
Interrupt reporting if it takes more than this many seconds.
|
1192
|
-
|
1193
|
-
|
904
|
+
var : str, optional, default None
|
905
|
+
Name of the artifact in which to store the caught exception.
|
906
|
+
If not specified, the exception is not stored.
|
907
|
+
print_exception : bool, default True
|
908
|
+
Determines whether or not the exception is printed to
|
909
|
+
stdout when caught.
|
1194
910
|
"""
|
1195
911
|
...
|
1196
912
|
|
@@ -1342,51 +1058,384 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
1342
1058
|
...
|
1343
1059
|
|
1344
1060
|
@typing.overload
|
1345
|
-
def
|
1061
|
+
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]]]:
|
1346
1062
|
"""
|
1347
|
-
Specifies
|
1348
|
-
|
1349
|
-
The decorator will create an optional artifact, specified by `var`, which
|
1350
|
-
contains the exception raised. You can use it to detect the presence
|
1351
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
1352
|
-
are missing.
|
1063
|
+
Specifies environment variables to be set prior to the execution of a step.
|
1353
1064
|
|
1354
1065
|
Parameters
|
1355
1066
|
----------
|
1356
|
-
|
1357
|
-
|
1358
|
-
If not specified, the exception is not stored.
|
1359
|
-
print_exception : bool, default True
|
1360
|
-
Determines whether or not the exception is printed to
|
1361
|
-
stdout when caught.
|
1067
|
+
vars : Dict[str, str], default {}
|
1068
|
+
Dictionary of environment variables to set.
|
1362
1069
|
"""
|
1363
1070
|
...
|
1364
1071
|
|
1365
1072
|
@typing.overload
|
1366
|
-
def
|
1073
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1367
1074
|
...
|
1368
1075
|
|
1369
1076
|
@typing.overload
|
1370
|
-
def
|
1077
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1371
1078
|
...
|
1372
1079
|
|
1373
|
-
def
|
1080
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
1374
1081
|
"""
|
1375
|
-
Specifies
|
1082
|
+
Specifies environment variables to be set prior to the execution of a step.
|
1376
1083
|
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1084
|
+
Parameters
|
1085
|
+
----------
|
1086
|
+
vars : Dict[str, str], default {}
|
1087
|
+
Dictionary of environment variables to set.
|
1088
|
+
"""
|
1089
|
+
...
|
1090
|
+
|
1091
|
+
@typing.overload
|
1092
|
+
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]]]:
|
1093
|
+
"""
|
1094
|
+
Specifies the PyPI packages for the step.
|
1095
|
+
|
1096
|
+
Information in this decorator will augment any
|
1097
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1098
|
+
you can use `@pypi_base` to set packages required by all
|
1099
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1381
1100
|
|
1382
1101
|
Parameters
|
1383
1102
|
----------
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1103
|
+
packages : Dict[str, str], default: {}
|
1104
|
+
Packages to use for this step. The key is the name of the package
|
1105
|
+
and the value is the version to use.
|
1106
|
+
python : str, optional, default: None
|
1107
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1108
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1109
|
+
"""
|
1110
|
+
...
|
1111
|
+
|
1112
|
+
@typing.overload
|
1113
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1114
|
+
...
|
1115
|
+
|
1116
|
+
@typing.overload
|
1117
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1118
|
+
...
|
1119
|
+
|
1120
|
+
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):
|
1121
|
+
"""
|
1122
|
+
Specifies the PyPI packages for the step.
|
1123
|
+
|
1124
|
+
Information in this decorator will augment any
|
1125
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1126
|
+
you can use `@pypi_base` to set packages required by all
|
1127
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1128
|
+
|
1129
|
+
Parameters
|
1130
|
+
----------
|
1131
|
+
packages : Dict[str, str], default: {}
|
1132
|
+
Packages to use for this step. The key is the name of the package
|
1133
|
+
and the value is the version to use.
|
1134
|
+
python : str, optional, default: None
|
1135
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1136
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1137
|
+
"""
|
1138
|
+
...
|
1139
|
+
|
1140
|
+
@typing.overload
|
1141
|
+
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]]]:
|
1142
|
+
"""
|
1143
|
+
Specifies the Conda environment for the step.
|
1144
|
+
|
1145
|
+
Information in this decorator will augment any
|
1146
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
1147
|
+
you can use `@conda_base` to set packages required by all
|
1148
|
+
steps and use `@conda` to specify step-specific overrides.
|
1149
|
+
|
1150
|
+
Parameters
|
1151
|
+
----------
|
1152
|
+
packages : Dict[str, str], default {}
|
1153
|
+
Packages to use for this step. The key is the name of the package
|
1154
|
+
and the value is the version to use.
|
1155
|
+
libraries : Dict[str, str], default {}
|
1156
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1157
|
+
python : str, optional, default None
|
1158
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1159
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1160
|
+
disabled : bool, default False
|
1161
|
+
If set to True, disables @conda.
|
1162
|
+
"""
|
1163
|
+
...
|
1164
|
+
|
1165
|
+
@typing.overload
|
1166
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1167
|
+
...
|
1168
|
+
|
1169
|
+
@typing.overload
|
1170
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1171
|
+
...
|
1172
|
+
|
1173
|
+
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):
|
1174
|
+
"""
|
1175
|
+
Specifies the Conda environment for the step.
|
1176
|
+
|
1177
|
+
Information in this decorator will augment any
|
1178
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
1179
|
+
you can use `@conda_base` to set packages required by all
|
1180
|
+
steps and use `@conda` to specify step-specific overrides.
|
1181
|
+
|
1182
|
+
Parameters
|
1183
|
+
----------
|
1184
|
+
packages : Dict[str, str], default {}
|
1185
|
+
Packages to use for this step. The key is the name of the package
|
1186
|
+
and the value is the version to use.
|
1187
|
+
libraries : Dict[str, str], default {}
|
1188
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1189
|
+
python : str, optional, default None
|
1190
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1191
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1192
|
+
disabled : bool, default False
|
1193
|
+
If set to True, disables @conda.
|
1194
|
+
"""
|
1195
|
+
...
|
1196
|
+
|
1197
|
+
@typing.overload
|
1198
|
+
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]]]:
|
1199
|
+
"""
|
1200
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
1201
|
+
|
1202
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1203
|
+
|
1204
|
+
Parameters
|
1205
|
+
----------
|
1206
|
+
type : str, default 'default'
|
1207
|
+
Card type.
|
1208
|
+
id : str, optional, default None
|
1209
|
+
If multiple cards are present, use this id to identify this card.
|
1210
|
+
options : Dict[str, Any], default {}
|
1211
|
+
Options passed to the card. The contents depend on the card type.
|
1212
|
+
timeout : int, default 45
|
1213
|
+
Interrupt reporting if it takes more than this many seconds.
|
1214
|
+
|
1215
|
+
|
1216
|
+
"""
|
1217
|
+
...
|
1218
|
+
|
1219
|
+
@typing.overload
|
1220
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1221
|
+
...
|
1222
|
+
|
1223
|
+
@typing.overload
|
1224
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1225
|
+
...
|
1226
|
+
|
1227
|
+
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):
|
1228
|
+
"""
|
1229
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
1230
|
+
|
1231
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1232
|
+
|
1233
|
+
Parameters
|
1234
|
+
----------
|
1235
|
+
type : str, default 'default'
|
1236
|
+
Card type.
|
1237
|
+
id : str, optional, default None
|
1238
|
+
If multiple cards are present, use this id to identify this card.
|
1239
|
+
options : Dict[str, Any], default {}
|
1240
|
+
Options passed to the card. The contents depend on the card type.
|
1241
|
+
timeout : int, default 45
|
1242
|
+
Interrupt reporting if it takes more than this many seconds.
|
1243
|
+
|
1244
|
+
|
1245
|
+
"""
|
1246
|
+
...
|
1247
|
+
|
1248
|
+
@typing.overload
|
1249
|
+
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]]]:
|
1250
|
+
"""
|
1251
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
1252
|
+
the execution of a step.
|
1253
|
+
|
1254
|
+
Parameters
|
1255
|
+
----------
|
1256
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
1257
|
+
List of secret specs, defining how the secrets are to be retrieved
|
1258
|
+
"""
|
1259
|
+
...
|
1260
|
+
|
1261
|
+
@typing.overload
|
1262
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1263
|
+
...
|
1264
|
+
|
1265
|
+
@typing.overload
|
1266
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1267
|
+
...
|
1268
|
+
|
1269
|
+
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]]] = []):
|
1270
|
+
"""
|
1271
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
1272
|
+
the execution of a step.
|
1273
|
+
|
1274
|
+
Parameters
|
1275
|
+
----------
|
1276
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
1277
|
+
List of secret specs, defining how the secrets are to be retrieved
|
1278
|
+
"""
|
1279
|
+
...
|
1280
|
+
|
1281
|
+
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]]]:
|
1282
|
+
"""
|
1283
|
+
Specifies that this step should execute on Kubernetes.
|
1284
|
+
|
1285
|
+
Parameters
|
1286
|
+
----------
|
1287
|
+
cpu : int, default 1
|
1288
|
+
Number of CPUs required for this step. If `@resources` is
|
1289
|
+
also present, the maximum value from all decorators is used.
|
1290
|
+
memory : int, default 4096
|
1291
|
+
Memory size (in MB) required for this step. If
|
1292
|
+
`@resources` is also present, the maximum value from all decorators is
|
1293
|
+
used.
|
1294
|
+
disk : int, default 10240
|
1295
|
+
Disk size (in MB) required for this step. If
|
1296
|
+
`@resources` is also present, the maximum value from all decorators is
|
1297
|
+
used.
|
1298
|
+
image : str, optional, default None
|
1299
|
+
Docker image to use when launching on Kubernetes. If not specified, and
|
1300
|
+
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
1301
|
+
not, a default Docker image mapping to the current version of Python is used.
|
1302
|
+
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
1303
|
+
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
1304
|
+
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
1305
|
+
Kubernetes service account to use when launching pod in Kubernetes.
|
1306
|
+
secrets : List[str], optional, default None
|
1307
|
+
Kubernetes secrets to use when launching pod in Kubernetes. These
|
1308
|
+
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
1309
|
+
in Metaflow configuration.
|
1310
|
+
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
1311
|
+
Kubernetes namespace to use when launching pod in Kubernetes.
|
1312
|
+
gpu : int, optional, default None
|
1313
|
+
Number of GPUs required for this step. A value of zero implies that
|
1314
|
+
the scheduled node should not have GPUs.
|
1315
|
+
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
1316
|
+
The vendor of the GPUs to be used for this step.
|
1317
|
+
tolerations : List[str], default []
|
1318
|
+
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
1319
|
+
Kubernetes tolerations to use when launching pod in Kubernetes.
|
1320
|
+
use_tmpfs : bool, default False
|
1321
|
+
This enables an explicit tmpfs mount for this step.
|
1322
|
+
tmpfs_tempdir : bool, default True
|
1323
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
1324
|
+
tmpfs_size : int, optional, default: None
|
1325
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
1326
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
1327
|
+
memory allocated for this step.
|
1328
|
+
tmpfs_path : str, optional, default /metaflow_temp
|
1329
|
+
Path to tmpfs mount for this step.
|
1330
|
+
persistent_volume_claims : Dict[str, str], optional, default None
|
1331
|
+
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
1332
|
+
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
1333
|
+
shared_memory: int, optional
|
1334
|
+
Shared memory size (in MiB) required for this step
|
1335
|
+
port: int, optional
|
1336
|
+
Port number to specify in the Kubernetes job object
|
1337
|
+
"""
|
1338
|
+
...
|
1339
|
+
|
1340
|
+
@typing.overload
|
1341
|
+
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]]]:
|
1342
|
+
"""
|
1343
|
+
Specifies the number of times the task corresponding
|
1344
|
+
to a step needs to be retried.
|
1345
|
+
|
1346
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
1347
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
1348
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
1349
|
+
|
1350
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
1351
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
1352
|
+
ensuring that the flow execution can continue.
|
1353
|
+
|
1354
|
+
Parameters
|
1355
|
+
----------
|
1356
|
+
times : int, default 3
|
1357
|
+
Number of times to retry this task.
|
1358
|
+
minutes_between_retries : int, default 2
|
1359
|
+
Number of minutes between retries.
|
1360
|
+
"""
|
1361
|
+
...
|
1362
|
+
|
1363
|
+
@typing.overload
|
1364
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1365
|
+
...
|
1366
|
+
|
1367
|
+
@typing.overload
|
1368
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1369
|
+
...
|
1370
|
+
|
1371
|
+
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):
|
1372
|
+
"""
|
1373
|
+
Specifies the number of times the task corresponding
|
1374
|
+
to a step needs to be retried.
|
1375
|
+
|
1376
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
1377
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
1378
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
1379
|
+
|
1380
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
1381
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
1382
|
+
ensuring that the flow execution can continue.
|
1383
|
+
|
1384
|
+
Parameters
|
1385
|
+
----------
|
1386
|
+
times : int, default 3
|
1387
|
+
Number of times to retry this task.
|
1388
|
+
minutes_between_retries : int, default 2
|
1389
|
+
Number of minutes between retries.
|
1390
|
+
"""
|
1391
|
+
...
|
1392
|
+
|
1393
|
+
@typing.overload
|
1394
|
+
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]]:
|
1395
|
+
"""
|
1396
|
+
Specifies the times when the flow should be run when running on a
|
1397
|
+
production scheduler.
|
1398
|
+
|
1399
|
+
Parameters
|
1400
|
+
----------
|
1401
|
+
hourly : bool, default False
|
1402
|
+
Run the workflow hourly.
|
1403
|
+
daily : bool, default True
|
1404
|
+
Run the workflow daily.
|
1405
|
+
weekly : bool, default False
|
1406
|
+
Run the workflow weekly.
|
1407
|
+
cron : str, optional, default None
|
1408
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1409
|
+
specified by this expression.
|
1410
|
+
timezone : str, optional, default None
|
1411
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1412
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1413
|
+
"""
|
1414
|
+
...
|
1415
|
+
|
1416
|
+
@typing.overload
|
1417
|
+
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1418
|
+
...
|
1419
|
+
|
1420
|
+
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):
|
1421
|
+
"""
|
1422
|
+
Specifies the times when the flow should be run when running on a
|
1423
|
+
production scheduler.
|
1424
|
+
|
1425
|
+
Parameters
|
1426
|
+
----------
|
1427
|
+
hourly : bool, default False
|
1428
|
+
Run the workflow hourly.
|
1429
|
+
daily : bool, default True
|
1430
|
+
Run the workflow daily.
|
1431
|
+
weekly : bool, default False
|
1432
|
+
Run the workflow weekly.
|
1433
|
+
cron : str, optional, default None
|
1434
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1435
|
+
specified by this expression.
|
1436
|
+
timezone : str, optional, default None
|
1437
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1438
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1390
1439
|
"""
|
1391
1440
|
...
|
1392
1441
|
|
@@ -1493,73 +1542,6 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
1493
1542
|
"""
|
1494
1543
|
...
|
1495
1544
|
|
1496
|
-
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1497
|
-
"""
|
1498
|
-
Specifies what flows belong to the same project.
|
1499
|
-
|
1500
|
-
A project-specific namespace is created for all flows that
|
1501
|
-
use the same `@project(name)`.
|
1502
|
-
|
1503
|
-
Parameters
|
1504
|
-
----------
|
1505
|
-
name : str
|
1506
|
-
Project name. Make sure that the name is unique amongst all
|
1507
|
-
projects that use the same production scheduler. The name may
|
1508
|
-
contain only lowercase alphanumeric characters and underscores.
|
1509
|
-
|
1510
|
-
|
1511
|
-
"""
|
1512
|
-
...
|
1513
|
-
|
1514
|
-
@typing.overload
|
1515
|
-
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]]:
|
1516
|
-
"""
|
1517
|
-
Specifies the times when the flow should be run when running on a
|
1518
|
-
production scheduler.
|
1519
|
-
|
1520
|
-
Parameters
|
1521
|
-
----------
|
1522
|
-
hourly : bool, default False
|
1523
|
-
Run the workflow hourly.
|
1524
|
-
daily : bool, default True
|
1525
|
-
Run the workflow daily.
|
1526
|
-
weekly : bool, default False
|
1527
|
-
Run the workflow weekly.
|
1528
|
-
cron : str, optional, default None
|
1529
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1530
|
-
specified by this expression.
|
1531
|
-
timezone : str, optional, default None
|
1532
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1533
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1534
|
-
"""
|
1535
|
-
...
|
1536
|
-
|
1537
|
-
@typing.overload
|
1538
|
-
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1539
|
-
...
|
1540
|
-
|
1541
|
-
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):
|
1542
|
-
"""
|
1543
|
-
Specifies the times when the flow should be run when running on a
|
1544
|
-
production scheduler.
|
1545
|
-
|
1546
|
-
Parameters
|
1547
|
-
----------
|
1548
|
-
hourly : bool, default False
|
1549
|
-
Run the workflow hourly.
|
1550
|
-
daily : bool, default True
|
1551
|
-
Run the workflow daily.
|
1552
|
-
weekly : bool, default False
|
1553
|
-
Run the workflow weekly.
|
1554
|
-
cron : str, optional, default None
|
1555
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1556
|
-
specified by this expression.
|
1557
|
-
timezone : str, optional, default None
|
1558
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1559
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1560
|
-
"""
|
1561
|
-
...
|
1562
|
-
|
1563
1545
|
@typing.overload
|
1564
1546
|
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]]:
|
1565
1547
|
"""
|
@@ -1655,45 +1637,6 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
1655
1637
|
"""
|
1656
1638
|
...
|
1657
1639
|
|
1658
|
-
@typing.overload
|
1659
|
-
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1660
|
-
"""
|
1661
|
-
Specifies the PyPI packages for all steps of the flow.
|
1662
|
-
|
1663
|
-
Use `@pypi_base` to set common packages required by all
|
1664
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1665
|
-
Parameters
|
1666
|
-
----------
|
1667
|
-
packages : Dict[str, str], default: {}
|
1668
|
-
Packages to use for this flow. The key is the name of the package
|
1669
|
-
and the value is the version to use.
|
1670
|
-
python : str, optional, default: None
|
1671
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1672
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1673
|
-
"""
|
1674
|
-
...
|
1675
|
-
|
1676
|
-
@typing.overload
|
1677
|
-
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1678
|
-
...
|
1679
|
-
|
1680
|
-
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1681
|
-
"""
|
1682
|
-
Specifies the PyPI packages for all steps of the flow.
|
1683
|
-
|
1684
|
-
Use `@pypi_base` to set common packages required by all
|
1685
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1686
|
-
Parameters
|
1687
|
-
----------
|
1688
|
-
packages : Dict[str, str], default: {}
|
1689
|
-
Packages to use for this flow. The key is the name of the package
|
1690
|
-
and the value is the version to use.
|
1691
|
-
python : str, optional, default: None
|
1692
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1693
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1694
|
-
"""
|
1695
|
-
...
|
1696
|
-
|
1697
1640
|
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]]:
|
1698
1641
|
"""
|
1699
1642
|
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.
|
@@ -1736,48 +1679,6 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
|
|
1736
1679
|
"""
|
1737
1680
|
...
|
1738
1681
|
|
1739
|
-
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]]:
|
1740
|
-
"""
|
1741
|
-
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)
|
1742
|
-
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1743
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1744
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1745
|
-
starts only after all sensors finish.
|
1746
|
-
|
1747
|
-
Parameters
|
1748
|
-
----------
|
1749
|
-
timeout : int
|
1750
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
1751
|
-
poke_interval : int
|
1752
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
1753
|
-
mode : str
|
1754
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1755
|
-
exponential_backoff : bool
|
1756
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1757
|
-
pool : str
|
1758
|
-
the slot pool this task should run in,
|
1759
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1760
|
-
soft_fail : bool
|
1761
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1762
|
-
name : str
|
1763
|
-
Name of the sensor on Airflow
|
1764
|
-
description : str
|
1765
|
-
Description of sensor in the Airflow UI
|
1766
|
-
bucket_key : Union[str, List[str]]
|
1767
|
-
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1768
|
-
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1769
|
-
bucket_name : str
|
1770
|
-
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1771
|
-
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1772
|
-
wildcard_match : bool
|
1773
|
-
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1774
|
-
aws_conn_id : str
|
1775
|
-
a reference to the s3 connection on Airflow. (Default: None)
|
1776
|
-
verify : bool
|
1777
|
-
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1778
|
-
"""
|
1779
|
-
...
|
1780
|
-
|
1781
1682
|
@typing.overload
|
1782
1683
|
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]]:
|
1783
1684
|
"""
|
@@ -1827,6 +1728,105 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
|
|
1827
1728
|
"""
|
1828
1729
|
...
|
1829
1730
|
|
1731
|
+
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1732
|
+
"""
|
1733
|
+
Specifies what flows belong to the same project.
|
1734
|
+
|
1735
|
+
A project-specific namespace is created for all flows that
|
1736
|
+
use the same `@project(name)`.
|
1737
|
+
|
1738
|
+
Parameters
|
1739
|
+
----------
|
1740
|
+
name : str
|
1741
|
+
Project name. Make sure that the name is unique amongst all
|
1742
|
+
projects that use the same production scheduler. The name may
|
1743
|
+
contain only lowercase alphanumeric characters and underscores.
|
1744
|
+
|
1745
|
+
|
1746
|
+
"""
|
1747
|
+
...
|
1748
|
+
|
1749
|
+
@typing.overload
|
1750
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1751
|
+
"""
|
1752
|
+
Specifies the PyPI packages for all steps of the flow.
|
1753
|
+
|
1754
|
+
Use `@pypi_base` to set common packages required by all
|
1755
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1756
|
+
Parameters
|
1757
|
+
----------
|
1758
|
+
packages : Dict[str, str], default: {}
|
1759
|
+
Packages to use for this flow. The key is the name of the package
|
1760
|
+
and the value is the version to use.
|
1761
|
+
python : str, optional, default: None
|
1762
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1763
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1764
|
+
"""
|
1765
|
+
...
|
1766
|
+
|
1767
|
+
@typing.overload
|
1768
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1769
|
+
...
|
1770
|
+
|
1771
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1772
|
+
"""
|
1773
|
+
Specifies the PyPI packages for all steps of the flow.
|
1774
|
+
|
1775
|
+
Use `@pypi_base` to set common packages required by all
|
1776
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1777
|
+
Parameters
|
1778
|
+
----------
|
1779
|
+
packages : Dict[str, str], default: {}
|
1780
|
+
Packages to use for this flow. The key is the name of the package
|
1781
|
+
and the value is the version to use.
|
1782
|
+
python : str, optional, default: None
|
1783
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1784
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1785
|
+
"""
|
1786
|
+
...
|
1787
|
+
|
1788
|
+
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]]:
|
1789
|
+
"""
|
1790
|
+
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)
|
1791
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1792
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1793
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1794
|
+
starts only after all sensors finish.
|
1795
|
+
|
1796
|
+
Parameters
|
1797
|
+
----------
|
1798
|
+
timeout : int
|
1799
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1800
|
+
poke_interval : int
|
1801
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1802
|
+
mode : str
|
1803
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1804
|
+
exponential_backoff : bool
|
1805
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1806
|
+
pool : str
|
1807
|
+
the slot pool this task should run in,
|
1808
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1809
|
+
soft_fail : bool
|
1810
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1811
|
+
name : str
|
1812
|
+
Name of the sensor on Airflow
|
1813
|
+
description : str
|
1814
|
+
Description of sensor in the Airflow UI
|
1815
|
+
bucket_key : Union[str, List[str]]
|
1816
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1817
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1818
|
+
bucket_name : str
|
1819
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1820
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1821
|
+
wildcard_match : bool
|
1822
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1823
|
+
aws_conn_id : str
|
1824
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1825
|
+
verify : bool
|
1826
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1827
|
+
"""
|
1828
|
+
...
|
1829
|
+
|
1830
1830
|
def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
|
1831
1831
|
"""
|
1832
1832
|
Switch namespace to the one provided.
|