ob-metaflow-stubs 6.0.3.176rc2__py2.py3-none-any.whl → 6.0.3.176rc3__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 +760 -760
- 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 +4 -4
- metaflow-stubs/client/filecache.pyi +1 -1
- metaflow-stubs/events.pyi +2 -2
- metaflow-stubs/exception.pyi +1 -1
- metaflow-stubs/flowspec.pyi +3 -3
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +2 -2
- 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 +1 -1
- metaflow-stubs/metadata_provider/util.pyi +1 -1
- metaflow-stubs/metaflow_config.pyi +1 -1
- metaflow-stubs/metaflow_current.pyi +98 -98
- 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 +2 -2
- 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 +1 -1
- 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 +2 -2
- 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 +3 -3
- 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 +2 -2
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +1 -1
- 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/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/fast_bakery/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/baker.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/docker_environment.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/fast_bakery.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 +1 -1
- metaflow-stubs/multicore_utils.pyi +1 -1
- metaflow-stubs/ob_internal.pyi +1 -1
- metaflow-stubs/parameters.pyi +2 -2
- metaflow-stubs/plugins/__init__.pyi +12 -12
- 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 +1 -1
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +1 -1
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +1 -1
- 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 +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +1 -1
- 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 +2 -2
- metaflow-stubs/plugins/cards/card_modules/card.pyi +1 -1
- metaflow-stubs/plugins/cards/card_modules/components.pyi +2 -2
- 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 +1 -1
- 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 +3 -3
- 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 +1 -1
- 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 +4 -4
- 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 +2 -2
- 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 +1 -1
- metaflow-stubs/plugins/timeout_decorator.pyi +1 -1
- metaflow-stubs/plugins/torchtune/__init__.pyi +1 -1
- metaflow-stubs/plugins/uv/__init__.pyi +1 -1
- metaflow-stubs/plugins/uv/uv_environment.pyi +1 -1
- 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 +1 -1
- metaflow-stubs/runner/metaflow_runner.pyi +2 -2
- 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 +1 -1
- 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 +4 -4
- metaflow-stubs/user_configs/config_options.pyi +1 -1
- metaflow-stubs/user_configs/config_parameters.pyi +4 -4
- {ob_metaflow_stubs-6.0.3.176rc2.dist-info → ob_metaflow_stubs-6.0.3.176rc3.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-6.0.3.176rc3.dist-info/RECORD +218 -0
- ob_metaflow_stubs-6.0.3.176rc2.dist-info/RECORD +0 -218
- {ob_metaflow_stubs-6.0.3.176rc2.dist-info → ob_metaflow_stubs-6.0.3.176rc3.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-6.0.3.176rc2.dist-info → ob_metaflow_stubs-6.0.3.176rc3.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-04T06:35:02.879434 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -36,17 +36,17 @@ 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
38
|
from . import cards as cards
|
39
|
-
from . import metaflow_git as metaflow_git
|
40
39
|
from . import tuple_util as tuple_util
|
40
|
+
from . import metaflow_git as metaflow_git
|
41
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 pyproject_toml_parser as pyproject_toml_parser
|
48
47
|
from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
|
49
48
|
from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
|
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
|
52
52
|
from .client.core import get_namespace as get_namespace
|
@@ -154,133 +154,6 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
154
154
|
"""
|
155
155
|
...
|
156
156
|
|
157
|
-
@typing.overload
|
158
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
159
|
-
"""
|
160
|
-
Decorator prototype for all step decorators. This function gets specialized
|
161
|
-
and imported for all decorators types by _import_plugin_decorators().
|
162
|
-
"""
|
163
|
-
...
|
164
|
-
|
165
|
-
@typing.overload
|
166
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
167
|
-
...
|
168
|
-
|
169
|
-
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
170
|
-
"""
|
171
|
-
Decorator prototype for all step decorators. This function gets specialized
|
172
|
-
and imported for all decorators types by _import_plugin_decorators().
|
173
|
-
"""
|
174
|
-
...
|
175
|
-
|
176
|
-
@typing.overload
|
177
|
-
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]]]:
|
178
|
-
"""
|
179
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
180
|
-
|
181
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
182
|
-
|
183
|
-
|
184
|
-
Parameters
|
185
|
-
----------
|
186
|
-
type : str, default 'default'
|
187
|
-
Card type.
|
188
|
-
id : str, optional, default None
|
189
|
-
If multiple cards are present, use this id to identify this card.
|
190
|
-
options : Dict[str, Any], default {}
|
191
|
-
Options passed to the card. The contents depend on the card type.
|
192
|
-
timeout : int, default 45
|
193
|
-
Interrupt reporting if it takes more than this many seconds.
|
194
|
-
"""
|
195
|
-
...
|
196
|
-
|
197
|
-
@typing.overload
|
198
|
-
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
199
|
-
...
|
200
|
-
|
201
|
-
@typing.overload
|
202
|
-
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
203
|
-
...
|
204
|
-
|
205
|
-
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):
|
206
|
-
"""
|
207
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
208
|
-
|
209
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
210
|
-
|
211
|
-
|
212
|
-
Parameters
|
213
|
-
----------
|
214
|
-
type : str, default 'default'
|
215
|
-
Card type.
|
216
|
-
id : str, optional, default None
|
217
|
-
If multiple cards are present, use this id to identify this card.
|
218
|
-
options : Dict[str, Any], default {}
|
219
|
-
Options passed to the card. The contents depend on the card type.
|
220
|
-
timeout : int, default 45
|
221
|
-
Interrupt reporting if it takes more than this many seconds.
|
222
|
-
"""
|
223
|
-
...
|
224
|
-
|
225
|
-
@typing.overload
|
226
|
-
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]]]:
|
227
|
-
"""
|
228
|
-
Specifies a timeout for your step.
|
229
|
-
|
230
|
-
This decorator is useful if this step may hang indefinitely.
|
231
|
-
|
232
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
233
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
234
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
235
|
-
|
236
|
-
Note that all the values specified in parameters are added together so if you specify
|
237
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
238
|
-
|
239
|
-
|
240
|
-
Parameters
|
241
|
-
----------
|
242
|
-
seconds : int, default 0
|
243
|
-
Number of seconds to wait prior to timing out.
|
244
|
-
minutes : int, default 0
|
245
|
-
Number of minutes to wait prior to timing out.
|
246
|
-
hours : int, default 0
|
247
|
-
Number of hours to wait prior to timing out.
|
248
|
-
"""
|
249
|
-
...
|
250
|
-
|
251
|
-
@typing.overload
|
252
|
-
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
253
|
-
...
|
254
|
-
|
255
|
-
@typing.overload
|
256
|
-
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
257
|
-
...
|
258
|
-
|
259
|
-
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):
|
260
|
-
"""
|
261
|
-
Specifies a timeout for your step.
|
262
|
-
|
263
|
-
This decorator is useful if this step may hang indefinitely.
|
264
|
-
|
265
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
266
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
267
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
268
|
-
|
269
|
-
Note that all the values specified in parameters are added together so if you specify
|
270
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
271
|
-
|
272
|
-
|
273
|
-
Parameters
|
274
|
-
----------
|
275
|
-
seconds : int, default 0
|
276
|
-
Number of seconds to wait prior to timing out.
|
277
|
-
minutes : int, default 0
|
278
|
-
Number of minutes to wait prior to timing out.
|
279
|
-
hours : int, default 0
|
280
|
-
Number of hours to wait prior to timing out.
|
281
|
-
"""
|
282
|
-
...
|
283
|
-
|
284
157
|
@typing.overload
|
285
158
|
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]]]:
|
286
159
|
"""
|
@@ -360,112 +233,110 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
360
233
|
"""
|
361
234
|
...
|
362
235
|
|
363
|
-
|
364
|
-
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]]]:
|
236
|
+
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] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', 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', security_context: typing.Optional[typing.Dict[str, typing.Any]] = 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]]]:
|
365
237
|
"""
|
366
|
-
Specifies
|
367
|
-
|
368
|
-
Information in this decorator will augment any
|
369
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
370
|
-
you can use `@conda_base` to set packages required by all
|
371
|
-
steps and use `@conda` to specify step-specific overrides.
|
238
|
+
Specifies that this step should execute on Kubernetes.
|
372
239
|
|
373
240
|
|
374
241
|
Parameters
|
375
242
|
----------
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
243
|
+
cpu : int, default 1
|
244
|
+
Number of CPUs required for this step. If `@resources` is
|
245
|
+
also present, the maximum value from all decorators is used.
|
246
|
+
memory : int, default 4096
|
247
|
+
Memory size (in MB) required for this step. If
|
248
|
+
`@resources` is also present, the maximum value from all decorators is
|
249
|
+
used.
|
250
|
+
disk : int, default 10240
|
251
|
+
Disk size (in MB) required for this step. If
|
252
|
+
`@resources` is also present, the maximum value from all decorators is
|
253
|
+
used.
|
254
|
+
image : str, optional, default None
|
255
|
+
Docker image to use when launching on Kubernetes. If not specified, and
|
256
|
+
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
257
|
+
not, a default Docker image mapping to the current version of Python is used.
|
258
|
+
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
259
|
+
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
260
|
+
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
261
|
+
Kubernetes service account to use when launching pod in Kubernetes.
|
262
|
+
secrets : List[str], optional, default None
|
263
|
+
Kubernetes secrets to use when launching pod in Kubernetes. These
|
264
|
+
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
265
|
+
in Metaflow configuration.
|
266
|
+
node_selector: Union[Dict[str,str], str], optional, default None
|
267
|
+
Kubernetes node selector(s) to apply to the pod running the task.
|
268
|
+
Can be passed in as a comma separated string of values e.g.
|
269
|
+
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
270
|
+
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
271
|
+
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
272
|
+
Kubernetes namespace to use when launching pod in Kubernetes.
|
273
|
+
gpu : int, optional, default None
|
274
|
+
Number of GPUs required for this step. A value of zero implies that
|
275
|
+
the scheduled node should not have GPUs.
|
276
|
+
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
277
|
+
The vendor of the GPUs to be used for this step.
|
278
|
+
tolerations : List[str], default []
|
279
|
+
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
280
|
+
Kubernetes tolerations to use when launching pod in Kubernetes.
|
281
|
+
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
282
|
+
Kubernetes labels to use when launching pod in Kubernetes.
|
283
|
+
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
284
|
+
Kubernetes annotations to use when launching pod in Kubernetes.
|
285
|
+
use_tmpfs : bool, default False
|
286
|
+
This enables an explicit tmpfs mount for this step.
|
287
|
+
tmpfs_tempdir : bool, default True
|
288
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
289
|
+
tmpfs_size : int, optional, default: None
|
290
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
291
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
292
|
+
memory allocated for this step.
|
293
|
+
tmpfs_path : str, optional, default /metaflow_temp
|
294
|
+
Path to tmpfs mount for this step.
|
295
|
+
persistent_volume_claims : Dict[str, str], optional, default None
|
296
|
+
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
297
|
+
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
298
|
+
shared_memory: int, optional
|
299
|
+
Shared memory size (in MiB) required for this step
|
300
|
+
port: int, optional
|
301
|
+
Port number to specify in the Kubernetes job object
|
302
|
+
compute_pool : str, optional, default None
|
303
|
+
Compute pool to be used for for this step.
|
304
|
+
If not specified, any accessible compute pool within the perimeter is used.
|
305
|
+
hostname_resolution_timeout: int, default 10 * 60
|
306
|
+
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
307
|
+
Only applicable when @parallel is used.
|
308
|
+
qos: str, default: Burstable
|
309
|
+
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
310
|
+
|
311
|
+
security_context: Dict[str, Any], optional, default None
|
312
|
+
Container security context. Applies to the task container. Allows the following keys:
|
313
|
+
- privileged: bool, optional, default None
|
314
|
+
- allow_privilege_escalation: bool, optional, default None
|
315
|
+
- run_as_user: int, optional, default None
|
316
|
+
- run_as_group: int, optional, default None
|
317
|
+
- run_as_non_root: bool, optional, default None
|
386
318
|
"""
|
387
319
|
...
|
388
320
|
|
389
|
-
|
390
|
-
|
321
|
+
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]]]:
|
322
|
+
"""
|
323
|
+
Specifies that this step should execute on DGX cloud.
|
324
|
+
|
325
|
+
|
326
|
+
Parameters
|
327
|
+
----------
|
328
|
+
gpu : int
|
329
|
+
Number of GPUs to use.
|
330
|
+
gpu_type : str
|
331
|
+
Type of Nvidia GPU to use.
|
332
|
+
"""
|
391
333
|
...
|
392
334
|
|
393
335
|
@typing.overload
|
394
|
-
def
|
395
|
-
...
|
396
|
-
|
397
|
-
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):
|
336
|
+
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]]]:
|
398
337
|
"""
|
399
|
-
Specifies
|
400
|
-
|
401
|
-
Information in this decorator will augment any
|
402
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
403
|
-
you can use `@conda_base` to set packages required by all
|
404
|
-
steps and use `@conda` to specify step-specific overrides.
|
405
|
-
|
406
|
-
|
407
|
-
Parameters
|
408
|
-
----------
|
409
|
-
packages : Dict[str, str], default {}
|
410
|
-
Packages to use for this step. The key is the name of the package
|
411
|
-
and the value is the version to use.
|
412
|
-
libraries : Dict[str, str], default {}
|
413
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
414
|
-
python : str, optional, default None
|
415
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
416
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
417
|
-
disabled : bool, default False
|
418
|
-
If set to True, disables @conda.
|
419
|
-
"""
|
420
|
-
...
|
421
|
-
|
422
|
-
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]]]:
|
423
|
-
"""
|
424
|
-
Decorator that helps cache, version and store models/datasets from huggingface hub.
|
425
|
-
|
426
|
-
|
427
|
-
Parameters
|
428
|
-
----------
|
429
|
-
temp_dir_root : str, optional
|
430
|
-
The root directory that will hold the temporary directory where objects will be downloaded.
|
431
|
-
|
432
|
-
load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
|
433
|
-
The list of repos (models/datasets) to load.
|
434
|
-
|
435
|
-
Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
|
436
|
-
|
437
|
-
- If repo (model/dataset) is not found in the datastore:
|
438
|
-
- Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
|
439
|
-
- Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
|
440
|
-
- All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
|
441
|
-
|
442
|
-
- If repo is found in the datastore:
|
443
|
-
- Loads it directly from datastore to local path (can be temporary directory or specified path)
|
444
|
-
"""
|
445
|
-
...
|
446
|
-
|
447
|
-
@typing.overload
|
448
|
-
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
449
|
-
"""
|
450
|
-
Internal decorator to support Fast bakery
|
451
|
-
"""
|
452
|
-
...
|
453
|
-
|
454
|
-
@typing.overload
|
455
|
-
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
456
|
-
...
|
457
|
-
|
458
|
-
def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
459
|
-
"""
|
460
|
-
Internal decorator to support Fast bakery
|
461
|
-
"""
|
462
|
-
...
|
463
|
-
|
464
|
-
@typing.overload
|
465
|
-
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]]]:
|
466
|
-
"""
|
467
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
468
|
-
the execution of a step.
|
338
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
339
|
+
the execution of a step.
|
469
340
|
|
470
341
|
|
471
342
|
Parameters
|
@@ -496,22 +367,6 @@ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
496
367
|
"""
|
497
368
|
...
|
498
369
|
|
499
|
-
def nvidia(*, gpu: int, gpu_type: str, queue_timeout: int) -> 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]]]:
|
500
|
-
"""
|
501
|
-
Specifies that this step should execute on DGX cloud.
|
502
|
-
|
503
|
-
|
504
|
-
Parameters
|
505
|
-
----------
|
506
|
-
gpu : int
|
507
|
-
Number of GPUs to use.
|
508
|
-
gpu_type : str
|
509
|
-
Type of Nvidia GPU to use.
|
510
|
-
queue_timeout : int
|
511
|
-
Time to keep the job in NVCF's queue.
|
512
|
-
"""
|
513
|
-
...
|
514
|
-
|
515
370
|
@typing.overload
|
516
371
|
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]]]:
|
517
372
|
"""
|
@@ -545,140 +400,58 @@ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], Non
|
|
545
400
|
"""
|
546
401
|
...
|
547
402
|
|
548
|
-
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]]]:
|
549
|
-
"""
|
550
|
-
Specifies that this step should execute on DGX cloud.
|
551
|
-
|
552
|
-
|
553
|
-
Parameters
|
554
|
-
----------
|
555
|
-
gpu : int
|
556
|
-
Number of GPUs to use.
|
557
|
-
gpu_type : str
|
558
|
-
Type of Nvidia GPU to use.
|
559
|
-
"""
|
560
|
-
...
|
561
|
-
|
562
|
-
@typing.overload
|
563
|
-
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]]]:
|
564
|
-
"""
|
565
|
-
Specifies the PyPI packages for the step.
|
566
|
-
|
567
|
-
Information in this decorator will augment any
|
568
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
569
|
-
you can use `@pypi_base` to set packages required by all
|
570
|
-
steps and use `@pypi` to specify step-specific overrides.
|
571
|
-
|
572
|
-
|
573
|
-
Parameters
|
574
|
-
----------
|
575
|
-
packages : Dict[str, str], default: {}
|
576
|
-
Packages to use for this step. The key is the name of the package
|
577
|
-
and the value is the version to use.
|
578
|
-
python : str, optional, default: None
|
579
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
580
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
581
|
-
"""
|
582
|
-
...
|
583
|
-
|
584
|
-
@typing.overload
|
585
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
586
|
-
...
|
587
|
-
|
588
403
|
@typing.overload
|
589
|
-
def
|
590
|
-
...
|
591
|
-
|
592
|
-
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):
|
404
|
+
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]]]:
|
593
405
|
"""
|
594
|
-
Specifies the
|
595
|
-
|
596
|
-
Information in this decorator will augment any
|
597
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
598
|
-
you can use `@pypi_base` to set packages required by all
|
599
|
-
steps and use `@pypi` to specify step-specific overrides.
|
600
|
-
|
406
|
+
Specifies the number of times the task corresponding
|
407
|
+
to a step needs to be retried.
|
601
408
|
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
Packages to use for this step. The key is the name of the package
|
606
|
-
and the value is the version to use.
|
607
|
-
python : str, optional, default: None
|
608
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
609
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
610
|
-
"""
|
611
|
-
...
|
612
|
-
|
613
|
-
@typing.overload
|
614
|
-
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]]]:
|
615
|
-
"""
|
616
|
-
Enables checkpointing for a step.
|
409
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
410
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
411
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
617
412
|
|
413
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
414
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
415
|
+
ensuring that the flow execution can continue.
|
618
416
|
|
619
417
|
|
620
418
|
Parameters
|
621
419
|
----------
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
will be loaded at the start of the task.
|
627
|
-
- "none": Do not load any checkpoint
|
628
|
-
- "fresh": Loads the lastest checkpoint created within the running Task.
|
629
|
-
This mode helps loading checkpoints across various retry attempts of the same task.
|
630
|
-
With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
|
631
|
-
created within the task will be loaded when the task is retries execution on failure.
|
632
|
-
|
633
|
-
temp_dir_root : str, default: None
|
634
|
-
The root directory under which `current.checkpoint.directory` will be created.
|
420
|
+
times : int, default 3
|
421
|
+
Number of times to retry this task.
|
422
|
+
minutes_between_retries : int, default 2
|
423
|
+
Number of minutes between retries.
|
635
424
|
"""
|
636
425
|
...
|
637
426
|
|
638
427
|
@typing.overload
|
639
|
-
def
|
428
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
640
429
|
...
|
641
430
|
|
642
431
|
@typing.overload
|
643
|
-
def
|
432
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
644
433
|
...
|
645
434
|
|
646
|
-
def
|
435
|
+
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):
|
647
436
|
"""
|
648
|
-
|
649
|
-
|
650
|
-
|
437
|
+
Specifies the number of times the task corresponding
|
438
|
+
to a step needs to be retried.
|
651
439
|
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
The policy for loading the checkpoint. The following policies are supported:
|
656
|
-
- "eager": Loads the the latest available checkpoint within the namespace.
|
657
|
-
With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
|
658
|
-
will be loaded at the start of the task.
|
659
|
-
- "none": Do not load any checkpoint
|
660
|
-
- "fresh": Loads the lastest checkpoint created within the running Task.
|
661
|
-
This mode helps loading checkpoints across various retry attempts of the same task.
|
662
|
-
With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
|
663
|
-
created within the task will be loaded when the task is retries execution on failure.
|
440
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
441
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
442
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
664
443
|
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
...
|
669
|
-
|
670
|
-
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]]]:
|
671
|
-
"""
|
672
|
-
Specifies that this step is used to deploy an instance of the app.
|
673
|
-
Requires that self.app_name, self.app_port, self.entrypoint and self.deployDir is set.
|
444
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
445
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
446
|
+
ensuring that the flow execution can continue.
|
674
447
|
|
675
448
|
|
676
449
|
Parameters
|
677
450
|
----------
|
678
|
-
|
679
|
-
Number of
|
680
|
-
|
681
|
-
|
451
|
+
times : int, default 3
|
452
|
+
Number of times to retry this task.
|
453
|
+
minutes_between_retries : int, default 2
|
454
|
+
Number of minutes between retries.
|
682
455
|
"""
|
683
456
|
...
|
684
457
|
|
@@ -739,109 +512,59 @@ def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
739
512
|
"""
|
740
513
|
...
|
741
514
|
|
742
|
-
|
743
|
-
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]]]:
|
515
|
+
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]]]:
|
744
516
|
"""
|
745
|
-
Specifies that
|
746
|
-
|
747
|
-
The decorator will create an optional artifact, specified by `var`, which
|
748
|
-
contains the exception raised. You can use it to detect the presence
|
749
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
750
|
-
are missing.
|
517
|
+
Specifies that this step is used to deploy an instance of the app.
|
518
|
+
Requires that self.app_name, self.app_port, self.entrypoint and self.deployDir is set.
|
751
519
|
|
752
520
|
|
753
521
|
Parameters
|
754
522
|
----------
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
Determines whether or not the exception is printed to
|
760
|
-
stdout when caught.
|
523
|
+
app_port : int
|
524
|
+
Number of GPUs to use.
|
525
|
+
app_name : str
|
526
|
+
Name of the app to deploy.
|
761
527
|
"""
|
762
528
|
...
|
763
529
|
|
764
|
-
|
765
|
-
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
766
|
-
...
|
767
|
-
|
768
|
-
@typing.overload
|
769
|
-
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
770
|
-
...
|
771
|
-
|
772
|
-
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):
|
530
|
+
def nvidia(*, gpu: int, gpu_type: str, queue_timeout: int) -> 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]]]:
|
773
531
|
"""
|
774
|
-
Specifies that
|
775
|
-
|
776
|
-
The decorator will create an optional artifact, specified by `var`, which
|
777
|
-
contains the exception raised. You can use it to detect the presence
|
778
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
779
|
-
are missing.
|
532
|
+
Specifies that this step should execute on DGX cloud.
|
780
533
|
|
781
534
|
|
782
535
|
Parameters
|
783
536
|
----------
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
537
|
+
gpu : int
|
538
|
+
Number of GPUs to use.
|
539
|
+
gpu_type : str
|
540
|
+
Type of Nvidia GPU to use.
|
541
|
+
queue_timeout : int
|
542
|
+
Time to keep the job in NVCF's queue.
|
790
543
|
"""
|
791
544
|
...
|
792
545
|
|
793
|
-
|
794
|
-
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]]]:
|
546
|
+
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]]]:
|
795
547
|
"""
|
796
|
-
|
797
|
-
to a step needs to be retried.
|
798
|
-
|
799
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
800
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
801
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
802
|
-
|
803
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
804
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
805
|
-
ensuring that the flow execution can continue.
|
548
|
+
Decorator that helps cache, version and store models/datasets from huggingface hub.
|
806
549
|
|
807
550
|
|
808
551
|
Parameters
|
809
552
|
----------
|
810
|
-
|
811
|
-
|
812
|
-
minutes_between_retries : int, default 2
|
813
|
-
Number of minutes between retries.
|
814
|
-
"""
|
815
|
-
...
|
816
|
-
|
817
|
-
@typing.overload
|
818
|
-
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
819
|
-
...
|
820
|
-
|
821
|
-
@typing.overload
|
822
|
-
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
823
|
-
...
|
824
|
-
|
825
|
-
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):
|
826
|
-
"""
|
827
|
-
Specifies the number of times the task corresponding
|
828
|
-
to a step needs to be retried.
|
553
|
+
temp_dir_root : str, optional
|
554
|
+
The root directory that will hold the temporary directory where objects will be downloaded.
|
829
555
|
|
830
|
-
|
831
|
-
|
832
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
556
|
+
load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
|
557
|
+
The list of repos (models/datasets) to load.
|
833
558
|
|
834
|
-
|
835
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
836
|
-
ensuring that the flow execution can continue.
|
559
|
+
Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
|
837
560
|
|
561
|
+
- If repo (model/dataset) is not found in the datastore:
|
562
|
+
- Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
|
563
|
+
- Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
|
564
|
+
- All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
|
838
565
|
|
839
|
-
|
840
|
-
|
841
|
-
times : int, default 3
|
842
|
-
Number of times to retry this task.
|
843
|
-
minutes_between_retries : int, default 2
|
844
|
-
Number of minutes between retries.
|
566
|
+
- If repo is found in the datastore:
|
567
|
+
- Loads it directly from datastore to local path (can be temporary directory or specified path)
|
845
568
|
"""
|
846
569
|
...
|
847
570
|
|
@@ -888,189 +611,89 @@ def ollama(*, models: list, backend: str, force_pull: bool, cache_update_policy:
|
|
888
611
|
"""
|
889
612
|
...
|
890
613
|
|
891
|
-
|
614
|
+
@typing.overload
|
615
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
892
616
|
"""
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
Parameters
|
897
|
-
----------
|
898
|
-
cpu : int, default 1
|
899
|
-
Number of CPUs required for this step. If `@resources` is
|
900
|
-
also present, the maximum value from all decorators is used.
|
901
|
-
memory : int, default 4096
|
902
|
-
Memory size (in MB) required for this step. If
|
903
|
-
`@resources` is also present, the maximum value from all decorators is
|
904
|
-
used.
|
905
|
-
disk : int, default 10240
|
906
|
-
Disk size (in MB) required for this step. If
|
907
|
-
`@resources` is also present, the maximum value from all decorators is
|
908
|
-
used.
|
909
|
-
image : str, optional, default None
|
910
|
-
Docker image to use when launching on Kubernetes. If not specified, and
|
911
|
-
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
912
|
-
not, a default Docker image mapping to the current version of Python is used.
|
913
|
-
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
914
|
-
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
915
|
-
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
916
|
-
Kubernetes service account to use when launching pod in Kubernetes.
|
917
|
-
secrets : List[str], optional, default None
|
918
|
-
Kubernetes secrets to use when launching pod in Kubernetes. These
|
919
|
-
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
920
|
-
in Metaflow configuration.
|
921
|
-
node_selector: Union[Dict[str,str], str], optional, default None
|
922
|
-
Kubernetes node selector(s) to apply to the pod running the task.
|
923
|
-
Can be passed in as a comma separated string of values e.g.
|
924
|
-
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
925
|
-
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
926
|
-
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
927
|
-
Kubernetes namespace to use when launching pod in Kubernetes.
|
928
|
-
gpu : int, optional, default None
|
929
|
-
Number of GPUs required for this step. A value of zero implies that
|
930
|
-
the scheduled node should not have GPUs.
|
931
|
-
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
932
|
-
The vendor of the GPUs to be used for this step.
|
933
|
-
tolerations : List[str], default []
|
934
|
-
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
935
|
-
Kubernetes tolerations to use when launching pod in Kubernetes.
|
936
|
-
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
937
|
-
Kubernetes labels to use when launching pod in Kubernetes.
|
938
|
-
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
939
|
-
Kubernetes annotations to use when launching pod in Kubernetes.
|
940
|
-
use_tmpfs : bool, default False
|
941
|
-
This enables an explicit tmpfs mount for this step.
|
942
|
-
tmpfs_tempdir : bool, default True
|
943
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
944
|
-
tmpfs_size : int, optional, default: None
|
945
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
946
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
947
|
-
memory allocated for this step.
|
948
|
-
tmpfs_path : str, optional, default /metaflow_temp
|
949
|
-
Path to tmpfs mount for this step.
|
950
|
-
persistent_volume_claims : Dict[str, str], optional, default None
|
951
|
-
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
952
|
-
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
953
|
-
shared_memory: int, optional
|
954
|
-
Shared memory size (in MiB) required for this step
|
955
|
-
port: int, optional
|
956
|
-
Port number to specify in the Kubernetes job object
|
957
|
-
compute_pool : str, optional, default None
|
958
|
-
Compute pool to be used for for this step.
|
959
|
-
If not specified, any accessible compute pool within the perimeter is used.
|
960
|
-
hostname_resolution_timeout: int, default 10 * 60
|
961
|
-
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
962
|
-
Only applicable when @parallel is used.
|
963
|
-
qos: str, default: Burstable
|
964
|
-
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
965
|
-
|
966
|
-
security_context: Dict[str, Any], optional, default None
|
967
|
-
Container security context. Applies to the task container. Allows the following keys:
|
968
|
-
- privileged: bool, optional, default None
|
969
|
-
- allow_privilege_escalation: bool, optional, default None
|
970
|
-
- run_as_user: int, optional, default None
|
971
|
-
- run_as_group: int, optional, default None
|
972
|
-
- run_as_non_root: bool, optional, default None
|
617
|
+
Internal decorator to support Fast bakery
|
973
618
|
"""
|
974
619
|
...
|
975
620
|
|
976
|
-
|
621
|
+
@typing.overload
|
622
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
623
|
+
...
|
624
|
+
|
625
|
+
def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
977
626
|
"""
|
978
|
-
|
979
|
-
|
980
|
-
A project-specific namespace is created for all flows that
|
981
|
-
use the same `@project(name)`.
|
982
|
-
|
983
|
-
|
984
|
-
Parameters
|
985
|
-
----------
|
986
|
-
name : str
|
987
|
-
Project name. Make sure that the name is unique amongst all
|
988
|
-
projects that use the same production scheduler. The name may
|
989
|
-
contain only lowercase alphanumeric characters and underscores.
|
990
|
-
|
991
|
-
branch : Optional[str], default None
|
992
|
-
The branch to use. If not specified, the branch is set to
|
993
|
-
`user.<username>` unless `production` is set to `True`. This can
|
994
|
-
also be set on the command line using `--branch` as a top-level option.
|
995
|
-
It is an error to specify `branch` in the decorator and on the command line.
|
996
|
-
|
997
|
-
production : bool, default False
|
998
|
-
Whether or not the branch is the production branch. This can also be set on the
|
999
|
-
command line using `--production` as a top-level option. It is an error to specify
|
1000
|
-
`production` in the decorator and on the command line.
|
1001
|
-
The project branch name will be:
|
1002
|
-
- if `branch` is specified:
|
1003
|
-
- if `production` is True: `prod.<branch>`
|
1004
|
-
- if `production` is False: `test.<branch>`
|
1005
|
-
- if `branch` is not specified:
|
1006
|
-
- if `production` is True: `prod`
|
1007
|
-
- if `production` is False: `user.<username>`
|
627
|
+
Internal decorator to support Fast bakery
|
1008
628
|
"""
|
1009
629
|
...
|
1010
630
|
|
1011
631
|
@typing.overload
|
1012
|
-
def
|
632
|
+
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]]]:
|
1013
633
|
"""
|
1014
|
-
Specifies the
|
634
|
+
Specifies that the step will success under all circumstances.
|
1015
635
|
|
1016
|
-
|
1017
|
-
|
636
|
+
The decorator will create an optional artifact, specified by `var`, which
|
637
|
+
contains the exception raised. You can use it to detect the presence
|
638
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
639
|
+
are missing.
|
1018
640
|
|
1019
641
|
|
1020
642
|
Parameters
|
1021
643
|
----------
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1029
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1030
|
-
disabled : bool, default False
|
1031
|
-
If set to True, disables Conda.
|
644
|
+
var : str, optional, default None
|
645
|
+
Name of the artifact in which to store the caught exception.
|
646
|
+
If not specified, the exception is not stored.
|
647
|
+
print_exception : bool, default True
|
648
|
+
Determines whether or not the exception is printed to
|
649
|
+
stdout when caught.
|
1032
650
|
"""
|
1033
651
|
...
|
1034
652
|
|
1035
653
|
@typing.overload
|
1036
|
-
def
|
654
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1037
655
|
...
|
1038
656
|
|
1039
|
-
|
657
|
+
@typing.overload
|
658
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
659
|
+
...
|
660
|
+
|
661
|
+
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):
|
1040
662
|
"""
|
1041
|
-
Specifies the
|
663
|
+
Specifies that the step will success under all circumstances.
|
1042
664
|
|
1043
|
-
|
1044
|
-
|
665
|
+
The decorator will create an optional artifact, specified by `var`, which
|
666
|
+
contains the exception raised. You can use it to detect the presence
|
667
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
668
|
+
are missing.
|
1045
669
|
|
1046
670
|
|
1047
671
|
Parameters
|
1048
672
|
----------
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1056
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1057
|
-
disabled : bool, default False
|
1058
|
-
If set to True, disables Conda.
|
673
|
+
var : str, optional, default None
|
674
|
+
Name of the artifact in which to store the caught exception.
|
675
|
+
If not specified, the exception is not stored.
|
676
|
+
print_exception : bool, default True
|
677
|
+
Determines whether or not the exception is printed to
|
678
|
+
stdout when caught.
|
1059
679
|
"""
|
1060
680
|
...
|
1061
681
|
|
1062
682
|
@typing.overload
|
1063
|
-
def
|
683
|
+
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]]]:
|
1064
684
|
"""
|
1065
|
-
Specifies the PyPI packages for
|
685
|
+
Specifies the PyPI packages for the step.
|
1066
686
|
|
1067
|
-
|
687
|
+
Information in this decorator will augment any
|
688
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
689
|
+
you can use `@pypi_base` to set packages required by all
|
1068
690
|
steps and use `@pypi` to specify step-specific overrides.
|
1069
691
|
|
692
|
+
|
1070
693
|
Parameters
|
1071
694
|
----------
|
1072
695
|
packages : Dict[str, str], default: {}
|
1073
|
-
Packages to use for this
|
696
|
+
Packages to use for this step. The key is the name of the package
|
1074
697
|
and the value is the version to use.
|
1075
698
|
python : str, optional, default: None
|
1076
699
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
@@ -1079,20 +702,27 @@ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[s
|
|
1079
702
|
...
|
1080
703
|
|
1081
704
|
@typing.overload
|
1082
|
-
def
|
705
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1083
706
|
...
|
1084
707
|
|
1085
|
-
|
708
|
+
@typing.overload
|
709
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
710
|
+
...
|
711
|
+
|
712
|
+
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):
|
1086
713
|
"""
|
1087
|
-
Specifies the PyPI packages for
|
714
|
+
Specifies the PyPI packages for the step.
|
1088
715
|
|
1089
|
-
|
716
|
+
Information in this decorator will augment any
|
717
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
718
|
+
you can use `@pypi_base` to set packages required by all
|
1090
719
|
steps and use `@pypi` to specify step-specific overrides.
|
1091
720
|
|
721
|
+
|
1092
722
|
Parameters
|
1093
723
|
----------
|
1094
724
|
packages : Dict[str, str], default: {}
|
1095
|
-
Packages to use for this
|
725
|
+
Packages to use for this step. The key is the name of the package
|
1096
726
|
and the value is the version to use.
|
1097
727
|
python : str, optional, default: None
|
1098
728
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
@@ -1101,201 +731,300 @@ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packag
|
|
1101
731
|
...
|
1102
732
|
|
1103
733
|
@typing.overload
|
1104
|
-
def
|
734
|
+
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]]]:
|
1105
735
|
"""
|
1106
|
-
Specifies the
|
1107
|
-
|
1108
|
-
```
|
1109
|
-
@trigger(event='foo')
|
1110
|
-
```
|
1111
|
-
or
|
1112
|
-
```
|
1113
|
-
@trigger(events=['foo', 'bar'])
|
1114
|
-
```
|
1115
|
-
|
1116
|
-
Additionally, you can specify the parameter mappings
|
1117
|
-
to map event payload to Metaflow parameters for the flow.
|
1118
|
-
```
|
1119
|
-
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1120
|
-
```
|
1121
|
-
or
|
1122
|
-
```
|
1123
|
-
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1124
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1125
|
-
```
|
736
|
+
Specifies the Conda environment for the step.
|
1126
737
|
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
This is equivalent to:
|
1132
|
-
```
|
1133
|
-
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1134
|
-
```
|
738
|
+
Information in this decorator will augment any
|
739
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
740
|
+
you can use `@conda_base` to set packages required by all
|
741
|
+
steps and use `@conda` to specify step-specific overrides.
|
1135
742
|
|
1136
743
|
|
1137
744
|
Parameters
|
1138
745
|
----------
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
746
|
+
packages : Dict[str, str], default {}
|
747
|
+
Packages to use for this step. The key is the name of the package
|
748
|
+
and the value is the version to use.
|
749
|
+
libraries : Dict[str, str], default {}
|
750
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
751
|
+
python : str, optional, default None
|
752
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
753
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
754
|
+
disabled : bool, default False
|
755
|
+
If set to True, disables @conda.
|
1145
756
|
"""
|
1146
757
|
...
|
1147
758
|
|
1148
759
|
@typing.overload
|
1149
|
-
def
|
760
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1150
761
|
...
|
1151
762
|
|
1152
|
-
|
763
|
+
@typing.overload
|
764
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
765
|
+
...
|
766
|
+
|
767
|
+
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):
|
1153
768
|
"""
|
1154
|
-
Specifies the
|
1155
|
-
|
1156
|
-
```
|
1157
|
-
@trigger(event='foo')
|
1158
|
-
```
|
1159
|
-
or
|
1160
|
-
```
|
1161
|
-
@trigger(events=['foo', 'bar'])
|
1162
|
-
```
|
1163
|
-
|
1164
|
-
Additionally, you can specify the parameter mappings
|
1165
|
-
to map event payload to Metaflow parameters for the flow.
|
1166
|
-
```
|
1167
|
-
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1168
|
-
```
|
1169
|
-
or
|
1170
|
-
```
|
1171
|
-
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1172
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1173
|
-
```
|
769
|
+
Specifies the Conda environment for the step.
|
1174
770
|
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
This is equivalent to:
|
1180
|
-
```
|
1181
|
-
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1182
|
-
```
|
771
|
+
Information in this decorator will augment any
|
772
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
773
|
+
you can use `@conda_base` to set packages required by all
|
774
|
+
steps and use `@conda` to specify step-specific overrides.
|
1183
775
|
|
1184
776
|
|
1185
777
|
Parameters
|
1186
778
|
----------
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
779
|
+
packages : Dict[str, str], default {}
|
780
|
+
Packages to use for this step. The key is the name of the package
|
781
|
+
and the value is the version to use.
|
782
|
+
libraries : Dict[str, str], default {}
|
783
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
784
|
+
python : str, optional, default None
|
785
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
786
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
787
|
+
disabled : bool, default False
|
788
|
+
If set to True, disables @conda.
|
1193
789
|
"""
|
1194
790
|
...
|
1195
791
|
|
1196
|
-
|
792
|
+
@typing.overload
|
793
|
+
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]]]:
|
1197
794
|
"""
|
1198
|
-
|
1199
|
-
|
1200
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1201
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1202
|
-
starts only after all sensors finish.
|
795
|
+
Enables checkpointing for a step.
|
796
|
+
|
1203
797
|
|
1204
798
|
|
1205
799
|
Parameters
|
1206
800
|
----------
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
1220
|
-
name : str
|
1221
|
-
Name of the sensor on Airflow
|
1222
|
-
description : str
|
1223
|
-
Description of sensor in the Airflow UI
|
1224
|
-
bucket_key : Union[str, List[str]]
|
1225
|
-
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1226
|
-
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1227
|
-
bucket_name : str
|
1228
|
-
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1229
|
-
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1230
|
-
wildcard_match : bool
|
1231
|
-
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1232
|
-
aws_conn_id : str
|
1233
|
-
a reference to the s3 connection on Airflow. (Default: None)
|
1234
|
-
verify : bool
|
1235
|
-
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
801
|
+
load_policy : str, default: "fresh"
|
802
|
+
The policy for loading the checkpoint. The following policies are supported:
|
803
|
+
- "eager": Loads the the latest available checkpoint within the namespace.
|
804
|
+
With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
|
805
|
+
will be loaded at the start of the task.
|
806
|
+
- "none": Do not load any checkpoint
|
807
|
+
- "fresh": Loads the lastest checkpoint created within the running Task.
|
808
|
+
This mode helps loading checkpoints across various retry attempts of the same task.
|
809
|
+
With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
|
810
|
+
created within the task will be loaded when the task is retries execution on failure.
|
811
|
+
|
812
|
+
temp_dir_root : str, default: None
|
813
|
+
The root directory under which `current.checkpoint.directory` will be created.
|
1236
814
|
"""
|
1237
815
|
...
|
1238
816
|
|
1239
817
|
@typing.overload
|
1240
|
-
def
|
818
|
+
def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
819
|
+
...
|
820
|
+
|
821
|
+
@typing.overload
|
822
|
+
def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
823
|
+
...
|
824
|
+
|
825
|
+
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):
|
1241
826
|
"""
|
1242
|
-
|
1243
|
-
|
827
|
+
Enables checkpointing for a step.
|
828
|
+
|
1244
829
|
|
1245
830
|
|
1246
831
|
Parameters
|
1247
832
|
----------
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1255
|
-
|
1256
|
-
|
1257
|
-
|
1258
|
-
|
1259
|
-
|
833
|
+
load_policy : str, default: "fresh"
|
834
|
+
The policy for loading the checkpoint. The following policies are supported:
|
835
|
+
- "eager": Loads the the latest available checkpoint within the namespace.
|
836
|
+
With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
|
837
|
+
will be loaded at the start of the task.
|
838
|
+
- "none": Do not load any checkpoint
|
839
|
+
- "fresh": Loads the lastest checkpoint created within the running Task.
|
840
|
+
This mode helps loading checkpoints across various retry attempts of the same task.
|
841
|
+
With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
|
842
|
+
created within the task will be loaded when the task is retries execution on failure.
|
843
|
+
|
844
|
+
temp_dir_root : str, default: None
|
845
|
+
The root directory under which `current.checkpoint.directory` will be created.
|
1260
846
|
"""
|
1261
847
|
...
|
1262
848
|
|
1263
849
|
@typing.overload
|
1264
|
-
def
|
850
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
851
|
+
"""
|
852
|
+
Decorator prototype for all step decorators. This function gets specialized
|
853
|
+
and imported for all decorators types by _import_plugin_decorators().
|
854
|
+
"""
|
1265
855
|
...
|
1266
856
|
|
1267
|
-
|
857
|
+
@typing.overload
|
858
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
859
|
+
...
|
860
|
+
|
861
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
1268
862
|
"""
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
|
1273
|
-
Parameters
|
1274
|
-
----------
|
1275
|
-
hourly : bool, default False
|
1276
|
-
Run the workflow hourly.
|
1277
|
-
daily : bool, default True
|
1278
|
-
Run the workflow daily.
|
1279
|
-
weekly : bool, default False
|
1280
|
-
Run the workflow weekly.
|
1281
|
-
cron : str, optional, default None
|
1282
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1283
|
-
specified by this expression.
|
1284
|
-
timezone : str, optional, default None
|
1285
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1286
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
863
|
+
Decorator prototype for all step decorators. This function gets specialized
|
864
|
+
and imported for all decorators types by _import_plugin_decorators().
|
1287
865
|
"""
|
1288
866
|
...
|
1289
867
|
|
1290
|
-
|
868
|
+
@typing.overload
|
869
|
+
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]]]:
|
1291
870
|
"""
|
1292
|
-
|
1293
|
-
`@checkpoint`/`@model`/`@huggingface_hub` decorators.
|
871
|
+
Specifies a timeout for your step.
|
1294
872
|
|
1295
|
-
This decorator is useful
|
1296
|
-
than what is configured in Metaflow. This can be for variety of reasons:
|
873
|
+
This decorator is useful if this step may hang indefinitely.
|
1297
874
|
|
1298
|
-
|
875
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
876
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
877
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
878
|
+
|
879
|
+
Note that all the values specified in parameters are added together so if you specify
|
880
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
881
|
+
|
882
|
+
|
883
|
+
Parameters
|
884
|
+
----------
|
885
|
+
seconds : int, default 0
|
886
|
+
Number of seconds to wait prior to timing out.
|
887
|
+
minutes : int, default 0
|
888
|
+
Number of minutes to wait prior to timing out.
|
889
|
+
hours : int, default 0
|
890
|
+
Number of hours to wait prior to timing out.
|
891
|
+
"""
|
892
|
+
...
|
893
|
+
|
894
|
+
@typing.overload
|
895
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
896
|
+
...
|
897
|
+
|
898
|
+
@typing.overload
|
899
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
900
|
+
...
|
901
|
+
|
902
|
+
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):
|
903
|
+
"""
|
904
|
+
Specifies a timeout for your step.
|
905
|
+
|
906
|
+
This decorator is useful if this step may hang indefinitely.
|
907
|
+
|
908
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
909
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
910
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
911
|
+
|
912
|
+
Note that all the values specified in parameters are added together so if you specify
|
913
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
914
|
+
|
915
|
+
|
916
|
+
Parameters
|
917
|
+
----------
|
918
|
+
seconds : int, default 0
|
919
|
+
Number of seconds to wait prior to timing out.
|
920
|
+
minutes : int, default 0
|
921
|
+
Number of minutes to wait prior to timing out.
|
922
|
+
hours : int, default 0
|
923
|
+
Number of hours to wait prior to timing out.
|
924
|
+
"""
|
925
|
+
...
|
926
|
+
|
927
|
+
@typing.overload
|
928
|
+
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]]]:
|
929
|
+
"""
|
930
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
931
|
+
|
932
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
933
|
+
|
934
|
+
|
935
|
+
Parameters
|
936
|
+
----------
|
937
|
+
type : str, default 'default'
|
938
|
+
Card type.
|
939
|
+
id : str, optional, default None
|
940
|
+
If multiple cards are present, use this id to identify this card.
|
941
|
+
options : Dict[str, Any], default {}
|
942
|
+
Options passed to the card. The contents depend on the card type.
|
943
|
+
timeout : int, default 45
|
944
|
+
Interrupt reporting if it takes more than this many seconds.
|
945
|
+
"""
|
946
|
+
...
|
947
|
+
|
948
|
+
@typing.overload
|
949
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
950
|
+
...
|
951
|
+
|
952
|
+
@typing.overload
|
953
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
954
|
+
...
|
955
|
+
|
956
|
+
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):
|
957
|
+
"""
|
958
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
959
|
+
|
960
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
961
|
+
|
962
|
+
|
963
|
+
Parameters
|
964
|
+
----------
|
965
|
+
type : str, default 'default'
|
966
|
+
Card type.
|
967
|
+
id : str, optional, default None
|
968
|
+
If multiple cards are present, use this id to identify this card.
|
969
|
+
options : Dict[str, Any], default {}
|
970
|
+
Options passed to the card. The contents depend on the card type.
|
971
|
+
timeout : int, default 45
|
972
|
+
Interrupt reporting if it takes more than this many seconds.
|
973
|
+
"""
|
974
|
+
...
|
975
|
+
|
976
|
+
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]]:
|
977
|
+
"""
|
978
|
+
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.
|
979
|
+
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.
|
980
|
+
|
981
|
+
|
982
|
+
Parameters
|
983
|
+
----------
|
984
|
+
timeout : int
|
985
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
986
|
+
poke_interval : int
|
987
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
988
|
+
mode : str
|
989
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
990
|
+
exponential_backoff : bool
|
991
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
992
|
+
pool : str
|
993
|
+
the slot pool this task should run in,
|
994
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
995
|
+
soft_fail : bool
|
996
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
997
|
+
name : str
|
998
|
+
Name of the sensor on Airflow
|
999
|
+
description : str
|
1000
|
+
Description of sensor in the Airflow UI
|
1001
|
+
external_dag_id : str
|
1002
|
+
The dag_id that contains the task you want to wait for.
|
1003
|
+
external_task_ids : List[str]
|
1004
|
+
The list of task_ids that you want to wait for.
|
1005
|
+
If None (default value) the sensor waits for the DAG. (Default: None)
|
1006
|
+
allowed_states : List[str]
|
1007
|
+
Iterable of allowed states, (Default: ['success'])
|
1008
|
+
failed_states : List[str]
|
1009
|
+
Iterable of failed or dis-allowed states. (Default: None)
|
1010
|
+
execution_delta : datetime.timedelta
|
1011
|
+
time difference with the previous execution to look at,
|
1012
|
+
the default is the same logical date as the current task or DAG. (Default: None)
|
1013
|
+
check_existence: bool
|
1014
|
+
Set to True to check if the external task exists or check if
|
1015
|
+
the DAG to wait for exists. (Default: True)
|
1016
|
+
"""
|
1017
|
+
...
|
1018
|
+
|
1019
|
+
def with_artifact_store(f: typing.Optional[typing.Type[FlowSpecDerived]] = None):
|
1020
|
+
"""
|
1021
|
+
Allows setting external datastores to save data for the
|
1022
|
+
`@checkpoint`/`@model`/`@huggingface_hub` decorators.
|
1023
|
+
|
1024
|
+
This decorator is useful when users wish to save data to a different datastore
|
1025
|
+
than what is configured in Metaflow. This can be for variety of reasons:
|
1026
|
+
|
1027
|
+
1. Data security: The objects needs to be stored in a bucket (object storage) that is not accessible by other flows.
|
1299
1028
|
2. Data Locality: The location where the task is executing is not located in the same region as the datastore.
|
1300
1029
|
- Example: Metaflow datastore lives in US East, but the task is executing in Finland datacenters.
|
1301
1030
|
3. Data Lifecycle Policies: The objects need to be archived / managed separately from the Metaflow managed objects.
|
@@ -1401,46 +1130,54 @@ def with_artifact_store(f: typing.Optional[typing.Type[FlowSpecDerived]] = None)
|
|
1401
1130
|
"""
|
1402
1131
|
...
|
1403
1132
|
|
1404
|
-
|
1133
|
+
@typing.overload
|
1134
|
+
def schedule(*, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1405
1135
|
"""
|
1406
|
-
|
1407
|
-
|
1136
|
+
Specifies the times when the flow should be run when running on a
|
1137
|
+
production scheduler.
|
1408
1138
|
|
1409
1139
|
|
1410
1140
|
Parameters
|
1411
1141
|
----------
|
1412
|
-
|
1413
|
-
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1435
|
-
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1142
|
+
hourly : bool, default False
|
1143
|
+
Run the workflow hourly.
|
1144
|
+
daily : bool, default True
|
1145
|
+
Run the workflow daily.
|
1146
|
+
weekly : bool, default False
|
1147
|
+
Run the workflow weekly.
|
1148
|
+
cron : str, optional, default None
|
1149
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1150
|
+
specified by this expression.
|
1151
|
+
timezone : str, optional, default None
|
1152
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1153
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1154
|
+
"""
|
1155
|
+
...
|
1156
|
+
|
1157
|
+
@typing.overload
|
1158
|
+
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1159
|
+
...
|
1160
|
+
|
1161
|
+
def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
|
1162
|
+
"""
|
1163
|
+
Specifies the times when the flow should be run when running on a
|
1164
|
+
production scheduler.
|
1165
|
+
|
1166
|
+
|
1167
|
+
Parameters
|
1168
|
+
----------
|
1169
|
+
hourly : bool, default False
|
1170
|
+
Run the workflow hourly.
|
1171
|
+
daily : bool, default True
|
1172
|
+
Run the workflow daily.
|
1173
|
+
weekly : bool, default False
|
1174
|
+
Run the workflow weekly.
|
1175
|
+
cron : str, optional, default None
|
1176
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1177
|
+
specified by this expression.
|
1178
|
+
timezone : str, optional, default None
|
1179
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1180
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1444
1181
|
"""
|
1445
1182
|
...
|
1446
1183
|
|
@@ -1545,5 +1282,268 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
1545
1282
|
"""
|
1546
1283
|
...
|
1547
1284
|
|
1285
|
+
@typing.overload
|
1286
|
+
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]]:
|
1287
|
+
"""
|
1288
|
+
Specifies the event(s) that this flow depends on.
|
1289
|
+
|
1290
|
+
```
|
1291
|
+
@trigger(event='foo')
|
1292
|
+
```
|
1293
|
+
or
|
1294
|
+
```
|
1295
|
+
@trigger(events=['foo', 'bar'])
|
1296
|
+
```
|
1297
|
+
|
1298
|
+
Additionally, you can specify the parameter mappings
|
1299
|
+
to map event payload to Metaflow parameters for the flow.
|
1300
|
+
```
|
1301
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1302
|
+
```
|
1303
|
+
or
|
1304
|
+
```
|
1305
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1306
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1307
|
+
```
|
1308
|
+
|
1309
|
+
'parameters' can also be a list of strings and tuples like so:
|
1310
|
+
```
|
1311
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1312
|
+
```
|
1313
|
+
This is equivalent to:
|
1314
|
+
```
|
1315
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1316
|
+
```
|
1317
|
+
|
1318
|
+
|
1319
|
+
Parameters
|
1320
|
+
----------
|
1321
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
1322
|
+
Event dependency for this flow.
|
1323
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
1324
|
+
Events dependency for this flow.
|
1325
|
+
options : Dict[str, Any], default {}
|
1326
|
+
Backend-specific configuration for tuning eventing behavior.
|
1327
|
+
"""
|
1328
|
+
...
|
1329
|
+
|
1330
|
+
@typing.overload
|
1331
|
+
def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1332
|
+
...
|
1333
|
+
|
1334
|
+
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] = {}):
|
1335
|
+
"""
|
1336
|
+
Specifies the event(s) that this flow depends on.
|
1337
|
+
|
1338
|
+
```
|
1339
|
+
@trigger(event='foo')
|
1340
|
+
```
|
1341
|
+
or
|
1342
|
+
```
|
1343
|
+
@trigger(events=['foo', 'bar'])
|
1344
|
+
```
|
1345
|
+
|
1346
|
+
Additionally, you can specify the parameter mappings
|
1347
|
+
to map event payload to Metaflow parameters for the flow.
|
1348
|
+
```
|
1349
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1350
|
+
```
|
1351
|
+
or
|
1352
|
+
```
|
1353
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1354
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1355
|
+
```
|
1356
|
+
|
1357
|
+
'parameters' can also be a list of strings and tuples like so:
|
1358
|
+
```
|
1359
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1360
|
+
```
|
1361
|
+
This is equivalent to:
|
1362
|
+
```
|
1363
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1364
|
+
```
|
1365
|
+
|
1366
|
+
|
1367
|
+
Parameters
|
1368
|
+
----------
|
1369
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
1370
|
+
Event dependency for this flow.
|
1371
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
1372
|
+
Events dependency for this flow.
|
1373
|
+
options : Dict[str, Any], default {}
|
1374
|
+
Backend-specific configuration for tuning eventing behavior.
|
1375
|
+
"""
|
1376
|
+
...
|
1377
|
+
|
1378
|
+
@typing.overload
|
1379
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1380
|
+
"""
|
1381
|
+
Specifies the PyPI packages for all steps of the flow.
|
1382
|
+
|
1383
|
+
Use `@pypi_base` to set common packages required by all
|
1384
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1385
|
+
|
1386
|
+
Parameters
|
1387
|
+
----------
|
1388
|
+
packages : Dict[str, str], default: {}
|
1389
|
+
Packages to use for this flow. The key is the name of the package
|
1390
|
+
and the value is the version to use.
|
1391
|
+
python : str, optional, default: None
|
1392
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1393
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1394
|
+
"""
|
1395
|
+
...
|
1396
|
+
|
1397
|
+
@typing.overload
|
1398
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1399
|
+
...
|
1400
|
+
|
1401
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1402
|
+
"""
|
1403
|
+
Specifies the PyPI packages for all steps of the flow.
|
1404
|
+
|
1405
|
+
Use `@pypi_base` to set common packages required by all
|
1406
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1407
|
+
|
1408
|
+
Parameters
|
1409
|
+
----------
|
1410
|
+
packages : Dict[str, str], default: {}
|
1411
|
+
Packages to use for this flow. The key is the name of the package
|
1412
|
+
and the value is the version to use.
|
1413
|
+
python : str, optional, default: None
|
1414
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1415
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1416
|
+
"""
|
1417
|
+
...
|
1418
|
+
|
1419
|
+
@typing.overload
|
1420
|
+
def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1421
|
+
"""
|
1422
|
+
Specifies the Conda environment for all steps of the flow.
|
1423
|
+
|
1424
|
+
Use `@conda_base` to set common libraries required by all
|
1425
|
+
steps and use `@conda` to specify step-specific additions.
|
1426
|
+
|
1427
|
+
|
1428
|
+
Parameters
|
1429
|
+
----------
|
1430
|
+
packages : Dict[str, str], default {}
|
1431
|
+
Packages to use for this flow. The key is the name of the package
|
1432
|
+
and the value is the version to use.
|
1433
|
+
libraries : Dict[str, str], default {}
|
1434
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1435
|
+
python : str, optional, default None
|
1436
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1437
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1438
|
+
disabled : bool, default False
|
1439
|
+
If set to True, disables Conda.
|
1440
|
+
"""
|
1441
|
+
...
|
1442
|
+
|
1443
|
+
@typing.overload
|
1444
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1445
|
+
...
|
1446
|
+
|
1447
|
+
def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
1448
|
+
"""
|
1449
|
+
Specifies the Conda environment for all steps of the flow.
|
1450
|
+
|
1451
|
+
Use `@conda_base` to set common libraries required by all
|
1452
|
+
steps and use `@conda` to specify step-specific additions.
|
1453
|
+
|
1454
|
+
|
1455
|
+
Parameters
|
1456
|
+
----------
|
1457
|
+
packages : Dict[str, str], default {}
|
1458
|
+
Packages to use for this flow. The key is the name of the package
|
1459
|
+
and the value is the version to use.
|
1460
|
+
libraries : Dict[str, str], default {}
|
1461
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1462
|
+
python : str, optional, default None
|
1463
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1464
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1465
|
+
disabled : bool, default False
|
1466
|
+
If set to True, disables Conda.
|
1467
|
+
"""
|
1468
|
+
...
|
1469
|
+
|
1470
|
+
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]]:
|
1471
|
+
"""
|
1472
|
+
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)
|
1473
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1474
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1475
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1476
|
+
starts only after all sensors finish.
|
1477
|
+
|
1478
|
+
|
1479
|
+
Parameters
|
1480
|
+
----------
|
1481
|
+
timeout : int
|
1482
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1483
|
+
poke_interval : int
|
1484
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1485
|
+
mode : str
|
1486
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1487
|
+
exponential_backoff : bool
|
1488
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1489
|
+
pool : str
|
1490
|
+
the slot pool this task should run in,
|
1491
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1492
|
+
soft_fail : bool
|
1493
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1494
|
+
name : str
|
1495
|
+
Name of the sensor on Airflow
|
1496
|
+
description : str
|
1497
|
+
Description of sensor in the Airflow UI
|
1498
|
+
bucket_key : Union[str, List[str]]
|
1499
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1500
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1501
|
+
bucket_name : str
|
1502
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1503
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1504
|
+
wildcard_match : bool
|
1505
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1506
|
+
aws_conn_id : str
|
1507
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1508
|
+
verify : bool
|
1509
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1510
|
+
"""
|
1511
|
+
...
|
1512
|
+
|
1513
|
+
def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1514
|
+
"""
|
1515
|
+
Specifies what flows belong to the same project.
|
1516
|
+
|
1517
|
+
A project-specific namespace is created for all flows that
|
1518
|
+
use the same `@project(name)`.
|
1519
|
+
|
1520
|
+
|
1521
|
+
Parameters
|
1522
|
+
----------
|
1523
|
+
name : str
|
1524
|
+
Project name. Make sure that the name is unique amongst all
|
1525
|
+
projects that use the same production scheduler. The name may
|
1526
|
+
contain only lowercase alphanumeric characters and underscores.
|
1527
|
+
|
1528
|
+
branch : Optional[str], default None
|
1529
|
+
The branch to use. If not specified, the branch is set to
|
1530
|
+
`user.<username>` unless `production` is set to `True`. This can
|
1531
|
+
also be set on the command line using `--branch` as a top-level option.
|
1532
|
+
It is an error to specify `branch` in the decorator and on the command line.
|
1533
|
+
|
1534
|
+
production : bool, default False
|
1535
|
+
Whether or not the branch is the production branch. This can also be set on the
|
1536
|
+
command line using `--production` as a top-level option. It is an error to specify
|
1537
|
+
`production` in the decorator and on the command line.
|
1538
|
+
The project branch name will be:
|
1539
|
+
- if `branch` is specified:
|
1540
|
+
- if `production` is True: `prod.<branch>`
|
1541
|
+
- if `production` is False: `test.<branch>`
|
1542
|
+
- if `branch` is not specified:
|
1543
|
+
- if `production` is True: `prod`
|
1544
|
+
- if `production` is False: `user.<username>`
|
1545
|
+
"""
|
1546
|
+
...
|
1547
|
+
|
1548
1548
|
pkg_name: str
|
1549
1549
|
|