ob-metaflow-stubs 5.5__py2.py3-none-any.whl → 5.6__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. metaflow-stubs/__init__.pyi +511 -511
  2. metaflow-stubs/cards.pyi +5 -5
  3. metaflow-stubs/cli.pyi +3 -3
  4. metaflow-stubs/client/__init__.pyi +4 -4
  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 +4 -4
  13. metaflow-stubs/metadata/metadata.pyi +3 -3
  14. metaflow-stubs/metadata/util.pyi +2 -2
  15. metaflow-stubs/metaflow_config.pyi +2 -2
  16. metaflow-stubs/metaflow_current.pyi +36 -36
  17. metaflow-stubs/mflog/mflog.pyi +2 -2
  18. metaflow-stubs/multicore_utils.pyi +2 -2
  19. metaflow-stubs/parameters.pyi +4 -4
  20. metaflow-stubs/plugins/__init__.pyi +3 -3
  21. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  22. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  23. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  24. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  25. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +3 -3
  26. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +3 -3
  27. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +3 -3
  28. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  29. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  30. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  31. metaflow-stubs/plugins/argo/argo_workflows.pyi +5 -5
  32. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +7 -7
  33. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +6 -6
  34. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
  35. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  36. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  37. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  38. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  39. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  40. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  41. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  42. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  43. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
  44. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  45. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  46. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +2 -2
  47. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  48. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  49. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  50. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +3 -3
  51. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  52. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  53. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  54. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +4 -4
  55. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  56. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  57. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  58. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  59. metaflow-stubs/plugins/cards/card_cli.pyi +3 -3
  60. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  61. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  62. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  63. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  64. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  65. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  66. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  67. metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
  68. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  69. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  70. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  71. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  72. metaflow-stubs/plugins/cards/component_serializer.pyi +4 -4
  73. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  74. metaflow-stubs/plugins/catch_decorator.pyi +4 -4
  75. metaflow-stubs/plugins/datatools/__init__.pyi +3 -3
  76. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  77. metaflow-stubs/plugins/datatools/s3/__init__.pyi +3 -3
  78. metaflow-stubs/plugins/datatools/s3/s3.pyi +4 -4
  79. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  80. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  81. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  82. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  83. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  84. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  85. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  86. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  87. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  88. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +4 -4
  89. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  90. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  91. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  92. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  93. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  94. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +3 -3
  95. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +4 -4
  96. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  97. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
  98. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  99. metaflow-stubs/plugins/logs_cli.pyi +3 -3
  100. metaflow-stubs/plugins/package_cli.pyi +2 -2
  101. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  102. metaflow-stubs/plugins/perimeters.pyi +2 -2
  103. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  104. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  105. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  106. metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
  107. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  108. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  109. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  110. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  111. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  112. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  113. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
  114. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  115. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  116. metaflow-stubs/plugins/tag_cli.pyi +5 -5
  117. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  118. metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
  119. metaflow-stubs/procpoll.pyi +2 -2
  120. metaflow-stubs/profilers/__init__.pyi +2 -2
  121. metaflow-stubs/pylint_wrapper.pyi +2 -2
  122. metaflow-stubs/runner/__init__.pyi +2 -2
  123. metaflow-stubs/runner/deployer.pyi +4 -4
  124. metaflow-stubs/runner/metaflow_runner.pyi +4 -4
  125. metaflow-stubs/runner/nbdeploy.pyi +2 -2
  126. metaflow-stubs/runner/nbrun.pyi +2 -2
  127. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  128. metaflow-stubs/runner/utils.pyi +2 -2
  129. metaflow-stubs/system/__init__.pyi +3 -3
  130. metaflow-stubs/system/system_logger.pyi +3 -3
  131. metaflow-stubs/system/system_monitor.pyi +3 -3
  132. metaflow-stubs/tagging_util.pyi +2 -2
  133. metaflow-stubs/tuple_util.pyi +2 -2
  134. {ob_metaflow_stubs-5.5.dist-info → ob_metaflow_stubs-5.6.dist-info}/METADATA +1 -1
  135. ob_metaflow_stubs-5.6.dist-info/RECORD +138 -0
  136. ob_metaflow_stubs-5.5.dist-info/RECORD +0 -138
  137. {ob_metaflow_stubs-5.5.dist-info → ob_metaflow_stubs-5.6.dist-info}/WHEEL +0 -0
  138. {ob_metaflow_stubs-5.5.dist-info → ob_metaflow_stubs-5.6.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.17.1+ob(v1) #
4
- # Generated on 2024-08-27T02:02:03.052211 #
3
+ # MF version: 2.12.18.1+ob(v1) #
4
+ # Generated on 2024-08-28T20:35:42.371631 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
+ import metaflow.parameters
11
12
  import metaflow.datastore.inputs
13
+ import metaflow.flowspec
12
14
  import io
13
- import metaflow.events
15
+ import metaflow.client.core
14
16
  import metaflow.plugins.datatools.s3.s3
17
+ import typing
15
18
  import metaflow.metaflow_current
16
- import metaflow.runner.metaflow_runner
17
- import metaflow.flowspec
18
- import datetime
19
19
  import metaflow._vendor.click.types
20
- import metaflow.parameters
21
- import metaflow.client.core
22
- import typing
20
+ import metaflow.events
21
+ import datetime
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
 
@@ -728,210 +728,246 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
728
728
  ...
729
729
 
730
730
  @typing.overload
731
- def resources(*, cpu: int = 1, gpu: int = 0, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
731
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
732
732
  """
733
- Specifies the resources needed when executing this step.
734
-
735
- Use `@resources` to specify the resource requirements
736
- independently of the specific compute layer (`@batch`, `@kubernetes`).
737
-
738
- You can choose the compute layer on the command line by executing e.g.
739
- ```
740
- python myflow.py run --with batch
741
- ```
742
- or
743
- ```
744
- python myflow.py run --with kubernetes
745
- ```
746
- which executes the flow on the desired system using the
747
- requirements specified in `@resources`.
748
-
749
- Parameters
750
- ----------
751
- cpu : int, default 1
752
- Number of CPUs required for this step.
753
- gpu : int, default 0
754
- Number of GPUs required for this step.
755
- disk : int, optional, default None
756
- Disk size (in MB) required for this step. Only applies on Kubernetes.
757
- memory : int, default 4096
758
- Memory size (in MB) required for this step.
759
- shared_memory : int, optional, default None
760
- The value for the size (in MiB) of the /dev/shm volume for this step.
761
- This parameter maps to the `--shm-size` option in Docker.
733
+ Decorator prototype for all step decorators. This function gets specialized
734
+ and imported for all decorators types by _import_plugin_decorators().
762
735
  """
763
736
  ...
764
737
 
765
738
  @typing.overload
766
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
739
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
767
740
  ...
768
741
 
769
- @typing.overload
770
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
742
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
743
+ """
744
+ Decorator prototype for all step decorators. This function gets specialized
745
+ and imported for all decorators types by _import_plugin_decorators().
746
+ """
771
747
  ...
772
748
 
773
- def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
749
+ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = "KUBERNETES_IMAGE_PULL_POLICY", service_account: str = "METAFLOW_KUBERNETES_SERVICE_ACCOUNT", secrets: typing.Optional[typing.List[str]] = None, namespace: str = "METAFLOW_KUBERNETES_NAMESPACE", gpu: typing.Optional[int] = None, gpu_vendor: str = "KUBERNETES_GPU_VENDOR", tolerations: typing.List[str] = [], use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = "/metaflow_temp", persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
774
750
  """
775
- Specifies the resources needed when executing this step.
776
-
777
- Use `@resources` to specify the resource requirements
778
- independently of the specific compute layer (`@batch`, `@kubernetes`).
779
-
780
- You can choose the compute layer on the command line by executing e.g.
781
- ```
782
- python myflow.py run --with batch
783
- ```
784
- or
785
- ```
786
- python myflow.py run --with kubernetes
787
- ```
788
- which executes the flow on the desired system using the
789
- requirements specified in `@resources`.
751
+ Specifies that this step should execute on Kubernetes.
790
752
 
791
753
  Parameters
792
754
  ----------
793
755
  cpu : int, default 1
794
- Number of CPUs required for this step.
795
- gpu : int, default 0
796
- Number of GPUs required for this step.
797
- disk : int, optional, default None
798
- Disk size (in MB) required for this step. Only applies on Kubernetes.
756
+ Number of CPUs required for this step. If `@resources` is
757
+ also present, the maximum value from all decorators is used.
799
758
  memory : int, default 4096
800
- Memory size (in MB) required for this step.
801
- shared_memory : int, optional, default None
802
- The value for the size (in MiB) of the /dev/shm volume for this step.
803
- This parameter maps to the `--shm-size` option in Docker.
804
- """
805
- ...
806
-
807
- @typing.overload
808
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
809
- """
810
- Internal decorator to support Fast bakery
811
- """
812
- ...
813
-
814
- @typing.overload
815
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
816
- ...
817
-
818
- def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
819
- """
820
- Internal decorator to support Fast bakery
759
+ Memory size (in MB) required for this step. If
760
+ `@resources` is also present, the maximum value from all decorators is
761
+ used.
762
+ disk : int, default 10240
763
+ Disk size (in MB) required for this step. If
764
+ `@resources` is also present, the maximum value from all decorators is
765
+ used.
766
+ image : str, optional, default None
767
+ Docker image to use when launching on Kubernetes. If not specified, and
768
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
769
+ not, a default Docker image mapping to the current version of Python is used.
770
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
771
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
772
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
773
+ Kubernetes service account to use when launching pod in Kubernetes.
774
+ secrets : List[str], optional, default None
775
+ Kubernetes secrets to use when launching pod in Kubernetes. These
776
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
777
+ in Metaflow configuration.
778
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
779
+ Kubernetes namespace to use when launching pod in Kubernetes.
780
+ gpu : int, optional, default None
781
+ Number of GPUs required for this step. A value of zero implies that
782
+ the scheduled node should not have GPUs.
783
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
784
+ The vendor of the GPUs to be used for this step.
785
+ tolerations : List[str], default []
786
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
787
+ Kubernetes tolerations to use when launching pod in Kubernetes.
788
+ use_tmpfs : bool, default False
789
+ This enables an explicit tmpfs mount for this step.
790
+ tmpfs_tempdir : bool, default True
791
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
792
+ tmpfs_size : int, optional, default: None
793
+ The value for the size (in MiB) of the tmpfs mount for this step.
794
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
795
+ memory allocated for this step.
796
+ tmpfs_path : str, optional, default /metaflow_temp
797
+ Path to tmpfs mount for this step.
798
+ persistent_volume_claims : Dict[str, str], optional, default None
799
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
800
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
801
+ shared_memory: int, optional
802
+ Shared memory size (in MiB) required for this step
803
+ port: int, optional
804
+ Port number to specify in the Kubernetes job object
805
+ compute_pool : str, optional, default None
806
+ Compute pool to be used for for this step.
807
+ If not specified, any accessible compute pool within the perimeter is used.
821
808
  """
822
809
  ...
823
810
 
824
811
  @typing.overload
825
- 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]]]:
812
+ 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]]]:
826
813
  """
827
- Creates a human-readable report, a Metaflow Card, after this step completes.
814
+ Specifies the PyPI packages for the step.
828
815
 
829
- Note that you may add multiple `@card` decorators in a step with different parameters.
816
+ Information in this decorator will augment any
817
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
818
+ you can use `@pypi_base` to set packages required by all
819
+ steps and use `@pypi` to specify step-specific overrides.
830
820
 
831
821
  Parameters
832
822
  ----------
833
- type : str, default 'default'
834
- Card type.
835
- id : str, optional, default None
836
- If multiple cards are present, use this id to identify this card.
837
- options : Dict[str, Any], default {}
838
- Options passed to the card. The contents depend on the card type.
839
- timeout : int, default 45
840
- Interrupt reporting if it takes more than this many seconds.
841
-
842
-
823
+ packages : Dict[str, str], default: {}
824
+ Packages to use for this step. The key is the name of the package
825
+ and the value is the version to use.
826
+ python : str, optional, default: None
827
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
828
+ that the version used will correspond to the version of the Python interpreter used to start the run.
843
829
  """
