metaflow-stubs 2.12.12__py2.py3-none-any.whl → 2.12.13__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.
Files changed (150) hide show
  1. metaflow-stubs/__init__.pyi +505 -502
  2. metaflow-stubs/cards.pyi +4 -4
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/client/__init__.pyi +2 -2
  5. metaflow-stubs/client/core.pyi +6 -6
  6. metaflow-stubs/client/filecache.pyi +2 -2
  7. metaflow-stubs/clone_util.pyi +2 -2
  8. metaflow-stubs/events.pyi +2 -2
  9. metaflow-stubs/exception.pyi +2 -2
  10. metaflow-stubs/flowspec.pyi +5 -5
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +5 -5
  13. metaflow-stubs/metadata/metadata.pyi +3 -3
  14. metaflow-stubs/metadata/util.pyi +2 -2
  15. metaflow-stubs/metaflow_config.pyi +6 -4
  16. metaflow-stubs/metaflow_current.pyi +22 -22
  17. metaflow-stubs/mflog/mflog.pyi +2 -2
  18. metaflow-stubs/multicore_utils.pyi +2 -2
  19. metaflow-stubs/parameters.pyi +3 -3
  20. metaflow-stubs/plugins/__init__.pyi +2 -2
  21. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  22. metaflow-stubs/plugins/airflow/airflow.pyi +3 -3
  23. metaflow-stubs/plugins/airflow/airflow_cli.pyi +2 -2
  24. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
  25. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  26. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  27. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  28. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  29. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +3 -3
  30. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +3 -3
  31. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  32. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  33. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  34. metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -3
  35. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +5 -5
  36. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +6 -6
  37. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
  38. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  39. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  40. metaflow-stubs/plugins/aws/aws_utils.pyi +5 -2
  41. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  42. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  43. metaflow-stubs/plugins/aws/batch/batch_cli.pyi +2 -2
  44. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  45. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  46. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  47. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
  48. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  49. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
  50. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  51. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +2 -2
  52. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  53. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  54. metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +4 -4
  55. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  56. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
  57. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +2 -2
  58. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  59. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  60. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  61. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +3 -3
  62. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  63. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  64. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  65. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  66. metaflow-stubs/plugins/cards/card_cli.pyi +4 -4
  67. metaflow-stubs/plugins/cards/card_client.pyi +2 -2
  68. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  69. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  70. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  71. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  72. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  73. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  74. metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +2 -2
  75. metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +2 -2
  76. metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +2 -2
  77. metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +2 -2
  78. metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +2 -2
  79. metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
  80. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  81. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  82. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  83. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  84. metaflow-stubs/plugins/cards/component_serializer.pyi +4 -4
  85. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  86. metaflow-stubs/plugins/catch_decorator.pyi +2 -2
  87. metaflow-stubs/plugins/datatools/__init__.pyi +4 -4
  88. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  89. metaflow-stubs/plugins/datatools/s3/__init__.pyi +3 -3
  90. metaflow-stubs/plugins/datatools/s3/s3.pyi +5 -5
  91. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  92. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  93. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  94. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  95. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  96. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  97. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  98. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  99. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  100. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
  101. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  102. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  103. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  104. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  105. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  106. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  107. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +3 -3
  108. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  109. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
  110. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
  111. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  112. metaflow-stubs/plugins/logs_cli.pyi +4 -4
  113. metaflow-stubs/plugins/package_cli.pyi +2 -2
  114. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  115. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  116. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  117. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  118. metaflow-stubs/plugins/pypi/conda_environment.pyi +3 -3
  119. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  120. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  121. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  122. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  123. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  124. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  125. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
  126. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  127. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  128. metaflow-stubs/plugins/tag_cli.pyi +4 -4
  129. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
  130. metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
  131. metaflow-stubs/procpoll.pyi +2 -2
  132. metaflow-stubs/pylint_wrapper.pyi +2 -2
  133. metaflow-stubs/runner/__init__.pyi +2 -2
  134. metaflow-stubs/runner/deployer.pyi +3 -3
  135. metaflow-stubs/runner/metaflow_runner.pyi +5 -5
  136. metaflow-stubs/runner/nbdeploy.pyi +2 -2
  137. metaflow-stubs/runner/nbrun.pyi +2 -2
  138. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  139. metaflow-stubs/runner/utils.pyi +2 -2
  140. metaflow-stubs/system/__init__.pyi +3 -3
  141. metaflow-stubs/system/system_logger.pyi +3 -3
  142. metaflow-stubs/system/system_monitor.pyi +2 -2
  143. metaflow-stubs/tagging_util.pyi +2 -2
  144. metaflow-stubs/tuple_util.pyi +2 -2
  145. metaflow-stubs/version.pyi +2 -2
  146. {metaflow_stubs-2.12.12.dist-info → metaflow_stubs-2.12.13.dist-info}/METADATA +2 -2
  147. metaflow_stubs-2.12.13.dist-info/RECORD +150 -0
  148. {metaflow_stubs-2.12.12.dist-info → metaflow_stubs-2.12.13.dist-info}/WHEEL +1 -1
  149. metaflow_stubs-2.12.12.dist-info/RECORD +0 -150
  150. {metaflow_stubs-2.12.12.dist-info → metaflow_stubs-2.12.13.dist-info}/top_level.txt +0 -0
