ob-metaflow-stubs 6.0.3.176rc5__py2.py3-none-any.whl → 6.0.3.177__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.
- metaflow-stubs/__init__.pyi +494 -493
- metaflow-stubs/cards.pyi +1 -1
- metaflow-stubs/cli.pyi +1 -1
- metaflow-stubs/cli_components/__init__.pyi +1 -1
- metaflow-stubs/cli_components/utils.pyi +1 -1
- metaflow-stubs/client/__init__.pyi +1 -1
- metaflow-stubs/client/core.pyi +5 -5
- metaflow-stubs/client/filecache.pyi +2 -2
- metaflow-stubs/events.pyi +1 -1
- metaflow-stubs/exception.pyi +1 -1
- metaflow-stubs/flowspec.pyi +4 -4
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +3 -3
- metaflow-stubs/info_file.pyi +1 -1
- metaflow-stubs/metadata_provider/__init__.pyi +1 -1
- metaflow-stubs/metadata_provider/heartbeat.pyi +1 -1
- metaflow-stubs/metadata_provider/metadata.pyi +2 -2
- metaflow-stubs/metadata_provider/util.pyi +1 -1
- metaflow-stubs/metaflow_config.pyi +1 -1
- metaflow-stubs/metaflow_current.pyi +99 -99
- metaflow-stubs/metaflow_git.pyi +1 -1
- metaflow-stubs/mf_extensions/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/async_cards.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/deco_injection_mixin.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/extra_components.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/checkpoint_lister.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/lineage_card.pyi +1 -1
- 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 +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/core.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/decorator.pyi +4 -4
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/exceptions.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/final_api.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/lineage.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/context.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/core.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/decorator.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/exceptions.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/task_utils.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/exceptions.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/decorator.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/core.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/exceptions.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/model_storage.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/flowspec_utils.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/general.pyi +1 -1
- 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 +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/base.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/tar.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/aws/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/outerbounds/plugins/aws/assume_role_decorator.pyi +52 -0
- metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/async_cards.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/injector.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/coreweave.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/nebius.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/kubernetes/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/kubernetes/pod_killer.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/constants.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/exceptions.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/ollama.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/status_card.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/snowflake.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/profilers/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/profilers/gpu.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/remote_config.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/toplevel/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.pyi +2 -1
- metaflow-stubs/multicore_utils.pyi +1 -1
- metaflow-stubs/parameters.pyi +3 -3
- metaflow-stubs/plugins/__init__.pyi +11 -11
- metaflow-stubs/plugins/airflow/__init__.pyi +1 -1
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +1 -1
- metaflow-stubs/plugins/airflow/exception.pyi +1 -1
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +1 -1
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +1 -1
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +1 -1
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +1 -1
- metaflow-stubs/plugins/argo/__init__.pyi +1 -1
- metaflow-stubs/plugins/argo/argo_client.pyi +1 -1
- metaflow-stubs/plugins/argo/argo_events.pyi +1 -1
- 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 +1 -1
- metaflow-stubs/plugins/aws/aws_client.pyi +1 -1
- metaflow-stubs/plugins/aws/aws_utils.pyi +1 -1
- metaflow-stubs/plugins/aws/batch/__init__.pyi +1 -1
- metaflow-stubs/plugins/aws/batch/batch.pyi +1 -1
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +1 -1
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +1 -1
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +1 -1
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +1 -1
- 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 +1 -1
- metaflow-stubs/plugins/azure/azure_credential.pyi +1 -1
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +1 -1
- metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/azure/azure_utils.pyi +1 -1
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +1 -1
- metaflow-stubs/plugins/azure/includefile_support.pyi +1 -1
- metaflow-stubs/plugins/cards/__init__.pyi +5 -5
- metaflow-stubs/plugins/cards/card_client.pyi +2 -2
- metaflow-stubs/plugins/cards/card_creator.pyi +1 -1
- metaflow-stubs/plugins/cards/card_datastore.pyi +1 -1
- metaflow-stubs/plugins/cards/card_decorator.pyi +1 -1
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +1 -1
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +1 -1
- metaflow-stubs/plugins/cards/card_modules/card.pyi +1 -1
- metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +1 -1
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +1 -1
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +1 -1
- metaflow-stubs/plugins/cards/card_resolver.pyi +1 -1
- metaflow-stubs/plugins/cards/component_serializer.pyi +1 -1
- metaflow-stubs/plugins/cards/exception.pyi +1 -1
- metaflow-stubs/plugins/catch_decorator.pyi +2 -2
- metaflow-stubs/plugins/datatools/__init__.pyi +1 -1
- metaflow-stubs/plugins/datatools/local.pyi +1 -1
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +1 -1
- metaflow-stubs/plugins/datatools/s3/s3.pyi +4 -4
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +1 -1
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +1 -1
- metaflow-stubs/plugins/debug_logger.pyi +1 -1
- metaflow-stubs/plugins/debug_monitor.pyi +1 -1
- metaflow-stubs/plugins/environment_decorator.pyi +1 -1
- metaflow-stubs/plugins/events_decorator.pyi +1 -1
- metaflow-stubs/plugins/frameworks/__init__.pyi +1 -1
- metaflow-stubs/plugins/frameworks/pytorch.pyi +1 -1
- metaflow-stubs/plugins/gcp/__init__.pyi +1 -1
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +1 -1
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +1 -1
- metaflow-stubs/plugins/gcp/gs_utils.pyi +1 -1
- metaflow-stubs/plugins/gcp/includefile_support.pyi +1 -1
- metaflow-stubs/plugins/kubernetes/__init__.pyi +1 -1
- metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +1 -1
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +1 -1
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +1 -1
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +1 -1
- metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +1 -1
- metaflow-stubs/plugins/ollama/__init__.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +1 -1
- metaflow-stubs/plugins/perimeters.pyi +1 -1
- metaflow-stubs/plugins/project_decorator.pyi +1 -1
- metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +1 -1
- metaflow-stubs/plugins/pypi/conda_environment.pyi +3 -3
- metaflow-stubs/plugins/pypi/parsers.pyi +1 -1
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +1 -1
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +1 -1
- metaflow-stubs/plugins/pypi/utils.pyi +1 -1
- metaflow-stubs/plugins/resources_decorator.pyi +1 -1
- metaflow-stubs/plugins/retry_decorator.pyi +1 -1
- metaflow-stubs/plugins/secrets/__init__.pyi +1 -1
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +1 -1
- metaflow-stubs/plugins/snowflake/__init__.pyi +1 -1
- metaflow-stubs/plugins/storage_executor.pyi +1 -1
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
- metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
- metaflow-stubs/plugins/torchtune/__init__.pyi +1 -1
- metaflow-stubs/plugins/uv/__init__.pyi +1 -1
- metaflow-stubs/plugins/uv/uv_environment.pyi +2 -2
- metaflow-stubs/profilers/__init__.pyi +1 -1
- metaflow-stubs/pylint_wrapper.pyi +1 -1
- metaflow-stubs/runner/__init__.pyi +1 -1
- metaflow-stubs/runner/deployer.pyi +29 -29
- metaflow-stubs/runner/deployer_impl.pyi +2 -2
- metaflow-stubs/runner/metaflow_runner.pyi +3 -3
- metaflow-stubs/runner/nbdeploy.pyi +1 -1
- metaflow-stubs/runner/nbrun.pyi +1 -1
- metaflow-stubs/runner/subprocess_manager.pyi +1 -1
- metaflow-stubs/runner/utils.pyi +2 -2
- metaflow-stubs/system/__init__.pyi +1 -1
- metaflow-stubs/system/system_logger.pyi +2 -2
- metaflow-stubs/system/system_monitor.pyi +1 -1
- metaflow-stubs/tagging_util.pyi +1 -1
- metaflow-stubs/tuple_util.pyi +1 -1
- metaflow-stubs/user_configs/__init__.pyi +1 -1
- metaflow-stubs/user_configs/config_decorators.pyi +5 -5
- metaflow-stubs/user_configs/config_options.pyi +2 -2
- metaflow-stubs/user_configs/config_parameters.pyi +5 -5
- {ob_metaflow_stubs-6.0.3.176rc5.dist-info → ob_metaflow_stubs-6.0.3.177.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-6.0.3.177.dist-info/RECORD +215 -0
- ob_metaflow_stubs-6.0.3.176rc5.dist-info/RECORD +0 -213
- {ob_metaflow_stubs-6.0.3.176rc5.dist-info → ob_metaflow_stubs-6.0.3.177.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-6.0.3.176rc5.dist-info → ob_metaflow_stubs-6.0.3.177.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
3
|
# MF version: 2.15.14.1+obcheckpoint(0.2.1);ob(v1) #
|
4
|
-
# Generated on 2025-06-
|
4
|
+
# Generated on 2025-06-10T19:56:51.889454 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -35,17 +35,17 @@ from .user_configs.config_parameters import ConfigValue as ConfigValue
|
|
35
35
|
from .user_configs.config_parameters import config_expr as config_expr
|
36
36
|
from .user_configs.config_decorators import CustomFlowDecorator as CustomFlowDecorator
|
37
37
|
from .user_configs.config_decorators import CustomStepDecorator as CustomStepDecorator
|
38
|
-
from . import tuple_util as tuple_util
|
39
38
|
from . import cards as cards
|
40
|
-
from . import
|
39
|
+
from . import tuple_util as tuple_util
|
41
40
|
from . import metaflow_git as metaflow_git
|
41
|
+
from . import events as events
|
42
42
|
from . import runner as runner
|
43
43
|
from . import plugins as plugins
|
44
44
|
from .mf_extensions.outerbounds.toplevel.global_aliases_for_metaflow_package import S3 as S3
|
45
45
|
from . import includefile as includefile
|
46
46
|
from .includefile import IncludeFile as IncludeFile
|
47
|
-
from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
|
48
47
|
from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
|
48
|
+
from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
|
49
49
|
from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
|
50
50
|
from . import client as client
|
51
51
|
from .client.core import namespace as namespace
|
@@ -72,6 +72,7 @@ from .mf_extensions.outerbounds.toplevel.global_aliases_for_metaflow_package imp
|
|
72
72
|
from .mf_extensions.outerbounds.plugins.snowflake.snowflake import Snowflake as Snowflake
|
73
73
|
from .mf_extensions.outerbounds.plugins.checkpoint_datastores.nebius import nebius_checkpoints as nebius_checkpoints
|
74
74
|
from .mf_extensions.outerbounds.plugins.checkpoint_datastores.coreweave import coreweave_checkpoints as coreweave_checkpoints
|
75
|
+
from .mf_extensions.outerbounds.plugins.aws.assume_role_decorator import assume_role as assume_role
|
75
76
|
from . import cli_components as cli_components
|
76
77
|
from . import system as system
|
77
78
|
from . import pylint_wrapper as pylint_wrapper
|
@@ -153,129 +154,71 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
153
154
|
"""
|
154
155
|
...
|
155
156
|
|
156
|
-
|
157
|
+
@typing.overload
|
158
|
+
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]]]:
|
157
159
|
"""
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
Parameters
|
162
|
-
----------
|
163
|
-
temp_dir_root : str, optional
|
164
|
-
The root directory that will hold the temporary directory where objects will be downloaded.
|
165
|
-
|
166
|
-
load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
|
167
|
-
The list of repos (models/datasets) to load.
|
168
|
-
|
169
|
-
Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
|
170
|
-
|
171
|
-
- If repo (model/dataset) is not found in the datastore:
|
172
|
-
- Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
|
173
|
-
- Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
|
174
|
-
- All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
|
160
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
175
161
|
|
176
|
-
|
177
|
-
- Loads it directly from datastore to local path (can be temporary directory or specified path)
|
178
|
-
"""
|
179
|
-
...
|
180
|
-
|
181
|
-
def nvct(*, 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]]]:
|
182
|
-
"""
|
183
|
-
Specifies that this step should execute on DGX cloud.
|
162
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
184
163
|
|
185
164
|
|
186
165
|
Parameters
|
187
166
|
----------
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
167
|
+
type : str, default 'default'
|
168
|
+
Card type.
|
169
|
+
id : str, optional, default None
|
170
|
+
If multiple cards are present, use this id to identify this card.
|
171
|
+
options : Dict[str, Any], default {}
|
172
|
+
Options passed to the card. The contents depend on the card type.
|
173
|
+
timeout : int, default 45
|
174
|
+
Interrupt reporting if it takes more than this many seconds.
|
192
175
|
"""
|
193
176
|
...
|
194
177
|
|
195
178
|
@typing.overload
|
196
|
-
def
|
197
|
-
"""
|
198
|
-
Decorator prototype for all step decorators. This function gets specialized
|
199
|
-
and imported for all decorators types by _import_plugin_decorators().
|
200
|
-
"""
|
179
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
201
180
|
...
|
202
181
|
|
203
182
|
@typing.overload
|
204
|
-
def
|
205
|
-
...
|
206
|
-
|
207
|
-
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
208
|
-
"""
|
209
|
-
Decorator prototype for all step decorators. This function gets specialized
|
210
|
-
and imported for all decorators types by _import_plugin_decorators().
|
211
|
-
"""
|
183
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
212
184
|
...
|
213
185
|
|
214
|
-
|
215
|
-
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]]]:
|
186
|
+
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):
|
216
187
|
"""
|
217
|
-
|
218
|
-
the execution of a step.
|
219
|
-
|
188
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
220
189
|
|
221
|
-
|
222
|
-
----------
|
223
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
224
|
-
List of secret specs, defining how the secrets are to be retrieved
|
225
|
-
"""
|
226
|
-
...
|
227
|
-
|
228
|
-
@typing.overload
|
229
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
230
|
-
...
|
231
|
-
|
232
|
-
@typing.overload
|
233
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
234
|
-
...
|
235
|
-
|
236
|
-
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]]] = []):
|
237
|
-
"""
|
238
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
239
|
-
the execution of a step.
|
190
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
240
191
|
|
241
192
|
|
242
193
|
Parameters
|
243
194
|
----------
|
244
|
-
|
245
|
-
|
195
|
+
type : str, default 'default'
|
196
|
+
Card type.
|
197
|
+
id : str, optional, default None
|
198
|
+
If multiple cards are present, use this id to identify this card.
|
199
|
+
options : Dict[str, Any], default {}
|
200
|
+
Options passed to the card. The contents depend on the card type.
|
201
|
+
timeout : int, default 45
|
202
|
+
Interrupt reporting if it takes more than this many seconds.
|
246
203
|
"""
|
247
204
|
...
|
248
205
|
|
249
206
|
@typing.overload
|
250
|
-
def
|
207
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
251
208
|
"""
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
Parameters
|
256
|
-
----------
|
257
|
-
vars : Dict[str, str], default {}
|
258
|
-
Dictionary of environment variables to set.
|
209
|
+
Decorator prototype for all step decorators. This function gets specialized
|
210
|
+
and imported for all decorators types by _import_plugin_decorators().
|
259
211
|
"""
|
260
212
|
...
|
261
213
|
|
262
214
|
@typing.overload
|
263
|
-
def
|
264
|
-
...
|
265
|
-
|
266
|
-
@typing.overload
|
267
|
-
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
215
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
268
216
|
...
|
269
217
|
|
270
|
-
def
|
218
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
271
219
|
"""
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
Parameters
|
276
|
-
----------
|
277
|
-
vars : Dict[str, str], default {}
|
278
|
-
Dictionary of environment variables to set.
|
220
|
+
Decorator prototype for all step decorators. This function gets specialized
|
221
|
+
and imported for all decorators types by _import_plugin_decorators().
|
279
222
|
"""
|
280
223
|
...
|
281
224
|
|
@@ -338,111 +281,17 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
338
281
|
"""
|
339
282
|
...
|
340
283
|
|
341
|
-
|
342
|
-
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]]]:
|
343
|
-
"""
|
344
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
345
|
-
|
346
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
347
|
-
|
348
|
-
|
349
|
-
Parameters
|
350
|
-
----------
|
351
|
-
type : str, default 'default'
|
352
|
-
Card type.
|
353
|
-
id : str, optional, default None
|
354
|
-
If multiple cards are present, use this id to identify this card.
|
355
|
-
options : Dict[str, Any], default {}
|
356
|
-
Options passed to the card. The contents depend on the card type.
|
357
|
-
timeout : int, default 45
|
358
|
-
Interrupt reporting if it takes more than this many seconds.
|
359
|
-
"""
|
360
|
-
...
|
361
|
-
|
362
|
-
@typing.overload
|
363
|
-
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
364
|
-
...
|
365
|
-
|
366
|
-
@typing.overload
|
367
|
-
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
368
|
-
...
|
369
|
-
|
370
|
-
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):
|
371
|
-
"""
|
372
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
373
|
-
|
374
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
375
|
-
|
376
|
-
|
377
|
-
Parameters
|
378
|
-
----------
|
379
|
-
type : str, default 'default'
|
380
|
-
Card type.
|
381
|
-
id : str, optional, default None
|
382
|
-
If multiple cards are present, use this id to identify this card.
|
383
|
-
options : Dict[str, Any], default {}
|
384
|
-
Options passed to the card. The contents depend on the card type.
|
385
|
-
timeout : int, default 45
|
386
|
-
Interrupt reporting if it takes more than this many seconds.
|
387
|
-
"""
|
388
|
-
...
|
389
|
-
|
390
|
-
@typing.overload
|
391
|
-
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]]]:
|
392
|
-
"""
|
393
|
-
Specifies the Conda environment for the step.
|
394
|
-
|
395
|
-
Information in this decorator will augment any
|
396
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
397
|
-
you can use `@conda_base` to set packages required by all
|
398
|
-
steps and use `@conda` to specify step-specific overrides.
|
399
|
-
|
400
|
-
|
401
|
-
Parameters
|
402
|
-
----------
|
403
|
-
packages : Dict[str, str], default {}
|
404
|
-
Packages to use for this step. The key is the name of the package
|
405
|
-
and the value is the version to use.
|
406
|
-
libraries : Dict[str, str], default {}
|
407
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
408
|
-
python : str, optional, default None
|
409
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
410
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
411
|
-
disabled : bool, default False
|
412
|
-
If set to True, disables @conda.
|
413
|
-
"""
|
414
|
-
...
|
415
|
-
|
416
|
-
@typing.overload
|
417
|
-
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
418
|
-
...
|
419
|
-
|
420
|
-
@typing.overload
|
421
|
-
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
422
|
-
...
|
423
|
-
|
424
|
-
def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
284
|
+
def nvct(*, 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]]]:
|
425
285
|
"""
|
426
|
-
Specifies
|
427
|
-
|
428
|
-
Information in this decorator will augment any
|
429
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
430
|
-
you can use `@conda_base` to set packages required by all
|
431
|
-
steps and use `@conda` to specify step-specific overrides.
|
286
|
+
Specifies that this step should execute on DGX cloud.
|
432
287
|
|
433
288
|
|
434
289
|
Parameters
|
435
290
|
----------
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
441
|
-
python : str, optional, default None
|
442
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
443
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
444
|
-
disabled : bool, default False
|
445
|
-
If set to True, disables @conda.
|
291
|
+
gpu : int
|
292
|
+
Number of GPUs to use.
|
293
|
+
gpu_type : str
|
294
|
+
Type of Nvidia GPU to use.
|
446
295
|
"""
|
447
296
|
...
|
448
297
|
|
@@ -532,32 +381,114 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
|
|
532
381
|
...
|
533
382
|
|
534
383
|
@typing.overload
|
535
|
-
def
|
384
|
+
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]]]:
|
536
385
|
"""
|
537
|
-
|
538
|
-
|
539
|
-
Use `@resources` to specify the resource requirements
|
540
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
386
|
+
Enables checkpointing for a step.
|
541
387
|
|
542
|
-
You can choose the compute layer on the command line by executing e.g.
|
543
|
-
```
|
544
|
-
python myflow.py run --with batch
|
545
|
-
```
|
546
|
-
or
|
547
|
-
```
|
548
|
-
python myflow.py run --with kubernetes
|
549
|
-
```
|
550
|
-
which executes the flow on the desired system using the
|
551
|
-
requirements specified in `@resources`.
|
552
388
|
|
553
389
|
|
554
390
|
Parameters
|
555
391
|
----------
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
392
|
+
load_policy : str, default: "fresh"
|
393
|
+
The policy for loading the checkpoint. The following policies are supported:
|
394
|
+
- "eager": Loads the the latest available checkpoint within the namespace.
|
395
|
+
With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
|
396
|
+
will be loaded at the start of the task.
|
397
|
+
- "none": Do not load any checkpoint
|
398
|
+
- "fresh": Loads the lastest checkpoint created within the running Task.
|
399
|
+
This mode helps loading checkpoints across various retry attempts of the same task.
|
400
|
+
With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
|
401
|
+
created within the task will be loaded when the task is retries execution on failure.
|
402
|
+
|
403
|
+
temp_dir_root : str, default: None
|
404
|
+
The root directory under which `current.checkpoint.directory` will be created.
|
405
|
+
"""
|
406
|
+
...
|
407
|
+
|
408
|
+
@typing.overload
|
409
|
+
def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
410
|
+
...
|
411
|
+
|
412
|
+
@typing.overload
|
413
|
+
def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
414
|
+
...
|
415
|
+
|
416
|
+
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):
|
417
|
+
"""
|
418
|
+
Enables checkpointing for a step.
|
419
|
+
|
420
|
+
|
421
|
+
|
422
|
+
Parameters
|
423
|
+
----------
|
424
|
+
load_policy : str, default: "fresh"
|
425
|
+
The policy for loading the checkpoint. The following policies are supported:
|
426
|
+
- "eager": Loads the the latest available checkpoint within the namespace.
|
427
|
+
With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
|
428
|
+
will be loaded at the start of the task.
|
429
|
+
- "none": Do not load any checkpoint
|
430
|
+
- "fresh": Loads the lastest checkpoint created within the running Task.
|
431
|
+
This mode helps loading checkpoints across various retry attempts of the same task.
|
432
|
+
With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
|
433
|
+
created within the task will be loaded when the task is retries execution on failure.
|
434
|
+
|
435
|
+
temp_dir_root : str, default: None
|
436
|
+
The root directory under which `current.checkpoint.directory` will be created.
|
437
|
+
"""
|
438
|
+
...
|
439
|
+
|
440
|
+
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]]]:
|
441
|
+
"""
|
442
|
+
Decorator that helps cache, version and store models/datasets from huggingface hub.
|
443
|
+
|
444
|
+
|
445
|
+
Parameters
|
446
|
+
----------
|
447
|
+
temp_dir_root : str, optional
|
448
|
+
The root directory that will hold the temporary directory where objects will be downloaded.
|
449
|
+
|
450
|
+
load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
|
451
|
+
The list of repos (models/datasets) to load.
|
452
|
+
|
453
|
+
Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
|
454
|
+
|
455
|
+
- If repo (model/dataset) is not found in the datastore:
|
456
|
+
- Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
|
457
|
+
- Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
|
458
|
+
- All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
|
459
|
+
|
460
|
+
- If repo is found in the datastore:
|
461
|
+
- Loads it directly from datastore to local path (can be temporary directory or specified path)
|
462
|
+
"""
|
463
|
+
...
|
464
|
+
|
465
|
+
@typing.overload
|
466
|
+
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]]]:
|
467
|
+
"""
|
468
|
+
Specifies the resources needed when executing this step.
|
469
|
+
|
470
|
+
Use `@resources` to specify the resource requirements
|
471
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
472
|
+
|
473
|
+
You can choose the compute layer on the command line by executing e.g.
|
474
|
+
```
|
475
|
+
python myflow.py run --with batch
|
476
|
+
```
|
477
|
+
or
|
478
|
+
```
|
479
|
+
python myflow.py run --with kubernetes
|
480
|
+
```
|
481
|
+
which executes the flow on the desired system using the
|
482
|
+
requirements specified in `@resources`.
|
483
|
+
|
484
|
+
|
485
|
+
Parameters
|
486
|
+
----------
|
487
|
+
cpu : int, default 1
|
488
|
+
Number of CPUs required for this step.
|
489
|
+
gpu : int, optional, default None
|
490
|
+
Number of GPUs required for this step.
|
491
|
+
disk : int, optional, default None
|
561
492
|
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
562
493
|
memory : int, default 4096
|
563
494
|
Memory size (in MB) required for this step.
|
@@ -610,6 +541,76 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
610
541
|
"""
|
611
542
|
...
|
612
543
|
|
544
|
+
def app_deploy(*, app_port: int, app_name: 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]]]:
|
545
|
+
"""
|
546
|
+
Specifies that this step is used to deploy an instance of the app.
|
547
|
+
Requires that self.app_name, self.app_port, self.entrypoint and self.deployDir is set.
|
548
|
+
|
549
|
+
|
550
|
+
Parameters
|
551
|
+
----------
|
552
|
+
app_port : int
|
553
|
+
Number of GPUs to use.
|
554
|
+
app_name : str
|
555
|
+
Name of the app to deploy.
|
556
|
+
"""
|
557
|
+
...
|
558
|
+
|
559
|
+
@typing.overload
|
560
|
+
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]]]:
|
561
|
+
"""
|
562
|
+
Specifies the number of times the task corresponding
|
563
|
+
to a step needs to be retried.
|
564
|
+
|
565
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
566
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
567
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
568
|
+
|
569
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
570
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
571
|
+
ensuring that the flow execution can continue.
|
572
|
+
|
573
|
+
|
574
|
+
Parameters
|
575
|
+
----------
|
576
|
+
times : int, default 3
|
577
|
+
Number of times to retry this task.
|
578
|
+
minutes_between_retries : int, default 2
|
579
|
+
Number of minutes between retries.
|
580
|
+
"""
|
581
|
+
...
|
582
|
+
|
583
|
+
@typing.overload
|
584
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
585
|
+
...
|
586
|
+
|
587
|
+
@typing.overload
|
588
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
589
|
+
...
|
590
|
+
|
591
|
+
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):
|
592
|
+
"""
|
593
|
+
Specifies the number of times the task corresponding
|
594
|
+
to a step needs to be retried.
|
595
|
+
|
596
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
597
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
598
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
599
|
+
|
600
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
601
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
602
|
+
ensuring that the flow execution can continue.
|
603
|
+
|
604
|
+
|
605
|
+
Parameters
|
606
|
+
----------
|
607
|
+
times : int, default 3
|
608
|
+
Number of times to retry this task.
|
609
|
+
minutes_between_retries : int, default 2
|
610
|
+
Number of minutes between retries.
|
611
|
+
"""
|
612
|
+
...
|
613
|
+
|
613
614
|
def ollama(*, models: list, backend: str, force_pull: bool, cache_update_policy: str, force_cache_update: bool, debug: bool, circuit_breaker_config: dict, timeout_config: dict) -> 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]]]:
|
614
615
|
"""
|
615
616
|
This decorator is used to run Ollama APIs as Metaflow task sidecars.
|
@@ -653,57 +654,6 @@ def ollama(*, models: list, backend: str, force_pull: bool, cache_update_policy:
|
|
653
654
|
"""
|
654
655
|
...
|
655
656
|
|
656
|
-
@typing.overload
|
657
|
-
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]]]:
|
658
|
-
"""
|
659
|
-
Specifies the PyPI packages for the step.
|
660
|
-
|
661
|
-
Information in this decorator will augment any
|
662
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
663
|
-
you can use `@pypi_base` to set packages required by all
|
664
|
-
steps and use `@pypi` to specify step-specific overrides.
|
665
|
-
|
666
|
-
|
667
|
-
Parameters
|
668
|
-
----------
|
669
|
-
packages : Dict[str, str], default: {}
|
670
|
-
Packages to use for this step. The key is the name of the package
|
671
|
-
and the value is the version to use.
|
672
|
-
python : str, optional, default: None
|
673
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
674
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
675
|
-
"""
|
676
|
-
...
|
677
|
-
|
678
|
-
@typing.overload
|
679
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
680
|
-
...
|
681
|
-
|
682
|
-
@typing.overload
|
683
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
684
|
-
...
|
685
|
-
|
686
|
-
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):
|
687
|
-
"""
|
688
|
-
Specifies the PyPI packages for the step.
|
689
|
-
|
690
|
-
Information in this decorator will augment any
|
691
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
692
|
-
you can use `@pypi_base` to set packages required by all
|
693
|
-
steps and use `@pypi` to specify step-specific overrides.
|
694
|
-
|
695
|
-
|
696
|
-
Parameters
|
697
|
-
----------
|
698
|
-
packages : Dict[str, str], default: {}
|
699
|
-
Packages to use for this step. The key is the name of the package
|
700
|
-
and the value is the version to use.
|
701
|
-
python : str, optional, default: None
|
702
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
703
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
704
|
-
"""
|
705
|
-
...
|
706
|
-
|
707
657
|
@typing.overload
|
708
658
|
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
709
659
|
"""
|
@@ -722,57 +672,37 @@ def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepF
|
|
722
672
|
...
|
723
673
|
|
724
674
|
@typing.overload
|
725
|
-
def
|
675
|
+
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]]]:
|
726
676
|
"""
|
727
|
-
Specifies
|
728
|
-
|
729
|
-
|
730
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
731
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
732
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
733
|
-
|
734
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
735
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
736
|
-
ensuring that the flow execution can continue.
|
677
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
678
|
+
the execution of a step.
|
737
679
|
|
738
680
|
|
739
681
|
Parameters
|
740
682
|
----------
|
741
|
-
|
742
|
-
|
743
|
-
minutes_between_retries : int, default 2
|
744
|
-
Number of minutes between retries.
|
683
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
684
|
+
List of secret specs, defining how the secrets are to be retrieved
|
745
685
|
"""
|
746
686
|
...
|
747
687
|
|
748
688
|
@typing.overload
|
749
|
-
def
|
689
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
750
690
|
...
|
751
691
|
|
752
692
|
@typing.overload
|
753
|
-
def
|
693
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
754
694
|
...
|
755
695
|
|
756
|
-
def
|
696
|
+
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]]] = []):
|
757
697
|
"""
|
758
|
-
Specifies
|
759
|
-
|
760
|
-
|
761
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
762
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
763
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
764
|
-
|
765
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
766
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
767
|
-
ensuring that the flow execution can continue.
|
698
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
699
|
+
the execution of a step.
|
768
700
|
|
769
701
|
|
770
702
|
Parameters
|
771
703
|
----------
|
772
|
-
|
773
|
-
|
774
|
-
minutes_between_retries : int, default 2
|
775
|
-
Number of minutes between retries.
|
704
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
705
|
+
List of secret specs, defining how the secrets are to be retrieved
|
776
706
|
"""
|
777
707
|
...
|
778
708
|
|
@@ -827,75 +757,87 @@ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
827
757
|
"""
|
828
758
|
...
|
829
759
|
|
830
|
-
|
760
|
+
@typing.overload
|
761
|
+
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]]]:
|
831
762
|
"""
|
832
|
-
Specifies
|
833
|
-
|
763
|
+
Specifies the PyPI packages for the step.
|
764
|
+
|
765
|
+
Information in this decorator will augment any
|
766
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
767
|
+
you can use `@pypi_base` to set packages required by all
|
768
|
+
steps and use `@pypi` to specify step-specific overrides.
|
834
769
|
|
835
770
|
|
836
771
|
Parameters
|
837
772
|
----------
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
773
|
+
packages : Dict[str, str], default: {}
|
774
|
+
Packages to use for this step. The key is the name of the package
|
775
|
+
and the value is the version to use.
|
776
|
+
python : str, optional, default: None
|
777
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
778
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
842
779
|
"""
|
843
780
|
...
|
844
781
|
|
845
782
|
@typing.overload
|
846
|
-
def
|
783
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
784
|
+
...
|
785
|
+
|
786
|
+
@typing.overload
|
787
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
788
|
+
...
|
789
|
+
|
790
|
+
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):
|
847
791
|
"""
|
848
|
-
|
792
|
+
Specifies the PyPI packages for the step.
|
849
793
|
|
794
|
+
Information in this decorator will augment any
|
795
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
796
|
+
you can use `@pypi_base` to set packages required by all
|
797
|
+
steps and use `@pypi` to specify step-specific overrides.
|
850
798
|
|
851
799
|
|
852
800
|
Parameters
|
853
801
|
----------
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
802
|
+
packages : Dict[str, str], default: {}
|
803
|
+
Packages to use for this step. The key is the name of the package
|
804
|
+
and the value is the version to use.
|
805
|
+
python : str, optional, default: None
|
806
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
807
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
808
|
+
"""
|
809
|
+
...
|
810
|
+
|
811
|
+
@typing.overload
|
812
|
+
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]]]:
|
813
|
+
"""
|
814
|
+
Specifies environment variables to be set prior to the execution of a step.
|
864
815
|
|
865
|
-
|
866
|
-
|
816
|
+
|
817
|
+
Parameters
|
818
|
+
----------
|
819
|
+
vars : Dict[str, str], default {}
|
820
|
+
Dictionary of environment variables to set.
|
867
821
|
"""
|
868
822
|
...
|
869
823
|
|
870
824
|
@typing.overload
|
871
|
-
def
|
825
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
872
826
|
...
|
873
827
|
|
874
828
|
@typing.overload
|
875
|
-
def
|
829
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
876
830
|
...
|
877
831
|
|
878
|
-
def
|
832
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
879
833
|
"""
|
880
|
-
|
881
|
-
|
834
|
+
Specifies environment variables to be set prior to the execution of a step.
|
882
835
|
|
883
836
|
|
884
837
|
Parameters
|
885
838
|
----------
|
886
|
-
|
887
|
-
|
888
|
-
- "eager": Loads the the latest available checkpoint within the namespace.
|
889
|
-
With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
|
890
|
-
will be loaded at the start of the task.
|
891
|
-
- "none": Do not load any checkpoint
|
892
|
-
- "fresh": Loads the lastest checkpoint created within the running Task.
|
893
|
-
This mode helps loading checkpoints across various retry attempts of the same task.
|
894
|
-
With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
|
895
|
-
created within the task will be loaded when the task is retries execution on failure.
|
896
|
-
|
897
|
-
temp_dir_root : str, default: None
|
898
|
-
The root directory under which `current.checkpoint.directory` will be created.
|
839
|
+
vars : Dict[str, str], default {}
|
840
|
+
Dictionary of environment variables to set.
|
899
841
|
"""
|
900
842
|
...
|
901
843
|
|
@@ -972,6 +914,65 @@ def nvidia(*, gpu: int, gpu_type: str, queue_timeout: int) -> typing.Callable[[t
|
|
972
914
|
"""
|
973
915
|
...
|
974
916
|
|
917
|
+
@typing.overload
|
918
|
+
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]]]:
|
919
|
+
"""
|
920
|
+
Specifies the Conda environment for the step.
|
921
|
+
|
922
|
+
Information in this decorator will augment any
|
923
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
924
|
+
you can use `@conda_base` to set packages required by all
|
925
|
+
steps and use `@conda` to specify step-specific overrides.
|
926
|
+
|
927
|
+
|
928
|
+
Parameters
|
929
|
+
----------
|
930
|
+
packages : Dict[str, str], default {}
|
931
|
+
Packages to use for this step. The key is the name of the package
|
932
|
+
and the value is the version to use.
|
933
|
+
libraries : Dict[str, str], default {}
|
934
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
935
|
+
python : str, optional, default None
|
936
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
937
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
938
|
+
disabled : bool, default False
|
939
|
+
If set to True, disables @conda.
|
940
|
+
"""
|
941
|
+
...
|
942
|
+
|
943
|
+
@typing.overload
|
944
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
945
|
+
...
|
946
|
+
|
947
|
+
@typing.overload
|
948
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
949
|
+
...
|
950
|
+
|
951
|
+
def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
952
|
+
"""
|
953
|
+
Specifies the Conda environment for the step.
|
954
|
+
|
955
|
+
Information in this decorator will augment any
|
956
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
957
|
+
you can use `@conda_base` to set packages required by all
|
958
|
+
steps and use `@conda` to specify step-specific overrides.
|
959
|
+
|
960
|
+
|
961
|
+
Parameters
|
962
|
+
----------
|
963
|
+
packages : Dict[str, str], default {}
|
964
|
+
Packages to use for this step. The key is the name of the package
|
965
|
+
and the value is the version to use.
|
966
|
+
libraries : Dict[str, str], default {}
|
967
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
968
|
+
python : str, optional, default None
|
969
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
970
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
971
|
+
disabled : bool, default False
|
972
|
+
If set to True, disables @conda.
|
973
|
+
"""
|
974
|
+
...
|
975
|
+
|
975
976
|
def with_artifact_store(f: typing.Optional[typing.Type[FlowSpecDerived]] = None):
|
976
977
|
"""
|
977
978
|
Allows setting external datastores to save data for the
|
@@ -1071,18 +1072,139 @@ def with_artifact_store(f: typing.Optional[typing.Type[FlowSpecDerived]] = None)
|
|
1071
1072
|
Parameters:
|
1072
1073
|
----------
|
1073
1074
|
|
1074
|
-
type: str
|
1075
|
-
The type of the datastore. Can be one of 's3', 'gcs', 'azure' or any other supported metaflow Datastore.
|
1075
|
+
type: str
|
1076
|
+
The type of the datastore. Can be one of 's3', 'gcs', 'azure' or any other supported metaflow Datastore.
|
1077
|
+
|
1078
|
+
config: dict or Callable
|
1079
|
+
Dictionary of configuration options for the datastore. The following keys are required:
|
1080
|
+
- root: The root path in the datastore where the data will be saved. (needs to be in the format expected by the datastore)
|
1081
|
+
- example: 's3://bucket-name/path/to/root'
|
1082
|
+
- example: 'gs://bucket-name/path/to/root'
|
1083
|
+
- example: 'https://myblockacc.blob.core.windows.net/metaflow/'
|
1084
|
+
- role_arn (optional): AWS IAM role to access s3 bucket (only when `type` is 's3')
|
1085
|
+
- session_vars (optional): AWS session variables to access s3 bucket (only when `type` is 's3')
|
1086
|
+
- client_params (optional): AWS client parameters to access s3 bucket (only when `type` is 's3')
|
1087
|
+
"""
|
1088
|
+
...
|
1089
|
+
|
1090
|
+
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]]:
|
1091
|
+
"""
|
1092
|
+
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)
|
1093
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1094
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1095
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1096
|
+
starts only after all sensors finish.
|
1097
|
+
|
1098
|
+
|
1099
|
+
Parameters
|
1100
|
+
----------
|
1101
|
+
timeout : int
|
1102
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1103
|
+
poke_interval : int
|
1104
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1105
|
+
mode : str
|
1106
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1107
|
+
exponential_backoff : bool
|
1108
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1109
|
+
pool : str
|
1110
|
+
the slot pool this task should run in,
|
1111
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1112
|
+
soft_fail : bool
|
1113
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1114
|
+
name : str
|
1115
|
+
Name of the sensor on Airflow
|
1116
|
+
description : str
|
1117
|
+
Description of sensor in the Airflow UI
|
1118
|
+
bucket_key : Union[str, List[str]]
|
1119
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1120
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1121
|
+
bucket_name : str
|
1122
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1123
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1124
|
+
wildcard_match : bool
|
1125
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1126
|
+
aws_conn_id : str
|
1127
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1128
|
+
verify : bool
|
1129
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1130
|
+
"""
|
1131
|
+
...
|
1132
|
+
|
1133
|
+
def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1134
|
+
"""
|
1135
|
+
Specifies what flows belong to the same project.
|
1136
|
+
|
1137
|
+
A project-specific namespace is created for all flows that
|
1138
|
+
use the same `@project(name)`.
|
1139
|
+
|
1140
|
+
|
1141
|
+
Parameters
|
1142
|
+
----------
|
1143
|
+
name : str
|
1144
|
+
Project name. Make sure that the name is unique amongst all
|
1145
|
+
projects that use the same production scheduler. The name may
|
1146
|
+
contain only lowercase alphanumeric characters and underscores.
|
1147
|
+
|
1148
|
+
branch : Optional[str], default None
|
1149
|
+
The branch to use. If not specified, the branch is set to
|
1150
|
+
`user.<username>` unless `production` is set to `True`. This can
|
1151
|
+
also be set on the command line using `--branch` as a top-level option.
|
1152
|
+
It is an error to specify `branch` in the decorator and on the command line.
|
1076
1153
|
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1154
|
+
production : bool, default False
|
1155
|
+
Whether or not the branch is the production branch. This can also be set on the
|
1156
|
+
command line using `--production` as a top-level option. It is an error to specify
|
1157
|
+
`production` in the decorator and on the command line.
|
1158
|
+
The project branch name will be:
|
1159
|
+
- if `branch` is specified:
|
1160
|
+
- if `production` is True: `prod.<branch>`
|
1161
|
+
- if `production` is False: `test.<branch>`
|
1162
|
+
- if `branch` is not specified:
|
1163
|
+
- if `production` is True: `prod`
|
1164
|
+
- if `production` is False: `user.<username>`
|
1165
|
+
"""
|
1166
|
+
...
|
1167
|
+
|
1168
|
+
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]]:
|
1169
|
+
"""
|
1170
|
+
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.
|
1171
|
+
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.
|
1172
|
+
|
1173
|
+
|
1174
|
+
Parameters
|
1175
|
+
----------
|
1176
|
+
timeout : int
|
1177
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1178
|
+
poke_interval : int
|
1179
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1180
|
+
mode : str
|
1181
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1182
|
+
exponential_backoff : bool
|
1183
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1184
|
+
pool : str
|
1185
|
+
the slot pool this task should run in,
|
1186
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1187
|
+
soft_fail : bool
|
1188
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1189
|
+
name : str
|
1190
|
+
Name of the sensor on Airflow
|
1191
|
+
description : str
|
1192
|
+
Description of sensor in the Airflow UI
|
1193
|
+
external_dag_id : str
|
1194
|
+
The dag_id that contains the task you want to wait for.
|
1195
|
+
external_task_ids : List[str]
|
1196
|
+
The list of task_ids that you want to wait for.
|
1197
|
+
If None (default value) the sensor waits for the DAG. (Default: None)
|
1198
|
+
allowed_states : List[str]
|
1199
|
+
Iterable of allowed states, (Default: ['success'])
|
1200
|
+
failed_states : List[str]
|
1201
|
+
Iterable of failed or dis-allowed states. (Default: None)
|
1202
|
+
execution_delta : datetime.timedelta
|
1203
|
+
time difference with the previous execution to look at,
|
1204
|
+
the default is the same logical date as the current task or DAG. (Default: None)
|
1205
|
+
check_existence: bool
|
1206
|
+
Set to True to check if the external task exists or check if
|
1207
|
+
the DAG to wait for exists. (Default: True)
|
1086
1208
|
"""
|
1087
1209
|
...
|
1088
1210
|
|
@@ -1188,47 +1310,6 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
|
|
1188
1310
|
"""
|
1189
1311
|
...
|
1190
1312
|
|
1191
|
-
@typing.overload
|
1192
|
-
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1193
|
-
"""
|
1194
|
-
Specifies the PyPI packages for all steps of the flow.
|
1195
|
-
|
1196
|
-
Use `@pypi_base` to set common packages required by all
|
1197
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1198
|
-
|
1199
|
-
Parameters
|
1200
|
-
----------
|
1201
|
-
packages : Dict[str, str], default: {}
|
1202
|
-
Packages to use for this flow. The key is the name of the package
|
1203
|
-
and the value is the version to use.
|
1204
|
-
python : str, optional, default: None
|
1205
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1206
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1207
|
-
"""
|
1208
|
-
...
|
1209
|
-
|
1210
|
-
@typing.overload
|
1211
|
-
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1212
|
-
...
|
1213
|
-
|
1214
|
-
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1215
|
-
"""
|
1216
|
-
Specifies the PyPI packages for all steps of the flow.
|
1217
|
-
|
1218
|
-
Use `@pypi_base` to set common packages required by all
|
1219
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1220
|
-
|
1221
|
-
Parameters
|
1222
|
-
----------
|
1223
|
-
packages : Dict[str, str], default: {}
|
1224
|
-
Packages to use for this flow. The key is the name of the package
|
1225
|
-
and the value is the version to use.
|
1226
|
-
python : str, optional, default: None
|
1227
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1228
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1229
|
-
"""
|
1230
|
-
...
|
1231
|
-
|
1232
1313
|
@typing.overload
|
1233
1314
|
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]]:
|
1234
1315
|
"""
|
@@ -1330,49 +1411,6 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
1330
1411
|
"""
|
1331
1412
|
...
|
1332
1413
|
|
1333
|
-
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]]:
|
1334
|
-
"""
|
1335
|
-
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)
|
1336
|
-
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1337
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1338
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1339
|
-
starts only after all sensors finish.
|
1340
|
-
|
1341
|
-
|
1342
|
-
Parameters
|
1343
|
-
----------
|
1344
|
-
timeout : int
|
1345
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
1346
|
-
poke_interval : int
|
1347
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
1348
|
-
mode : str
|
1349
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1350
|
-
exponential_backoff : bool
|
1351
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1352
|
-
pool : str
|
1353
|
-
the slot pool this task should run in,
|
1354
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1355
|
-
soft_fail : bool
|
1356
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1357
|
-
name : str
|
1358
|
-
Name of the sensor on Airflow
|
1359
|
-
description : str
|
1360
|
-
Description of sensor in the Airflow UI
|
1361
|
-
bucket_key : Union[str, List[str]]
|
1362
|
-
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1363
|
-
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1364
|
-
bucket_name : str
|
1365
|
-
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1366
|
-
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1367
|
-
wildcard_match : bool
|
1368
|
-
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1369
|
-
aws_conn_id : str
|
1370
|
-
a reference to the s3 connection on Airflow. (Default: None)
|
1371
|
-
verify : bool
|
1372
|
-
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1373
|
-
"""
|
1374
|
-
...
|
1375
|
-
|
1376
1414
|
@typing.overload
|
1377
1415
|
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]]:
|
1378
1416
|
"""
|
@@ -1466,81 +1504,44 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
1466
1504
|
"""
|
1467
1505
|
...
|
1468
1506
|
|
1469
|
-
|
1507
|
+
@typing.overload
|
1508
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1470
1509
|
"""
|
1471
|
-
Specifies
|
1472
|
-
|
1473
|
-
A project-specific namespace is created for all flows that
|
1474
|
-
use the same `@project(name)`.
|
1510
|
+
Specifies the PyPI packages for all steps of the flow.
|
1475
1511
|
|
1512
|
+
Use `@pypi_base` to set common packages required by all
|
1513
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1476
1514
|
|
1477
1515
|
Parameters
|
1478
1516
|
----------
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1485
|
-
The branch to use. If not specified, the branch is set to
|
1486
|
-
`user.<username>` unless `production` is set to `True`. This can
|
1487
|
-
also be set on the command line using `--branch` as a top-level option.
|
1488
|
-
It is an error to specify `branch` in the decorator and on the command line.
|
1489
|
-
|
1490
|
-
production : bool, default False
|
1491
|
-
Whether or not the branch is the production branch. This can also be set on the
|
1492
|
-
command line using `--production` as a top-level option. It is an error to specify
|
1493
|
-
`production` in the decorator and on the command line.
|
1494
|
-
The project branch name will be:
|
1495
|
-
- if `branch` is specified:
|
1496
|
-
- if `production` is True: `prod.<branch>`
|
1497
|
-
- if `production` is False: `test.<branch>`
|
1498
|
-
- if `branch` is not specified:
|
1499
|
-
- if `production` is True: `prod`
|
1500
|
-
- if `production` is False: `user.<username>`
|
1517
|
+
packages : Dict[str, str], default: {}
|
1518
|
+
Packages to use for this flow. The key is the name of the package
|
1519
|
+
and the value is the version to use.
|
1520
|
+
python : str, optional, default: None
|
1521
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1522
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1501
1523
|
"""
|
1502
1524
|
...
|
1503
1525
|
|
1504
|
-
|
1526
|
+
@typing.overload
|
1527
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1528
|
+
...
|
1529
|
+
|
1530
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1505
1531
|
"""
|
1506
|
-
|
1507
|
-
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.
|
1532
|
+
Specifies the PyPI packages for all steps of the flow.
|
1508
1533
|
|
1534
|
+
Use `@pypi_base` to set common packages required by all
|
1535
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1509
1536
|
|
1510
1537
|
Parameters
|
1511
1538
|
----------
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
1515
|
-
|
1516
|
-
|
1517
|
-
|
1518
|
-
exponential_backoff : bool
|
1519
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1520
|
-
pool : str
|
1521
|
-
the slot pool this task should run in,
|
1522
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1523
|
-
soft_fail : bool
|
1524
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1525
|
-
name : str
|
1526
|
-
Name of the sensor on Airflow
|
1527
|
-
description : str
|
1528
|
-
Description of sensor in the Airflow UI
|
1529
|
-
external_dag_id : str
|
1530
|
-
The dag_id that contains the task you want to wait for.
|
1531
|
-
external_task_ids : List[str]
|
1532
|
-
The list of task_ids that you want to wait for.
|
1533
|
-
If None (default value) the sensor waits for the DAG. (Default: None)
|
1534
|
-
allowed_states : List[str]
|
1535
|
-
Iterable of allowed states, (Default: ['success'])
|
1536
|
-
failed_states : List[str]
|
1537
|
-
Iterable of failed or dis-allowed states. (Default: None)
|
1538
|
-
execution_delta : datetime.timedelta
|
1539
|
-
time difference with the previous execution to look at,
|
1540
|
-
the default is the same logical date as the current task or DAG. (Default: None)
|
1541
|
-
check_existence: bool
|
1542
|
-
Set to True to check if the external task exists or check if
|
1543
|
-
the DAG to wait for exists. (Default: True)
|
1539
|
+
packages : Dict[str, str], default: {}
|
1540
|
+
Packages to use for this flow. The key is the name of the package
|
1541
|
+
and the value is the version to use.
|
1542
|
+
python : str, optional, default: None
|
1543
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1544
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1544
1545
|
"""
|
1545
1546
|
...
|
1546
1547
|
|