844
830
  ...
845
831
 
846
832
  @typing.overload
847
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
833
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
848
834
  ...
849
835
 
850
836
  @typing.overload
851
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
837
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
852
838
  ...
853
839
 
854
- 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):
840
+ 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):
855
841
  """
856
- Creates a human-readable report, a Metaflow Card, after this step completes.
842
+ Specifies the PyPI packages for the step.
857
843
 
858
- Note that you may add multiple `@card` decorators in a step with different parameters.
844
+ Information in this decorator will augment any
845
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
846
+ you can use `@pypi_base` to set packages required by all
847
+ steps and use `@pypi` to specify step-specific overrides.
859
848
 
860
849
  Parameters
861
850
  ----------
862
- type : str, default 'default'
863
- Card type.
864
- id : str, optional, default None
865
- If multiple cards are present, use this id to identify this card.
866
- options : Dict[str, Any], default {}
867
- Options passed to the card. The contents depend on the card type.
868
- timeout : int, default 45
869
- Interrupt reporting if it takes more than this many seconds.
870
-
871
-
851
+ packages : Dict[str, str], default: {}
852
+ Packages to use for this step. The key is the name of the package
853
+ and the value is the version to use.
854
+ python : str, optional, default: None
855
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
856
+ that the version used will correspond to the version of the Python interpreter used to start the run.
872
857
  """
