ob-metaflow-stubs 4.4__py2.py3-none-any.whl → 4.5__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 +471 -471
  2. metaflow-stubs/cards.pyi +3 -3
  3. metaflow-stubs/cli.pyi +1 -1
  4. metaflow-stubs/client/__init__.pyi +3 -3
  5. metaflow-stubs/client/core.pyi +5 -5
  6. metaflow-stubs/client/filecache.pyi +2 -2
  7. metaflow-stubs/clone_util.pyi +1 -1
  8. metaflow-stubs/events.pyi +2 -2
  9. metaflow-stubs/exception.pyi +1 -1
  10. metaflow-stubs/flowspec.pyi +4 -4
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +4 -4
  13. metaflow-stubs/metadata/metadata.pyi +2 -2
  14. metaflow-stubs/metadata/util.pyi +1 -1
  15. metaflow-stubs/metaflow_config.pyi +1 -1
  16. metaflow-stubs/metaflow_current.pyi +2 -2
  17. metaflow-stubs/mflog/mflog.pyi +1 -1
  18. metaflow-stubs/multicore_utils.pyi +1 -1
  19. metaflow-stubs/parameters.pyi +2 -2
  20. metaflow-stubs/plugins/__init__.pyi +1 -1
  21. metaflow-stubs/plugins/airflow/__init__.pyi +1 -1
  22. metaflow-stubs/plugins/airflow/airflow.pyi +2 -2
  23. metaflow-stubs/plugins/airflow/airflow_cli.pyi +2 -2
  24. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +1 -1
  25. metaflow-stubs/plugins/airflow/airflow_utils.pyi +1 -1
  26. metaflow-stubs/plugins/airflow/exception.pyi +1 -1
  27. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +1 -1
  28. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  29. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
  30. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
  31. metaflow-stubs/plugins/argo/__init__.pyi +1 -1
  32. metaflow-stubs/plugins/argo/argo_client.pyi +1 -1
  33. metaflow-stubs/plugins/argo/argo_events.pyi +1 -1
  34. metaflow-stubs/plugins/argo/argo_workflows.pyi +2 -2
  35. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +2 -2
  36. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +1 -1
  37. metaflow-stubs/plugins/aws/__init__.pyi +1 -1
  38. metaflow-stubs/plugins/aws/aws_client.pyi +1 -1
  39. metaflow-stubs/plugins/aws/aws_utils.pyi +1 -1
  40. metaflow-stubs/plugins/aws/batch/__init__.pyi +1 -1
  41. metaflow-stubs/plugins/aws/batch/batch.pyi +1 -1
  42. metaflow-stubs/plugins/aws/batch/batch_cli.pyi +1 -1
  43. metaflow-stubs/plugins/aws/batch/batch_client.pyi +1 -1
  44. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  45. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +1 -1
  46. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +2 -2
  47. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +1 -1
  48. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +1 -1
  49. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +1 -1
  50. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +1 -1
  51. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +1 -1
  52. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +1 -1
  53. metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +2 -2
  54. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +1 -1
  55. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +1 -1
  56. metaflow-stubs/plugins/azure/__init__.pyi +1 -1
  57. metaflow-stubs/plugins/azure/azure_credential.pyi +1 -1
  58. metaflow-stubs/plugins/azure/azure_exceptions.pyi +1 -1
  59. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +2 -2
  60. metaflow-stubs/plugins/azure/azure_utils.pyi +1 -1
  61. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +1 -1
  62. metaflow-stubs/plugins/azure/includefile_support.pyi +1 -1
  63. metaflow-stubs/plugins/cards/__init__.pyi +1 -1
  64. metaflow-stubs/plugins/cards/card_cli.pyi +4 -4
  65. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  66. metaflow-stubs/plugins/cards/card_creator.pyi +1 -1
  67. metaflow-stubs/plugins/cards/card_datastore.pyi +1 -1
  68. metaflow-stubs/plugins/cards/card_decorator.pyi +1 -1
  69. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +1 -1
  70. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  71. metaflow-stubs/plugins/cards/card_modules/card.pyi +1 -1
  72. metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +1 -1
  73. metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +1 -1
  74. metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +1 -1
  75. metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +1 -1
  76. metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +1 -1
  77. metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
  78. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +1 -1
  79. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +1 -1
  80. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  81. metaflow-stubs/plugins/cards/card_resolver.pyi +1 -1
  82. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  83. metaflow-stubs/plugins/cards/exception.pyi +1 -1
  84. metaflow-stubs/plugins/catch_decorator.pyi +2 -2
  85. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  86. metaflow-stubs/plugins/datatools/local.pyi +1 -1
  87. metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
  88. metaflow-stubs/plugins/datatools/s3/s3.pyi +5 -5
  89. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +1 -1
  90. metaflow-stubs/plugins/datatools/s3/s3util.pyi +1 -1
  91. metaflow-stubs/plugins/debug_logger.pyi +1 -1
  92. metaflow-stubs/plugins/debug_monitor.pyi +1 -1
  93. metaflow-stubs/plugins/environment_decorator.pyi +1 -1
  94. metaflow-stubs/plugins/events_decorator.pyi +1 -1
  95. metaflow-stubs/plugins/frameworks/__init__.pyi +1 -1
  96. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  97. metaflow-stubs/plugins/gcp/__init__.pyi +1 -1
  98. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +2 -2
  99. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +1 -1
  100. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +1 -1
  101. metaflow-stubs/plugins/gcp/gs_utils.pyi +1 -1
  102. metaflow-stubs/plugins/gcp/includefile_support.pyi +1 -1
  103. metaflow-stubs/plugins/kubernetes/__init__.pyi +1 -1
  104. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +1 -1
  105. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +2 -2
  106. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +1 -1
  107. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
  108. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +1 -1
  109. metaflow-stubs/plugins/logs_cli.pyi +3 -3
  110. metaflow-stubs/plugins/package_cli.pyi +1 -1
  111. metaflow-stubs/plugins/parallel_decorator.pyi +1 -1
  112. metaflow-stubs/plugins/perimeters.pyi +1 -1
  113. metaflow-stubs/plugins/project_decorator.pyi +1 -1
  114. metaflow-stubs/plugins/pypi/__init__.pyi +1 -1
  115. metaflow-stubs/plugins/pypi/conda_decorator.pyi +1 -1
  116. metaflow-stubs/plugins/pypi/conda_environment.pyi +3 -3
  117. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +1 -1
  118. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  119. metaflow-stubs/plugins/pypi/utils.pyi +1 -1
  120. metaflow-stubs/plugins/resources_decorator.pyi +1 -1
  121. metaflow-stubs/plugins/retry_decorator.pyi +1 -1
  122. metaflow-stubs/plugins/secrets/__init__.pyi +1 -1
  123. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
  124. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +1 -1
  125. metaflow-stubs/plugins/storage_executor.pyi +1 -1
  126. metaflow-stubs/plugins/tag_cli.pyi +3 -3
  127. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  128. metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
  129. metaflow-stubs/procpoll.pyi +1 -1
  130. metaflow-stubs/profilers/__init__.pyi +1 -1
  131. metaflow-stubs/pylint_wrapper.pyi +1 -1
  132. metaflow-stubs/runner/__init__.pyi +1 -1
  133. metaflow-stubs/runner/metaflow_runner.pyi +2 -2
  134. metaflow-stubs/runner/nbrun.pyi +1 -1
  135. metaflow-stubs/runner/subprocess_manager.pyi +1 -1
  136. metaflow-stubs/system/__init__.pyi +3 -3
  137. metaflow-stubs/system/system_logger.pyi +2 -2
  138. metaflow-stubs/system/system_monitor.pyi +2 -2
  139. metaflow-stubs/tagging_util.pyi +1 -1
  140. metaflow-stubs/tuple_util.pyi +1 -1
  141. {ob_metaflow_stubs-4.4.dist-info → ob_metaflow_stubs-4.5.dist-info}/METADATA +1 -1
  142. ob_metaflow_stubs-4.5.dist-info/RECORD +145 -0
  143. ob_metaflow_stubs-4.4.dist-info/RECORD +0 -145
  144. {ob_metaflow_stubs-4.4.dist-info → ob_metaflow_stubs-4.5.dist-info}/WHEEL +0 -0
  145. {ob_metaflow_stubs-4.4.dist-info → ob_metaflow_stubs-4.5.dist-info}/top_level.txt +0 -0
