ob-metaflow-stubs 4.2__py2.py3-none-any.whl → 4.3__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. metaflow-stubs/__init__.pyi +560 -560
  2. metaflow-stubs/cards.pyi +5 -5
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/client/__init__.pyi +3 -3
  5. metaflow-stubs/client/core.pyi +7 -7
  6. metaflow-stubs/client/filecache.pyi +2 -2
  7. metaflow-stubs/clone_util.pyi +2 -2
  8. metaflow-stubs/events.pyi +3 -3
  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 +2 -2
  14. metaflow-stubs/metadata/util.pyi +2 -2
  15. metaflow-stubs/metaflow_config.pyi +2 -2
  16. metaflow-stubs/metaflow_current.pyi +3 -3
  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 +3 -3
  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 +4 -4
  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 +3 -3
  29. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +4 -4
  30. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +4 -4
  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 +4 -4
  35. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +5 -5
  36. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +4 -4
  37. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  38. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  39. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  40. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  41. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  42. metaflow-stubs/plugins/aws/batch/batch_cli.pyi +2 -2
  43. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  44. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +4 -4
  45. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  46. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
  47. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  48. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
  49. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  50. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +2 -2
  51. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  52. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  53. metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +5 -5
  54. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  55. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
  56. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  57. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  58. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  59. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +4 -4
  60. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  61. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  62. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  63. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  64. metaflow-stubs/plugins/cards/card_cli.pyi +5 -5
  65. metaflow-stubs/plugins/cards/card_client.pyi +2 -2
  66. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  67. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  68. metaflow-stubs/plugins/cards/card_decorator.pyi +3 -3
  69. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  70. metaflow-stubs/plugins/cards/card_modules/basic.pyi +4 -4
  71. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  72. metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +2 -2
  73. metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +2 -2
  74. metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +2 -2
  75. metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +2 -2
  76. metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +2 -2
  77. metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
  78. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  79. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  80. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +3 -3
  81. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  82. metaflow-stubs/plugins/cards/component_serializer.pyi +4 -4
  83. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  84. metaflow-stubs/plugins/catch_decorator.pyi +4 -4
  85. metaflow-stubs/plugins/datatools/__init__.pyi +4 -4
  86. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  87. metaflow-stubs/plugins/datatools/s3/__init__.pyi +3 -3
  88. metaflow-stubs/plugins/datatools/s3/s3.pyi +5 -5
  89. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  90. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  91. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  92. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  93. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  94. metaflow-stubs/plugins/events_decorator.pyi +3 -3
  95. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  96. metaflow-stubs/plugins/frameworks/pytorch.pyi +4 -4
  97. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  98. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +4 -4
  99. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  100. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  101. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  102. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  103. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  104. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +3 -3
  105. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +3 -3
  106. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  107. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +4 -4
  108. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +3 -3
  109. metaflow-stubs/plugins/logs_cli.pyi +4 -4
  110. metaflow-stubs/plugins/package_cli.pyi +2 -2
  111. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  112. metaflow-stubs/plugins/perimeters.pyi +24 -0
  113. metaflow-stubs/plugins/project_decorator.pyi +3 -3
  114. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  115. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  116. metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
  117. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  118. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  119. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  120. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  121. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  122. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  123. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
  124. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  125. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  126. metaflow-stubs/plugins/tag_cli.pyi +5 -5
  127. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  128. metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
  129. metaflow-stubs/procpoll.pyi +2 -2
  130. metaflow-stubs/profilers/__init__.pyi +2 -2
  131. metaflow-stubs/pylint_wrapper.pyi +2 -2
  132. metaflow-stubs/runner/__init__.pyi +2 -2
  133. metaflow-stubs/runner/metaflow_runner.pyi +5 -5
  134. metaflow-stubs/runner/nbrun.pyi +2 -2
  135. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  136. metaflow-stubs/system/__init__.pyi +3 -3
  137. metaflow-stubs/system/system_logger.pyi +3 -3
  138. metaflow-stubs/system/system_monitor.pyi +2 -2
  139. metaflow-stubs/tagging_util.pyi +2 -2
  140. metaflow-stubs/tuple_util.pyi +2 -2
  141. {ob_metaflow_stubs-4.2.dist-info → ob_metaflow_stubs-4.3.dist-info}/METADATA +1 -1
  142. ob_metaflow_stubs-4.3.dist-info/RECORD +145 -0
  143. ob_metaflow_stubs-4.2.dist-info/RECORD +0 -144
  144. {ob_metaflow_stubs-4.2.dist-info → ob_metaflow_stubs-4.3.dist-info}/WHEEL +0 -0
  145. {ob_metaflow_stubs-4.2.dist-info → ob_metaflow_stubs-4.3.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.7.1+nim(0.0.1);ob(v1) #
4
- # Generated on 2024-07-08T23:52:24.906750 #
3
+ # MF version: 2.12.7.1+ob(v1) #
4
+ # Generated on 2024-07-09T16:19:31.537205 #
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._vendor.click.types
12
- import metaflow.events
11
+ import metaflow.client.core
13
12
  import metaflow.metaflow_current
14
- import metaflow.parameters
15
- import metaflow.datastore.inputs
13
+ import io
14
+ import metaflow.plugins.datatools.s3.s3
16
15
  import datetime
16
+ import metaflow.datastore.inputs
17
17
  import metaflow.flowspec
18
- import metaflow.client.core
19
- import metaflow.plugins.datatools.s3.s3
20
- import metaflow.runner.metaflow_runner
18
+ import metaflow.parameters
19
+ import metaflow._vendor.click.types
20
+ import metaflow.events
21
21
  import typing
22
- import io
22
+ import metaflow.runner.metaflow_runner
23
23
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
24
24
  StepFlag = typing.NewType("StepFlag", bool)
25
25
 
@@ -727,55 +727,6 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
727
727
  """
728
728
  ...
729
729
 
730
- @typing.overload
731
- def catch(*, var: typing.Optional[str] = None, print_exception: bool = True) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
732
- """
733
- Specifies that the step will success under all circumstances.
734
-
735
- The decorator will create an optional artifact, specified by `var`, which
736
- contains the exception raised. You can use it to detect the presence
737
- of errors, indicating that all happy-path artifacts produced by the step
738
- are missing.
739
-
740
- Parameters
741
- ----------
742
- var : str, optional, default None
743
- Name of the artifact in which to store the caught exception.
744
- If not specified, the exception is not stored.
745
- print_exception : bool, default True
746
- Determines whether or not the exception is printed to
747
- stdout when caught.
748
- """
749
- ...
750
-
751
- @typing.overload
752
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
753
- ...
754
-
755
- @typing.overload
756
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
757
- ...
758
-
759
- def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
760
- """
761
- Specifies that the step will success under all circumstances.
762
-
763
- The decorator will create an optional artifact, specified by `var`, which
764
- contains the exception raised. You can use it to detect the presence
765
- of errors, indicating that all happy-path artifacts produced by the step
766
- are missing.
767
-
768
- Parameters
769
- ----------
770
- var : str, optional, default None
771
- Name of the artifact in which to store the caught exception.
772
- If not specified, the exception is not stored.
773
- print_exception : bool, default True
774
- Determines whether or not the exception is printed to
775
- stdout when caught.
776
- """
777
- ...
778
-
779
730
  @typing.overload
780
731
  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]]]:
781
732
  """
@@ -833,62 +784,150 @@ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
833
784
  """
834
785
  ...
835
786
 
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) -> 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]]]:
787
+ @typing.overload
788
+ 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]]]:
837
789
  """
838
- Specifies that this step should execute on Kubernetes.
790
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
839
791
 
840
792
  Parameters
841
793
  ----------
842
794
  cpu : int, default 1
843
795
  Number of CPUs required for this step. If `@resources` is
844
796
  also present, the maximum value from all decorators is used.
797
+ gpu : int, default 0
798
+ Number of GPUs required for this step. If `@resources` is
799
+ also present, the maximum value from all decorators is used.
845
800
  memory : int, default 4096
846
801
  Memory size (in MB) required for this step. If
847
802
  `@resources` is also present, the maximum value from all decorators is
848
803
  used.
849
- disk : int, default 10240
850
- Disk size (in MB) required for this step. If
804
+ image : str, optional, default None
805
+ Docker image to use when launching on AWS Batch. If not specified, and
806
+ METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
807
+ not, a default Docker image mapping to the current version of Python is used.
808
+ queue : str, default METAFLOW_BATCH_JOB_QUEUE
809
+ AWS Batch Job Queue to submit the job to.
810
+ iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
811
+ AWS IAM role that AWS Batch container uses to access AWS cloud resources.
812
+ execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
813
+ AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
814
+ (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
815
+ shared_memory : int, optional, default None
816
+ The value for the size (in MiB) of the /dev/shm volume for this step.
817
+ This parameter maps to the `--shm-size` option in Docker.
818
+ max_swap : int, optional, default None
819
+ The total amount of swap memory (in MiB) a container can use for this
820
+ step. This parameter is translated to the `--memory-swap` option in
821
+ Docker where the value is the sum of the container memory plus the
822
+ `max_swap` value.
823
+ swappiness : int, optional, default None
824
+ This allows you to tune memory swappiness behavior for this step.
825
+ A swappiness value of 0 causes swapping not to happen unless absolutely
826
+ necessary. A swappiness value of 100 causes pages to be swapped very
827
+ aggressively. Accepted values are whole numbers between 0 and 100.
828
+ use_tmpfs : bool, default False
829
+ This enables an explicit tmpfs mount for this step. Note that tmpfs is
830
+ not available on Fargate compute environments
831
+ tmpfs_tempdir : bool, default True
832
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
833
+ tmpfs_size : int, optional, default None
834
+ The value for the size (in MiB) of the tmpfs mount for this step.
835
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
836
+ memory allocated for this step.
837
+ tmpfs_path : str, optional, default None
838
+ Path to tmpfs mount for this step. Defaults to /metaflow_temp.
839
+ inferentia : int, default 0
840
+ Number of Inferentia chips required for this step.
841
+ trainium : int, default None
842
+ Alias for inferentia. Use only one of the two.
843
+ efa : int, default 0
844
+ Number of elastic fabric adapter network devices to attach to container
845
+ ephemeral_storage : int, default None
846
+ The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
847
+ This is only relevant for Fargate compute environments
848
+ log_driver: str, optional, default None
849
+ The log driver to use for the Amazon ECS container.
850
+ log_options: List[str], optional, default None
851
+ List of strings containing options for the chosen log driver. The configurable values
852
+ depend on the `log driver` chosen. Validation of these options is not supported yet.
853
+ Example: [`awslogs-group:aws/batch/job`]
854
+ """
855
+ ...
856
+
857
+ @typing.overload
858
+ def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
859
+ ...
860
+
861
+ @typing.overload
862
+ def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
863
+ ...
864
+
865
+ 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):
866
+ """
867
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
868
+
869
+ Parameters
870
+ ----------
871
+ cpu : int, default 1
872
+ Number of CPUs required for this step. If `@resources` is
873
+ also present, the maximum value from all decorators is used.
874
+ gpu : int, default 0
875
+ Number of GPUs required for this step. If `@resources` is
876
+ also present, the maximum value from all decorators is used.
877
+ memory : int, default 4096
878
+ Memory size (in MB) required for this step. If
851
879
  `@resources` is also present, the maximum value from all decorators is
852
880
  used.
853
881
  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
882
+ Docker image to use when launching on AWS Batch. If not specified, and
883
+ METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
856
884
  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.
885
+ queue : str, default METAFLOW_BATCH_JOB_QUEUE
886
+ AWS Batch Job Queue to submit the job to.
887
+ iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
888
+ AWS IAM role that AWS Batch container uses to access AWS cloud resources.
889
+ execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
890
+ AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
891
+ (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
892
+ shared_memory : int, optional, default None
893
+ The value for the size (in MiB) of the /dev/shm volume for this step.
894
+ This parameter maps to the `--shm-size` option in Docker.
895
+ max_swap : int, optional, default None
896
+ The total amount of swap memory (in MiB) a container can use for this
897
+ step. This parameter is translated to the `--memory-swap` option in
898
+ Docker where the value is the sum of the container memory plus the
899
+ `max_swap` value.
900
+ swappiness : int, optional, default None
901
+ This allows you to tune memory swappiness behavior for this step.
902
+ A swappiness value of 0 causes swapping not to happen unless absolutely
903
+ necessary. A swappiness value of 100 causes pages to be swapped very
904
+ aggressively. Accepted values are whole numbers between 0 and 100.
875
905
  use_tmpfs : bool, default False
876
- This enables an explicit tmpfs mount for this step.
906
+ This enables an explicit tmpfs mount for this step. Note that tmpfs is
907
+ not available on Fargate compute environments
877
908
  tmpfs_tempdir : bool, default True
878
909
  sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
879
- tmpfs_size : int, optional, default: None
910
+ tmpfs_size : int, optional, default None
880
911
  The value for the size (in MiB) of the tmpfs mount for this step.
881
912
  This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
882
913
  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
914
+ tmpfs_path : str, optional, default None
915
+ Path to tmpfs mount for this step. Defaults to /metaflow_temp.
916
+ inferentia : int, default 0
917
+ Number of Inferentia chips required for this step.
918
+ trainium : int, default None
919
+ Alias for inferentia. Use only one of the two.
920
+ efa : int, default 0
921
+ Number of elastic fabric adapter network devices to attach to container
922
+ ephemeral_storage : int, default None
923
+ The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
924
+ This is only relevant for Fargate compute environments
925
+ log_driver: str, optional, default None
926
+ The log driver to use for the Amazon ECS container.
927
+ log_options: List[str], optional, default None
928
+ List of strings containing options for the chosen log driver. The configurable values
929
+ depend on the `log driver` chosen. Validation of these options is not supported yet.
930
+ Example: [`awslogs-group:aws/batch/job`]
892
931
  """
893
932
  ...
894
933
 
@@ -946,86 +985,51 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
946
985
  ...
947
986
 
948
987
  @typing.overload
949
- 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]]]:
988
+ 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]]]:
950
989
  """
951
- Creates a human-readable report, a Metaflow Card, after this step completes.
990
+ Specifies the PyPI packages for the step.
952
991
 
953
- Note that you may add multiple `@card` decorators in a step with different parameters.
992
+ Information in this decorator will augment any
993
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
994
+ you can use `@pypi_base` to set packages required by all
995
+ steps and use `@pypi` to specify step-specific overrides.
954
996
 
955
997
  Parameters
956
998
  ----------
957
- type : str, default 'default'
958
- Card type.
959
- id : str, optional, default None
960
- If multiple cards are present, use this id to identify this card.
961
- options : Dict[str, Any], default {}
962
- Options passed to the card. The contents depend on the card type.
963
- timeout : int, default 45
964
- Interrupt reporting if it takes more than this many seconds.
965
-
966
-
999
+ packages : Dict[str, str], default: {}
1000
+ Packages to use for this step. The key is the name of the package
1001
+ and the value is the version to use.
1002
+ python : str, optional, default: None
1003
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1004
+ that the version used will correspond to the version of the Python interpreter used to start the run.
967
1005
  """
968
1006
  ...
969
1007
 
970
1008
  @typing.overload
971
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1009
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
972
1010
  ...
973
1011
 
974
1012
  @typing.overload
975
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1013
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
976
1014
  ...
977
1015
 
978
- 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):
1016
+ 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):
979
1017
  """
980
- Creates a human-readable report, a Metaflow Card, after this step completes.
1018
+ Specifies the PyPI packages for the step.
981
1019
 
982
- Note that you may add multiple `@card` decorators in a step with different parameters.
983
-
984
- Parameters
985
- ----------
986
- type : str, default 'default'
987
- Card type.
988
- id : str, optional, default None
989
- If multiple cards are present, use this id to identify this card.
990
- options : Dict[str, Any], default {}
991
- Options passed to the card. The contents depend on the card type.
992
- timeout : int, default 45
993
- Interrupt reporting if it takes more than this many seconds.
994
-
995
-
996
- """
997
- ...
998
-
999
- @typing.overload
1000
- 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]]]:
1001
- """
1002
- Specifies secrets to be retrieved and injected as environment variables prior to
1003
- the execution of a step.
1004
-
1005
- Parameters
1006
- ----------
1007
- sources : List[Union[str, Dict[str, Any]]], default: []
1008
- List of secret specs, defining how the secrets are to be retrieved
1009
- """
1010
- ...
1011
-
1012
- @typing.overload
1013
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1014
- ...
1015
-
1016
- @typing.overload
1017
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1018
- ...
1019
-
1020
- 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]]] = []):
1021
- """
1022
- Specifies secrets to be retrieved and injected as environment variables prior to
1023
- the execution of a step.
1020
+ Information in this decorator will augment any
1021
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
1022
+ you can use `@pypi_base` to set packages required by all
1023
+ steps and use `@pypi` to specify step-specific overrides.
1024
1024
 
1025
1025
  Parameters
1026
1026
  ----------
1027
- sources : List[Union[str, Dict[str, Any]]], default: []
1028
- List of secret specs, defining how the secrets are to be retrieved
1027
+ packages : Dict[str, str], default: {}
1028
+ Packages to use for this step. The key is the name of the package
1029
+ and the value is the version to use.
1030
+ python : str, optional, default: None
1031
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1032
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1029
1033
  """
1030
1034
  ...
1031
1035
 
@@ -1106,6 +1110,37 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
1106
1110
  """
1107
1111
  ...
1108
1112
 
1113
+ @typing.overload
1114
+ 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]]]:
1115
+ """
1116
+ Specifies environment variables to be set prior to the execution of a step.
1117
+
1118
+ Parameters
1119
+ ----------
1120
+ vars : Dict[str, str], default {}
1121
+ Dictionary of environment variables to set.
1122
+ """
1123
+ ...
1124
+
1125
+ @typing.overload
1126
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1127
+ ...
1128
+
1129
+ @typing.overload
1130
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1131
+ ...
1132
+
1133
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
1134
+ """
1135
+ Specifies environment variables to be set prior to the execution of a step.
1136
+
1137
+ Parameters
1138
+ ----------
1139
+ vars : Dict[str, str], default {}
1140
+ Dictionary of environment variables to set.
1141
+ """
1142
+ ...
1143
+
1109
1144
  @typing.overload
