metaflow-stubs 2.12.4__py2.py3-none-any.whl → 2.12.6__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 +493 -493
- metaflow-stubs/cards.pyi +11 -5
- metaflow-stubs/cli.pyi +3 -3
- metaflow-stubs/client/__init__.pyi +4 -4
- metaflow-stubs/client/core.pyi +5 -5
- 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 +6 -6
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +5 -5
- metaflow-stubs/metadata/metadata.pyi +2 -2
- metaflow-stubs/metadata/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -2
- metaflow-stubs/metaflow_current.pyi +18 -18
- 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 +9 -3
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow.pyi +4 -4
- metaflow-stubs/plugins/airflow/airflow_cli.pyi +4 -4
- 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 +3 -3
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +4 -4
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +4 -4
- 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 +6 -4
- metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +5 -5
- 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 +4 -4
- 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 +5 -5
- 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 +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 +9 -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 +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 +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 +4 -4
- metaflow-stubs/plugins/datatools/__init__.pyi +3 -3
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +4 -4
- metaflow-stubs/plugins/datatools/s3/s3.pyi +7 -7
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
- metaflow-stubs/plugins/debug_logger.pyi +2 -2
- metaflow-stubs/plugins/debug_monitor.pyi +2 -2
- metaflow-stubs/plugins/environment_decorator.pyi +2 -2
- metaflow-stubs/plugins/events_decorator.pyi +3 -3
- 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 +3 -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 +4 -4
- metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +3 -3
- 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 +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 +6 -6
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +4 -4
- 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/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/metaflow_runner.pyi +3 -3
- metaflow-stubs/runner/nbrun.pyi +2 -2
- metaflow-stubs/runner/subprocess_manager.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- metaflow-stubs/version.pyi +2 -2
- {metaflow_stubs-2.12.4.dist-info → metaflow_stubs-2.12.6.dist-info}/METADATA +2 -2
- metaflow_stubs-2.12.6.dist-info/RECORD +142 -0
- {metaflow_stubs-2.12.4.dist-info → metaflow_stubs-2.12.6.dist-info}/WHEEL +1 -1
- metaflow_stubs-2.12.4.dist-info/RECORD +0 -142
- {metaflow_stubs-2.12.4.dist-info → metaflow_stubs-2.12.6.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-
|
3
|
+
# MF version: 2.12.6 #
|
4
|
+
# Generated on 2024-07-01T22:37:35.546266 #
|
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.
|
12
|
-
import datetime
|
13
|
-
import metaflow.events
|
11
|
+
import metaflow.parameters
|
14
12
|
import metaflow.flowspec
|
15
|
-
import
|
13
|
+
import datetime
|
14
|
+
import metaflow.datastore.inputs
|
15
|
+
import metaflow.plugins.datatools.s3.s3
|
16
16
|
import metaflow.client.core
|
17
|
-
import metaflow.
|
17
|
+
import metaflow.events
|
18
18
|
import metaflow.runner.metaflow_runner
|
19
|
+
import metaflow._vendor.click.types
|
19
20
|
import typing
|
20
|
-
import metaflow.
|
21
|
-
import
|
22
|
-
import metaflow.parameters
|
21
|
+
import metaflow.metaflow_current
|
22
|
+
import io
|
23
23
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
24
24
|
StepFlag = typing.NewType("StepFlag", bool)
|
25
25
|
|
@@ -728,259 +728,134 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
728
728
|
...
|
729
729
|
|
730
730
|
@typing.overload
|
731
|
-
def
|
731
|
+
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]]]:
|
732
732
|
"""
|
733
|
-
Specifies
|
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.
|
734
743
|
|
735
744
|
Parameters
|
736
745
|
----------
|
737
|
-
|
738
|
-
Number of
|
739
|
-
|
740
|
-
|
741
|
-
Number of GPUs required for this step. If `@resources` is
|
742
|
-
also present, the maximum value from all decorators is used.
|
743
|
-
memory : int, default 4096
|
744
|
-
Memory size (in MB) required for this step. If
|
745
|
-
`@resources` is also present, the maximum value from all decorators is
|
746
|
-
used.
|
747
|
-
image : str, optional, default None
|
748
|
-
Docker image to use when launching on AWS Batch. If not specified, and
|
749
|
-
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
750
|
-
not, a default Docker image mapping to the current version of Python is used.
|
751
|
-
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
752
|
-
AWS Batch Job Queue to submit the job to.
|
753
|
-
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
754
|
-
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
755
|
-
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
756
|
-
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
757
|
-
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
758
|
-
shared_memory : int, optional, default None
|
759
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
760
|
-
This parameter maps to the `--shm-size` option in Docker.
|
761
|
-
max_swap : int, optional, default None
|
762
|
-
The total amount of swap memory (in MiB) a container can use for this
|
763
|
-
step. This parameter is translated to the `--memory-swap` option in
|
764
|
-
Docker where the value is the sum of the container memory plus the
|
765
|
-
`max_swap` value.
|
766
|
-
swappiness : int, optional, default None
|
767
|
-
This allows you to tune memory swappiness behavior for this step.
|
768
|
-
A swappiness value of 0 causes swapping not to happen unless absolutely
|
769
|
-
necessary. A swappiness value of 100 causes pages to be swapped very
|
770
|
-
aggressively. Accepted values are whole numbers between 0 and 100.
|
771
|
-
use_tmpfs : bool, default False
|
772
|
-
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
773
|
-
not available on Fargate compute environments
|
774
|
-
tmpfs_tempdir : bool, default True
|
775
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
776
|
-
tmpfs_size : int, optional, default None
|
777
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
778
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
779
|
-
memory allocated for this step.
|
780
|
-
tmpfs_path : str, optional, default None
|
781
|
-
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
782
|
-
inferentia : int, default 0
|
783
|
-
Number of Inferentia chips required for this step.
|
784
|
-
trainium : int, default None
|
785
|
-
Alias for inferentia. Use only one of the two.
|
786
|
-
efa : int, default 0
|
787
|
-
Number of elastic fabric adapter network devices to attach to container
|
788
|
-
ephemeral_storage : int, default None
|
789
|
-
The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
|
790
|
-
This is only relevant for Fargate compute environments
|
791
|
-
log_driver: str, optional, default None
|
792
|
-
The log driver to use for the Amazon ECS container.
|
793
|
-
log_options: List[str], optional, default None
|
794
|
-
List of strings containing options for the chosen log driver. The configurable values
|
795
|
-
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
796
|
-
Example: [`awslogs-group:aws/batch/job`]
|
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.
|
797
750
|
"""
|
798
751
|
...
|
799
752
|
|
800
753
|
@typing.overload
|
801
|
-
def
|
754
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
802
755
|
...
|
803
756
|
|
804
757
|
@typing.overload
|
805
|
-
def
|
758
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
806
759
|
...
|
807
760
|
|
808
|
-
def
|
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):
|
809
762
|
"""
|
810
|
-
Specifies
|
763
|
+
Specifies the number of times the task corresponding
|
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.
|
811
773
|
|
812
774
|
Parameters
|
813
775
|
----------
|
814
|
-
|
815
|
-
Number of
|
816
|
-
|
817
|
-
|
818
|
-
Number of GPUs required for this step. If `@resources` is
|
819
|
-
also present, the maximum value from all decorators is used.
|
820
|
-
memory : int, default 4096
|
821
|
-
Memory size (in MB) required for this step. If
|
822
|
-
`@resources` is also present, the maximum value from all decorators is
|
823
|
-
used.
|
824
|
-
image : str, optional, default None
|
825
|
-
Docker image to use when launching on AWS Batch. If not specified, and
|
826
|
-
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
827
|
-
not, a default Docker image mapping to the current version of Python is used.
|
828
|
-
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
829
|
-
AWS Batch Job Queue to submit the job to.
|
830
|
-
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
831
|
-
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
832
|
-
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
833
|
-
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
834
|
-
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
835
|
-
shared_memory : int, optional, default None
|
836
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
837
|
-
This parameter maps to the `--shm-size` option in Docker.
|
838
|
-
max_swap : int, optional, default None
|
839
|
-
The total amount of swap memory (in MiB) a container can use for this
|
840
|
-
step. This parameter is translated to the `--memory-swap` option in
|
841
|
-
Docker where the value is the sum of the container memory plus the
|
842
|
-
`max_swap` value.
|
843
|
-
swappiness : int, optional, default None
|
844
|
-
This allows you to tune memory swappiness behavior for this step.
|
845
|
-
A swappiness value of 0 causes swapping not to happen unless absolutely
|
846
|
-
necessary. A swappiness value of 100 causes pages to be swapped very
|
847
|
-
aggressively. Accepted values are whole numbers between 0 and 100.
|
848
|
-
use_tmpfs : bool, default False
|
849
|
-
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
850
|
-
not available on Fargate compute environments
|
851
|
-
tmpfs_tempdir : bool, default True
|
852
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
853
|
-
tmpfs_size : int, optional, default None
|
854
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
855
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
856
|
-
memory allocated for this step.
|
857
|
-
tmpfs_path : str, optional, default None
|
858
|
-
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
859
|
-
inferentia : int, default 0
|
860
|
-
Number of Inferentia chips required for this step.
|
861
|
-
trainium : int, default None
|
862
|
-
Alias for inferentia. Use only one of the two.
|
863
|
-
efa : int, default 0
|
864
|
-
Number of elastic fabric adapter network devices to attach to container
|
865
|
-
ephemeral_storage : int, default None
|
866
|
-
The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
|
867
|
-
This is only relevant for Fargate compute environments
|
868
|
-
log_driver: str, optional, default None
|
869
|
-
The log driver to use for the Amazon ECS container.
|
870
|
-
log_options: List[str], optional, default None
|
871
|
-
List of strings containing options for the chosen log driver. The configurable values
|
872
|
-
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
873
|
-
Example: [`awslogs-group:aws/batch/job`]
|
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.
|
874
780
|
"""
|
875
781
|
...
|
876
782
|
|
877
783
|
@typing.overload
|
878
|
-
def
|
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]]]:
|
879
785
|
"""
|
880
|
-
Specifies
|
881
|
-
|
882
|
-
This decorator is useful if this step may hang indefinitely.
|
883
|
-
|
884
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
885
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
886
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
786
|
+
Specifies the Conda environment for the step.
|
887
787
|
|
888
|
-
|
889
|
-
|
788
|
+
Information in this decorator will augment any
|
789
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
790
|
+
you can use `@conda_base` to set packages required by all
|
791
|
+
steps and use `@conda` to specify step-specific overrides.
|
890
792
|
|
891
793
|
Parameters
|
892
794
|
----------
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
795
|
+
packages : Dict[str, str], default {}
|
796
|
+
Packages to use for this step. The key is the name of the package
|
797
|
+
and the value is the version to use.
|
798
|
+
libraries : Dict[str, str], default {}
|
799
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
800
|
+
python : str, optional, default None
|
801
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
802
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
803
|
+
disabled : bool, default False
|
804
|
+
If set to True, disables @conda.
|
899
805
|
"""
|
900
806
|
...
|
901
807
|
|
902
808
|
@typing.overload
|
903
|
-
def
|
809
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
904
810
|
...
|
905
811
|
|
906
812
|
@typing.overload
|
907
|
-
def
|
813
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
908
814
|
...
|
909
815
|
|
910
|
-
def
|
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):
|
911
817
|
"""
|
912
|
-
Specifies
|
913
|
-
|
914
|
-
This decorator is useful if this step may hang indefinitely.
|
915
|
-
|
916
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
917
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
918
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
818
|
+
Specifies the Conda environment for the step.
|
919
819
|
|
920
|
-
|
921
|
-
|
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.
|
922
824
|
|
923
825
|
Parameters
|
924
826
|
----------
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
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.
|
931
837
|
"""
|
932
838
|
...
|
933
839
|
|
934
840
|
@typing.overload
|
935
|
-
def
|
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]]]:
|
936
842
|
"""
|
937
|
-
Specifies
|
843
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
844
|
+
the execution of a step.
|
938
845
|
|
939
846
|
Parameters
|
940
847
|
----------
|
941
|
-
|
942
|
-
|
848
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
849
|
+
List of secret specs, defining how the secrets are to be retrieved
|
943
850
|
"""
|
944
851
|
...
|
945
852
|
|
946
853
|
@typing.overload
|
947
|
-
def
|
854
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
948
855
|
...
|
949
856
|
|
950
857
|
@typing.overload
|
951
|
-
def
|
952
|
-
...
|
953
|
-
|
954
|
-
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
955
|
-
"""
|
956
|
-
Specifies environment variables to be set prior to the execution of a step.
|
957
|
-
|
958
|
-
Parameters
|
959
|
-
----------
|
960
|
-
vars : Dict[str, str], default {}
|
961
|
-
Dictionary of environment variables to set.
|
962
|
-
"""
|
963
|
-
...
|
964
|
-
|
965
|
-
@typing.overload
|
966
|
-
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]]]:
|
967
|
-
"""
|
968
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
969
|
-
the execution of a step.
|
970
|
-
|
971
|
-
Parameters
|
972
|
-
----------
|
973
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
974
|
-
List of secret specs, defining how the secrets are to be retrieved
|
975
|
-
"""
|
976
|
-
...
|
977
|
-
|
978
|
-
@typing.overload
|
979
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
980
|
-
...
|
981
|
-
|
982
|
-
@typing.overload
|
983
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
858
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
984
859
|
...
|
985
860
|
|
986
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]]] = []):
|
@@ -995,113 +870,119 @@ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
995
870
|
"""
|
996
871
|
...
|
997
872
|
|
998
|
-
|
999
|
-
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]]]:
|
873
|
+
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]]]:
|
1000
874
|
"""
|
1001
|
-
Specifies
|
1002
|
-
to a step needs to be retried.
|
1003
|
-
|
1004
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
1005
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
1006
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
1007
|
-
|
1008
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
1009
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
1010
|
-
ensuring that the flow execution can continue.
|
875
|
+
Specifies that this step should execute on Kubernetes.
|
1011
876
|
|
1012
877
|
Parameters
|
1013
878
|
----------
|
1014
|
-
|
1015
|
-
Number of
|
1016
|
-
|
1017
|
-
|
879
|
+
cpu : int, default 1
|
880
|
+
Number of CPUs required for this step. If `@resources` is
|
881
|
+
also present, the maximum value from all decorators is used.
|
882
|
+
memory : int, default 4096
|
883
|
+
Memory size (in MB) required for this step. If
|
884
|
+
`@resources` is also present, the maximum value from all decorators is
|
885
|
+
used.
|
886
|
+
disk : int, default 10240
|
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
|
1018
929
|
"""
|
1019
930
|
...
|
1020
931
|
|
1021
932
|
@typing.overload
|
1022
|
-
def
|
1023
|
-
...
|
1024
|
-
|
1025
|
-
@typing.overload
|
1026
|
-
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1027
|
-
...
|
1028
|
-
|
1029
|
-
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):
|
933
|
+
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]]]:
|
1030
934
|
"""
|
1031
|
-
Specifies
|
1032
|
-
to a step needs to be retried.
|
1033
|
-
|
1034
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
1035
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
1036
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
935
|
+
Specifies a timeout for your step.
|
1037
936
|
|
1038
|
-
This
|
1039
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
1040
|
-
ensuring that the flow execution can continue.
|
937
|
+
This decorator is useful if this step may hang indefinitely.
|
1041
938
|
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
Number of times to retry this task.
|
1046
|
-
minutes_between_retries : int, default 2
|
1047
|
-
Number of minutes between retries.
|
1048
|
-
"""
|
1049
|
-
...
|
1050
|
-
|
1051
|
-
@typing.overload
|
1052
|
-
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]]]:
|
1053
|
-
"""
|
1054
|
-
Specifies the Conda environment for the step.
|
939
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
940
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
941
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
1055
942
|
|
1056
|
-
|
1057
|
-
|
1058
|
-
you can use `@conda_base` to set packages required by all
|
1059
|
-
steps and use `@conda` to specify step-specific overrides.
|
943
|
+
Note that all the values specified in parameters are added together so if you specify
|
944
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
1060
945
|
|
1061
946
|
Parameters
|
1062
947
|
----------
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1070
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1071
|
-
disabled : bool, default False
|
1072
|
-
If set to True, disables @conda.
|
948
|
+
seconds : int, default 0
|
949
|
+
Number of seconds to wait prior to timing out.
|
950
|
+
minutes : int, default 0
|
951
|
+
Number of minutes to wait prior to timing out.
|
952
|
+
hours : int, default 0
|
953
|
+
Number of hours to wait prior to timing out.
|
1073
954
|
"""
|
1074
955
|
...
|
1075
956
|
|
1076
957
|
@typing.overload
|
1077
|
-
def
|
958
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1078
959
|
...
|
1079
960
|
|
1080
961
|
@typing.overload
|
1081
|
-
def
|
962
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1082
963
|
...
|
1083
964
|
|
1084
|
-
def
|
965
|
+
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):
|
1085
966
|
"""
|
1086
|
-
Specifies
|
967
|
+
Specifies a timeout for your step.
|
1087
968
|
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
969
|
+
This decorator is useful if this step may hang indefinitely.
|
970
|
+
|
971
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
972
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
973
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
974
|
+
|
975
|
+
Note that all the values specified in parameters are added together so if you specify
|
976
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
1092
977
|
|
1093
978
|
Parameters
|
1094
979
|
----------
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1102
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1103
|
-
disabled : bool, default False
|
1104
|
-
If set to True, disables @conda.
|
980
|
+
seconds : int, default 0
|
981
|
+
Number of seconds to wait prior to timing out.
|
982
|
+
minutes : int, default 0
|
983
|
+
Number of minutes to wait prior to timing out.
|
984
|
+
hours : int, default 0
|
985
|
+
Number of hours to wait prior to timing out.
|
1105
986
|
"""
|
1106
987
|
...
|
1107
988
|
|
@@ -1182,57 +1063,6 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
1182
1063
|
"""
|
1183
1064
|
...
|
1184
1065
|
|
1185
|
-
@typing.overload
|
1186
|
-
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]]]:
|
1187
|
-
"""
|
1188
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
1189
|
-
|
1190
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1191
|
-
|
1192
|
-
Parameters
|
1193
|
-
----------
|
1194
|
-
type : str, default 'default'
|
1195
|
-
Card type.
|
1196
|
-
id : str, optional, default None
|
1197
|
-
If multiple cards are present, use this id to identify this card.
|
1198
|
-
options : Dict[str, Any], default {}
|
1199
|
-
Options passed to the card. The contents depend on the card type.
|
1200
|
-
timeout : int, default 45
|
1201
|
-
Interrupt reporting if it takes more than this many seconds.
|
1202
|
-
|
1203
|
-
|
1204
|
-
"""
|
1205
|
-
...
|
1206
|
-
|
1207
|
-
@typing.overload
|
1208
|
-
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1209
|
-
...
|
1210
|
-
|
1211
|
-
@typing.overload
|
1212
|
-
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1213
|
-
...
|
1214
|
-
|
1215
|
-
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):
|
1216
|
-
"""
|
1217
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
1218
|
-
|
1219
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1220
|
-
|
1221
|
-
Parameters
|
1222
|
-
----------
|
1223
|
-
type : str, default 'default'
|
1224
|
-
Card type.
|
1225
|
-
id : str, optional, default None
|
1226
|
-
If multiple cards are present, use this id to identify this card.
|
1227
|
-
options : Dict[str, Any], default {}
|
1228
|
-
Options passed to the card. The contents depend on the card type.
|
1229
|
-
timeout : int, default 45
|
1230
|
-
Interrupt reporting if it takes more than this many seconds.
|
1231
|
-
|
1232
|
-
|
1233
|
-
"""
|
1234
|
-
...
|
1235
|
-
|
1236
1066
|
@typing.overload
|
1237
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]]]:
|
1238
1068
|
"""
|
@@ -1283,128 +1113,280 @@ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
|
|
1283
1113
|
...
|
1284
1114
|
|
1285
1115
|
@typing.overload
|
1286
|
-
def
|
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]]]:
|
1287
1117
|
"""
|
1288
|
-
Specifies
|
1118
|
+
Specifies environment variables to be set prior to the execution of a step.
|
1289
1119
|
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
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.
|
1294
1138
|
|
1295
1139
|
Parameters
|
1296
1140
|
----------
|
1297
|
-
|
1298
|
-
|
1299
|
-
If not specified, the exception is not stored.
|
1300
|
-
print_exception : bool, default True
|
1301
|
-
Determines whether or not the exception is printed to
|
1302
|
-
stdout when caught.
|
1141
|
+
vars : Dict[str, str], default {}
|
1142
|
+
Dictionary of environment variables to set.
|
1303
1143
|
"""
|
1304
1144
|
...
|
1305
1145
|
|
1306
1146
|
@typing.overload
|
1307
|
-
def
|
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.
|
1152
|
+
|
1153
|
+
Parameters
|
1154
|
+
----------
|
1155
|
+
type : str, default 'default'
|
1156
|
+
Card type.
|
1157
|
+
id : str, optional, default None
|
1158
|
+
If multiple cards are present, use this id to identify this card.
|
1159
|
+
options : Dict[str, Any], default {}
|
1160
|
+
Options passed to the card. The contents depend on the card type.
|
1161
|
+
timeout : int, default 45
|
1162
|
+
Interrupt reporting if it takes more than this many seconds.
|
1163
|
+
|
1164
|
+
|
1165
|
+
"""
|
1308
1166
|
...
|
1309
1167
|
|
1310
1168
|
@typing.overload
|
1311
|
-
def
|
1169
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1312
1170
|
...
|
1313
1171
|
|
1314
|
-
|
1172
|
+
@typing.overload
|
1173
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1174
|
+
...
|
1175
|
+
|
1176
|
+
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):
|
1315
1177
|
"""
|
1316
|
-
|
1178
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
1317
1179
|
|
1318
|
-
|
1319
|
-
contains the exception raised. You can use it to detect the presence
|
1320
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
1321
|
-
are missing.
|
1180
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1322
1181
|
|
1323
1182
|
Parameters
|
1324
1183
|
----------
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1184
|
+
type : str, default 'default'
|
1185
|
+
Card type.
|
1186
|
+
id : str, optional, default None
|
1187
|
+
If multiple cards are present, use this id to identify this card.
|
1188
|
+
options : Dict[str, Any], default {}
|
1189
|
+
Options passed to the card. The contents depend on the card type.
|
1190
|
+
timeout : int, default 45
|
1191
|
+
Interrupt reporting if it takes more than this many seconds.
|
1192
|
+
|
1193
|
+
|
1331
1194
|
"""
|
1332
1195
|
...
|
1333
1196
|
|
1334
|
-
|
1197
|
+
@typing.overload
|
1198
|
+
def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = "METAFLOW_BATCH_JOB_QUEUE", iam_role: str = "METAFLOW_ECS_S3_ACCESS_IAM_ROLE", execution_role: str = "METAFLOW_ECS_FARGATE_EXECUTION_ROLE", shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[str]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
1335
1199
|
"""
|
1336
|
-
Specifies that this step should execute on
|
1200
|
+
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
1337
1201
|
|
1338
1202
|
Parameters
|
1339
1203
|
----------
|
1340
1204
|
cpu : int, default 1
|
1341
1205
|
Number of CPUs required for this step. If `@resources` is
|
1342
1206
|
also present, the maximum value from all decorators is used.
|
1207
|
+
gpu : int, default 0
|
1208
|
+
Number of GPUs required for this step. If `@resources` is
|
1209
|
+
also present, the maximum value from all decorators is used.
|
1343
1210
|
memory : int, default 4096
|
1344
1211
|
Memory size (in MB) required for this step. If
|
1345
1212
|
`@resources` is also present, the maximum value from all decorators is
|
1346
1213
|
used.
|
1347
|
-
disk : int, default 10240
|
1348
|
-
Disk size (in MB) required for this step. If
|
1349
|
-
`@resources` is also present, the maximum value from all decorators is
|
1350
|
-
used.
|
1351
1214
|
image : str, optional, default None
|
1352
|
-
Docker image to use when launching on
|
1353
|
-
|
1215
|
+
Docker image to use when launching on AWS Batch. If not specified, and
|
1216
|
+
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
1354
1217
|
not, a default Docker image mapping to the current version of Python is used.
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1218
|
+
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
1219
|
+
AWS Batch Job Queue to submit the job to.
|
1220
|
+
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
1221
|
+
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
1222
|
+
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
1223
|
+
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
1224
|
+
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
1225
|
+
shared_memory : int, optional, default None
|
1226
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
1227
|
+
This parameter maps to the `--shm-size` option in Docker.
|
1228
|
+
max_swap : int, optional, default None
|
1229
|
+
The total amount of swap memory (in MiB) a container can use for this
|
1230
|
+
step. This parameter is translated to the `--memory-swap` option in
|
1231
|
+
Docker where the value is the sum of the container memory plus the
|
1232
|
+
`max_swap` value.
|
1233
|
+
swappiness : int, optional, default None
|
1234
|
+
This allows you to tune memory swappiness behavior for this step.
|
1235
|
+
A swappiness value of 0 causes swapping not to happen unless absolutely
|
1236
|
+
necessary. A swappiness value of 100 causes pages to be swapped very
|
1237
|
+
aggressively. Accepted values are whole numbers between 0 and 100.
|
1373
1238
|
use_tmpfs : bool, default False
|
1374
|
-
This enables an explicit tmpfs mount for this step.
|
1239
|
+
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
1240
|
+
not available on Fargate compute environments
|
1375
1241
|
tmpfs_tempdir : bool, default True
|
1376
1242
|
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
1377
|
-
tmpfs_size : int, optional, default
|
1243
|
+
tmpfs_size : int, optional, default None
|
1378
1244
|
The value for the size (in MiB) of the tmpfs mount for this step.
|
1379
1245
|
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
1380
1246
|
memory allocated for this step.
|
1381
|
-
tmpfs_path : str, optional, default
|
1382
|
-
Path to tmpfs mount for this step.
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1247
|
+
tmpfs_path : str, optional, default None
|
1248
|
+
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
1249
|
+
inferentia : int, default 0
|
1250
|
+
Number of Inferentia chips required for this step.
|
1251
|
+
trainium : int, default None
|
1252
|
+
Alias for inferentia. Use only one of the two.
|
1253
|
+
efa : int, default 0
|
1254
|
+
Number of elastic fabric adapter network devices to attach to container
|
1255
|
+
ephemeral_storage : int, default None
|
1256
|
+
The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
|
1257
|
+
This is only relevant for Fargate compute environments
|
1258
|
+
log_driver: str, optional, default None
|
1259
|
+
The log driver to use for the Amazon ECS container.
|
1260
|
+
log_options: List[str], optional, default None
|
1261
|
+
List of strings containing options for the chosen log driver. The configurable values
|
1262
|
+
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
1263
|
+
Example: [`awslogs-group:aws/batch/job`]
|
1264
|
+
"""
|
1265
|
+
...
|
1266
|
+
|
1267
|
+
@typing.overload
|
1268
|
+
def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1269
|
+
...
|
1270
|
+
|
1271
|
+
@typing.overload
|
1272
|
+
def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1273
|
+
...
|
1274
|
+
|
1275
|
+
def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = "METAFLOW_BATCH_JOB_QUEUE", iam_role: str = "METAFLOW_ECS_S3_ACCESS_IAM_ROLE", execution_role: str = "METAFLOW_ECS_FARGATE_EXECUTION_ROLE", shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[str]] = None):
|
1276
|
+
"""
|
1277
|
+
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
1278
|
+
|
1279
|
+
Parameters
|
1280
|
+
----------
|
1281
|
+
cpu : int, default 1
|
1282
|
+
Number of CPUs required for this step. If `@resources` is
|
1283
|
+
also present, the maximum value from all decorators is used.
|
1284
|
+
gpu : int, default 0
|
1285
|
+
Number of GPUs required for this step. If `@resources` is
|
1286
|
+
also present, the maximum value from all decorators is used.
|
1287
|
+
memory : int, default 4096
|
1288
|
+
Memory size (in MB) required for this step. If
|
1289
|
+
`@resources` is also present, the maximum value from all decorators is
|
1290
|
+
used.
|
1291
|
+
image : str, optional, default None
|
1292
|
+
Docker image to use when launching on AWS Batch. If not specified, and
|
1293
|
+
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
1294
|
+
not, a default Docker image mapping to the current version of Python is used.
|
1295
|
+
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
1296
|
+
AWS Batch Job Queue to submit the job to.
|
1297
|
+
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
1298
|
+
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
1299
|
+
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
1300
|
+
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
1301
|
+
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
1302
|
+
shared_memory : int, optional, default None
|
1303
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
1304
|
+
This parameter maps to the `--shm-size` option in Docker.
|
1305
|
+
max_swap : int, optional, default None
|
1306
|
+
The total amount of swap memory (in MiB) a container can use for this
|
1307
|
+
step. This parameter is translated to the `--memory-swap` option in
|
1308
|
+
Docker where the value is the sum of the container memory plus the
|
1309
|
+
`max_swap` value.
|
1310
|
+
swappiness : int, optional, default None
|
1311
|
+
This allows you to tune memory swappiness behavior for this step.
|
1312
|
+
A swappiness value of 0 causes swapping not to happen unless absolutely
|
1313
|
+
necessary. A swappiness value of 100 causes pages to be swapped very
|
1314
|
+
aggressively. Accepted values are whole numbers between 0 and 100.
|
1315
|
+
use_tmpfs : bool, default False
|
1316
|
+
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
1317
|
+
not available on Fargate compute environments
|
1318
|
+
tmpfs_tempdir : bool, default True
|
1319
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
1320
|
+
tmpfs_size : int, optional, default None
|
1321
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
1322
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
1323
|
+
memory allocated for this step.
|
1324
|
+
tmpfs_path : str, optional, default None
|
1325
|
+
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
1326
|
+
inferentia : int, default 0
|
1327
|
+
Number of Inferentia chips required for this step.
|
1328
|
+
trainium : int, default None
|
1329
|
+
Alias for inferentia. Use only one of the two.
|
1330
|
+
efa : int, default 0
|
1331
|
+
Number of elastic fabric adapter network devices to attach to container
|
1332
|
+
ephemeral_storage : int, default None
|
1333
|
+
The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
|
1334
|
+
This is only relevant for Fargate compute environments
|
1335
|
+
log_driver: str, optional, default None
|
1336
|
+
The log driver to use for the Amazon ECS container.
|
1337
|
+
log_options: List[str], optional, default None
|
1338
|
+
List of strings containing options for the chosen log driver. The configurable values
|
1339
|
+
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
1340
|
+
Example: [`awslogs-group:aws/batch/job`]
|
1390
1341
|
"""
|
1391
1342
|
...
|
1392
1343
|
|
1393
|
-
|
1344
|
+
@typing.overload
|
1345
|
+
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]]]:
|
1394
1346
|
"""
|
1395
|
-
Specifies
|
1347
|
+
Specifies that the step will success under all circumstances.
|
1396
1348
|
|
1397
|
-
|
1398
|
-
use the
|
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.
|
1399
1353
|
|
1400
1354
|
Parameters
|
1401
1355
|
----------
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
|
1356
|
+
var : str, optional, default None
|
1357
|
+
Name of the artifact in which to store the caught exception.
|
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.
|
1362
|
+
"""
|
1363
|
+
...
|
1364
|
+
|
1365
|
+
@typing.overload
|
1366
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1367
|
+
...
|
1368
|
+
|
1369
|
+
@typing.overload
|
1370
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1371
|
+
...
|
1372
|
+
|
1373
|
+
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):
|
1374
|
+
"""
|
1375
|
+
Specifies that the step will success under all circumstances.
|
1406
1376
|
|
1377
|
+
The decorator will create an optional artifact, specified by `var`, which
|
1378
|
+
contains the exception raised. You can use it to detect the presence
|
1379
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
1380
|
+
are missing.
|
1407
1381
|
|
1382
|
+
Parameters
|
1383
|
+
----------
|
1384
|
+
var : str, optional, default None
|
1385
|
+
Name of the artifact in which to store the caught exception.
|
1386
|
+
If not specified, the exception is not stored.
|
1387
|
+
print_exception : bool, default True
|
1388
|
+
Determines whether or not the exception is printed to
|
1389
|
+
stdout when caught.
|
1408
1390
|
"""
|
1409
1391
|
...
|
1410
1392
|
|
@@ -1511,6 +1493,73 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
1511
1493
|
"""
|
1512
1494
|
...
|
1513
1495
|
|
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
|
+
|
1514
1563
|
@typing.overload
|
1515
1564
|
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]]:
|
1516
1565
|
"""
|
@@ -1607,100 +1656,41 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
1607
1656
|
...
|
1608
1657
|
|
1609
1658
|
@typing.overload
|
1610
|
-
def
|
1611
|
-
"""
|
1612
|
-
Specifies the times when the flow should be run when running on a
|
1613
|
-
production scheduler.
|
1614
|
-
|
1615
|
-
Parameters
|
1616
|
-
----------
|
1617
|
-
hourly : bool, default False
|
1618
|
-
Run the workflow hourly.
|
1619
|
-
daily : bool, default True
|
1620
|
-
Run the workflow daily.
|
1621
|
-
weekly : bool, default False
|
1622
|
-
Run the workflow weekly.
|
1623
|
-
cron : str, optional, default None
|
1624
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1625
|
-
specified by this expression.
|
1626
|
-
timezone : str, optional, default None
|
1627
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1628
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1629
|
-
"""
|
1630
|
-
...
|
1631
|
-
|
1632
|
-
@typing.overload
|
1633
|
-
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1634
|
-
...
|
1635
|
-
|
1636
|
-
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):
|
1637
|
-
"""
|
1638
|
-
Specifies the times when the flow should be run when running on a
|
1639
|
-
production scheduler.
|
1640
|
-
|
1641
|
-
Parameters
|
1642
|
-
----------
|
1643
|
-
hourly : bool, default False
|
1644
|
-
Run the workflow hourly.
|
1645
|
-
daily : bool, default True
|
1646
|
-
Run the workflow daily.
|
1647
|
-
weekly : bool, default False
|
1648
|
-
Run the workflow weekly.
|
1649
|
-
cron : str, optional, default None
|
1650
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1651
|
-
specified by this expression.
|
1652
|
-
timezone : str, optional, default None
|
1653
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1654
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1655
|
-
"""
|
1656
|
-
...
|
1657
|
-
|
1658
|
-
@typing.overload
|
1659
|
-
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]]:
|
1659
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1660
1660
|
"""
|
1661
|
-
Specifies the
|
1662
|
-
|
1663
|
-
Use `@conda_base` to set common libraries required by all
|
1664
|
-
steps and use `@conda` to specify step-specific additions.
|
1661
|
+
Specifies the PyPI packages for all steps of the flow.
|
1665
1662
|
|
1663
|
+
Use `@pypi_base` to set common packages required by all
|
1664
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1666
1665
|
Parameters
|
1667
1666
|
----------
|
1668
|
-
packages : Dict[str, str], default {}
|
1667
|
+
packages : Dict[str, str], default: {}
|
1669
1668
|
Packages to use for this flow. The key is the name of the package
|
1670
1669
|
and the value is the version to use.
|
1671
|
-
|
1672
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1673
|
-
python : str, optional, default None
|
1670
|
+
python : str, optional, default: None
|
1674
1671
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1675
1672
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1676
|
-
disabled : bool, default False
|
1677
|
-
If set to True, disables Conda.
|
1678
1673
|
"""
|
1679
1674
|
...
|
1680
1675
|
|
1681
1676
|
@typing.overload
|
1682
|
-
def
|
1677
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1683
1678
|
...
|
1684
1679
|
|
1685
|
-
def
|
1680
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1686
1681
|
"""
|
1687
|
-
Specifies the
|
1688
|
-
|
1689
|
-
Use `@conda_base` to set common libraries required by all
|
1690
|
-
steps and use `@conda` to specify step-specific additions.
|
1682
|
+
Specifies the PyPI packages for all steps of the flow.
|
1691
1683
|
|
1684
|
+
Use `@pypi_base` to set common packages required by all
|
1685
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1692
1686
|
Parameters
|
1693
1687
|
----------
|
1694
|
-
packages : Dict[str, str], default {}
|
1688
|
+
packages : Dict[str, str], default: {}
|
1695
1689
|
Packages to use for this flow. The key is the name of the package
|
1696
1690
|
and the value is the version to use.
|
1697
|
-
|
1698
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1699
|
-
python : str, optional, default None
|
1691
|
+
python : str, optional, default: None
|
1700
1692
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1701
1693
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1702
|
-
disabled : bool, default False
|
1703
|
-
If set to True, disables Conda.
|
1704
1694
|
"""
|
1705
1695
|
...
|
1706
1696
|
|
@@ -1789,41 +1779,51 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
|
|
1789
1779
|
...
|
1790
1780
|
|
1791
1781
|
@typing.overload
|
1792
|
-
def
|
1782
|
+
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]]:
|
1793
1783
|
"""
|
1794
|
-
Specifies the
|
1784
|
+
Specifies the Conda environment for all steps of the flow.
|
1785
|
+
|
1786
|
+
Use `@conda_base` to set common libraries required by all
|
1787
|
+
steps and use `@conda` to specify step-specific additions.
|
1795
1788
|
|
1796
|
-
Use `@pypi_base` to set common packages required by all
|
1797
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1798
1789
|
Parameters
|
1799
1790
|
----------
|
1800
|
-
packages : Dict[str, str], default
|
1791
|
+
packages : Dict[str, str], default {}
|
1801
1792
|
Packages to use for this flow. The key is the name of the package
|
1802
1793
|
and the value is the version to use.
|
1803
|
-
|
1794
|
+
libraries : Dict[str, str], default {}
|
1795
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1796
|
+
python : str, optional, default None
|
1804
1797
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1805
1798
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1799
|
+
disabled : bool, default False
|
1800
|
+
If set to True, disables Conda.
|
1806
1801
|
"""
|
1807
1802
|
...
|
1808
1803
|
|
1809
1804
|
@typing.overload
|
1810
|
-
def
|
1805
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1811
1806
|
...
|
1812
1807
|
|
1813
|
-
def
|
1808
|
+
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):
|
1814
1809
|
"""
|
1815
|
-
Specifies the
|
1810
|
+
Specifies the Conda environment for all steps of the flow.
|
1811
|
+
|
1812
|
+
Use `@conda_base` to set common libraries required by all
|
1813
|
+
steps and use `@conda` to specify step-specific additions.
|
1816
1814
|
|
1817
|
-
Use `@pypi_base` to set common packages required by all
|
1818
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1819
1815
|
Parameters
|
1820
1816
|
----------
|
1821
|
-
packages : Dict[str, str], default
|
1817
|
+
packages : Dict[str, str], default {}
|
1822
1818
|
Packages to use for this flow. The key is the name of the package
|
1823
1819
|
and the value is the version to use.
|
1824
|
-
|
1820
|
+
libraries : Dict[str, str], default {}
|
1821
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1822
|
+
python : str, optional, default None
|
1825
1823
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1826
1824
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1825
|
+
disabled : bool, default False
|
1826
|
+
If set to True, disables Conda.
|
1827
1827
|
"""
|
1828
1828
|
...
|
1829
1829
|
|