@@ -1,25 +1,25 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.7.1+ob(v1) #
4
- # Generated on 2024-07-11T17:01:16.236498 #
4
+ # Generated on 2024-07-12T00:19:39.735632 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
- import metaflow.events
12
- import metaflow.client.core
13
- import typing
14
11
  import metaflow.flowspec
15
12
  import metaflow.plugins.datatools.s3.s3
16
- import metaflow.parameters
13
+ import typing
14
+ import metaflow.events
15
+ import metaflow.metaflow_current
16
+ import metaflow.client.core
17
17
  import metaflow.runner.metaflow_runner
18
- import io
19
18
  import metaflow._vendor.click.types
20
- import datetime
21
19
  import metaflow.datastore.inputs
22
- import metaflow.metaflow_current
20
+ import datetime
21
+ import io
22
+ import metaflow.parameters
23
23
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
24
24
  StepFlag = typing.NewType("StepFlag", bool)
25
25
 
@@ -728,116 +728,82 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
728
728
  ...
729
729
 
730
730
  @typing.overload
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]]]:
731
+ def catch(*, var: typing.Optional[str] = None, print_exception: bool = True) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
732
732
  """
733
- Specifies the Conda environment for the step.
733
+ Specifies that the step will success under all circumstances.
734
734
 
735
- Information in this decorator will augment any
736
- attributes set in the `@conda_base` flow-level decorator. Hence,
737
- you can use `@conda_base` to set packages required by all
738
- steps and use `@conda` to specify step-specific overrides.
735
+ The decorator will create an optional artifact, specified by `var`, which
736
+ contains the exception raised. You can use it to detect the presence
737
+ of errors, indicating that all happy-path artifacts produced by the step
738
+ are missing.
739
739
 
740
740
  Parameters
741
741
  ----------
742
- 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
- libraries : Dict[str, str], default {}
746
- Supported for backward compatibility. When used with packages, packages will take precedence.
747
- python : str, optional, default None
748
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
749
- that the version used will correspond to the version of the Python interpreter used to start the run.
750
- disabled : bool, default False
751
- If set to True, disables @conda.
742
+ var : str, optional, default None
743
+ Name of the artifact in which to store the caught exception.
744
+ If not specified, the exception is not stored.
745
+ print_exception : bool, default True
746
+ Determines whether or not the exception is printed to
747
+ stdout when caught.
752
748
  """
753
749
  ...
754
750
 
755
751
  @typing.overload
756
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
752
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
757
753
  ...
758
754
 
759
755
  @typing.overload
760
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
756
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
761
757
  ...
762
758
 
