ob-metaflow-stubs 6.0.3.126__py2.py3-none-any.whl → 6.0.3.128__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- metaflow-stubs/__init__.pyi +287 -281
- metaflow-stubs/cards.pyi +2 -2
- metaflow-stubs/cli.pyi +2 -2
- metaflow-stubs/cli_components/__init__.pyi +2 -2
- metaflow-stubs/cli_components/utils.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +2 -2
- metaflow-stubs/client/core.pyi +4 -4
- metaflow-stubs/client/filecache.pyi +3 -3
- metaflow-stubs/events.pyi +3 -3
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +3 -3
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +3 -3
- metaflow-stubs/info_file.pyi +2 -2
- metaflow-stubs/metadata_provider/__init__.pyi +2 -2
- metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
- metaflow-stubs/metadata_provider/metadata.pyi +2 -2
- metaflow-stubs/metadata_provider/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -2
- metaflow-stubs/metaflow_current.pyi +81 -81
- metaflow-stubs/mf_extensions/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/async_cards.pyi +58 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/deco_injection_mixin.pyi +23 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/extra_components.pyi +69 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/checkpoint_lister.pyi +76 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/lineage_card.pyi +33 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/checkpoint_storage.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/constructors.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/core.pyi +4 -4
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/decorator.pyi +249 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/exceptions.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/final_api.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/lineage.pyi +27 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/core.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/exceptions.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/task_utils.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/exceptions.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/decorator.pyi +206 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/core.pyi +99 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/exceptions.pyi +25 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/model_storage.pyi +80 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/flowspec_utils.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/general.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/identity_utils.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/base.pyi +20 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/tar.pyi +25 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/snowflake.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/profilers/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/profilers/gpu.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/remote_config.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/toplevel/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/parameters.pyi +3 -3
- metaflow-stubs/plugins/__init__.pyi +13 -13
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
- metaflow-stubs/plugins/airflow/exception.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
- metaflow-stubs/plugins/argo/__init__.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +2 -2
- metaflow-stubs/plugins/aws/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +3 -3
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +2 -2
- metaflow-stubs/plugins/azure/__init__.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
- metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/cards/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_client.pyi +2 -2
- metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
- metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +2 -2
- metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3.pyi +3 -3
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
- metaflow-stubs/plugins/debug_logger.pyi +2 -2
- metaflow-stubs/plugins/debug_monitor.pyi +2 -2
- metaflow-stubs/plugins/environment_decorator.pyi +2 -2
- metaflow-stubs/plugins/events_decorator.pyi +2 -2
- metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
- metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
- metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
- metaflow-stubs/plugins/perimeters.pyi +2 -2
- metaflow-stubs/plugins/project_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
- metaflow-stubs/plugins/pypi/utils.pyi +2 -2
- metaflow-stubs/plugins/resources_decorator.pyi +2 -2
- metaflow-stubs/plugins/retry_decorator.pyi +2 -2
- metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
- metaflow-stubs/plugins/snowflake/__init__.pyi +2 -2
- metaflow-stubs/plugins/storage_executor.pyi +2 -2
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
- metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
- metaflow-stubs/profilers/__init__.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +29 -29
- metaflow-stubs/runner/deployer_impl.pyi +3 -3
- metaflow-stubs/runner/metaflow_runner.pyi +3 -3
- metaflow-stubs/runner/nbdeploy.pyi +2 -2
- metaflow-stubs/runner/nbrun.pyi +2 -2
- metaflow-stubs/runner/subprocess_manager.pyi +2 -2
- metaflow-stubs/runner/utils.pyi +3 -3
- metaflow-stubs/system/__init__.pyi +2 -2
- metaflow-stubs/system/system_logger.pyi +2 -2
- metaflow-stubs/system/system_monitor.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- metaflow-stubs/user_configs/__init__.pyi +2 -2
- metaflow-stubs/user_configs/config_decorators.pyi +6 -6
- metaflow-stubs/user_configs/config_options.pyi +2 -2
- metaflow-stubs/user_configs/config_parameters.pyi +7 -7
- {ob_metaflow_stubs-6.0.3.126.dist-info → ob_metaflow_stubs-6.0.3.128.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-6.0.3.128.dist-info/RECORD +191 -0
- ob_metaflow_stubs-6.0.3.126.dist-info/RECORD +0 -173
- {ob_metaflow_stubs-6.0.3.126.dist-info → ob_metaflow_stubs-6.0.3.128.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-6.0.3.126.dist-info → ob_metaflow_stubs-6.0.3.128.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.39.1+obcheckpoint(0.1.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.6);ob(v1) #
|
4
|
+
# Generated on 2024-12-18T07:29:34.132398 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -35,8 +35,8 @@ from .user_configs.config_parameters import config_expr as config_expr
|
|
35
35
|
from .user_configs.config_decorators import CustomFlowDecorator as CustomFlowDecorator
|
36
36
|
from .user_configs.config_decorators import CustomStepDecorator as CustomStepDecorator
|
37
37
|
from . import events as events
|
38
|
-
from . import tuple_util as tuple_util
|
39
38
|
from . import cards as cards
|
39
|
+
from . import tuple_util as tuple_util
|
40
40
|
from . import runner as runner
|
41
41
|
from . import plugins as plugins
|
42
42
|
from .mf_extensions.outerbounds.toplevel.global_aliases_for_metaflow_package import S3 as S3
|
@@ -145,6 +145,12 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
145
145
|
"""
|
146
146
|
...
|
147
147
|
|
148
|
+
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, node_selector: typing.Union[typing.Dict[str, str], str, None] = 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, hostname_resolution_timeout: int = 600, qos: str = 'Burstable') -> 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]]]:
|
149
|
+
"""
|
150
|
+
Specifies that this step should execute on Kubernetes.
|
151
|
+
"""
|
152
|
+
...
|
153
|
+
|
148
154
|
@typing.overload
|
149
155
|
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]]]:
|
150
156
|
"""
|
@@ -176,139 +182,6 @@ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
176
182
|
"""
|
177
183
|
...
|
178
184
|
|
179
|
-
@typing.overload
|
180
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
181
|
-
"""
|
182
|
-
Decorator prototype for all step decorators. This function gets specialized
|
183
|
-
and imported for all decorators types by _import_plugin_decorators().
|
184
|
-
"""
|
185
|
-
...
|
186
|
-
|
187
|
-
@typing.overload
|
188
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
189
|
-
...
|
190
|
-
|
191
|
-
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
192
|
-
"""
|
193
|
-
Decorator prototype for all step decorators. This function gets specialized
|
194
|
-
and imported for all decorators types by _import_plugin_decorators().
|
195
|
-
"""
|
196
|
-
...
|
197
|
-
|
198
|
-
@typing.overload
|
199
|
-
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]]]:
|
200
|
-
"""
|
201
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
202
|
-
the execution of a step.
|
203
|
-
"""
|
204
|
-
...
|
205
|
-
|
206
|
-
@typing.overload
|
207
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
208
|
-
...
|
209
|
-
|
210
|
-
@typing.overload
|
211
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
212
|
-
...
|
213
|
-
|
214
|
-
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]]] = []):
|
215
|
-
"""
|
216
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
217
|
-
the execution of a step.
|
218
|
-
"""
|
219
|
-
...
|
220
|
-
|
221
|
-
@typing.overload
|
222
|
-
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]]]:
|
223
|
-
"""
|
224
|
-
Specifies a timeout for your step.
|
225
|
-
|
226
|
-
This decorator is useful if this step may hang indefinitely.
|
227
|
-
|
228
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
229
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
230
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
231
|
-
|
232
|
-
Note that all the values specified in parameters are added together so if you specify
|
233
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
234
|
-
"""
|
235
|
-
...
|
236
|
-
|
237
|
-
@typing.overload
|
238
|
-
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
239
|
-
...
|
240
|
-
|
241
|
-
@typing.overload
|
242
|
-
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
243
|
-
...
|
244
|
-
|
245
|
-
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):
|
246
|
-
"""
|
247
|
-
Specifies a timeout for your step.
|
248
|
-
|
249
|
-
This decorator is useful if this step may hang indefinitely.
|
250
|
-
|
251
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
252
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
253
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
254
|
-
|
255
|
-
Note that all the values specified in parameters are added together so if you specify
|
256
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
257
|
-
"""
|
258
|
-
...
|
259
|
-
|
260
|
-
@typing.overload
|
261
|
-
def checkpoint(*, load_policy: str = 'fresh', temp_dir_root: 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]]]:
|
262
|
-
"""
|
263
|
-
Enables checkpointing for a step.
|
264
|
-
"""
|
265
|
-
...
|
266
|
-
|
267
|
-
@typing.overload
|
268
|
-
def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
269
|
-
...
|
270
|
-
|
271
|
-
@typing.overload
|
272
|
-
def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
273
|
-
...
|
274
|
-
|
275
|
-
def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load_policy: str = 'fresh', temp_dir_root: str = None):
|
276
|
-
"""
|
277
|
-
Enables checkpointing for a step.
|
278
|
-
"""
|
279
|
-
...
|
280
|
-
|
281
|
-
@typing.overload
|
282
|
-
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]]]:
|
283
|
-
"""
|
284
|
-
Specifies that the step will success under all circumstances.
|
285
|
-
|
286
|
-
The decorator will create an optional artifact, specified by `var`, which
|
287
|
-
contains the exception raised. You can use it to detect the presence
|
288
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
289
|
-
are missing.
|
290
|
-
"""
|
291
|
-
...
|
292
|
-
|
293
|
-
@typing.overload
|
294
|
-
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
295
|
-
...
|
296
|
-
|
297
|
-
@typing.overload
|
298
|
-
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
299
|
-
...
|
300
|
-
|
301
|
-
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):
|
302
|
-
"""
|
303
|
-
Specifies that the step will success under all circumstances.
|
304
|
-
|
305
|
-
The decorator will create an optional artifact, specified by `var`, which
|
306
|
-
contains the exception raised. You can use it to detect the presence
|
307
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
308
|
-
are missing.
|
309
|
-
"""
|
310
|
-
...
|
311
|
-
|
312
185
|
@typing.overload
|
313
186
|
def resources(*, cpu: int = 1, gpu: typing.Optional[int] = None, 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]]]:
|
314
187
|
"""
|
@@ -358,12 +231,6 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
358
231
|
"""
|
359
232
|
...
|
360
233
|
|
361
|
-
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, node_selector: typing.Union[typing.Dict[str, str], str, None] = 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, hostname_resolution_timeout: int = 600, qos: str = 'Burstable') -> 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]]]:
|
362
|
-
"""
|
363
|
-
Specifies that this step should execute on Kubernetes.
|
364
|
-
"""
|
365
|
-
...
|
366
|
-
|
367
234
|
@typing.overload
|
368
235
|
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]]]:
|
369
236
|
"""
|
@@ -395,9 +262,51 @@ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
|
|
395
262
|
"""
|
396
263
|
...
|
397
264
|
|
398
|
-
|
265
|
+
@typing.overload
|
266
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
399
267
|
"""
|
400
|
-
|
268
|
+
Internal decorator to support Fast bakery
|
269
|
+
"""
|
270
|
+
...
|
271
|
+
|
272
|
+
@typing.overload
|
273
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
274
|
+
...
|
275
|
+
|
276
|
+
def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
277
|
+
"""
|
278
|
+
Internal decorator to support Fast bakery
|
279
|
+
"""
|
280
|
+
...
|
281
|
+
|
282
|
+
@typing.overload
|
283
|
+
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]]]:
|
284
|
+
"""
|
285
|
+
Specifies that the step will success under all circumstances.
|
286
|
+
|
287
|
+
The decorator will create an optional artifact, specified by `var`, which
|
288
|
+
contains the exception raised. You can use it to detect the presence
|
289
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
290
|
+
are missing.
|
291
|
+
"""
|
292
|
+
...
|
293
|
+
|
294
|
+
@typing.overload
|
295
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
296
|
+
...
|
297
|
+
|
298
|
+
@typing.overload
|
299
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
300
|
+
...
|
301
|
+
|
302
|
+
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):
|
303
|
+
"""
|
304
|
+
Specifies that the step will success under all circumstances.
|
305
|
+
|
306
|
+
The decorator will create an optional artifact, specified by `var`, which
|
307
|
+
contains the exception raised. You can use it to detect the presence
|
308
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
309
|
+
are missing.
|
401
310
|
"""
|
402
311
|
...
|
403
312
|
|
@@ -423,40 +332,44 @@ def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
423
332
|
...
|
424
333
|
|
425
334
|
@typing.overload
|
426
|
-
def
|
335
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
427
336
|
"""
|
428
|
-
|
337
|
+
Decorator prototype for all step decorators. This function gets specialized
|
338
|
+
and imported for all decorators types by _import_plugin_decorators().
|
429
339
|
"""
|
430
340
|
...
|
431
341
|
|
432
342
|
@typing.overload
|
433
|
-
def
|
434
|
-
...
|
435
|
-
|
436
|
-
@typing.overload
|
437
|
-
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
343
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
438
344
|
...
|
439
345
|
|
440
|
-
def
|
346
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
441
347
|
"""
|
442
|
-
|
348
|
+
Decorator prototype for all step decorators. This function gets specialized
|
349
|
+
and imported for all decorators types by _import_plugin_decorators().
|
443
350
|
"""
|
444
351
|
...
|
445
352
|
|
446
353
|
@typing.overload
|
447
|
-
def
|
354
|
+
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]]]:
|
448
355
|
"""
|
449
|
-
|
356
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
357
|
+
the execution of a step.
|
450
358
|
"""
|
451
359
|
...
|
452
360
|
|
453
361
|
@typing.overload
|
454
|
-
def
|
362
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
455
363
|
...
|
456
364
|
|
457
|
-
|
365
|
+
@typing.overload
|
366
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
367
|
+
...
|
368
|
+
|
369
|
+
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]]] = []):
|
458
370
|
"""
|
459
|
-
|
371
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
372
|
+
the execution of a step.
|
460
373
|
"""
|
461
374
|
...
|
462
375
|
|
@@ -500,84 +413,120 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
500
413
|
...
|
501
414
|
|
502
415
|
@typing.overload
|
503
|
-
def
|
416
|
+
def checkpoint(*, load_policy: str = 'fresh', temp_dir_root: 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]]]:
|
504
417
|
"""
|
505
|
-
|
506
|
-
|
507
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
418
|
+
Enables checkpointing for a step.
|
508
419
|
"""
|
509
420
|
...
|
510
421
|
|
511
422
|
@typing.overload
|
512
|
-
def
|
423
|
+
def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
513
424
|
...
|
514
425
|
|
515
426
|
@typing.overload
|
516
|
-
def
|
427
|
+
def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
517
428
|
...
|
518
429
|
|
519
|
-
def
|
430
|
+
def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load_policy: str = 'fresh', temp_dir_root: str = None):
|
520
431
|
"""
|
521
|
-
|
522
|
-
|
523
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
432
|
+
Enables checkpointing for a step.
|
524
433
|
"""
|
525
434
|
...
|
526
435
|
|
527
|
-
def
|
436
|
+
def nvidia(*, gpu: int, gpu_type: 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]]]:
|
528
437
|
"""
|
529
|
-
|
530
|
-
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
531
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
532
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
533
|
-
starts only after all sensors finish.
|
438
|
+
Specifies that this step should execute on DGX cloud.
|
534
439
|
"""
|
535
440
|
...
|
536
441
|
|
537
442
|
@typing.overload
|
538
|
-
def
|
443
|
+
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]]]:
|
539
444
|
"""
|
540
|
-
Specifies
|
541
|
-
|
542
|
-
Use `@pypi_base` to set common packages required by all
|
543
|
-
steps and use `@pypi` to specify step-specific overrides.
|
445
|
+
Specifies environment variables to be set prior to the execution of a step.
|
544
446
|
"""
|
545
447
|
...
|
546
448
|
|
547
449
|
@typing.overload
|
548
|
-
def
|
450
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
549
451
|
...
|
550
452
|
|
551
|
-
|
453
|
+
@typing.overload
|
454
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
455
|
+
...
|
456
|
+
|
457
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
552
458
|
"""
|
553
|
-
Specifies
|
459
|
+
Specifies environment variables to be set prior to the execution of a step.
|
460
|
+
"""
|
461
|
+
...
|
462
|
+
|
463
|
+
def huggingface_hub(*, temp_dir_root: typing.Optional[str] = None, load: typing.Union[typing.List[str], typing.List[typing.Tuple[typing.Dict, str]], typing.List[typing.Tuple[str, str]], typing.List[typing.Dict], 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]]]:
|
464
|
+
"""
|
465
|
+
Decorator that helps cache, version and store models/datasets from huggingface hub.
|
466
|
+
"""
|
467
|
+
...
|
468
|
+
|
469
|
+
@typing.overload
|
470
|
+
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]]]:
|
471
|
+
"""
|
472
|
+
Specifies a timeout for your step.
|
554
473
|
|
555
|
-
|
556
|
-
|
474
|
+
This decorator is useful if this step may hang indefinitely.
|
475
|
+
|
476
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
477
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
478
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
479
|
+
|
480
|
+
Note that all the values specified in parameters are added together so if you specify
|
481
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
557
482
|
"""
|
558
483
|
...
|
559
484
|
|
560
|
-
|
485
|
+
@typing.overload
|
486
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
487
|
+
...
|
488
|
+
|
489
|
+
@typing.overload
|
490
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
491
|
+
...
|
492
|
+
|
493
|
+
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):
|
561
494
|
"""
|
562
|
-
|
495
|
+
Specifies a timeout for your step.
|
563
496
|
|
564
|
-
|
565
|
-
-----------
|
566
|
-
@nim(
|
567
|
-
models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
|
568
|
-
backend='managed'
|
569
|
-
)
|
497
|
+
This decorator is useful if this step may hang indefinitely.
|
570
498
|
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
- 🚧 'dataplane': Run in your account.
|
499
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
500
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
501
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
575
502
|
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
503
|
+
Note that all the values specified in parameters are added together so if you specify
|
504
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
505
|
+
"""
|
506
|
+
...
|
507
|
+
|
508
|
+
@typing.overload
|
509
|
+
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]]]:
|
510
|
+
"""
|
511
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
512
|
+
|
513
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
514
|
+
"""
|
515
|
+
...
|
516
|
+
|
517
|
+
@typing.overload
|
518
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
519
|
+
...
|
520
|
+
|
521
|
+
@typing.overload
|
522
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
523
|
+
...
|
524
|
+
|
525
|
+
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):
|
526
|
+
"""
|
527
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
528
|
+
|
529
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
581
530
|
"""
|
582
531
|
...
|
583
532
|
|
@@ -623,6 +572,119 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
|
|
623
572
|
"""
|
624
573
|
...
|
625
574
|
|
575
|
+
def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, bucket_key: typing.Union[str, typing.List[str]], bucket_name: str, wildcard_match: bool, aws_conn_id: str, verify: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
576
|
+
"""
|
577
|
+
The `@airflow_s3_key_sensor` decorator attaches a Airflow [S3KeySensor](https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/_api/airflow/providers/amazon/aws/sensors/s3/index.html#airflow.providers.amazon.aws.sensors.s3.S3KeySensor)
|
578
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
579
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
580
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
581
|
+
starts only after all sensors finish.
|
582
|
+
"""
|
583
|
+
...
|
584
|
+
|
585
|
+
@typing.overload
|
586
|
+
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]]:
|
587
|
+
"""
|
588
|
+
Specifies the event(s) that this flow depends on.
|
589
|
+
|
590
|
+
```
|
591
|
+
@trigger(event='foo')
|
592
|
+
```
|
593
|
+
or
|
594
|
+
```
|
595
|
+
@trigger(events=['foo', 'bar'])
|
596
|
+
```
|
597
|
+
|
598
|
+
Additionally, you can specify the parameter mappings
|
599
|
+
to map event payload to Metaflow parameters for the flow.
|
600
|
+
```
|
601
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
602
|
+
```
|
603
|
+
or
|
604
|
+
```
|
605
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
606
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
607
|
+
```
|
608
|
+
|
609
|
+
'parameters' can also be a list of strings and tuples like so:
|
610
|
+
```
|
611
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
612
|
+
```
|
613
|
+
This is equivalent to:
|
614
|
+
```
|
615
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
616
|
+
```
|
617
|
+
"""
|
618
|
+
...
|
619
|
+
|
620
|
+
@typing.overload
|
621
|
+
def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
622
|
+
...
|
623
|
+
|
624
|
+
def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, 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] = {}):
|
625
|
+
"""
|
626
|
+
Specifies the event(s) that this flow depends on.
|
627
|
+
|
628
|
+
```
|
629
|
+
@trigger(event='foo')
|
630
|
+
```
|
631
|
+
or
|
632
|
+
```
|
633
|
+
@trigger(events=['foo', 'bar'])
|
634
|
+
```
|
635
|
+
|
636
|
+
Additionally, you can specify the parameter mappings
|
637
|
+
to map event payload to Metaflow parameters for the flow.
|
638
|
+
```
|
639
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
640
|
+
```
|
641
|
+
or
|
642
|
+
```
|
643
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
644
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
645
|
+
```
|
646
|
+
|
647
|
+
'parameters' can also be a list of strings and tuples like so:
|
648
|
+
```
|
649
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
650
|
+
```
|
651
|
+
This is equivalent to:
|
652
|
+
```
|
653
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
654
|
+
```
|
655
|
+
"""
|
656
|
+
...
|
657
|
+
|
658
|
+
@typing.overload
|
659
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
660
|
+
"""
|
661
|
+
Specifies the PyPI packages for all steps of the flow.
|
662
|
+
|
663
|
+
Use `@pypi_base` to set common packages required by all
|
664
|
+
steps and use `@pypi` to specify step-specific overrides.
|
665
|
+
"""
|
666
|
+
...
|
667
|
+
|
668
|
+
@typing.overload
|
669
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
670
|
+
...
|
671
|
+
|
672
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
673
|
+
"""
|
674
|
+
Specifies the PyPI packages for all steps of the flow.
|
675
|
+
|
676
|
+
Use `@pypi_base` to set common packages required by all
|
677
|
+
steps and use `@pypi` to specify step-specific overrides.
|
678
|
+
"""
|
679
|
+
...
|
680
|
+
|
681
|
+
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]]:
|
682
|
+
"""
|
683
|
+
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.
|
684
|
+
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.
|
685
|
+
"""
|
686
|
+
...
|
687
|
+
|
626
688
|
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
627
689
|
"""
|
628
690
|
Specifies what flows belong to the same project.
|
@@ -632,6 +694,30 @@ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typ
|
|
632
694
|
"""
|
633
695
|
...
|
634
696
|
|
697
|
+
def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
698
|
+
"""
|
699
|
+
This decorator is used to run NIM containers in Metaflow tasks as sidecars.
|
700
|
+
|
701
|
+
User code call
|
702
|
+
-----------
|
703
|
+
@nim(
|
704
|
+
models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
|
705
|
+
backend='managed'
|
706
|
+
)
|
707
|
+
|
708
|
+
Valid backend options
|
709
|
+
---------------------
|
710
|
+
- 'managed': Outerbounds selects a compute provider based on the model.
|
711
|
+
- 🚧 'dataplane': Run in your account.
|
712
|
+
|
713
|
+
Valid model options
|
714
|
+
----------------
|
715
|
+
- 'meta/llama3-8b-instruct': 8B parameter model
|
716
|
+
- 'meta/llama3-70b-instruct': 70B parameter model
|
717
|
+
- Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
|
718
|
+
"""
|
719
|
+
...
|
720
|
+
|
635
721
|
@typing.overload
|
636
722
|
def trigger_on_finish(*, flow: typing.Union[typing.Dict[str, 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]]:
|
637
723
|
"""
|
@@ -713,85 +799,5 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
713
799
|
"""
|
714
800
|
...
|
715
801
|
|
716
|
-
@typing.overload
|
717
|
-
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]]:
|
718
|
-
"""
|
719
|
-
Specifies the event(s) that this flow depends on.
|
720
|
-
|
721
|
-
```
|
722
|
-
@trigger(event='foo')
|
723
|
-
```
|
724
|
-
or
|
725
|
-
```
|
726
|
-
@trigger(events=['foo', 'bar'])
|
727
|
-
```
|
728
|
-
|
729
|
-
Additionally, you can specify the parameter mappings
|
730
|
-
to map event payload to Metaflow parameters for the flow.
|
731
|
-
```
|
732
|
-
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
733
|
-
```
|
734
|
-
or
|
735
|
-
```
|
736
|
-
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
737
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
738
|
-
```
|
739
|
-
|
740
|
-
'parameters' can also be a list of strings and tuples like so:
|
741
|
-
```
|
742
|
-
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
743
|
-
```
|
744
|
-
This is equivalent to:
|
745
|
-
```
|
746
|
-
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
747
|
-
```
|
748
|
-
"""
|
749
|
-
...
|
750
|
-
|
751
|
-
@typing.overload
|
752
|
-
def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
753
|
-
...
|
754
|
-
|
755
|
-
def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, 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] = {}):
|
756
|
-
"""
|
757
|
-
Specifies the event(s) that this flow depends on.
|
758
|
-
|
759
|
-
```
|
760
|
-
@trigger(event='foo')
|
761
|
-
```
|
762
|
-
or
|
763
|
-
```
|
764
|
-
@trigger(events=['foo', 'bar'])
|
765
|
-
```
|
766
|
-
|
767
|
-
Additionally, you can specify the parameter mappings
|
768
|
-
to map event payload to Metaflow parameters for the flow.
|
769
|
-
```
|
770
|
-
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
771
|
-
```
|
772
|
-
or
|
773
|
-
```
|
774
|
-
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
775
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
776
|
-
```
|
777
|
-
|
778
|
-
'parameters' can also be a list of strings and tuples like so:
|
779
|
-
```
|
780
|
-
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
781
|
-
```
|
782
|
-
This is equivalent to:
|
783
|
-
```
|
784
|
-
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
785
|
-
```
|
786
|
-
"""
|
787
|
-
...
|
788
|
-
|
789
|
-
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]]:
|
790
|
-
"""
|
791
|
-
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.
|
792
|
-
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.
|
793
|
-
"""
|
794
|
-
...
|
795
|
-
|
796
802
|
pkg_name: str
|
797
803
|
|