873
858
  ...
874
859
 
875
860
  @typing.overload
876
- 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]]]:
861
+ 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]]]:
877
862
  """
878
- Specifies secrets to be retrieved and injected as environment variables prior to
879
- the execution of a step.
863
+ Specifies environment variables to be set prior to the execution of a step.
880
864
 
881
865
  Parameters
882
866
  ----------
883
- sources : List[Union[str, Dict[str, Any]]], default: []
884
- List of secret specs, defining how the secrets are to be retrieved
867
+ vars : Dict[str, str], default {}
868
+ Dictionary of environment variables to set.
885
869
  """
886
870
  ...
887
871
 
888
872
  @typing.overload
889
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
873
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
890
874
  ...
891
875
 
892
876
  @typing.overload
893
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
877
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
894
878
  ...
895
879
 
896
- 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]]] = []):
880
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
897
881
  """
898
- Specifies secrets to be retrieved and injected as environment variables prior to
899
- the execution of a step.
882
+ Specifies environment variables to be set prior to the execution of a step.
900
883
 
901
884
  Parameters
902
885
  ----------
903
- sources : List[Union[str, Dict[str, Any]]], default: []
904
- List of secret specs, defining how the secrets are to be retrieved
886
+ vars : Dict[str, str], default {}
887
+ Dictionary of environment variables to set.
905
888
  """
906
889
  ...
907
890
 
908
891
  @typing.overload
909
- 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]]]:
892
+ def retry(*, times: int = 3, minutes_between_retries: int = 2) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
910
893
  """
911
- Specifies that the step will success under all circumstances.
894
+ Specifies the number of times the task corresponding
895
+ to a step needs to be retried.
912
896
 
913
- The decorator will create an optional artifact, specified by `var`, which
914
- contains the exception raised. You can use it to detect the presence
915
- of errors, indicating that all happy-path artifacts produced by the step
916
- are missing.
897
+ This decorator is useful for handling transient errors, such as networking issues.
898
+ If your task contains operations that can't be retried safely, e.g. database updates,
899
+ it is advisable to annotate it with `@retry(times=0)`.
900
+
901
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
902
+ decorator will execute a no-op task after all retries have been exhausted,
903
+ ensuring that the flow execution can continue.
917
904
 
918
905
  Parameters
919
906
  ----------
920
- var : str, optional, default None
921
- Name of the artifact in which to store the caught exception.
922
- If not specified, the exception is not stored.
923
- print_exception : bool, default True
924
- Determines whether or not the exception is printed to
925
- stdout when caught.
907
+ times : int, default 3
908
+ Number of times to retry this task.
909
+ minutes_between_retries : int, default 2
910
+ Number of minutes between retries.
926
911
  """
927
912
  ...
928
913
 
929
914
  @typing.overload
930
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
915
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
931
916
  ...
932
917
 
933
918
  @typing.overload
934
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
919
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
920
+ ...
921
+
922
+ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
923
+ """
924
+ Specifies the number of times the task corresponding
925
+ to a step needs to be retried.
926
+
927
+ This decorator is useful for handling transient errors, such as networking issues.
928
+ If your task contains operations that can't be retried safely, e.g. database updates,
929
+ it is advisable to annotate it with `@retry(times=0)`.
930
+
931
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
932
+ decorator will execute a no-op task after all retries have been exhausted,
933
+ ensuring that the flow execution can continue.
934
+
935
+ Parameters
936
+ ----------
937
+ times : int, default 3
938
+ Number of times to retry this task.
939
+ minutes_between_retries : int, default 2
940
+ Number of minutes between retries.
941
+ """
942
+ ...
943
+
944
+ @typing.overload
945
+ 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]]]:
946
+ """
947
+ Specifies that the step will success under all circumstances.
948
+
949
+ The decorator will create an optional artifact, specified by `var`, which
950
+ contains the exception raised. You can use it to detect the presence
951
+ of errors, indicating that all happy-path artifacts produced by the step
952
+ are missing.
953
+
954
+ Parameters
955
+ ----------
956
+ var : str, optional, default None
957
+ Name of the artifact in which to store the caught exception.
958
+ If not specified, the exception is not stored.
959
+ print_exception : bool, default True
960
+ Determines whether or not the exception is printed to
961
+ stdout when caught.
962
+ """
963
+ ...
964
+
965
+ @typing.overload
966
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
967
+ ...
968
+
969
+ @typing.overload
970
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
935
971
  ...
