ob-metaflow-stubs 6.0.3.139__py2.py3-none-any.whl → 6.0.3.140__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 +809 -230
- metaflow-stubs/cards.pyi +2 -2
- metaflow-stubs/cli.pyi +2 -2
- metaflow-stubs/cli_components/__init__.pyi +2 -2
- metaflow-stubs/cli_components/utils.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +2 -2
- metaflow-stubs/client/core.pyi +5 -5
- metaflow-stubs/client/filecache.pyi +3 -3
- metaflow-stubs/events.pyi +3 -3
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +4 -4
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +2 -2
- 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 +127 -127
- metaflow-stubs/mf_extensions/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/async_cards.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/deco_injection_mixin.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/extra_components.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/checkpoint_lister.pyi +4 -4
- 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 +4 -4
- 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 +4 -4
- 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 +3 -3
- 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 +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 +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/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 +2 -2
- metaflow-stubs/plugins/__init__.pyi +12 -12
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
- metaflow-stubs/plugins/airflow/exception.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
- metaflow-stubs/plugins/argo/__init__.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +2 -2
- metaflow-stubs/plugins/aws/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +5 -5
- 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 +5 -5
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3.pyi +4 -4
- 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 +5 -5
- 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/parallel_decorator.pyi +2 -2
- metaflow-stubs/plugins/perimeters.pyi +2 -2
- metaflow-stubs/plugins/project_decorator.pyi +20 -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 +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 +3 -3
- metaflow-stubs/profilers/__init__.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +3 -3
- metaflow-stubs/runner/deployer_impl.pyi +2 -2
- metaflow-stubs/runner/metaflow_runner.pyi +3 -3
- metaflow-stubs/runner/nbdeploy.pyi +2 -2
- metaflow-stubs/runner/nbrun.pyi +2 -2
- metaflow-stubs/runner/subprocess_manager.pyi +2 -2
- metaflow-stubs/runner/utils.pyi +3 -3
- metaflow-stubs/system/__init__.pyi +2 -2
- metaflow-stubs/system/system_logger.pyi +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 +5 -7
- metaflow-stubs/user_configs/config_options.pyi +2 -2
- metaflow-stubs/user_configs/config_parameters.pyi +7 -7
- {ob_metaflow_stubs-6.0.3.139.dist-info → ob_metaflow_stubs-6.0.3.140.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-6.0.3.140.dist-info/RECORD +192 -0
- ob_metaflow_stubs-6.0.3.139.dist-info/RECORD +0 -192
- {ob_metaflow_stubs-6.0.3.139.dist-info → ob_metaflow_stubs-6.0.3.140.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-6.0.3.139.dist-info → ob_metaflow_stubs-6.0.3.140.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.
|
4
|
-
# Generated on 2025-02-
|
3
|
+
# MF version: 2.14.0.1+obcheckpoint(0.1.8);ob(v1) #
|
4
|
+
# Generated on 2025-02-11T20:37:27.195718 #
|
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
|
|
@@ -35,8 +35,8 @@ from .user_configs.config_parameters import ConfigValue as ConfigValue
|
|
35
35
|
from .user_configs.config_parameters import config_expr as config_expr
|
36
36
|
from .user_configs.config_decorators import CustomFlowDecorator as CustomFlowDecorator
|
37
37
|
from .user_configs.config_decorators import CustomStepDecorator as CustomStepDecorator
|
38
|
-
from . import cards as cards
|
39
38
|
from . import tuple_util as tuple_util
|
39
|
+
from . import cards as cards
|
40
40
|
from . import events as events
|
41
41
|
from . import runner as runner
|
42
42
|
from . import plugins as plugins
|
@@ -147,87 +147,138 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
147
147
|
...
|
148
148
|
|
149
149
|
@typing.overload
|
150
|
-
def
|
150
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
151
151
|
"""
|
152
|
-
|
153
|
-
|
152
|
+
Internal decorator to support Fast bakery
|
153
|
+
Parameters
|
154
|
+
----------
|
154
155
|
"""
|
155
156
|
...
|
156
157
|
|
157
158
|
@typing.overload
|
158
|
-
def
|
159
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
159
160
|
...
|
160
161
|
|
161
|
-
|
162
|
-
|
162
|
+
def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
163
|
+
"""
|
164
|
+
Internal decorator to support Fast bakery
|
165
|
+
Parameters
|
166
|
+
----------
|
167
|
+
"""
|
163
168
|
...
|
164
169
|
|
165
|
-
def
|
170
|
+
def huggingface_hub(*, temp_dir_root: typing.Optional[str] = None, load: typing.Union[typing.List[str], typing.List[typing.Tuple[typing.Dict, str]], typing.List[typing.Tuple[str, str]], typing.List[typing.Dict], None]) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
166
171
|
"""
|
167
|
-
|
168
|
-
|
172
|
+
Decorator that helps cache, version and store models/datasets from huggingface hub.
|
173
|
+
|
174
|
+
|
175
|
+
Parameters
|
176
|
+
----------
|
177
|
+
temp_dir_root : str, optional
|
178
|
+
The root directory that will hold the temporary directory where objects will be downloaded.
|
179
|
+
|
180
|
+
load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
|
181
|
+
The list of repos (models/datasets) to load.
|
182
|
+
|
183
|
+
Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
|
184
|
+
|
185
|
+
- If repo (model/dataset) is not found in the datastore:
|
186
|
+
- Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
|
187
|
+
- Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
|
188
|
+
- All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
|
189
|
+
|
190
|
+
- If repo is found in the datastore:
|
191
|
+
- Loads it directly from datastore to local path (can be temporary directory or specified path)
|
169
192
|
"""
|
170
193
|
...
|
171
194
|
|
172
195
|
@typing.overload
|
173
|
-
def
|
196
|
+
def environment(*, vars: typing.Dict[str, str] = {}) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
174
197
|
"""
|
175
|
-
Specifies
|
198
|
+
Specifies environment variables to be set prior to the execution of a step.
|
176
199
|
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
200
|
+
|
201
|
+
Parameters
|
202
|
+
----------
|
203
|
+
vars : Dict[str, str], default {}
|
204
|
+
Dictionary of environment variables to set.
|
181
205
|
"""
|
182
206
|
...
|
183
207
|
|
184
208
|
@typing.overload
|
185
|
-
def
|
209
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
186
210
|
...
|
187
211
|
|
188
212
|
@typing.overload
|
189
|
-
def
|
213
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
190
214
|
...
|
191
215
|
|
192
|
-
def
|
216
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
193
217
|
"""
|
194
|
-
Specifies
|
218
|
+
Specifies environment variables to be set prior to the execution of a step.
|
195
219
|
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
220
|
+
|
221
|
+
Parameters
|
222
|
+
----------
|
223
|
+
vars : Dict[str, str], default {}
|
224
|
+
Dictionary of environment variables to set.
|
200
225
|
"""
|
201
226
|
...
|
202
227
|
|
203
228
|
@typing.overload
|
204
|
-
def
|
229
|
+
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]]]:
|
205
230
|
"""
|
206
|
-
|
231
|
+
Enables checkpointing for a step.
|
207
232
|
|
208
|
-
|
233
|
+
|
234
|
+
|
235
|
+
Parameters
|
236
|
+
----------
|
237
|
+
load_policy : str, default: "fresh"
|
238
|
+
The policy for loading the checkpoint. The following policies are supported:
|
239
|
+
- "eager": Loads the the latest available checkpoint within the namespace.
|
240
|
+
With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
|
241
|
+
will be loaded at the start of the task.
|
242
|
+
- "none": Do not load any checkpoint
|
243
|
+
- "fresh": Loads the lastest checkpoint created within the running Task.
|
244
|
+
This mode helps loading checkpoints across various retry attempts of the same task.
|
245
|
+
With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
|
246
|
+
created within the task will be loaded when the task is retries execution on failure.
|
247
|
+
|
248
|
+
temp_dir_root : str, default: None
|
249
|
+
The root directory under which `current.checkpoint.directory` will be created.
|
209
250
|
"""
|
210
251
|
...
|
211
252
|
|
212
253
|
@typing.overload
|
213
|
-
def
|
254
|
+
def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
214
255
|
...
|
215
256
|
|
216
257
|
@typing.overload
|
217
|
-
def
|
258
|
+
def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
218
259
|
...
|
219
260
|
|
220
|
-
def
|
261
|
+
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):
|
221
262
|
"""
|
222
|
-
|
263
|
+
Enables checkpointing for a step.
|
223
264
|
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
265
|
+
|
266
|
+
|
267
|
+
Parameters
|
268
|
+
----------
|
269
|
+
load_policy : str, default: "fresh"
|
270
|
+
The policy for loading the checkpoint. The following policies are supported:
|
271
|
+
- "eager": Loads the the latest available checkpoint within the namespace.
|
272
|
+
With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
|
273
|
+
will be loaded at the start of the task.
|
274
|
+
- "none": Do not load any checkpoint
|
275
|
+
- "fresh": Loads the lastest checkpoint created within the running Task.
|
276
|
+
This mode helps loading checkpoints across various retry attempts of the same task.
|
277
|
+
With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
|
278
|
+
created within the task will be loaded when the task is retries execution on failure.
|
279
|
+
|
280
|
+
temp_dir_root : str, default: None
|
281
|
+
The root directory under which `current.checkpoint.directory` will be created.
|
231
282
|
"""
|
232
283
|
...
|
233
284
|
|
@@ -244,6 +295,16 @@ def timeout(*, seconds: int = 0, minutes: int = 0, hours: int = 0) -> typing.Cal
|
|
244
295
|
|
245
296
|
Note that all the values specified in parameters are added together so if you specify
|
246
297
|
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
298
|
+
|
299
|
+
|
300
|
+
Parameters
|
301
|
+
----------
|
302
|
+
seconds : int, default 0
|
303
|
+
Number of seconds to wait prior to timing out.
|
304
|
+
minutes : int, default 0
|
305
|
+
Number of minutes to wait prior to timing out.
|
306
|
+
hours : int, default 0
|
307
|
+
Number of hours to wait prior to timing out.
|
247
308
|
"""
|
248
309
|
...
|
249
310
|
|
@@ -267,84 +328,124 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
267
328
|
|
268
329
|
Note that all the values specified in parameters are added together so if you specify
|
269
330
|
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
331
|
+
|
332
|
+
|
333
|
+
Parameters
|
334
|
+
----------
|
335
|
+
seconds : int, default 0
|
336
|
+
Number of seconds to wait prior to timing out.
|
337
|
+
minutes : int, default 0
|
338
|
+
Number of minutes to wait prior to timing out.
|
339
|
+
hours : int, default 0
|
340
|
+
Number of hours to wait prior to timing out.
|
270
341
|
"""
|
271
342
|
...
|
272
343
|
|
273
344
|
@typing.overload
|
274
|
-
def
|
345
|
+
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]]]:
|
275
346
|
"""
|
276
|
-
|
347
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
277
348
|
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
349
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
350
|
+
|
351
|
+
|
352
|
+
Parameters
|
353
|
+
----------
|
354
|
+
type : str, default 'default'
|
355
|
+
Card type.
|
356
|
+
id : str, optional, default None
|
357
|
+
If multiple cards are present, use this id to identify this card.
|
358
|
+
options : Dict[str, Any], default {}
|
359
|
+
Options passed to the card. The contents depend on the card type.
|
360
|
+
timeout : int, default 45
|
361
|
+
Interrupt reporting if it takes more than this many seconds.
|
282
362
|
"""
|
283
363
|
...
|
284
364
|
|
285
365
|
@typing.overload
|
286
|
-
def
|
366
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
287
367
|
...
|
288
368
|
|
289
369
|
@typing.overload
|
290
|
-
def
|
370
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
291
371
|
...
|
292
372
|
|
293
|
-
def
|
373
|
+
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):
|
294
374
|
"""
|
295
|
-
|
375
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
296
376
|
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
377
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
378
|
+
|
379
|
+
|
380
|
+
Parameters
|
381
|
+
----------
|
382
|
+
type : str, default 'default'
|
383
|
+
Card type.
|
384
|
+
id : str, optional, default None
|
385
|
+
If multiple cards are present, use this id to identify this card.
|
386
|
+
options : Dict[str, Any], default {}
|
387
|
+
Options passed to the card. The contents depend on the card type.
|
388
|
+
timeout : int, default 45
|
389
|
+
Interrupt reporting if it takes more than this many seconds.
|
301
390
|
"""
|
302
391
|
...
|
303
392
|
|
304
393
|
@typing.overload
|
305
|
-
def
|
394
|
+
def pypi(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
306
395
|
"""
|
307
|
-
Specifies the
|
308
|
-
to a step needs to be retried.
|
396
|
+
Specifies the PyPI packages for the step.
|
309
397
|
|
310
|
-
|
311
|
-
|
312
|
-
|
398
|
+
Information in this decorator will augment any
|
399
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
400
|
+
you can use `@pypi_base` to set packages required by all
|
401
|
+
steps and use `@pypi` to specify step-specific overrides.
|
313
402
|
|
314
|
-
|
315
|
-
|
316
|
-
|
403
|
+
|
404
|
+
Parameters
|
405
|
+
----------
|
406
|
+
packages : Dict[str, str], default: {}
|
407
|
+
Packages to use for this step. The key is the name of the package
|
408
|
+
and the value is the version to use.
|
409
|
+
python : str, optional, default: None
|
410
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
411
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
317
412
|
"""
|
318
413
|
...
|
319
414
|
|
320
415
|
@typing.overload
|
321
|
-
def
|
416
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
322
417
|
...
|
323
418
|
|
324
419
|
@typing.overload
|
325
|
-
def
|
420
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
326
421
|
...
|
327
422
|
|
328
|
-
def
|
423
|
+
def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
329
424
|
"""
|
330
|
-
Specifies the
|
331
|
-
to a step needs to be retried.
|
425
|
+
Specifies the PyPI packages for the step.
|
332
426
|
|
333
|
-
|
334
|
-
|
335
|
-
|
427
|
+
Information in this decorator will augment any
|
428
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
429
|
+
you can use `@pypi_base` to set packages required by all
|
430
|
+
steps and use `@pypi` to specify step-specific overrides.
|
336
431
|
|
337
|
-
|
338
|
-
|
339
|
-
|
432
|
+
|
433
|
+
Parameters
|
434
|
+
----------
|
435
|
+
packages : Dict[str, str], default: {}
|
436
|
+
Packages to use for this step. The key is the name of the package
|
437
|
+
and the value is the version to use.
|
438
|
+
python : str, optional, default: None
|
439
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
440
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
340
441
|
"""
|
341
442
|
...
|
342
443
|
|
343
444
|
@typing.overload
|
344
445
|
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
345
446
|
"""
|
346
|
-
|
347
|
-
|
447
|
+
Parameters
|
448
|
+
----------
|
348
449
|
"""
|
349
450
|
...
|
350
451
|
|
@@ -354,31 +455,160 @@ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None])
|
|
354
455
|
|
355
456
|
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
356
457
|
"""
|
357
|
-
|
358
|
-
|
458
|
+
Parameters
|
459
|
+
----------
|
359
460
|
"""
|
360
461
|
...
|
361
462
|
|
362
|
-
|
463
|
+
@typing.overload
|
464
|
+
def conda(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
363
465
|
"""
|
364
|
-
Specifies
|
466
|
+
Specifies the Conda environment for the step.
|
467
|
+
|
468
|
+
Information in this decorator will augment any
|
469
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
470
|
+
you can use `@conda_base` to set packages required by all
|
471
|
+
steps and use `@conda` to specify step-specific overrides.
|
472
|
+
|
473
|
+
|
474
|
+
Parameters
|
475
|
+
----------
|
476
|
+
packages : Dict[str, str], default {}
|
477
|
+
Packages to use for this step. The key is the name of the package
|
478
|
+
and the value is the version to use.
|
479
|
+
libraries : Dict[str, str], default {}
|
480
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
481
|
+
python : str, optional, default None
|
482
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
483
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
484
|
+
disabled : bool, default False
|
485
|
+
If set to True, disables @conda.
|
365
486
|
"""
|
366
487
|
...
|
367
488
|
|
368
489
|
@typing.overload
|
369
|
-
def
|
490
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
491
|
+
...
|
492
|
+
|
493
|
+
@typing.overload
|
494
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
495
|
+
...
|
496
|
+
|
497
|
+
def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
370
498
|
"""
|
371
|
-
|
499
|
+
Specifies the Conda environment for the step.
|
500
|
+
|
501
|
+
Information in this decorator will augment any
|
502
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
503
|
+
you can use `@conda_base` to set packages required by all
|
504
|
+
steps and use `@conda` to specify step-specific overrides.
|
505
|
+
|
506
|
+
|
507
|
+
Parameters
|
508
|
+
----------
|
509
|
+
packages : Dict[str, str], default {}
|
510
|
+
Packages to use for this step. The key is the name of the package
|
511
|
+
and the value is the version to use.
|
512
|
+
libraries : Dict[str, str], default {}
|
513
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
514
|
+
python : str, optional, default None
|
515
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
516
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
517
|
+
disabled : bool, default False
|
518
|
+
If set to True, disables @conda.
|
372
519
|
"""
|
373
520
|
...
|
374
521
|
|
375
|
-
|
376
|
-
|
522
|
+
def nvidia(*, gpu: int, gpu_type: str, queue_timeout: int) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
523
|
+
"""
|
524
|
+
Specifies that this step should execute on DGX cloud.
|
525
|
+
|
526
|
+
|
527
|
+
Parameters
|
528
|
+
----------
|
529
|
+
gpu : int
|
530
|
+
Number of GPUs to use.
|
531
|
+
gpu_type : str
|
532
|
+
Type of Nvidia GPU to use.
|
533
|
+
queue_timeout : int
|
534
|
+
Time to keep the job in NVCF's queue.
|
535
|
+
"""
|
377
536
|
...
|
378
537
|
|
379
|
-
def
|
538
|
+
def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[str] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable') -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
380
539
|
"""
|
381
|
-
|
540
|
+
Specifies that this step should execute on Kubernetes.
|
541
|
+
|
542
|
+
|
543
|
+
Parameters
|
544
|
+
----------
|
545
|
+
cpu : int, default 1
|
546
|
+
Number of CPUs required for this step. If `@resources` is
|
547
|
+
also present, the maximum value from all decorators is used.
|
548
|
+
memory : int, default 4096
|
549
|
+
Memory size (in MB) required for this step. If
|
550
|
+
`@resources` is also present, the maximum value from all decorators is
|
551
|
+
used.
|
552
|
+
disk : int, default 10240
|
553
|
+
Disk size (in MB) required for this step. If
|
554
|
+
`@resources` is also present, the maximum value from all decorators is
|
555
|
+
used.
|
556
|
+
image : str, optional, default None
|
557
|
+
Docker image to use when launching on Kubernetes. If not specified, and
|
558
|
+
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
559
|
+
not, a default Docker image mapping to the current version of Python is used.
|
560
|
+
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
561
|
+
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
562
|
+
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
563
|
+
Kubernetes service account to use when launching pod in Kubernetes.
|
564
|
+
secrets : List[str], optional, default None
|
565
|
+
Kubernetes secrets to use when launching pod in Kubernetes. These
|
566
|
+
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
567
|
+
in Metaflow configuration.
|
568
|
+
node_selector: Union[Dict[str,str], str], optional, default None
|
569
|
+
Kubernetes node selector(s) to apply to the pod running the task.
|
570
|
+
Can be passed in as a comma separated string of values e.g.
|
571
|
+
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
572
|
+
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
573
|
+
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
574
|
+
Kubernetes namespace to use when launching pod in Kubernetes.
|
575
|
+
gpu : int, optional, default None
|
576
|
+
Number of GPUs required for this step. A value of zero implies that
|
577
|
+
the scheduled node should not have GPUs.
|
578
|
+
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
579
|
+
The vendor of the GPUs to be used for this step.
|
580
|
+
tolerations : List[str], default []
|
581
|
+
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
582
|
+
Kubernetes tolerations to use when launching pod in Kubernetes.
|
583
|
+
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
584
|
+
Kubernetes labels to use when launching pod in Kubernetes.
|
585
|
+
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
586
|
+
Kubernetes annotations to use when launching pod in Kubernetes.
|
587
|
+
use_tmpfs : bool, default False
|
588
|
+
This enables an explicit tmpfs mount for this step.
|
589
|
+
tmpfs_tempdir : bool, default True
|
590
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
591
|
+
tmpfs_size : int, optional, default: None
|
592
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
593
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
594
|
+
memory allocated for this step.
|
595
|
+
tmpfs_path : str, optional, default /metaflow_temp
|
596
|
+
Path to tmpfs mount for this step.
|
597
|
+
persistent_volume_claims : Dict[str, str], optional, default None
|
598
|
+
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
599
|
+
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
600
|
+
shared_memory: int, optional
|
601
|
+
Shared memory size (in MiB) required for this step
|
602
|
+
port: int, optional
|
603
|
+
Port number to specify in the Kubernetes job object
|
604
|
+
compute_pool : str, optional, default None
|
605
|
+
Compute pool to be used for for this step.
|
606
|
+
If not specified, any accessible compute pool within the perimeter is used.
|
607
|
+
hostname_resolution_timeout: int, default 10 * 60
|
608
|
+
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
609
|
+
Only applicable when @parallel is used.
|
610
|
+
qos: str, default: Burstable
|
611
|
+
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
382
612
|
"""
|
383
613
|
...
|
384
614
|
|
@@ -400,6 +630,21 @@ def resources(*, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Op
|
|
400
630
|
```
|
401
631
|
which executes the flow on the desired system using the
|
402
632
|
requirements specified in `@resources`.
|
633
|
+
|
634
|
+
|
635
|
+
Parameters
|
636
|
+
----------
|
637
|
+
cpu : int, default 1
|
638
|
+
Number of CPUs required for this step.
|
639
|
+
gpu : int, optional, default None
|
640
|
+
Number of GPUs required for this step.
|
641
|
+
disk : int, optional, default None
|
642
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
643
|
+
memory : int, default 4096
|
644
|
+
Memory size (in MB) required for this step.
|
645
|
+
shared_memory : int, optional, default None
|
646
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
647
|
+
This parameter maps to the `--shm-size` option in Docker.
|
403
648
|
"""
|
404
649
|
...
|
405
650
|
|
@@ -428,217 +673,348 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
428
673
|
```
|
429
674
|
which executes the flow on the desired system using the
|
430
675
|
requirements specified in `@resources`.
|
676
|
+
|
677
|
+
|
678
|
+
Parameters
|
679
|
+
----------
|
680
|
+
cpu : int, default 1
|
681
|
+
Number of CPUs required for this step.
|
682
|
+
gpu : int, optional, default None
|
683
|
+
Number of GPUs required for this step.
|
684
|
+
disk : int, optional, default None
|
685
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
686
|
+
memory : int, default 4096
|
687
|
+
Memory size (in MB) required for this step.
|
688
|
+
shared_memory : int, optional, default None
|
689
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
690
|
+
This parameter maps to the `--shm-size` option in Docker.
|
431
691
|
"""
|
432
692
|
...
|
433
693
|
|
434
694
|
@typing.overload
|
435
|
-
def
|
695
|
+
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]]]:
|
436
696
|
"""
|
437
|
-
|
697
|
+
Specifies that the step will success under all circumstances.
|
698
|
+
|
699
|
+
The decorator will create an optional artifact, specified by `var`, which
|
700
|
+
contains the exception raised. You can use it to detect the presence
|
701
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
702
|
+
are missing.
|
703
|
+
|
704
|
+
|
705
|
+
Parameters
|
706
|
+
----------
|
707
|
+
var : str, optional, default None
|
708
|
+
Name of the artifact in which to store the caught exception.
|
709
|
+
If not specified, the exception is not stored.
|
710
|
+
print_exception : bool, default True
|
711
|
+
Determines whether or not the exception is printed to
|
712
|
+
stdout when caught.
|
438
713
|
"""
|
439
714
|
...
|
440
715
|
|
441
716
|
@typing.overload
|
442
|
-
def
|
717
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
443
718
|
...
|
444
719
|
|
445
720
|
@typing.overload
|
446
|
-
def
|
721
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
447
722
|
...
|
448
723
|
|
449
|
-
def
|
450
|
-
"""
|
451
|
-
Enables checkpointing for a step.
|
724
|
+
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):
|
452
725
|
"""
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
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):
|
471
|
-
"""
|
472
|
-
Enables loading / saving of models within a step.
|
726
|
+
Specifies that the step will success under all circumstances.
|
727
|
+
|
728
|
+
The decorator will create an optional artifact, specified by `var`, which
|
729
|
+
contains the exception raised. You can use it to detect the presence
|
730
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
731
|
+
are missing.
|
732
|
+
|
733
|
+
|
734
|
+
Parameters
|
735
|
+
----------
|
736
|
+
var : str, optional, default None
|
737
|
+
Name of the artifact in which to store the caught exception.
|
738
|
+
If not specified, the exception is not stored.
|
739
|
+
print_exception : bool, default True
|
740
|
+
Determines whether or not the exception is printed to
|
741
|
+
stdout when caught.
|
473
742
|
"""
|
474
743
|
...
|
475
744
|
|
476
745
|
@typing.overload
|
477
|
-
def
|
746
|
+
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]]]:
|
478
747
|
"""
|
479
|
-
Specifies
|
748
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
749
|
+
the execution of a step.
|
480
750
|
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
751
|
+
|
752
|
+
Parameters
|
753
|
+
----------
|
754
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
755
|
+
List of secret specs, defining how the secrets are to be retrieved
|
485
756
|
"""
|
486
757
|
...
|
487
758
|
|
488
759
|
@typing.overload
|
489
|
-
def
|
760
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
490
761
|
...
|
491
762
|
|
492
763
|
@typing.overload
|
493
|
-
def
|
764
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
494
765
|
...
|
495
766
|
|
496
|
-
def
|
767
|
+
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]]] = []):
|
497
768
|
"""
|
498
|
-
Specifies
|
769
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
770
|
+
the execution of a step.
|
499
771
|
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
772
|
+
|
773
|
+
Parameters
|
774
|
+
----------
|
775
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
776
|
+
List of secret specs, defining how the secrets are to be retrieved
|
504
777
|
"""
|
505
778
|
...
|
506
779
|
|
507
780
|
@typing.overload
|
508
|
-
def
|
781
|
+
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]]]:
|
509
782
|
"""
|
510
|
-
Specifies
|
783
|
+
Specifies the number of times the task corresponding
|
784
|
+
to a step needs to be retried.
|
785
|
+
|
786
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
787
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
788
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
789
|
+
|
790
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
791
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
792
|
+
ensuring that the flow execution can continue.
|
793
|
+
|
794
|
+
|
795
|
+
Parameters
|
796
|
+
----------
|
797
|
+
times : int, default 3
|
798
|
+
Number of times to retry this task.
|
799
|
+
minutes_between_retries : int, default 2
|
800
|
+
Number of minutes between retries.
|
511
801
|
"""
|
512
802
|
...
|
513
803
|
|
514
804
|
@typing.overload
|
515
|
-
def
|
805
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
516
806
|
...
|
517
807
|
|
518
808
|
@typing.overload
|
519
|
-
def
|
809
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
520
810
|
...
|
521
811
|
|
522
|
-
def
|
812
|
+
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):
|
523
813
|
"""
|
524
|
-
Specifies
|
814
|
+
Specifies the number of times the task corresponding
|
815
|
+
to a step needs to be retried.
|
816
|
+
|
817
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
818
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
819
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
820
|
+
|
821
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
822
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
823
|
+
ensuring that the flow execution can continue.
|
824
|
+
|
825
|
+
|
826
|
+
Parameters
|
827
|
+
----------
|
828
|
+
times : int, default 3
|
829
|
+
Number of times to retry this task.
|
830
|
+
minutes_between_retries : int, default 2
|
831
|
+
Number of minutes between retries.
|
525
832
|
"""
|
526
833
|
...
|
527
834
|
|
528
|
-
|
835
|
+
@typing.overload
|
836
|
+
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]]]:
|
529
837
|
"""
|
530
|
-
|
838
|
+
Enables loading / saving of models within a step.
|
839
|
+
|
840
|
+
|
841
|
+
|
842
|
+
Parameters
|
843
|
+
----------
|
844
|
+
load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
|
845
|
+
Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
|
846
|
+
These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
|
847
|
+
- `current.checkpoint`
|
848
|
+
- `current.model`
|
849
|
+
- `current.huggingface_hub`
|
850
|
+
|
851
|
+
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
|
852
|
+
the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
|
853
|
+
If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
|
854
|
+
|
855
|
+
temp_dir_root : str, default: None
|
856
|
+
The root directory under which `current.model.loaded` will store loaded models
|
531
857
|
"""
|
532
858
|
...
|
533
859
|
|
534
860
|
@typing.overload
|
535
|
-
def
|
536
|
-
"""
|
537
|
-
Specifies the PyPI packages for all steps of the flow.
|
538
|
-
|
539
|
-
Use `@pypi_base` to set common packages required by all
|
540
|
-
steps and use `@pypi` to specify step-specific overrides.
|
541
|
-
"""
|
861
|
+
def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
542
862
|
...
|
543
863
|
|
544
864
|
@typing.overload
|
545
|
-
def
|
865
|
+
def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
546
866
|
...
|
547
867
|
|
548
|
-
def
|
868
|
+
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):
|
549
869
|
"""
|
550
|
-
|
870
|
+
Enables loading / saving of models within a step.
|
551
871
|
|
552
|
-
|
553
|
-
|
872
|
+
|
873
|
+
|
874
|
+
Parameters
|
875
|
+
----------
|
876
|
+
load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
|
877
|
+
Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
|
878
|
+
These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
|
879
|
+
- `current.checkpoint`
|
880
|
+
- `current.model`
|
881
|
+
- `current.huggingface_hub`
|
882
|
+
|
883
|
+
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
|
884
|
+
the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
|
885
|
+
If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
|
886
|
+
|
887
|
+
temp_dir_root : str, default: None
|
888
|
+
The root directory under which `current.model.loaded` will store loaded models
|
554
889
|
"""
|
555
890
|
...
|
556
891
|
|
557
|
-
def
|
892
|
+
def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
558
893
|
"""
|
559
|
-
|
560
|
-
|
894
|
+
Specifies what flows belong to the same project.
|
895
|
+
|
896
|
+
A project-specific namespace is created for all flows that
|
897
|
+
use the same `@project(name)`.
|
898
|
+
|
899
|
+
|
900
|
+
Parameters
|
901
|
+
----------
|
902
|
+
name : str
|
903
|
+
Project name. Make sure that the name is unique amongst all
|
904
|
+
projects that use the same production scheduler. The name may
|
905
|
+
contain only lowercase alphanumeric characters and underscores.
|
906
|
+
|
907
|
+
branch : Optional[str], default None
|
908
|
+
The branch to use. If not specified, the branch is set to
|
909
|
+
`user.<username>` unless `production` is set to `True`. This can
|
910
|
+
also be set on the command line using `--branch` as a top-level option.
|
911
|
+
It is an error to specify `branch` in the decorator and on the command line.
|
912
|
+
|
913
|
+
production : bool, default False
|
914
|
+
Whether or not the branch is the production branch. This can also be set on the
|
915
|
+
command line using `--production` as a top-level option. It is an error to specify
|
916
|
+
`production` in the decorator and on the command line.
|
917
|
+
The project branch name will be:
|
918
|
+
- if `branch` is specified:
|
919
|
+
- if `production` is True: `prod.<branch>`
|
920
|
+
- if `production` is False: `test.<branch>`
|
921
|
+
- if `branch` is not specified:
|
922
|
+
- if `production` is True: `prod`
|
923
|
+
- if `production` is False: `user.<username>`
|
561
924
|
"""
|
562
925
|
...
|
563
926
|
|
564
927
|
@typing.overload
|
565
|
-
def
|
928
|
+
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]]:
|
566
929
|
"""
|
567
|
-
Specifies the
|
568
|
-
|
569
|
-
```
|
570
|
-
@trigger_on_finish(flow='FooFlow')
|
571
|
-
```
|
572
|
-
or
|
573
|
-
```
|
574
|
-
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
575
|
-
```
|
576
|
-
This decorator respects the @project decorator and triggers the flow
|
577
|
-
when upstream runs within the same namespace complete successfully
|
930
|
+
Specifies the Conda environment for all steps of the flow.
|
578
931
|
|
579
|
-
|
580
|
-
|
581
|
-
```
|
582
|
-
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
583
|
-
```
|
584
|
-
or
|
585
|
-
```
|
586
|
-
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
587
|
-
```
|
932
|
+
Use `@conda_base` to set common libraries required by all
|
933
|
+
steps and use `@conda` to specify step-specific additions.
|
588
934
|
|
589
|
-
You can also specify just the project or project branch (other values will be
|
590
|
-
inferred from the current project or project branch):
|
591
|
-
```
|
592
|
-
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
593
|
-
```
|
594
935
|
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
936
|
+
Parameters
|
937
|
+
----------
|
938
|
+
packages : Dict[str, str], default {}
|
939
|
+
Packages to use for this flow. The key is the name of the package
|
940
|
+
and the value is the version to use.
|
941
|
+
libraries : Dict[str, str], default {}
|
942
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
943
|
+
python : str, optional, default None
|
944
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
945
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
946
|
+
disabled : bool, default False
|
947
|
+
If set to True, disables Conda.
|
600
948
|
"""
|
601
949
|
...
|
602
950
|
|
603
951
|
@typing.overload
|
604
|
-
def
|
952
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
605
953
|
...
|
606
954
|
|
607
|
-
def
|
955
|
+
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):
|
608
956
|
"""
|
609
|
-
Specifies the
|
957
|
+
Specifies the Conda environment for all steps of the flow.
|
610
958
|
|
611
|
-
|
612
|
-
|
613
|
-
```
|
614
|
-
or
|
615
|
-
```
|
616
|
-
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
617
|
-
```
|
618
|
-
This decorator respects the @project decorator and triggers the flow
|
619
|
-
when upstream runs within the same namespace complete successfully
|
959
|
+
Use `@conda_base` to set common libraries required by all
|
960
|
+
steps and use `@conda` to specify step-specific additions.
|
620
961
|
|
621
|
-
Additionally, you can specify project aware upstream flow dependencies
|
622
|
-
by specifying the fully qualified project_flow_name.
|
623
|
-
```
|
624
|
-
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
625
|
-
```
|
626
|
-
or
|
627
|
-
```
|
628
|
-
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
629
|
-
```
|
630
962
|
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
963
|
+
Parameters
|
964
|
+
----------
|
965
|
+
packages : Dict[str, str], default {}
|
966
|
+
Packages to use for this flow. The key is the name of the package
|
967
|
+
and the value is the version to use.
|
968
|
+
libraries : Dict[str, str], default {}
|
969
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
970
|
+
python : str, optional, default None
|
971
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
972
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
973
|
+
disabled : bool, default False
|
974
|
+
If set to True, disables Conda.
|
975
|
+
"""
|
976
|
+
...
|
977
|
+
|
978
|
+
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]]:
|
979
|
+
"""
|
980
|
+
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.
|
981
|
+
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.
|
636
982
|
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
983
|
+
|
984
|
+
Parameters
|
985
|
+
----------
|
986
|
+
timeout : int
|
987
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
988
|
+
poke_interval : int
|
989
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
990
|
+
mode : str
|
991
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
992
|
+
exponential_backoff : bool
|
993
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
994
|
+
pool : str
|
995
|
+
the slot pool this task should run in,
|
996
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
997
|
+
soft_fail : bool
|
998
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
999
|
+
name : str
|
1000
|
+
Name of the sensor on Airflow
|
1001
|
+
description : str
|
1002
|
+
Description of sensor in the Airflow UI
|
1003
|
+
external_dag_id : str
|
1004
|
+
The dag_id that contains the task you want to wait for.
|
1005
|
+
external_task_ids : List[str]
|
1006
|
+
The list of task_ids that you want to wait for.
|
1007
|
+
If None (default value) the sensor waits for the DAG. (Default: None)
|
1008
|
+
allowed_states : List[str]
|
1009
|
+
Iterable of allowed states, (Default: ['success'])
|
1010
|
+
failed_states : List[str]
|
1011
|
+
Iterable of failed or dis-allowed states. (Default: None)
|
1012
|
+
execution_delta : datetime.timedelta
|
1013
|
+
time difference with the previous execution to look at,
|
1014
|
+
the default is the same logical date as the current task or DAG. (Default: None)
|
1015
|
+
check_existence: bool
|
1016
|
+
Set to True to check if the external task exists or check if
|
1017
|
+
the DAG to wait for exists. (Default: True)
|
642
1018
|
"""
|
643
1019
|
...
|
644
1020
|
|
@@ -647,6 +1023,22 @@ def schedule(*, hourly: bool = False, daily: bool = True, weekly: bool = False,
|
|
647
1023
|
"""
|
648
1024
|
Specifies the times when the flow should be run when running on a
|
649
1025
|
production scheduler.
|
1026
|
+
|
1027
|
+
|
1028
|
+
Parameters
|
1029
|
+
----------
|
1030
|
+
hourly : bool, default False
|
1031
|
+
Run the workflow hourly.
|
1032
|
+
daily : bool, default True
|
1033
|
+
Run the workflow daily.
|
1034
|
+
weekly : bool, default False
|
1035
|
+
Run the workflow weekly.
|
1036
|
+
cron : str, optional, default None
|
1037
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1038
|
+
specified by this expression.
|
1039
|
+
timezone : str, optional, default None
|
1040
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1041
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
650
1042
|
"""
|
651
1043
|
...
|
652
1044
|
|
@@ -658,15 +1050,22 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
|
|
658
1050
|
"""
|
659
1051
|
Specifies the times when the flow should be run when running on a
|
660
1052
|
production scheduler.
|
661
|
-
"""
|
662
|
-
...
|
663
|
-
|
664
|
-
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
665
|
-
"""
|
666
|
-
Specifies what flows belong to the same project.
|
667
1053
|
|
668
|
-
|
669
|
-
|
1054
|
+
|
1055
|
+
Parameters
|
1056
|
+
----------
|
1057
|
+
hourly : bool, default False
|
1058
|
+
Run the workflow hourly.
|
1059
|
+
daily : bool, default True
|
1060
|
+
Run the workflow daily.
|
1061
|
+
weekly : bool, default False
|
1062
|
+
Run the workflow weekly.
|
1063
|
+
cron : str, optional, default None
|
1064
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1065
|
+
specified by this expression.
|
1066
|
+
timezone : str, optional, default None
|
1067
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1068
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
670
1069
|
"""
|
671
1070
|
...
|
672
1071
|
|
@@ -691,6 +1090,55 @@ def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[Fl
|
|
691
1090
|
- 'meta/llama3-8b-instruct': 8B parameter model
|
692
1091
|
- 'meta/llama3-70b-instruct': 70B parameter model
|
693
1092
|
- Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
|
1093
|
+
|
1094
|
+
|
1095
|
+
Parameters
|
1096
|
+
----------
|
1097
|
+
models: list[NIM]
|
1098
|
+
List of NIM containers running models in sidecars.
|
1099
|
+
backend: str
|
1100
|
+
Compute provider to run the NIM container.
|
1101
|
+
"""
|
1102
|
+
...
|
1103
|
+
|
1104
|
+
@typing.overload
|
1105
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1106
|
+
"""
|
1107
|
+
Specifies the PyPI packages for all steps of the flow.
|
1108
|
+
|
1109
|
+
Use `@pypi_base` to set common packages required by all
|
1110
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1111
|
+
|
1112
|
+
Parameters
|
1113
|
+
----------
|
1114
|
+
packages : Dict[str, str], default: {}
|
1115
|
+
Packages to use for this flow. The key is the name of the package
|
1116
|
+
and the value is the version to use.
|
1117
|
+
python : str, optional, default: None
|
1118
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1119
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1120
|
+
"""
|
1121
|
+
...
|
1122
|
+
|
1123
|
+
@typing.overload
|
1124
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1125
|
+
...
|
1126
|
+
|
1127
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1128
|
+
"""
|
1129
|
+
Specifies the PyPI packages for all steps of the flow.
|
1130
|
+
|
1131
|
+
Use `@pypi_base` to set common packages required by all
|
1132
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1133
|
+
|
1134
|
+
Parameters
|
1135
|
+
----------
|
1136
|
+
packages : Dict[str, str], default: {}
|
1137
|
+
Packages to use for this flow. The key is the name of the package
|
1138
|
+
and the value is the version to use.
|
1139
|
+
python : str, optional, default: None
|
1140
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1141
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
694
1142
|
"""
|
695
1143
|
...
|
696
1144
|
|
@@ -726,6 +1174,16 @@ def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = No
|
|
726
1174
|
```
|
727
1175
|
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
728
1176
|
```
|
1177
|
+
|
1178
|
+
|
1179
|
+
Parameters
|
1180
|
+
----------
|
1181
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
1182
|
+
Event dependency for this flow.
|
1183
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
1184
|
+
Events dependency for this flow.
|
1185
|
+
options : Dict[str, Any], default {}
|
1186
|
+
Backend-specific configuration for tuning eventing behavior.
|
729
1187
|
"""
|
730
1188
|
...
|
731
1189
|
|
@@ -764,29 +1222,117 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
764
1222
|
```
|
765
1223
|
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
766
1224
|
```
|
1225
|
+
|
1226
|
+
|
1227
|
+
Parameters
|
1228
|
+
----------
|
1229
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
1230
|
+
Event dependency for this flow.
|
1231
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
1232
|
+
Events dependency for this flow.
|
1233
|
+
options : Dict[str, Any], default {}
|
1234
|
+
Backend-specific configuration for tuning eventing behavior.
|
767
1235
|
"""
|
768
1236
|
...
|
769
1237
|
|
770
1238
|
@typing.overload
|
771
|
-
def
|
1239
|
+
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]]:
|
772
1240
|
"""
|
773
|
-
Specifies the
|
1241
|
+
Specifies the flow(s) that this flow depends on.
|
774
1242
|
|
775
|
-
|
776
|
-
|
1243
|
+
```
|
1244
|
+
@trigger_on_finish(flow='FooFlow')
|
1245
|
+
```
|
1246
|
+
or
|
1247
|
+
```
|
1248
|
+
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
1249
|
+
```
|
1250
|
+
This decorator respects the @project decorator and triggers the flow
|
1251
|
+
when upstream runs within the same namespace complete successfully
|
1252
|
+
|
1253
|
+
Additionally, you can specify project aware upstream flow dependencies
|
1254
|
+
by specifying the fully qualified project_flow_name.
|
1255
|
+
```
|
1256
|
+
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
1257
|
+
```
|
1258
|
+
or
|
1259
|
+
```
|
1260
|
+
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
1261
|
+
```
|
1262
|
+
|
1263
|
+
You can also specify just the project or project branch (other values will be
|
1264
|
+
inferred from the current project or project branch):
|
1265
|
+
```
|
1266
|
+
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
1267
|
+
```
|
1268
|
+
|
1269
|
+
Note that `branch` is typically one of:
|
1270
|
+
- `prod`
|
1271
|
+
- `user.bob`
|
1272
|
+
- `test.my_experiment`
|
1273
|
+
- `prod.staging`
|
1274
|
+
|
1275
|
+
|
1276
|
+
Parameters
|
1277
|
+
----------
|
1278
|
+
flow : Union[str, Dict[str, str]], optional, default None
|
1279
|
+
Upstream flow dependency for this flow.
|
1280
|
+
flows : List[Union[str, Dict[str, str]]], default []
|
1281
|
+
Upstream flow dependencies for this flow.
|
1282
|
+
options : Dict[str, Any], default {}
|
1283
|
+
Backend-specific configuration for tuning eventing behavior.
|
777
1284
|
"""
|
778
1285
|
...
|
779
1286
|
|
780
1287
|
@typing.overload
|
781
|
-
def
|
1288
|
+
def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
782
1289
|
...
|
783
1290
|
|
784
|
-
def
|
1291
|
+
def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, 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] = {}):
|
785
1292
|
"""
|
786
|
-
Specifies the
|
1293
|
+
Specifies the flow(s) that this flow depends on.
|
787
1294
|
|
788
|
-
|
789
|
-
|
1295
|
+
```
|
1296
|
+
@trigger_on_finish(flow='FooFlow')
|
1297
|
+
```
|
1298
|
+
or
|
1299
|
+
```
|
1300
|
+
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
1301
|
+
```
|
1302
|
+
This decorator respects the @project decorator and triggers the flow
|
1303
|
+
when upstream runs within the same namespace complete successfully
|
1304
|
+
|
1305
|
+
Additionally, you can specify project aware upstream flow dependencies
|
1306
|
+
by specifying the fully qualified project_flow_name.
|
1307
|
+
```
|
1308
|
+
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
1309
|
+
```
|
1310
|
+
or
|
1311
|
+
```
|
1312
|
+
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
1313
|
+
```
|
1314
|
+
|
1315
|
+
You can also specify just the project or project branch (other values will be
|
1316
|
+
inferred from the current project or project branch):
|
1317
|
+
```
|
1318
|
+
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
1319
|
+
```
|
1320
|
+
|
1321
|
+
Note that `branch` is typically one of:
|
1322
|
+
- `prod`
|
1323
|
+
- `user.bob`
|
1324
|
+
- `test.my_experiment`
|
1325
|
+
- `prod.staging`
|
1326
|
+
|
1327
|
+
|
1328
|
+
Parameters
|
1329
|
+
----------
|
1330
|
+
flow : Union[str, Dict[str, str]], optional, default None
|
1331
|
+
Upstream flow dependency for this flow.
|
1332
|
+
flows : List[Union[str, Dict[str, str]]], default []
|
1333
|
+
Upstream flow dependencies for this flow.
|
1334
|
+
options : Dict[str, Any], default {}
|
1335
|
+
Backend-specific configuration for tuning eventing behavior.
|
790
1336
|
"""
|
791
1337
|
...
|
792
1338
|
|
@@ -797,6 +1343,39 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
|
|
797
1343
|
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
798
1344
|
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
799
1345
|
starts only after all sensors finish.
|
1346
|
+
|
1347
|
+
|
1348
|
+
Parameters
|
1349
|
+
----------
|
1350
|
+
timeout : int
|
1351
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1352
|
+
poke_interval : int
|
1353
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1354
|
+
mode : str
|
1355
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1356
|
+
exponential_backoff : bool
|
1357
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1358
|
+
pool : str
|
1359
|
+
the slot pool this task should run in,
|
1360
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1361
|
+
soft_fail : bool
|
1362
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1363
|
+
name : str
|
1364
|
+
Name of the sensor on Airflow
|
1365
|
+
description : str
|
1366
|
+
Description of sensor in the Airflow UI
|
1367
|
+
bucket_key : Union[str, List[str]]
|
1368
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1369
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1370
|
+
bucket_name : str
|
1371
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1372
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1373
|
+
wildcard_match : bool
|
1374
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1375
|
+
aws_conn_id : str
|
1376
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1377
|
+
verify : bool
|
1378
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
800
1379
|
"""
|
801
1380
|
...
|
802
1381
|
|