763
- def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
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):
764
760
  """
765
- Specifies the Conda environment for the step.
761
+ Specifies that the step will success under all circumstances.
766
762
 
767
- Information in this decorator will augment any
768
- attributes set in the `@conda_base` flow-level decorator. Hence,
769
- you can use `@conda_base` to set packages required by all
770
- steps and use `@conda` to specify step-specific overrides.
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.
771
767
 
772
768
  Parameters
773
769
  ----------
774
- packages : Dict[str, str], default {}
775
- Packages to use for this step. The key is the name of the package
776
- and the value is the version to use.
777
- libraries : Dict[str, str], default {}
778
- Supported for backward compatibility. When used with packages, packages will take precedence.
779
- python : str, optional, default None
780
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
781
- that the version used will correspond to the version of the Python interpreter used to start the run.
782
- disabled : bool, default False
783
- If set to True, disables @conda.
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.
784
776
  """
785
777
  ...
786
778
 
787
779
  @typing.overload
788
- 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]]]:
780
+ 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]]]:
789
781
  """
790
- Specifies a timeout for your step.
791
-
792
- This decorator is useful if this step may hang indefinitely.
793
-
794
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
795
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
796
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
797
-
798
- Note that all the values specified in parameters are added together so if you specify
799
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
782
+ Specifies environment variables to be set prior to the execution of a step.
800
783
 
801
784
  Parameters
802
785
  ----------
803
- seconds : int, default 0
804
- Number of seconds to wait prior to timing out.
805
- minutes : int, default 0
806
- Number of minutes to wait prior to timing out.
807
- hours : int, default 0
808
- Number of hours to wait prior to timing out.
786
+ vars : Dict[str, str], default {}
787
+ Dictionary of environment variables to set.
809
788
  """
810
789
  ...
811
790
 
812
791
  @typing.overload
813
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
792
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
814
793
  ...
815
794
 
816
795
  @typing.overload
817
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
796
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
818
797
  ...
819
798
 
820
- 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):
799
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
821
800
  """
822
- Specifies a timeout for your step.
823
-
824
- This decorator is useful if this step may hang indefinitely.
825
-
826
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
827
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
828
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
829
-
830
- Note that all the values specified in parameters are added together so if you specify
831
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
801
+ Specifies environment variables to be set prior to the execution of a step.
832
802
 
833
803
  Parameters
834
804
  ----------
835
- seconds : int, default 0
836
- Number of seconds to wait prior to timing out.
837
- minutes : int, default 0
838
- Number of minutes to wait prior to timing out.
839
- hours : int, default 0
840
- Number of hours to wait prior to timing out.
805
+ vars : Dict[str, str], default {}
806
+ Dictionary of environment variables to set.
841
807
  """
842
808
  ...
843
809
 
@@ -875,127 +841,304 @@ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
875
841
  ...
876
842
 
877
843
  @typing.overload
878
- 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]]]:
844
+ 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]]]:
879
845
  """
880
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
846
+ Specifies the resources needed when executing this step.
847
+
848
+ Use `@resources` to specify the resource requirements
849
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
850
+
851
+ You can choose the compute layer on the command line by executing e.g.
852
+ ```
853
+ python myflow.py run --with batch
854
+ ```
855
+ or
856
+ ```
857
+ python myflow.py run --with kubernetes
858
+ ```
859
+ which executes the flow on the desired system using the
860
+ requirements specified in `@resources`.
881
861
 
882
862
  Parameters
883
863
  ----------
884
864
  cpu : int, default 1
885
- Number of CPUs required for this step. If `@resources` is
886
- also present, the maximum value from all decorators is used.
865
+ Number of CPUs required for this step.
887
866
  gpu : int, default 0
888
- Number of GPUs required for this step. If `@resources` is
889
- also present, the maximum value from all decorators is used.
867
+ Number of GPUs required for this step.
868
+ disk : int, optional, default None
869
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
890
870
  memory : int, default 4096
891
- Memory size (in MB) required for this step. If
892
- `@resources` is also present, the maximum value from all decorators is
893
- used.
894
- image : str, optional, default None
895
- Docker image to use when launching on AWS Batch. If not specified, and
896
- METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
897
- not, a default Docker image mapping to the current version of Python is used.
898
- queue : str, default METAFLOW_BATCH_JOB_QUEUE
899
- AWS Batch Job Queue to submit the job to.
900
- iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
901
- AWS IAM role that AWS Batch container uses to access AWS cloud resources.
902
- execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
903
- AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
904
- (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
871
+ Memory size (in MB) required for this step.
905
872
  shared_memory : int, optional, default None
906
873
  The value for the size (in MiB) of the /dev/shm volume for this step.
907
874
  This parameter maps to the `--shm-size` option in Docker.
908
- max_swap : int, optional, default None
909
- The total amount of swap memory (in MiB) a container can use for this
910
- step. This parameter is translated to the `--memory-swap` option in
911
- Docker where the value is the sum of the container memory plus the
912
- `max_swap` value.
913
- swappiness : int, optional, default None
914
- This allows you to tune memory swappiness behavior for this step.
915
- A swappiness value of 0 causes swapping not to happen unless absolutely
916
- necessary. A swappiness value of 100 causes pages to be swapped very
917
- aggressively. Accepted values are whole numbers between 0 and 100.
918
- use_tmpfs : bool, default False
919
- This enables an explicit tmpfs mount for this step. Note that tmpfs is
920
- not available on Fargate compute environments
921
- tmpfs_tempdir : bool, default True
922
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
923
- tmpfs_size : int, optional, default None
924
- The value for the size (in MiB) of the tmpfs mount for this step.
925
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
926
- memory allocated for this step.
927
- tmpfs_path : str, optional, default None
928
- Path to tmpfs mount for this step. Defaults to /metaflow_temp.
929
- inferentia : int, default 0
930
- Number of Inferentia chips required for this step.
931
- trainium : int, default None
932
- Alias for inferentia. Use only one of the two.
933
- efa : int, default 0
934
- Number of elastic fabric adapter network devices to attach to container
935
- ephemeral_storage : int, default None
936
- The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
937
- This is only relevant for Fargate compute environments
938
- log_driver: str, optional, default None
939
- The log driver to use for the Amazon ECS container.
940
- log_options: List[str], optional, default None
941
- List of strings containing options for the chosen log driver. The configurable values
942
- depend on the `log driver` chosen. Validation of these options is not supported yet.
943
- Example: [`awslogs-group:aws/batch/job`]
944
875
  """