936
972
 
937
973
  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):
@@ -1011,6 +1047,90 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
1011
1047
  """
1012
1048
  ...
1013
1049
 
1050
+ @typing.overload
1051
+ 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]]]:
1052
+ """
1053
+ Specifies secrets to be retrieved and injected as environment variables prior to
1054
+ the execution of a step.
1055
+
1056
+ Parameters
1057
+ ----------
1058
+ sources : List[Union[str, Dict[str, Any]]], default: []
1059
+ List of secret specs, defining how the secrets are to be retrieved
1060
+ """
1061
+ ...
1062
+
1063
+ @typing.overload
1064
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1065
+ ...
1066
+
1067
+ @typing.overload
1068
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1069
+ ...
1070
+
1071
+ 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]]] = []):
1072
+ """
1073
+ Specifies secrets to be retrieved and injected as environment variables prior to
1074
+ the execution of a step.
1075
+
1076
+ Parameters
1077
+ ----------
1078
+ sources : List[Union[str, Dict[str, Any]]], default: []
1079
+ List of secret specs, defining how the secrets are to be retrieved
1080
+ """
1081
+ ...
1082
+
1083
+ @typing.overload
1084
+ 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]]]:
1085
+ """
1086
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1087
+
1088
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1089
+
1090
+ Parameters
1091
+ ----------
1092
+ type : str, default 'default'
1093
+ Card type.
1094
+ id : str, optional, default None
1095
+ If multiple cards are present, use this id to identify this card.
1096
+ options : Dict[str, Any], default {}
1097
+ Options passed to the card. The contents depend on the card type.
1098
+ timeout : int, default 45
1099
+ Interrupt reporting if it takes more than this many seconds.
1100
+
1101
+
1102
+ """
1103
+ ...
1104
+
1105
+ @typing.overload
1106
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1107
+ ...
1108
+
1109
+ @typing.overload
1110
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1111
+ ...
1112
+
1113
+ 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):
1114
+ """
1115
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1116
+
1117
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1118
+
1119
+ Parameters
1120
+ ----------
1121
+ type : str, default 'default'
1122
+ Card type.
1123
+ id : str, optional, default None
1124
+ If multiple cards are present, use this id to identify this card.
1125
+ options : Dict[str, Any], default {}
1126
+ Options passed to the card. The contents depend on the card type.
1127
+ timeout : int, default 45
1128
+ Interrupt reporting if it takes more than this many seconds.
1129
+
1130
+
1131
+ """
1132
+ ...
1133
+
1014
1134
  @typing.overload
1015
1135
  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]]]:
1016
1136
  """
@@ -1069,184 +1189,110 @@ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
1069
1189
  ...
1070
1190
 
1071
1191
  @typing.overload
1072
- def retry(*, times: int = 3, minutes_between_retries: int = 2) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1192
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1073
1193
  """
1074
- Specifies the number of times the task corresponding
1075
- to a step needs to be retried.
1076
-
1077
- This decorator is useful for handling transient errors, such as networking issues.
1078
- If your task contains operations that can't be retried safely, e.g. database updates,
1079
- it is advisable to annotate it with `@retry(times=0)`.
1080
-
1081
- This can be used in conjunction with the `@catch` decorator. The `@catch`
1082
- decorator will execute a no-op task after all retries have been exhausted,
1083
- ensuring that the flow execution can continue.
1084
-
1085
- Parameters
1086
- ----------
1087
- times : int, default 3
1088
- Number of times to retry this task.
1089
- minutes_between_retries : int, default 2
1090
- Number of minutes between retries.
1194
+ Internal decorator to support Fast bakery
1091
1195
  """
1092
1196
  ...
1093
1197
 
1094
1198
  @typing.overload
1095
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1096
- ...
1097
-
1098
- @typing.overload
1099
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1199
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1100
1200
  ...
1101
1201
 
1102
- def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
1202
+ def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
1103
1203
  """
1104
- Specifies the number of times the task corresponding
1105
- to a step needs to be retried.
1106
-
1107
- This decorator is useful for handling transient errors, such as networking issues.
1108
- If your task contains operations that can't be retried safely, e.g. database updates,
1109
- it is advisable to annotate it with `@retry(times=0)`.
1110
-
1111
- This can be used in conjunction with the `@catch` decorator. The `@catch`
1112
- decorator will execute a no-op task after all retries have been exhausted,
1113
- ensuring that the flow execution can continue.
1114
-
1115
- Parameters
1116
- ----------
1117
- times : int, default 3
1118
- Number of times to retry this task.
1119
- minutes_between_retries : int, default 2
1120
- Number of minutes between retries.
1204
+ Internal decorator to support Fast bakery
1121
1205
  """
1122
1206
  ...
1123
1207
 
