ob-metaflow-stubs 6.0.3.140__py2.py3-none-any.whl → 6.0.3.141__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 +461 -460
- 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 +2 -2
- 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 +79 -79
- 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 +4 -4
- 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 +2 -2
- 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/core.pyi +2 -2
- 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 +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/exceptions.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/model_storage.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/flowspec_utils.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/general.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/identity_utils.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/base.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/tar.pyi +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/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/parameters.pyi +2 -2
- metaflow-stubs/plugins/__init__.pyi +10 -10
- metaflow-stubs/plugins/airflow/__init__.pyi +1 -1
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +1 -1
- metaflow-stubs/plugins/airflow/exception.pyi +1 -1
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +1 -1
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +1 -1
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +1 -1
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +1 -1
- metaflow-stubs/plugins/argo/__init__.pyi +1 -1
- metaflow-stubs/plugins/argo/argo_client.pyi +1 -1
- metaflow-stubs/plugins/argo/argo_events.pyi +1 -1
- metaflow-stubs/plugins/argo/argo_workflows.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +2 -2
- metaflow-stubs/plugins/aws/__init__.pyi +1 -1
- metaflow-stubs/plugins/aws/aws_client.pyi +1 -1
- metaflow-stubs/plugins/aws/aws_utils.pyi +1 -1
- metaflow-stubs/plugins/aws/batch/__init__.pyi +1 -1
- metaflow-stubs/plugins/aws/batch/batch.pyi +1 -1
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +1 -1
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +1 -1
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +1 -1
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +3 -3
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +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 +2 -2
- 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 +1 -1
- 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 +1 -1
- 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 +2 -2
- 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/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/pypi_decorator.pyi +1 -1
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +1 -1
- metaflow-stubs/plugins/pypi/utils.pyi +1 -1
- metaflow-stubs/plugins/resources_decorator.pyi +1 -1
- metaflow-stubs/plugins/retry_decorator.pyi +1 -1
- metaflow-stubs/plugins/secrets/__init__.pyi +1 -1
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +1 -1
- 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/profilers/__init__.pyi +1 -1
- metaflow-stubs/pylint_wrapper.pyi +1 -1
- metaflow-stubs/runner/__init__.pyi +1 -1
- metaflow-stubs/runner/deployer.pyi +5 -5
- metaflow-stubs/runner/deployer_impl.pyi +1 -1
- metaflow-stubs/runner/metaflow_runner.pyi +1 -1
- metaflow-stubs/runner/nbdeploy.pyi +1 -1
- metaflow-stubs/runner/nbrun.pyi +1 -1
- metaflow-stubs/runner/subprocess_manager.pyi +1 -1
- metaflow-stubs/runner/utils.pyi +2 -2
- metaflow-stubs/system/__init__.pyi +1 -1
- metaflow-stubs/system/system_logger.pyi +2 -2
- metaflow-stubs/system/system_monitor.pyi +1 -1
- metaflow-stubs/tagging_util.pyi +1 -1
- metaflow-stubs/tuple_util.pyi +1 -1
- metaflow-stubs/user_configs/__init__.pyi +1 -1
- metaflow-stubs/user_configs/config_decorators.pyi +4 -4
- metaflow-stubs/user_configs/config_options.pyi +2 -2
- metaflow-stubs/user_configs/config_parameters.pyi +4 -4
- {ob_metaflow_stubs-6.0.3.140.dist-info → ob_metaflow_stubs-6.0.3.141.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-6.0.3.141.dist-info/RECORD +192 -0
- ob_metaflow_stubs-6.0.3.140.dist-info/RECORD +0 -192
- {ob_metaflow_stubs-6.0.3.140.dist-info → ob_metaflow_stubs-6.0.3.141.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-6.0.3.140.dist-info → ob_metaflow_stubs-6.0.3.141.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
3
|
# MF version: 2.14.0.1+obcheckpoint(0.1.8);ob(v1) #
|
4
|
-
# Generated on 2025-02-
|
4
|
+
# Generated on 2025-02-13T16:37:07.058478 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
|
-
import datetime
|
12
11
|
import typing
|
12
|
+
import datetime
|
13
13
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
14
14
|
StepFlag = typing.NewType("StepFlag", bool)
|
15
15
|
|
@@ -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
|
38
39
|
from . import tuple_util as tuple_util
|
39
40
|
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
|
@@ -146,198 +146,133 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
146
146
|
"""
|
147
147
|
...
|
148
148
|
|
149
|
-
|
150
|
-
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
151
|
-
"""
|
152
|
-
Internal decorator to support Fast bakery
|
153
|
-
Parameters
|
154
|
-
----------
|
155
|
-
"""
|
156
|
-
...
|
157
|
-
|
158
|
-
@typing.overload
|
159
|
-
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
160
|
-
...
|
161
|
-
|
162
|
-
def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
163
|
-
"""
|
164
|
-
Internal decorator to support Fast bakery
|
165
|
-
Parameters
|
166
|
-
----------
|
167
|
-
"""
|
168
|
-
...
|
169
|
-
|
170
|
-
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]]]:
|
171
|
-
"""
|
172
|
-
Decorator that helps cache, version and store models/datasets from huggingface hub.
|
173
|
-
|
174
|
-
|
175
|
-
Parameters
|
176
|
-
----------
|
177
|
-
temp_dir_root : str, optional
|
178
|
-
The root directory that will hold the temporary directory where objects will be downloaded.
|
179
|
-
|
180
|
-
load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
|
181
|
-
The list of repos (models/datasets) to load.
|
182
|
-
|
183
|
-
Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
|
184
|
-
|
185
|
-
- If repo (model/dataset) is not found in the datastore:
|
186
|
-
- Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
|
187
|
-
- Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
|
188
|
-
- All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
|
189
|
-
|
190
|
-
- If repo is found in the datastore:
|
191
|
-
- Loads it directly from datastore to local path (can be temporary directory or specified path)
|
192
|
-
"""
|
193
|
-
...
|
194
|
-
|
195
|
-
@typing.overload
|
196
|
-
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]]]:
|
197
|
-
"""
|
198
|
-
Specifies environment variables to be set prior to the execution of a step.
|
199
|
-
|
200
|
-
|
201
|
-
Parameters
|
202
|
-
----------
|
203
|
-
vars : Dict[str, str], default {}
|
204
|
-
Dictionary of environment variables to set.
|
205
|
-
"""
|
206
|
-
...
|
207
|
-
|
208
|
-
@typing.overload
|
209
|
-
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
210
|
-
...
|
211
|
-
|
212
|
-
@typing.overload
|
213
|
-
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
214
|
-
...
|
215
|
-
|
216
|
-
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
149
|
+
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]]]:
|
217
150
|
"""
|
218
|
-
Specifies
|
151
|
+
Specifies that this step should execute on DGX cloud.
|
219
152
|
|
220
153
|
|
221
154
|
Parameters
|
222
155
|
----------
|
223
|
-
|
224
|
-
|
156
|
+
gpu : int
|
157
|
+
Number of GPUs to use.
|
158
|
+
gpu_type : str
|
159
|
+
Type of Nvidia GPU to use.
|
160
|
+
queue_timeout : int
|
161
|
+
Time to keep the job in NVCF's queue.
|
225
162
|
"""
|
226
163
|
...
|
227
164
|
|
228
165
|
@typing.overload
|
229
|
-
def
|
166
|
+
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]]]:
|
230
167
|
"""
|
231
|
-
|
168
|
+
Specifies the Conda environment for the step.
|
232
169
|
|
170
|
+
Information in this decorator will augment any
|
171
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
172
|
+
you can use `@conda_base` to set packages required by all
|
173
|
+
steps and use `@conda` to specify step-specific overrides.
|
233
174
|
|
234
175
|
|
235
176
|
Parameters
|
236
177
|
----------
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
temp_dir_root : str, default: None
|
249
|
-
The root directory under which `current.checkpoint.directory` will be created.
|
178
|
+
packages : Dict[str, str], default {}
|
179
|
+
Packages to use for this step. The key is the name of the package
|
180
|
+
and the value is the version to use.
|
181
|
+
libraries : Dict[str, str], default {}
|
182
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
183
|
+
python : str, optional, default None
|
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.
|
250
188
|
"""
|
251
189
|
...
|
252
190
|
|
253
191
|
@typing.overload
|
254
|
-
def
|
192
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
255
193
|
...
|
256
194
|
|
257
195
|
@typing.overload
|
258
|
-
def
|
196
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
259
197
|
...
|
260
198
|
|
261
|
-
def
|
199
|
+
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):
|
262
200
|
"""
|
263
|
-
|
201
|
+
Specifies the Conda environment for the step.
|
264
202
|
|
203
|
+
Information in this decorator will augment any
|
204
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
205
|
+
you can use `@conda_base` to set packages required by all
|
206
|
+
steps and use `@conda` to specify step-specific overrides.
|
265
207
|
|
266
208
|
|
267
209
|
Parameters
|
268
210
|
----------
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
temp_dir_root : str, default: None
|
281
|
-
The root directory under which `current.checkpoint.directory` will be created.
|
211
|
+
packages : Dict[str, str], default {}
|
212
|
+
Packages to use for this step. The key is the name of the package
|
213
|
+
and the value is the version to use.
|
214
|
+
libraries : Dict[str, str], default {}
|
215
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
216
|
+
python : str, optional, default None
|
217
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
218
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
219
|
+
disabled : bool, default False
|
220
|
+
If set to True, disables @conda.
|
282
221
|
"""
|
283
222
|
...
|
284
223
|
|
285
224
|
@typing.overload
|
286
|
-
def
|
225
|
+
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]]]:
|
287
226
|
"""
|
288
|
-
Specifies
|
289
|
-
|
290
|
-
This decorator is useful if this step may hang indefinitely.
|
227
|
+
Specifies the number of times the task corresponding
|
228
|
+
to a step needs to be retried.
|
291
229
|
|
292
|
-
This
|
293
|
-
|
294
|
-
|
230
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
231
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
232
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
295
233
|
|
296
|
-
|
297
|
-
|
234
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
235
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
236
|
+
ensuring that the flow execution can continue.
|
298
237
|
|
299
238
|
|
300
239
|
Parameters
|
301
240
|
----------
|
302
|
-
|
303
|
-
Number of
|
304
|
-
|
305
|
-
Number of minutes
|
306
|
-
hours : int, default 0
|
307
|
-
Number of hours to wait prior to timing out.
|
241
|
+
times : int, default 3
|
242
|
+
Number of times to retry this task.
|
243
|
+
minutes_between_retries : int, default 2
|
244
|
+
Number of minutes between retries.
|
308
245
|
"""
|
309
246
|
...
|
310
247
|
|
311
248
|
@typing.overload
|
312
|
-
def
|
249
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
313
250
|
...
|
314
251
|
|
315
252
|
@typing.overload
|
316
|
-
def
|
253
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
317
254
|
...
|
318
255
|
|
319
|
-
def
|
256
|
+
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):
|
320
257
|
"""
|
321
|
-
Specifies
|
322
|
-
|
323
|
-
This decorator is useful if this step may hang indefinitely.
|
258
|
+
Specifies the number of times the task corresponding
|
259
|
+
to a step needs to be retried.
|
324
260
|
|
325
|
-
This
|
326
|
-
|
327
|
-
|
261
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
262
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
263
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
328
264
|
|
329
|
-
|
330
|
-
|
265
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
266
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
267
|
+
ensuring that the flow execution can continue.
|
331
268
|
|
332
269
|
|
333
270
|
Parameters
|
334
271
|
----------
|
335
|
-
|
336
|
-
Number of
|
337
|
-
|
338
|
-
Number of minutes
|
339
|
-
hours : int, default 0
|
340
|
-
Number of hours to wait prior to timing out.
|
272
|
+
times : int, default 3
|
273
|
+
Number of times to retry this task.
|
274
|
+
minutes_between_retries : int, default 2
|
275
|
+
Number of minutes between retries.
|
341
276
|
"""
|
342
277
|
...
|
343
278
|
|
@@ -390,154 +325,9 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
|
|
390
325
|
"""
|
391
326
|
...
|
392
327
|
|
393
|
-
|
394
|
-
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]]]:
|
395
|
-
"""
|
396
|
-
Specifies the PyPI packages for the step.
|
397
|
-
|
398
|
-
Information in this decorator will augment any
|
399
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
400
|
-
you can use `@pypi_base` to set packages required by all
|
401
|
-
steps and use `@pypi` to specify step-specific overrides.
|
402
|
-
|
403
|
-
|
404
|
-
Parameters
|
405
|
-
----------
|
406
|
-
packages : Dict[str, str], default: {}
|
407
|
-
Packages to use for this step. The key is the name of the package
|
408
|
-
and the value is the version to use.
|
409
|
-
python : str, optional, default: None
|
410
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
411
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
412
|
-
"""
|
413
|
-
...
|
414
|
-
|
415
|
-
@typing.overload
|
416
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
417
|
-
...
|
418
|
-
|
419
|
-
@typing.overload
|
420
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
421
|
-
...
|
422
|
-
|
423
|
-
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):
|
328
|
+
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') -> 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]]]:
|
424
329
|
"""
|
425
|
-
Specifies
|
426
|
-
|
427
|
-
Information in this decorator will augment any
|
428
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
429
|
-
you can use `@pypi_base` to set packages required by all
|
430
|
-
steps and use `@pypi` to specify step-specific overrides.
|
431
|
-
|
432
|
-
|
433
|
-
Parameters
|
434
|
-
----------
|
435
|
-
packages : Dict[str, str], default: {}
|
436
|
-
Packages to use for this step. The key is the name of the package
|
437
|
-
and the value is the version to use.
|
438
|
-
python : str, optional, default: None
|
439
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
440
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
441
|
-
"""
|
442
|
-
...
|
443
|
-
|
444
|
-
@typing.overload
|
445
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
446
|
-
"""
|
447
|
-
Parameters
|
448
|
-
----------
|
449
|
-
"""
|
450
|
-
...
|
451
|
-
|
452
|
-
@typing.overload
|
453
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
454
|
-
...
|
455
|
-
|
456
|
-
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
457
|
-
"""
|
458
|
-
Parameters
|
459
|
-
----------
|
460
|
-
"""
|
461
|
-
...
|
462
|
-
|
463
|
-
@typing.overload
|
464
|
-
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]]]:
|
465
|
-
"""
|
466
|
-
Specifies the Conda environment for the step.
|
467
|
-
|
468
|
-
Information in this decorator will augment any
|
469
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
470
|
-
you can use `@conda_base` to set packages required by all
|
471
|
-
steps and use `@conda` to specify step-specific overrides.
|
472
|
-
|
473
|
-
|
474
|
-
Parameters
|
475
|
-
----------
|
476
|
-
packages : Dict[str, str], default {}
|
477
|
-
Packages to use for this step. The key is the name of the package
|
478
|
-
and the value is the version to use.
|
479
|
-
libraries : Dict[str, str], default {}
|
480
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
481
|
-
python : str, optional, default None
|
482
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
483
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
484
|
-
disabled : bool, default False
|
485
|
-
If set to True, disables @conda.
|
486
|
-
"""
|
487
|
-
...
|
488
|
-
|
489
|
-
@typing.overload
|
490
|
-
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
491
|
-
...
|
492
|
-
|
493
|
-
@typing.overload
|
494
|
-
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
495
|
-
...
|
496
|
-
|
497
|
-
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):
|
498
|
-
"""
|
499
|
-
Specifies the Conda environment for the step.
|
500
|
-
|
501
|
-
Information in this decorator will augment any
|
502
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
503
|
-
you can use `@conda_base` to set packages required by all
|
504
|
-
steps and use `@conda` to specify step-specific overrides.
|
505
|
-
|
506
|
-
|
507
|
-
Parameters
|
508
|
-
----------
|
509
|
-
packages : Dict[str, str], default {}
|
510
|
-
Packages to use for this step. The key is the name of the package
|
511
|
-
and the value is the version to use.
|
512
|
-
libraries : Dict[str, str], default {}
|
513
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
514
|
-
python : str, optional, default None
|
515
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
516
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
517
|
-
disabled : bool, default False
|
518
|
-
If set to True, disables @conda.
|
519
|
-
"""
|
520
|
-
...
|
521
|
-
|
522
|
-
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]]]:
|
523
|
-
"""
|
524
|
-
Specifies that this step should execute on DGX cloud.
|
525
|
-
|
526
|
-
|
527
|
-
Parameters
|
528
|
-
----------
|
529
|
-
gpu : int
|
530
|
-
Number of GPUs to use.
|
531
|
-
gpu_type : str
|
532
|
-
Type of Nvidia GPU to use.
|
533
|
-
queue_timeout : int
|
534
|
-
Time to keep the job in NVCF's queue.
|
535
|
-
"""
|
536
|
-
...
|
537
|
-
|
538
|
-
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') -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
539
|
-
"""
|
540
|
-
Specifies that this step should execute on Kubernetes.
|
330
|
+
Specifies that this step should execute on Kubernetes.
|
541
331
|
|
542
332
|
|
543
333
|
Parameters
|
@@ -613,81 +403,197 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
|
|
613
403
|
...
|
614
404
|
|
615
405
|
@typing.overload
|
616
|
-
def
|
406
|
+
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]]]:
|
617
407
|
"""
|
618
|
-
|
408
|
+
Enables checkpointing for a step.
|
619
409
|
|
620
|
-
Use `@resources` to specify the resource requirements
|
621
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
622
410
|
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
411
|
+
|
412
|
+
Parameters
|
413
|
+
----------
|
414
|
+
load_policy : str, default: "fresh"
|
415
|
+
The policy for loading the checkpoint. The following policies are supported:
|
416
|
+
- "eager": Loads the the latest available checkpoint within the namespace.
|
417
|
+
With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
|
418
|
+
will be loaded at the start of the task.
|
419
|
+
- "none": Do not load any checkpoint
|
420
|
+
- "fresh": Loads the lastest checkpoint created within the running Task.
|
421
|
+
This mode helps loading checkpoints across various retry attempts of the same task.
|
422
|
+
With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
|
423
|
+
created within the task will be loaded when the task is retries execution on failure.
|
424
|
+
|
425
|
+
temp_dir_root : str, default: None
|
426
|
+
The root directory under which `current.checkpoint.directory` will be created.
|
427
|
+
"""
|
428
|
+
...
|
429
|
+
|
430
|
+
@typing.overload
|
431
|
+
def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
432
|
+
...
|
433
|
+
|
434
|
+
@typing.overload
|
435
|
+
def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
436
|
+
...
|
437
|
+
|
438
|
+
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):
|
439
|
+
"""
|
440
|
+
Enables checkpointing for a step.
|
441
|
+
|
633
442
|
|
634
443
|
|
635
444
|
Parameters
|
636
445
|
----------
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
446
|
+
load_policy : str, default: "fresh"
|
447
|
+
The policy for loading the checkpoint. The following policies are supported:
|
448
|
+
- "eager": Loads the the latest available checkpoint within the namespace.
|
449
|
+
With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
|
450
|
+
will be loaded at the start of the task.
|
451
|
+
- "none": Do not load any checkpoint
|
452
|
+
- "fresh": Loads the lastest checkpoint created within the running Task.
|
453
|
+
This mode helps loading checkpoints across various retry attempts of the same task.
|
454
|
+
With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
|
455
|
+
created within the task will be loaded when the task is retries execution on failure.
|
456
|
+
|
457
|
+
temp_dir_root : str, default: None
|
458
|
+
The root directory under which `current.checkpoint.directory` will be created.
|
648
459
|
"""
|
649
460
|
...
|
650
461
|
|
651
462
|
@typing.overload
|
652
|
-
def
|
463
|
+
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]]]:
|
464
|
+
"""
|
465
|
+
Specifies environment variables to be set prior to the execution of a step.
|
466
|
+
|
467
|
+
|
468
|
+
Parameters
|
469
|
+
----------
|
470
|
+
vars : Dict[str, str], default {}
|
471
|
+
Dictionary of environment variables to set.
|
472
|
+
"""
|
653
473
|
...
|
654
474
|
|
655
475
|
@typing.overload
|
656
|
-
def
|
476
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
657
477
|
...
|
658
478
|
|
659
|
-
|
479
|
+
@typing.overload
|
480
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
481
|
+
...
|
482
|
+
|
483
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
660
484
|
"""
|
661
|
-
Specifies
|
485
|
+
Specifies environment variables to be set prior to the execution of a step.
|
662
486
|
|
663
|
-
Use `@resources` to specify the resource requirements
|
664
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
665
487
|
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
488
|
+
Parameters
|
489
|
+
----------
|
490
|
+
vars : Dict[str, str], default {}
|
491
|
+
Dictionary of environment variables to set.
|
492
|
+
"""
|
493
|
+
...
|
494
|
+
|
495
|
+
@typing.overload
|
496
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
497
|
+
"""
|
498
|
+
Internal decorator to support Fast bakery
|
499
|
+
Parameters
|
500
|
+
----------
|
501
|
+
"""
|
502
|
+
...
|
503
|
+
|
504
|
+
@typing.overload
|
505
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
506
|
+
...
|
507
|
+
|
508
|
+
def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
509
|
+
"""
|
510
|
+
Internal decorator to support Fast bakery
|
511
|
+
Parameters
|
512
|
+
----------
|
513
|
+
"""
|
514
|
+
...
|
515
|
+
|
516
|
+
@typing.overload
|
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]]]:
|
518
|
+
"""
|
519
|
+
Specifies a timeout for your step.
|
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.
|
676
529
|
|
677
530
|
|
678
531
|
Parameters
|
679
532
|
----------
|
680
|
-
|
681
|
-
Number of
|
682
|
-
|
683
|
-
Number of
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
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)
|
691
597
|
"""
|
692
598
|
...
|
693
599
|
|
@@ -742,6 +648,76 @@ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
742
648
|
"""
|
743
649
|
...
|
744
650
|
|
651
|
+
@typing.overload
|
652
|
+
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]]]:
|
653
|
+
"""
|
654
|
+
Specifies the PyPI packages for the step.
|
655
|
+
|
656
|
+
Information in this decorator will augment any
|
657
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
658
|
+
you can use `@pypi_base` to set packages required by all
|
659
|
+
steps and use `@pypi` to specify step-specific overrides.
|
660
|
+
|
661
|
+
|
662
|
+
Parameters
|
663
|
+
----------
|
664
|
+
packages : Dict[str, str], default: {}
|
665
|
+
Packages to use for this step. The key is the name of the package
|
666
|
+
and the value is the version to use.
|
667
|
+
python : str, optional, default: None
|
668
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
669
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
670
|
+
"""
|
671
|
+
...
|
672
|
+
|
673
|
+
@typing.overload
|
674
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
675
|
+
...
|
676
|
+
|
677
|
+
@typing.overload
|
678
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
679
|
+
...
|
680
|
+
|
681
|
+
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):
|
682
|
+
"""
|
683
|
+
Specifies the PyPI packages for the step.
|
684
|
+
|
685
|
+
Information in this decorator will augment any
|
686
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
687
|
+
you can use `@pypi_base` to set packages required by all
|
688
|
+
steps and use `@pypi` to specify step-specific overrides.
|
689
|
+
|
690
|
+
|
691
|
+
Parameters
|
692
|
+
----------
|
693
|
+
packages : Dict[str, str], default: {}
|
694
|
+
Packages to use for this step. The key is the name of the package
|
695
|
+
and the value is the version to use.
|
696
|
+
python : str, optional, default: None
|
697
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
698
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
699
|
+
"""
|
700
|
+
...
|
701
|
+
|
702
|
+
@typing.overload
|
703
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
704
|
+
"""
|
705
|
+
Parameters
|
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
|
+
|
745
721
|
@typing.overload
|
746
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]]]:
|
747
723
|
"""
|
@@ -772,63 +748,120 @@ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
772
748
|
|
773
749
|
Parameters
|
774
750
|
----------
|
775
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
776
|
-
List of secret specs, defining how the secrets are to be retrieved
|
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.
|
777
786
|
"""
|
778
787
|
...
|
779
788
|
|
780
789
|
@typing.overload
|
781
|
-
def
|
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]]]:
|
782
791
|
"""
|
783
|
-
Specifies the
|
784
|
-
to a step needs to be retried.
|
792
|
+
Specifies the resources needed when executing this step.
|
785
793
|
|
786
|
-
|
787
|
-
|
788
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
794
|
+
Use `@resources` to specify the resource requirements
|
795
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
789
796
|
|
790
|
-
|
791
|
-
|
792
|
-
|
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`.
|
793
807
|
|
794
808
|
|
795
809
|
Parameters
|
796
810
|
----------
|
797
|
-
|
798
|
-
Number of
|
799
|
-
|
800
|
-
Number of
|
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.
|
801
822
|
"""
|
802
823
|
...
|
803
824
|
|
804
825
|
@typing.overload
|
805
|
-
def
|
826
|
+
def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
806
827
|
...
|
807
828
|
|
808
829
|
@typing.overload
|
809
|
-
def
|
830
|
+
def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
810
831
|
...
|
811
832
|
|
812
|
-
def
|
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):
|
813
834
|
"""
|
814
|
-
Specifies the
|
815
|
-
to a step needs to be retried.
|
835
|
+
Specifies the resources needed when executing this step.
|
816
836
|
|
817
|
-
|
818
|
-
|
819
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
837
|
+
Use `@resources` to specify the resource requirements
|
838
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
820
839
|
|
821
|
-
|
822
|
-
|
823
|
-
|
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`.
|
824
850
|
|
825
851
|
|
826
852
|
Parameters
|
827
853
|
----------
|
828
|
-
|
829
|
-
Number of
|
830
|
-
|
831
|
-
Number of
|
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.
|
832
865
|
"""
|
833
866
|
...
|
834
867
|
|
@@ -924,6 +957,49 @@ def project(*, name: str, branch: typing.Optional[str] = None, production: bool
|
|
924
957
|
"""
|
925
958
|
...
|
926
959
|
|
960
|
+
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]]:
|
961
|
+
"""
|
962
|
+
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.
|
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
|
+
|
966
|
+
Parameters
|
967
|
+
----------
|
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
|
+
"""
|
1001
|
+
...
|
1002
|
+
|
927
1003
|
@typing.overload
|
928
1004
|
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]]:
|
929
1005
|
"""
|
@@ -975,10 +1051,13 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
|
|
975
1051
|
"""
|
976
1052
|
...
|
977
1053
|
|
978
|
-
def
|
1054
|
+
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]]:
|
979
1055
|
"""
|
980
|
-
The `@
|
981
|
-
This decorator only works when a flow is scheduled on Airflow
|
1056
|
+
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)
|
1057
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
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
1061
|
|
983
1062
|
|
984
1063
|
Parameters
|
@@ -1000,21 +1079,18 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
|
|
1000
1079
|
Name of the sensor on Airflow
|
1001
1080
|
description : str
|
1002
1081
|
Description of sensor in the Airflow UI
|
1003
|
-
|
1004
|
-
The
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
check_existence: bool
|
1016
|
-
Set to True to check if the external task exists or check if
|
1017
|
-
the DAG to wait for exists. (Default: True)
|
1082
|
+
bucket_key : Union[str, List[str]]
|
1083
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1084
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1085
|
+
bucket_name : str
|
1086
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1087
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1088
|
+
wildcard_match : bool
|
1089
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1090
|
+
aws_conn_id : str
|
1091
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1092
|
+
verify : bool
|
1093
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1018
1094
|
"""
|
1019
1095
|
...
|
1020
1096
|
|
@@ -1069,38 +1145,6 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
|
|
1069
1145
|
"""
|
1070
1146
|
...
|
1071
1147
|
|
1072
|
-
def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1073
|
-
"""
|
1074
|
-
This decorator is used to run NIM containers in Metaflow tasks as sidecars.
|
1075
|
-
|
1076
|
-
User code call
|
1077
|
-
-----------
|
1078
|
-
@nim(
|
1079
|
-
models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
|
1080
|
-
backend='managed'
|
1081
|
-
)
|
1082
|
-
|
1083
|
-
Valid backend options
|
1084
|
-
---------------------
|
1085
|
-
- 'managed': Outerbounds selects a compute provider based on the model.
|
1086
|
-
- 🚧 'dataplane': Run in your account.
|
1087
|
-
|
1088
|
-
Valid model options
|
1089
|
-
----------------
|
1090
|
-
- 'meta/llama3-8b-instruct': 8B parameter model
|
1091
|
-
- 'meta/llama3-70b-instruct': 70B parameter model
|
1092
|
-
- Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
|
1093
|
-
|
1094
|
-
|
1095
|
-
Parameters
|
1096
|
-
----------
|
1097
|
-
models: list[NIM]
|
1098
|
-
List of NIM containers running models in sidecars.
|
1099
|
-
backend: str
|
1100
|
-
Compute provider to run the NIM container.
|
1101
|
-
"""
|
1102
|
-
...
|
1103
|
-
|
1104
1148
|
@typing.overload
|
1105
1149
|
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1106
1150
|
"""
|
@@ -1336,48 +1380,5 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
1336
1380
|
"""
|
1337
1381
|
...
|
1338
1382
|
|
1339
|
-
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]]:
|
1340
|
-
"""
|
1341
|
-
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)
|
1342
|
-
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1343
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1344
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1345
|
-
starts only after all sensors finish.
|
1346
|
-
|
1347
|
-
|
1348
|
-
Parameters
|
1349
|
-
----------
|
1350
|
-
timeout : int
|
1351
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
1352
|
-
poke_interval : int
|
1353
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
1354
|
-
mode : str
|
1355
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1356
|
-
exponential_backoff : bool
|
1357
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1358
|
-
pool : str
|
1359
|
-
the slot pool this task should run in,
|
1360
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1361
|
-
soft_fail : bool
|
1362
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1363
|
-
name : str
|
1364
|
-
Name of the sensor on Airflow
|
1365
|
-
description : str
|
1366
|
-
Description of sensor in the Airflow UI
|
1367
|
-
bucket_key : Union[str, List[str]]
|
1368
|
-
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1369
|
-
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1370
|
-
bucket_name : str
|
1371
|
-
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1372
|
-
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1373
|
-
wildcard_match : bool
|
1374
|
-
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1375
|
-
aws_conn_id : str
|
1376
|
-
a reference to the s3 connection on Airflow. (Default: None)
|
1377
|
-
verify : bool
|
1378
|
-
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1379
|
-
"""
|
1380
|
-
...
|
1381
|
-
|
1382
1383
|
pkg_name: str
|
1383
1384
|
|