@@ -1,25 +1,25 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.12 #
4
- # Generated on 2024-08-13T23:49:26.963512 #
3
+ # MF version: 2.12.13 #
4
+ # Generated on 2024-08-21T05:55:53.002542 #
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.runner.metaflow_runner
12
- import metaflow.plugins.datatools.s3.s3
13
- import io
11
+ import typing
14
12
  import metaflow.client.core
15
- import metaflow.events
16
13
  import metaflow.parameters
17
- import typing
14
+ import io
18
15
  import metaflow.metaflow_current
16
+ import metaflow.flowspec
19
17
  import datetime
18
+ import metaflow.events
20
19
  import metaflow.datastore.inputs
20
+ import metaflow.plugins.datatools.s3.s3
21
+ import metaflow.runner.metaflow_runner
21
22
  import metaflow._vendor.click.types
22
- import metaflow.flowspec
23
23
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
24
24
  StepFlag = typing.NewType("StepFlag", bool)
25
25
 
@@ -728,149 +728,51 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
728
728
  ...
729
729
 
730
730
  @typing.overload
731
- 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]]]:
731
+ 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]]]:
732
732
  """
733
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
733
+ Specifies the PyPI packages for the step.
734
+
735
+ Information in this decorator will augment any
736
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
737
+ you can use `@pypi_base` to set packages required by all
738
+ steps and use `@pypi` to specify step-specific overrides.
734
739
 
735
740
  Parameters
736
741
  ----------
737
- cpu : int, default 1
738
- Number of CPUs required for this step. If `@resources` is
739
- also present, the maximum value from all decorators is used.
740
- gpu : int, default 0
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`]
742
+ packages : Dict[str, str], default: {}
743
+ Packages to use for this step. The key is the name of the package
744
+ and the value is the version to use.
745
+ python : str, optional, default: None
746
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
747
+ that the version used will correspond to the version of the Python interpreter used to start the run.
797
748
  """
798
749
  ...
799
750
 
800
751
  @typing.overload
801
- def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
752
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
802
753
  ...
803
754
 
804
755
  @typing.overload
805
- def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
756
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
806
757
  ...
807
758
 
808
- 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):
759
+ 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):
809
760
  """
810
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
761
+ Specifies the PyPI packages for the step.
762
+
763
+ Information in this decorator will augment any
764
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
765
+ you can use `@pypi_base` to set packages required by all
766
+ steps and use `@pypi` to specify step-specific overrides.
811
767
 
812
768
  Parameters
813
769
  ----------
814
- cpu : int, default 1
815
- Number of CPUs required for this step. If `@resources` is
816
- also present, the maximum value from all decorators is used.
817
- gpu : int, default 0
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`]
770
+ packages : Dict[str, str], default: {}
771
+ Packages to use for this step. The key is the name of the package
772
+ and the value is the version to use.
773
+ python : str, optional, default: None
774
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
775
+ that the version used will correspond to the version of the Python interpreter used to start the run.
874
776
  """
875
777
  ...
876
778
 
@@ -931,46 +833,185 @@ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
931
833
  """
932
834
  ...
933
835
 
934
- @typing.overload
935
- 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]]]:
836
+ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = "KUBERNETES_IMAGE_PULL_POLICY", service_account: str = "METAFLOW_KUBERNETES_SERVICE_ACCOUNT", secrets: typing.Optional[typing.List[str]] = None, namespace: str = "METAFLOW_KUBERNETES_NAMESPACE", gpu: typing.Optional[int] = None, gpu_vendor: str = "KUBERNETES_GPU_VENDOR", tolerations: typing.List[str] = [], use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = "/metaflow_temp", persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
936
837
  """
937
- Specifies secrets to be retrieved and injected as environment variables prior to
938
- the execution of a step.
838
+ Specifies that this step should execute on Kubernetes.
939
839
 
940
840
  Parameters
941
841
  ----------
942
- sources : List[Union[str, Dict[str, Any]]], default: []
943
- List of secret specs, defining how the secrets are to be retrieved
842
+ cpu : int, default 1
843
+ Number of CPUs required for this step. If `@resources` is
844
+ also present, the maximum value from all decorators is used.
845
+ memory : int, default 4096
846
+ Memory size (in MB) required for this step. If
847
+ `@resources` is also present, the maximum value from all decorators is
848
+ used.
849
+ disk : int, default 10240
850
+ Disk size (in MB) required for this step. If
851
+ `@resources` is also present, the maximum value from all decorators is
852
+ used.
853
+ image : str, optional, default None
854
+ Docker image to use when launching on Kubernetes. If not specified, and
855
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
856
+ not, a default Docker image mapping to the current version of Python is used.
857
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
858
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
859
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
860
+ Kubernetes service account to use when launching pod in Kubernetes.
861
+ secrets : List[str], optional, default None
862
+ Kubernetes secrets to use when launching pod in Kubernetes. These
863
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
864
+ in Metaflow configuration.
865
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
866
+ Kubernetes namespace to use when launching pod in Kubernetes.
867
+ gpu : int, optional, default None
868
+ Number of GPUs required for this step. A value of zero implies that
869
+ the scheduled node should not have GPUs.
870
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
871
+ The vendor of the GPUs to be used for this step.
872
+ tolerations : List[str], default []
873
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
874
+ Kubernetes tolerations to use when launching pod in Kubernetes.
875
+ use_tmpfs : bool, default False
876
+ This enables an explicit tmpfs mount for this step.
877
+ tmpfs_tempdir : bool, default True
878
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
879
+ tmpfs_size : int, optional, default: None
880
+ The value for the size (in MiB) of the tmpfs mount for this step.
881
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
882
+ memory allocated for this step.
883
+ tmpfs_path : str, optional, default /metaflow_temp
884
+ Path to tmpfs mount for this step.
885
+ persistent_volume_claims : Dict[str, str], optional, default None
886
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
887
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
888
+ shared_memory: int, optional
889
+ Shared memory size (in MiB) required for this step
890
+ port: int, optional
891
+ Port number to specify in the Kubernetes job object
892
+ compute_pool : str, optional, default None
893
+ Compute pool to be used for for this step.
894
+ If not specified, any accessible compute pool within the perimeter is used.
944
895
  """
945
896
  ...
946
897
 
947
898
  @typing.overload
948
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
949
- ...
950
-
951
- @typing.overload
952
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
953
- ...
954
-
955
- 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]]] = []):
899
+ 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]]]:
956
900
  """