1124
- def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = "KUBERNETES_IMAGE_PULL_POLICY", service_account: str = "METAFLOW_KUBERNETES_SERVICE_ACCOUNT", secrets: typing.Optional[typing.List[str]] = None, namespace: str = "METAFLOW_KUBERNETES_NAMESPACE", gpu: typing.Optional[int] = None, gpu_vendor: str = "KUBERNETES_GPU_VENDOR", tolerations: typing.List[str] = [], use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = "/metaflow_temp", persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1208
+ @typing.overload
1209
+ 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]]]:
1125
1210
  """
1126
- Specifies that this step should execute on Kubernetes.
1211
+ Specifies the resources needed when executing this step.
1212
+
1213
+ Use `@resources` to specify the resource requirements
1214
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
1215
+
1216
+ You can choose the compute layer on the command line by executing e.g.
1217
+ ```
1218
+ python myflow.py run --with batch
1219
+ ```
1220
+ or
1221
+ ```
1222
+ python myflow.py run --with kubernetes
1223
+ ```
1224
+ which executes the flow on the desired system using the
1225
+ requirements specified in `@resources`.
1127
1226
 
1128
1227
  Parameters
1129
1228
  ----------
1130
1229
  cpu : int, default 1
1131
- Number of CPUs required for this step. If `@resources` is
1132
- also present, the maximum value from all decorators is used.
1230
+ Number of CPUs required for this step.
1231
+ gpu : int, default 0
1232
+ Number of GPUs required for this step.
1233
+ disk : int, optional, default None
1234
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
1133
1235
  memory : int, default 4096
1134
- Memory size (in MB) required for this step. If
1135
- `@resources` is also present, the maximum value from all decorators is
1136
- used.
1137
- disk : int, default 10240
1138
- Disk size (in MB) required for this step. If
1139
- `@resources` is also present, the maximum value from all decorators is
1140
- used.
1141
- image : str, optional, default None
1142
- Docker image to use when launching on Kubernetes. If not specified, and
1143
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
1144
- not, a default Docker image mapping to the current version of Python is used.
1145
- image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
1146
- If given, the imagePullPolicy to be applied to the Docker image of the step.
1147
- service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
1148
- Kubernetes service account to use when launching pod in Kubernetes.
1149
- secrets : List[str], optional, default None
1150
- Kubernetes secrets to use when launching pod in Kubernetes. These
1151
- secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
1152
- in Metaflow configuration.
1153
- namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
1154
- Kubernetes namespace to use when launching pod in Kubernetes.
1155
- gpu : int, optional, default None
1156
- Number of GPUs required for this step. A value of zero implies that
1157
- the scheduled node should not have GPUs.
1158
- gpu_vendor : str, default KUBERNETES_GPU_VENDOR
1159
- The vendor of the GPUs to be used for this step.
1160
- tolerations : List[str], default []
1161
- The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
1162
- Kubernetes tolerations to use when launching pod in Kubernetes.
1163
- use_tmpfs : bool, default False
1164
- This enables an explicit tmpfs mount for this step.
1165
- tmpfs_tempdir : bool, default True
1166
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
1167
- tmpfs_size : int, optional, default: None
1168
- The value for the size (in MiB) of the tmpfs mount for this step.
1169
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
1170
- memory allocated for this step.
1171
- tmpfs_path : str, optional, default /metaflow_temp
1172
- Path to tmpfs mount for this step.
1173
- persistent_volume_claims : Dict[str, str], optional, default None
1174
- A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
1175
- volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
1176
- shared_memory: int, optional
1177
- Shared memory size (in MiB) required for this step
1178
- port: int, optional
1179
- Port number to specify in the Kubernetes job object
1180
- compute_pool : str, optional, default None
1181
- Compute pool to be used for for this step.
1182
- If not specified, any accessible compute pool within the perimeter is used.
1183
- """
1184
- ...
1185
-
1186
- @typing.overload
1187
- 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]]]:
1188
- """
1189
- Specifies environment variables to be set prior to the execution of a step.
1190
-
1191
- Parameters
1192
- ----------
1193
- vars : Dict[str, str], default {}
1194
- Dictionary of environment variables to set.
1236
+ Memory size (in MB) required for this step.
1237
+ shared_memory : int, optional, default None
1238
+ The value for the size (in MiB) of the /dev/shm volume for this step.
1239
+ This parameter maps to the `--shm-size` option in Docker.
1195
1240
  """
1196
1241
  ...
1197
1242
 
1198
1243
  @typing.overload
1199
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1244
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1200
1245
  ...
1201
1246
 
1202
1247
  @typing.overload
1203
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1248
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1204
1249
  ...
1205
1250
 
1206
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
1251
+ 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):
1207
1252
  """
1208
- Specifies environment variables to be set prior to the execution of a step.
1253
+ Specifies the resources needed when executing this step.
1254
+
1255
+ Use `@resources` to specify the resource requirements
1256
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
1257
+
1258
+ You can choose the compute layer on the command line by executing e.g.
1259
+ ```
1260
+ python myflow.py run --with batch
1261
+ ```
1262
+ or
1263
+ ```
1264
+ python myflow.py run --with kubernetes
1265
+ ```
1266
+ which executes the flow on the desired system using the
1267
+ requirements specified in `@resources`.
1209
1268
 
1210
1269
  Parameters
1211
1270
  ----------
1212
- vars : Dict[str, str], default {}
1213
- Dictionary of environment variables to set.
1214
- """
1215
- ...
1216
-
1217
- @typing.overload
1218
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1219
- """
1220
- Decorator prototype for all step decorators. This function gets specialized
1221
- and imported for all decorators types by _import_plugin_decorators().
1222
- """
1223
- ...
1224
-
1225
- @typing.overload
1226
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1227
- ...
1228
-
1229
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
1230
- """
1231
- Decorator prototype for all step decorators. This function gets specialized
1232
- and imported for all decorators types by _import_plugin_decorators().
1271
+ cpu : int, default 1
1272
+ Number of CPUs required for this step.
1273
+ gpu : int, default 0
1274
+ Number of GPUs required for this step.
1275
+ disk : int, optional, default None
1276
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
1277
+ memory : int, default 4096
1278
+ Memory size (in MB) required for this step.
1279
+ shared_memory : int, optional, default None
1280
+ The value for the size (in MiB) of the /dev/shm volume for this step.
1281
+ This parameter maps to the `--shm-size` option in Docker.
1233
1282
  """
1234
1283
  ...
1235
1284
 
1236
1285
  @typing.overload