1110
1145
  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]]]:
1111
1146
  """
@@ -1164,481 +1199,286 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
1164
1199
  ...
1165
1200
 
1166
1201
  @typing.overload
1167
- 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]]]:
1202
+ 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]]]:
1168
1203
  """
1169
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
1204
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1205
+
1206
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1170
1207
 
1171
1208
  Parameters
1172
1209
  ----------
1173
- cpu : int, default 1
1174
- Number of CPUs required for this step. If `@resources` is
1175
- also present, the maximum value from all decorators is used.
1176
- gpu : int, default 0
1177
- Number of GPUs required for this step. If `@resources` is
1178
- also present, the maximum value from all decorators is used.
1179
- memory : int, default 4096
1180
- Memory size (in MB) required for this step. If
1181
- `@resources` is also present, the maximum value from all decorators is
1182
- used.
1183
- image : str, optional, default None
1184
- Docker image to use when launching on AWS Batch. If not specified, and
1185
- METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
1186
- not, a default Docker image mapping to the current version of Python is used.
1187
- queue : str, default METAFLOW_BATCH_JOB_QUEUE
1188
- AWS Batch Job Queue to submit the job to.
1189
- iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
1190
- AWS IAM role that AWS Batch container uses to access AWS cloud resources.
1191
- execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
1192
- AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
1193
- (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
1194
- shared_memory : int, optional, default None
1195
- The value for the size (in MiB) of the /dev/shm volume for this step.
1196
- This parameter maps to the `--shm-size` option in Docker.
1197
- max_swap : int, optional, default None
1198
- The total amount of swap memory (in MiB) a container can use for this
1199
- step. This parameter is translated to the `--memory-swap` option in
1200
- Docker where the value is the sum of the container memory plus the
1201
- `max_swap` value.
1202
- swappiness : int, optional, default None
1203
- This allows you to tune memory swappiness behavior for this step.
1204
- A swappiness value of 0 causes swapping not to happen unless absolutely
1205
- necessary. A swappiness value of 100 causes pages to be swapped very
1206
- aggressively. Accepted values are whole numbers between 0 and 100.
1207
- use_tmpfs : bool, default False
1208
- This enables an explicit tmpfs mount for this step. Note that tmpfs is
1209
- not available on Fargate compute environments
1210
- tmpfs_tempdir : bool, default True
1211
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
1212
- tmpfs_size : int, optional, default None
1213
- The value for the size (in MiB) of the tmpfs mount for this step.
1214
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
1215
- memory allocated for this step.
1216
- tmpfs_path : str, optional, default None
1217
- Path to tmpfs mount for this step. Defaults to /metaflow_temp.
1218
- inferentia : int, default 0
1219
- Number of Inferentia chips required for this step.
1220
- trainium : int, default None
1221
- Alias for inferentia. Use only one of the two.
1222
- efa : int, default 0
1223
- Number of elastic fabric adapter network devices to attach to container
1224
- ephemeral_storage : int, default None
1225
- The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
1226
- This is only relevant for Fargate compute environments
1227
- log_driver: str, optional, default None
1228
- The log driver to use for the Amazon ECS container.
1229
- log_options: List[str], optional, default None
1230
- List of strings containing options for the chosen log driver. The configurable values
1231
- depend on the `log driver` chosen. Validation of these options is not supported yet.
1232
- Example: [`awslogs-group:aws/batch/job`]
1210
+ type : str, default 'default'
1211
+ Card type.
1212
+ id : str, optional, default None
1213
+ If multiple cards are present, use this id to identify this card.
1214
+ options : Dict[str, Any], default {}
1215
+ Options passed to the card. The contents depend on the card type.
1216
+ timeout : int, default 45
1217
+ Interrupt reporting if it takes more than this many seconds.
1218
+
1219
+
1233
1220
  """
1234
1221
  ...
1235
1222
 
1236
1223
  @typing.overload
1237
- def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1224
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1238
1225
  ...
1239
1226
 
1240
1227
  @typing.overload
1241
- def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1228
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1242
1229
  ...
1243
1230
 
1244
- 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):
1231
+ 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):
1245
1232
  """
1246
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
1233
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1234
+
1235
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1247
1236
 
1248
1237
  Parameters
1249
1238
  ----------
1250
- cpu : int, default 1
1251
- Number of CPUs required for this step. If `@resources` is
1252
- also present, the maximum value from all decorators is used.
1253
- gpu : int, default 0
1254
- Number of GPUs required for this step. If `@resources` is
1255
- also present, the maximum value from all decorators is used.
1256
- memory : int, default 4096
1257
- Memory size (in MB) required for this step. If
1258
- `@resources` is also present, the maximum value from all decorators is
1259
- used.
1260
- image : str, optional, default None
1261
- Docker image to use when launching on AWS Batch. If not specified, and
1262
- METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
1263
- not, a default Docker image mapping to the current version of Python is used.
1264
- queue : str, default METAFLOW_BATCH_JOB_QUEUE
1265
- AWS Batch Job Queue to submit the job to.
1266
- iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
1267
- AWS IAM role that AWS Batch container uses to access AWS cloud resources.
1268
- execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
1269
- AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
1270
- (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
1271
- shared_memory : int, optional, default None
1272
- The value for the size (in MiB) of the /dev/shm volume for this step.
1273
- This parameter maps to the `--shm-size` option in Docker.
1274
- max_swap : int, optional, default None
1275
- The total amount of swap memory (in MiB) a container can use for this
1276
- step. This parameter is translated to the `--memory-swap` option in
1277
- Docker where the value is the sum of the container memory plus the
1278
- `max_swap` value.
1279
- swappiness : int, optional, default None
1280
- This allows you to tune memory swappiness behavior for this step.
1281
- A swappiness value of 0 causes swapping not to happen unless absolutely
1282
- necessary. A swappiness value of 100 causes pages to be swapped very
1283
- aggressively. Accepted values are whole numbers between 0 and 100.
1284
- use_tmpfs : bool, default False
1285
- This enables an explicit tmpfs mount for this step. Note that tmpfs is
1286
- not available on Fargate compute environments
1287
- tmpfs_tempdir : bool, default True
1288
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
1289
- tmpfs_size : int, optional, default None
1290
- The value for the size (in MiB) of the tmpfs mount for this step.
1291
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
1292
- memory allocated for this step.
1293
- tmpfs_path : str, optional, default None
1294
- Path to tmpfs mount for this step. Defaults to /metaflow_temp.
1295
- inferentia : int, default 0
1296
- Number of Inferentia chips required for this step.
1297
- trainium : int, default None
1298
- Alias for inferentia. Use only one of the two.
1299
- efa : int, default 0
1300
- Number of elastic fabric adapter network devices to attach to container
1301
- ephemeral_storage : int, default None
1302
- The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
1303
- This is only relevant for Fargate compute environments
1304
- log_driver: str, optional, default None
1305
- The log driver to use for the Amazon ECS container.
1306
- log_options: List[str], optional, default None
1307
- List of strings containing options for the chosen log driver. The configurable values
1308
- depend on the `log driver` chosen. Validation of these options is not supported yet.
1309
- Example: [`awslogs-group:aws/batch/job`]
1239
+ type : str, default 'default'
1240
+ Card type.
1241
+ id : str, optional, default None
1242
+ If multiple cards are present, use this id to identify this card.
1243
+ options : Dict[str, Any], default {}
1244
+ Options passed to the card. The contents depend on the card type.
1245
+ timeout : int, default 45
1246
+ Interrupt reporting if it takes more than this many seconds.
1247
+
1248
+
1310
1249
  """
1311
1250
  ...
1312
1251
 
1313
1252
  @typing.overload
1314
- 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]]]:
1253
+ 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]]]:
1315
1254
  """
1316
- Specifies environment variables to be set prior to the execution of a step.
1255
+ Specifies secrets to be retrieved and injected as environment variables prior to
1256
+ the execution of a step.
1317
1257
 
1318
1258
  Parameters
1319
1259
  ----------
1320
- vars : Dict[str, str], default {}
1321
- Dictionary of environment variables to set.
1260
+ sources : List[Union[str, Dict[str, Any]]], default: []
1261
+ List of secret specs, defining how the secrets are to be retrieved
1322
1262
  """
1323
1263
  ...
1324
1264
 
1325
1265
  @typing.overload
1326
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1266
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1327
1267
  ...
1328
1268
 
1329
1269
  @typing.overload
1330
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1270
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1331
1271
  ...
1332
1272
 
1333
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
1273
+ 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]]] = []):
1334
1274
  """
1335
- Specifies environment variables to be set prior to the execution of a step.
1275
+ Specifies secrets to be retrieved and injected as environment variables prior to
1276
+ the execution of a step.
1336
1277
 
1337
1278
  Parameters
1338
1279
  ----------
1339
- vars : Dict[str, str], default {}
1340
- Dictionary of environment variables to set.
1280
+ sources : List[Union[str, Dict[str, Any]]], default: []
1281
+ List of secret specs, defining how the secrets are to be retrieved
1341
1282
  """
1342
1283
  ...
1343
1284
 
1344
- @typing.overload
1345
- 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]]]:
1285
+ 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]]]:
1346
1286
  """
1347
- Specifies the PyPI packages for the step.
1348
-
1349
- Information in this decorator will augment any
1350
- attributes set in the `@pyi_base` flow-level decorator. Hence,
1351
- you can use `@pypi_base` to set packages required by all
1352
- steps and use `@pypi` to specify step-specific overrides.
1287
+ Specifies that this step should execute on Kubernetes.
1353
1288
 
1354
1289
  Parameters
1355
1290
  ----------
1356
- packages : Dict[str, str], default: {}
1357
- Packages to use for this step. The key is the name of the package
1358
- and the value is the version to use.
1359
- python : str, optional, default: None
1360
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1361
- that the version used will correspond to the version of the Python interpreter used to start the run.
1291
+ cpu : int, default 1
1292
+ Number of CPUs required for this step. If `@resources` is
1293
+ also present, the maximum value from all decorators is used.
1294
+ memory : int, default 4096
1295
+ Memory size (in MB) required for this step. If
1296
+ `@resources` is also present, the maximum value from all decorators is
1297
+ used.
1298
+ disk : int, default 10240
1299
+ Disk size (in MB) required for this step. If
1300
+ `@resources` is also present, the maximum value from all decorators is
1301
+ used.
1302
+ image : str, optional, default None
1303
+ Docker image to use when launching on Kubernetes. If not specified, and
1304
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
1305
+ not, a default Docker image mapping to the current version of Python is used.
1306
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
1307
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
1308
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
1309
+ Kubernetes service account to use when launching pod in Kubernetes.
1310
+ secrets : List[str], optional, default None
1311
+ Kubernetes secrets to use when launching pod in Kubernetes. These
1312
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
1313
+ in Metaflow configuration.
1314
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
1315
+ Kubernetes namespace to use when launching pod in Kubernetes.
1316
+ gpu : int, optional, default None
1317
+ Number of GPUs required for this step. A value of zero implies that
1318
+ the scheduled node should not have GPUs.
1319
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
1320
+ The vendor of the GPUs to be used for this step.
1321
+ tolerations : List[str], default []
1322
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
1323
+ Kubernetes tolerations to use when launching pod in Kubernetes.
1324
+ use_tmpfs : bool, default False
1325
+ This enables an explicit tmpfs mount for this step.
1326
+ tmpfs_tempdir : bool, default True
1327
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
1328
+ tmpfs_size : int, optional, default: None
1329
+ The value for the size (in MiB) of the tmpfs mount for this step.
1330
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
1331
+ memory allocated for this step.
1332
+ tmpfs_path : str, optional, default /metaflow_temp
1333
+ Path to tmpfs mount for this step.
1334
+ persistent_volume_claims : Dict[str, str], optional, default None
1335
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
1336
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
1337
+ shared_memory: int, optional
1338
+ Shared memory size (in MiB) required for this step
1339
+ port: int, optional
1340
+ Port number to specify in the Kubernetes job object
1362
1341
  """
1363
1342
  ...
1364
1343
 
1365
1344
  @typing.overload
1366
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1367
- ...
1368
-
1369
- @typing.overload
1370
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1371
- ...
1372
-
1373
- 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):
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]]]:
1374
1346
  """
1375
- Specifies the PyPI packages for the step.
1347
+ Specifies that the step will success under all circumstances.
1376
1348
 
1377
- Information in this decorator will augment any
1378
- attributes set in the `@pyi_base` flow-level decorator. Hence,
1379
- you can use `@pypi_base` to set packages required by all
1380
- steps and use `@pypi` to specify step-specific overrides.
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.
1381
1353
 
1382
1354
  Parameters
1383
1355
  ----------
1384
- packages : Dict[str, str], default: {}
1385
- Packages to use for this step. The key is the name of the package
1386
- and the value is the version to use.
1387
- python : str, optional, default: None
1388
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1389
- that the version used will correspond to the version of the Python interpreter used to start the run.
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.
1390
1362
  """
1391
1363
  ...
1392
1364
 
1393
1365
  @typing.overload
1394
- def trigger_on_finish(*, flow: typing.Union[str, typing.Dict[str, str], None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1395
- """
1396
- Specifies the flow(s) that this flow depends on.
1397
-
1398
- ```
1399
- @trigger_on_finish(flow='FooFlow')
1400
- ```
1401
- or
1402
- ```
1403
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1404
- ```
1405
- This decorator respects the @project decorator and triggers the flow
1406
- when upstream runs within the same namespace complete successfully
1407
-
1408
- Additionally, you can specify project aware upstream flow dependencies
1409
- by specifying the fully qualified project_flow_name.
1410
- ```
1411
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1412
- ```
1413
- or
1414
- ```
1415
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1416
- ```
1417
-
1418
- You can also specify just the project or project branch (other values will be
1419
- inferred from the current project or project branch):
1420
- ```
1421
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1422
- ```
1423
-
1424
- Note that `branch` is typically one of:
1425
- - `prod`
1426
- - `user.bob`
1427
- - `test.my_experiment`
1428
- - `prod.staging`
1429
-
1430
- Parameters
1431
- ----------
1432
- flow : Union[str, Dict[str, str]], optional, default None
1433
- Upstream flow dependency for this flow.
1434
- flows : List[Union[str, Dict[str, str]]], default []
1435
- Upstream flow dependencies for this flow.
1436
- options : Dict[str, Any], default {}
1437
- Backend-specific configuration for tuning eventing behavior.
1438
-
1439
-
1440
- """
1366
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1441
1367
  ...
1442
1368
 
1443
1369
  @typing.overload
1444
- def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1370
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1445
1371
  ...
1446
1372
 
1447
- def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, flow: typing.Union[str, typing.Dict[str, str], None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}):
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):
1448
1374
  """
1449
- Specifies the flow(s) that this flow depends on.
1450
-
1451
- ```
1452
- @trigger_on_finish(flow='FooFlow')
1453
- ```
1454
- or
1455
- ```
1456
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1457
- ```
1458
- This decorator respects the @project decorator and triggers the flow
1459
- when upstream runs within the same namespace complete successfully
1460
-
1461
- Additionally, you can specify project aware upstream flow dependencies
1462
- by specifying the fully qualified project_flow_name.
1463
- ```
1464
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1465
- ```
1466
- or
1467
- ```
1468
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1469
- ```
1470
-
1471
- You can also specify just the project or project branch (other values will be
1472
- inferred from the current project or project branch):
1473
- ```
1474
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1475
- ```
1375
+ Specifies that the step will success under all circumstances.
1476
1376
 
1477
- Note that `branch` is typically one of:
1478
- - `prod`
1479
- - `user.bob`
1480
- - `test.my_experiment`
1481
- - `prod.staging`
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.
1482
1381
 
1483
1382
  Parameters
1484
1383
  ----------
1485
- flow : Union[str, Dict[str, str]], optional, default None
1486
- Upstream flow dependency for this flow.
1487
- flows : List[Union[str, Dict[str, str]]], default []
1488
- Upstream flow dependencies for this flow.
1489
- options : Dict[str, Any], default {}
1490
- Backend-specific configuration for tuning eventing behavior.
1491
-
1492
-
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.
1493
1390
  """
1494
1391
  ...
1495
1392
 
1496
1393
  @typing.overload
1497
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1394
+ 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]]:
1498
1395
  """
1499
- Specifies the PyPI packages for all steps of the flow.
1396
+ Specifies the Conda environment for all steps of the flow.
1397
+
1398
+ Use `@conda_base` to set common libraries required by all
1399
+ steps and use `@conda` to specify step-specific additions.
1500
1400
 
1501
- Use `@pypi_base` to set common packages required by all
1502
- steps and use `@pypi` to specify step-specific overrides.
1503
1401
  Parameters
1504
1402
  ----------
1505
- packages : Dict[str, str], default: {}
1403
+ packages : Dict[str, str], default {}
1506
1404
  Packages to use for this flow. The key is the name of the package
1507
1405
  and the value is the version to use.
1508
- python : str, optional, default: None
1406
+ libraries : Dict[str, str], default {}
1407
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1408
+ python : str, optional, default None
1509
1409
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1510
1410
  that the version used will correspond to the version of the Python interpreter used to start the run.
1411
+ disabled : bool, default False
1412
+ If set to True, disables Conda.
1511
1413
  """
1512
1414
  ...
1513
1415
 
1514
1416
  @typing.overload
1515
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1417
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1516
1418
  ...
1517
1419
 
1518
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1420
+ 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):
1519
1421
  """
1520
- Specifies the PyPI packages for all steps of the flow.
1422
+ Specifies the Conda environment for all steps of the flow.
1423
+
1424
+ Use `@conda_base` to set common libraries required by all
1425
+ steps and use `@conda` to specify step-specific additions.
1521
1426
 
1522
- Use `@pypi_base` to set common packages required by all
1523
- steps and use `@pypi` to specify step-specific overrides.
1524
1427
  Parameters
1525
1428
  ----------
1526
- packages : Dict[str, str], default: {}
1429
+ packages : Dict[str, str], default {}
1527
1430
  Packages to use for this flow. The key is the name of the package
1528
1431
  and the value is the version to use.
1529
- python : str, optional, default: None
1432
+ libraries : Dict[str, str], default {}
1433
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1434
+ python : str, optional, default None
1530
1435
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1531
1436
  that the version used will correspond to the version of the Python interpreter used to start the run.
1532
- """
1533
- ...
1534
-
1535
- def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1536
- """
1537
- Specifies what flows belong to the same project.
1538
-
1539
- A project-specific namespace is created for all flows that
1540
- use the same `@project(name)`.
1541
-
1542
- Parameters
1543
- ----------
1544
- name : str
1545
- Project name. Make sure that the name is unique amongst all
1546
- projects that use the same production scheduler. The name may
1547
- contain only lowercase alphanumeric characters and underscores.
1548
-
1549
-
1437
+ disabled : bool, default False
1438
+ If set to True, disables Conda.
1550
1439
  """
1551
1440
  ...
1552
1441
 
1553
1442
  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]]:
1554
1443
  """
1555
- 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)
1556
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1557
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1558
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1559
- starts only after all sensors finish.
1560
-
1561
- Parameters
1562
- ----------
1563
- timeout : int
1564
- Time, in seconds before the task times out and fails. (Default: 3600)
1565
- poke_interval : int
1566
- Time in seconds that the job should wait in between each try. (Default: 60)
1567
- mode : str
1568
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1569
- exponential_backoff : bool
1570
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1571
- pool : str
1572
- the slot pool this task should run in,
1573
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1574
- soft_fail : bool
1575
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1576
- name : str
1577
- Name of the sensor on Airflow
1578
- description : str
1579
- Description of sensor in the Airflow UI
1580
- bucket_key : Union[str, List[str]]
1581
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1582
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1583
- bucket_name : str
1584
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1585
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1586
- wildcard_match : bool
1587
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1588
- aws_conn_id : str
1589
- a reference to the s3 connection on Airflow. (Default: None)
1590
- verify : bool
1591
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1592
- """
1593
- ...
1594
-
1595
- @typing.overload
1596
- 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]]:
1597
- """
1598
- Specifies the times when the flow should be run when running on a
1599
- production scheduler.
1600
-
1601
- Parameters
1602
- ----------
1603
- hourly : bool, default False
1604
- Run the workflow hourly.
1605
- daily : bool, default True
1606
- Run the workflow daily.
1607
- weekly : bool, default False
1608
- Run the workflow weekly.
1609
- cron : str, optional, default None
1610
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1611
- specified by this expression.
1612
- timezone : str, optional, default None
1613
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1614
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1615
- """
1616
- ...
1617
-
1618
- @typing.overload
1619
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1620
- ...
1621
-
1622
- 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):
1623
- """
1624
- Specifies the times when the flow should be run when running on a
1625
- production scheduler.
1626
-
1627
- Parameters
1628
- ----------
1629
- hourly : bool, default False
1630
- Run the workflow hourly.
1631
- daily : bool, default True
1632
- Run the workflow daily.
1633
- weekly : bool, default False
1634
- Run the workflow weekly.
1635
- cron : str, optional, default None
1636
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1637
- specified by this expression.
1638
- timezone : str, optional, default None
1639
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1640
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1641
- """
1444
+ 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)
1445
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1446
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1447
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1448
+ starts only after all sensors finish.
1449
+
1450
+ Parameters
1451
+ ----------
1452
+ timeout : int
1453
+ Time, in seconds before the task times out and fails. (Default: 3600)
1454
+ poke_interval : int
1455
+ Time in seconds that the job should wait in between each try. (Default: 60)
1456
+ mode : str
1457
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1458
+ exponential_backoff : bool
1459
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1460
+ pool : str
1461
+ the slot pool this task should run in,
1462
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1463
+ soft_fail : bool
1464
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1465
+ name : str
1466
+ Name of the sensor on Airflow
1467
+ description : str
1468
+ Description of sensor in the Airflow UI
1469
+ bucket_key : Union[str, List[str]]
1470
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1471
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1472
+ bucket_name : str
1473
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1474
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1475
+ wildcard_match : bool
1476
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1477
+ aws_conn_id : str
1478
+ a reference to the s3 connection on Airflow. (Default: None)
1479
+ verify : bool
1480
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1481
+ """
1642
1482
  ...
1643
1483
 
1644
1484
  def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, external_dag_id: str, external_task_ids: typing.List[str], allowed_states: typing.List[str], failed_states: typing.List[str], execution_delta: "datetime.timedelta", check_existence: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
@@ -1684,51 +1524,123 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
1684
1524
  ...
1685
1525
 
1686
1526
  @typing.overload
1687
- 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]]:
1527
+ def trigger_on_finish(*, flow: typing.Union[str, typing.Dict[str, str], None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1688
1528
  """
1689
- Specifies the Conda environment for all steps of the flow.
1529
+ Specifies the flow(s) that this flow depends on.
1690
1530
 
1691
- Use `@conda_base` to set common libraries required by all
1692
- steps and use `@conda` to specify step-specific additions.
1531
+ ```
1532
+ @trigger_on_finish(flow='FooFlow')
1533
+ ```
1534
+ or
1535
+ ```
1536
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1537
+ ```
1538
+ This decorator respects the @project decorator and triggers the flow
1539
+ when upstream runs within the same namespace complete successfully
1540
+
1541
+ Additionally, you can specify project aware upstream flow dependencies
1542
+ by specifying the fully qualified project_flow_name.
1543
+ ```
1544
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1545
+ ```
1546
+ or
1547
+ ```
1548
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1549
+ ```
1550
+
1551
+ You can also specify just the project or project branch (other values will be
1552
+ inferred from the current project or project branch):
1553
+ ```
1554
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1555
+ ```
1556
+
1557
+ Note that `branch` is typically one of:
1558
+ - `prod`
1559
+ - `user.bob`
1560
+ - `test.my_experiment`
1561
+ - `prod.staging`
1693
1562
 
1694
1563
  Parameters
1695
1564
  ----------
1696
- packages : Dict[str, str], default {}
1697
- Packages to use for this flow. The key is the name of the package
1698
- and the value is the version to use.
1699
- libraries : Dict[str, str], default {}
1700
- Supported for backward compatibility. When used with packages, packages will take precedence.
1701
- python : str, optional, default None
1702
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1703
- that the version used will correspond to the version of the Python interpreter used to start the run.
1704
- disabled : bool, default False
1705
- If set to True, disables Conda.
1565
+ flow : Union[str, Dict[str, str]], optional, default None
1566
+ Upstream flow dependency for this flow.
1567
+ flows : List[Union[str, Dict[str, str]]], default []
1568
+ Upstream flow dependencies for this flow.
1569
+ options : Dict[str, Any], default {}
1570
+ Backend-specific configuration for tuning eventing behavior.
1571
+
1572
+
1706
1573
  """
1707
1574
  ...
1708
1575
 
1709
1576
  @typing.overload
1710
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1577
+ def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1711
1578
  ...
1712
1579
 
1713
- 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):
1580
+ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, flow: typing.Union[str, typing.Dict[str, str], None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}):
1714
1581
  """
1715
- Specifies the Conda environment for all steps of the flow.
1582
+ Specifies the flow(s) that this flow depends on.
1716
1583
 
1717
- Use `@conda_base` to set common libraries required by all
1718
- steps and use `@conda` to specify step-specific additions.
1584
+ ```
1585
+ @trigger_on_finish(flow='FooFlow')
1586
+ ```
1587
+ or
1588
+ ```
1589
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1590
+ ```
1591
+ This decorator respects the @project decorator and triggers the flow
1592
+ when upstream runs within the same namespace complete successfully
1593
+
1594
+ Additionally, you can specify project aware upstream flow dependencies
1595
+ by specifying the fully qualified project_flow_name.
1596
+ ```
1597
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1598
+ ```
1599
+ or
1600
+ ```
1601
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1602
+ ```
1603
+
1604
+ You can also specify just the project or project branch (other values will be
1605
+ inferred from the current project or project branch):
1606
+ ```
1607
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1608
+ ```
1609
+
1610
+ Note that `branch` is typically one of:
1611
+ - `prod`
1612
+ - `user.bob`
1613
+ - `test.my_experiment`
1614
+ - `prod.staging`
1719
1615
 
1720
1616
  Parameters
1721
1617
  ----------
1722
- packages : Dict[str, str], default {}
1723
- Packages to use for this flow. The key is the name of the package
1724
- and the value is the version to use.
1725
- libraries : Dict[str, str], default {}
1726
- Supported for backward compatibility. When used with packages, packages will take precedence.
1727
- python : str, optional, default None
1728
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1729
- that the version used will correspond to the version of the Python interpreter used to start the run.
1730
- disabled : bool, default False
1731
- If set to True, disables Conda.
1618
+ flow : Union[str, Dict[str, str]], optional, default None
1619
+ Upstream flow dependency for this flow.
1620
+ flows : List[Union[str, Dict[str, str]]], default []
1621
+ Upstream flow dependencies for this flow.
1622
+ options : Dict[str, Any], default {}
1623
+ Backend-specific configuration for tuning eventing behavior.
1624
+
1625
+
1626
+ """
1627
+ ...
1628
+
1629
+ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1630
+ """
1631
+ Specifies what flows belong to the same project.
1632
+
1633
+ A project-specific namespace is created for all flows that
1634
+ use the same `@project(name)`.
1635
+
1636
+ Parameters
1637
+ ----------
1638
+ name : str
1639
+ Project name. Make sure that the name is unique amongst all
1640
+ projects that use the same production scheduler. The name may
1641
+ contain only lowercase alphanumeric characters and underscores.
1642
+
1643
+
1732
1644
  """