945
876
  ...
946
877
 
947
878
  @typing.overload
948
- def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
879
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
949
880
  ...
950
881
 
951
882
  @typing.overload
952
- def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
883
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
953
884
  ...
954
885
 
955
- 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):
886
+ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
956
887
  """
957
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
888
+ Specifies the resources needed when executing this step.
889
+
890
+ Use `@resources` to specify the resource requirements
891
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
892
+
893
+ You can choose the compute layer on the command line by executing e.g.
894
+ ```
895
+ python myflow.py run --with batch
896
+ ```
897
+ or
898
+ ```
899
+ python myflow.py run --with kubernetes
900
+ ```
901
+ which executes the flow on the desired system using the
902
+ requirements specified in `@resources`.
958
903
 
959
904
  Parameters
960
905
  ----------
961
906
  cpu : int, default 1
962
- Number of CPUs required for this step. If `@resources` is
963
- also present, the maximum value from all decorators is used.
907
+ Number of CPUs required for this step.
964
908
  gpu : int, default 0
965
- Number of GPUs required for this step. If `@resources` is
966
- also present, the maximum value from all decorators is used.
909
+ Number of GPUs required for this step.
910
+ disk : int, optional, default None
911
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
967
912
  memory : int, default 4096
968
- Memory size (in MB) required for this step. If
969
- `@resources` is also present, the maximum value from all decorators is
970
- used.
971
- image : str, optional, default None
972
- Docker image to use when launching on AWS Batch. If not specified, and
973
- METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
974
- not, a default Docker image mapping to the current version of Python is used.
975
- queue : str, default METAFLOW_BATCH_JOB_QUEUE
976
- AWS Batch Job Queue to submit the job to.
977
- iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
978
- AWS IAM role that AWS Batch container uses to access AWS cloud resources.
979
- execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
980
- AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
981
- (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
913
+ Memory size (in MB) required for this step.
982
914
  shared_memory : int, optional, default None
983
915
  The value for the size (in MiB) of the /dev/shm volume for this step.
984
916
  This parameter maps to the `--shm-size` option in Docker.
985
- max_swap : int, optional, default None
986
- The total amount of swap memory (in MiB) a container can use for this
987
- step. This parameter is translated to the `--memory-swap` option in
988
- Docker where the value is the sum of the container memory plus the
989
- `max_swap` value.
990
- swappiness : int, optional, default None
991
- This allows you to tune memory swappiness behavior for this step.
992
- A swappiness value of 0 causes swapping not to happen unless absolutely
993
- necessary. A swappiness value of 100 causes pages to be swapped very
994
- aggressively. Accepted values are whole numbers between 0 and 100.
995
- use_tmpfs : bool, default False
996
- This enables an explicit tmpfs mount for this step. Note that tmpfs is
997
- not available on Fargate compute environments
998
- tmpfs_tempdir : bool, default True
917
+ """
918
+ ...
919
+
920
+ @typing.overload
921
+ 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]]]:
922
+ """
923
+ Creates a human-readable report, a Metaflow Card, after this step completes.
924
+
925
+ Note that you may add multiple `@card` decorators in a step with different parameters.
926
+
927
+ Parameters
928
+ ----------
929
+ type : str, default 'default'
930
+ Card type.
931
+ id : str, optional, default None
932
+ If multiple cards are present, use this id to identify this card.
933
+ options : Dict[str, Any], default {}
934
+ Options passed to the card. The contents depend on the card type.
935
+ timeout : int, default 45
936
+ Interrupt reporting if it takes more than this many seconds.
937
+
938
+
939
+ """
940
+ ...
941
+
942
+ @typing.overload
943
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
944
+ ...
945
+
946
+ @typing.overload
947
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
948
+ ...
949
+
950
+ 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):
951
+ """
952
+ Creates a human-readable report, a Metaflow Card, after this step completes.
953
+
954
+ Note that you may add multiple `@card` decorators in a step with different parameters.
955
+
956
+ Parameters
957
+ ----------
958
+ type : str, default 'default'
959
+ Card type.
960
+ id : str, optional, default None
961
+ If multiple cards are present, use this id to identify this card.
962
+ options : Dict[str, Any], default {}
963
+ Options passed to the card. The contents depend on the card type.
964
+ timeout : int, default 45
965
+ Interrupt reporting if it takes more than this many seconds.
966
+
967
+
968
+ """
969
+ ...
970
+
971
+ @typing.overload
972
+ 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]]]:
973
+ """
974
+ Specifies the PyPI packages for the step.
975
+
976
+ Information in this decorator will augment any
977
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
978
+ you can use `@pypi_base` to set packages required by all
979
+ steps and use `@pypi` to specify step-specific overrides.
980
+
981
+ Parameters
982
+ ----------
983
+ packages : Dict[str, str], default: {}
984
+ Packages to use for this step. The key is the name of the package
985
+ and the value is the version to use.
986
+ python : str, optional, default: None
987
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
988
+ that the version used will correspond to the version of the Python interpreter used to start the run.
989
+ """
990
+ ...
991
+
992
+ @typing.overload
993
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
994
+ ...
995
+
996
+ @typing.overload
997
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
998
+ ...
999
+
1000
+ 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):
1001
+ """
1002
+ Specifies the PyPI packages for the step.
1003
+
1004
+ Information in this decorator will augment any
1005
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
1006
+ you can use `@pypi_base` to set packages required by all
1007
+ steps and use `@pypi` to specify step-specific overrides.
1008
+
1009
+ Parameters
1010
+ ----------
1011
+ packages : Dict[str, str], default: {}
1012
+ Packages to use for this step. The key is the name of the package
1013
+ and the value is the version to use.
1014
+ python : str, optional, default: None
1015
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1016
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1017
+ """
1018
+ ...
1019
+
1020
+ @typing.overload
1021
+ 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]]]:
1022
+ """
1023
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
1024
+
1025
+ Parameters
1026
+ ----------
1027
+ cpu : int, default 1
1028
+ Number of CPUs required for this step. If `@resources` is
1029
+ also present, the maximum value from all decorators is used.
1030
+ gpu : int, default 0
1031
+ Number of GPUs required for this step. If `@resources` is
1032
+ also present, the maximum value from all decorators is used.
1033
+ memory : int, default 4096
1034
+ Memory size (in MB) required for this step. If
1035
+ `@resources` is also present, the maximum value from all decorators is
1036
+ used.
1037
+ image : str, optional, default None
1038
+ Docker image to use when launching on AWS Batch. If not specified, and
1039
+ METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
1040
+ not, a default Docker image mapping to the current version of Python is used.
1041
+ queue : str, default METAFLOW_BATCH_JOB_QUEUE
1042
+ AWS Batch Job Queue to submit the job to.
1043
+ iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
1044
+ AWS IAM role that AWS Batch container uses to access AWS cloud resources.
1045
+ execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
1046
+ AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
1047
+ (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
1048
+ shared_memory : int, optional, default None
1049
+ The value for the size (in MiB) of the /dev/shm volume for this step.
1050
+ This parameter maps to the `--shm-size` option in Docker.
1051
+ max_swap : int, optional, default None
1052
+ The total amount of swap memory (in MiB) a container can use for this
1053
+ step. This parameter is translated to the `--memory-swap` option in
1054
+ Docker where the value is the sum of the container memory plus the
1055
+ `max_swap` value.
1056
+ swappiness : int, optional, default None
1057
+ This allows you to tune memory swappiness behavior for this step.
1058
+ A swappiness value of 0 causes swapping not to happen unless absolutely
1059
+ necessary. A swappiness value of 100 causes pages to be swapped very
1060
+ aggressively. Accepted values are whole numbers between 0 and 100.
1061
+ use_tmpfs : bool, default False
1062
+ This enables an explicit tmpfs mount for this step. Note that tmpfs is
1063
+ not available on Fargate compute environments
1064
+ tmpfs_tempdir : bool, default True
1065
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
1066
+ tmpfs_size : int, optional, default None
1067
+ The value for the size (in MiB) of the tmpfs mount for this step.
1068
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
1069
+ memory allocated for this step.
1070
+ tmpfs_path : str, optional, default None
1071
+ Path to tmpfs mount for this step. Defaults to /metaflow_temp.
1072
+ inferentia : int, default 0
1073
+ Number of Inferentia chips required for this step.
1074
+ trainium : int, default None
1075
+ Alias for inferentia. Use only one of the two.
1076
+ efa : int, default 0
1077
+ Number of elastic fabric adapter network devices to attach to container
1078
+ ephemeral_storage : int, default None
1079
+ The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
1080
+ This is only relevant for Fargate compute environments
1081
+ log_driver: str, optional, default None
1082
+ The log driver to use for the Amazon ECS container.
1083
+ log_options: List[str], optional, default None
1084
+ List of strings containing options for the chosen log driver. The configurable values
1085
+ depend on the `log driver` chosen. Validation of these options is not supported yet.
1086
+ Example: [`awslogs-group:aws/batch/job`]
1087
+ """
1088
+ ...
1089
+
1090
+ @typing.overload
1091
+ def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1092
+ ...
1093
+
1094
+ @typing.overload
1095
+ def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1096
+ ...
1097
+
1098
+ 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):
1099
+ """
1100
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
1101
+
1102
+ Parameters
1103
+ ----------
1104
+ cpu : int, default 1
1105
+ Number of CPUs required for this step. If `@resources` is
1106
+ also present, the maximum value from all decorators is used.
1107
+ gpu : int, default 0
1108
+ Number of GPUs required for this step. If `@resources` is
1109
+ also present, the maximum value from all decorators is used.
1110
+ memory : int, default 4096
1111
+ Memory size (in MB) required for this step. If
1112
+ `@resources` is also present, the maximum value from all decorators is
1113
+ used.
1114
+ image : str, optional, default None
1115
+ Docker image to use when launching on AWS Batch. If not specified, and
1116
+ METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
1117
+ not, a default Docker image mapping to the current version of Python is used.
1118
+ queue : str, default METAFLOW_BATCH_JOB_QUEUE
1119
+ AWS Batch Job Queue to submit the job to.
1120
+ iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
1121
+ AWS IAM role that AWS Batch container uses to access AWS cloud resources.
1122
+ execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
1123
+ AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
1124
+ (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
1125
+ shared_memory : int, optional, default None
1126
+ The value for the size (in MiB) of the /dev/shm volume for this step.
1127
+ This parameter maps to the `--shm-size` option in Docker.
1128
+ max_swap : int, optional, default None
1129
+ The total amount of swap memory (in MiB) a container can use for this
1130
+ step. This parameter is translated to the `--memory-swap` option in
1131
+ Docker where the value is the sum of the container memory plus the
1132
+ `max_swap` value.
1133
+ swappiness : int, optional, default None
1134
+ This allows you to tune memory swappiness behavior for this step.
1135
+ A swappiness value of 0 causes swapping not to happen unless absolutely
1136
+ necessary. A swappiness value of 100 causes pages to be swapped very
1137
+ aggressively. Accepted values are whole numbers between 0 and 100.
1138
+ use_tmpfs : bool, default False
1139
+ This enables an explicit tmpfs mount for this step. Note that tmpfs is
1140
+ not available on Fargate compute environments
1141
+ tmpfs_tempdir : bool, default True
999
1142
  sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
1000
1143
  tmpfs_size : int, optional, default None
1001
1144
  The value for the size (in MiB) of the tmpfs mount for this step.
@@ -1081,210 +1224,59 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
1081
1224
  ...
1082
1225
 
1083
1226
  @typing.overload
1084
- 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]]]:
1085
- """
1086
- Specifies environment variables to be set prior to the execution of a step.
1087
-
1088
- Parameters
1089
- ----------
1090
- vars : Dict[str, str], default {}
1091
- Dictionary of environment variables to set.
1092
- """
1093
- ...
1094
-
1095
- @typing.overload
1096
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1097
- ...
1098
-
1099
- @typing.overload
1100
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1101
- ...
1102
-
1103
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
1104
- """
1105
- Specifies environment variables to be set prior to the execution of a step.
1106
-
1107
- Parameters
1108
- ----------
1109
- vars : Dict[str, str], default {}
1110
- Dictionary of environment variables to set.
1111
- """
1112
- ...
1113
-
1114
- @typing.overload
1115
- 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]]]:
1116
- """
1117
- Specifies the resources needed when executing this step.
1118
-
1119
- Use `@resources` to specify the resource requirements
1120
- independently of the specific compute layer (`@batch`, `@kubernetes`).
1121
-
1122
- You can choose the compute layer on the command line by executing e.g.
1123
- ```
1124
- python myflow.py run --with batch
1125
- ```
1126
- or
1127
- ```
1128
- python myflow.py run --with kubernetes
1129
- ```
1130
- which executes the flow on the desired system using the
1131
- requirements specified in `@resources`.
1132
-
1133
- Parameters
1134
- ----------
1135
- cpu : int, default 1
1136
- Number of CPUs required for this step.
1137
- gpu : int, default 0
1138
- Number of GPUs required for this step.
1139
- disk : int, optional, default None
1140
- Disk size (in MB) required for this step. Only applies on Kubernetes.
1141
- memory : int, default 4096
1142
- Memory size (in MB) required for this step.
1143
- shared_memory : int, optional, default None
1144
- The value for the size (in MiB) of the /dev/shm volume for this step.
1145
- This parameter maps to the `--shm-size` option in Docker.
1146
- """
1147
- ...
1148
-
1149
- @typing.overload
1150
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1151
- ...
1152
-
1153
- @typing.overload
1154
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1155
- ...
1156
-
1157
- def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
1158
- """
1159
- Specifies the resources needed when executing this step.
1160
-
1161
- Use `@resources` to specify the resource requirements
1162
- independently of the specific compute layer (`@batch`, `@kubernetes`).
1163
-
1164
- You can choose the compute layer on the command line by executing e.g.
1165
- ```
1166
- python myflow.py run --with batch
1167
- ```
1168
- or
1169
- ```
1170
- python myflow.py run --with kubernetes
1171
- ```
1172
- which executes the flow on the desired system using the
1173
- requirements specified in `@resources`.
1174
-
1175
- Parameters
1176
- ----------
1177
- cpu : int, default 1
1178
- Number of CPUs required for this step.
1179
- gpu : int, default 0
1180
- Number of GPUs required for this step.
1181
- disk : int, optional, default None
1182
- Disk size (in MB) required for this step. Only applies on Kubernetes.
1183
- memory : int, default 4096
1184
- Memory size (in MB) required for this step.
1185
- shared_memory : int, optional, default None
1186
- The value for the size (in MiB) of the /dev/shm volume for this step.
1187
- This parameter maps to the `--shm-size` option in Docker.
1188
- """
1189
- ...
1190
-
1191
- @typing.overload
1192
- 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]]]:
1193
- """
1194
- Specifies that the step will success under all circumstances.
1195
-
1196
- The decorator will create an optional artifact, specified by `var`, which
1197
- contains the exception raised. You can use it to detect the presence
1198
- of errors, indicating that all happy-path artifacts produced by the step
1199
- are missing.
1200
-
1201
- Parameters
1202
- ----------
1203
- var : str, optional, default None
1204
- Name of the artifact in which to store the caught exception.
1205
- If not specified, the exception is not stored.
1206
- print_exception : bool, default True
1207
- Determines whether or not the exception is printed to
1208
- stdout when caught.
1209
- """
1210
- ...
1211
-
1212
- @typing.overload
1213
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1214
- ...
1215
-
1216
- @typing.overload
1217
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1218
- ...
1219
-
1220
- 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):
1227
+ 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]]]:
1221
1228
  """