957
- Specifies secrets to be retrieved and injected as environment variables prior to
958
- the execution of a step.
901
+ Specifies the number of times the task corresponding
902
+ to a step needs to be retried.
903
+
904
+ This decorator is useful for handling transient errors, such as networking issues.
905
+ If your task contains operations that can't be retried safely, e.g. database updates,
906
+ it is advisable to annotate it with `@retry(times=0)`.
907
+
908
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
909
+ decorator will execute a no-op task after all retries have been exhausted,
910
+ ensuring that the flow execution can continue.
959
911
 
960
912
  Parameters
961
913
  ----------
962
- sources : List[Union[str, Dict[str, Any]]], default: []
963
- List of secret specs, defining how the secrets are to be retrieved
914
+ times : int, default 3
915
+ Number of times to retry this task.
916
+ minutes_between_retries : int, default 2
917
+ Number of minutes between retries.
964
918
  """
965
919
  ...
966
920
 
967
921
  @typing.overload
968
- 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]]]:
969
- """
970
- Specifies the resources needed when executing this step.
971
-
972
- Use `@resources` to specify the resource requirements
973
- independently of the specific compute layer (`@batch`, `@kubernetes`).
922
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
923
+ ...
924
+
925
+ @typing.overload
926
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
927
+ ...
928
+
929
+ 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):
930
+ """
931
+ Specifies the number of times the task corresponding
932
+ to a step needs to be retried.
933
+
934
+ This decorator is useful for handling transient errors, such as networking issues.
935
+ If your task contains operations that can't be retried safely, e.g. database updates,
936
+ it is advisable to annotate it with `@retry(times=0)`.
937
+
938
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
939
+ decorator will execute a no-op task after all retries have been exhausted,
940
+ ensuring that the flow execution can continue.
941
+
942
+ Parameters
943
+ ----------
944
+ times : int, default 3
945
+ Number of times to retry this task.
946
+ minutes_between_retries : int, default 2
947
+ Number of minutes between retries.
948
+ """
949
+ ...
950
+
951
+ @typing.overload
952
+ 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]]]:
953
+ """
954
+ Specifies a timeout for your step.
955
+
956
+ This decorator is useful if this step may hang indefinitely.
957
+
958
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
959
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
960
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
961
+
962
+ Note that all the values specified in parameters are added together so if you specify
963
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
964
+
965
+ Parameters
966
+ ----------
967
+ seconds : int, default 0
968
+ Number of seconds to wait prior to timing out.
969
+ minutes : int, default 0
970
+ Number of minutes to wait prior to timing out.
971
+ hours : int, default 0
972
+ Number of hours to wait prior to timing out.
973
+ """
974
+ ...
975
+
976
+ @typing.overload
977
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
978
+ ...
979
+
980
+ @typing.overload
981
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
982
+ ...
983
+
984
+ 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):
985
+ """
986
+ Specifies a timeout for your step.
987
+
988
+ This decorator is useful if this step may hang indefinitely.
989
+
990
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
991
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
992
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
993
+
994
+ Note that all the values specified in parameters are added together so if you specify
995
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
996
+
997
+ Parameters
998
+ ----------
999
+ seconds : int, default 0
1000
+ Number of seconds to wait prior to timing out.
1001
+ minutes : int, default 0
1002
+ Number of minutes to wait prior to timing out.
1003
+ hours : int, default 0
1004
+ Number of hours to wait prior to timing out.
1005
+ """
1006
+ ...
1007
+
1008
+ @typing.overload
1009
+ 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]]]:
1010
+ """
1011
+ Specifies the resources needed when executing this step.
1012
+
1013
+ Use `@resources` to specify the resource requirements
1014
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
974
1015
 
975
1016
  You can choose the compute layer on the command line by executing e.g.
976
1017
  ```
@@ -1042,59 +1083,86 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
1042
1083
  ...
1043
1084
 
1044
1085
  @typing.overload
1045
- 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]]]:
1086
+ 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]]]:
1046
1087
  """
1047
- Specifies a timeout for your step.
1088
+ Specifies secrets to be retrieved and injected as environment variables prior to
1089
+ the execution of a step.
1048
1090
 
1049
- This decorator is useful if this step may hang indefinitely.
1091
+ Parameters
1092
+ ----------
1093
+ sources : List[Union[str, Dict[str, Any]]], default: []
1094
+ List of secret specs, defining how the secrets are to be retrieved
1095
+ """
1096
+ ...
1097
+
1098
+ @typing.overload
1099
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1100
+ ...
1101
+
1102
+ @typing.overload
1103
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1104
+ ...
1105
+
1106
+ 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]]] = []):
1107
+ """
1108
+ Specifies secrets to be retrieved and injected as environment variables prior to
1109
+ the execution of a step.
1050
1110
 