1237
- 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]]]:
1286
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1238
1287
  """
1239
- Specifies the PyPI packages for the step.
1288
+ Specifies the PyPI packages for all steps of the flow.
1240
1289
 
1241
- Information in this decorator will augment any
1242
- attributes set in the `@pyi_base` flow-level decorator. Hence,
1243
- you can use `@pypi_base` to set packages required by all
1290
+ Use `@pypi_base` to set common packages required by all
1244
1291
  steps and use `@pypi` to specify step-specific overrides.
1245
-
1246
1292
  Parameters
1247
1293
  ----------
1248
1294
  packages : Dict[str, str], default: {}
1249
- Packages to use for this step. The key is the name of the package
1295
+ Packages to use for this flow. The key is the name of the package
1250
1296
  and the value is the version to use.
1251
1297
  python : str, optional, default: None
1252
1298
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
@@ -1255,26 +1301,19 @@ def pypi(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] =
1255
1301
  ...
1256
1302
 
1257
1303
  @typing.overload
1258
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1259
- ...
1260
-
1261
- @typing.overload
1262
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1304
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1263
1305
  ...
1264
1306
 
1265
- 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):
1307
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1266
1308
  """
1267
- Specifies the PyPI packages for the step.
1309
+ Specifies the PyPI packages for all steps of the flow.
1268
1310
 
1269
- Information in this decorator will augment any
1270
- attributes set in the `@pyi_base` flow-level decorator. Hence,
1271
- you can use `@pypi_base` to set packages required by all
1311
+ Use `@pypi_base` to set common packages required by all
1272
1312
  steps and use `@pypi` to specify step-specific overrides.
1273
-
1274
1313
  Parameters
1275
1314
  ----------
1276
1315
  packages : Dict[str, str], default: {}
1277
- Packages to use for this step. The key is the name of the package
1316
+ Packages to use for this flow. The key is the name of the package
1278
1317
  and the value is the version to use.
1279
1318
  python : str, optional, default: None
1280
1319
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
@@ -1283,90 +1322,147 @@ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
1283
1322
  ...
1284
1323
 
1285
1324
  @typing.overload
1286
- 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]]:
1325
+ 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]]:
1287
1326
  """
1288
- Specifies the times when the flow should be run when running on a
1289
- production scheduler.
1327
+ Specifies the flow(s) that this flow depends on.
1328
+
1329
+ ```
1330
+ @trigger_on_finish(flow='FooFlow')
1331
+ ```
1332
+ or
1333
+ ```
1334
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1335
+ ```
1336
+ This decorator respects the @project decorator and triggers the flow
1337
+ when upstream runs within the same namespace complete successfully
1338
+
1339
+ Additionally, you can specify project aware upstream flow dependencies
1340
+ by specifying the fully qualified project_flow_name.
1341
+ ```
1342
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1343
+ ```
1344
+ or
1345
+ ```
1346
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1347
+ ```
1348
+
1349
+ You can also specify just the project or project branch (other values will be
1350
+ inferred from the current project or project branch):
1351
+ ```
1352
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1353
+ ```
1354
+
1355
+ Note that `branch` is typically one of:
1356
+ - `prod`
1357
+ - `user.bob`
1358
+ - `test.my_experiment`
1359
+ - `prod.staging`
1290
1360
 
1291
1361
  Parameters
1292
1362
  ----------
1293
- hourly : bool, default False
1294
- Run the workflow hourly.
1295
- daily : bool, default True
1296
- Run the workflow daily.
1297
- weekly : bool, default False
1298
- Run the workflow weekly.
1299
- cron : str, optional, default None
1300
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1301
- specified by this expression.
1302
- timezone : str, optional, default None
1303
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1304
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1363
+ flow : Union[str, Dict[str, str]], optional, default None
1364
+ Upstream flow dependency for this flow.
1365
+ flows : List[Union[str, Dict[str, str]]], default []
1366
+ Upstream flow dependencies for this flow.
1367
+ options : Dict[str, Any], default {}
1368
+ Backend-specific configuration for tuning eventing behavior.
1369
+
1370
+
1305
1371
  """
1306
1372
  ...
1307
1373
 
1308
1374
  @typing.overload
1309
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1375
+ def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1310
1376
  ...
1311
1377
 
1312
- 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):
1378
+ 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] = {}):
1313
1379
  """
1314
- Specifies the times when the flow should be run when running on a
1315
- production scheduler.
1380
+ Specifies the flow(s) that this flow depends on.
1316
1381
 
1317
- Parameters
1318
- ----------
1319
- hourly : bool, default False
1320
- Run the workflow hourly.
1321
- daily : bool, default True
1322
- Run the workflow daily.
1323
- weekly : bool, default False
1324
- Run the workflow weekly.
1325
- cron : str, optional, default None
1326
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1327
- specified by this expression.
1328
- timezone : str, optional, default None
1329
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1330
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1331
- """
1332
- ...
1333
-
1334
- @typing.overload
1335
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1336
- """
1337
- Specifies the PyPI packages for all steps of the flow.
1382
+ ```
1383
+ @trigger_on_finish(flow='FooFlow')
1384
+ ```
1385
+ or
1386
+ ```
1387
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1388
+ ```
1389
+ This decorator respects the @project decorator and triggers the flow
1390
+ when upstream runs within the same namespace complete successfully
1391
+
1392
+ Additionally, you can specify project aware upstream flow dependencies
1393
+ by specifying the fully qualified project_flow_name.
1394
+ ```
1395
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1396
+ ```
1397
+ or
1398
+ ```
1399
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1400
+ ```
1401
+
1402
+ You can also specify just the project or project branch (other values will be
1403
+ inferred from the current project or project branch):
1404
+ ```
1405
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1406
+ ```
1407
+
1408
+ Note that `branch` is typically one of:
1409
+ - `prod`
1410
+ - `user.bob`
1411
+ - `test.my_experiment`
1412
+ - `prod.staging`
1338
1413
 
1339
- Use `@pypi_base` to set common packages required by all
1340
- steps and use `@pypi` to specify step-specific overrides.
1341
1414
  Parameters
1342
1415
  ----------
1343
- packages : Dict[str, str], default: {}
1344
- Packages to use for this flow. The key is the name of the package
1345
- and the value is the version to use.
1346
- python : str, optional, default: None
1347
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1348
- that the version used will correspond to the version of the Python interpreter used to start the run.
1416
+ flow : Union[str, Dict[str, str]], optional, default None
1417
+ Upstream flow dependency for this flow.
1418
+ flows : List[Union[str, Dict[str, str]]], default []
1419
+ Upstream flow dependencies for this flow.
1420
+ options : Dict[str, Any], default {}
1421
+ Backend-specific configuration for tuning eventing behavior.
1422
+
1423
+
1349
1424
  """