1222
- Specifies that the step will success under all circumstances.
1229
+ Specifies a timeout for your step.
1223
1230
 
1224
- The decorator will create an optional artifact, specified by `var`, which
1225
- contains the exception raised. You can use it to detect the presence
1226
- of errors, indicating that all happy-path artifacts produced by the step
1227
- are missing.
1231
+ This decorator is useful if this step may hang indefinitely.
1228
1232
 
1229
- Parameters
1230
- ----------
1231
- var : str, optional, default None
1232
- Name of the artifact in which to store the caught exception.
1233
- If not specified, the exception is not stored.
1234
- print_exception : bool, default True
1235
- Determines whether or not the exception is printed to
1236
- stdout when caught.
1237
- """
1238
- ...
1239
-
1240
- @typing.overload
1241
- 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]]]:
1242
- """
1243
- Creates a human-readable report, a Metaflow Card, after this step completes.
1233
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1234
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
1235
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
1244
1236
 
1245
- Note that you may add multiple `@card` decorators in a step with different parameters.
1237
+ Note that all the values specified in parameters are added together so if you specify
1238
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1246
1239
 
1247
1240
  Parameters
1248
1241
  ----------
1249
- type : str, default 'default'
1250
- Card type.
1251
- id : str, optional, default None
1252
- If multiple cards are present, use this id to identify this card.
1253
- options : Dict[str, Any], default {}
1254
- Options passed to the card. The contents depend on the card type.
1255
- timeout : int, default 45
1256
- Interrupt reporting if it takes more than this many seconds.
1257
-
1258
-
1242
+ seconds : int, default 0
1243
+ Number of seconds to wait prior to timing out.
1244
+ minutes : int, default 0
1245
+ Number of minutes to wait prior to timing out.
1246
+ hours : int, default 0
1247
+ Number of hours to wait prior to timing out.
1259
1248
  """
1260
1249
  ...
1261
1250
 
1262
1251
  @typing.overload
1263
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1252
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1264
1253
  ...
1265
1254
 
1266
1255
  @typing.overload
1267
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1256
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1268
1257
  ...
1269
1258
 
1270
- 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):
1259
+ 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):
1271
1260
  """