1051
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1052
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
1053
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
1111
+ Parameters
1112
+ ----------
1113
+ sources : List[Union[str, Dict[str, Any]]], default: []
1114
+ List of secret specs, defining how the secrets are to be retrieved
1115
+ """
1116
+ ...
1117
+
1118
+ @typing.overload
1119
+ 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]]]:
1120
+ """
1121
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1054
1122
 
1055
- Note that all the values specified in parameters are added together so if you specify
1056
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1123
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1057
1124
 
1058
1125
  Parameters
1059
1126
  ----------
1060
- seconds : int, default 0
1061
- Number of seconds to wait prior to timing out.
1062
- minutes : int, default 0
1063
- Number of minutes to wait prior to timing out.
1064
- hours : int, default 0
1065
- Number of hours to wait prior to timing out.
1127
+ type : str, default 'default'
1128
+ Card type.
1129
+ id : str, optional, default None
1130
+ If multiple cards are present, use this id to identify this card.
1131
+ options : Dict[str, Any], default {}
1132
+ Options passed to the card. The contents depend on the card type.
1133
+ timeout : int, default 45
1134
+ Interrupt reporting if it takes more than this many seconds.
1135
+
1136
+
1066
1137
  """
1067
1138
  ...
1068
1139
 
1069
1140
  @typing.overload
1070
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1141
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1071
1142
  ...
1072
1143
 
1073
1144
  @typing.overload
1074
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1145
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1075
1146
  ...
1076
1147
 
1077
- 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):
1148
+ 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):
1078
1149
  """
1079
- Specifies a timeout for your step.
1080
-
1081
- This decorator is useful if this step may hang indefinitely.
1082
-
1083
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1084
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
1085
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
1150
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1086
1151
 
1087
- Note that all the values specified in parameters are added together so if you specify
1088
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1152
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1089
1153
 
1090
1154
  Parameters
1091
1155
  ----------
1092
- seconds : int, default 0
1093
- Number of seconds to wait prior to timing out.
1094
- minutes : int, default 0
1095
- Number of minutes to wait prior to timing out.
1096
- hours : int, default 0
1097
- Number of hours to wait prior to timing out.
1156
+ type : str, default 'default'
1157
+ Card type.
1158
+ id : str, optional, default None
1159
+ If multiple cards are present, use this id to identify this card.
1160
+ options : Dict[str, Any], default {}
1161
+ Options passed to the card. The contents depend on the card type.
1162
+ timeout : int, default 45
1163
+ Interrupt reporting if it takes more than this many seconds.
1164
+
1165
+
1098
1166
  """
1099
1167
  ...
1100
1168
 
@@ -1130,55 +1198,149 @@ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], Non
1130
1198
  ...
1131
1199
 
1132
1200
  @typing.overload
1133
- 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]]]:
1201
+ 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]]]:
1134
1202
  """
1135
- Specifies the number of times the task corresponding
1136
- to a step needs to be retried.
1137
-
1138
- This decorator is useful for handling transient errors, such as networking issues.
1139
- If your task contains operations that can't be retried safely, e.g. database updates,
1140
- it is advisable to annotate it with `@retry(times=0)`.
1141
-
1142
- This can be used in conjunction with the `@catch` decorator. The `@catch`
1143
- decorator will execute a no-op task after all retries have been exhausted,
1144
- ensuring that the flow execution can continue.
1203
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
1145
1204
 
1146
1205
  Parameters
1147
1206
  ----------
