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