1272
- Creates a human-readable report, a Metaflow Card, after this step completes.
1261
+ Specifies a timeout for your step.
1273
1262
 
1274
- Note that you may add multiple `@card` decorators in a step with different parameters.
1263
+ This decorator is useful if this step may hang indefinitely.
1275
1264
 
1276
- Parameters
1277
- ----------
1278
- type : str, default 'default'
1279
- Card type.
1280
- id : str, optional, default None
1281
- If multiple cards are present, use this id to identify this card.
1282
- options : Dict[str, Any], default {}
1283
- Options passed to the card. The contents depend on the card type.
1284
- timeout : int, default 45
1285
- Interrupt reporting if it takes more than this many seconds.
1265
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1266
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
1267
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
1286
1268
 
1269
+ Note that all the values specified in parameters are added together so if you specify
1270
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1287
1271
 
1272
+ Parameters
1273
+ ----------
1274
+ seconds : int, default 0
1275
+ Number of seconds to wait prior to timing out.
1276
+ minutes : int, default 0
1277
+ Number of minutes to wait prior to timing out.
1278
+ hours : int, default 0
1279
+ Number of hours to wait prior to timing out.
1288
1280
  """
1289
1281
  ...
1290
1282
 
@@ -1342,123 +1334,19 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
1342
1334
  ...
1343
1335
 
1344
1336
  @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]]]:
1346
- """
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.
1353
-
1354
- Parameters
1355
- ----------
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.
1362
- """
1363
- ...
1364
-
1365
- @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):
1337
+ 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]]]:
1374
1338
  """