1148
- times : int, default 3
1149
- Number of times to retry this task.
1150
- minutes_between_retries : int, default 2
1151
- Number of minutes between retries.
1207
+ cpu : int, default 1
1208
+ Number of CPUs required for this step. If `@resources` is
1209
+ also present, the maximum value from all decorators is used.
1210
+ gpu : int, default 0
1211
+ Number of GPUs required for this step. If `@resources` is
1212
+ also present, the maximum value from all decorators is used.
1213
+ memory : int, default 4096
1214
+ Memory size (in MB) required for this step. If
1215
+ `@resources` is also present, the maximum value from all decorators is
1216
+ used.
1217
+ image : str, optional, default None
1218
+ Docker image to use when launching on AWS Batch. If not specified, and
1219
+ METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
1220
+ not, a default Docker image mapping to the current version of Python is used.
1221
+ queue : str, default METAFLOW_BATCH_JOB_QUEUE
1222
+ AWS Batch Job Queue to submit the job to.
1223
+ iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
1224
+ AWS IAM role that AWS Batch container uses to access AWS cloud resources.
1225
+ execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
1226
+ AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
1227
+ (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
1228
+ shared_memory : int, optional, default None
1229
+ The value for the size (in MiB) of the /dev/shm volume for this step.
1230
+ This parameter maps to the `--shm-size` option in Docker.
1231
+ max_swap : int, optional, default None
1232
+ The total amount of swap memory (in MiB) a container can use for this
1233
+ step. This parameter is translated to the `--memory-swap` option in
1234
+ Docker where the value is the sum of the container memory plus the
1235
+ `max_swap` value.
1236
+ swappiness : int, optional, default None
1237
+ This allows you to tune memory swappiness behavior for this step.
1238
+ A swappiness value of 0 causes swapping not to happen unless absolutely
1239
+ necessary. A swappiness value of 100 causes pages to be swapped very
1240
+ aggressively. Accepted values are whole numbers between 0 and 100.
1241
+ use_tmpfs : bool, default False
1242
+ This enables an explicit tmpfs mount for this step. Note that tmpfs is
1243
+ not available on Fargate compute environments
1244
+ tmpfs_tempdir : bool, default True
1245
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
1246
+ tmpfs_size : int, optional, default None
1247
+ The value for the size (in MiB) of the tmpfs mount for this step.
1248
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
1249
+ memory allocated for this step.
1250
+ tmpfs_path : str, optional, default None
1251
+ Path to tmpfs mount for this step. Defaults to /metaflow_temp.
1252
+ inferentia : int, default 0
1253
+ Number of Inferentia chips required for this step.
1254
+ trainium : int, default None
1255
+ Alias for inferentia. Use only one of the two.
1256
+ efa : int, default 0
1257
+ Number of elastic fabric adapter network devices to attach to container
1258
+ ephemeral_storage : int, default None
1259
+ The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
1260
+ This is only relevant for Fargate compute environments
1261
+ log_driver: str, optional, default None
1262
+ The log driver to use for the Amazon ECS container.
1263
+ log_options: List[str], optional, default None
1264
+ List of strings containing options for the chosen log driver. The configurable values
1265
+ depend on the `log driver` chosen. Validation of these options is not supported yet.
1266
+ Example: [`awslogs-group:aws/batch/job`]
1152
1267
  """
1153
1268
  ...
1154
1269
 
1155
1270
  @typing.overload
1156
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1271
+ def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1157
1272
  ...
1158
1273
 
1159
1274
  @typing.overload
1160
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1275
+ def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1161
1276
  ...
1162
1277
 
1163
- 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):
1278
+ 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):
1164
1279
  """
1165
- Specifies the number of times the task corresponding
1166
- to a step needs to be retried.
1167
-
1168
- This decorator is useful for handling transient errors, such as networking issues.
1169
- If your task contains operations that can't be retried safely, e.g. database updates,
1170
- it is advisable to annotate it with `@retry(times=0)`.
1171
-
1172
- This can be used in conjunction with the `@catch` decorator. The `@catch`
1173
- decorator will execute a no-op task after all retries have been exhausted,
1174
- ensuring that the flow execution can continue.
1280
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
1175
1281
 
1176
1282
  Parameters
1177
1283
  ----------
1178
- times : int, default 3
1179
- Number of times to retry this task.
1180
- minutes_between_retries : int, default 2
1181
- Number of minutes between retries.
1284
+ cpu : int, default 1
1285
+ Number of CPUs required for this step. If `@resources` is
1286
+ also present, the maximum value from all decorators is used.
1287
+ gpu : int, default 0
1288
+ Number of GPUs 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
+ image : str, optional, default None
1295
+ Docker image to use when launching on AWS Batch. If not specified, and
1296
+ METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
1297
+ not, a default Docker image mapping to the current version of Python is used.
1298
+ queue : str, default METAFLOW_BATCH_JOB_QUEUE
1299
+ AWS Batch Job Queue to submit the job to.
1300
+ iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
1301
+ AWS IAM role that AWS Batch container uses to access AWS cloud resources.
1302
+ execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
1303
+ AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
1304
+ (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
1305
+ shared_memory : int, optional, default None
1306
+ The value for the size (in MiB) of the /dev/shm volume for this step.
1307
+ This parameter maps to the `--shm-size` option in Docker.
1308
+ max_swap : int, optional, default None
1309
+ The total amount of swap memory (in MiB) a container can use for this
1310
+ step. This parameter is translated to the `--memory-swap` option in
1311
+ Docker where the value is the sum of the container memory plus the
1312
+ `max_swap` value.
1313
+ swappiness : int, optional, default None
1314
+ This allows you to tune memory swappiness behavior for this step.
1315
+ A swappiness value of 0 causes swapping not to happen unless absolutely
1316
+ necessary. A swappiness value of 100 causes pages to be swapped very
1317
+ aggressively. Accepted values are whole numbers between 0 and 100.
1318
+ use_tmpfs : bool, default False
1319
+ This enables an explicit tmpfs mount for this step. Note that tmpfs is
1320
+ not available on Fargate compute environments
1321
+ tmpfs_tempdir : bool, default True
1322
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
1323
+ tmpfs_size : int, optional, default None
1324
+ The value for the size (in MiB) of the tmpfs mount for this step.
1325
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
1326
+ memory allocated for this step.
1327
+ tmpfs_path : str, optional, default None
1328
+ Path to tmpfs mount for this step. Defaults to /metaflow_temp.
1329
+ inferentia : int, default 0
1330
+ Number of Inferentia chips required for this step.
1331
+ trainium : int, default None
1332
+ Alias for inferentia. Use only one of the two.
1333
+ efa : int, default 0
1334
+ Number of elastic fabric adapter network devices to attach to container
1335
+ ephemeral_storage : int, default None
1336
+ The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
1337
+ This is only relevant for Fargate compute environments
1338
+ log_driver: str, optional, default None
1339
+ The log driver to use for the Amazon ECS container.
1340
+ log_options: List[str], optional, default None
1341
+ List of strings containing options for the chosen log driver. The configurable values
1342
+ depend on the `log driver` chosen. Validation of these options is not supported yet.
1343
+ Example: [`awslogs-group:aws/batch/job`]
1182
1344
  """
1183
1345
  ...
1184
1346
 
@@ -1251,70 +1413,16 @@ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
1251
1413
  ...
1252
1414
 
1253
1415
  @typing.overload
1254
- 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]]]:
1255
- """
1256
- Creates a human-readable report, a Metaflow Card, after this step completes.
1257
-
1258
- Note that you may add multiple `@card` decorators in a step with different parameters.
1259
-
1260
- Parameters
1261
- ----------
1262
- type : str, default 'default'
1263
- Card type.
1264
- id : str, optional, default None
1265
- If multiple cards are present, use this id to identify this card.
1266
- options : Dict[str, Any], default {}
1267
- Options passed to the card. The contents depend on the card type.
1268
- timeout : int, default 45
1269
- Interrupt reporting if it takes more than this many seconds.
1270
-
1271
-
1272
- """
1273
- ...
1274
-
1275
- @typing.overload
1276
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1277
- ...
1278
-
1279
- @typing.overload
1280
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1281
- ...
1282
-
1283
- 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):
1284
- """
1285
- Creates a human-readable report, a Metaflow Card, after this step completes.
1286
-
1287
- Note that you may add multiple `@card` decorators in a step with different parameters.
1288
-
1289
- Parameters
1290
- ----------
1291
- type : str, default 'default'
1292
- Card type.
1293
- id : str, optional, default None
1294
- If multiple cards are present, use this id to identify this card.
1295
- options : Dict[str, Any], default {}
1296
- Options passed to the card. The contents depend on the card type.
1297
- timeout : int, default 45
1298
- Interrupt reporting if it takes more than this many seconds.
1299
-
1300
-
1301
- """
1302
- ...
1303
-
1304
- @typing.overload
1305
- 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]]]:
1416
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1306
1417
  """
1307
- Specifies the PyPI packages for the step.
1418
+ Specifies the PyPI packages for all steps of the flow.
1308
1419
 
1309
- Information in this decorator will augment any
1310
- attributes set in the `@pyi_base` flow-level decorator. Hence,
1311
- you can use `@pypi_base` to set packages required by all
1420
+ Use `@pypi_base` to set common packages required by all
1312
1421
  steps and use `@pypi` to specify step-specific overrides.
1313
-
1314
1422
  Parameters
1315
1423
  ----------
1316
1424
  packages : Dict[str, str], default: {}
1317
- Packages to use for this step. The key is the name of the package
1425
+ Packages to use for this flow. The key is the name of the package
1318
1426
  and the value is the version to use.
1319
1427
  python : str, optional, default: None
1320
1428
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
@@ -1323,89 +1431,23 @@ def pypi(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] =
1323
1431
  ...
1324
1432
 
1325
1433
  @typing.overload
1326
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1327
- ...
1328
-
1329
- @typing.overload
1330
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1331
- ...
1332
-
1333
- 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):
1334
- """
1335
- Specifies the PyPI packages for the step.
1336
-
1337
- Information in this decorator will augment any
1338
- attributes set in the `@pyi_base` flow-level decorator. Hence,
1339
- you can use `@pypi_base` to set packages required by all
1340
- steps and use `@pypi` to specify step-specific overrides.
1341
-
1342
- Parameters
1343
- ----------
1344
- packages : Dict[str, str], default: {}
1345
- Packages to use for this step. The key is the name of the package
1346
- and the value is the version to use.
1347
- python : str, optional, default: None
1348
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1349
- that the version used will correspond to the version of the Python interpreter used to start the run.
1350
- """
1434
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1351
1435
  ...
1352
1436
 
1353
- 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]]]:
1437
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1354
1438
  """
1355
- Specifies that this step should execute on Kubernetes.
1356
-
1357
- Parameters
1358
- ----------
1359
- cpu : int, default 1
1360
- Number of CPUs required for this step. If `@resources` is
1361
- also present, the maximum value from all decorators is used.
1362
- memory : int, default 4096
1363
- Memory size (in MB) required for this step. If
1364
- `@resources` is also present, the maximum value from all decorators is
1365
- used.
1366
- disk : int, default 10240
1367
- Disk size (in MB) required for this step. If
1368
- `@resources` is also present, the maximum value from all decorators is
1369
- used.
1370
- image : str, optional, default None
1371
- Docker image to use when launching on Kubernetes. If not specified, and
1372
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
1373
- not, a default Docker image mapping to the current version of Python is used.
1374
- image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
1375
- If given, the imagePullPolicy to be applied to the Docker image of the step.
1376
- service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
1377
- Kubernetes service account to use when launching pod in Kubernetes.
1378
- secrets : List[str], optional, default None
1379
- Kubernetes secrets to use when launching pod in Kubernetes. These
1380
- secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
1381
- in Metaflow configuration.
1382
- namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
1383
- Kubernetes namespace to use when launching pod in Kubernetes.
1384
- gpu : int, optional, default None
1385
- Number of GPUs required for this step. A value of zero implies that
1386
- the scheduled node should not have GPUs.
1387
- gpu_vendor : str, default KUBERNETES_GPU_VENDOR
1388
- The vendor of the GPUs to be used for this step.
1389
- tolerations : List[str], default []
1390
- The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
1391
- Kubernetes tolerations to use when launching pod in Kubernetes.
1392
- use_tmpfs : bool, default False
1393
- This enables an explicit tmpfs mount for this step.
1394
- tmpfs_tempdir : bool, default True
1395
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
1396
- tmpfs_size : int, optional, default: None
1397
- The value for the size (in MiB) of the tmpfs mount for this step.
1398
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
1399
- memory allocated for this step.
1400
- tmpfs_path : str, optional, default /metaflow_temp
1401
- Path to tmpfs mount for this step.
1402
- persistent_volume_claims : Dict[str, str], optional, default None
1403
- A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
1404
- volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
1405
- shared_memory: int, optional
1406
- Shared memory size (in MiB) required for this step
1407
- port: int, optional
1408
- Port number to specify in the Kubernetes job object
1439
+ Specifies the PyPI packages for all steps of the flow.
1440
+
1441
+ Use `@pypi_base` to set common packages required by all
1442
+ steps and use `@pypi` to specify step-specific overrides.
1443
+ Parameters
1444
+ ----------
1445
+ packages : Dict[str, str], default: {}
1446
+ Packages to use for this flow. The key is the name of the package
1447
+ and the value is the version to use.
1448
+ python : str, optional, default: None
1449
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1450
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1409
1451
  """