1350
1425
  ...
1351
1426
 
1352
- @typing.overload
1353
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1354
- ...
1355
-
1356
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1427
+ 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]]:
1357
1428
  """
1358
- Specifies the PyPI packages for all steps of the flow.
1429
+ The `@airflow_external_task_sensor` decorator attaches a Airflow [ExternalTaskSensor](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/sensors/external_task/index.html#airflow.sensors.external_task.ExternalTaskSensor) before the start step of the flow.
1430
+ This decorator only works when a flow is scheduled on Airflow and is compiled using `airflow create`. More than one `@airflow_external_task_sensor` can be added as a flow decorators. Adding more than one decorator will ensure that `start` step starts only after all sensors finish.
1359
1431
 
1360
- Use `@pypi_base` to set common packages required by all
1361
- steps and use `@pypi` to specify step-specific overrides.
1362
1432
  Parameters
1363
1433
  ----------
1364
- packages : Dict[str, str], default: {}
1365
- Packages to use for this flow. The key is the name of the package
1366
- and the value is the version to use.
1367
- python : str, optional, default: None
1368
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1369
- that the version used will correspond to the version of the Python interpreter used to start the run.
1434
+ timeout : int
1435
+ Time, in seconds before the task times out and fails. (Default: 3600)
1436
+ poke_interval : int
1437
+ Time in seconds that the job should wait in between each try. (Default: 60)
1438
+ mode : str
1439
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1440
+ exponential_backoff : bool
1441
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1442
+ pool : str
1443
+ the slot pool this task should run in,
1444
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1445
+ soft_fail : bool
1446
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1447
+ name : str
1448
+ Name of the sensor on Airflow
1449
+ description : str
1450
+ Description of sensor in the Airflow UI
1451
+ external_dag_id : str
1452
+ The dag_id that contains the task you want to wait for.
1453
+ external_task_ids : List[str]
1454
+ The list of task_ids that you want to wait for.
1455
+ If None (default value) the sensor waits for the DAG. (Default: None)
1456
+ allowed_states : List[str]
1457
+ Iterable of allowed states, (Default: ['success'])
1458
+ failed_states : List[str]
1459
+ Iterable of failed or dis-allowed states. (Default: None)
1460
+ execution_delta : datetime.timedelta
1461
+ time difference with the previous execution to look at,
1462
+ the default is the same logical date as the current task or DAG. (Default: None)
1463
+ check_existence: bool
1464
+ Set to True to check if the external task exists or check if
1465
+ the DAG to wait for exists. (Default: True)
1370
1466
  """
1371
1467
  ...
1372
1468
 
@@ -1412,37 +1508,6 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
1412
1508
  """
1413
1509
  ...
1414
1510
 
1415
- def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1416
- """
1417
- This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1418
-
1419
- User code call
1420
- -----------
1421
- @nim(
1422
- models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1423
- backend='managed'
1424
- )
1425
-
1426
- Valid backend options
1427
- ---------------------
1428
- - 'managed': Outerbounds selects a compute provider based on the model.
1429
- - 🚧 'dataplane': Run in your account.
1430
-
1431
- Valid model options
1432
- ----------------
1433
- - 'meta/llama3-8b-instruct': 8B parameter model
1434
- - 'meta/llama3-70b-instruct': 70B parameter model
1435
- - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1436
-
1437
- Parameters
1438
- ----------
1439
- models: list[NIM]
1440
- List of NIM containers running models in sidecars.
1441
- backend: str
1442
- Compute provider to run the NIM container.
1443
- """
1444
- ...
1445
-
1446
1511
  @typing.overload
1447
1512
  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]]:
1448
1513
  """
@@ -1492,21 +1557,34 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
1492
1557
  """
1493
1558
  ...
1494
1559
 
1495
- def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1560
+ def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1496
1561
  """
1497
- Specifies what flows belong to the same project.
1562
+ This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1498
1563
 
1499
- A project-specific namespace is created for all flows that
1500
- use the same `@project(name)`.
1564
+ User code call
1565
+ -----------
1566
+ @nim(
1567
+ models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1568
+ backend='managed'
1569
+ )
1501
1570
 
1502
- Parameters
1503
- ----------
1504
- name : str
1505
- Project name. Make sure that the name is unique amongst all
1506
- projects that use the same production scheduler. The name may
1507
- contain only lowercase alphanumeric characters and underscores.
1571
+ Valid backend options
1572
+ ---------------------
1573
+ - 'managed': Outerbounds selects a compute provider based on the model.
1574
+ - 🚧 'dataplane': Run in your account.
1508
1575
 
1576
+ Valid model options
1577
+ ----------------
1578
+ - 'meta/llama3-8b-instruct': 8B parameter model
1579
+ - 'meta/llama3-70b-instruct': 70B parameter model
1580
+ - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1509
1581
 
1582
+ Parameters
1583
+ ----------
1584
+ models: list[NIM]
1585
+ List of NIM containers running models in sidecars.
1586
+ backend: str
1587
+ Compute provider to run the NIM container.
1510
1588
  """
1511
1589
  ...
1512
1590
 
@@ -1605,146 +1683,68 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1605
1683
  """
1606
1684
  ...
1607
1685
 