1375
- Specifies the PyPI packages for the step.
1339
+ Specifies the Conda environment for the step.
1376
1340
 
1377
1341
  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.
1381
-
1382
- Parameters
1383
- ----------
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.
1390
- """
1391
- ...
1392
-
1393
- @typing.overload
1394
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1395
- """
1396
- Specifies the PyPI packages for all steps of the flow.
1397
-
1398
- Use `@pypi_base` to set common packages required by all
1399
- steps and use `@pypi` to specify step-specific overrides.
1400
- Parameters
1401
- ----------
1402
- packages : Dict[str, str], default: {}
1403
- Packages to use for this flow. The key is the name of the package
1404
- and the value is the version to use.
1405
- python : str, optional, default: None
1406
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1407
- that the version used will correspond to the version of the Python interpreter used to start the run.
1408
- """
1409
- ...
1410
-
1411
- @typing.overload
1412
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1413
- ...
1414
-
1415
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1416
- """
1417
- Specifies the PyPI packages for all steps of the flow.
1418
-
1419
- Use `@pypi_base` to set common packages required by all
1420
- steps and use `@pypi` to specify step-specific overrides.
1421
- Parameters
1422
- ----------
1423
- packages : Dict[str, str], default: {}
1424
- Packages to use for this flow. The key is the name of the package
1425
- and the value is the version to use.
1426
- python : str, optional, default: None
1427
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1428
- that the version used will correspond to the version of the Python interpreter used to start the run.
1429
- """
1430
- ...
1431
-
1432
- def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1433
- """
1434
- Specifies what flows belong to the same project.
1435
-
1436
- A project-specific namespace is created for all flows that
1437
- use the same `@project(name)`.
1438
-
1439
- Parameters
1440
- ----------
1441
- name : str
1442
- Project name. Make sure that the name is unique amongst all
1443
- projects that use the same production scheduler. The name may
1444
- contain only lowercase alphanumeric characters and underscores.
1445
-
1446
-
1447
- """
1448
- ...
1449
-
1450
- @typing.overload
1451
- 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]]:
1452
- """
1453
- Specifies the Conda environment for all steps of the flow.
1454
-
1455
- Use `@conda_base` to set common libraries required by all
1456
- steps and use `@conda` to specify step-specific additions.
1342
+ attributes set in the `@conda_base` flow-level decorator. Hence,
1343
+ you can use `@conda_base` to set packages required by all
1344
+ steps and use `@conda` to specify step-specific overrides.
1457
1345
 
1458
1346
  Parameters
1459
1347
  ----------
1460
1348
  packages : Dict[str, str], default {}
1461
- Packages to use for this flow. The key is the name of the package
1349
+ Packages to use for this step. The key is the name of the package
1462
1350
  and the value is the version to use.
1463
1351
  libraries : Dict[str, str], default {}
1464
1352
  Supported for backward compatibility. When used with packages, packages will take precedence.