1410
1452
  ...
1411
1453
 
@@ -1512,94 +1554,52 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
1512
1554
  """
1513
1555
  ...
1514
1556
 
1515
- 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]]:
1516
- """
1517
- 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)
1518
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1519
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1520
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1521
- starts only after all sensors finish.
1522
-
1523
- Parameters
1524
- ----------
1525
- timeout : int
1526
- Time, in seconds before the task times out and fails. (Default: 3600)
1527
- poke_interval : int
1528
- Time in seconds that the job should wait in between each try. (Default: 60)
1529
- mode : str
1530
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1531
- exponential_backoff : bool
1532
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1533
- pool : str
1534
- the slot pool this task should run in,
1535
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1536
- soft_fail : bool
1537
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1538
- name : str
1539
- Name of the sensor on Airflow
1540
- description : str
1541
- Description of sensor in the Airflow UI
1542
- bucket_key : Union[str, List[str]]
1543
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1544
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1545
- bucket_name : str
1546
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1547
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1548
- wildcard_match : bool
1549
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1550
- aws_conn_id : str
1551
- a reference to the s3 connection on Airflow. (Default: None)
1552
- verify : bool
1553
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1554
- """
1555
- ...
1556
-
1557
1557
  @typing.overload
1558
- 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]]:
1558
+ 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]]:
1559
1559
  """