1608
- 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]]:
1686
+ @typing.overload
1687
+ 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]]:
1609
1688
  """
1610
- The `@airflow_external_task_sensor` decorator attaches a Airflow [ExternalTaskSensor](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/sensors/external_task/index.html#airflow.sensors.external_task.ExternalTaskSensor) before the start step of the flow.
1611
- This decorator only works when a flow is scheduled on Airflow and is compiled using `airflow create`. More than one `@airflow_external_task_sensor` can be added as a flow decorators. Adding more than one decorator will ensure that `start` step starts only after all sensors finish.
1689
+ Specifies the times when the flow should be run when running on a
1690
+ production scheduler.
1612
1691
 
1613
1692
  Parameters
1614
1693
  ----------
1615
- timeout : int
1616
- Time, in seconds before the task times out and fails. (Default: 3600)
1617
- poke_interval : int
1618
- Time in seconds that the job should wait in between each try. (Default: 60)
1619
- mode : str
1620
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1621
- exponential_backoff : bool
1622
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1623
- pool : str
1624
- the slot pool this task should run in,
1625
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1626
- soft_fail : bool
1627
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1628
- name : str
1629
- Name of the sensor on Airflow
1630
- description : str
1631
- Description of sensor in the Airflow UI
1632
- external_dag_id : str
1633
- The dag_id that contains the task you want to wait for.
1634
- external_task_ids : List[str]
1635
- The list of task_ids that you want to wait for.
1636
- If None (default value) the sensor waits for the DAG. (Default: None)
1637
- allowed_states : List[str]
1638
- Iterable of allowed states, (Default: ['success'])
1639
- failed_states : List[str]
1640
- Iterable of failed or dis-allowed states. (Default: None)
1641
- execution_delta : datetime.timedelta
1642
- time difference with the previous execution to look at,
1643
- the default is the same logical date as the current task or DAG. (Default: None)
1644
- check_existence: bool
1645
- Set to True to check if the external task exists or check if
1646
- the DAG to wait for exists. (Default: True)
1694
+ hourly : bool, default False
1695
+ Run the workflow hourly.
1696
+ daily : bool, default True
1697
+ Run the workflow daily.
1698
+ weekly : bool, default False
1699
+ Run the workflow weekly.
1700
+ cron : str, optional, default None
1701
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1702
+ specified by this expression.
1703
+ timezone : str, optional, default None
1704
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1705
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1647
1706
  """
1648
1707
  ...
1649
1708
 
1650
1709
  @typing.overload
1651
- 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]]:
1710
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1711
+ ...
1712
+
1713
+ 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):
1652
1714
  """
1653
- Specifies the flow(s) that this flow depends on.
1654
-
1655
- ```
1656
- @trigger_on_finish(flow='FooFlow')
1657
- ```
1658
- or
1659
- ```
1660
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1661
- ```
1662
- This decorator respects the @project decorator and triggers the flow
1663
- when upstream runs within the same namespace complete successfully
1664
-
1665
- Additionally, you can specify project aware upstream flow dependencies
1666
- by specifying the fully qualified project_flow_name.
1667
- ```
1668
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1669
- ```
1670
- or
1671
- ```
1672
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1673
- ```
1674
-
1675
- You can also specify just the project or project branch (other values will be
1676
- inferred from the current project or project branch):
1677
- ```
1678
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1679
- ```
1680
-
1681
- Note that `branch` is typically one of:
1682
- - `prod`
1683
- - `user.bob`
1684
- - `test.my_experiment`
1685
- - `prod.staging`
1715
+ Specifies the times when the flow should be run when running on a
1716
+ production scheduler.
1686
1717
 
1687
1718
  Parameters
1688
1719
  ----------
1689
- flow : Union[str, Dict[str, str]], optional, default None
1690
- Upstream flow dependency for this flow.
1691
- flows : List[Union[str, Dict[str, str]]], default []
1692
- Upstream flow dependencies for this flow.
1693
- options : Dict[str, Any], default {}
1694
- Backend-specific configuration for tuning eventing behavior.
1695
-
1696
-
1720
+ hourly : bool, default False
1721
+ Run the workflow hourly.
1722
+ daily : bool, default True
1723
+ Run the workflow daily.
1724
+ weekly : bool, default False
1725
+ Run the workflow weekly.
1726
+ cron : str, optional, default None
1727
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1728
+ specified by this expression.
1729
+ timezone : str, optional, default None
1730
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1731
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1697
1732
  """
1698
1733
  ...
1699
1734
 
1700
- @typing.overload
1701
- def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1702
- ...
1703
-
1704
- 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] = {}):
1735
+ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1705
1736
  """
1706
- Specifies the flow(s) that this flow depends on.
1707
-
1708
- ```
1709
- @trigger_on_finish(flow='FooFlow')
1710
- ```
1711
- or
1712
- ```
1713
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1714
- ```
1715
- This decorator respects the @project decorator and triggers the flow
1716
- when upstream runs within the same namespace complete successfully
1717
-
1718
- Additionally, you can specify project aware upstream flow dependencies
1719
- by specifying the fully qualified project_flow_name.
1720
- ```
1721
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1722
- ```
1723
- or
1724
- ```
1725
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1726
- ```
1727
-
1728
- You can also specify just the project or project branch (other values will be
1729
- inferred from the current project or project branch):
1730
- ```
1731
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1732
- ```
1737
+ Specifies what flows belong to the same project.
1733
1738
 
1734
- Note that `branch` is typically one of:
1735
- - `prod`
1736
- - `user.bob`
1737
- - `test.my_experiment`
1738
- - `prod.staging`
1739
+ A project-specific namespace is created for all flows that
1740
+ use the same `@project(name)`.
1739
1741
 
1740
1742
  Parameters
1741
1743
  ----------
1742
- flow : Union[str, Dict[str, str]], optional, default None
1743
- Upstream flow dependency for this flow.
1744
- flows : List[Union[str, Dict[str, str]]], default []
1745
- Upstream flow dependencies for this flow.
1746
- options : Dict[str, Any], default {}
1747
- Backend-specific configuration for tuning eventing behavior.
1744
+ name : str
1745
+ Project name. Make sure that the name is unique amongst all
1746
+ projects that use the same production scheduler. The name may
1747
+ contain only lowercase alphanumeric characters and underscores.
1748
1748
 
1749
1749
 
1750
1750
  """