ob-metaflow-stubs 6.0.3.141__py2.py3-none-any.whl → 6.0.3.143rc0__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- metaflow-stubs/__init__.pyi +604 -573
- metaflow-stubs/cards.pyi +2 -2
- metaflow-stubs/cli.pyi +2 -2
- metaflow-stubs/cli_components/__init__.pyi +2 -2
- metaflow-stubs/cli_components/utils.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +2 -2
- metaflow-stubs/client/core.pyi +5 -5
- metaflow-stubs/client/filecache.pyi +2 -2
- metaflow-stubs/events.pyi +3 -3
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +4 -4
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +3 -3
- metaflow-stubs/info_file.pyi +2 -2
- metaflow-stubs/metadata_provider/__init__.pyi +2 -2
- metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
- metaflow-stubs/metadata_provider/metadata.pyi +2 -2
- metaflow-stubs/metadata_provider/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -2
- metaflow-stubs/metaflow_current.pyi +99 -99
- metaflow-stubs/mf_extensions/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/async_cards.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/deco_injection_mixin.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/extra_components.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/__init__.pyi +2 -2
- 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 +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/checkpoint_storage.pyi +5 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/constructors.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/core.pyi +6 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/decorator.pyi +3 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/exceptions.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/final_api.pyi +4 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/lineage.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/context.pyi +79 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/core.pyi +4 -8
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/decorator.pyi +46 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/exceptions.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/task_utils.pyi +11 -4
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/exceptions.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/decorator.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/core.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/exceptions.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/model_storage.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/flowspec_utils.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/general.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/identity_utils.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/base.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/tar.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/snowflake.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/profilers/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/profilers/gpu.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/remote_config.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/toplevel/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/parameters.pyi +3 -3
- metaflow-stubs/plugins/__init__.pyi +12 -12
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
- metaflow-stubs/plugins/airflow/exception.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
- metaflow-stubs/plugins/argo/__init__.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +2 -2
- metaflow-stubs/plugins/aws/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +2 -2
- metaflow-stubs/plugins/azure/__init__.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
- metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/cards/__init__.pyi +6 -6
- metaflow-stubs/plugins/cards/card_client.pyi +2 -2
- metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
- metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +3 -3
- metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
- metaflow-stubs/plugins/debug_logger.pyi +2 -2
- metaflow-stubs/plugins/debug_monitor.pyi +2 -2
- metaflow-stubs/plugins/environment_decorator.pyi +2 -2
- metaflow-stubs/plugins/events_decorator.pyi +2 -2
- metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
- metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
- metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +4 -4
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +5 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
- metaflow-stubs/plugins/perimeters.pyi +2 -2
- metaflow-stubs/plugins/project_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
- metaflow-stubs/plugins/pypi/utils.pyi +2 -2
- metaflow-stubs/plugins/resources_decorator.pyi +2 -2
- metaflow-stubs/plugins/retry_decorator.pyi +2 -2
- metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
- metaflow-stubs/plugins/snowflake/__init__.pyi +2 -2
- metaflow-stubs/plugins/storage_executor.pyi +2 -2
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
- metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
- metaflow-stubs/profilers/__init__.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +2 -2
- metaflow-stubs/runner/deployer_impl.pyi +2 -2
- metaflow-stubs/runner/metaflow_runner.pyi +3 -3
- metaflow-stubs/runner/nbdeploy.pyi +2 -2
- metaflow-stubs/runner/nbrun.pyi +2 -2
- metaflow-stubs/runner/subprocess_manager.pyi +2 -2
- metaflow-stubs/runner/utils.pyi +3 -3
- metaflow-stubs/system/__init__.pyi +2 -2
- metaflow-stubs/system/system_logger.pyi +3 -3
- metaflow-stubs/system/system_monitor.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- metaflow-stubs/user_configs/__init__.pyi +2 -2
- metaflow-stubs/user_configs/config_decorators.pyi +6 -6
- metaflow-stubs/user_configs/config_options.pyi +2 -2
- metaflow-stubs/user_configs/config_parameters.pyi +5 -5
- {ob_metaflow_stubs-6.0.3.141.dist-info → ob_metaflow_stubs-6.0.3.143rc0.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-6.0.3.143rc0.dist-info/RECORD +194 -0
- ob_metaflow_stubs-6.0.3.141.dist-info/RECORD +0 -192
- {ob_metaflow_stubs-6.0.3.141.dist-info → ob_metaflow_stubs-6.0.3.143rc0.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-6.0.3.141.dist-info → ob_metaflow_stubs-6.0.3.143rc0.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.14.0.
|
4
|
-
# Generated on 2025-02-
|
3
|
+
# MF version: 2.14.0.2rc0+obcheckpoint(0.1.8.1rc0);ob(v1) #
|
4
|
+
# Generated on 2025-02-17T19:27:36.178389 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -35,9 +35,9 @@ from .user_configs.config_parameters import ConfigValue as ConfigValue
|
|
35
35
|
from .user_configs.config_parameters import config_expr as config_expr
|
36
36
|
from .user_configs.config_decorators import CustomFlowDecorator as CustomFlowDecorator
|
37
37
|
from .user_configs.config_decorators import CustomStepDecorator as CustomStepDecorator
|
38
|
-
from . import events as events
|
39
38
|
from . import tuple_util as tuple_util
|
40
39
|
from . import cards as cards
|
40
|
+
from . import events as events
|
41
41
|
from . import runner as runner
|
42
42
|
from . import plugins as plugins
|
43
43
|
from .mf_extensions.outerbounds.toplevel.global_aliases_for_metaflow_package import S3 as S3
|
@@ -63,6 +63,7 @@ from .runner.deployer import DeployedFlow as DeployedFlow
|
|
63
63
|
from .runner.nbdeploy import NBDeployer as NBDeployer
|
64
64
|
from .mf_extensions.obcheckpoint.plugins.machine_learning_utilities.checkpoints.final_api import Checkpoint as Checkpoint
|
65
65
|
from .mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures import load_model as load_model
|
66
|
+
from .mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastore.context import using_artifact_store as using_artifact_store
|
66
67
|
from .mf_extensions.outerbounds.toplevel.global_aliases_for_metaflow_package import get_aws_client as get_aws_client
|
67
68
|
from .mf_extensions.outerbounds.plugins.snowflake.snowflake import Snowflake as Snowflake
|
68
69
|
from . import cli_components as cli_components
|
@@ -146,78 +147,247 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
146
147
|
"""
|
147
148
|
...
|
148
149
|
|
149
|
-
def
|
150
|
+
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]]]:
|
150
151
|
"""
|
151
|
-
|
152
|
+
Decorator that helps cache, version and store models/datasets from huggingface hub.
|
152
153
|
|
153
154
|
|
154
155
|
Parameters
|
155
156
|
----------
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
157
|
+
temp_dir_root : str, optional
|
158
|
+
The root directory that will hold the temporary directory where objects will be downloaded.
|
159
|
+
|
160
|
+
load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
|
161
|
+
The list of repos (models/datasets) to load.
|
162
|
+
|
163
|
+
Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
|
164
|
+
|
165
|
+
- If repo (model/dataset) is not found in the datastore:
|
166
|
+
- Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
|
167
|
+
- Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
|
168
|
+
- All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
|
169
|
+
|
170
|
+
- If repo is found in the datastore:
|
171
|
+
- Loads it directly from datastore to local path (can be temporary directory or specified path)
|
162
172
|
"""
|
163
173
|
...
|
164
174
|
|
165
175
|
@typing.overload
|
166
|
-
def
|
176
|
+
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]]]:
|
167
177
|
"""
|
168
|
-
Specifies
|
178
|
+
Specifies a timeout for your step.
|
169
179
|
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
180
|
+
This decorator is useful if this step may hang indefinitely.
|
181
|
+
|
182
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
183
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
184
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
185
|
+
|
186
|
+
Note that all the values specified in parameters are added together so if you specify
|
187
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
174
188
|
|
175
189
|
|
176
190
|
Parameters
|
177
191
|
----------
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
185
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
186
|
-
disabled : bool, default False
|
187
|
-
If set to True, disables @conda.
|
192
|
+
seconds : int, default 0
|
193
|
+
Number of seconds to wait prior to timing out.
|
194
|
+
minutes : int, default 0
|
195
|
+
Number of minutes to wait prior to timing out.
|
196
|
+
hours : int, default 0
|
197
|
+
Number of hours to wait prior to timing out.
|
188
198
|
"""
|
189
199
|
...
|
190
200
|
|
191
201
|
@typing.overload
|
192
|
-
def
|
202
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
193
203
|
...
|
194
204
|
|
195
205
|
@typing.overload
|
196
|
-
def
|
206
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
197
207
|
...
|
198
208
|
|
199
|
-
def
|
209
|
+
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):
|
200
210
|
"""
|
201
|
-
Specifies
|
211
|
+
Specifies a timeout for your step.
|
202
212
|
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
213
|
+
This decorator is useful if this step may hang indefinitely.
|
214
|
+
|
215
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
216
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
217
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
218
|
+
|
219
|
+
Note that all the values specified in parameters are added together so if you specify
|
220
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
207
221
|
|
208
222
|
|
209
223
|
Parameters
|
210
224
|
----------
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
225
|
+
seconds : int, default 0
|
226
|
+
Number of seconds to wait prior to timing out.
|
227
|
+
minutes : int, default 0
|
228
|
+
Number of minutes to wait prior to timing out.
|
229
|
+
hours : int, default 0
|
230
|
+
Number of hours to wait prior to timing out.
|
231
|
+
"""
|
232
|
+
...
|
233
|
+
|
234
|
+
@typing.overload
|
235
|
+
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]]]:
|
236
|
+
"""
|
237
|
+
Specifies that the step will success under all circumstances.
|
238
|
+
|
239
|
+
The decorator will create an optional artifact, specified by `var`, which
|
240
|
+
contains the exception raised. You can use it to detect the presence
|
241
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
242
|
+
are missing.
|
243
|
+
|
244
|
+
|
245
|
+
Parameters
|
246
|
+
----------
|
247
|
+
var : str, optional, default None
|
248
|
+
Name of the artifact in which to store the caught exception.
|
249
|
+
If not specified, the exception is not stored.
|
250
|
+
print_exception : bool, default True
|
251
|
+
Determines whether or not the exception is printed to
|
252
|
+
stdout when caught.
|
253
|
+
"""
|
254
|
+
...
|
255
|
+
|
256
|
+
@typing.overload
|
257
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
258
|
+
...
|
259
|
+
|
260
|
+
@typing.overload
|
261
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
262
|
+
...
|
263
|
+
|
264
|
+
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):
|
265
|
+
"""
|
266
|
+
Specifies that the step will success under all circumstances.
|
267
|
+
|
268
|
+
The decorator will create an optional artifact, specified by `var`, which
|
269
|
+
contains the exception raised. You can use it to detect the presence
|
270
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
271
|
+
are missing.
|
272
|
+
|
273
|
+
|
274
|
+
Parameters
|
275
|
+
----------
|
276
|
+
var : str, optional, default None
|
277
|
+
Name of the artifact in which to store the caught exception.
|
278
|
+
If not specified, the exception is not stored.
|
279
|
+
print_exception : bool, default True
|
280
|
+
Determines whether or not the exception is printed to
|
281
|
+
stdout when caught.
|
282
|
+
"""
|
283
|
+
...
|
284
|
+
|
285
|
+
@typing.overload
|
286
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
287
|
+
"""
|
288
|
+
Parameters
|
289
|
+
----------
|
290
|
+
"""
|
291
|
+
...
|
292
|
+
|
293
|
+
@typing.overload
|
294
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
295
|
+
...
|
296
|
+
|
297
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
298
|
+
"""
|
299
|
+
Parameters
|
300
|
+
----------
|
301
|
+
"""
|
302
|
+
...
|
303
|
+
|
304
|
+
@typing.overload
|
305
|
+
def model(*, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, 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]]]:
|
306
|
+
"""
|
307
|
+
Enables loading / saving of models within a step.
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
Parameters
|
312
|
+
----------
|
313
|
+
load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
|
314
|
+
Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
|
315
|
+
These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
|
316
|
+
- `current.checkpoint`
|
317
|
+
- `current.model`
|
318
|
+
- `current.huggingface_hub`
|
319
|
+
|
320
|
+
If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
|
321
|
+
the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
|
322
|
+
If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
|
323
|
+
|
324
|
+
temp_dir_root : str, default: None
|
325
|
+
The root directory under which `current.model.loaded` will store loaded models
|
326
|
+
"""
|
327
|
+
...
|
328
|
+
|
329
|
+
@typing.overload
|
330
|
+
def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
331
|
+
...
|
332
|
+
|
333
|
+
@typing.overload
|
334
|
+
def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
335
|
+
...
|
336
|
+
|
337
|
+
def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: str = None):
|
338
|
+
"""
|
339
|
+
Enables loading / saving of models within a step.
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
Parameters
|
344
|
+
----------
|
345
|
+
load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
|
346
|
+
Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
|
347
|
+
These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
|
348
|
+
- `current.checkpoint`
|
349
|
+
- `current.model`
|
350
|
+
- `current.huggingface_hub`
|
351
|
+
|
352
|
+
If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
|
353
|
+
the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
|
354
|
+
If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
|
355
|
+
|
356
|
+
temp_dir_root : str, default: None
|
357
|
+
The root directory under which `current.model.loaded` will store loaded models
|
358
|
+
"""
|
359
|
+
...
|
360
|
+
|
361
|
+
def nim(*, models: "list[NIM]", backend: 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]]]:
|
362
|
+
"""
|
363
|
+
This decorator is used to run NIM containers in Metaflow tasks as sidecars.
|
364
|
+
|
365
|
+
User code call
|
366
|
+
-----------
|
367
|
+
@nim(
|
368
|
+
models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
|
369
|
+
backend='managed'
|
370
|
+
)
|
371
|
+
|
372
|
+
Valid backend options
|
373
|
+
---------------------
|
374
|
+
- 'managed': Outerbounds selects a compute provider based on the model.
|
375
|
+
|
376
|
+
Valid model options
|
377
|
+
----------------
|
378
|
+
- 'meta/llama3-8b-instruct': 8B parameter model
|
379
|
+
- 'meta/llama3-70b-instruct': 70B parameter model
|
380
|
+
- any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
|
381
|
+
|
382
|
+
|
383
|
+
Parameters
|
384
|
+
----------
|
385
|
+
models: list[NIM]
|
386
|
+
List of NIM containers running models in sidecars.
|
387
|
+
backend: str
|
388
|
+
Compute provider to run the NIM container.
|
389
|
+
queue_timeout : int
|
390
|
+
Time to keep the job in NVCF's queue.
|
221
391
|
"""
|
222
392
|
...
|
223
393
|
|
@@ -277,7 +447,64 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
277
447
|
...
|
278
448
|
|
279
449
|
@typing.overload
|
280
|
-
def
|
450
|
+
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]]]:
|
451
|
+
"""
|
452
|
+
Enables checkpointing for a step.
|
453
|
+
|
454
|
+
|
455
|
+
|
456
|
+
Parameters
|
457
|
+
----------
|
458
|
+
load_policy : str, default: "fresh"
|
459
|
+
The policy for loading the checkpoint. The following policies are supported:
|
460
|
+
- "eager": Loads the the latest available checkpoint within the namespace.
|
461
|
+
With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
|
462
|
+
will be loaded at the start of the task.
|
463
|
+
- "none": Do not load any checkpoint
|
464
|
+
- "fresh": Loads the lastest checkpoint created within the running Task.
|
465
|
+
This mode helps loading checkpoints across various retry attempts of the same task.
|
466
|
+
With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
|
467
|
+
created within the task will be loaded when the task is retries execution on failure.
|
468
|
+
|
469
|
+
temp_dir_root : str, default: None
|
470
|
+
The root directory under which `current.checkpoint.directory` will be created.
|
471
|
+
"""
|
472
|
+
...
|
473
|
+
|
474
|
+
@typing.overload
|
475
|
+
def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
476
|
+
...
|
477
|
+
|
478
|
+
@typing.overload
|
479
|
+
def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
480
|
+
...
|
481
|
+
|
482
|
+
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):
|
483
|
+
"""
|
484
|
+
Enables checkpointing for a step.
|
485
|
+
|
486
|
+
|
487
|
+
|
488
|
+
Parameters
|
489
|
+
----------
|
490
|
+
load_policy : str, default: "fresh"
|
491
|
+
The policy for loading the checkpoint. The following policies are supported:
|
492
|
+
- "eager": Loads the the latest available checkpoint within the namespace.
|
493
|
+
With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
|
494
|
+
will be loaded at the start of the task.
|
495
|
+
- "none": Do not load any checkpoint
|
496
|
+
- "fresh": Loads the lastest checkpoint created within the running Task.
|
497
|
+
This mode helps loading checkpoints across various retry attempts of the same task.
|
498
|
+
With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
|
499
|
+
created within the task will be loaded when the task is retries execution on failure.
|
500
|
+
|
501
|
+
temp_dir_root : str, default: None
|
502
|
+
The root directory under which `current.checkpoint.directory` will be created.
|
503
|
+
"""
|
504
|
+
...
|
505
|
+
|
506
|
+
@typing.overload
|
507
|
+
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]]]:
|
281
508
|
"""
|
282
509
|
Creates a human-readable report, a Metaflow Card, after this step completes.
|
283
510
|
|
@@ -325,7 +552,40 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
|
|
325
552
|
"""
|
326
553
|
...
|
327
554
|
|
328
|
-
|
555
|
+
@typing.overload
|
556
|
+
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]]]:
|
557
|
+
"""
|
558
|
+
Specifies environment variables to be set prior to the execution of a step.
|
559
|
+
|
560
|
+
|
561
|
+
Parameters
|
562
|
+
----------
|
563
|
+
vars : Dict[str, str], default {}
|
564
|
+
Dictionary of environment variables to set.
|
565
|
+
"""
|
566
|
+
...
|
567
|
+
|
568
|
+
@typing.overload
|
569
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
570
|
+
...
|
571
|
+
|
572
|
+
@typing.overload
|
573
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
574
|
+
...
|
575
|
+
|
576
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
577
|
+
"""
|
578
|
+
Specifies environment variables to be set prior to the execution of a step.
|
579
|
+
|
580
|
+
|
581
|
+
Parameters
|
582
|
+
----------
|
583
|
+
vars : Dict[str, str], default {}
|
584
|
+
Dictionary of environment variables to set.
|
585
|
+
"""
|
586
|
+
...
|
587
|
+
|
588
|
+
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', extended_resources: typing.Optional[typing.Dict[str, 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]]]:
|
329
589
|
"""
|
330
590
|
Specifies that this step should execute on Kubernetes.
|
331
591
|
|
@@ -399,252 +659,198 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
|
|
399
659
|
Only applicable when @parallel is used.
|
400
660
|
qos: str, default: Burstable
|
401
661
|
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
662
|
+
extended_resources: Dict[str, str], optional, default None
|
663
|
+
Extended resources to be requested for the pod.
|
664
|
+
https://kubernetes.io/docs/tasks/administer-cluster/extended-resource-node/
|
402
665
|
"""
|
403
666
|
...
|
404
667
|
|
405
668
|
@typing.overload
|
406
|
-
def
|
669
|
+
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]]]:
|
407
670
|
"""
|
408
|
-
|
671
|
+
Specifies the Conda environment for the step.
|
409
672
|
|
673
|
+
Information in this decorator will augment any
|
674
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
675
|
+
you can use `@conda_base` to set packages required by all
|
676
|
+
steps and use `@conda` to specify step-specific overrides.
|
410
677
|
|
411
678
|
|
412
679
|
Parameters
|
413
680
|
----------
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
temp_dir_root : str, default: None
|
426
|
-
The root directory under which `current.checkpoint.directory` will be created.
|
681
|
+
packages : Dict[str, str], default {}
|
682
|
+
Packages to use for this step. The key is the name of the package
|
683
|
+
and the value is the version to use.
|
684
|
+
libraries : Dict[str, str], default {}
|
685
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
686
|
+
python : str, optional, default None
|
687
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
688
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
689
|
+
disabled : bool, default False
|
690
|
+
If set to True, disables @conda.
|
427
691
|
"""
|
428
692
|
...
|
429
693
|
|
430
694
|
@typing.overload
|
431
|
-
def
|
695
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
432
696
|
...
|
433
697
|
|
434
698
|
@typing.overload
|
435
|
-
def
|
699
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
436
700
|
...
|
437
701
|
|
438
|
-
def
|
702
|
+
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):
|
439
703
|
"""
|
440
|
-
|
704
|
+
Specifies the Conda environment for the step.
|
441
705
|
|
706
|
+
Information in this decorator will augment any
|
707
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
708
|
+
you can use `@conda_base` to set packages required by all
|
709
|
+
steps and use `@conda` to specify step-specific overrides.
|
442
710
|
|
443
711
|
|
444
712
|
Parameters
|
445
713
|
----------
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
temp_dir_root : str, default: None
|
458
|
-
The root directory under which `current.checkpoint.directory` will be created.
|
714
|
+
packages : Dict[str, str], default {}
|
715
|
+
Packages to use for this step. The key is the name of the package
|
716
|
+
and the value is the version to use.
|
717
|
+
libraries : Dict[str, str], default {}
|
718
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
719
|
+
python : str, optional, default None
|
720
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
721
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
722
|
+
disabled : bool, default False
|
723
|
+
If set to True, disables @conda.
|
459
724
|
"""
|
460
725
|
...
|
461
726
|
|
462
727
|
@typing.overload
|
463
|
-
def
|
728
|
+
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]]]:
|
464
729
|
"""
|
465
|
-
Specifies
|
730
|
+
Specifies the resources needed when executing this step.
|
731
|
+
|
732
|
+
Use `@resources` to specify the resource requirements
|
733
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
734
|
+
|
735
|
+
You can choose the compute layer on the command line by executing e.g.
|
736
|
+
```
|
737
|
+
python myflow.py run --with batch
|
738
|
+
```
|
739
|
+
or
|
740
|
+
```
|
741
|
+
python myflow.py run --with kubernetes
|
742
|
+
```
|
743
|
+
which executes the flow on the desired system using the
|
744
|
+
requirements specified in `@resources`.
|
466
745
|
|
467
746
|
|
468
747
|
Parameters
|
469
748
|
----------
|
470
|
-
|
471
|
-
|
749
|
+
cpu : int, default 1
|
750
|
+
Number of CPUs required for this step.
|
751
|
+
gpu : int, optional, default None
|
752
|
+
Number of GPUs required for this step.
|
753
|
+
disk : int, optional, default None
|
754
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
755
|
+
memory : int, default 4096
|
756
|
+
Memory size (in MB) required for this step.
|
757
|
+
shared_memory : int, optional, default None
|
758
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
759
|
+
This parameter maps to the `--shm-size` option in Docker.
|
472
760
|
"""
|
473
761
|
...
|
474
762
|
|
475
763
|
@typing.overload
|
476
|
-
def
|
764
|
+
def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
477
765
|
...
|
478
766
|
|
479
767
|
@typing.overload
|
480
|
-
def
|
768
|
+
def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
481
769
|
...
|
482
770
|
|
483
|
-
def
|
771
|
+
def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
|
484
772
|
"""
|
485
|
-
Specifies
|
773
|
+
Specifies the resources needed when executing this step.
|
774
|
+
|
775
|
+
Use `@resources` to specify the resource requirements
|
776
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
777
|
+
|
778
|
+
You can choose the compute layer on the command line by executing e.g.
|
779
|
+
```
|
780
|
+
python myflow.py run --with batch
|
781
|
+
```
|
782
|
+
or
|
783
|
+
```
|
784
|
+
python myflow.py run --with kubernetes
|
785
|
+
```
|
786
|
+
which executes the flow on the desired system using the
|
787
|
+
requirements specified in `@resources`.
|
486
788
|
|
487
789
|
|
488
790
|
Parameters
|
489
791
|
----------
|
490
|
-
|
491
|
-
|
792
|
+
cpu : int, default 1
|
793
|
+
Number of CPUs required for this step.
|
794
|
+
gpu : int, optional, default None
|
795
|
+
Number of GPUs required for this step.
|
796
|
+
disk : int, optional, default None
|
797
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
798
|
+
memory : int, default 4096
|
799
|
+
Memory size (in MB) required for this step.
|
800
|
+
shared_memory : int, optional, default None
|
801
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
802
|
+
This parameter maps to the `--shm-size` option in Docker.
|
492
803
|
"""
|
493
804
|
...
|
494
805
|
|
495
806
|
@typing.overload
|
496
|
-
def
|
807
|
+
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]]]:
|
497
808
|
"""
|
498
|
-
|
809
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
810
|
+
the execution of a step.
|
811
|
+
|
812
|
+
|
499
813
|
Parameters
|
500
814
|
----------
|
815
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
816
|
+
List of secret specs, defining how the secrets are to be retrieved
|
501
817
|
"""
|
502
818
|
...
|
503
819
|
|
504
820
|
@typing.overload
|
505
|
-
def
|
821
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
506
822
|
...
|
507
823
|
|
508
|
-
|
824
|
+
@typing.overload
|
825
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
826
|
+
...
|
827
|
+
|
828
|
+
def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []):
|
509
829
|
"""
|
510
|
-
|
830
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
831
|
+
the execution of a step.
|
832
|
+
|
833
|
+
|
511
834
|
Parameters
|
512
835
|
----------
|
836
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
837
|
+
List of secret specs, defining how the secrets are to be retrieved
|
513
838
|
"""
|
514
839
|
...
|
515
840
|
|
516
|
-
|
517
|
-
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]]]:
|
841
|
+
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]]]:
|
518
842
|
"""
|
519
|
-
Specifies
|
520
|
-
|
521
|
-
This decorator is useful if this step may hang indefinitely.
|
522
|
-
|
523
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
524
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
525
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
526
|
-
|
527
|
-
Note that all the values specified in parameters are added together so if you specify
|
528
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
529
|
-
|
530
|
-
|
531
|
-
Parameters
|
532
|
-
----------
|
533
|
-
seconds : int, default 0
|
534
|
-
Number of seconds to wait prior to timing out.
|
535
|
-
minutes : int, default 0
|
536
|
-
Number of minutes to wait prior to timing out.
|
537
|
-
hours : int, default 0
|
538
|
-
Number of hours to wait prior to timing out.
|
539
|
-
"""
|
540
|
-
...
|
541
|
-
|
542
|
-
@typing.overload
|
543
|
-
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
544
|
-
...
|
545
|
-
|
546
|
-
@typing.overload
|
547
|
-
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
548
|
-
...
|
549
|
-
|
550
|
-
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):
|
551
|
-
"""
|
552
|
-
Specifies a timeout for your step.
|
553
|
-
|
554
|
-
This decorator is useful if this step may hang indefinitely.
|
555
|
-
|
556
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
557
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
558
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
559
|
-
|
560
|
-
Note that all the values specified in parameters are added together so if you specify
|
561
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
562
|
-
|
563
|
-
|
564
|
-
Parameters
|
565
|
-
----------
|
566
|
-
seconds : int, default 0
|
567
|
-
Number of seconds to wait prior to timing out.
|
568
|
-
minutes : int, default 0
|
569
|
-
Number of minutes to wait prior to timing out.
|
570
|
-
hours : int, default 0
|
571
|
-
Number of hours to wait prior to timing out.
|
572
|
-
"""
|
573
|
-
...
|
574
|
-
|
575
|
-
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]]]:
|
576
|
-
"""
|
577
|
-
Decorator that helps cache, version and store models/datasets from huggingface hub.
|
578
|
-
|
579
|
-
|
580
|
-
Parameters
|
581
|
-
----------
|
582
|
-
temp_dir_root : str, optional
|
583
|
-
The root directory that will hold the temporary directory where objects will be downloaded.
|
584
|
-
|
585
|
-
load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
|
586
|
-
The list of repos (models/datasets) to load.
|
587
|
-
|
588
|
-
Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
|
589
|
-
|
590
|
-
- If repo (model/dataset) is not found in the datastore:
|
591
|
-
- Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
|
592
|
-
- Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
|
593
|
-
- All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
|
594
|
-
|
595
|
-
- If repo is found in the datastore:
|
596
|
-
- Loads it directly from datastore to local path (can be temporary directory or specified path)
|
597
|
-
"""
|
598
|
-
...
|
599
|
-
|
600
|
-
@typing.overload
|
601
|
-
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]]]:
|
602
|
-
"""
|
603
|
-
Specifies that the step will success under all circumstances.
|
604
|
-
|
605
|
-
The decorator will create an optional artifact, specified by `var`, which
|
606
|
-
contains the exception raised. You can use it to detect the presence
|
607
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
608
|
-
are missing.
|
843
|
+
Specifies that this step should execute on DGX cloud.
|
609
844
|
|
610
845
|
|
611
846
|
Parameters
|
612
847
|
----------
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
"""
|
620
|
-
...
|
621
|
-
|
622
|
-
@typing.overload
|
623
|
-
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
624
|
-
...
|
625
|
-
|
626
|
-
@typing.overload
|
627
|
-
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
628
|
-
...
|
629
|
-
|
630
|
-
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):
|
631
|
-
"""
|
632
|
-
Specifies that the step will success under all circumstances.
|
633
|
-
|
634
|
-
The decorator will create an optional artifact, specified by `var`, which
|
635
|
-
contains the exception raised. You can use it to detect the presence
|
636
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
637
|
-
are missing.
|
638
|
-
|
639
|
-
|
640
|
-
Parameters
|
641
|
-
----------
|
642
|
-
var : str, optional, default None
|
643
|
-
Name of the artifact in which to store the caught exception.
|
644
|
-
If not specified, the exception is not stored.
|
645
|
-
print_exception : bool, default True
|
646
|
-
Determines whether or not the exception is printed to
|
647
|
-
stdout when caught.
|
848
|
+
gpu : int
|
849
|
+
Number of GPUs to use.
|
850
|
+
gpu_type : str
|
851
|
+
Type of Nvidia GPU to use.
|
852
|
+
queue_timeout : int
|
853
|
+
Time to keep the job in NVCF's queue.
|
648
854
|
"""
|
649
855
|
...
|
650
856
|
|
@@ -699,304 +905,24 @@ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
|
|
699
905
|
"""
|
700
906
|
...
|
701
907
|
|
702
|
-
@typing.overload
|
703
|
-
def
|
704
|
-
"""
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
...
|
709
|
-
|
710
|
-
@typing.overload
|
711
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
712
|
-
...
|
713
|
-
|
714
|
-
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
715
|
-
"""
|
716
|
-
Parameters
|
717
|
-
----------
|
718
|
-
"""
|
719
|
-
...
|
720
|
-
|
721
|
-
@typing.overload
|
722
|
-
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]]]:
|
723
|
-
"""
|
724
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
725
|
-
the execution of a step.
|
726
|
-
|
727
|
-
|
728
|
-
Parameters
|
729
|
-
----------
|
730
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
731
|
-
List of secret specs, defining how the secrets are to be retrieved
|
732
|
-
"""
|
733
|
-
...
|
734
|
-
|
735
|
-
@typing.overload
|
736
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
737
|
-
...
|
738
|
-
|
739
|
-
@typing.overload
|
740
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
741
|
-
...
|
742
|
-
|
743
|
-
def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []):
|
744
|
-
"""
|
745
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
746
|
-
the execution of a step.
|
747
|
-
|
748
|
-
|
749
|
-
Parameters
|
750
|
-
----------
|
751
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
752
|
-
List of secret specs, defining how the secrets are to be retrieved
|
753
|
-
"""
|
754
|
-
...
|
755
|
-
|
756
|
-
def nim(*, models: "list[NIM]", backend: 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]]]:
|
757
|
-
"""
|
758
|
-
This decorator is used to run NIM containers in Metaflow tasks as sidecars.
|
759
|
-
|
760
|
-
User code call
|
761
|
-
-----------
|
762
|
-
@nim(
|
763
|
-
models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
|
764
|
-
backend='managed'
|
765
|
-
)
|
766
|
-
|
767
|
-
Valid backend options
|
768
|
-
---------------------
|
769
|
-
- 'managed': Outerbounds selects a compute provider based on the model.
|
770
|
-
|
771
|
-
Valid model options
|
772
|
-
----------------
|
773
|
-
- 'meta/llama3-8b-instruct': 8B parameter model
|
774
|
-
- 'meta/llama3-70b-instruct': 70B parameter model
|
775
|
-
- any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
|
776
|
-
|
777
|
-
|
778
|
-
Parameters
|
779
|
-
----------
|
780
|
-
models: list[NIM]
|
781
|
-
List of NIM containers running models in sidecars.
|
782
|
-
backend: str
|
783
|
-
Compute provider to run the NIM container.
|
784
|
-
queue_timeout : int
|
785
|
-
Time to keep the job in NVCF's queue.
|
786
|
-
"""
|
787
|
-
...
|
788
|
-
|
789
|
-
@typing.overload
|
790
|
-
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]]]:
|
791
|
-
"""
|
792
|
-
Specifies the resources needed when executing this step.
|
793
|
-
|
794
|
-
Use `@resources` to specify the resource requirements
|
795
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
796
|
-
|
797
|
-
You can choose the compute layer on the command line by executing e.g.
|
798
|
-
```
|
799
|
-
python myflow.py run --with batch
|
800
|
-
```
|
801
|
-
or
|
802
|
-
```
|
803
|
-
python myflow.py run --with kubernetes
|
804
|
-
```
|
805
|
-
which executes the flow on the desired system using the
|
806
|
-
requirements specified in `@resources`.
|
807
|
-
|
808
|
-
|
809
|
-
Parameters
|
810
|
-
----------
|
811
|
-
cpu : int, default 1
|
812
|
-
Number of CPUs required for this step.
|
813
|
-
gpu : int, optional, default None
|
814
|
-
Number of GPUs required for this step.
|
815
|
-
disk : int, optional, default None
|
816
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
817
|
-
memory : int, default 4096
|
818
|
-
Memory size (in MB) required for this step.
|
819
|
-
shared_memory : int, optional, default None
|
820
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
821
|
-
This parameter maps to the `--shm-size` option in Docker.
|
822
|
-
"""
|
823
|
-
...
|
824
|
-
|
825
|
-
@typing.overload
|
826
|
-
def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
827
|
-
...
|
828
|
-
|
829
|
-
@typing.overload
|
830
|
-
def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
831
|
-
...
|
832
|
-
|
833
|
-
def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
|
834
|
-
"""
|
835
|
-
Specifies the resources needed when executing this step.
|
836
|
-
|
837
|
-
Use `@resources` to specify the resource requirements
|
838
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
839
|
-
|
840
|
-
You can choose the compute layer on the command line by executing e.g.
|
841
|
-
```
|
842
|
-
python myflow.py run --with batch
|
843
|
-
```
|
844
|
-
or
|
845
|
-
```
|
846
|
-
python myflow.py run --with kubernetes
|
847
|
-
```
|
848
|
-
which executes the flow on the desired system using the
|
849
|
-
requirements specified in `@resources`.
|
850
|
-
|
851
|
-
|
852
|
-
Parameters
|
853
|
-
----------
|
854
|
-
cpu : int, default 1
|
855
|
-
Number of CPUs required for this step.
|
856
|
-
gpu : int, optional, default None
|
857
|
-
Number of GPUs required for this step.
|
858
|
-
disk : int, optional, default None
|
859
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
860
|
-
memory : int, default 4096
|
861
|
-
Memory size (in MB) required for this step.
|
862
|
-
shared_memory : int, optional, default None
|
863
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
864
|
-
This parameter maps to the `--shm-size` option in Docker.
|
865
|
-
"""
|
866
|
-
...
|
867
|
-
|
868
|
-
@typing.overload
|
869
|
-
def model(*, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, 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]]]:
|
870
|
-
"""
|
871
|
-
Enables loading / saving of models within a step.
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
Parameters
|
876
|
-
----------
|
877
|
-
load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
|
878
|
-
Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
|
879
|
-
These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
|
880
|
-
- `current.checkpoint`
|
881
|
-
- `current.model`
|
882
|
-
- `current.huggingface_hub`
|
883
|
-
|
884
|
-
If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
|
885
|
-
the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
|
886
|
-
If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
|
887
|
-
|
888
|
-
temp_dir_root : str, default: None
|
889
|
-
The root directory under which `current.model.loaded` will store loaded models
|
890
|
-
"""
|
891
|
-
...
|
892
|
-
|
893
|
-
@typing.overload
|
894
|
-
def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
895
|
-
...
|
896
|
-
|
897
|
-
@typing.overload
|
898
|
-
def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
899
|
-
...
|
900
|
-
|
901
|
-
def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: str = None):
|
902
|
-
"""
|
903
|
-
Enables loading / saving of models within a step.
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
Parameters
|
908
|
-
----------
|
909
|
-
load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
|
910
|
-
Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
|
911
|
-
These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
|
912
|
-
- `current.checkpoint`
|
913
|
-
- `current.model`
|
914
|
-
- `current.huggingface_hub`
|
915
|
-
|
916
|
-
If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
|
917
|
-
the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
|
918
|
-
If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
|
919
|
-
|
920
|
-
temp_dir_root : str, default: None
|
921
|
-
The root directory under which `current.model.loaded` will store loaded models
|
922
|
-
"""
|
923
|
-
...
|
924
|
-
|
925
|
-
def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
926
|
-
"""
|
927
|
-
Specifies what flows belong to the same project.
|
928
|
-
|
929
|
-
A project-specific namespace is created for all flows that
|
930
|
-
use the same `@project(name)`.
|
931
|
-
|
932
|
-
|
933
|
-
Parameters
|
934
|
-
----------
|
935
|
-
name : str
|
936
|
-
Project name. Make sure that the name is unique amongst all
|
937
|
-
projects that use the same production scheduler. The name may
|
938
|
-
contain only lowercase alphanumeric characters and underscores.
|
939
|
-
|
940
|
-
branch : Optional[str], default None
|
941
|
-
The branch to use. If not specified, the branch is set to
|
942
|
-
`user.<username>` unless `production` is set to `True`. This can
|
943
|
-
also be set on the command line using `--branch` as a top-level option.
|
944
|
-
It is an error to specify `branch` in the decorator and on the command line.
|
945
|
-
|
946
|
-
production : bool, default False
|
947
|
-
Whether or not the branch is the production branch. This can also be set on the
|
948
|
-
command line using `--production` as a top-level option. It is an error to specify
|
949
|
-
`production` in the decorator and on the command line.
|
950
|
-
The project branch name will be:
|
951
|
-
- if `branch` is specified:
|
952
|
-
- if `production` is True: `prod.<branch>`
|
953
|
-
- if `production` is False: `test.<branch>`
|
954
|
-
- if `branch` is not specified:
|
955
|
-
- if `production` is True: `prod`
|
956
|
-
- if `production` is False: `user.<username>`
|
908
|
+
@typing.overload
|
909
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
910
|
+
"""
|
911
|
+
Internal decorator to support Fast bakery
|
912
|
+
Parameters
|
913
|
+
----------
|
957
914
|
"""
|
958
915
|
...
|
959
916
|
|
960
|
-
|
917
|
+
@typing.overload
|
918
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
919
|
+
...
|
920
|
+
|
921
|
+
def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
961
922
|
"""
|
962
|
-
|
963
|
-
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.
|
964
|
-
|
965
|
-
|
923
|
+
Internal decorator to support Fast bakery
|
966
924
|
Parameters
|
967
925
|
----------
|
968
|
-
timeout : int
|
969
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
970
|
-
poke_interval : int
|
971
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
972
|
-
mode : str
|
973
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
974
|
-
exponential_backoff : bool
|
975
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
976
|
-
pool : str
|
977
|
-
the slot pool this task should run in,
|
978
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
979
|
-
soft_fail : bool
|
980
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
981
|
-
name : str
|
982
|
-
Name of the sensor on Airflow
|
983
|
-
description : str
|
984
|
-
Description of sensor in the Airflow UI
|
985
|
-
external_dag_id : str
|
986
|
-
The dag_id that contains the task you want to wait for.
|
987
|
-
external_task_ids : List[str]
|
988
|
-
The list of task_ids that you want to wait for.
|
989
|
-
If None (default value) the sensor waits for the DAG. (Default: None)
|
990
|
-
allowed_states : List[str]
|
991
|
-
Iterable of allowed states, (Default: ['success'])
|
992
|
-
failed_states : List[str]
|
993
|
-
Iterable of failed or dis-allowed states. (Default: None)
|
994
|
-
execution_delta : datetime.timedelta
|
995
|
-
time difference with the previous execution to look at,
|
996
|
-
the default is the same logical date as the current task or DAG. (Default: None)
|
997
|
-
check_existence: bool
|
998
|
-
Set to True to check if the external task exists or check if
|
999
|
-
the DAG to wait for exists. (Default: True)
|
1000
926
|
"""
|
1001
927
|
...
|
1002
928
|
|
@@ -1051,13 +977,10 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
|
|
1051
977
|
"""
|
1052
978
|
...
|
1053
979
|
|
1054
|
-
def
|
980
|
+
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]]:
|
1055
981
|
"""
|
1056
|
-
The `@
|
1057
|
-
|
1058
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1059
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1060
|
-
starts only after all sensors finish.
|
982
|
+
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.
|
983
|
+
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.
|
1061
984
|
|
1062
985
|
|
1063
986
|
Parameters
|
@@ -1079,69 +1002,48 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
|
|
1079
1002
|
Name of the sensor on Airflow
|
1080
1003
|
description : str
|
1081
1004
|
Description of sensor in the Airflow UI
|
1082
|
-
|
1083
|
-
The
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1005
|
+
external_dag_id : str
|
1006
|
+
The dag_id that contains the task you want to wait for.
|
1007
|
+
external_task_ids : List[str]
|
1008
|
+
The list of task_ids that you want to wait for.
|
1009
|
+
If None (default value) the sensor waits for the DAG. (Default: None)
|
1010
|
+
allowed_states : List[str]
|
1011
|
+
Iterable of allowed states, (Default: ['success'])
|
1012
|
+
failed_states : List[str]
|
1013
|
+
Iterable of failed or dis-allowed states. (Default: None)
|
1014
|
+
execution_delta : datetime.timedelta
|
1015
|
+
time difference with the previous execution to look at,
|
1016
|
+
the default is the same logical date as the current task or DAG. (Default: None)
|
1017
|
+
check_existence: bool
|
1018
|
+
Set to True to check if the external task exists or check if
|
1019
|
+
the DAG to wait for exists. (Default: True)
|
1094
1020
|
"""
|
1095
1021
|
...
|
1096
1022
|
|
1097
|
-
|
1098
|
-
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]]:
|
1023
|
+
def with_artifact_store(f: typing.Optional[typing.Type[FlowSpecDerived]] = None):
|
1099
1024
|
"""
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1025
|
+
Allows setting external datastores to save data for the
|
1026
|
+
`@checkpoint`/`@model`/`@huggingface_hub` decorators. This is useful
|
1027
|
+
when the compute medium lives in a different geographical location
|
1028
|
+
than metaflow's datastore (e.g. S3, GCS, Azure Blob Storage).
|
1103
1029
|
|
1104
|
-
Parameters
|
1030
|
+
Parameters:
|
1105
1031
|
----------
|
1106
|
-
hourly : bool, default False
|
1107
|
-
Run the workflow hourly.
|
1108
|
-
daily : bool, default True
|
1109
|
-
Run the workflow daily.
|
1110
|
-
weekly : bool, default False
|
1111
|
-
Run the workflow weekly.
|
1112
|
-
cron : str, optional, default None
|
1113
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1114
|
-
specified by this expression.
|
1115
|
-
timezone : str, optional, default None
|
1116
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1117
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1118
|
-
"""
|
1119
|
-
...
|
1120
|
-
|
1121
|
-
@typing.overload
|
1122
|
-
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1123
|
-
...
|
1124
|
-
|
1125
|
-
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):
|
1126
|
-
"""
|
1127
|
-
Specifies the times when the flow should be run when running on a
|
1128
|
-
production scheduler.
|
1129
|
-
|
1130
1032
|
|
1033
|
+
type: str
|
1034
|
+
The type of the datastore. Can be one of 's3', 'gcs', 'azure' or any other supported metaflow Datastore.
|
1035
|
+
|
1036
|
+
config: dict or Callable
|
1037
|
+
Dictionary of configuration options for the datastore. The following keys are required:
|
1038
|
+
- root: The root path in the datastore where the data will be saved. (needs to be in the format expected by the datastore)
|
1039
|
+
- example: 's3://bucket-name/path/to/root'
|
1040
|
+
- example: 'gs://bucket-name/path/to/root'
|
1041
|
+
- example: 'https://myblockacc.blob.core.windows.net/metaflow/'
|
1042
|
+
- role_arn (optional): AWS IAM role to access s3 bucket (only when `type` is 's3')
|
1043
|
+
- session_vars (optional): AWS session variables to access s3 bucket (only when `type` is 's3')
|
1044
|
+
- client_params (optional): AWS client parameters to access s3 bucket (only when `type` is 's3')
|
1131
1045
|
Parameters
|
1132
1046
|
----------
|
1133
|
-
hourly : bool, default False
|
1134
|
-
Run the workflow hourly.
|
1135
|
-
daily : bool, default True
|
1136
|
-
Run the workflow daily.
|
1137
|
-
weekly : bool, default False
|
1138
|
-
Run the workflow weekly.
|
1139
|
-
cron : str, optional, default None
|
1140
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1141
|
-
specified by this expression.
|
1142
|
-
timezone : str, optional, default None
|
1143
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1144
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1145
1047
|
"""
|
1146
1048
|
...
|
1147
1049
|
|
@@ -1186,6 +1088,49 @@ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packag
|
|
1186
1088
|
"""
|
1187
1089
|
...
|
1188
1090
|
|
1091
|
+
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]]:
|
1092
|
+
"""
|
1093
|
+
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)
|
1094
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1095
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1096
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1097
|
+
starts only after all sensors finish.
|
1098
|
+
|
1099
|
+
|
1100
|
+
Parameters
|
1101
|
+
----------
|
1102
|
+
timeout : int
|
1103
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1104
|
+
poke_interval : int
|
1105
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1106
|
+
mode : str
|
1107
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1108
|
+
exponential_backoff : bool
|
1109
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1110
|
+
pool : str
|
1111
|
+
the slot pool this task should run in,
|
1112
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1113
|
+
soft_fail : bool
|
1114
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1115
|
+
name : str
|
1116
|
+
Name of the sensor on Airflow
|
1117
|
+
description : str
|
1118
|
+
Description of sensor in the Airflow UI
|
1119
|
+
bucket_key : Union[str, List[str]]
|
1120
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1121
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1122
|
+
bucket_name : str
|
1123
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1124
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1125
|
+
wildcard_match : bool
|
1126
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1127
|
+
aws_conn_id : str
|
1128
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1129
|
+
verify : bool
|
1130
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1131
|
+
"""
|
1132
|
+
...
|
1133
|
+
|
1189
1134
|
@typing.overload
|
1190
1135
|
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]]:
|
1191
1136
|
"""
|
@@ -1279,6 +1224,92 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
1279
1224
|
"""
|
1280
1225
|
...
|
1281
1226
|
|
1227
|
+
def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1228
|
+
"""
|
1229
|
+
Specifies what flows belong to the same project.
|
1230
|
+
|
1231
|
+
A project-specific namespace is created for all flows that
|
1232
|
+
use the same `@project(name)`.
|
1233
|
+
|
1234
|
+
|
1235
|
+
Parameters
|
1236
|
+
----------
|
1237
|
+
name : str
|
1238
|
+
Project name. Make sure that the name is unique amongst all
|
1239
|
+
projects that use the same production scheduler. The name may
|
1240
|
+
contain only lowercase alphanumeric characters and underscores.
|
1241
|
+
|
1242
|
+
branch : Optional[str], default None
|
1243
|
+
The branch to use. If not specified, the branch is set to
|
1244
|
+
`user.<username>` unless `production` is set to `True`. This can
|
1245
|
+
also be set on the command line using `--branch` as a top-level option.
|
1246
|
+
It is an error to specify `branch` in the decorator and on the command line.
|
1247
|
+
|
1248
|
+
production : bool, default False
|
1249
|
+
Whether or not the branch is the production branch. This can also be set on the
|
1250
|
+
command line using `--production` as a top-level option. It is an error to specify
|
1251
|
+
`production` in the decorator and on the command line.
|
1252
|
+
The project branch name will be:
|
1253
|
+
- if `branch` is specified:
|
1254
|
+
- if `production` is True: `prod.<branch>`
|
1255
|
+
- if `production` is False: `test.<branch>`
|
1256
|
+
- if `branch` is not specified:
|
1257
|
+
- if `production` is True: `prod`
|
1258
|
+
- if `production` is False: `user.<username>`
|
1259
|
+
"""
|
1260
|
+
...
|
1261
|
+
|
1262
|
+
@typing.overload
|
1263
|
+
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]]:
|
1264
|
+
"""
|
1265
|
+
Specifies the times when the flow should be run when running on a
|
1266
|
+
production scheduler.
|
1267
|
+
|
1268
|
+
|
1269
|
+
Parameters
|
1270
|
+
----------
|
1271
|
+
hourly : bool, default False
|
1272
|
+
Run the workflow hourly.
|
1273
|
+
daily : bool, default True
|
1274
|
+
Run the workflow daily.
|
1275
|
+
weekly : bool, default False
|
1276
|
+
Run the workflow weekly.
|
1277
|
+
cron : str, optional, default None
|
1278
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1279
|
+
specified by this expression.
|
1280
|
+
timezone : str, optional, default None
|
1281
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1282
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1283
|
+
"""
|
1284
|
+
...
|
1285
|
+
|
1286
|
+
@typing.overload
|
1287
|
+
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1288
|
+
...
|
1289
|
+
|
1290
|
+
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):
|
1291
|
+
"""
|
1292
|
+
Specifies the times when the flow should be run when running on a
|
1293
|
+
production scheduler.
|
1294
|
+
|
1295
|
+
|
1296
|
+
Parameters
|
1297
|
+
----------
|
1298
|
+
hourly : bool, default False
|
1299
|
+
Run the workflow hourly.
|
1300
|
+
daily : bool, default True
|
1301
|
+
Run the workflow daily.
|
1302
|
+
weekly : bool, default False
|
1303
|
+
Run the workflow weekly.
|
1304
|
+
cron : str, optional, default None
|
1305
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1306
|
+
specified by this expression.
|
1307
|
+
timezone : str, optional, default None
|
1308
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1309
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1310
|
+
"""
|
1311
|
+
...
|
1312
|
+
|
1282
1313
|
@typing.overload
|
1283
1314
|
def trigger_on_finish(*, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1284
1315
|
"""
|