1560
- Specifies the Conda environment for all steps of the flow.
1561
-
1562
- Use `@conda_base` to set common libraries required by all
1563
- steps and use `@conda` to specify step-specific additions.
1560
+ Specifies the times when the flow should be run when running on a
1561
+ production scheduler.
1564
1562
 
1565
1563
  Parameters
1566
1564
  ----------
1567
- packages : Dict[str, str], default {}
1568
- Packages to use for this flow. The key is the name of the package
1569
- and the value is the version to use.
1570
- libraries : Dict[str, str], default {}
1571
- Supported for backward compatibility. When used with packages, packages will take precedence.
1572
- python : str, optional, default None
1573
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1574
- that the version used will correspond to the version of the Python interpreter used to start the run.
1575
- disabled : bool, default False
1576
- If set to True, disables Conda.
1565
+ hourly : bool, default False
1566
+ Run the workflow hourly.
1567
+ daily : bool, default True
1568
+ Run the workflow daily.
1569
+ weekly : bool, default False
1570
+ Run the workflow weekly.
1571
+ cron : str, optional, default None
1572
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1573
+ specified by this expression.
1574
+ timezone : str, optional, default None
1575
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1576
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1577
1577
  """
1578
1578
  ...
1579
1579
 
1580
1580
  @typing.overload
1581
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1581
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1582
1582
  ...
1583
1583
 
1584
- 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):
1584
+ 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):
1585
1585
  """
1586
- Specifies the Conda environment for all steps of the flow.
1587
-
1588
- Use `@conda_base` to set common libraries required by all
1589
- steps and use `@conda` to specify step-specific additions.
1586
+ Specifies the times when the flow should be run when running on a
1587
+ production scheduler.
1590
1588
 
1591
1589
  Parameters
1592
1590
  ----------
1593
- packages : Dict[str, str], default {}
1594
- Packages to use for this flow. The key is the name of the package
1595
- and the value is the version to use.
1596
- libraries : Dict[str, str], default {}
1597
- Supported for backward compatibility. When used with packages, packages will take precedence.
1598
- python : str, optional, default None
1599
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1600
- that the version used will correspond to the version of the Python interpreter used to start the run.
1601
- disabled : bool, default False
1602
- If set to True, disables Conda.
1591
+ hourly : bool, default False
1592
+ Run the workflow hourly.
1593
+ daily : bool, default True
1594
+ Run the workflow daily.
1595
+ weekly : bool, default False
1596
+ Run the workflow weekly.
1597
+ cron : str, optional, default None
1598
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1599
+ specified by this expression.
1600
+ timezone : str, optional, default None
1601
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1602
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1603
1603
  """
1604
1604
  ...
1605
1605
 
@@ -1645,91 +1645,70 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
1645
1645
  """
1646
1646
  ...
1647
1647
 