1733
1645
  ...
1734
1646
 
@@ -1827,6 +1739,94 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1827
1739
  """
1828
1740
  ...
1829
1741
 
1742
+ @typing.overload
1743
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1744
+ """
1745
+ Specifies the PyPI packages for all steps of the flow.
1746
+
1747
+ Use `@pypi_base` to set common packages required by all
1748
+ steps and use `@pypi` to specify step-specific overrides.
1749
+ Parameters
1750
+ ----------
1751
+ packages : Dict[str, str], default: {}
1752
+ Packages to use for this flow. The key is the name of the package
1753
+ and the value is the version to use.
1754
+ python : str, optional, default: None
1755
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1756
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1757
+ """
1758
+ ...
1759
+
1760
+ @typing.overload
1761
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1762
+ ...
1763
+
1764
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1765
+ """
1766
+ Specifies the PyPI packages for all steps of the flow.
1767
+
1768
+ Use `@pypi_base` to set common packages required by all
1769
+ steps and use `@pypi` to specify step-specific overrides.
1770
+ Parameters
1771
+ ----------
1772
+ packages : Dict[str, str], default: {}
1773
+ Packages to use for this flow. The key is the name of the package
1774
+ and the value is the version to use.
1775
+ python : str, optional, default: None
1776
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1777
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1778
+ """
1779
+ ...
1780
+
1781
+ @typing.overload
1782
+ 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]]:
1783
+ """
1784
+ Specifies the times when the flow should be run when running on a
1785
+ production scheduler.
1786
+
1787
+ Parameters
1788
+ ----------
1789
+ hourly : bool, default False
1790
+ Run the workflow hourly.
1791
+ daily : bool, default True
1792
+ Run the workflow daily.
1793
+ weekly : bool, default False
1794
+ Run the workflow weekly.
1795
+ cron : str, optional, default None
1796
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1797
+ specified by this expression.
1798
+ timezone : str, optional, default None
1799
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1800
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1801
+ """
1802
+ ...
1803
+
1804
+ @typing.overload
1805
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1806
+ ...
1807
+
1808
+ 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):
1809
+ """
1810
+ Specifies the times when the flow should be run when running on a
1811
+ production scheduler.
1812
+
1813
+ Parameters
1814
+ ----------
1815
+ hourly : bool, default False
1816
+ Run the workflow hourly.
1817
+ daily : bool, default True
1818
+ Run the workflow daily.
1819
+ weekly : bool, default False
1820
+ Run the workflow weekly.
1821
+ cron : str, optional, default None
1822
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1823
+ specified by this expression.
1824
+ timezone : str, optional, default None
1825
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1826
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1827
+ """
1828
+ ...
1829
+
1830
1830
  def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
1831
1831
  """
1832
1832
  Switch namespace to the one provided.