metaflow-stubs 2.16.5__py2.py3-none-any.whl → 2.16.6__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 +433 -433
- 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 +3 -3
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +6 -6
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +4 -4
- 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 +3 -3
- 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 +5 -5
- metaflow-stubs/packaging_sys/backend.pyi +5 -5
- metaflow-stubs/packaging_sys/distribution_support.pyi +4 -4
- metaflow-stubs/packaging_sys/tar_backend.pyi +6 -6
- metaflow-stubs/packaging_sys/utils.pyi +2 -2
- metaflow-stubs/packaging_sys/v1.pyi +4 -4
- metaflow-stubs/parameters.pyi +4 -4
- metaflow-stubs/plugins/__init__.pyi +13 -13
- 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 +3 -3
- 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 +3 -3
- metaflow-stubs/plugins/argo/exit_hooks.pyi +3 -3
- metaflow-stubs/plugins/aws/__init__.pyi +4 -4
- 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 +4 -4
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +4 -4
- 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 +3 -3
- metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
- metaflow-stubs/plugins/cards/card_decorator.pyi +3 -3
- 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 +5 -5
- 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 +5 -5
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
- metaflow-stubs/plugins/debug_logger.pyi +2 -2
- metaflow-stubs/plugins/debug_monitor.pyi +2 -2
- metaflow-stubs/plugins/environment_decorator.pyi +2 -2
- metaflow-stubs/plugins/events_decorator.pyi +2 -2
- metaflow-stubs/plugins/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 +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_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 +2 -2
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +5 -5
- 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 +3 -3
- 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 +3 -3
- 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 +5 -5
- metaflow-stubs/runner/deployer_impl.pyi +3 -3
- metaflow-stubs/runner/metaflow_runner.pyi +4 -4
- 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 +5 -5
- 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_options.pyi +3 -3
- metaflow-stubs/user_configs/config_parameters.pyi +7 -7
- 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 +5 -5
- metaflow-stubs/user_decorators/user_step_decorator.pyi +6 -6
- metaflow-stubs/version.pyi +2 -2
- {metaflow_stubs-2.16.5.dist-info → metaflow_stubs-2.16.6.dist-info}/METADATA +2 -2
- metaflow_stubs-2.16.6.dist-info/RECORD +166 -0
- metaflow_stubs-2.16.5.dist-info/RECORD +0 -166
- {metaflow_stubs-2.16.5.dist-info → metaflow_stubs-2.16.6.dist-info}/WHEEL +0 -0
- {metaflow_stubs-2.16.5.dist-info → metaflow_stubs-2.16.6.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.16.
|
|
4
|
-
# Generated on 2025-07-
|
|
3
|
+
# MF version: 2.16.6 #
|
|
4
|
+
# Generated on 2025-07-24T19:01:37.061324 #
|
|
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
|
|
|
@@ -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 events as events
|
|
43
|
-
from . import metaflow_git as metaflow_git
|
|
44
42
|
from . import tuple_util as tuple_util
|
|
43
|
+
from . import metaflow_git as metaflow_git
|
|
44
|
+
from . import events as events
|
|
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 pyproject_toml_parser as pyproject_toml_parser
|
|
51
50
|
from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
|
|
52
51
|
from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
|
|
52
|
+
from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
|
|
53
53
|
from . import cards as cards
|
|
54
54
|
from . import client as client
|
|
55
55
|
from .client.core import namespace as namespace
|
|
@@ -152,6 +152,74 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
|
152
152
|
"""
|
|
153
153
|
...
|
|
154
154
|
|
|
155
|
+
@typing.overload
|
|
156
|
+
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
|
+
"""
|
|
158
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
|
159
|
+
|
|
160
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
Parameters
|
|
164
|
+
----------
|
|
165
|
+
type : str, default 'default'
|
|
166
|
+
Card type.
|
|
167
|
+
id : str, optional, default None
|
|
168
|
+
If multiple cards are present, use this id to identify this card.
|
|
169
|
+
options : Dict[str, Any], default {}
|
|
170
|
+
Options passed to the card. The contents depend on the card type.
|
|
171
|
+
timeout : int, default 45
|
|
172
|
+
Interrupt reporting if it takes more than this many seconds.
|
|
173
|
+
"""
|
|
174
|
+
...
|
|
175
|
+
|
|
176
|
+
@typing.overload
|
|
177
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
178
|
+
...
|
|
179
|
+
|
|
180
|
+
@typing.overload
|
|
181
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
182
|
+
...
|
|
183
|
+
|
|
184
|
+
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):
|
|
185
|
+
"""
|
|
186
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
|
187
|
+
|
|
188
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
Parameters
|
|
192
|
+
----------
|
|
193
|
+
type : str, default 'default'
|
|
194
|
+
Card type.
|
|
195
|
+
id : str, optional, default None
|
|
196
|
+
If multiple cards are present, use this id to identify this card.
|
|
197
|
+
options : Dict[str, Any], default {}
|
|
198
|
+
Options passed to the card. The contents depend on the card type.
|
|
199
|
+
timeout : int, default 45
|
|
200
|
+
Interrupt reporting if it takes more than this many seconds.
|
|
201
|
+
"""
|
|
202
|
+
...
|
|
203
|
+
|
|
204
|
+
@typing.overload
|
|
205
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
206
|
+
"""
|
|
207
|
+
Decorator prototype for all step decorators. This function gets specialized
|
|
208
|
+
and imported for all decorators types by _import_plugin_decorators().
|
|
209
|
+
"""
|
|
210
|
+
...
|
|
211
|
+
|
|
212
|
+
@typing.overload
|
|
213
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
214
|
+
...
|
|
215
|
+
|
|
216
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
|
217
|
+
"""
|
|
218
|
+
Decorator prototype for all step decorators. This function gets specialized
|
|
219
|
+
and imported for all decorators types by _import_plugin_decorators().
|
|
220
|
+
"""
|
|
221
|
+
...
|
|
222
|
+
|
|
155
223
|
@typing.overload
|
|
156
224
|
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]]]:
|
|
157
225
|
"""
|
|
@@ -203,6 +271,128 @@ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
|
203
271
|
"""
|
|
204
272
|
...
|
|
205
273
|
|
|
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
|
+
|
|
206
396
|
@typing.overload
|
|
207
397
|
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]]]:
|
|
208
398
|
"""
|
|
@@ -283,111 +473,61 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
|
283
473
|
...
|
|
284
474
|
|
|
285
475
|
@typing.overload
|
|
286
|
-
def
|
|
287
|
-
"""
|
|
288
|
-
Decorator prototype for all step decorators. This function gets specialized
|
|
289
|
-
and imported for all decorators types by _import_plugin_decorators().
|
|
290
|
-
"""
|
|
291
|
-
...
|
|
292
|
-
|
|
293
|
-
@typing.overload
|
|
294
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
295
|
-
...
|
|
296
|
-
|
|
297
|
-
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
|
298
|
-
"""
|
|
299
|
-
Decorator prototype for all step decorators. This function gets specialized
|
|
300
|
-
and imported for all decorators types by _import_plugin_decorators().
|
|
301
|
-
"""
|
|
302
|
-
...
|
|
303
|
-
|
|
304
|
-
@typing.overload
|
|
305
|
-
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]]]:
|
|
476
|
+
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]]]:
|
|
306
477
|
"""
|
|
307
|
-
Specifies
|
|
478
|
+
Specifies a timeout for your step.
|
|
308
479
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
480
|
+
This decorator is useful if this step may hang indefinitely.
|
|
481
|
+
|
|
482
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
|
483
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
|
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.
|
|
313
488
|
|
|
314
489
|
|
|
315
490
|
Parameters
|
|
316
491
|
----------
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
492
|
+
seconds : int, default 0
|
|
493
|
+
Number of seconds to wait prior to timing out.
|
|
494
|
+
minutes : int, default 0
|
|
495
|
+
Number of minutes to wait prior to timing out.
|
|
496
|
+
hours : int, default 0
|
|
497
|
+
Number of hours to wait prior to timing out.
|
|
323
498
|
"""
|
|
324
499
|
...
|
|
325
500
|
|
|
326
501
|
@typing.overload
|
|
327
|
-
def
|
|
502
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
328
503
|
...
|
|
329
504
|
|
|
330
505
|
@typing.overload
|
|
331
|
-
def
|
|
506
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
332
507
|
...
|
|
333
508
|
|
|
334
|
-
def
|
|
509
|
+
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):
|
|
335
510
|
"""
|
|
336
|
-
Specifies
|
|
511
|
+
Specifies a timeout for your step.
|
|
337
512
|
|
|
338
|
-
|
|
339
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
|
340
|
-
you can use `@pypi_base` to set packages required by all
|
|
341
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
Parameters
|
|
345
|
-
----------
|
|
346
|
-
packages : Dict[str, str], default: {}
|
|
347
|
-
Packages to use for this step. The key is the name of the package
|
|
348
|
-
and the value is the version to use.
|
|
349
|
-
python : str, optional, default: None
|
|
350
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
351
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
352
|
-
"""
|
|
353
|
-
...
|
|
354
|
-
|
|
355
|
-
@typing.overload
|
|
356
|
-
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]]]:
|
|
357
|
-
"""
|
|
358
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
|
359
|
-
the execution of a step.
|
|
513
|
+
This decorator is useful if this step may hang indefinitely.
|
|
360
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.
|
|
361
518
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
|
365
|
-
List of secret specs, defining how the secrets are to be retrieved
|
|
366
|
-
role : str, optional, default: None
|
|
367
|
-
Role to use for fetching secrets
|
|
368
|
-
"""
|
|
369
|
-
...
|
|
370
|
-
|
|
371
|
-
@typing.overload
|
|
372
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
373
|
-
...
|
|
374
|
-
|
|
375
|
-
@typing.overload
|
|
376
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
377
|
-
...
|
|
378
|
-
|
|
379
|
-
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):
|
|
380
|
-
"""
|
|
381
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
|
382
|
-
the execution of a step.
|
|
519
|
+
Note that all the values specified in parameters are added together so if you specify
|
|
520
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
|
383
521
|
|
|
384
522
|
|
|
385
523
|
Parameters
|
|
386
524
|
----------
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
525
|
+
seconds : int, default 0
|
|
526
|
+
Number of seconds to wait prior to timing out.
|
|
527
|
+
minutes : int, default 0
|
|
528
|
+
Number of minutes to wait prior to timing out.
|
|
529
|
+
hours : int, default 0
|
|
530
|
+
Number of hours to wait prior to timing out.
|
|
391
531
|
"""
|
|
392
532
|
...
|
|
393
533
|
|
|
@@ -541,291 +681,92 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
|
541
681
|
...
|
|
542
682
|
|
|
543
683
|
@typing.overload
|
|
544
|
-
def
|
|
545
|
-
"""
|
|
546
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
|
547
|
-
|
|
548
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
Parameters
|
|
552
|
-
----------
|
|
553
|
-
type : str, default 'default'
|
|
554
|
-
Card type.
|
|
555
|
-
id : str, optional, default None
|
|
556
|
-
If multiple cards are present, use this id to identify this card.
|
|
557
|
-
options : Dict[str, Any], default {}
|
|
558
|
-
Options passed to the card. The contents depend on the card type.
|
|
559
|
-
timeout : int, default 45
|
|
560
|
-
Interrupt reporting if it takes more than this many seconds.
|
|
561
|
-
"""
|
|
562
|
-
...
|
|
563
|
-
|
|
564
|
-
@typing.overload
|
|
565
|
-
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
566
|
-
...
|
|
567
|
-
|
|
568
|
-
@typing.overload
|
|
569
|
-
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
570
|
-
...
|
|
571
|
-
|
|
572
|
-
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):
|
|
573
|
-
"""
|
|
574
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
|
575
|
-
|
|
576
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
Parameters
|
|
580
|
-
----------
|
|
581
|
-
type : str, default 'default'
|
|
582
|
-
Card type.
|
|
583
|
-
id : str, optional, default None
|
|
584
|
-
If multiple cards are present, use this id to identify this card.
|
|
585
|
-
options : Dict[str, Any], default {}
|
|
586
|
-
Options passed to the card. The contents depend on the card type.
|
|
587
|
-
timeout : int, default 45
|
|
588
|
-
Interrupt reporting if it takes more than this many seconds.
|
|
589
|
-
"""
|
|
590
|
-
...
|
|
591
|
-
|
|
592
|
-
@typing.overload
|
|
593
|
-
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]]]:
|
|
684
|
+
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]]]:
|
|
594
685
|
"""
|
|
595
|
-
Specifies the
|
|
686
|
+
Specifies the PyPI packages for the step.
|
|
596
687
|
|
|
597
688
|
Information in this decorator will augment any
|
|
598
|
-
attributes set in the `@
|
|
599
|
-
you can use `@
|
|
600
|
-
steps and use `@
|
|
689
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
|
690
|
+
you can use `@pypi_base` to set packages required by all
|
|
691
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
601
692
|
|
|
602
693
|
|
|
603
694
|
Parameters
|
|
604
695
|
----------
|
|
605
|
-
packages : Dict[str, str], default {}
|
|
696
|
+
packages : Dict[str, str], default: {}
|
|
606
697
|
Packages to use for this step. The key is the name of the package
|
|
607
698
|
and the value is the version to use.
|
|
608
|
-
|
|
609
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
610
|
-
python : str, optional, default None
|
|
699
|
+
python : str, optional, default: None
|
|
611
700
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
612
701
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
613
|
-
disabled : bool, default False
|
|
614
|
-
If set to True, disables @conda.
|
|
615
702
|
"""
|
|
616
703
|
...
|
|
617
704
|
|
|
618
705
|
@typing.overload
|
|
619
|
-
def
|
|
706
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
620
707
|
...
|
|
621
708
|
|
|
622
709
|
@typing.overload
|
|
623
|
-
def
|
|
710
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
624
711
|
...
|
|
625
712
|
|
|
626
|
-
def
|
|
713
|
+
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):
|
|
627
714
|
"""
|
|
628
|
-
Specifies the
|
|
715
|
+
Specifies the PyPI packages for the step.
|
|
629
716
|
|
|
630
717
|
Information in this decorator will augment any
|
|
631
|
-
attributes set in the `@
|
|
632
|
-
you can use `@
|
|
633
|
-
steps and use `@
|
|
718
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
|
719
|
+
you can use `@pypi_base` to set packages required by all
|
|
720
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
634
721
|
|
|
635
722
|
|
|
636
723
|
Parameters
|
|
637
724
|
----------
|
|
638
|
-
packages : Dict[str, str], default {}
|
|
725
|
+
packages : Dict[str, str], default: {}
|
|
639
726
|
Packages to use for this step. The key is the name of the package
|
|
640
727
|
and the value is the version to use.
|
|
641
|
-
|
|
642
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
643
|
-
python : str, optional, default None
|
|
728
|
+
python : str, optional, default: None
|
|
644
729
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
645
730
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
646
|
-
disabled : bool, default False
|
|
647
|
-
If set to True, disables @conda.
|
|
648
|
-
"""
|
|
649
|
-
...
|
|
650
|
-
|
|
651
|
-
@typing.overload
|
|
652
|
-
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]]]:
|
|
653
|
-
"""
|
|
654
|
-
Specifies a timeout for your step.
|
|
655
|
-
|
|
656
|
-
This decorator is useful if this step may hang indefinitely.
|
|
657
|
-
|
|
658
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
|
659
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
|
660
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
|
661
|
-
|
|
662
|
-
Note that all the values specified in parameters are added together so if you specify
|
|
663
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
Parameters
|
|
667
|
-
----------
|
|
668
|
-
seconds : int, default 0
|
|
669
|
-
Number of seconds to wait prior to timing out.
|
|
670
|
-
minutes : int, default 0
|
|
671
|
-
Number of minutes to wait prior to timing out.
|
|
672
|
-
hours : int, default 0
|
|
673
|
-
Number of hours to wait prior to timing out.
|
|
674
|
-
"""
|
|
675
|
-
...
|
|
676
|
-
|
|
677
|
-
@typing.overload
|
|
678
|
-
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
679
|
-
...
|
|
680
|
-
|
|
681
|
-
@typing.overload
|
|
682
|
-
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
683
|
-
...
|
|
684
|
-
|
|
685
|
-
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):
|
|
686
|
-
"""
|
|
687
|
-
Specifies a timeout for your step.
|
|
688
|
-
|
|
689
|
-
This decorator is useful if this step may hang indefinitely.
|
|
690
|
-
|
|
691
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
|
692
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
|
693
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
|
694
|
-
|
|
695
|
-
Note that all the values specified in parameters are added together so if you specify
|
|
696
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
Parameters
|
|
700
|
-
----------
|
|
701
|
-
seconds : int, default 0
|
|
702
|
-
Number of seconds to wait prior to timing out.
|
|
703
|
-
minutes : int, default 0
|
|
704
|
-
Number of minutes to wait prior to timing out.
|
|
705
|
-
hours : int, default 0
|
|
706
|
-
Number of hours to wait prior to timing out.
|
|
707
|
-
"""
|
|
708
|
-
...
|
|
709
|
-
|
|
710
|
-
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]]]:
|
|
711
|
-
"""
|
|
712
|
-
Specifies that this step should execute on Kubernetes.
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
Parameters
|
|
716
|
-
----------
|
|
717
|
-
cpu : int, default 1
|
|
718
|
-
Number of CPUs required for this step. If `@resources` is
|
|
719
|
-
also present, the maximum value from all decorators is used.
|
|
720
|
-
memory : int, default 4096
|
|
721
|
-
Memory size (in MB) required for this step. If
|
|
722
|
-
`@resources` is also present, the maximum value from all decorators is
|
|
723
|
-
used.
|
|
724
|
-
disk : int, default 10240
|
|
725
|
-
Disk size (in MB) required for this step. If
|
|
726
|
-
`@resources` is also present, the maximum value from all decorators is
|
|
727
|
-
used.
|
|
728
|
-
image : str, optional, default None
|
|
729
|
-
Docker image to use when launching on Kubernetes. If not specified, and
|
|
730
|
-
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
|
731
|
-
not, a default Docker image mapping to the current version of Python is used.
|
|
732
|
-
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
|
733
|
-
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
|
734
|
-
image_pull_secrets: List[str], default []
|
|
735
|
-
The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
|
|
736
|
-
Kubernetes image pull secrets to use when pulling container images
|
|
737
|
-
in Kubernetes.
|
|
738
|
-
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
|
739
|
-
Kubernetes service account to use when launching pod in Kubernetes.
|
|
740
|
-
secrets : List[str], optional, default None
|
|
741
|
-
Kubernetes secrets to use when launching pod in Kubernetes. These
|
|
742
|
-
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
|
743
|
-
in Metaflow configuration.
|
|
744
|
-
node_selector: Union[Dict[str,str], str], optional, default None
|
|
745
|
-
Kubernetes node selector(s) to apply to the pod running the task.
|
|
746
|
-
Can be passed in as a comma separated string of values e.g.
|
|
747
|
-
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
|
748
|
-
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
|
749
|
-
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
|
750
|
-
Kubernetes namespace to use when launching pod in Kubernetes.
|
|
751
|
-
gpu : int, optional, default None
|
|
752
|
-
Number of GPUs required for this step. A value of zero implies that
|
|
753
|
-
the scheduled node should not have GPUs.
|
|
754
|
-
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
|
755
|
-
The vendor of the GPUs to be used for this step.
|
|
756
|
-
tolerations : List[Dict[str,str]], default []
|
|
757
|
-
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
|
758
|
-
Kubernetes tolerations to use when launching pod in Kubernetes.
|
|
759
|
-
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
|
760
|
-
Kubernetes labels to use when launching pod in Kubernetes.
|
|
761
|
-
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
|
762
|
-
Kubernetes annotations to use when launching pod in Kubernetes.
|
|
763
|
-
use_tmpfs : bool, default False
|
|
764
|
-
This enables an explicit tmpfs mount for this step.
|
|
765
|
-
tmpfs_tempdir : bool, default True
|
|
766
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
|
767
|
-
tmpfs_size : int, optional, default: None
|
|
768
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
|
769
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
|
770
|
-
memory allocated for this step.
|
|
771
|
-
tmpfs_path : str, optional, default /metaflow_temp
|
|
772
|
-
Path to tmpfs mount for this step.
|
|
773
|
-
persistent_volume_claims : Dict[str, str], optional, default None
|
|
774
|
-
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
|
775
|
-
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
|
776
|
-
shared_memory: int, optional
|
|
777
|
-
Shared memory size (in MiB) required for this step
|
|
778
|
-
port: int, optional
|
|
779
|
-
Port number to specify in the Kubernetes job object
|
|
780
|
-
compute_pool : str, optional, default None
|
|
781
|
-
Compute pool to be used for for this step.
|
|
782
|
-
If not specified, any accessible compute pool within the perimeter is used.
|
|
783
|
-
hostname_resolution_timeout: int, default 10 * 60
|
|
784
|
-
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
|
785
|
-
Only applicable when @parallel is used.
|
|
786
|
-
qos: str, default: Burstable
|
|
787
|
-
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
|
788
|
-
|
|
789
|
-
security_context: Dict[str, Any], optional, default None
|
|
790
|
-
Container security context. Applies to the task container. Allows the following keys:
|
|
791
|
-
- privileged: bool, optional, default None
|
|
792
|
-
- allow_privilege_escalation: bool, optional, default None
|
|
793
|
-
- run_as_user: int, optional, default None
|
|
794
|
-
- run_as_group: int, optional, default None
|
|
795
|
-
- run_as_non_root: bool, optional, default None
|
|
796
731
|
"""
|
|
797
732
|
...
|
|
798
733
|
|
|
799
734
|
@typing.overload
|
|
800
|
-
def
|
|
735
|
+
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]]]:
|
|
801
736
|
"""
|
|
802
|
-
Specifies
|
|
737
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
|
738
|
+
the execution of a step.
|
|
803
739
|
|
|
804
740
|
|
|
805
741
|
Parameters
|
|
806
742
|
----------
|
|
807
|
-
|
|
808
|
-
|
|
743
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
|
744
|
+
List of secret specs, defining how the secrets are to be retrieved
|
|
745
|
+
role : str, optional, default: None
|
|
746
|
+
Role to use for fetching secrets
|
|
809
747
|
"""
|
|
810
748
|
...
|
|
811
749
|
|
|
812
750
|
@typing.overload
|
|
813
|
-
def
|
|
751
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
814
752
|
...
|
|
815
753
|
|
|
816
754
|
@typing.overload
|
|
817
|
-
def
|
|
755
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
818
756
|
...
|
|
819
757
|
|
|
820
|
-
def
|
|
758
|
+
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):
|
|
821
759
|
"""
|
|
822
|
-
Specifies
|
|
760
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
|
761
|
+
the execution of a step.
|
|
823
762
|
|
|
824
763
|
|
|
825
764
|
Parameters
|
|
826
765
|
----------
|
|
827
|
-
|
|
828
|
-
|
|
766
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
|
767
|
+
List of secret specs, defining how the secrets are to be retrieved
|
|
768
|
+
role : str, optional, default: None
|
|
769
|
+
Role to use for fetching secrets
|
|
829
770
|
"""
|
|
830
771
|
...
|
|
831
772
|
|
|
@@ -885,86 +826,61 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
|
885
826
|
...
|
|
886
827
|
|
|
887
828
|
@typing.overload
|
|
888
|
-
def
|
|
829
|
+
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]]]:
|
|
889
830
|
"""
|
|
890
|
-
Specifies the
|
|
891
|
-
|
|
892
|
-
Use `@pypi_base` to set common packages required by all
|
|
893
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
831
|
+
Specifies the Conda environment for the step.
|
|
894
832
|
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
and the value is the version to use.
|
|
900
|
-
python : str, optional, default: None
|
|
901
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
902
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
903
|
-
"""
|
|
904
|
-
...
|
|
905
|
-
|
|
906
|
-
@typing.overload
|
|
907
|
-
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
908
|
-
...
|
|
909
|
-
|
|
910
|
-
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
|
911
|
-
"""
|
|
912
|
-
Specifies the PyPI packages for all steps of the flow.
|
|
833
|
+
Information in this decorator will augment any
|
|
834
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
|
835
|
+
you can use `@conda_base` to set packages required by all
|
|
836
|
+
steps and use `@conda` to specify step-specific overrides.
|
|
913
837
|
|
|
914
|
-
Use `@pypi_base` to set common packages required by all
|
|
915
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
916
838
|
|
|
917
839
|
Parameters
|
|
918
840
|
----------
|
|
919
|
-
packages : Dict[str, str], default
|
|
920
|
-
Packages to use for this
|
|
841
|
+
packages : Dict[str, str], default {}
|
|
842
|
+
Packages to use for this step. The key is the name of the package
|
|
921
843
|
and the value is the version to use.
|
|
922
|
-
|
|
844
|
+
libraries : Dict[str, str], default {}
|
|
845
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
846
|
+
python : str, optional, default None
|
|
923
847
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
924
848
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
849
|
+
disabled : bool, default False
|
|
850
|
+
If set to True, disables @conda.
|
|
925
851
|
"""
|
|
926
852
|
...
|
|
927
853
|
|
|
928
|
-
|
|
854
|
+
@typing.overload
|
|
855
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
856
|
+
...
|
|
857
|
+
|
|
858
|
+
@typing.overload
|
|
859
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
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):
|
|
929
863
|
"""
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
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.
|
|
935
870
|
|
|
936
871
|
|
|
937
872
|
Parameters
|
|
938
873
|
----------
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
|
950
|
-
soft_fail : bool
|
|
951
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
|
952
|
-
name : str
|
|
953
|
-
Name of the sensor on Airflow
|
|
954
|
-
description : str
|
|
955
|
-
Description of sensor in the Airflow UI
|
|
956
|
-
bucket_key : Union[str, List[str]]
|
|
957
|
-
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
|
958
|
-
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
|
959
|
-
bucket_name : str
|
|
960
|
-
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
|
961
|
-
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
|
962
|
-
wildcard_match : bool
|
|
963
|
-
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
|
964
|
-
aws_conn_id : str
|
|
965
|
-
a reference to the s3 connection on Airflow. (Default: None)
|
|
966
|
-
verify : bool
|
|
967
|
-
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
|
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.
|
|
968
884
|
"""
|
|
969
885
|
...
|
|
970
886
|
|
|
@@ -1019,6 +935,57 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
|
|
|
1019
935
|
"""
|
|
1020
936
|
...
|
|
1021
937
|
|
|
938
|
+
@typing.overload
|
|
939
|
+
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]]:
|
|
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
|
+
"""
|
|
960
|
+
...
|
|
961
|
+
|
|
962
|
+
@typing.overload
|
|
963
|
+
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
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
|
+
"""
|
|
987
|
+
...
|
|
988
|
+
|
|
1022
989
|
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]]:
|
|
1023
990
|
"""
|
|
1024
991
|
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.
|
|
@@ -1155,6 +1122,49 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
|
1155
1122
|
"""
|
|
1156
1123
|
...
|
|
1157
1124
|
|
|
1125
|
+
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
|
+
"""
|
|
1127
|
+
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)
|
|
1128
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
|
1129
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
|
1130
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
|
1131
|
+
starts only after all sensors finish.
|
|
1132
|
+
|
|
1133
|
+
|
|
1134
|
+
Parameters
|
|
1135
|
+
----------
|
|
1136
|
+
timeout : int
|
|
1137
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
|
1138
|
+
poke_interval : int
|
|
1139
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
|
1140
|
+
mode : str
|
|
1141
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
|
1142
|
+
exponential_backoff : bool
|
|
1143
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
|
1144
|
+
pool : str
|
|
1145
|
+
the slot pool this task should run in,
|
|
1146
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
|
1147
|
+
soft_fail : bool
|
|
1148
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
|
1149
|
+
name : str
|
|
1150
|
+
Name of the sensor on Airflow
|
|
1151
|
+
description : str
|
|
1152
|
+
Description of sensor in the Airflow UI
|
|
1153
|
+
bucket_key : Union[str, List[str]]
|
|
1154
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
|
1155
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
|
1156
|
+
bucket_name : str
|
|
1157
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
|
1158
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
|
1159
|
+
wildcard_match : bool
|
|
1160
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
|
1161
|
+
aws_conn_id : str
|
|
1162
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
|
1163
|
+
verify : bool
|
|
1164
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
|
1165
|
+
"""
|
|
1166
|
+
...
|
|
1167
|
+
|
|
1158
1168
|
def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
1159
1169
|
"""
|
|
1160
1170
|
Specifies what flows belong to the same project.
|
|
@@ -1190,57 +1200,6 @@ def project(*, name: str, branch: typing.Optional[str] = None, production: bool
|
|
|
1190
1200
|
"""
|
|
1191
1201
|
...
|
|
1192
1202
|
|
|
1193
|
-
@typing.overload
|
|
1194
|
-
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]]:
|
|
1195
|
-
"""
|
|
1196
|
-
Specifies the times when the flow should be run when running on a
|
|
1197
|
-
production scheduler.
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
Parameters
|
|
1201
|
-
----------
|
|
1202
|
-
hourly : bool, default False
|
|
1203
|
-
Run the workflow hourly.
|
|
1204
|
-
daily : bool, default True
|
|
1205
|
-
Run the workflow daily.
|
|
1206
|
-
weekly : bool, default False
|
|
1207
|
-
Run the workflow weekly.
|
|
1208
|
-
cron : str, optional, default None
|
|
1209
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
|
1210
|
-
specified by this expression.
|
|
1211
|
-
timezone : str, optional, default None
|
|
1212
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
|
1213
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
|
1214
|
-
"""
|
|
1215
|
-
...
|
|
1216
|
-
|
|
1217
|
-
@typing.overload
|
|
1218
|
-
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1219
|
-
...
|
|
1220
|
-
|
|
1221
|
-
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):
|
|
1222
|
-
"""
|
|
1223
|
-
Specifies the times when the flow should be run when running on a
|
|
1224
|
-
production scheduler.
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
Parameters
|
|
1228
|
-
----------
|
|
1229
|
-
hourly : bool, default False
|
|
1230
|
-
Run the workflow hourly.
|
|
1231
|
-
daily : bool, default True
|
|
1232
|
-
Run the workflow daily.
|
|
1233
|
-
weekly : bool, default False
|
|
1234
|
-
Run the workflow weekly.
|
|
1235
|
-
cron : str, optional, default None
|
|
1236
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
|
1237
|
-
specified by this expression.
|
|
1238
|
-
timezone : str, optional, default None
|
|
1239
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
|
1240
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
|
1241
|
-
"""
|
|
1242
|
-
...
|
|
1243
|
-
|
|
1244
1203
|
@typing.overload
|
|
1245
1204
|
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]]:
|
|
1246
1205
|
"""
|
|
@@ -1342,3 +1301,44 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
|
1342
1301
|
"""
|
|
1343
1302
|
...
|
|
1344
1303
|
|
|
1304
|
+
@typing.overload
|
|
1305
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
1306
|
+
"""
|
|
1307
|
+
Specifies the PyPI packages for all steps of the flow.
|
|
1308
|
+
|
|
1309
|
+
Use `@pypi_base` to set common packages required by all
|
|
1310
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
1311
|
+
|
|
1312
|
+
Parameters
|
|
1313
|
+
----------
|
|
1314
|
+
packages : Dict[str, str], default: {}
|
|
1315
|
+
Packages to use for this flow. The key is the name of the package
|
|
1316
|
+
and the value is the version to use.
|
|
1317
|
+
python : str, optional, default: None
|
|
1318
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1319
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1320
|
+
"""
|
|
1321
|
+
...
|
|
1322
|
+
|
|
1323
|
+
@typing.overload
|
|
1324
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1325
|
+
...
|
|
1326
|
+
|
|
1327
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
|
1328
|
+
"""
|
|
1329
|
+
Specifies the PyPI packages for all steps of the flow.
|
|
1330
|
+
|
|
1331
|
+
Use `@pypi_base` to set common packages required by all
|
|
1332
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
1333
|
+
|
|
1334
|
+
Parameters
|
|
1335
|
+
----------
|
|
1336
|
+
packages : Dict[str, str], default: {}
|
|
1337
|
+
Packages to use for this flow. The key is the name of the package
|
|
1338
|
+
and the value is the version to use.
|
|
1339
|
+
python : str, optional, default: None
|
|
1340
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1341
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1342
|
+
"""
|
|
1343
|
+
...
|
|
1344
|
+
|