metaflow-stubs 2.16.6__py2.py3-none-any.whl → 2.16.7__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.
Potentially problematic release.
This version of metaflow-stubs might be problematic. Click here for more details.
- metaflow-stubs/__init__.pyi +575 -575
- metaflow-stubs/cards.pyi +2 -2
- metaflow-stubs/cli.pyi +2 -2
- metaflow-stubs/cli_components/__init__.pyi +2 -2
- metaflow-stubs/cli_components/utils.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +2 -2
- metaflow-stubs/client/core.pyi +5 -5
- metaflow-stubs/client/filecache.pyi +2 -2
- metaflow-stubs/events.pyi +2 -2
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +4 -4
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +3 -3
- metaflow-stubs/meta_files.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 +22 -22
- metaflow-stubs/metaflow_git.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/packaging_sys/__init__.pyi +13 -13
- metaflow-stubs/packaging_sys/backend.pyi +20 -7
- metaflow-stubs/packaging_sys/distribution_support.pyi +3 -3
- metaflow-stubs/packaging_sys/tar_backend.pyi +16 -7
- metaflow-stubs/packaging_sys/utils.pyi +2 -2
- metaflow-stubs/packaging_sys/v1.pyi +3 -3
- 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_decorator.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
- metaflow-stubs/plugins/airflow/exception.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
- metaflow-stubs/plugins/argo/__init__.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +4 -4
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +24 -2
- metaflow-stubs/plugins/argo/exit_hooks.pyi +2 -2
- metaflow-stubs/plugins/aws/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.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_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +3 -3
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +13 -2
- metaflow-stubs/plugins/azure/__init__.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
- metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/cards/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_client.pyi +2 -2
- metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
- metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +2 -2
- metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3.pyi +4 -4
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
- metaflow-stubs/plugins/debug_logger.pyi +2 -2
- metaflow-stubs/plugins/debug_monitor.pyi +2 -2
- metaflow-stubs/plugins/environment_decorator.pyi +2 -2
- metaflow-stubs/plugins/events_decorator.pyi +2 -2
- metaflow-stubs/plugins/exit_hook/__init__.pyi +2 -2
- metaflow-stubs/plugins/exit_hook/exit_hook_decorator.pyi +2 -2
- metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
- metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
- metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
- metaflow-stubs/plugins/project_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/__init__.pyi +3 -3
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
- 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 +2 -2
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
- metaflow-stubs/plugins/secrets/secrets_func.pyi +2 -2
- metaflow-stubs/plugins/secrets/secrets_spec.pyi +2 -2
- metaflow-stubs/plugins/secrets/utils.pyi +2 -2
- metaflow-stubs/plugins/storage_executor.pyi +2 -2
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
- metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
- metaflow-stubs/plugins/uv/__init__.pyi +2 -2
- metaflow-stubs/plugins/uv/uv_environment.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +53 -22
- metaflow-stubs/runner/deployer_impl.pyi +2 -2
- metaflow-stubs/runner/metaflow_runner.pyi +2 -2
- 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 +4 -4
- metaflow-stubs/system/__init__.pyi +2 -2
- metaflow-stubs/system/system_logger.pyi +2 -2
- metaflow-stubs/system/system_monitor.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- metaflow-stubs/user_configs/__init__.pyi +2 -2
- metaflow-stubs/user_configs/config_options.pyi +3 -3
- metaflow-stubs/user_configs/config_parameters.pyi +5 -5
- metaflow-stubs/user_decorators/__init__.pyi +2 -2
- metaflow-stubs/user_decorators/common.pyi +2 -2
- metaflow-stubs/user_decorators/mutable_flow.pyi +6 -6
- metaflow-stubs/user_decorators/mutable_step.pyi +5 -5
- metaflow-stubs/user_decorators/user_flow_decorator.pyi +4 -4
- metaflow-stubs/user_decorators/user_step_decorator.pyi +5 -5
- metaflow-stubs/version.pyi +2 -2
- {metaflow_stubs-2.16.6.dist-info → metaflow_stubs-2.16.7.dist-info}/METADATA +2 -2
- metaflow_stubs-2.16.7.dist-info/RECORD +166 -0
- metaflow_stubs-2.16.6.dist-info/RECORD +0 -166
- {metaflow_stubs-2.16.6.dist-info → metaflow_stubs-2.16.7.dist-info}/WHEEL +0 -0
- {metaflow_stubs-2.16.6.dist-info → metaflow_stubs-2.16.7.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
######################################################################################################
|
|
2
2
|
# Auto-generated Metaflow stub file #
|
|
3
|
-
# MF version: 2.16.
|
|
4
|
-
# Generated on 2025-07-
|
|
3
|
+
# MF version: 2.16.7 #
|
|
4
|
+
# Generated on 2025-07-29T01:50:18.781263 #
|
|
5
5
|
######################################################################################################
|
|
6
6
|
|
|
7
7
|
from __future__ import annotations
|
|
@@ -39,17 +39,17 @@ from .user_decorators.user_step_decorator import UserStepDecorator as UserStepDe
|
|
|
39
39
|
from .user_decorators.user_step_decorator import StepMutator as StepMutator
|
|
40
40
|
from .user_decorators.user_step_decorator import user_step_decorator as user_step_decorator
|
|
41
41
|
from .user_decorators.user_flow_decorator import FlowMutator as FlowMutator
|
|
42
|
-
from . import tuple_util as tuple_util
|
|
43
42
|
from . import metaflow_git as metaflow_git
|
|
44
43
|
from . import events as events
|
|
44
|
+
from . import tuple_util as tuple_util
|
|
45
45
|
from . import runner as runner
|
|
46
46
|
from . import plugins as plugins
|
|
47
47
|
from .plugins.datatools.s3.s3 import S3 as S3
|
|
48
48
|
from . import includefile as includefile
|
|
49
49
|
from .includefile import IncludeFile as IncludeFile
|
|
50
|
-
from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
|
|
51
|
-
from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
|
|
52
50
|
from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
|
|
51
|
+
from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
|
|
52
|
+
from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
|
|
53
53
|
from . import cards as cards
|
|
54
54
|
from . import client as client
|
|
55
55
|
from .client.core import namespace as namespace
|
|
@@ -70,8 +70,8 @@ from .runner.deployer import Deployer as Deployer
|
|
|
70
70
|
from .runner.deployer import DeployedFlow as DeployedFlow
|
|
71
71
|
from .runner.nbdeploy import NBDeployer as NBDeployer
|
|
72
72
|
from . import version as version
|
|
73
|
-
from . import cli_components as cli_components
|
|
74
73
|
from . import system as system
|
|
74
|
+
from . import cli_components as cli_components
|
|
75
75
|
from . import pylint_wrapper as pylint_wrapper
|
|
76
76
|
from . import cli as cli
|
|
77
77
|
|
|
@@ -152,6 +152,64 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
|
152
152
|
"""
|
|
153
153
|
...
|
|
154
154
|
|
|
155
|
+
@typing.overload
|
|
156
|
+
def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: 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]]]:
|
|
157
|
+
"""
|
|
158
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
|
159
|
+
the execution of a step.
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
Parameters
|
|
163
|
+
----------
|
|
164
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
|
165
|
+
List of secret specs, defining how the secrets are to be retrieved
|
|
166
|
+
role : str, optional, default: None
|
|
167
|
+
Role to use for fetching secrets
|
|
168
|
+
"""
|
|
169
|
+
...
|
|
170
|
+
|
|
171
|
+
@typing.overload
|
|
172
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
173
|
+
...
|
|
174
|
+
|
|
175
|
+
@typing.overload
|
|
176
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
177
|
+
...
|
|
178
|
+
|
|
179
|
+
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]]] = [], role: typing.Optional[str] = None):
|
|
180
|
+
"""
|
|
181
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
|
182
|
+
the execution of a step.
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
Parameters
|
|
186
|
+
----------
|
|
187
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
|
188
|
+
List of secret specs, defining how the secrets are to be retrieved
|
|
189
|
+
role : str, optional, default: None
|
|
190
|
+
Role to use for fetching secrets
|
|
191
|
+
"""
|
|
192
|
+
...
|
|
193
|
+
|
|
194
|
+
@typing.overload
|
|
195
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
196
|
+
"""
|
|
197
|
+
Decorator prototype for all step decorators. This function gets specialized
|
|
198
|
+
and imported for all decorators types by _import_plugin_decorators().
|
|
199
|
+
"""
|
|
200
|
+
...
|
|
201
|
+
|
|
202
|
+
@typing.overload
|
|
203
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
204
|
+
...
|
|
205
|
+
|
|
206
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
|
207
|
+
"""
|
|
208
|
+
Decorator prototype for all step decorators. This function gets specialized
|
|
209
|
+
and imported for all decorators types by _import_plugin_decorators().
|
|
210
|
+
"""
|
|
211
|
+
...
|
|
212
|
+
|
|
155
213
|
@typing.overload
|
|
156
214
|
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]]]:
|
|
157
215
|
"""
|
|
@@ -202,21 +260,61 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
|
|
|
202
260
|
...
|
|
203
261
|
|
|
204
262
|
@typing.overload
|
|
205
|
-
def
|
|
263
|
+
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]]]:
|
|
206
264
|
"""
|
|
207
|
-
|
|
208
|
-
|
|
265
|
+
Specifies a timeout for your step.
|
|
266
|
+
|
|
267
|
+
This decorator is useful if this step may hang indefinitely.
|
|
268
|
+
|
|
269
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
|
270
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
|
271
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
|
272
|
+
|
|
273
|
+
Note that all the values specified in parameters are added together so if you specify
|
|
274
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
Parameters
|
|
278
|
+
----------
|
|
279
|
+
seconds : int, default 0
|
|
280
|
+
Number of seconds to wait prior to timing out.
|
|
281
|
+
minutes : int, default 0
|
|
282
|
+
Number of minutes to wait prior to timing out.
|
|
283
|
+
hours : int, default 0
|
|
284
|
+
Number of hours to wait prior to timing out.
|
|
209
285
|
"""
|
|
210
286
|
...
|
|
211
287
|
|
|
212
288
|
@typing.overload
|
|
213
|
-
def
|
|
289
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
214
290
|
...
|
|
215
291
|
|
|
216
|
-
|
|
292
|
+
@typing.overload
|
|
293
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
294
|
+
...
|
|
295
|
+
|
|
296
|
+
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):
|
|
217
297
|
"""
|
|
218
|
-
|
|
219
|
-
|
|
298
|
+
Specifies a timeout for your step.
|
|
299
|
+
|
|
300
|
+
This decorator is useful if this step may hang indefinitely.
|
|
301
|
+
|
|
302
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
|
303
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
|
304
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
|
305
|
+
|
|
306
|
+
Note that all the values specified in parameters are added together so if you specify
|
|
307
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
Parameters
|
|
311
|
+
----------
|
|
312
|
+
seconds : int, default 0
|
|
313
|
+
Number of seconds to wait prior to timing out.
|
|
314
|
+
minutes : int, default 0
|
|
315
|
+
Number of minutes to wait prior to timing out.
|
|
316
|
+
hours : int, default 0
|
|
317
|
+
Number of hours to wait prior to timing out.
|
|
220
318
|
"""
|
|
221
319
|
...
|
|
222
320
|
|
|
@@ -271,128 +369,6 @@ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
|
271
369
|
"""
|
|
272
370
|
...
|
|
273
371
|
|
|
274
|
-
@typing.overload
|
|
275
|
-
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]]]:
|
|
276
|
-
"""
|
|
277
|
-
Specifies environment variables to be set prior to the execution of a step.
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
Parameters
|
|
281
|
-
----------
|
|
282
|
-
vars : Dict[str, str], default {}
|
|
283
|
-
Dictionary of environment variables to set.
|
|
284
|
-
"""
|
|
285
|
-
...
|
|
286
|
-
|
|
287
|
-
@typing.overload
|
|
288
|
-
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
289
|
-
...
|
|
290
|
-
|
|
291
|
-
@typing.overload
|
|
292
|
-
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
293
|
-
...
|
|
294
|
-
|
|
295
|
-
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
|
296
|
-
"""
|
|
297
|
-
Specifies environment variables to be set prior to the execution of a step.
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
Parameters
|
|
301
|
-
----------
|
|
302
|
-
vars : Dict[str, str], default {}
|
|
303
|
-
Dictionary of environment variables to set.
|
|
304
|
-
"""
|
|
305
|
-
...
|
|
306
|
-
|
|
307
|
-
def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', image_pull_secrets: typing.List[str] = [], 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[typing.Dict[str, 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', security_context: typing.Optional[typing.Dict[str, typing.Any]] = 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]]]:
|
|
308
|
-
"""
|
|
309
|
-
Specifies that this step should execute on Kubernetes.
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
Parameters
|
|
313
|
-
----------
|
|
314
|
-
cpu : int, default 1
|
|
315
|
-
Number of CPUs required for this step. If `@resources` is
|
|
316
|
-
also present, the maximum value from all decorators is used.
|
|
317
|
-
memory : int, default 4096
|
|
318
|
-
Memory size (in MB) required for this step. If
|
|
319
|
-
`@resources` is also present, the maximum value from all decorators is
|
|
320
|
-
used.
|
|
321
|
-
disk : int, default 10240
|
|
322
|
-
Disk size (in MB) required for this step. If
|
|
323
|
-
`@resources` is also present, the maximum value from all decorators is
|
|
324
|
-
used.
|
|
325
|
-
image : str, optional, default None
|
|
326
|
-
Docker image to use when launching on Kubernetes. If not specified, and
|
|
327
|
-
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
|
328
|
-
not, a default Docker image mapping to the current version of Python is used.
|
|
329
|
-
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
|
330
|
-
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
|
331
|
-
image_pull_secrets: List[str], default []
|
|
332
|
-
The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
|
|
333
|
-
Kubernetes image pull secrets to use when pulling container images
|
|
334
|
-
in Kubernetes.
|
|
335
|
-
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
|
336
|
-
Kubernetes service account to use when launching pod in Kubernetes.
|
|
337
|
-
secrets : List[str], optional, default None
|
|
338
|
-
Kubernetes secrets to use when launching pod in Kubernetes. These
|
|
339
|
-
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
|
340
|
-
in Metaflow configuration.
|
|
341
|
-
node_selector: Union[Dict[str,str], str], optional, default None
|
|
342
|
-
Kubernetes node selector(s) to apply to the pod running the task.
|
|
343
|
-
Can be passed in as a comma separated string of values e.g.
|
|
344
|
-
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
|
345
|
-
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
|
346
|
-
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
|
347
|
-
Kubernetes namespace to use when launching pod in Kubernetes.
|
|
348
|
-
gpu : int, optional, default None
|
|
349
|
-
Number of GPUs required for this step. A value of zero implies that
|
|
350
|
-
the scheduled node should not have GPUs.
|
|
351
|
-
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
|
352
|
-
The vendor of the GPUs to be used for this step.
|
|
353
|
-
tolerations : List[Dict[str,str]], default []
|
|
354
|
-
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
|
355
|
-
Kubernetes tolerations to use when launching pod in Kubernetes.
|
|
356
|
-
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
|
357
|
-
Kubernetes labels to use when launching pod in Kubernetes.
|
|
358
|
-
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
|
359
|
-
Kubernetes annotations to use when launching pod in Kubernetes.
|
|
360
|
-
use_tmpfs : bool, default False
|
|
361
|
-
This enables an explicit tmpfs mount for this step.
|
|
362
|
-
tmpfs_tempdir : bool, default True
|
|
363
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
|
364
|
-
tmpfs_size : int, optional, default: None
|
|
365
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
|
366
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
|
367
|
-
memory allocated for this step.
|
|
368
|
-
tmpfs_path : str, optional, default /metaflow_temp
|
|
369
|
-
Path to tmpfs mount for this step.
|
|
370
|
-
persistent_volume_claims : Dict[str, str], optional, default None
|
|
371
|
-
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
|
372
|
-
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
|
373
|
-
shared_memory: int, optional
|
|
374
|
-
Shared memory size (in MiB) required for this step
|
|
375
|
-
port: int, optional
|
|
376
|
-
Port number to specify in the Kubernetes job object
|
|
377
|
-
compute_pool : str, optional, default None
|
|
378
|
-
Compute pool to be used for for this step.
|
|
379
|
-
If not specified, any accessible compute pool within the perimeter is used.
|
|
380
|
-
hostname_resolution_timeout: int, default 10 * 60
|
|
381
|
-
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
|
382
|
-
Only applicable when @parallel is used.
|
|
383
|
-
qos: str, default: Burstable
|
|
384
|
-
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
|
385
|
-
|
|
386
|
-
security_context: Dict[str, Any], optional, default None
|
|
387
|
-
Container security context. Applies to the task container. Allows the following keys:
|
|
388
|
-
- privileged: bool, optional, default None
|
|
389
|
-
- allow_privilege_escalation: bool, optional, default None
|
|
390
|
-
- run_as_user: int, optional, default None
|
|
391
|
-
- run_as_group: int, optional, default None
|
|
392
|
-
- run_as_non_root: bool, optional, default None
|
|
393
|
-
"""
|
|
394
|
-
...
|
|
395
|
-
|
|
396
372
|
@typing.overload
|
|
397
373
|
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]]]:
|
|
398
374
|
"""
|
|
@@ -473,210 +449,116 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
|
473
449
|
...
|
|
474
450
|
|
|
475
451
|
@typing.overload
|
|
476
|
-
def
|
|
452
|
+
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]]]:
|
|
477
453
|
"""
|
|
478
|
-
Specifies
|
|
454
|
+
Specifies the Conda environment for the step.
|
|
479
455
|
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
|
485
|
-
|
|
486
|
-
Note that all the values specified in parameters are added together so if you specify
|
|
487
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
|
456
|
+
Information in this decorator will augment any
|
|
457
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
|
458
|
+
you can use `@conda_base` to set packages required by all
|
|
459
|
+
steps and use `@conda` to specify step-specific overrides.
|
|
488
460
|
|
|
489
461
|
|
|
490
462
|
Parameters
|
|
491
463
|
----------
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
464
|
+
packages : Dict[str, str], default {}
|
|
465
|
+
Packages to use for this step. The key is the name of the package
|
|
466
|
+
and the value is the version to use.
|
|
467
|
+
libraries : Dict[str, str], default {}
|
|
468
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
469
|
+
python : str, optional, default None
|
|
470
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
471
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
472
|
+
disabled : bool, default False
|
|
473
|
+
If set to True, disables @conda.
|
|
498
474
|
"""
|
|
499
475
|
...
|
|
500
476
|
|
|
501
477
|
@typing.overload
|
|
502
|
-
def
|
|
478
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
503
479
|
...
|
|
504
480
|
|
|
505
481
|
@typing.overload
|
|
506
|
-
def
|
|
482
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
507
483
|
...
|
|
508
484
|
|
|
509
|
-
def
|
|
485
|
+
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):
|
|
510
486
|
"""
|
|
511
|
-
Specifies
|
|
512
|
-
|
|
513
|
-
This decorator is useful if this step may hang indefinitely.
|
|
514
|
-
|
|
515
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
|
516
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
|
517
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
|
487
|
+
Specifies the Conda environment for the step.
|
|
518
488
|
|
|
519
|
-
|
|
520
|
-
|
|
489
|
+
Information in this decorator will augment any
|
|
490
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
|
491
|
+
you can use `@conda_base` to set packages required by all
|
|
492
|
+
steps and use `@conda` to specify step-specific overrides.
|
|
521
493
|
|
|
522
494
|
|
|
523
495
|
Parameters
|
|
524
496
|
----------
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
497
|
+
packages : Dict[str, str], default {}
|
|
498
|
+
Packages to use for this step. The key is the name of the package
|
|
499
|
+
and the value is the version to use.
|
|
500
|
+
libraries : Dict[str, str], default {}
|
|
501
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
502
|
+
python : str, optional, default None
|
|
503
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
504
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
505
|
+
disabled : bool, default False
|
|
506
|
+
If set to True, disables @conda.
|
|
531
507
|
"""
|
|
532
508
|
...
|
|
533
509
|
|
|
534
510
|
@typing.overload
|
|
535
|
-
def
|
|
511
|
+
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]]]:
|
|
536
512
|
"""
|
|
537
|
-
Specifies
|
|
513
|
+
Specifies the number of times the task corresponding
|
|
514
|
+
to a step needs to be retried.
|
|
515
|
+
|
|
516
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
|
517
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
|
518
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
|
519
|
+
|
|
520
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
|
521
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
|
522
|
+
ensuring that the flow execution can continue.
|
|
538
523
|
|
|
539
524
|
|
|
540
525
|
Parameters
|
|
541
526
|
----------
|
|
542
|
-
|
|
543
|
-
Number of
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
Number of GPUs required for this step. If `@resources` is
|
|
547
|
-
also present, the maximum value from all decorators is used.
|
|
548
|
-
memory : int, default 4096
|
|
549
|
-
Memory size (in MB) required for this step. If
|
|
550
|
-
`@resources` is also present, the maximum value from all decorators is
|
|
551
|
-
used.
|
|
552
|
-
image : str, optional, default None
|
|
553
|
-
Docker image to use when launching on AWS Batch. If not specified, and
|
|
554
|
-
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
|
555
|
-
not, a default Docker image mapping to the current version of Python is used.
|
|
556
|
-
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
|
557
|
-
AWS Batch Job Queue to submit the job to.
|
|
558
|
-
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
|
559
|
-
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
|
560
|
-
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
|
561
|
-
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
|
562
|
-
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
|
563
|
-
shared_memory : int, optional, default None
|
|
564
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
|
565
|
-
This parameter maps to the `--shm-size` option in Docker.
|
|
566
|
-
max_swap : int, optional, default None
|
|
567
|
-
The total amount of swap memory (in MiB) a container can use for this
|
|
568
|
-
step. This parameter is translated to the `--memory-swap` option in
|
|
569
|
-
Docker where the value is the sum of the container memory plus the
|
|
570
|
-
`max_swap` value.
|
|
571
|
-
swappiness : int, optional, default None
|
|
572
|
-
This allows you to tune memory swappiness behavior for this step.
|
|
573
|
-
A swappiness value of 0 causes swapping not to happen unless absolutely
|
|
574
|
-
necessary. A swappiness value of 100 causes pages to be swapped very
|
|
575
|
-
aggressively. Accepted values are whole numbers between 0 and 100.
|
|
576
|
-
use_tmpfs : bool, default False
|
|
577
|
-
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
|
578
|
-
not available on Fargate compute environments
|
|
579
|
-
tmpfs_tempdir : bool, default True
|
|
580
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
|
581
|
-
tmpfs_size : int, optional, default None
|
|
582
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
|
583
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
|
584
|
-
memory allocated for this step.
|
|
585
|
-
tmpfs_path : str, optional, default None
|
|
586
|
-
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
|
587
|
-
inferentia : int, default 0
|
|
588
|
-
Number of Inferentia chips required for this step.
|
|
589
|
-
trainium : int, default None
|
|
590
|
-
Alias for inferentia. Use only one of the two.
|
|
591
|
-
efa : int, default 0
|
|
592
|
-
Number of elastic fabric adapter network devices to attach to container
|
|
593
|
-
ephemeral_storage : int, default None
|
|
594
|
-
The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
|
|
595
|
-
This is only relevant for Fargate compute environments
|
|
596
|
-
log_driver: str, optional, default None
|
|
597
|
-
The log driver to use for the Amazon ECS container.
|
|
598
|
-
log_options: List[str], optional, default None
|
|
599
|
-
List of strings containing options for the chosen log driver. The configurable values
|
|
600
|
-
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
|
601
|
-
Example: [`awslogs-group:aws/batch/job`]
|
|
527
|
+
times : int, default 3
|
|
528
|
+
Number of times to retry this task.
|
|
529
|
+
minutes_between_retries : int, default 2
|
|
530
|
+
Number of minutes between retries.
|
|
602
531
|
"""
|
|
603
532
|
...
|
|
604
533
|
|
|
605
534
|
@typing.overload
|
|
606
|
-
def
|
|
535
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
607
536
|
...
|
|
608
537
|
|
|
609
538
|
@typing.overload
|
|
610
|
-
def
|
|
539
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
611
540
|
...
|
|
612
541
|
|
|
613
|
-
def
|
|
542
|
+
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):
|
|
614
543
|
"""
|
|
615
|
-
Specifies
|
|
544
|
+
Specifies the number of times the task corresponding
|
|
545
|
+
to a step needs to be retried.
|
|
546
|
+
|
|
547
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
|
548
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
|
549
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
|
550
|
+
|
|
551
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
|
552
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
|
553
|
+
ensuring that the flow execution can continue.
|
|
616
554
|
|
|
617
555
|
|
|
618
556
|
Parameters
|
|
619
557
|
----------
|
|
620
|
-
|
|
621
|
-
Number of
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
Number of GPUs required for this step. If `@resources` is
|
|
625
|
-
also present, the maximum value from all decorators is used.
|
|
626
|
-
memory : int, default 4096
|
|
627
|
-
Memory size (in MB) required for this step. If
|
|
628
|
-
`@resources` is also present, the maximum value from all decorators is
|
|
629
|
-
used.
|
|
630
|
-
image : str, optional, default None
|
|
631
|
-
Docker image to use when launching on AWS Batch. If not specified, and
|
|
632
|
-
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
|
633
|
-
not, a default Docker image mapping to the current version of Python is used.
|
|
634
|
-
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
|
635
|
-
AWS Batch Job Queue to submit the job to.
|
|
636
|
-
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
|
637
|
-
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
|
638
|
-
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
|
639
|
-
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
|
640
|
-
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
|
641
|
-
shared_memory : int, optional, default None
|
|
642
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
|
643
|
-
This parameter maps to the `--shm-size` option in Docker.
|
|
644
|
-
max_swap : int, optional, default None
|
|
645
|
-
The total amount of swap memory (in MiB) a container can use for this
|
|
646
|
-
step. This parameter is translated to the `--memory-swap` option in
|
|
647
|
-
Docker where the value is the sum of the container memory plus the
|
|
648
|
-
`max_swap` value.
|
|
649
|
-
swappiness : int, optional, default None
|
|
650
|
-
This allows you to tune memory swappiness behavior for this step.
|
|
651
|
-
A swappiness value of 0 causes swapping not to happen unless absolutely
|
|
652
|
-
necessary. A swappiness value of 100 causes pages to be swapped very
|
|
653
|
-
aggressively. Accepted values are whole numbers between 0 and 100.
|
|
654
|
-
use_tmpfs : bool, default False
|
|
655
|
-
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
|
656
|
-
not available on Fargate compute environments
|
|
657
|
-
tmpfs_tempdir : bool, default True
|
|
658
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
|
659
|
-
tmpfs_size : int, optional, default None
|
|
660
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
|
661
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
|
662
|
-
memory allocated for this step.
|
|
663
|
-
tmpfs_path : str, optional, default None
|
|
664
|
-
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
|
665
|
-
inferentia : int, default 0
|
|
666
|
-
Number of Inferentia chips required for this step.
|
|
667
|
-
trainium : int, default None
|
|
668
|
-
Alias for inferentia. Use only one of the two.
|
|
669
|
-
efa : int, default 0
|
|
670
|
-
Number of elastic fabric adapter network devices to attach to container
|
|
671
|
-
ephemeral_storage : int, default None
|
|
672
|
-
The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
|
|
673
|
-
This is only relevant for Fargate compute environments
|
|
674
|
-
log_driver: str, optional, default None
|
|
675
|
-
The log driver to use for the Amazon ECS container.
|
|
676
|
-
log_options: List[str], optional, default None
|
|
677
|
-
List of strings containing options for the chosen log driver. The configurable values
|
|
678
|
-
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
|
679
|
-
Example: [`awslogs-group:aws/batch/job`]
|
|
558
|
+
times : int, default 3
|
|
559
|
+
Number of times to retry this task.
|
|
560
|
+
minutes_between_retries : int, default 2
|
|
561
|
+
Number of minutes between retries.
|
|
680
562
|
"""
|
|
681
563
|
...
|
|
682
564
|
|
|
@@ -732,300 +614,273 @@ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
|
|
|
732
614
|
...
|
|
733
615
|
|
|
734
616
|
@typing.overload
|
|
735
|
-
def
|
|
617
|
+
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]]]:
|
|
736
618
|
"""
|
|
737
|
-
Specifies
|
|
738
|
-
the execution of a step.
|
|
619
|
+
Specifies environment variables to be set prior to the execution of a step.
|
|
739
620
|
|
|
740
621
|
|
|
741
622
|
Parameters
|
|
742
623
|
----------
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
role : str, optional, default: None
|
|
746
|
-
Role to use for fetching secrets
|
|
624
|
+
vars : Dict[str, str], default {}
|
|
625
|
+
Dictionary of environment variables to set.
|
|
747
626
|
"""
|
|
748
627
|
...
|
|
749
628
|
|
|
750
629
|
@typing.overload
|
|
751
|
-
def
|
|
630
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
752
631
|
...
|
|
753
632
|
|
|
754
633
|
@typing.overload
|
|
755
|
-
def
|
|
634
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
756
635
|
...
|
|
757
636
|
|
|
758
|
-
def
|
|
637
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
|
759
638
|
"""
|
|
760
|
-
Specifies
|
|
761
|
-
the execution of a step.
|
|
639
|
+
Specifies environment variables to be set prior to the execution of a step.
|
|
762
640
|
|
|
763
641
|
|
|
764
642
|
Parameters
|
|
765
643
|
----------
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
role : str, optional, default: None
|
|
769
|
-
Role to use for fetching secrets
|
|
644
|
+
vars : Dict[str, str], default {}
|
|
645
|
+
Dictionary of environment variables to set.
|
|
770
646
|
"""
|
|
771
647
|
...
|
|
772
648
|
|
|
773
|
-
|
|
774
|
-
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]]]:
|
|
649
|
+
def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', image_pull_secrets: typing.List[str] = [], 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[typing.Dict[str, 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', security_context: typing.Optional[typing.Dict[str, typing.Any]] = 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]]]:
|
|
775
650
|
"""
|
|
776
|
-
Specifies
|
|
777
|
-
to a step needs to be retried.
|
|
778
|
-
|
|
779
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
|
780
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
|
781
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
|
782
|
-
|
|
783
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
|
784
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
|
785
|
-
ensuring that the flow execution can continue.
|
|
651
|
+
Specifies that this step should execute on Kubernetes.
|
|
786
652
|
|
|
787
653
|
|
|
788
654
|
Parameters
|
|
789
655
|
----------
|
|
790
|
-
|
|
791
|
-
Number of
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
@
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
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):
|
|
863
|
-
"""
|
|
864
|
-
Specifies the Conda environment for the step.
|
|
865
|
-
|
|
866
|
-
Information in this decorator will augment any
|
|
867
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
|
868
|
-
you can use `@conda_base` to set packages required by all
|
|
869
|
-
steps and use `@conda` to specify step-specific overrides.
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
Parameters
|
|
873
|
-
----------
|
|
874
|
-
packages : Dict[str, str], default {}
|
|
875
|
-
Packages to use for this step. The key is the name of the package
|
|
876
|
-
and the value is the version to use.
|
|
877
|
-
libraries : Dict[str, str], default {}
|
|
878
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
879
|
-
python : str, optional, default None
|
|
880
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
881
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
882
|
-
disabled : bool, default False
|
|
883
|
-
If set to True, disables @conda.
|
|
884
|
-
"""
|
|
885
|
-
...
|
|
886
|
-
|
|
887
|
-
@typing.overload
|
|
888
|
-
def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
889
|
-
"""
|
|
890
|
-
Specifies the Conda environment for all steps of the flow.
|
|
891
|
-
|
|
892
|
-
Use `@conda_base` to set common libraries required by all
|
|
893
|
-
steps and use `@conda` to specify step-specific additions.
|
|
894
|
-
|
|
656
|
+
cpu : int, default 1
|
|
657
|
+
Number of CPUs required for this step. If `@resources` is
|
|
658
|
+
also present, the maximum value from all decorators is used.
|
|
659
|
+
memory : int, default 4096
|
|
660
|
+
Memory size (in MB) required for this step. If
|
|
661
|
+
`@resources` is also present, the maximum value from all decorators is
|
|
662
|
+
used.
|
|
663
|
+
disk : int, default 10240
|
|
664
|
+
Disk size (in MB) required for this step. If
|
|
665
|
+
`@resources` is also present, the maximum value from all decorators is
|
|
666
|
+
used.
|
|
667
|
+
image : str, optional, default None
|
|
668
|
+
Docker image to use when launching on Kubernetes. If not specified, and
|
|
669
|
+
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
|
670
|
+
not, a default Docker image mapping to the current version of Python is used.
|
|
671
|
+
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
|
672
|
+
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
|
673
|
+
image_pull_secrets: List[str], default []
|
|
674
|
+
The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
|
|
675
|
+
Kubernetes image pull secrets to use when pulling container images
|
|
676
|
+
in Kubernetes.
|
|
677
|
+
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
|
678
|
+
Kubernetes service account to use when launching pod in Kubernetes.
|
|
679
|
+
secrets : List[str], optional, default None
|
|
680
|
+
Kubernetes secrets to use when launching pod in Kubernetes. These
|
|
681
|
+
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
|
682
|
+
in Metaflow configuration.
|
|
683
|
+
node_selector: Union[Dict[str,str], str], optional, default None
|
|
684
|
+
Kubernetes node selector(s) to apply to the pod running the task.
|
|
685
|
+
Can be passed in as a comma separated string of values e.g.
|
|
686
|
+
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
|
687
|
+
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
|
688
|
+
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
|
689
|
+
Kubernetes namespace to use when launching pod in Kubernetes.
|
|
690
|
+
gpu : int, optional, default None
|
|
691
|
+
Number of GPUs required for this step. A value of zero implies that
|
|
692
|
+
the scheduled node should not have GPUs.
|
|
693
|
+
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
|
694
|
+
The vendor of the GPUs to be used for this step.
|
|
695
|
+
tolerations : List[Dict[str,str]], default []
|
|
696
|
+
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
|
697
|
+
Kubernetes tolerations to use when launching pod in Kubernetes.
|
|
698
|
+
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
|
699
|
+
Kubernetes labels to use when launching pod in Kubernetes.
|
|
700
|
+
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
|
701
|
+
Kubernetes annotations to use when launching pod in Kubernetes.
|
|
702
|
+
use_tmpfs : bool, default False
|
|
703
|
+
This enables an explicit tmpfs mount for this step.
|
|
704
|
+
tmpfs_tempdir : bool, default True
|
|
705
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
|
706
|
+
tmpfs_size : int, optional, default: None
|
|
707
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
|
708
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
|
709
|
+
memory allocated for this step.
|
|
710
|
+
tmpfs_path : str, optional, default /metaflow_temp
|
|
711
|
+
Path to tmpfs mount for this step.
|
|
712
|
+
persistent_volume_claims : Dict[str, str], optional, default None
|
|
713
|
+
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
|
714
|
+
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
|
715
|
+
shared_memory: int, optional
|
|
716
|
+
Shared memory size (in MiB) required for this step
|
|
717
|
+
port: int, optional
|
|
718
|
+
Port number to specify in the Kubernetes job object
|
|
719
|
+
compute_pool : str, optional, default None
|
|
720
|
+
Compute pool to be used for for this step.
|
|
721
|
+
If not specified, any accessible compute pool within the perimeter is used.
|
|
722
|
+
hostname_resolution_timeout: int, default 10 * 60
|
|
723
|
+
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
|
724
|
+
Only applicable when @parallel is used.
|
|
725
|
+
qos: str, default: Burstable
|
|
726
|
+
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
|
895
727
|
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
python : str, optional, default None
|
|
904
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
905
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
906
|
-
disabled : bool, default False
|
|
907
|
-
If set to True, disables Conda.
|
|
728
|
+
security_context: Dict[str, Any], optional, default None
|
|
729
|
+
Container security context. Applies to the task container. Allows the following keys:
|
|
730
|
+
- privileged: bool, optional, default None
|
|
731
|
+
- allow_privilege_escalation: bool, optional, default None
|
|
732
|
+
- run_as_user: int, optional, default None
|
|
733
|
+
- run_as_group: int, optional, default None
|
|
734
|
+
- run_as_non_root: bool, optional, default None
|
|
908
735
|
"""
|
|
909
736
|
...
|
|
910
737
|
|
|
911
738
|
@typing.overload
|
|
912
|
-
def
|
|
913
|
-
...
|
|
914
|
-
|
|
915
|
-
def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
|
739
|
+
def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = 'METAFLOW_BATCH_JOB_QUEUE', iam_role: str = 'METAFLOW_ECS_S3_ACCESS_IAM_ROLE', execution_role: str = 'METAFLOW_ECS_FARGATE_EXECUTION_ROLE', shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[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]]]:
|
|
916
740
|
"""
|
|
917
|
-
Specifies
|
|
918
|
-
|
|
919
|
-
Use `@conda_base` to set common libraries required by all
|
|
920
|
-
steps and use `@conda` to specify step-specific additions.
|
|
741
|
+
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
|
921
742
|
|
|
922
743
|
|
|
923
744
|
Parameters
|
|
924
745
|
----------
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
746
|
+
cpu : int, default 1
|
|
747
|
+
Number of CPUs required for this step. If `@resources` is
|
|
748
|
+
also present, the maximum value from all decorators is used.
|
|
749
|
+
gpu : int, default 0
|
|
750
|
+
Number of GPUs required for this step. If `@resources` is
|
|
751
|
+
also present, the maximum value from all decorators is used.
|
|
752
|
+
memory : int, default 4096
|
|
753
|
+
Memory size (in MB) required for this step. If
|
|
754
|
+
`@resources` is also present, the maximum value from all decorators is
|
|
755
|
+
used.
|
|
756
|
+
image : str, optional, default None
|
|
757
|
+
Docker image to use when launching on AWS Batch. If not specified, and
|
|
758
|
+
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
|
759
|
+
not, a default Docker image mapping to the current version of Python is used.
|
|
760
|
+
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
|
761
|
+
AWS Batch Job Queue to submit the job to.
|
|
762
|
+
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
|
763
|
+
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
|
764
|
+
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
|
765
|
+
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
|
766
|
+
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
|
767
|
+
shared_memory : int, optional, default None
|
|
768
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
|
769
|
+
This parameter maps to the `--shm-size` option in Docker.
|
|
770
|
+
max_swap : int, optional, default None
|
|
771
|
+
The total amount of swap memory (in MiB) a container can use for this
|
|
772
|
+
step. This parameter is translated to the `--memory-swap` option in
|
|
773
|
+
Docker where the value is the sum of the container memory plus the
|
|
774
|
+
`max_swap` value.
|
|
775
|
+
swappiness : int, optional, default None
|
|
776
|
+
This allows you to tune memory swappiness behavior for this step.
|
|
777
|
+
A swappiness value of 0 causes swapping not to happen unless absolutely
|
|
778
|
+
necessary. A swappiness value of 100 causes pages to be swapped very
|
|
779
|
+
aggressively. Accepted values are whole numbers between 0 and 100.
|
|
780
|
+
use_tmpfs : bool, default False
|
|
781
|
+
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
|
782
|
+
not available on Fargate compute environments
|
|
783
|
+
tmpfs_tempdir : bool, default True
|
|
784
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
|
785
|
+
tmpfs_size : int, optional, default None
|
|
786
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
|
787
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
|
788
|
+
memory allocated for this step.
|
|
789
|
+
tmpfs_path : str, optional, default None
|
|
790
|
+
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
|
791
|
+
inferentia : int, default 0
|
|
792
|
+
Number of Inferentia chips required for this step.
|
|
793
|
+
trainium : int, default None
|
|
794
|
+
Alias for inferentia. Use only one of the two.
|
|
795
|
+
efa : int, default 0
|
|
796
|
+
Number of elastic fabric adapter network devices to attach to container
|
|
797
|
+
ephemeral_storage : int, default None
|
|
798
|
+
The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
|
|
799
|
+
This is only relevant for Fargate compute environments
|
|
800
|
+
log_driver: str, optional, default None
|
|
801
|
+
The log driver to use for the Amazon ECS container.
|
|
802
|
+
log_options: List[str], optional, default None
|
|
803
|
+
List of strings containing options for the chosen log driver. The configurable values
|
|
804
|
+
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
|
805
|
+
Example: [`awslogs-group:aws/batch/job`]
|
|
935
806
|
"""
|
|
936
807
|
...
|
|
937
808
|
|
|
938
809
|
@typing.overload
|
|
939
|
-
def
|
|
940
|
-
"""
|
|
941
|
-
Specifies the times when the flow should be run when running on a
|
|
942
|
-
production scheduler.
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
Parameters
|
|
946
|
-
----------
|
|
947
|
-
hourly : bool, default False
|
|
948
|
-
Run the workflow hourly.
|
|
949
|
-
daily : bool, default True
|
|
950
|
-
Run the workflow daily.
|
|
951
|
-
weekly : bool, default False
|
|
952
|
-
Run the workflow weekly.
|
|
953
|
-
cron : str, optional, default None
|
|
954
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
|
955
|
-
specified by this expression.
|
|
956
|
-
timezone : str, optional, default None
|
|
957
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
|
958
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
|
959
|
-
"""
|
|
810
|
+
def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
960
811
|
...
|
|
961
812
|
|
|
962
813
|
@typing.overload
|
|
963
|
-
def
|
|
964
|
-
...
|
|
965
|
-
|
|
966
|
-
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):
|
|
967
|
-
"""
|
|
968
|
-
Specifies the times when the flow should be run when running on a
|
|
969
|
-
production scheduler.
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
Parameters
|
|
973
|
-
----------
|
|
974
|
-
hourly : bool, default False
|
|
975
|
-
Run the workflow hourly.
|
|
976
|
-
daily : bool, default True
|
|
977
|
-
Run the workflow daily.
|
|
978
|
-
weekly : bool, default False
|
|
979
|
-
Run the workflow weekly.
|
|
980
|
-
cron : str, optional, default None
|
|
981
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
|
982
|
-
specified by this expression.
|
|
983
|
-
timezone : str, optional, default None
|
|
984
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
|
985
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
|
986
|
-
"""
|
|
814
|
+
def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
987
815
|
...
|
|
988
816
|
|
|
989
|
-
def
|
|
817
|
+
def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = 'METAFLOW_BATCH_JOB_QUEUE', iam_role: str = 'METAFLOW_ECS_S3_ACCESS_IAM_ROLE', execution_role: str = 'METAFLOW_ECS_FARGATE_EXECUTION_ROLE', shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[str]] = None):
|
|
990
818
|
"""
|
|
991
|
-
|
|
992
|
-
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.
|
|
819
|
+
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
|
993
820
|
|
|
994
821
|
|
|
995
822
|
Parameters
|
|
996
823
|
----------
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
824
|
+
cpu : int, default 1
|
|
825
|
+
Number of CPUs required for this step. If `@resources` is
|
|
826
|
+
also present, the maximum value from all decorators is used.
|
|
827
|
+
gpu : int, default 0
|
|
828
|
+
Number of GPUs required for this step. If `@resources` is
|
|
829
|
+
also present, the maximum value from all decorators is used.
|
|
830
|
+
memory : int, default 4096
|
|
831
|
+
Memory size (in MB) required for this step. If
|
|
832
|
+
`@resources` is also present, the maximum value from all decorators is
|
|
833
|
+
used.
|
|
834
|
+
image : str, optional, default None
|
|
835
|
+
Docker image to use when launching on AWS Batch. If not specified, and
|
|
836
|
+
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
|
837
|
+
not, a default Docker image mapping to the current version of Python is used.
|
|
838
|
+
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
|
839
|
+
AWS Batch Job Queue to submit the job to.
|
|
840
|
+
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
|
841
|
+
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
|
842
|
+
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
|
843
|
+
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
|
844
|
+
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
|
845
|
+
shared_memory : int, optional, default None
|
|
846
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
|
847
|
+
This parameter maps to the `--shm-size` option in Docker.
|
|
848
|
+
max_swap : int, optional, default None
|
|
849
|
+
The total amount of swap memory (in MiB) a container can use for this
|
|
850
|
+
step. This parameter is translated to the `--memory-swap` option in
|
|
851
|
+
Docker where the value is the sum of the container memory plus the
|
|
852
|
+
`max_swap` value.
|
|
853
|
+
swappiness : int, optional, default None
|
|
854
|
+
This allows you to tune memory swappiness behavior for this step.
|
|
855
|
+
A swappiness value of 0 causes swapping not to happen unless absolutely
|
|
856
|
+
necessary. A swappiness value of 100 causes pages to be swapped very
|
|
857
|
+
aggressively. Accepted values are whole numbers between 0 and 100.
|
|
858
|
+
use_tmpfs : bool, default False
|
|
859
|
+
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
|
860
|
+
not available on Fargate compute environments
|
|
861
|
+
tmpfs_tempdir : bool, default True
|
|
862
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
|
863
|
+
tmpfs_size : int, optional, default None
|
|
864
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
|
865
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
|
866
|
+
memory allocated for this step.
|
|
867
|
+
tmpfs_path : str, optional, default None
|
|
868
|
+
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
|
869
|
+
inferentia : int, default 0
|
|
870
|
+
Number of Inferentia chips required for this step.
|
|
871
|
+
trainium : int, default None
|
|
872
|
+
Alias for inferentia. Use only one of the two.
|
|
873
|
+
efa : int, default 0
|
|
874
|
+
Number of elastic fabric adapter network devices to attach to container
|
|
875
|
+
ephemeral_storage : int, default None
|
|
876
|
+
The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
|
|
877
|
+
This is only relevant for Fargate compute environments
|
|
878
|
+
log_driver: str, optional, default None
|
|
879
|
+
The log driver to use for the Amazon ECS container.
|
|
880
|
+
log_options: List[str], optional, default None
|
|
881
|
+
List of strings containing options for the chosen log driver. The configurable values
|
|
882
|
+
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
|
883
|
+
Example: [`awslogs-group:aws/batch/job`]
|
|
1029
884
|
"""
|
|
1030
885
|
...
|
|
1031
886
|
|
|
@@ -1122,6 +977,41 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
|
1122
977
|
"""
|
|
1123
978
|
...
|
|
1124
979
|
|
|
980
|
+
def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
981
|
+
"""
|
|
982
|
+
Specifies what flows belong to the same project.
|
|
983
|
+
|
|
984
|
+
A project-specific namespace is created for all flows that
|
|
985
|
+
use the same `@project(name)`.
|
|
986
|
+
|
|
987
|
+
|
|
988
|
+
Parameters
|
|
989
|
+
----------
|
|
990
|
+
name : str
|
|
991
|
+
Project name. Make sure that the name is unique amongst all
|
|
992
|
+
projects that use the same production scheduler. The name may
|
|
993
|
+
contain only lowercase alphanumeric characters and underscores.
|
|
994
|
+
|
|
995
|
+
branch : Optional[str], default None
|
|
996
|
+
The branch to use. If not specified, the branch is set to
|
|
997
|
+
`user.<username>` unless `production` is set to `True`. This can
|
|
998
|
+
also be set on the command line using `--branch` as a top-level option.
|
|
999
|
+
It is an error to specify `branch` in the decorator and on the command line.
|
|
1000
|
+
|
|
1001
|
+
production : bool, default False
|
|
1002
|
+
Whether or not the branch is the production branch. This can also be set on the
|
|
1003
|
+
command line using `--production` as a top-level option. It is an error to specify
|
|
1004
|
+
`production` in the decorator and on the command line.
|
|
1005
|
+
The project branch name will be:
|
|
1006
|
+
- if `branch` is specified:
|
|
1007
|
+
- if `production` is True: `prod.<branch>`
|
|
1008
|
+
- if `production` is False: `test.<branch>`
|
|
1009
|
+
- if `branch` is not specified:
|
|
1010
|
+
- if `production` is True: `prod`
|
|
1011
|
+
- if `production` is False: `user.<username>`
|
|
1012
|
+
"""
|
|
1013
|
+
...
|
|
1014
|
+
|
|
1125
1015
|
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]]:
|
|
1126
1016
|
"""
|
|
1127
1017
|
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)
|
|
@@ -1165,38 +1055,87 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
|
|
|
1165
1055
|
"""
|
|
1166
1056
|
...
|
|
1167
1057
|
|
|
1168
|
-
|
|
1058
|
+
@typing.overload
|
|
1059
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
1169
1060
|
"""
|
|
1170
|
-
Specifies
|
|
1061
|
+
Specifies the PyPI packages for all steps of the flow.
|
|
1171
1062
|
|
|
1172
|
-
|
|
1173
|
-
use
|
|
1063
|
+
Use `@pypi_base` to set common packages required by all
|
|
1064
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
1065
|
+
|
|
1066
|
+
Parameters
|
|
1067
|
+
----------
|
|
1068
|
+
packages : Dict[str, str], default: {}
|
|
1069
|
+
Packages to use for this flow. The key is the name of the package
|
|
1070
|
+
and the value is the version to use.
|
|
1071
|
+
python : str, optional, default: None
|
|
1072
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1073
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1074
|
+
"""
|
|
1075
|
+
...
|
|
1076
|
+
|
|
1077
|
+
@typing.overload
|
|
1078
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1079
|
+
...
|
|
1080
|
+
|
|
1081
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
|
1082
|
+
"""
|
|
1083
|
+
Specifies the PyPI packages for all steps of the flow.
|
|
1174
1084
|
|
|
1085
|
+
Use `@pypi_base` to set common packages required by all
|
|
1086
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
1175
1087
|
|
|
1176
1088
|
Parameters
|
|
1177
1089
|
----------
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1090
|
+
packages : Dict[str, str], default: {}
|
|
1091
|
+
Packages to use for this flow. The key is the name of the package
|
|
1092
|
+
and the value is the version to use.
|
|
1093
|
+
python : str, optional, default: None
|
|
1094
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1095
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1096
|
+
"""
|
|
1097
|
+
...
|
|
1098
|
+
|
|
1099
|
+
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]]:
|
|
1100
|
+
"""
|
|
1101
|
+
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.
|
|
1102
|
+
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.
|
|
1182
1103
|
|
|
1183
|
-
branch : Optional[str], default None
|
|
1184
|
-
The branch to use. If not specified, the branch is set to
|
|
1185
|
-
`user.<username>` unless `production` is set to `True`. This can
|
|
1186
|
-
also be set on the command line using `--branch` as a top-level option.
|
|
1187
|
-
It is an error to specify `branch` in the decorator and on the command line.
|
|
1188
1104
|
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1105
|
+
Parameters
|
|
1106
|
+
----------
|
|
1107
|
+
timeout : int
|
|
1108
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
|
1109
|
+
poke_interval : int
|
|
1110
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
|
1111
|
+
mode : str
|
|
1112
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
|
1113
|
+
exponential_backoff : bool
|
|
1114
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
|
1115
|
+
pool : str
|
|
1116
|
+
the slot pool this task should run in,
|
|
1117
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
|
1118
|
+
soft_fail : bool
|
|
1119
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
|
1120
|
+
name : str
|
|
1121
|
+
Name of the sensor on Airflow
|
|
1122
|
+
description : str
|
|
1123
|
+
Description of sensor in the Airflow UI
|
|
1124
|
+
external_dag_id : str
|
|
1125
|
+
The dag_id that contains the task you want to wait for.
|
|
1126
|
+
external_task_ids : List[str]
|
|
1127
|
+
The list of task_ids that you want to wait for.
|
|
1128
|
+
If None (default value) the sensor waits for the DAG. (Default: None)
|
|
1129
|
+
allowed_states : List[str]
|
|
1130
|
+
Iterable of allowed states, (Default: ['success'])
|
|
1131
|
+
failed_states : List[str]
|
|
1132
|
+
Iterable of failed or dis-allowed states. (Default: None)
|
|
1133
|
+
execution_delta : datetime.timedelta
|
|
1134
|
+
time difference with the previous execution to look at,
|
|
1135
|
+
the default is the same logical date as the current task or DAG. (Default: None)
|
|
1136
|
+
check_existence: bool
|
|
1137
|
+
Set to True to check if the external task exists or check if
|
|
1138
|
+
the DAG to wait for exists. (Default: True)
|
|
1200
1139
|
"""
|
|
1201
1140
|
...
|
|
1202
1141
|
|
|
@@ -1302,43 +1241,104 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
|
1302
1241
|
...
|
|
1303
1242
|
|
|
1304
1243
|
@typing.overload
|
|
1305
|
-
def
|
|
1244
|
+
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]]:
|
|
1306
1245
|
"""
|
|
1307
|
-
Specifies the
|
|
1246
|
+
Specifies the times when the flow should be run when running on a
|
|
1247
|
+
production scheduler.
|
|
1308
1248
|
|
|
1309
|
-
Use `@pypi_base` to set common packages required by all
|
|
1310
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
1311
1249
|
|
|
1312
1250
|
Parameters
|
|
1313
1251
|
----------
|
|
1314
|
-
|
|
1252
|
+
hourly : bool, default False
|
|
1253
|
+
Run the workflow hourly.
|
|
1254
|
+
daily : bool, default True
|
|
1255
|
+
Run the workflow daily.
|
|
1256
|
+
weekly : bool, default False
|
|
1257
|
+
Run the workflow weekly.
|
|
1258
|
+
cron : str, optional, default None
|
|
1259
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
|
1260
|
+
specified by this expression.
|
|
1261
|
+
timezone : str, optional, default None
|
|
1262
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
|
1263
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
|
1264
|
+
"""
|
|
1265
|
+
...
|
|
1266
|
+
|
|
1267
|
+
@typing.overload
|
|
1268
|
+
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1269
|
+
...
|
|
1270
|
+
|
|
1271
|
+
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):
|
|
1272
|
+
"""
|
|
1273
|
+
Specifies the times when the flow should be run when running on a
|
|
1274
|
+
production scheduler.
|
|
1275
|
+
|
|
1276
|
+
|
|
1277
|
+
Parameters
|
|
1278
|
+
----------
|
|
1279
|
+
hourly : bool, default False
|
|
1280
|
+
Run the workflow hourly.
|
|
1281
|
+
daily : bool, default True
|
|
1282
|
+
Run the workflow daily.
|
|
1283
|
+
weekly : bool, default False
|
|
1284
|
+
Run the workflow weekly.
|
|
1285
|
+
cron : str, optional, default None
|
|
1286
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
|
1287
|
+
specified by this expression.
|
|
1288
|
+
timezone : str, optional, default None
|
|
1289
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
|
1290
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
|
1291
|
+
"""
|
|
1292
|
+
...
|
|
1293
|
+
|
|
1294
|
+
@typing.overload
|
|
1295
|
+
def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
1296
|
+
"""
|
|
1297
|
+
Specifies the Conda environment for all steps of the flow.
|
|
1298
|
+
|
|
1299
|
+
Use `@conda_base` to set common libraries required by all
|
|
1300
|
+
steps and use `@conda` to specify step-specific additions.
|
|
1301
|
+
|
|
1302
|
+
|
|
1303
|
+
Parameters
|
|
1304
|
+
----------
|
|
1305
|
+
packages : Dict[str, str], default {}
|
|
1315
1306
|
Packages to use for this flow. The key is the name of the package
|
|
1316
1307
|
and the value is the version to use.
|
|
1317
|
-
|
|
1308
|
+
libraries : Dict[str, str], default {}
|
|
1309
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
1310
|
+
python : str, optional, default None
|
|
1318
1311
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1319
1312
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1313
|
+
disabled : bool, default False
|
|
1314
|
+
If set to True, disables Conda.
|
|
1320
1315
|
"""
|
|
1321
1316
|
...
|
|
1322
1317
|
|
|
1323
1318
|
@typing.overload
|
|
1324
|
-
def
|
|
1319
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1325
1320
|
...
|
|
1326
1321
|
|
|
1327
|
-
def
|
|
1322
|
+
def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
|
1328
1323
|
"""
|
|
1329
|
-
Specifies the
|
|
1324
|
+
Specifies the Conda environment for all steps of the flow.
|
|
1325
|
+
|
|
1326
|
+
Use `@conda_base` to set common libraries required by all
|
|
1327
|
+
steps and use `@conda` to specify step-specific additions.
|
|
1330
1328
|
|
|
1331
|
-
Use `@pypi_base` to set common packages required by all
|
|
1332
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
1333
1329
|
|
|
1334
1330
|
Parameters
|
|
1335
1331
|
----------
|
|
1336
|
-
packages : Dict[str, str], default
|
|
1332
|
+
packages : Dict[str, str], default {}
|
|
1337
1333
|
Packages to use for this flow. The key is the name of the package
|
|
1338
1334
|
and the value is the version to use.
|
|
1339
|
-
|
|
1335
|
+
libraries : Dict[str, str], default {}
|
|
1336
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
1337
|
+
python : str, optional, default None
|
|
1340
1338
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1341
1339
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1340
|
+
disabled : bool, default False
|
|
1341
|
+
If set to True, disables Conda.
|
|
1342
1342
|
"""
|
|
1343
1343
|
...
|
|
1344
1344
|
|