1648
- @typing.overload
1649
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1648
+ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1650
1649
  """
1651
- Specifies the PyPI packages for all steps of the flow.
1650
+ Specifies what flows belong to the same project.
1651
+
1652
+ A project-specific namespace is created for all flows that
1653
+ use the same `@project(name)`.
1652
1654
 
1653
- Use `@pypi_base` to set common packages required by all
1654
- steps and use `@pypi` to specify step-specific overrides.
1655
1655
  Parameters
1656
1656
  ----------
1657
- packages : Dict[str, str], default: {}
1658
- Packages to use for this flow. The key is the name of the package
1659
- and the value is the version to use.
1660
- python : str, optional, default: None
1661
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1662
- that the version used will correspond to the version of the Python interpreter used to start the run.
1657
+ name : str
1658
+ Project name. Make sure that the name is unique amongst all
1659
+ projects that use the same production scheduler. The name may
1660
+ contain only lowercase alphanumeric characters and underscores.
1661
+
1662
+
1663
1663
  """
1664
1664
  ...
1665
1665
 
1666
1666
  @typing.overload
1667
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1668
- ...
1669
-
1670
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1667
+ 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]]:
1671
1668
  """
1672
- Specifies the PyPI packages for all steps of the flow.
1669
+ Specifies the Conda environment for all steps of the flow.
1670
+
1671
+ Use `@conda_base` to set common libraries required by all
1672
+ steps and use `@conda` to specify step-specific additions.
1673
1673
 
1674
- Use `@pypi_base` to set common packages required by all
1675
- steps and use `@pypi` to specify step-specific overrides.
1676
1674
  Parameters
1677
1675
  ----------
1678
- packages : Dict[str, str], default: {}
1676
+ packages : Dict[str, str], default {}
1679
1677
  Packages to use for this flow. The key is the name of the package
1680
1678
  and the value is the version to use.
1681
- python : str, optional, default: None
1679
+ libraries : Dict[str, str], default {}
1680
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1681
+ python : str, optional, default None
1682
1682
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1683
1683
  that the version used will correspond to the version of the Python interpreter used to start the run.
1684
+ disabled : bool, default False
1685
+ If set to True, disables Conda.
1684
1686
  """
1685
1687
  ...
1686
1688
 
1687
1689
  @typing.overload
1688
- 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]]:
1689
- """
1690
- Specifies the times when the flow should be run when running on a
1691
- production scheduler.
1692
-
1693
- Parameters
1694
- ----------
1695
- hourly : bool, default False
1696
- Run the workflow hourly.
1697
- daily : bool, default True
1698
- Run the workflow daily.
1699
- weekly : bool, default False
1700
- Run the workflow weekly.
1701
- cron : str, optional, default None
1702
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1703
- specified by this expression.
1704
- timezone : str, optional, default None
1705
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1706
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1707
- """
1708
- ...
1709
-
1710
- @typing.overload
1711
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1690
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1712
1691
  ...
1713
1692
 
1714
- 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):
1693
+ 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):
1715
1694
  """
1716
- Specifies the times when the flow should be run when running on a
1717
- production scheduler.
1695
+ Specifies the Conda environment for all steps of the flow.
1696
+
1697
+ Use `@conda_base` to set common libraries required by all
1698
+ steps and use `@conda` to specify step-specific additions.
1718
1699
 
1719
1700
  Parameters
1720
1701
  ----------
1721
- hourly : bool, default False
1722
- Run the workflow hourly.
1723
- daily : bool, default True
1724
- Run the workflow daily.
1725
- weekly : bool, default False
1726
- Run the workflow weekly.
1727
- cron : str, optional, default None
1728
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1729
- specified by this expression.
1730
- timezone : str, optional, default None
1731
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1732
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1702
+ packages : Dict[str, str], default {}
1703
+ Packages to use for this flow. The key is the name of the package
1704
+ and the value is the version to use.
1705
+ libraries : Dict[str, str], default {}
1706
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1707
+ python : str, optional, default None
1708
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1709
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1710
+ disabled : bool, default False
1711
+ If set to True, disables Conda.
1733
1712
  """
1734
1713
  ...
1735
1714
 
@@ -1828,21 +1807,45 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1828
1807
  """
1829
1808
  ...
1830
1809
 
1831
- def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1810
+ 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]]:
1832
1811
  """
1833
- Specifies what flows belong to the same project.
1834
-
1835
- A project-specific namespace is created for all flows that
1836
- use the same `@project(name)`.
1812
+ 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)
1813
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1814
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1815
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1816
+ starts only after all sensors finish.
1837
1817
 
1838
1818
  Parameters
1839
1819
  ----------
1820
+ timeout : int
1821
+ Time, in seconds before the task times out and fails. (Default: 3600)
1822
+ poke_interval : int
1823
+ Time in seconds that the job should wait in between each try. (Default: 60)
1824
+ mode : str
1825
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1826
+ exponential_backoff : bool
1827
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1828
+ pool : str
1829
+ the slot pool this task should run in,
1830
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1831
+ soft_fail : bool
1832
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1840
1833
  name : str
1841
- Project name. Make sure that the name is unique amongst all
1842
- projects that use the same production scheduler. The name may
1843
- contain only lowercase alphanumeric characters and underscores.
1844
-
1845
-
1834
+ Name of the sensor on Airflow
1835
+ description : str
1836
+ Description of sensor in the Airflow UI
1837
+ bucket_key : Union[str, List[str]]
1838
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1839
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1840
+ bucket_name : str
1841
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1842
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1843
+ wildcard_match : bool
1844
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1845
+ aws_conn_id : str
1846
+ a reference to the s3 connection on Airflow. (Default: None)
1847
+ verify : bool
1848
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1846
1849
  """
1847
1850
  ...
1848
1851