metaflow-stubs 2.15.13__py2.py3-none-any.whl → 2.15.15__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- metaflow-stubs/__init__.pyi +458 -458
- 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 +7 -7
- metaflow-stubs/client/filecache.pyi +3 -3
- 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 +5 -5
- metaflow-stubs/info_file.pyi +2 -2
- metaflow-stubs/metadata_provider/__init__.pyi +2 -2
- metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
- metaflow-stubs/metadata_provider/metadata.pyi +3 -3
- metaflow-stubs/metadata_provider/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +4 -2
- metaflow-stubs/metaflow_current.pyi +4 -4
- metaflow-stubs/metaflow_git.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/parameters.pyi +5 -5
- metaflow-stubs/plugins/__init__.pyi +14 -14
- 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 +4 -4
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +5 -5
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -3
- metaflow-stubs/plugins/aws/__init__.pyi +3 -3
- 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 +5 -5
- 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 +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 +4 -4
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +2 -2
- metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3.pyi +3 -3
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
- metaflow-stubs/plugins/debug_logger.pyi +2 -2
- metaflow-stubs/plugins/debug_monitor.pyi +2 -2
- metaflow-stubs/plugins/environment_decorator.pyi +2 -2
- metaflow-stubs/plugins/events_decorator.pyi +2 -2
- metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
- metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
- metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kube_utils.pyi +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 +3 -3
- 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 +2 -2
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/secrets/secrets_decorator.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 +3 -3
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +30 -30
- metaflow-stubs/runner/deployer_impl.pyi +5 -2
- metaflow-stubs/runner/metaflow_runner.pyi +7 -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 +7 -4
- metaflow-stubs/system/__init__.pyi +2 -2
- metaflow-stubs/system/system_logger.pyi +3 -3
- metaflow-stubs/system/system_monitor.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- metaflow-stubs/user_configs/__init__.pyi +2 -2
- metaflow-stubs/user_configs/config_decorators.pyi +6 -6
- metaflow-stubs/user_configs/config_options.pyi +4 -4
- metaflow-stubs/user_configs/config_parameters.pyi +78 -18
- metaflow-stubs/version.pyi +2 -2
- {metaflow_stubs-2.15.13.dist-info → metaflow_stubs-2.15.15.dist-info}/METADATA +2 -2
- metaflow_stubs-2.15.15.dist-info/RECORD +149 -0
- {metaflow_stubs-2.15.13.dist-info → metaflow_stubs-2.15.15.dist-info}/WHEEL +1 -1
- metaflow_stubs-2.15.13.dist-info/RECORD +0 -149
- {metaflow_stubs-2.15.13.dist-info → metaflow_stubs-2.15.15.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.15.
|
4
|
-
# Generated on 2025-05-
|
3
|
+
# MF version: 2.15.15 #
|
4
|
+
# Generated on 2025-05-30T13:33:59.796602 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
|
-
import datetime
|
12
11
|
import typing
|
12
|
+
import datetime
|
13
13
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
14
14
|
StepFlag = typing.NewType("StepFlag", bool)
|
15
15
|
|
@@ -35,16 +35,16 @@ from .user_configs.config_parameters import ConfigValue as ConfigValue
|
|
35
35
|
from .user_configs.config_parameters import config_expr as config_expr
|
36
36
|
from .user_configs.config_decorators import CustomFlowDecorator as CustomFlowDecorator
|
37
37
|
from .user_configs.config_decorators import CustomStepDecorator as CustomStepDecorator
|
38
|
+
from . import events as events
|
38
39
|
from . import tuple_util as tuple_util
|
39
40
|
from . import metaflow_git as metaflow_git
|
40
|
-
from . import events as events
|
41
41
|
from . import runner as runner
|
42
42
|
from . import plugins as plugins
|
43
43
|
from .plugins.datatools.s3.s3 import S3 as S3
|
44
44
|
from . import includefile as includefile
|
45
45
|
from .includefile import IncludeFile as IncludeFile
|
46
|
-
from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
|
47
46
|
from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
|
47
|
+
from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
|
48
48
|
from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
|
49
49
|
from . import cards as cards
|
50
50
|
from . import client as client
|
@@ -147,37 +147,206 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
147
147
|
...
|
148
148
|
|
149
149
|
@typing.overload
|
150
|
-
def
|
150
|
+
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]]]:
|
151
151
|
"""
|
152
|
-
Specifies
|
153
|
-
|
152
|
+
Specifies that the step will success under all circumstances.
|
153
|
+
|
154
|
+
The decorator will create an optional artifact, specified by `var`, which
|
155
|
+
contains the exception raised. You can use it to detect the presence
|
156
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
157
|
+
are missing.
|
154
158
|
|
155
159
|
|
156
160
|
Parameters
|
157
161
|
----------
|
158
|
-
|
159
|
-
|
162
|
+
var : str, optional, default None
|
163
|
+
Name of the artifact in which to store the caught exception.
|
164
|
+
If not specified, the exception is not stored.
|
165
|
+
print_exception : bool, default True
|
166
|
+
Determines whether or not the exception is printed to
|
167
|
+
stdout when caught.
|
160
168
|
"""
|
161
169
|
...
|
162
170
|
|
163
171
|
@typing.overload
|
164
|
-
def
|
172
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
165
173
|
...
|
166
174
|
|
167
175
|
@typing.overload
|
168
|
-
def
|
176
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
169
177
|
...
|
170
178
|
|
171
|
-
def
|
179
|
+
def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
|
172
180
|
"""
|
173
|
-
Specifies
|
174
|
-
|
181
|
+
Specifies that the step will success under all circumstances.
|
182
|
+
|
183
|
+
The decorator will create an optional artifact, specified by `var`, which
|
184
|
+
contains the exception raised. You can use it to detect the presence
|
185
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
186
|
+
are missing.
|
175
187
|
|
176
188
|
|
177
189
|
Parameters
|
178
190
|
----------
|
179
|
-
|
180
|
-
|
191
|
+
var : str, optional, default None
|
192
|
+
Name of the artifact in which to store the caught exception.
|
193
|
+
If not specified, the exception is not stored.
|
194
|
+
print_exception : bool, default True
|
195
|
+
Determines whether or not the exception is printed to
|
196
|
+
stdout when caught.
|
197
|
+
"""
|
198
|
+
...
|
199
|
+
|
200
|
+
@typing.overload
|
201
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
202
|
+
"""
|
203
|
+
Decorator prototype for all step decorators. This function gets specialized
|
204
|
+
and imported for all decorators types by _import_plugin_decorators().
|
205
|
+
"""
|
206
|
+
...
|
207
|
+
|
208
|
+
@typing.overload
|
209
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
210
|
+
...
|
211
|
+
|
212
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
213
|
+
"""
|
214
|
+
Decorator prototype for all step decorators. This function gets specialized
|
215
|
+
and imported for all decorators types by _import_plugin_decorators().
|
216
|
+
"""
|
217
|
+
...
|
218
|
+
|
219
|
+
def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[str] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable', 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]]]:
|
220
|
+
"""
|
221
|
+
Specifies that this step should execute on Kubernetes.
|
222
|
+
|
223
|
+
|
224
|
+
Parameters
|
225
|
+
----------
|
226
|
+
cpu : int, default 1
|
227
|
+
Number of CPUs required for this step. If `@resources` is
|
228
|
+
also present, the maximum value from all decorators is used.
|
229
|
+
memory : int, default 4096
|
230
|
+
Memory size (in MB) required for this step. If
|
231
|
+
`@resources` is also present, the maximum value from all decorators is
|
232
|
+
used.
|
233
|
+
disk : int, default 10240
|
234
|
+
Disk size (in MB) required for this step. If
|
235
|
+
`@resources` is also present, the maximum value from all decorators is
|
236
|
+
used.
|
237
|
+
image : str, optional, default None
|
238
|
+
Docker image to use when launching on Kubernetes. If not specified, and
|
239
|
+
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
240
|
+
not, a default Docker image mapping to the current version of Python is used.
|
241
|
+
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
242
|
+
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
243
|
+
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
244
|
+
Kubernetes service account to use when launching pod in Kubernetes.
|
245
|
+
secrets : List[str], optional, default None
|
246
|
+
Kubernetes secrets to use when launching pod in Kubernetes. These
|
247
|
+
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
248
|
+
in Metaflow configuration.
|
249
|
+
node_selector: Union[Dict[str,str], str], optional, default None
|
250
|
+
Kubernetes node selector(s) to apply to the pod running the task.
|
251
|
+
Can be passed in as a comma separated string of values e.g.
|
252
|
+
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
253
|
+
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
254
|
+
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
255
|
+
Kubernetes namespace to use when launching pod in Kubernetes.
|
256
|
+
gpu : int, optional, default None
|
257
|
+
Number of GPUs required for this step. A value of zero implies that
|
258
|
+
the scheduled node should not have GPUs.
|
259
|
+
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
260
|
+
The vendor of the GPUs to be used for this step.
|
261
|
+
tolerations : List[str], default []
|
262
|
+
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
263
|
+
Kubernetes tolerations to use when launching pod in Kubernetes.
|
264
|
+
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
265
|
+
Kubernetes labels to use when launching pod in Kubernetes.
|
266
|
+
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
267
|
+
Kubernetes annotations to use when launching pod in Kubernetes.
|
268
|
+
use_tmpfs : bool, default False
|
269
|
+
This enables an explicit tmpfs mount for this step.
|
270
|
+
tmpfs_tempdir : bool, default True
|
271
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
272
|
+
tmpfs_size : int, optional, default: None
|
273
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
274
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
275
|
+
memory allocated for this step.
|
276
|
+
tmpfs_path : str, optional, default /metaflow_temp
|
277
|
+
Path to tmpfs mount for this step.
|
278
|
+
persistent_volume_claims : Dict[str, str], optional, default None
|
279
|
+
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
280
|
+
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
281
|
+
shared_memory: int, optional
|
282
|
+
Shared memory size (in MiB) required for this step
|
283
|
+
port: int, optional
|
284
|
+
Port number to specify in the Kubernetes job object
|
285
|
+
compute_pool : str, optional, default None
|
286
|
+
Compute pool to be used for for this step.
|
287
|
+
If not specified, any accessible compute pool within the perimeter is used.
|
288
|
+
hostname_resolution_timeout: int, default 10 * 60
|
289
|
+
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
290
|
+
Only applicable when @parallel is used.
|
291
|
+
qos: str, default: Burstable
|
292
|
+
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
293
|
+
|
294
|
+
security_context: Dict[str, Any], optional, default None
|
295
|
+
Container security context. Applies to the task container. Allows the following keys:
|
296
|
+
- privileged: bool, optional, default None
|
297
|
+
- allow_privilege_escalation: bool, optional, default None
|
298
|
+
- run_as_user: int, optional, default None
|
299
|
+
- run_as_group: int, optional, default None
|
300
|
+
- run_as_non_root: bool, optional, default None
|
301
|
+
"""
|
302
|
+
...
|
303
|
+
|
304
|
+
@typing.overload
|
305
|
+
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]]]:
|
306
|
+
"""
|
307
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
308
|
+
|
309
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
310
|
+
|
311
|
+
|
312
|
+
Parameters
|
313
|
+
----------
|
314
|
+
type : str, default 'default'
|
315
|
+
Card type.
|
316
|
+
id : str, optional, default None
|
317
|
+
If multiple cards are present, use this id to identify this card.
|
318
|
+
options : Dict[str, Any], default {}
|
319
|
+
Options passed to the card. The contents depend on the card type.
|
320
|
+
timeout : int, default 45
|
321
|
+
Interrupt reporting if it takes more than this many seconds.
|
322
|
+
"""
|
323
|
+
...
|
324
|
+
|
325
|
+
@typing.overload
|
326
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
327
|
+
...
|
328
|
+
|
329
|
+
@typing.overload
|
330
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
331
|
+
...
|
332
|
+
|
333
|
+
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):
|
334
|
+
"""
|
335
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
336
|
+
|
337
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
338
|
+
|
339
|
+
|
340
|
+
Parameters
|
341
|
+
----------
|
342
|
+
type : str, default 'default'
|
343
|
+
Card type.
|
344
|
+
id : str, optional, default None
|
345
|
+
If multiple cards are present, use this id to identify this card.
|
346
|
+
options : Dict[str, Any], default {}
|
347
|
+
Options passed to the card. The contents depend on the card type.
|
348
|
+
timeout : int, default 45
|
349
|
+
Interrupt reporting if it takes more than this many seconds.
|
181
350
|
"""
|
182
351
|
...
|
183
352
|
|
@@ -331,112 +500,200 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
331
500
|
...
|
332
501
|
|
333
502
|
@typing.overload
|
334
|
-
def
|
503
|
+
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]]]:
|
335
504
|
"""
|
336
|
-
Specifies the
|
505
|
+
Specifies the PyPI packages for the step.
|
337
506
|
|
338
507
|
Information in this decorator will augment any
|
339
|
-
attributes set in the `@
|
340
|
-
you can use `@
|
341
|
-
steps and use `@
|
508
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
509
|
+
you can use `@pypi_base` to set packages required by all
|
510
|
+
steps and use `@pypi` to specify step-specific overrides.
|
342
511
|
|
343
512
|
|
344
513
|
Parameters
|
345
514
|
----------
|
346
|
-
packages : Dict[str, str], default {}
|
515
|
+
packages : Dict[str, str], default: {}
|
347
516
|
Packages to use for this step. The key is the name of the package
|
348
517
|
and the value is the version to use.
|
349
|
-
|
350
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
351
|
-
python : str, optional, default None
|
518
|
+
python : str, optional, default: None
|
352
519
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
353
520
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
354
|
-
disabled : bool, default False
|
355
|
-
If set to True, disables @conda.
|
356
521
|
"""
|
357
522
|
...
|
358
523
|
|
359
524
|
@typing.overload
|
360
|
-
def
|
525
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
361
526
|
...
|
362
527
|
|
363
528
|
@typing.overload
|
364
|
-
def
|
529
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
365
530
|
...
|
366
531
|
|
367
|
-
def
|
532
|
+
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):
|
368
533
|
"""
|
369
|
-
Specifies the
|
534
|
+
Specifies the PyPI packages for the step.
|
370
535
|
|
371
536
|
Information in this decorator will augment any
|
372
|
-
attributes set in the `@
|
373
|
-
you can use `@
|
374
|
-
steps and use `@
|
537
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
538
|
+
you can use `@pypi_base` to set packages required by all
|
539
|
+
steps and use `@pypi` to specify step-specific overrides.
|
375
540
|
|
376
541
|
|
377
542
|
Parameters
|
378
543
|
----------
|
379
|
-
packages : Dict[str, str], default {}
|
544
|
+
packages : Dict[str, str], default: {}
|
380
545
|
Packages to use for this step. The key is the name of the package
|
381
546
|
and the value is the version to use.
|
382
|
-
|
383
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
384
|
-
python : str, optional, default None
|
547
|
+
python : str, optional, default: None
|
385
548
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
386
549
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
387
|
-
disabled : bool, default False
|
388
|
-
If set to True, disables @conda.
|
389
550
|
"""
|
390
551
|
...
|
391
552
|
|
392
553
|
@typing.overload
|
393
|
-
def
|
554
|
+
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]]]:
|
394
555
|
"""
|
395
|
-
Specifies
|
396
|
-
|
397
|
-
The decorator will create an optional artifact, specified by `var`, which
|
398
|
-
contains the exception raised. You can use it to detect the presence
|
399
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
400
|
-
are missing.
|
556
|
+
Specifies environment variables to be set prior to the execution of a step.
|
401
557
|
|
402
558
|
|
403
559
|
Parameters
|
404
560
|
----------
|
405
|
-
|
406
|
-
|
407
|
-
If not specified, the exception is not stored.
|
408
|
-
print_exception : bool, default True
|
409
|
-
Determines whether or not the exception is printed to
|
410
|
-
stdout when caught.
|
561
|
+
vars : Dict[str, str], default {}
|
562
|
+
Dictionary of environment variables to set.
|
411
563
|
"""
|
412
564
|
...
|
413
565
|
|
414
566
|
@typing.overload
|
415
|
-
def
|
567
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
416
568
|
...
|
417
569
|
|
418
570
|
@typing.overload
|
419
|
-
def
|
571
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
420
572
|
...
|
421
573
|
|
422
|
-
def
|
574
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
423
575
|
"""
|
424
|
-
Specifies
|
576
|
+
Specifies environment variables to be set prior to the execution of a step.
|
425
577
|
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
578
|
+
|
579
|
+
Parameters
|
580
|
+
----------
|
581
|
+
vars : Dict[str, str], default {}
|
582
|
+
Dictionary of environment variables to set.
|
583
|
+
"""
|
584
|
+
...
|
585
|
+
|
586
|
+
@typing.overload
|
587
|
+
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]]]:
|
588
|
+
"""
|
589
|
+
Specifies the Conda environment for the step.
|
590
|
+
|
591
|
+
Information in this decorator will augment any
|
592
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
593
|
+
you can use `@conda_base` to set packages required by all
|
594
|
+
steps and use `@conda` to specify step-specific overrides.
|
430
595
|
|
431
596
|
|
432
597
|
Parameters
|
433
598
|
----------
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
599
|
+
packages : Dict[str, str], default {}
|
600
|
+
Packages to use for this step. The key is the name of the package
|
601
|
+
and the value is the version to use.
|
602
|
+
libraries : Dict[str, str], default {}
|
603
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
604
|
+
python : str, optional, default None
|
605
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
606
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
607
|
+
disabled : bool, default False
|
608
|
+
If set to True, disables @conda.
|
609
|
+
"""
|
610
|
+
...
|
611
|
+
|
612
|
+
@typing.overload
|
613
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
614
|
+
...
|
615
|
+
|
616
|
+
@typing.overload
|
617
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
618
|
+
...
|
619
|
+
|
620
|
+
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):
|
621
|
+
"""
|
622
|
+
Specifies the Conda environment for the step.
|
623
|
+
|
624
|
+
Information in this decorator will augment any
|
625
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
626
|
+
you can use `@conda_base` to set packages required by all
|
627
|
+
steps and use `@conda` to specify step-specific overrides.
|
628
|
+
|
629
|
+
|
630
|
+
Parameters
|
631
|
+
----------
|
632
|
+
packages : Dict[str, str], default {}
|
633
|
+
Packages to use for this step. The key is the name of the package
|
634
|
+
and the value is the version to use.
|
635
|
+
libraries : Dict[str, str], default {}
|
636
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
637
|
+
python : str, optional, default None
|
638
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
639
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
640
|
+
disabled : bool, default False
|
641
|
+
If set to True, disables @conda.
|
642
|
+
"""
|
643
|
+
...
|
644
|
+
|
645
|
+
@typing.overload
|
646
|
+
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]]]:
|
647
|
+
"""
|
648
|
+
Specifies the number of times the task corresponding
|
649
|
+
to a step needs to be retried.
|
650
|
+
|
651
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
652
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
653
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
654
|
+
|
655
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
656
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
657
|
+
ensuring that the flow execution can continue.
|
658
|
+
|
659
|
+
|
660
|
+
Parameters
|
661
|
+
----------
|
662
|
+
times : int, default 3
|
663
|
+
Number of times to retry this task.
|
664
|
+
minutes_between_retries : int, default 2
|
665
|
+
Number of minutes between retries.
|
666
|
+
"""
|
667
|
+
...
|
668
|
+
|
669
|
+
@typing.overload
|
670
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
671
|
+
...
|
672
|
+
|
673
|
+
@typing.overload
|
674
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
675
|
+
...
|
676
|
+
|
677
|
+
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):
|
678
|
+
"""
|
679
|
+
Specifies the number of times the task corresponding
|
680
|
+
to a step needs to be retried.
|
681
|
+
|
682
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
683
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
684
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
685
|
+
|
686
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
687
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
688
|
+
ensuring that the flow execution can continue.
|
689
|
+
|
690
|
+
|
691
|
+
Parameters
|
692
|
+
----------
|
693
|
+
times : int, default 3
|
694
|
+
Number of times to retry this task.
|
695
|
+
minutes_between_retries : int, default 2
|
696
|
+
Number of minutes between retries.
|
440
697
|
"""
|
441
698
|
...
|
442
699
|
|
@@ -520,40 +777,42 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
520
777
|
...
|
521
778
|
|
522
779
|
@typing.overload
|
523
|
-
def
|
780
|
+
def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
524
781
|
"""
|
525
|
-
Specifies
|
526
|
-
|
527
|
-
This decorator is useful if this step may hang indefinitely.
|
528
|
-
|
529
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
530
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
531
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
532
|
-
|
533
|
-
Note that all the values specified in parameters are added together so if you specify
|
534
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
782
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
783
|
+
the execution of a step.
|
535
784
|
|
536
785
|
|
537
786
|
Parameters
|
538
787
|
----------
|
539
|
-
|
540
|
-
|
541
|
-
minutes : int, default 0
|
542
|
-
Number of minutes to wait prior to timing out.
|
543
|
-
hours : int, default 0
|
544
|
-
Number of hours to wait prior to timing out.
|
788
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
789
|
+
List of secret specs, defining how the secrets are to be retrieved
|
545
790
|
"""
|
546
791
|
...
|
547
792
|
|
548
793
|
@typing.overload
|
549
|
-
def
|
794
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
550
795
|
...
|
551
796
|
|
552
797
|
@typing.overload
|
553
|
-
def
|
798
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
554
799
|
...
|
555
800
|
|
556
|
-
def
|
801
|
+
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]]] = []):
|
802
|
+
"""
|
803
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
804
|
+
the execution of a step.
|
805
|
+
|
806
|
+
|
807
|
+
Parameters
|
808
|
+
----------
|
809
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
810
|
+
List of secret specs, defining how the secrets are to be retrieved
|
811
|
+
"""
|
812
|
+
...
|
813
|
+
|
814
|
+
@typing.overload
|
815
|
+
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]]]:
|
557
816
|
"""
|
558
817
|
Specifies a timeout for your step.
|
559
818
|
|
@@ -579,261 +838,50 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
579
838
|
...
|
580
839
|
|
581
840
|
@typing.overload
|
582
|
-
def
|
583
|
-
"""
|
584
|
-
Decorator prototype for all step decorators. This function gets specialized
|
585
|
-
and imported for all decorators types by _import_plugin_decorators().
|
586
|
-
"""
|
587
|
-
...
|
588
|
-
|
589
|
-
@typing.overload
|
590
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
591
|
-
...
|
592
|
-
|
593
|
-
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
594
|
-
"""
|
595
|
-
Decorator prototype for all step decorators. This function gets specialized
|
596
|
-
and imported for all decorators types by _import_plugin_decorators().
|
597
|
-
"""
|
598
|
-
...
|
599
|
-
|
600
|
-
def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[str] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable', 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]]]:
|
601
|
-
"""
|
602
|
-
Specifies that this step should execute on Kubernetes.
|
603
|
-
|
604
|
-
|
605
|
-
Parameters
|
606
|
-
----------
|
607
|
-
cpu : int, default 1
|
608
|
-
Number of CPUs required for this step. If `@resources` is
|
609
|
-
also present, the maximum value from all decorators is used.
|
610
|
-
memory : int, default 4096
|
611
|
-
Memory size (in MB) required for this step. If
|
612
|
-
`@resources` is also present, the maximum value from all decorators is
|
613
|
-
used.
|
614
|
-
disk : int, default 10240
|
615
|
-
Disk size (in MB) required for this step. If
|
616
|
-
`@resources` is also present, the maximum value from all decorators is
|
617
|
-
used.
|
618
|
-
image : str, optional, default None
|
619
|
-
Docker image to use when launching on Kubernetes. If not specified, and
|
620
|
-
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
621
|
-
not, a default Docker image mapping to the current version of Python is used.
|
622
|
-
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
623
|
-
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
624
|
-
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
625
|
-
Kubernetes service account to use when launching pod in Kubernetes.
|
626
|
-
secrets : List[str], optional, default None
|
627
|
-
Kubernetes secrets to use when launching pod in Kubernetes. These
|
628
|
-
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
629
|
-
in Metaflow configuration.
|
630
|
-
node_selector: Union[Dict[str,str], str], optional, default None
|
631
|
-
Kubernetes node selector(s) to apply to the pod running the task.
|
632
|
-
Can be passed in as a comma separated string of values e.g.
|
633
|
-
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
634
|
-
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
635
|
-
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
636
|
-
Kubernetes namespace to use when launching pod in Kubernetes.
|
637
|
-
gpu : int, optional, default None
|
638
|
-
Number of GPUs required for this step. A value of zero implies that
|
639
|
-
the scheduled node should not have GPUs.
|
640
|
-
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
641
|
-
The vendor of the GPUs to be used for this step.
|
642
|
-
tolerations : List[str], default []
|
643
|
-
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
644
|
-
Kubernetes tolerations to use when launching pod in Kubernetes.
|
645
|
-
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
646
|
-
Kubernetes labels to use when launching pod in Kubernetes.
|
647
|
-
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
648
|
-
Kubernetes annotations to use when launching pod in Kubernetes.
|
649
|
-
use_tmpfs : bool, default False
|
650
|
-
This enables an explicit tmpfs mount for this step.
|
651
|
-
tmpfs_tempdir : bool, default True
|
652
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
653
|
-
tmpfs_size : int, optional, default: None
|
654
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
655
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
656
|
-
memory allocated for this step.
|
657
|
-
tmpfs_path : str, optional, default /metaflow_temp
|
658
|
-
Path to tmpfs mount for this step.
|
659
|
-
persistent_volume_claims : Dict[str, str], optional, default None
|
660
|
-
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
661
|
-
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
662
|
-
shared_memory: int, optional
|
663
|
-
Shared memory size (in MiB) required for this step
|
664
|
-
port: int, optional
|
665
|
-
Port number to specify in the Kubernetes job object
|
666
|
-
compute_pool : str, optional, default None
|
667
|
-
Compute pool to be used for for this step.
|
668
|
-
If not specified, any accessible compute pool within the perimeter is used.
|
669
|
-
hostname_resolution_timeout: int, default 10 * 60
|
670
|
-
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
671
|
-
Only applicable when @parallel is used.
|
672
|
-
qos: str, default: Burstable
|
673
|
-
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
674
|
-
|
675
|
-
security_context: Dict[str, Any], optional, default None
|
676
|
-
Container security context. Applies to the task container. Allows the following keys:
|
677
|
-
- privileged: bool, optional, default None
|
678
|
-
- allow_privilege_escalation: bool, optional, default None
|
679
|
-
- run_as_user: int, optional, default None
|
680
|
-
- run_as_group: int, optional, default None
|
681
|
-
- run_as_non_root: bool, optional, default None
|
682
|
-
"""
|
683
|
-
...
|
684
|
-
|
685
|
-
@typing.overload
|
686
|
-
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]]]:
|
687
|
-
"""
|
688
|
-
Specifies environment variables to be set prior to the execution of a step.
|
689
|
-
|
690
|
-
|
691
|
-
Parameters
|
692
|
-
----------
|
693
|
-
vars : Dict[str, str], default {}
|
694
|
-
Dictionary of environment variables to set.
|
695
|
-
"""
|
696
|
-
...
|
697
|
-
|
698
|
-
@typing.overload
|
699
|
-
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
700
|
-
...
|
701
|
-
|
702
|
-
@typing.overload
|
703
|
-
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
704
|
-
...
|
705
|
-
|
706
|
-
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
707
|
-
"""
|
708
|
-
Specifies environment variables to be set prior to the execution of a step.
|
709
|
-
|
710
|
-
|
711
|
-
Parameters
|
712
|
-
----------
|
713
|
-
vars : Dict[str, str], default {}
|
714
|
-
Dictionary of environment variables to set.
|
715
|
-
"""
|
716
|
-
...
|
717
|
-
|
718
|
-
@typing.overload
|
719
|
-
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]]]:
|
720
|
-
"""
|
721
|
-
Specifies the number of times the task corresponding
|
722
|
-
to a step needs to be retried.
|
723
|
-
|
724
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
725
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
726
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
727
|
-
|
728
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
729
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
730
|
-
ensuring that the flow execution can continue.
|
731
|
-
|
732
|
-
|
733
|
-
Parameters
|
734
|
-
----------
|
735
|
-
times : int, default 3
|
736
|
-
Number of times to retry this task.
|
737
|
-
minutes_between_retries : int, default 2
|
738
|
-
Number of minutes between retries.
|
739
|
-
"""
|
740
|
-
...
|
741
|
-
|
742
|
-
@typing.overload
|
743
|
-
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
841
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
744
842
|
...
|
745
843
|
|
746
844
|
@typing.overload
|
747
|
-
def
|
748
|
-
...
|
749
|
-
|
750
|
-
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):
|
751
|
-
"""
|
752
|
-
Specifies the number of times the task corresponding
|
753
|
-
to a step needs to be retried.
|
754
|
-
|
755
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
756
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
757
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
758
|
-
|
759
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
760
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
761
|
-
ensuring that the flow execution can continue.
|
762
|
-
|
763
|
-
|
764
|
-
Parameters
|
765
|
-
----------
|
766
|
-
times : int, default 3
|
767
|
-
Number of times to retry this task.
|
768
|
-
minutes_between_retries : int, default 2
|
769
|
-
Number of minutes between retries.
|
770
|
-
"""
|
845
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
771
846
|
...
|
772
847
|
|
773
|
-
|
774
|
-
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]]]:
|
848
|
+
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):
|
775
849
|
"""
|
776
|
-
|
777
|
-
|
778
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
850
|
+
Specifies a timeout for your step.
|
779
851
|
|
852
|
+
This decorator is useful if this step may hang indefinitely.
|
780
853
|
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
Card type.
|
785
|
-
id : str, optional, default None
|
786
|
-
If multiple cards are present, use this id to identify this card.
|
787
|
-
options : Dict[str, Any], default {}
|
788
|
-
Options passed to the card. The contents depend on the card type.
|
789
|
-
timeout : int, default 45
|
790
|
-
Interrupt reporting if it takes more than this many seconds.
|
791
|
-
"""
|
792
|
-
...
|
793
|
-
|
794
|
-
@typing.overload
|
795
|
-
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
796
|
-
...
|
797
|
-
|
798
|
-
@typing.overload
|
799
|
-
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
800
|
-
...
|
801
|
-
|
802
|
-
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):
|
803
|
-
"""
|
804
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
854
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
855
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
856
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
805
857
|
|
806
|
-
Note that
|
858
|
+
Note that all the values specified in parameters are added together so if you specify
|
859
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
807
860
|
|
808
861
|
|
809
862
|
Parameters
|
810
863
|
----------
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
timeout : int, default 45
|
818
|
-
Interrupt reporting if it takes more than this many seconds.
|
864
|
+
seconds : int, default 0
|
865
|
+
Number of seconds to wait prior to timing out.
|
866
|
+
minutes : int, default 0
|
867
|
+
Number of minutes to wait prior to timing out.
|
868
|
+
hours : int, default 0
|
869
|
+
Number of hours to wait prior to timing out.
|
819
870
|
"""
|
820
871
|
...
|
821
872
|
|
822
873
|
@typing.overload
|
823
|
-
def
|
874
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
824
875
|
"""
|
825
|
-
Specifies the PyPI packages for the
|
876
|
+
Specifies the PyPI packages for all steps of the flow.
|
826
877
|
|
827
|
-
|
828
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
829
|
-
you can use `@pypi_base` to set packages required by all
|
878
|
+
Use `@pypi_base` to set common packages required by all
|
830
879
|
steps and use `@pypi` to specify step-specific overrides.
|
831
880
|
|
832
|
-
|
833
881
|
Parameters
|
834
882
|
----------
|
835
883
|
packages : Dict[str, str], default: {}
|
836
|
-
Packages to use for this
|
884
|
+
Packages to use for this flow. The key is the name of the package
|
837
885
|
and the value is the version to use.
|
838
886
|
python : str, optional, default: None
|
839
887
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
@@ -842,27 +890,20 @@ def pypi(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] =
|
|
842
890
|
...
|
843
891
|
|
844
892
|
@typing.overload
|
845
|
-
def
|
846
|
-
...
|
847
|
-
|
848
|
-
@typing.overload
|
849
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
893
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
850
894
|
...
|
851
895
|
|
852
|
-
def
|
896
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
853
897
|
"""
|
854
|
-
Specifies the PyPI packages for the
|
898
|
+
Specifies the PyPI packages for all steps of the flow.
|
855
899
|
|
856
|
-
|
857
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
858
|
-
you can use `@pypi_base` to set packages required by all
|
900
|
+
Use `@pypi_base` to set common packages required by all
|
859
901
|
steps and use `@pypi` to specify step-specific overrides.
|
860
902
|
|
861
|
-
|
862
903
|
Parameters
|
863
904
|
----------
|
864
905
|
packages : Dict[str, str], default: {}
|
865
|
-
Packages to use for this
|
906
|
+
Packages to use for this flow. The key is the name of the package
|
866
907
|
and the value is the version to use.
|
867
908
|
python : str, optional, default: None
|
868
909
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
@@ -963,90 +1004,6 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
963
1004
|
"""
|
964
1005
|
...
|
965
1006
|
|
966
|
-
@typing.overload
|
967
|
-
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
968
|
-
"""
|
969
|
-
Specifies the PyPI packages for all steps of the flow.
|
970
|
-
|
971
|
-
Use `@pypi_base` to set common packages required by all
|
972
|
-
steps and use `@pypi` to specify step-specific overrides.
|
973
|
-
|
974
|
-
Parameters
|
975
|
-
----------
|
976
|
-
packages : Dict[str, str], default: {}
|
977
|
-
Packages to use for this flow. The key is the name of the package
|
978
|
-
and the value is the version to use.
|
979
|
-
python : str, optional, default: None
|
980
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
981
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
982
|
-
"""
|
983
|
-
...
|
984
|
-
|
985
|
-
@typing.overload
|
986
|
-
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
987
|
-
...
|
988
|
-
|
989
|
-
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
990
|
-
"""
|
991
|
-
Specifies the PyPI packages for all steps of the flow.
|
992
|
-
|
993
|
-
Use `@pypi_base` to set common packages required by all
|
994
|
-
steps and use `@pypi` to specify step-specific overrides.
|
995
|
-
|
996
|
-
Parameters
|
997
|
-
----------
|
998
|
-
packages : Dict[str, str], default: {}
|
999
|
-
Packages to use for this flow. The key is the name of the package
|
1000
|
-
and the value is the version to use.
|
1001
|
-
python : str, optional, default: None
|
1002
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1003
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1004
|
-
"""
|
1005
|
-
...
|
1006
|
-
|
1007
|
-
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]]:
|
1008
|
-
"""
|
1009
|
-
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.
|
1010
|
-
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.
|
1011
|
-
|
1012
|
-
|
1013
|
-
Parameters
|
1014
|
-
----------
|
1015
|
-
timeout : int
|
1016
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
1017
|
-
poke_interval : int
|
1018
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
1019
|
-
mode : str
|
1020
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1021
|
-
exponential_backoff : bool
|
1022
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1023
|
-
pool : str
|
1024
|
-
the slot pool this task should run in,
|
1025
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1026
|
-
soft_fail : bool
|
1027
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1028
|
-
name : str
|
1029
|
-
Name of the sensor on Airflow
|
1030
|
-
description : str
|
1031
|
-
Description of sensor in the Airflow UI
|
1032
|
-
external_dag_id : str
|
1033
|
-
The dag_id that contains the task you want to wait for.
|
1034
|
-
external_task_ids : List[str]
|
1035
|
-
The list of task_ids that you want to wait for.
|
1036
|
-
If None (default value) the sensor waits for the DAG. (Default: None)
|
1037
|
-
allowed_states : List[str]
|
1038
|
-
Iterable of allowed states, (Default: ['success'])
|
1039
|
-
failed_states : List[str]
|
1040
|
-
Iterable of failed or dis-allowed states. (Default: None)
|
1041
|
-
execution_delta : datetime.timedelta
|
1042
|
-
time difference with the previous execution to look at,
|
1043
|
-
the default is the same logical date as the current task or DAG. (Default: None)
|
1044
|
-
check_existence: bool
|
1045
|
-
Set to True to check if the external task exists or check if
|
1046
|
-
the DAG to wait for exists. (Default: True)
|
1047
|
-
"""
|
1048
|
-
...
|
1049
|
-
|
1050
1007
|
@typing.overload
|
1051
1008
|
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]]:
|
1052
1009
|
"""
|
@@ -1183,6 +1140,92 @@ def project(*, name: str, branch: typing.Optional[str] = None, production: bool
|
|
1183
1140
|
"""
|
1184
1141
|
...
|
1185
1142
|
|
1143
|
+
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]]:
|
1144
|
+
"""
|
1145
|
+
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.
|
1146
|
+
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.
|
1147
|
+
|
1148
|
+
|
1149
|
+
Parameters
|
1150
|
+
----------
|
1151
|
+
timeout : int
|
1152
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1153
|
+
poke_interval : int
|
1154
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1155
|
+
mode : str
|
1156
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1157
|
+
exponential_backoff : bool
|
1158
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1159
|
+
pool : str
|
1160
|
+
the slot pool this task should run in,
|
1161
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1162
|
+
soft_fail : bool
|
1163
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1164
|
+
name : str
|
1165
|
+
Name of the sensor on Airflow
|
1166
|
+
description : str
|
1167
|
+
Description of sensor in the Airflow UI
|
1168
|
+
external_dag_id : str
|
1169
|
+
The dag_id that contains the task you want to wait for.
|
1170
|
+
external_task_ids : List[str]
|
1171
|
+
The list of task_ids that you want to wait for.
|
1172
|
+
If None (default value) the sensor waits for the DAG. (Default: None)
|
1173
|
+
allowed_states : List[str]
|
1174
|
+
Iterable of allowed states, (Default: ['success'])
|
1175
|
+
failed_states : List[str]
|
1176
|
+
Iterable of failed or dis-allowed states. (Default: None)
|
1177
|
+
execution_delta : datetime.timedelta
|
1178
|
+
time difference with the previous execution to look at,
|
1179
|
+
the default is the same logical date as the current task or DAG. (Default: None)
|
1180
|
+
check_existence: bool
|
1181
|
+
Set to True to check if the external task exists or check if
|
1182
|
+
the DAG to wait for exists. (Default: True)
|
1183
|
+
"""
|
1184
|
+
...
|
1185
|
+
|
1186
|
+
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]]:
|
1187
|
+
"""
|
1188
|
+
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)
|
1189
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1190
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1191
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1192
|
+
starts only after all sensors finish.
|
1193
|
+
|
1194
|
+
|
1195
|
+
Parameters
|
1196
|
+
----------
|
1197
|
+
timeout : int
|
1198
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1199
|
+
poke_interval : int
|
1200
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1201
|
+
mode : str
|
1202
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1203
|
+
exponential_backoff : bool
|
1204
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1205
|
+
pool : str
|
1206
|
+
the slot pool this task should run in,
|
1207
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1208
|
+
soft_fail : bool
|
1209
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1210
|
+
name : str
|
1211
|
+
Name of the sensor on Airflow
|
1212
|
+
description : str
|
1213
|
+
Description of sensor in the Airflow UI
|
1214
|
+
bucket_key : Union[str, List[str]]
|
1215
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1216
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1217
|
+
bucket_name : str
|
1218
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1219
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1220
|
+
wildcard_match : bool
|
1221
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1222
|
+
aws_conn_id : str
|
1223
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1224
|
+
verify : bool
|
1225
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1226
|
+
"""
|
1227
|
+
...
|
1228
|
+
|
1186
1229
|
@typing.overload
|
1187
1230
|
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]]:
|
1188
1231
|
"""
|
@@ -1285,46 +1328,3 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
|
|
1285
1328
|
"""
|
1286
1329
|
...
|
1287
1330
|
|
1288
|
-
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]]:
|
1289
|
-
"""
|
1290
|
-
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)
|
1291
|
-
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1292
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1293
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1294
|
-
starts only after all sensors finish.
|
1295
|
-
|
1296
|
-
|
1297
|
-
Parameters
|
1298
|
-
----------
|
1299
|
-
timeout : int
|
1300
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
1301
|
-
poke_interval : int
|
1302
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
1303
|
-
mode : str
|
1304
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1305
|
-
exponential_backoff : bool
|
1306
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1307
|
-
pool : str
|
1308
|
-
the slot pool this task should run in,
|
1309
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1310
|
-
soft_fail : bool
|
1311
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1312
|
-
name : str
|
1313
|
-
Name of the sensor on Airflow
|
1314
|
-
description : str
|
1315
|
-
Description of sensor in the Airflow UI
|
1316
|
-
bucket_key : Union[str, List[str]]
|
1317
|
-
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1318
|
-
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1319
|
-
bucket_name : str
|
1320
|
-
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1321
|
-
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1322
|
-
wildcard_match : bool
|
1323
|
-
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1324
|
-
aws_conn_id : str
|
1325
|
-
a reference to the s3 connection on Airflow. (Default: None)
|
1326
|
-
verify : bool
|
1327
|
-
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1328
|
-
"""
|
1329
|
-
...
|
1330
|
-
|