ob-metaflow-stubs 6.0.3.146__py2.py3-none-any.whl → 6.0.3.147__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- metaflow-stubs/__init__.pyi +482 -482
- metaflow-stubs/cards.pyi +2 -2
- metaflow-stubs/cli.pyi +2 -2
- metaflow-stubs/cli_components/__init__.pyi +2 -2
- metaflow-stubs/cli_components/utils.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +2 -2
- metaflow-stubs/client/core.pyi +4 -4
- 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 +3 -3
- metaflow-stubs/info_file.pyi +2 -2
- metaflow-stubs/metadata_provider/__init__.pyi +2 -2
- metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
- metaflow-stubs/metadata_provider/metadata.pyi +2 -2
- metaflow-stubs/metadata_provider/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -2
- metaflow-stubs/metaflow_current.pyi +116 -116
- 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 +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/deco_injection_mixin.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/extra_components.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/checkpoint_lister.pyi +2 -2
- 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 +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/constructors.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/core.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/decorator.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/exceptions.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/final_api.pyi +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 +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/exceptions.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/decorator.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/core.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/exceptions.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/model_storage.pyi +3 -3
- 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 +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/base.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/tar.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/injector.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/ollama.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/snowflake.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/profilers/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/profilers/gpu.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/remote_config.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/toplevel/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/parameters.pyi +3 -3
- metaflow-stubs/plugins/__init__.pyi +12 -12
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
- metaflow-stubs/plugins/airflow/exception.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
- metaflow-stubs/plugins/argo/__init__.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -3
- 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 +3 -3
- 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 +6 -6
- metaflow-stubs/plugins/cards/card_client.pyi +2 -2
- metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
- metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +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 +3 -3
- 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 +2 -2
- 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/kubernetes/spot_monitor_sidecar.pyi +2 -2
- metaflow-stubs/plugins/ollama/__init__.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 +3 -3
- 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 +4 -4
- 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 +6 -6
- metaflow-stubs/runner/deployer_impl.pyi +3 -3
- metaflow-stubs/runner/metaflow_runner.pyi +3 -3
- metaflow-stubs/runner/nbdeploy.pyi +2 -2
- metaflow-stubs/runner/nbrun.pyi +2 -2
- metaflow-stubs/runner/subprocess_manager.pyi +2 -2
- metaflow-stubs/runner/utils.pyi +3 -3
- metaflow-stubs/system/__init__.pyi +2 -2
- metaflow-stubs/system/system_logger.pyi +3 -3
- metaflow-stubs/system/system_monitor.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- metaflow-stubs/user_configs/__init__.pyi +2 -2
- metaflow-stubs/user_configs/config_decorators.pyi +6 -6
- metaflow-stubs/user_configs/config_options.pyi +3 -3
- metaflow-stubs/user_configs/config_parameters.pyi +5 -5
- {ob_metaflow_stubs-6.0.3.146.dist-info → ob_metaflow_stubs-6.0.3.147.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-6.0.3.147.dist-info/RECORD +197 -0
- ob_metaflow_stubs-6.0.3.146.dist-info/RECORD +0 -197
- {ob_metaflow_stubs-6.0.3.146.dist-info → ob_metaflow_stubs-6.0.3.147.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-6.0.3.146.dist-info → ob_metaflow_stubs-6.0.3.147.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.15.0.1+obcheckpoint(0.1.
|
4
|
-
# Generated on 2025-
|
3
|
+
# MF version: 2.15.0.1+obcheckpoint(0.1.9);ob(v1) #
|
4
|
+
# Generated on 2025-03-03T17:55:45.268987 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -147,70 +147,120 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
147
147
|
...
|
148
148
|
|
149
149
|
@typing.overload
|
150
|
-
def
|
150
|
+
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]]]:
|
151
151
|
"""
|
152
|
+
Specifies a timeout for your step.
|
153
|
+
|
154
|
+
This decorator is useful if this step may hang indefinitely.
|
155
|
+
|
156
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
157
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
158
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
159
|
+
|
160
|
+
Note that all the values specified in parameters are added together so if you specify
|
161
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
162
|
+
|
163
|
+
|
152
164
|
Parameters
|
153
165
|
----------
|
166
|
+
seconds : int, default 0
|
167
|
+
Number of seconds to wait prior to timing out.
|
168
|
+
minutes : int, default 0
|
169
|
+
Number of minutes to wait prior to timing out.
|
170
|
+
hours : int, default 0
|
171
|
+
Number of hours to wait prior to timing out.
|
154
172
|
"""
|
155
173
|
...
|
156
174
|
|
157
175
|
@typing.overload
|
158
|
-
def
|
176
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
159
177
|
...
|
160
178
|
|
161
|
-
|
179
|
+
@typing.overload
|
180
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
181
|
+
...
|
182
|
+
|
183
|
+
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):
|
162
184
|
"""
|
185
|
+
Specifies a timeout for your step.
|
186
|
+
|
187
|
+
This decorator is useful if this step may hang indefinitely.
|
188
|
+
|
189
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
190
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
191
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
192
|
+
|
193
|
+
Note that all the values specified in parameters are added together so if you specify
|
194
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
195
|
+
|
196
|
+
|
163
197
|
Parameters
|
164
198
|
----------
|
199
|
+
seconds : int, default 0
|
200
|
+
Number of seconds to wait prior to timing out.
|
201
|
+
minutes : int, default 0
|
202
|
+
Number of minutes to wait prior to timing out.
|
203
|
+
hours : int, default 0
|
204
|
+
Number of hours to wait prior to timing out.
|
165
205
|
"""
|
166
206
|
...
|
167
207
|
|
168
208
|
@typing.overload
|
169
|
-
def
|
209
|
+
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]]]:
|
170
210
|
"""
|
171
|
-
|
211
|
+
Specifies the Conda environment for the step.
|
172
212
|
|
173
|
-
|
213
|
+
Information in this decorator will augment any
|
214
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
215
|
+
you can use `@conda_base` to set packages required by all
|
216
|
+
steps and use `@conda` to specify step-specific overrides.
|
174
217
|
|
175
218
|
|
176
219
|
Parameters
|
177
220
|
----------
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
221
|
+
packages : Dict[str, str], default {}
|
222
|
+
Packages to use for this step. The key is the name of the package
|
223
|
+
and the value is the version to use.
|
224
|
+
libraries : Dict[str, str], default {}
|
225
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
226
|
+
python : str, optional, default None
|
227
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
228
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
229
|
+
disabled : bool, default False
|
230
|
+
If set to True, disables @conda.
|
186
231
|
"""
|
187
232
|
...
|
188
233
|
|
189
234
|
@typing.overload
|
190
|
-
def
|
235
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
191
236
|
...
|
192
237
|
|
193
238
|
@typing.overload
|
194
|
-
def
|
239
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
195
240
|
...
|
196
241
|
|
197
|
-
def
|
242
|
+
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):
|
198
243
|
"""
|
199
|
-
|
244
|
+
Specifies the Conda environment for the step.
|
200
245
|
|
201
|
-
|
246
|
+
Information in this decorator will augment any
|
247
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
248
|
+
you can use `@conda_base` to set packages required by all
|
249
|
+
steps and use `@conda` to specify step-specific overrides.
|
202
250
|
|
203
251
|
|
204
252
|
Parameters
|
205
253
|
----------
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
254
|
+
packages : Dict[str, str], default {}
|
255
|
+
Packages to use for this step. The key is the name of the package
|
256
|
+
and the value is the version to use.
|
257
|
+
libraries : Dict[str, str], default {}
|
258
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
259
|
+
python : str, optional, default None
|
260
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
261
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
262
|
+
disabled : bool, default False
|
263
|
+
If set to True, disables @conda.
|
214
264
|
"""
|
215
265
|
...
|
216
266
|
|
@@ -293,134 +343,6 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
293
343
|
"""
|
294
344
|
...
|
295
345
|
|
296
|
-
@typing.overload
|
297
|
-
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]]]:
|
298
|
-
"""
|
299
|
-
Specifies the PyPI packages for the step.
|
300
|
-
|
301
|
-
Information in this decorator will augment any
|
302
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
303
|
-
you can use `@pypi_base` to set packages required by all
|
304
|
-
steps and use `@pypi` to specify step-specific overrides.
|
305
|
-
|
306
|
-
|
307
|
-
Parameters
|
308
|
-
----------
|
309
|
-
packages : Dict[str, str], default: {}
|
310
|
-
Packages to use for this step. The key is the name of the package
|
311
|
-
and the value is the version to use.
|
312
|
-
python : str, optional, default: None
|
313
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
314
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
315
|
-
"""
|
316
|
-
...
|
317
|
-
|
318
|
-
@typing.overload
|
319
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
320
|
-
...
|
321
|
-
|
322
|
-
@typing.overload
|
323
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
324
|
-
...
|
325
|
-
|
326
|
-
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):
|
327
|
-
"""
|
328
|
-
Specifies the PyPI packages for the step.
|
329
|
-
|
330
|
-
Information in this decorator will augment any
|
331
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
332
|
-
you can use `@pypi_base` to set packages required by all
|
333
|
-
steps and use `@pypi` to specify step-specific overrides.
|
334
|
-
|
335
|
-
|
336
|
-
Parameters
|
337
|
-
----------
|
338
|
-
packages : Dict[str, str], default: {}
|
339
|
-
Packages to use for this step. The key is the name of the package
|
340
|
-
and the value is the version to use.
|
341
|
-
python : str, optional, default: None
|
342
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
343
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
344
|
-
"""
|
345
|
-
...
|
346
|
-
|
347
|
-
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]]]:
|
348
|
-
"""
|
349
|
-
Specifies that this step should execute on Kubernetes.
|
350
|
-
|
351
|
-
|
352
|
-
Parameters
|
353
|
-
----------
|
354
|
-
cpu : int, default 1
|
355
|
-
Number of CPUs required for this step. If `@resources` is
|
356
|
-
also present, the maximum value from all decorators is used.
|
357
|
-
memory : int, default 4096
|
358
|
-
Memory size (in MB) required for this step. If
|
359
|
-
`@resources` is also present, the maximum value from all decorators is
|
360
|
-
used.
|
361
|
-
disk : int, default 10240
|
362
|
-
Disk size (in MB) required for this step. If
|
363
|
-
`@resources` is also present, the maximum value from all decorators is
|
364
|
-
used.
|
365
|
-
image : str, optional, default None
|
366
|
-
Docker image to use when launching on Kubernetes. If not specified, and
|
367
|
-
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
368
|
-
not, a default Docker image mapping to the current version of Python is used.
|
369
|
-
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
370
|
-
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
371
|
-
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
372
|
-
Kubernetes service account to use when launching pod in Kubernetes.
|
373
|
-
secrets : List[str], optional, default None
|
374
|
-
Kubernetes secrets to use when launching pod in Kubernetes. These
|
375
|
-
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
376
|
-
in Metaflow configuration.
|
377
|
-
node_selector: Union[Dict[str,str], str], optional, default None
|
378
|
-
Kubernetes node selector(s) to apply to the pod running the task.
|
379
|
-
Can be passed in as a comma separated string of values e.g.
|
380
|
-
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
381
|
-
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
382
|
-
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
383
|
-
Kubernetes namespace to use when launching pod in Kubernetes.
|
384
|
-
gpu : int, optional, default None
|
385
|
-
Number of GPUs required for this step. A value of zero implies that
|
386
|
-
the scheduled node should not have GPUs.
|
387
|
-
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
388
|
-
The vendor of the GPUs to be used for this step.
|
389
|
-
tolerations : List[str], default []
|
390
|
-
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
391
|
-
Kubernetes tolerations to use when launching pod in Kubernetes.
|
392
|
-
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
393
|
-
Kubernetes labels to use when launching pod in Kubernetes.
|
394
|
-
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
395
|
-
Kubernetes annotations to use when launching pod in Kubernetes.
|
396
|
-
use_tmpfs : bool, default False
|
397
|
-
This enables an explicit tmpfs mount for this step.
|
398
|
-
tmpfs_tempdir : bool, default True
|
399
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
400
|
-
tmpfs_size : int, optional, default: None
|
401
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
402
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
403
|
-
memory allocated for this step.
|
404
|
-
tmpfs_path : str, optional, default /metaflow_temp
|
405
|
-
Path to tmpfs mount for this step.
|
406
|
-
persistent_volume_claims : Dict[str, str], optional, default None
|
407
|
-
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
408
|
-
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
409
|
-
shared_memory: int, optional
|
410
|
-
Shared memory size (in MiB) required for this step
|
411
|
-
port: int, optional
|
412
|
-
Port number to specify in the Kubernetes job object
|
413
|
-
compute_pool : str, optional, default None
|
414
|
-
Compute pool to be used for for this step.
|
415
|
-
If not specified, any accessible compute pool within the perimeter is used.
|
416
|
-
hostname_resolution_timeout: int, default 10 * 60
|
417
|
-
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
418
|
-
Only applicable when @parallel is used.
|
419
|
-
qos: str, default: Burstable
|
420
|
-
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
421
|
-
"""
|
422
|
-
...
|
423
|
-
|
424
346
|
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]]]:
|
425
347
|
"""
|
426
348
|
Decorator that helps cache, version and store models/datasets from huggingface hub.
|
@@ -502,157 +424,207 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
502
424
|
...
|
503
425
|
|
504
426
|
@typing.overload
|
505
|
-
def
|
427
|
+
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]]]:
|
506
428
|
"""
|
507
|
-
|
429
|
+
Specifies the PyPI packages for the step.
|
430
|
+
|
431
|
+
Information in this decorator will augment any
|
432
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
433
|
+
you can use `@pypi_base` to set packages required by all
|
434
|
+
steps and use `@pypi` to specify step-specific overrides.
|
435
|
+
|
436
|
+
|
508
437
|
Parameters
|
509
438
|
----------
|
439
|
+
packages : Dict[str, str], default: {}
|
440
|
+
Packages to use for this step. The key is the name of the package
|
441
|
+
and the value is the version to use.
|
442
|
+
python : str, optional, default: None
|
443
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
444
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
510
445
|
"""
|
511
446
|
...
|
512
447
|
|
513
448
|
@typing.overload
|
514
|
-
def
|
449
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
515
450
|
...
|
516
451
|
|
517
|
-
|
518
|
-
|
519
|
-
Internal decorator to support Fast bakery
|
520
|
-
Parameters
|
521
|
-
----------
|
522
|
-
"""
|
452
|
+
@typing.overload
|
453
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
523
454
|
...
|
524
455
|
|
525
|
-
|
526
|
-
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]]]:
|
456
|
+
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):
|
527
457
|
"""
|
528
|
-
Specifies
|
458
|
+
Specifies the PyPI packages for the step.
|
529
459
|
|
530
|
-
|
460
|
+
Information in this decorator will augment any
|
461
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
462
|
+
you can use `@pypi_base` to set packages required by all
|
463
|
+
steps and use `@pypi` to specify step-specific overrides.
|
531
464
|
|
532
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
533
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
534
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
535
465
|
|
536
|
-
|
537
|
-
|
466
|
+
Parameters
|
467
|
+
----------
|
468
|
+
packages : Dict[str, str], default: {}
|
469
|
+
Packages to use for this step. The key is the name of the package
|
470
|
+
and the value is the version to use.
|
471
|
+
python : str, optional, default: None
|
472
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
473
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
474
|
+
"""
|
475
|
+
...
|
476
|
+
|
477
|
+
@typing.overload
|
478
|
+
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]]]:
|
479
|
+
"""
|
480
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
481
|
+
|
482
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
538
483
|
|
539
484
|
|
540
485
|
Parameters
|
541
486
|
----------
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
487
|
+
type : str, default 'default'
|
488
|
+
Card type.
|
489
|
+
id : str, optional, default None
|
490
|
+
If multiple cards are present, use this id to identify this card.
|
491
|
+
options : Dict[str, Any], default {}
|
492
|
+
Options passed to the card. The contents depend on the card type.
|
493
|
+
timeout : int, default 45
|
494
|
+
Interrupt reporting if it takes more than this many seconds.
|
548
495
|
"""
|
549
496
|
...
|
550
497
|
|
551
498
|
@typing.overload
|
552
|
-
def
|
499
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
553
500
|
...
|
554
501
|
|
555
502
|
@typing.overload
|
556
|
-
def
|
503
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
557
504
|
...
|
558
505
|
|
559
|
-
def
|
506
|
+
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):
|
560
507
|
"""
|
561
|
-
|
562
|
-
|
563
|
-
This decorator is useful if this step may hang indefinitely.
|
564
|
-
|
565
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
566
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
567
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
508
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
568
509
|
|
569
|
-
Note that
|
570
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
510
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
571
511
|
|
572
512
|
|
573
513
|
Parameters
|
574
514
|
----------
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
515
|
+
type : str, default 'default'
|
516
|
+
Card type.
|
517
|
+
id : str, optional, default None
|
518
|
+
If multiple cards are present, use this id to identify this card.
|
519
|
+
options : Dict[str, Any], default {}
|
520
|
+
Options passed to the card. The contents depend on the card type.
|
521
|
+
timeout : int, default 45
|
522
|
+
Interrupt reporting if it takes more than this many seconds.
|
581
523
|
"""
|
582
524
|
...
|
583
525
|
|
584
526
|
@typing.overload
|
585
|
-
def
|
527
|
+
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]]]:
|
586
528
|
"""
|
587
|
-
Specifies the
|
529
|
+
Specifies that the step will success under all circumstances.
|
588
530
|
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
531
|
+
The decorator will create an optional artifact, specified by `var`, which
|
532
|
+
contains the exception raised. You can use it to detect the presence
|
533
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
534
|
+
are missing.
|
593
535
|
|
594
536
|
|
595
537
|
Parameters
|
596
538
|
----------
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
604
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
605
|
-
disabled : bool, default False
|
606
|
-
If set to True, disables @conda.
|
539
|
+
var : str, optional, default None
|
540
|
+
Name of the artifact in which to store the caught exception.
|
541
|
+
If not specified, the exception is not stored.
|
542
|
+
print_exception : bool, default True
|
543
|
+
Determines whether or not the exception is printed to
|
544
|
+
stdout when caught.
|
607
545
|
"""
|
608
546
|
...
|
609
547
|
|
610
548
|
@typing.overload
|
611
|
-
def
|
549
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
612
550
|
...
|
613
551
|
|
614
552
|
@typing.overload
|
615
|
-
def
|
553
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
616
554
|
...
|
617
555
|
|
618
|
-
def
|
556
|
+
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):
|
619
557
|
"""
|
620
|
-
Specifies the
|
558
|
+
Specifies that the step will success under all circumstances.
|
621
559
|
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
560
|
+
The decorator will create an optional artifact, specified by `var`, which
|
561
|
+
contains the exception raised. You can use it to detect the presence
|
562
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
563
|
+
are missing.
|
626
564
|
|
627
565
|
|
628
566
|
Parameters
|
629
567
|
----------
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
637
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
638
|
-
disabled : bool, default False
|
639
|
-
If set to True, disables @conda.
|
568
|
+
var : str, optional, default None
|
569
|
+
Name of the artifact in which to store the caught exception.
|
570
|
+
If not specified, the exception is not stored.
|
571
|
+
print_exception : bool, default True
|
572
|
+
Determines whether or not the exception is printed to
|
573
|
+
stdout when caught.
|
640
574
|
"""
|
641
575
|
...
|
642
576
|
|
643
|
-
|
577
|
+
@typing.overload
|
578
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
644
579
|
"""
|
645
|
-
|
580
|
+
Internal decorator to support Fast bakery
|
581
|
+
Parameters
|
582
|
+
----------
|
583
|
+
"""
|
584
|
+
...
|
585
|
+
|
586
|
+
@typing.overload
|
587
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
588
|
+
...
|
589
|
+
|
590
|
+
def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
591
|
+
"""
|
592
|
+
Internal decorator to support Fast bakery
|
593
|
+
Parameters
|
594
|
+
----------
|
595
|
+
"""
|
596
|
+
...
|
597
|
+
|
598
|
+
def ollama(*, models: "list[Ollama]", backend: 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]]]:
|
599
|
+
"""
|
600
|
+
This decorator is used to run Ollama APIs as Metaflow task sidecars.
|
601
|
+
|
602
|
+
User code call
|
603
|
+
-----------
|
604
|
+
@ollama(
|
605
|
+
models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
|
606
|
+
backend='local'
|
607
|
+
)
|
608
|
+
|
609
|
+
Valid backend options
|
610
|
+
---------------------
|
611
|
+
- 'local': Run as a separate process on the local task machine.
|
612
|
+
- (TODO) 'managed': Outerbounds hosts and selects compute provider.
|
613
|
+
- (TODO) 'remote': Spin up separate instance to serve Ollama models.
|
614
|
+
|
615
|
+
Valid model options
|
616
|
+
----------------
|
617
|
+
- 'llama3.2'
|
618
|
+
- 'llama3.3'
|
619
|
+
- any model here https://ollama.com/search
|
646
620
|
|
647
621
|
|
648
622
|
Parameters
|
649
623
|
----------
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
queue_timeout : int
|
655
|
-
Time to keep the job in NVCF's queue.
|
624
|
+
models: list[Ollama]
|
625
|
+
List of Ollama containers running models in sidecars.
|
626
|
+
backend: str
|
627
|
+
Determines where and how to run the Ollama process.
|
656
628
|
"""
|
657
629
|
...
|
658
630
|
|
@@ -689,6 +661,63 @@ def nim(*, models: "list[NIM]", backend: str, queue_timeout: int) -> typing.Call
|
|
689
661
|
"""
|
690
662
|
...
|
691
663
|
|
664
|
+
@typing.overload
|
665
|
+
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]]]:
|
666
|
+
"""
|
667
|
+
Enables loading / saving of models within a step.
|
668
|
+
|
669
|
+
|
670
|
+
|
671
|
+
Parameters
|
672
|
+
----------
|
673
|
+
load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
|
674
|
+
Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
|
675
|
+
These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
|
676
|
+
- `current.checkpoint`
|
677
|
+
- `current.model`
|
678
|
+
- `current.huggingface_hub`
|
679
|
+
|
680
|
+
If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
|
681
|
+
the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
|
682
|
+
If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
|
683
|
+
|
684
|
+
temp_dir_root : str, default: None
|
685
|
+
The root directory under which `current.model.loaded` will store loaded models
|
686
|
+
"""
|
687
|
+
...
|
688
|
+
|
689
|
+
@typing.overload
|
690
|
+
def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
691
|
+
...
|
692
|
+
|
693
|
+
@typing.overload
|
694
|
+
def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
695
|
+
...
|
696
|
+
|
697
|
+
def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: str = None):
|
698
|
+
"""
|
699
|
+
Enables loading / saving of models within a step.
|
700
|
+
|
701
|
+
|
702
|
+
|
703
|
+
Parameters
|
704
|
+
----------
|
705
|
+
load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
|
706
|
+
Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
|
707
|
+
These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
|
708
|
+
- `current.checkpoint`
|
709
|
+
- `current.model`
|
710
|
+
- `current.huggingface_hub`
|
711
|
+
|
712
|
+
If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
|
713
|
+
the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
|
714
|
+
If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
|
715
|
+
|
716
|
+
temp_dir_root : str, default: None
|
717
|
+
The root directory under which `current.model.loaded` will store loaded models
|
718
|
+
"""
|
719
|
+
...
|
720
|
+
|
692
721
|
@typing.overload
|
693
722
|
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]]]:
|
694
723
|
"""
|
@@ -779,62 +808,101 @@ def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None
|
|
779
808
|
"""
|
780
809
|
...
|
781
810
|
|
782
|
-
def
|
811
|
+
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]]]:
|
783
812
|
"""
|
784
|
-
|
785
|
-
|
786
|
-
User code call
|
787
|
-
-----------
|
788
|
-
@ollama(
|
789
|
-
models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
|
790
|
-
backend='local'
|
791
|
-
)
|
792
|
-
|
793
|
-
Valid backend options
|
794
|
-
---------------------
|
795
|
-
- 'local': Run as a separate process on the local task machine.
|
796
|
-
- (TODO) 'managed': Outerbounds hosts and selects compute provider.
|
797
|
-
- (TODO) 'remote': Spin up separate instance to serve Ollama models.
|
798
|
-
|
799
|
-
Valid model options
|
800
|
-
----------------
|
801
|
-
- 'llama3.2'
|
802
|
-
- 'llama3.3'
|
803
|
-
- any model here https://ollama.com/search
|
813
|
+
Specifies that this step should execute on Kubernetes.
|
804
814
|
|
805
815
|
|
806
816
|
Parameters
|
807
817
|
----------
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
818
|
+
cpu : int, default 1
|
819
|
+
Number of CPUs required for this step. If `@resources` is
|
820
|
+
also present, the maximum value from all decorators is used.
|
821
|
+
memory : int, default 4096
|
822
|
+
Memory size (in MB) required for this step. If
|
823
|
+
`@resources` is also present, the maximum value from all decorators is
|
824
|
+
used.
|
825
|
+
disk : int, default 10240
|
826
|
+
Disk size (in MB) required for this step. If
|
827
|
+
`@resources` is also present, the maximum value from all decorators is
|
828
|
+
used.
|
829
|
+
image : str, optional, default None
|
830
|
+
Docker image to use when launching on Kubernetes. If not specified, and
|
831
|
+
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
832
|
+
not, a default Docker image mapping to the current version of Python is used.
|
833
|
+
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
834
|
+
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
835
|
+
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
836
|
+
Kubernetes service account to use when launching pod in Kubernetes.
|
837
|
+
secrets : List[str], optional, default None
|
838
|
+
Kubernetes secrets to use when launching pod in Kubernetes. These
|
839
|
+
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
840
|
+
in Metaflow configuration.
|
841
|
+
node_selector: Union[Dict[str,str], str], optional, default None
|
842
|
+
Kubernetes node selector(s) to apply to the pod running the task.
|
843
|
+
Can be passed in as a comma separated string of values e.g.
|
844
|
+
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
845
|
+
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
846
|
+
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
847
|
+
Kubernetes namespace to use when launching pod in Kubernetes.
|
848
|
+
gpu : int, optional, default None
|
849
|
+
Number of GPUs required for this step. A value of zero implies that
|
850
|
+
the scheduled node should not have GPUs.
|
851
|
+
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
852
|
+
The vendor of the GPUs to be used for this step.
|
853
|
+
tolerations : List[str], default []
|
854
|
+
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
855
|
+
Kubernetes tolerations to use when launching pod in Kubernetes.
|
856
|
+
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
857
|
+
Kubernetes labels to use when launching pod in Kubernetes.
|
858
|
+
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
859
|
+
Kubernetes annotations to use when launching pod in Kubernetes.
|
860
|
+
use_tmpfs : bool, default False
|
861
|
+
This enables an explicit tmpfs mount for this step.
|
862
|
+
tmpfs_tempdir : bool, default True
|
863
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
864
|
+
tmpfs_size : int, optional, default: None
|
865
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
866
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
867
|
+
memory allocated for this step.
|
868
|
+
tmpfs_path : str, optional, default /metaflow_temp
|
869
|
+
Path to tmpfs mount for this step.
|
870
|
+
persistent_volume_claims : Dict[str, str], optional, default None
|
871
|
+
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
872
|
+
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
873
|
+
shared_memory: int, optional
|
874
|
+
Shared memory size (in MiB) required for this step
|
875
|
+
port: int, optional
|
876
|
+
Port number to specify in the Kubernetes job object
|
877
|
+
compute_pool : str, optional, default None
|
878
|
+
Compute pool to be used for for this step.
|
879
|
+
If not specified, any accessible compute pool within the perimeter is used.
|
880
|
+
hostname_resolution_timeout: int, default 10 * 60
|
881
|
+
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
882
|
+
Only applicable when @parallel is used.
|
883
|
+
qos: str, default: Burstable
|
884
|
+
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
812
885
|
"""
|
813
886
|
...
|
814
887
|
|
815
|
-
|
816
|
-
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]]]:
|
888
|
+
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]]]:
|
817
889
|
"""
|
818
|
-
Specifies
|
819
|
-
the execution of a step.
|
890
|
+
Specifies that this step should execute on DGX cloud.
|
820
891
|
|
821
892
|
|
822
893
|
Parameters
|
823
894
|
----------
|
824
|
-
|
825
|
-
|
895
|
+
gpu : int
|
896
|
+
Number of GPUs to use.
|
897
|
+
gpu_type : str
|
898
|
+
Type of Nvidia GPU to use.
|
899
|
+
queue_timeout : int
|
900
|
+
Time to keep the job in NVCF's queue.
|
826
901
|
"""
|
827
902
|
...
|
828
903
|
|
829
904
|
@typing.overload
|
830
|
-
def secrets(
|
831
|
-
...
|
832
|
-
|
833
|
-
@typing.overload
|
834
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
835
|
-
...
|
836
|
-
|
837
|
-
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]]] = []):
|
905
|
+
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]]]:
|
838
906
|
"""
|
839
907
|
Specifies secrets to be retrieved and injected as environment variables prior to
|
840
908
|
the execution of a step.
|
@@ -848,145 +916,42 @@ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
848
916
|
...
|
849
917
|
|
850
918
|
@typing.overload
|
851
|
-
def
|
852
|
-
"""
|
853
|
-
Enables loading / saving of models within a step.
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
Parameters
|
858
|
-
----------
|
859
|
-
load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
|
860
|
-
Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
|
861
|
-
These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
|
862
|
-
- `current.checkpoint`
|
863
|
-
- `current.model`
|
864
|
-
- `current.huggingface_hub`
|
865
|
-
|
866
|
-
If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
|
867
|
-
the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
|
868
|
-
If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
|
869
|
-
|
870
|
-
temp_dir_root : str, default: None
|
871
|
-
The root directory under which `current.model.loaded` will store loaded models
|
872
|
-
"""
|
873
|
-
...
|
874
|
-
|
875
|
-
@typing.overload
|
876
|
-
def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
877
|
-
...
|
878
|
-
|
879
|
-
@typing.overload
|
880
|
-
def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
881
|
-
...
|
882
|
-
|
883
|
-
def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: str = None):
|
884
|
-
"""
|
885
|
-
Enables loading / saving of models within a step.
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
Parameters
|
890
|
-
----------
|
891
|
-
load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
|
892
|
-
Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
|
893
|
-
These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
|
894
|
-
- `current.checkpoint`
|
895
|
-
- `current.model`
|
896
|
-
- `current.huggingface_hub`
|
897
|
-
|
898
|
-
If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
|
899
|
-
the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
|
900
|
-
If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
|
901
|
-
|
902
|
-
temp_dir_root : str, default: None
|
903
|
-
The root directory under which `current.model.loaded` will store loaded models
|
904
|
-
"""
|
905
|
-
...
|
906
|
-
|
907
|
-
@typing.overload
|
908
|
-
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]]]:
|
909
|
-
"""
|
910
|
-
Specifies that the step will success under all circumstances.
|
911
|
-
|
912
|
-
The decorator will create an optional artifact, specified by `var`, which
|
913
|
-
contains the exception raised. You can use it to detect the presence
|
914
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
915
|
-
are missing.
|
916
|
-
|
917
|
-
|
918
|
-
Parameters
|
919
|
-
----------
|
920
|
-
var : str, optional, default None
|
921
|
-
Name of the artifact in which to store the caught exception.
|
922
|
-
If not specified, the exception is not stored.
|
923
|
-
print_exception : bool, default True
|
924
|
-
Determines whether or not the exception is printed to
|
925
|
-
stdout when caught.
|
926
|
-
"""
|
927
|
-
...
|
928
|
-
|
929
|
-
@typing.overload
|
930
|
-
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
919
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
931
920
|
...
|
932
921
|
|
933
922
|
@typing.overload
|
934
|
-
def
|
923
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
935
924
|
...
|
936
925
|
|
937
|
-
def
|
926
|
+
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]]] = []):
|
938
927
|
"""
|
939
|
-
Specifies
|
940
|
-
|
941
|
-
The decorator will create an optional artifact, specified by `var`, which
|
942
|
-
contains the exception raised. You can use it to detect the presence
|
943
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
944
|
-
are missing.
|
928
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
929
|
+
the execution of a step.
|
945
930
|
|
946
931
|
|
947
932
|
Parameters
|
948
933
|
----------
|
949
|
-
|
950
|
-
|
951
|
-
If not specified, the exception is not stored.
|
952
|
-
print_exception : bool, default True
|
953
|
-
Determines whether or not the exception is printed to
|
954
|
-
stdout when caught.
|
934
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
935
|
+
List of secret specs, defining how the secrets are to be retrieved
|
955
936
|
"""
|
956
937
|
...
|
957
938
|
|
958
|
-
|
939
|
+
@typing.overload
|
940
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
941
|
+
"""
|
942
|
+
Parameters
|
943
|
+
----------
|
944
|
+
"""
|
945
|
+
...
|
946
|
+
|
947
|
+
@typing.overload
|
948
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
949
|
+
...
|
950
|
+
|
951
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
959
952
|
"""
|
960
|
-
Specifies what flows belong to the same project.
|
961
|
-
|
962
|
-
A project-specific namespace is created for all flows that
|
963
|
-
use the same `@project(name)`.
|
964
|
-
|
965
|
-
|
966
953
|
Parameters
|
967
954
|
----------
|
968
|
-
name : str
|
969
|
-
Project name. Make sure that the name is unique amongst all
|
970
|
-
projects that use the same production scheduler. The name may
|
971
|
-
contain only lowercase alphanumeric characters and underscores.
|
972
|
-
|
973
|
-
branch : Optional[str], default None
|
974
|
-
The branch to use. If not specified, the branch is set to
|
975
|
-
`user.<username>` unless `production` is set to `True`. This can
|
976
|
-
also be set on the command line using `--branch` as a top-level option.
|
977
|
-
It is an error to specify `branch` in the decorator and on the command line.
|
978
|
-
|
979
|
-
production : bool, default False
|
980
|
-
Whether or not the branch is the production branch. This can also be set on the
|
981
|
-
command line using `--production` as a top-level option. It is an error to specify
|
982
|
-
`production` in the decorator and on the command line.
|
983
|
-
The project branch name will be:
|
984
|
-
- if `branch` is specified:
|
985
|
-
- if `production` is True: `prod.<branch>`
|
986
|
-
- if `production` is False: `test.<branch>`
|
987
|
-
- if `branch` is not specified:
|
988
|
-
- if `production` is True: `prod`
|
989
|
-
- if `production` is False: `user.<username>`
|
990
955
|
"""
|
991
956
|
...
|
992
957
|
|
@@ -1134,49 +1099,6 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
1134
1099
|
"""
|
1135
1100
|
...
|
1136
1101
|
|
1137
|
-
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]]:
|
1138
|
-
"""
|
1139
|
-
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.
|
1140
|
-
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.
|
1141
|
-
|
1142
|
-
|
1143
|
-
Parameters
|
1144
|
-
----------
|
1145
|
-
timeout : int
|
1146
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
1147
|
-
poke_interval : int
|
1148
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
1149
|
-
mode : str
|
1150
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1151
|
-
exponential_backoff : bool
|
1152
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1153
|
-
pool : str
|
1154
|
-
the slot pool this task should run in,
|
1155
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1156
|
-
soft_fail : bool
|
1157
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1158
|
-
name : str
|
1159
|
-
Name of the sensor on Airflow
|
1160
|
-
description : str
|
1161
|
-
Description of sensor in the Airflow UI
|
1162
|
-
external_dag_id : str
|
1163
|
-
The dag_id that contains the task you want to wait for.
|
1164
|
-
external_task_ids : List[str]
|
1165
|
-
The list of task_ids that you want to wait for.
|
1166
|
-
If None (default value) the sensor waits for the DAG. (Default: None)
|
1167
|
-
allowed_states : List[str]
|
1168
|
-
Iterable of allowed states, (Default: ['success'])
|
1169
|
-
failed_states : List[str]
|
1170
|
-
Iterable of failed or dis-allowed states. (Default: None)
|
1171
|
-
execution_delta : datetime.timedelta
|
1172
|
-
time difference with the previous execution to look at,
|
1173
|
-
the default is the same logical date as the current task or DAG. (Default: None)
|
1174
|
-
check_existence: bool
|
1175
|
-
Set to True to check if the external task exists or check if
|
1176
|
-
the DAG to wait for exists. (Default: True)
|
1177
|
-
"""
|
1178
|
-
...
|
1179
|
-
|
1180
1102
|
@typing.overload
|
1181
1103
|
def trigger_on_finish(*, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1182
1104
|
"""
|
@@ -1278,54 +1200,79 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
1278
1200
|
"""
|
1279
1201
|
...
|
1280
1202
|
|
1281
|
-
|
1282
|
-
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]]:
|
1203
|
+
def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1283
1204
|
"""
|
1284
|
-
Specifies
|
1205
|
+
Specifies what flows belong to the same project.
|
1285
1206
|
|
1286
|
-
|
1287
|
-
|
1207
|
+
A project-specific namespace is created for all flows that
|
1208
|
+
use the same `@project(name)`.
|
1288
1209
|
|
1289
1210
|
|
1290
1211
|
Parameters
|
1291
1212
|
----------
|
1292
|
-
|
1213
|
+
name : str
|
1214
|
+
Project name. Make sure that the name is unique amongst all
|
1215
|
+
projects that use the same production scheduler. The name may
|
1216
|
+
contain only lowercase alphanumeric characters and underscores.
|
1217
|
+
|
1218
|
+
branch : Optional[str], default None
|
1219
|
+
The branch to use. If not specified, the branch is set to
|
1220
|
+
`user.<username>` unless `production` is set to `True`. This can
|
1221
|
+
also be set on the command line using `--branch` as a top-level option.
|
1222
|
+
It is an error to specify `branch` in the decorator and on the command line.
|
1223
|
+
|
1224
|
+
production : bool, default False
|
1225
|
+
Whether or not the branch is the production branch. This can also be set on the
|
1226
|
+
command line using `--production` as a top-level option. It is an error to specify
|
1227
|
+
`production` in the decorator and on the command line.
|
1228
|
+
The project branch name will be:
|
1229
|
+
- if `branch` is specified:
|
1230
|
+
- if `production` is True: `prod.<branch>`
|
1231
|
+
- if `production` is False: `test.<branch>`
|
1232
|
+
- if `branch` is not specified:
|
1233
|
+
- if `production` is True: `prod`
|
1234
|
+
- if `production` is False: `user.<username>`
|
1235
|
+
"""
|
1236
|
+
...
|
1237
|
+
|
1238
|
+
@typing.overload
|
1239
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1240
|
+
"""
|
1241
|
+
Specifies the PyPI packages for all steps of the flow.
|
1242
|
+
|
1243
|
+
Use `@pypi_base` to set common packages required by all
|
1244
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1245
|
+
|
1246
|
+
Parameters
|
1247
|
+
----------
|
1248
|
+
packages : Dict[str, str], default: {}
|
1293
1249
|
Packages to use for this flow. The key is the name of the package
|
1294
1250
|
and the value is the version to use.
|
1295
|
-
|
1296
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1297
|
-
python : str, optional, default None
|
1251
|
+
python : str, optional, default: None
|
1298
1252
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1299
1253
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1300
|
-
disabled : bool, default False
|
1301
|
-
If set to True, disables Conda.
|
1302
1254
|
"""
|
1303
1255
|
...
|
1304
1256
|
|
1305
1257
|
@typing.overload
|
1306
|
-
def
|
1258
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1307
1259
|
...
|
1308
1260
|
|
1309
|
-
def
|
1261
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1310
1262
|
"""
|
1311
|
-
Specifies the
|
1312
|
-
|
1313
|
-
Use `@conda_base` to set common libraries required by all
|
1314
|
-
steps and use `@conda` to specify step-specific additions.
|
1263
|
+
Specifies the PyPI packages for all steps of the flow.
|
1315
1264
|
|
1265
|
+
Use `@pypi_base` to set common packages required by all
|
1266
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1316
1267
|
|
1317
1268
|
Parameters
|
1318
1269
|
----------
|
1319
|
-
packages : Dict[str, str], default {}
|
1270
|
+
packages : Dict[str, str], default: {}
|
1320
1271
|
Packages to use for this flow. The key is the name of the package
|
1321
1272
|
and the value is the version to use.
|
1322
|
-
|
1323
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1324
|
-
python : str, optional, default None
|
1273
|
+
python : str, optional, default: None
|
1325
1274
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1326
1275
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1327
|
-
disabled : bool, default False
|
1328
|
-
If set to True, disables Conda.
|
1329
1276
|
"""
|
1330
1277
|
...
|
1331
1278
|
|
@@ -1372,44 +1319,97 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
|
|
1372
1319
|
"""
|
1373
1320
|
...
|
1374
1321
|
|
1322
|
+
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]]:
|
1323
|
+
"""
|
1324
|
+
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.
|
1325
|
+
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.
|
1326
|
+
|
1327
|
+
|
1328
|
+
Parameters
|
1329
|
+
----------
|
1330
|
+
timeout : int
|
1331
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1332
|
+
poke_interval : int
|
1333
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1334
|
+
mode : str
|
1335
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1336
|
+
exponential_backoff : bool
|
1337
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1338
|
+
pool : str
|
1339
|
+
the slot pool this task should run in,
|
1340
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1341
|
+
soft_fail : bool
|
1342
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1343
|
+
name : str
|
1344
|
+
Name of the sensor on Airflow
|
1345
|
+
description : str
|
1346
|
+
Description of sensor in the Airflow UI
|
1347
|
+
external_dag_id : str
|
1348
|
+
The dag_id that contains the task you want to wait for.
|
1349
|
+
external_task_ids : List[str]
|
1350
|
+
The list of task_ids that you want to wait for.
|
1351
|
+
If None (default value) the sensor waits for the DAG. (Default: None)
|
1352
|
+
allowed_states : List[str]
|
1353
|
+
Iterable of allowed states, (Default: ['success'])
|
1354
|
+
failed_states : List[str]
|
1355
|
+
Iterable of failed or dis-allowed states. (Default: None)
|
1356
|
+
execution_delta : datetime.timedelta
|
1357
|
+
time difference with the previous execution to look at,
|
1358
|
+
the default is the same logical date as the current task or DAG. (Default: None)
|
1359
|
+
check_existence: bool
|
1360
|
+
Set to True to check if the external task exists or check if
|
1361
|
+
the DAG to wait for exists. (Default: True)
|
1362
|
+
"""
|
1363
|
+
...
|
1364
|
+
|
1375
1365
|
@typing.overload
|
1376
|
-
def
|
1366
|
+
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]]:
|
1377
1367
|
"""
|
1378
|
-
Specifies the
|
1368
|
+
Specifies the Conda environment for all steps of the flow.
|
1369
|
+
|
1370
|
+
Use `@conda_base` to set common libraries required by all
|
1371
|
+
steps and use `@conda` to specify step-specific additions.
|
1379
1372
|
|
1380
|
-
Use `@pypi_base` to set common packages required by all
|
1381
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1382
1373
|
|
1383
1374
|
Parameters
|
1384
1375
|
----------
|
1385
|
-
packages : Dict[str, str], default
|
1376
|
+
packages : Dict[str, str], default {}
|
1386
1377
|
Packages to use for this flow. The key is the name of the package
|
1387
1378
|
and the value is the version to use.
|
1388
|
-
|
1379
|
+
libraries : Dict[str, str], default {}
|
1380
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1381
|
+
python : str, optional, default None
|
1389
1382
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1390
1383
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1384
|
+
disabled : bool, default False
|
1385
|
+
If set to True, disables Conda.
|
1391
1386
|
"""
|
1392
1387
|
...
|
1393
1388
|
|
1394
1389
|
@typing.overload
|
1395
|
-
def
|
1390
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1396
1391
|
...
|
1397
1392
|
|
1398
|
-
def
|
1393
|
+
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):
|
1399
1394
|
"""
|
1400
|
-
Specifies the
|
1395
|
+
Specifies the Conda environment for all steps of the flow.
|
1396
|
+
|
1397
|
+
Use `@conda_base` to set common libraries required by all
|
1398
|
+
steps and use `@conda` to specify step-specific additions.
|
1401
1399
|
|
1402
|
-
Use `@pypi_base` to set common packages required by all
|
1403
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1404
1400
|
|
1405
1401
|
Parameters
|
1406
1402
|
----------
|
1407
|
-
packages : Dict[str, str], default
|
1403
|
+
packages : Dict[str, str], default {}
|
1408
1404
|
Packages to use for this flow. The key is the name of the package
|
1409
1405
|
and the value is the version to use.
|
1410
|
-
|
1406
|
+
libraries : Dict[str, str], default {}
|
1407
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1408
|
+
python : str, optional, default None
|
1411
1409
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1412
1410
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1411
|
+
disabled : bool, default False
|
1412
|
+
If set to True, disables Conda.
|
1413
1413
|
"""
|
1414
1414
|
...
|
1415
1415
|
|