ob-metaflow-stubs 6.0.3.130__py2.py3-none-any.whl → 6.0.3.132__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 +222 -222
- metaflow-stubs/cards.pyi +3 -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 +6 -6
- metaflow-stubs/client/filecache.pyi +2 -2
- metaflow-stubs/events.pyi +2 -2
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +5 -5
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +4 -4
- 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 +96 -96
- 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 +4 -4
- 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 +5 -5
- 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 -5
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/constructors.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/core.pyi +4 -4
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/decorator.pyi +5 -5
- 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 +2 -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/core.pyi +2 -2
- 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 +4 -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 +3 -3
- 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 +3 -3
- 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 +4 -4
- 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 +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +3 -3
- 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 +4 -4
- metaflow-stubs/plugins/__init__.pyi +22 -14
- 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 +2 -2
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +4 -4
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +4 -4
- metaflow-stubs/plugins/aws/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +4 -4
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +3 -3
- metaflow-stubs/plugins/azure/__init__.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
- metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/cards/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_client.pyi +2 -2
- metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
- metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +15 -7
- metaflow-stubs/plugins/cards/card_modules/card.pyi +9 -3
- metaflow-stubs/plugins/cards/card_modules/components.pyi +48 -10
- 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 +6 -6
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +3 -3
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +2 -2
- metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3.pyi +5 -5
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
- metaflow-stubs/plugins/debug_logger.pyi +2 -2
- metaflow-stubs/plugins/debug_monitor.pyi +2 -2
- metaflow-stubs/plugins/environment_decorator.pyi +2 -2
- metaflow-stubs/plugins/events_decorator.pyi +2 -2
- metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
- metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
- metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kube_utils.pyi +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
- metaflow-stubs/plugins/perimeters.pyi +2 -2
- metaflow-stubs/plugins/project_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +5 -5
- 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 +3 -3
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
- metaflow-stubs/plugins/snowflake/__init__.pyi +2 -2
- metaflow-stubs/plugins/storage_executor.pyi +2 -2
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
- metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
- metaflow-stubs/profilers/__init__.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +5 -5
- metaflow-stubs/runner/deployer_impl.pyi +2 -2
- metaflow-stubs/runner/metaflow_runner.pyi +14 -6
- metaflow-stubs/runner/nbdeploy.pyi +2 -2
- metaflow-stubs/runner/nbrun.pyi +2 -2
- metaflow-stubs/runner/subprocess_manager.pyi +2 -2
- metaflow-stubs/runner/utils.pyi +3 -3
- metaflow-stubs/system/__init__.pyi +2 -2
- metaflow-stubs/system/system_logger.pyi +2 -2
- metaflow-stubs/system/system_monitor.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- metaflow-stubs/user_configs/__init__.pyi +2 -2
- metaflow-stubs/user_configs/config_decorators.pyi +6 -6
- metaflow-stubs/user_configs/config_options.pyi +3 -3
- metaflow-stubs/user_configs/config_parameters.pyi +7 -7
- {ob_metaflow_stubs-6.0.3.130.dist-info → ob_metaflow_stubs-6.0.3.132.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-6.0.3.132.dist-info/RECORD +191 -0
- ob_metaflow_stubs-6.0.3.130.dist-info/RECORD +0 -191
- {ob_metaflow_stubs-6.0.3.130.dist-info → ob_metaflow_stubs-6.0.3.132.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-6.0.3.130.dist-info → ob_metaflow_stubs-6.0.3.132.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
|
-
# MF version: 2.13.
|
4
|
-
# Generated on 2025-01-
|
3
|
+
# MF version: 2.13.3.1+obcheckpoint(0.1.6);ob(v1) #
|
4
|
+
# Generated on 2025-01-10T14:41:26.700032 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
|
-
import typing
|
12
11
|
import datetime
|
12
|
+
import typing
|
13
13
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
14
14
|
StepFlag = typing.NewType("StepFlag", bool)
|
15
15
|
|
@@ -146,117 +146,140 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
146
146
|
"""
|
147
147
|
...
|
148
148
|
|
149
|
-
|
149
|
+
@typing.overload
|
150
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
150
151
|
"""
|
151
|
-
|
152
|
+
Decorator prototype for all step decorators. This function gets specialized
|
153
|
+
and imported for all decorators types by _import_plugin_decorators().
|
152
154
|
"""
|
153
155
|
...
|
154
156
|
|
155
|
-
|
157
|
+
@typing.overload
|
158
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
159
|
+
...
|
160
|
+
|
161
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
156
162
|
"""
|
157
|
-
Decorator
|
163
|
+
Decorator prototype for all step decorators. This function gets specialized
|
164
|
+
and imported for all decorators types by _import_plugin_decorators().
|
158
165
|
"""
|
159
166
|
...
|
160
167
|
|
161
168
|
@typing.overload
|
162
|
-
def
|
169
|
+
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]]]:
|
163
170
|
"""
|
164
|
-
Specifies
|
165
|
-
to a step needs to be retried.
|
166
|
-
|
167
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
168
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
169
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
170
|
-
|
171
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
172
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
173
|
-
ensuring that the flow execution can continue.
|
171
|
+
Specifies environment variables to be set prior to the execution of a step.
|
174
172
|
"""
|
175
173
|
...
|
176
174
|
|
177
175
|
@typing.overload
|
178
|
-
def
|
176
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
179
177
|
...
|
180
178
|
|
181
179
|
@typing.overload
|
182
|
-
def
|
180
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
183
181
|
...
|
184
182
|
|
185
|
-
def
|
183
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
186
184
|
"""
|
187
|
-
Specifies
|
188
|
-
to a step needs to be retried.
|
189
|
-
|
190
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
191
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
192
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
193
|
-
|
194
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
195
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
196
|
-
ensuring that the flow execution can continue.
|
185
|
+
Specifies environment variables to be set prior to the execution of a step.
|
197
186
|
"""
|
198
187
|
...
|
199
188
|
|
200
189
|
@typing.overload
|
201
|
-
def
|
190
|
+
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]]]:
|
202
191
|
"""
|
203
|
-
|
204
|
-
|
205
|
-
This decorator is useful if this step may hang indefinitely.
|
206
|
-
|
207
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
208
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
209
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
210
|
-
|
211
|
-
Note that all the values specified in parameters are added together so if you specify
|
212
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
192
|
+
Enables checkpointing for a step.
|
213
193
|
"""
|
214
194
|
...
|
215
195
|
|
216
196
|
@typing.overload
|
217
|
-
def
|
197
|
+
def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
218
198
|
...
|
219
199
|
|
220
200
|
@typing.overload
|
221
|
-
def
|
201
|
+
def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
222
202
|
...
|
223
203
|
|
224
|
-
def
|
204
|
+
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):
|
225
205
|
"""
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
206
|
+
Enables checkpointing for a step.
|
207
|
+
"""
|
208
|
+
...
|
209
|
+
|
210
|
+
@typing.overload
|
211
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
212
|
+
"""
|
213
|
+
Internal decorator to support Fast bakery
|
214
|
+
"""
|
215
|
+
...
|
216
|
+
|
217
|
+
@typing.overload
|
218
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
219
|
+
...
|
220
|
+
|
221
|
+
def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
222
|
+
"""
|
223
|
+
Internal decorator to support Fast bakery
|
224
|
+
"""
|
225
|
+
...
|
226
|
+
|
227
|
+
@typing.overload
|
228
|
+
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]]]:
|
229
|
+
"""
|
230
|
+
Specifies the Conda environment for the step.
|
233
231
|
|
234
|
-
|
235
|
-
|
232
|
+
Information in this decorator will augment any
|
233
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
234
|
+
you can use `@conda_base` to set packages required by all
|
235
|
+
steps and use `@conda` to specify step-specific overrides.
|
236
236
|
"""
|
237
237
|
...
|
238
238
|
|
239
239
|
@typing.overload
|
240
|
-
def
|
240
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
241
|
+
...
|
242
|
+
|
243
|
+
@typing.overload
|
244
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
245
|
+
...
|
246
|
+
|
247
|
+
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):
|
241
248
|
"""
|
242
|
-
Specifies
|
249
|
+
Specifies the Conda environment for the step.
|
243
250
|
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
251
|
+
Information in this decorator will augment any
|
252
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
253
|
+
you can use `@conda_base` to set packages required by all
|
254
|
+
steps and use `@conda` to specify step-specific overrides.
|
248
255
|
"""
|
249
256
|
...
|
250
257
|
|
251
258
|
@typing.overload
|
252
|
-
def
|
259
|
+
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]]]:
|
260
|
+
"""
|
261
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
262
|
+
the execution of a step.
|
263
|
+
"""
|
253
264
|
...
|
254
265
|
|
255
266
|
@typing.overload
|
256
|
-
def
|
267
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
257
268
|
...
|
258
269
|
|
259
|
-
|
270
|
+
@typing.overload
|
271
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
272
|
+
...
|
273
|
+
|
274
|
+
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]]] = []):
|
275
|
+
"""
|
276
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
277
|
+
the execution of a step.
|
278
|
+
"""
|
279
|
+
...
|
280
|
+
|
281
|
+
@typing.overload
|
282
|
+
def catch(*, var: typing.Optional[str] = None, print_exception: bool = True) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
260
283
|
"""
|
261
284
|
Specifies that the step will success under all circumstances.
|
262
285
|
|
@@ -268,80 +291,103 @@ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
268
291
|
...
|
269
292
|
|
270
293
|
@typing.overload
|
271
|
-
def
|
272
|
-
"""
|
273
|
-
Decorator prototype for all step decorators. This function gets specialized
|
274
|
-
and imported for all decorators types by _import_plugin_decorators().
|
275
|
-
"""
|
294
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
276
295
|
...
|
277
296
|
|
278
297
|
@typing.overload
|
279
|
-
def
|
298
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
280
299
|
...
|
281
300
|
|
282
|
-
def
|
301
|
+
def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
|
283
302
|
"""
|
284
|
-
|
285
|
-
|
303
|
+
Specifies that the step will success under all circumstances.
|
304
|
+
|
305
|
+
The decorator will create an optional artifact, specified by `var`, which
|
306
|
+
contains the exception raised. You can use it to detect the presence
|
307
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
308
|
+
are missing.
|
286
309
|
"""
|
287
310
|
...
|
288
311
|
|
289
312
|
@typing.overload
|
290
|
-
def
|
313
|
+
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]]]:
|
291
314
|
"""
|
292
|
-
|
315
|
+
Specifies the number of times the task corresponding
|
316
|
+
to a step needs to be retried.
|
317
|
+
|
318
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
319
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
320
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
321
|
+
|
322
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
323
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
324
|
+
ensuring that the flow execution can continue.
|
293
325
|
"""
|
294
326
|
...
|
295
327
|
|
296
328
|
@typing.overload
|
297
|
-
def
|
329
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
298
330
|
...
|
299
331
|
|
300
332
|
@typing.overload
|
301
|
-
def
|
333
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
302
334
|
...
|
303
335
|
|
304
|
-
def
|
336
|
+
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):
|
305
337
|
"""
|
306
|
-
|
338
|
+
Specifies the number of times the task corresponding
|
339
|
+
to a step needs to be retried.
|
340
|
+
|
341
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
342
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
343
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
344
|
+
|
345
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
346
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
347
|
+
ensuring that the flow execution can continue.
|
307
348
|
"""
|
308
349
|
...
|
309
350
|
|
310
351
|
@typing.overload
|
311
|
-
def
|
352
|
+
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]]]:
|
312
353
|
"""
|
313
|
-
|
354
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
355
|
+
|
356
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
314
357
|
"""
|
315
358
|
...
|
316
359
|
|
317
360
|
@typing.overload
|
318
|
-
def
|
361
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
319
362
|
...
|
320
363
|
|
321
364
|
@typing.overload
|
322
|
-
def
|
365
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
323
366
|
...
|
324
367
|
|
325
|
-
def
|
368
|
+
def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
|
326
369
|
"""
|
327
|
-
|
370
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
371
|
+
|
372
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
328
373
|
"""
|
329
374
|
...
|
330
375
|
|
331
|
-
|
332
|
-
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
376
|
+
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]]]:
|
333
377
|
"""
|
334
|
-
|
378
|
+
Decorator that helps cache, version and store models/datasets from huggingface hub.
|
335
379
|
"""
|
336
380
|
...
|
337
381
|
|
338
|
-
|
339
|
-
|
382
|
+
def nvidia(*, gpu: int, gpu_type: str) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
383
|
+
"""
|
384
|
+
Specifies that this step should execute on DGX cloud.
|
385
|
+
"""
|
340
386
|
...
|
341
387
|
|
342
|
-
def
|
388
|
+
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]]]:
|
343
389
|
"""
|
344
|
-
|
390
|
+
Specifies that this step should execute on Kubernetes.
|
345
391
|
"""
|
346
392
|
...
|
347
393
|
|
@@ -394,66 +440,6 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
394
440
|
"""
|
395
441
|
...
|
396
442
|
|
397
|
-
@typing.overload
|
398
|
-
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]]]:
|
399
|
-
"""
|
400
|
-
Specifies the Conda environment for the step.
|
401
|
-
|
402
|
-
Information in this decorator will augment any
|
403
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
404
|
-
you can use `@conda_base` to set packages required by all
|
405
|
-
steps and use `@conda` to specify step-specific overrides.
|
406
|
-
"""
|
407
|
-
...
|
408
|
-
|
409
|
-
@typing.overload
|
410
|
-
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
411
|
-
...
|
412
|
-
|
413
|
-
@typing.overload
|
414
|
-
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
415
|
-
...
|
416
|
-
|
417
|
-
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):
|
418
|
-
"""
|
419
|
-
Specifies the Conda environment for the step.
|
420
|
-
|
421
|
-
Information in this decorator will augment any
|
422
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
423
|
-
you can use `@conda_base` to set packages required by all
|
424
|
-
steps and use `@conda` to specify step-specific overrides.
|
425
|
-
"""
|
426
|
-
...
|
427
|
-
|
428
|
-
def nvidia(*, gpu: int, gpu_type: str) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
429
|
-
"""
|
430
|
-
Specifies that this step should execute on DGX cloud.
|
431
|
-
"""
|
432
|
-
...
|
433
|
-
|
434
|
-
@typing.overload
|
435
|
-
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]]]:
|
436
|
-
"""
|
437
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
438
|
-
the execution of a step.
|
439
|
-
"""
|
440
|
-
...
|
441
|
-
|
442
|
-
@typing.overload
|
443
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
444
|
-
...
|
445
|
-
|
446
|
-
@typing.overload
|
447
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
448
|
-
...
|
449
|
-
|
450
|
-
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]]] = []):
|
451
|
-
"""
|
452
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
453
|
-
the execution of a step.
|
454
|
-
"""
|
455
|
-
...
|
456
|
-
|
457
443
|
@typing.overload
|
458
444
|
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]]]:
|
459
445
|
"""
|
@@ -507,69 +493,41 @@ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
|
|
507
493
|
...
|
508
494
|
|
509
495
|
@typing.overload
|
510
|
-
def
|
496
|
+
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]]]:
|
511
497
|
"""
|
512
|
-
|
498
|
+
Specifies a timeout for your step.
|
513
499
|
|
514
|
-
|
515
|
-
"""
|
516
|
-
...
|
517
|
-
|
518
|
-
@typing.overload
|
519
|
-
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
520
|
-
...
|
521
|
-
|
522
|
-
@typing.overload
|
523
|
-
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
524
|
-
...
|
525
|
-
|
526
|
-
def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
|
527
|
-
"""
|
528
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
500
|
+
This decorator is useful if this step may hang indefinitely.
|
529
501
|
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
535
|
-
"""
|
536
|
-
Specifies what flows belong to the same project.
|
502
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
503
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
504
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
537
505
|
|
538
|
-
|
539
|
-
|
540
|
-
"""
|
541
|
-
...
|
542
|
-
|
543
|
-
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]]:
|
544
|
-
"""
|
545
|
-
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)
|
546
|
-
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
547
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
548
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
549
|
-
starts only after all sensors finish.
|
506
|
+
Note that all the values specified in parameters are added together so if you specify
|
507
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
550
508
|
"""
|
551
509
|
...
|
552
510
|
|
553
511
|
@typing.overload
|
554
|
-
def
|
555
|
-
"""
|
556
|
-
Specifies the Conda environment for all steps of the flow.
|
557
|
-
|
558
|
-
Use `@conda_base` to set common libraries required by all
|
559
|
-
steps and use `@conda` to specify step-specific additions.
|
560
|
-
"""
|
512
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
561
513
|
...
|
562
514
|
|
563
515
|
@typing.overload
|
564
|
-
def
|
516
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
565
517
|
...
|
566
518
|
|
567
|
-
def
|
519
|
+
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):
|
568
520
|
"""
|
569
|
-
Specifies
|
521
|
+
Specifies a timeout for your step.
|
570
522
|
|
571
|
-
|
572
|
-
|
523
|
+
This decorator is useful if this step may hang indefinitely.
|
524
|
+
|
525
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
526
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
527
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
528
|
+
|
529
|
+
Note that all the values specified in parameters are added together so if you specify
|
530
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
573
531
|
"""
|
574
532
|
...
|
575
533
|
|
@@ -673,27 +631,10 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
|
|
673
631
|
"""
|
674
632
|
...
|
675
633
|
|
676
|
-
def
|
634
|
+
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]]:
|
677
635
|
"""
|
678
|
-
|
679
|
-
|
680
|
-
User code call
|
681
|
-
-----------
|
682
|
-
@nim(
|
683
|
-
models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
|
684
|
-
backend='managed'
|
685
|
-
)
|
686
|
-
|
687
|
-
Valid backend options
|
688
|
-
---------------------
|
689
|
-
- 'managed': Outerbounds selects a compute provider based on the model.
|
690
|
-
- 🚧 'dataplane': Run in your account.
|
691
|
-
|
692
|
-
Valid model options
|
693
|
-
----------------
|
694
|
-
- 'meta/llama3-8b-instruct': 8B parameter model
|
695
|
-
- 'meta/llama3-70b-instruct': 70B parameter model
|
696
|
-
- Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
|
636
|
+
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.
|
637
|
+
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.
|
697
638
|
"""
|
698
639
|
...
|
699
640
|
|
@@ -720,6 +661,29 @@ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packag
|
|
720
661
|
"""
|
721
662
|
...
|
722
663
|
|
664
|
+
@typing.overload
|
665
|
+
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]]:
|
666
|
+
"""
|
667
|
+
Specifies the Conda environment for all steps of the flow.
|
668
|
+
|
669
|
+
Use `@conda_base` to set common libraries required by all
|
670
|
+
steps and use `@conda` to specify step-specific additions.
|
671
|
+
"""
|
672
|
+
...
|
673
|
+
|
674
|
+
@typing.overload
|
675
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
676
|
+
...
|
677
|
+
|
678
|
+
def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
679
|
+
"""
|
680
|
+
Specifies the Conda environment for all steps of the flow.
|
681
|
+
|
682
|
+
Use `@conda_base` to set common libraries required by all
|
683
|
+
steps and use `@conda` to specify step-specific additions.
|
684
|
+
"""
|
685
|
+
...
|
686
|
+
|
723
687
|
@typing.overload
|
724
688
|
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]]:
|
725
689
|
"""
|
@@ -793,10 +757,46 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
793
757
|
"""
|
794
758
|
...
|
795
759
|
|
796
|
-
def
|
760
|
+
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
797
761
|
"""
|
798
|
-
|
799
|
-
|
762
|
+
Specifies what flows belong to the same project.
|
763
|
+
|
764
|
+
A project-specific namespace is created for all flows that
|
765
|
+
use the same `@project(name)`.
|
766
|
+
"""
|
767
|
+
...
|
768
|
+
|
769
|
+
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]]:
|
770
|
+
"""
|
771
|
+
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)
|
772
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
773
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
774
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
775
|
+
starts only after all sensors finish.
|
776
|
+
"""
|
777
|
+
...
|
778
|
+
|
779
|
+
def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
780
|
+
"""
|
781
|
+
This decorator is used to run NIM containers in Metaflow tasks as sidecars.
|
782
|
+
|
783
|
+
User code call
|
784
|
+
-----------
|
785
|
+
@nim(
|
786
|
+
models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
|
787
|
+
backend='managed'
|
788
|
+
)
|
789
|
+
|
790
|
+
Valid backend options
|
791
|
+
---------------------
|
792
|
+
- 'managed': Outerbounds selects a compute provider based on the model.
|
793
|
+
- 🚧 'dataplane': Run in your account.
|
794
|
+
|
795
|
+
Valid model options
|
796
|
+
----------------
|
797
|
+
- 'meta/llama3-8b-instruct': 8B parameter model
|
798
|
+
- 'meta/llama3-70b-instruct': 70B parameter model
|
799
|
+
- Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
|
800
800
|
"""
|
801
801
|
...
|
802
802
|
|