@@ -1466,25 +1354,31 @@ def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[s
1466
1354
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1467
1355
  that the version used will correspond to the version of the Python interpreter used to start the run.
1468
1356
  disabled : bool, default False
1469
- If set to True, disables Conda.
1357
+ If set to True, disables @conda.
1470
1358
  """
1471
1359
  ...
1472
1360
 
1473
1361
  @typing.overload
1474
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1362
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1475
1363
  ...
1476
1364
 
1477
- 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):
1365
+ @typing.overload
1366
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1367
+ ...
1368
+
1369
+ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
1478
1370
  """
1479
- Specifies the Conda environment for all steps of the flow.
1371
+ Specifies the Conda environment for the step.
1480
1372
 
1481
- Use `@conda_base` to set common libraries required by all
1482
- steps and use `@conda` to specify step-specific additions.
1373
+ Information in this decorator will augment any
1374
+ attributes set in the `@conda_base` flow-level decorator. Hence,
1375
+ you can use `@conda_base` to set packages required by all
1376
+ steps and use `@conda` to specify step-specific overrides.
1483
1377
 
1484
1378
  Parameters
1485
1379
  ----------
1486
1380
  packages : Dict[str, str], default {}
1487
- Packages to use for this flow. The key is the name of the package
1381
+ Packages to use for this step. The key is the name of the package
1488
1382
  and the value is the version to use.
1489
1383
  libraries : Dict[str, str], default {}
1490
1384
  Supported for backward compatibility. When used with packages, packages will take precedence.
@@ -1492,7 +1386,7 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
1492
1386
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1493
1387
  that the version used will correspond to the version of the Python interpreter used to start the run.
1494
1388
  disabled : bool, default False
1495
- If set to True, disables Conda.
1389
+ If set to True, disables @conda.
1496
1390
  """
1497
1391
  ...
1498
1392
 
@@ -1580,6 +1474,24 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
1580
1474
  """
1581
1475
  ...
1582
1476
 
1477
+ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1478
+ """
1479
+ Specifies what flows belong to the same project.
1480
+
1481
+ A project-specific namespace is created for all flows that
1482
+ use the same `@project(name)`.
1483
+
1484
+ Parameters
1485
+ ----------
1486
+ name : str
1487
+ Project name. Make sure that the name is unique amongst all
1488
+ projects that use the same production scheduler. The name may
1489
+ contain only lowercase alphanumeric characters and underscores.
1490
+
1491
+
1492
+ """
1493
+ ...
1494
+
1583
1495
  @typing.overload
1584
1496
  def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1585
1497
  """
@@ -1724,6 +1636,55 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
1724
1636
  """
1725
1637
  ...
1726
1638
 
1639
+ @typing.overload
1640
+ 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]]:
1641
+ """
1642
+ Specifies the Conda environment for all steps of the flow.
1643
+
1644
+ Use `@conda_base` to set common libraries required by all
1645
+ steps and use `@conda` to specify step-specific additions.
1646
+
1647
+ Parameters
1648
+ ----------
1649
+ packages : Dict[str, str], default {}
1650
+ Packages to use for this flow. The key is the name of the package
1651
+ and the value is the version to use.
1652
+ libraries : Dict[str, str], default {}
1653
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1654
+ python : str, optional, default None
1655
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1656
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1657
+ disabled : bool, default False
1658
+ If set to True, disables Conda.
1659
+ """
1660
+ ...
1661
+
1662
+ @typing.overload
1663
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1664
+ ...
1665
+
1666
+ 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):
1667
+ """
1668
+ Specifies the Conda environment for all steps of the flow.
1669
+
1670
+ Use `@conda_base` to set common libraries required by all
1671
+ steps and use `@conda` to specify step-specific additions.
1672
+
1673
+ Parameters
1674
+ ----------
1675
+ packages : Dict[str, str], default {}
1676
+ Packages to use for this flow. The key is the name of the package
1677
+ and the value is the version to use.
1678
+ libraries : Dict[str, str], default {}
1679
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1680
+ python : str, optional, default None
1681
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1682
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1683
+ disabled : bool, default False
1684
+ If set to True, disables Conda.
1685
+ """
1686
+ ...
1687
+
1727
1688
  def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1728
1689
  """
1729
1690
  This decorator is used to run NIM containers in Metaflow tasks as sidecars.
@@ -1755,6 +1716,45 @@ def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[Fl
1755
1716
  """
1756
1717
  ...
1757
1718
 
1719
+ @typing.overload
1720
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1721
+ """
1722
+ Specifies the PyPI packages for all steps of the flow.
1723
+
1724
+ Use `@pypi_base` to set common packages required by all
1725
+ steps and use `@pypi` to specify step-specific overrides.
1726
+ Parameters
1727
+ ----------
1728
+ packages : Dict[str, str], default: {}
1729
+ Packages to use for this flow. The key is the name of the package
1730
+ and the value is the version to use.
1731
+ python : str, optional, default: None
1732
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1733
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1734
+ """
1735
+ ...
1736
+
1737
+ @typing.overload
1738
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1739
+ ...
1740
+
1741
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1742
+ """
1743
+ Specifies the PyPI packages for all steps of the flow.
1744
+
1745
+ Use `@pypi_base` to set common packages required by all
1746
+ steps and use `@pypi` to specify step-specific overrides.
1747
+ Parameters
1748
+ ----------
1749
+ packages : Dict[str, str], default: {}
1750
+ Packages to use for this flow. The key is the name of the package
1751
+ and the value is the version to use.
1752
+ python : str, optional, default: None
1753
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1754
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1755
+ """
1756
+ ...
1757
+
1758
1758
  @typing.overload
1759
1759
  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]]:
1760
1760
  """