metaflow-stubs 2.17.1__py2.py3-none-any.whl → 2.17.2__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 +437 -437
- 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 +4 -4
- metaflow-stubs/client/filecache.pyi +2 -2
- metaflow-stubs/events.pyi +2 -2
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +12 -3
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +3 -3
- metaflow-stubs/meta_files.pyi +2 -2
- metaflow-stubs/metadata_provider/__init__.pyi +2 -2
- metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
- metaflow-stubs/metadata_provider/metadata.pyi +2 -2
- metaflow-stubs/metadata_provider/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -2
- metaflow-stubs/metaflow_current.pyi +4 -4
- metaflow-stubs/metaflow_git.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/packaging_sys/__init__.pyi +6 -6
- metaflow-stubs/packaging_sys/backend.pyi +3 -3
- metaflow-stubs/packaging_sys/distribution_support.pyi +4 -4
- metaflow-stubs/packaging_sys/tar_backend.pyi +4 -4
- metaflow-stubs/packaging_sys/utils.pyi +2 -2
- metaflow-stubs/packaging_sys/v1.pyi +2 -2
- metaflow-stubs/parameters.pyi +4 -4
- metaflow-stubs/plugins/__init__.pyi +10 -10
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
- metaflow-stubs/plugins/airflow/exception.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
- metaflow-stubs/plugins/argo/__init__.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -3
- metaflow-stubs/plugins/argo/exit_hooks.pyi +2 -2
- 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 +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +2 -2
- metaflow-stubs/plugins/azure/__init__.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
- metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/cards/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_client.pyi +2 -2
- metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
- metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +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/exit_hook/__init__.pyi +2 -2
- metaflow-stubs/plugins/exit_hook/exit_hook_decorator.pyi +2 -2
- metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
- metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
- metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
- metaflow-stubs/plugins/project_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +3 -3
- 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 +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 +33 -33
- metaflow-stubs/runner/deployer_impl.pyi +2 -2
- metaflow-stubs/runner/metaflow_runner.pyi +3 -3
- metaflow-stubs/runner/nbdeploy.pyi +2 -2
- metaflow-stubs/runner/nbrun.pyi +2 -2
- metaflow-stubs/runner/subprocess_manager.pyi +2 -2
- metaflow-stubs/runner/utils.pyi +3 -3
- metaflow-stubs/system/__init__.pyi +2 -2
- metaflow-stubs/system/system_logger.pyi +2 -2
- metaflow-stubs/system/system_monitor.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- metaflow-stubs/user_configs/__init__.pyi +2 -2
- metaflow-stubs/user_configs/config_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 +4 -4
- metaflow-stubs/user_decorators/mutable_step.pyi +5 -5
- metaflow-stubs/user_decorators/user_flow_decorator.pyi +2 -2
- metaflow-stubs/user_decorators/user_step_decorator.pyi +19 -6
- metaflow-stubs/version.pyi +2 -2
- {metaflow_stubs-2.17.1.dist-info → metaflow_stubs-2.17.2.dist-info}/METADATA +2 -2
- metaflow_stubs-2.17.2.dist-info/RECORD +166 -0
- metaflow_stubs-2.17.1.dist-info/RECORD +0 -166
- {metaflow_stubs-2.17.1.dist-info → metaflow_stubs-2.17.2.dist-info}/WHEEL +0 -0
- {metaflow_stubs-2.17.1.dist-info → metaflow_stubs-2.17.2.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
######################################################################################################
|
|
2
2
|
# Auto-generated Metaflow stub file #
|
|
3
|
-
# MF version: 2.17.
|
|
4
|
-
# Generated on 2025-08-
|
|
3
|
+
# MF version: 2.17.2 #
|
|
4
|
+
# Generated on 2025-08-19T21:01:04.587987 #
|
|
5
5
|
######################################################################################################
|
|
6
6
|
|
|
7
7
|
from __future__ import annotations
|
|
@@ -152,45 +152,6 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
|
152
152
|
"""
|
|
153
153
|
...
|
|
154
154
|
|
|
155
|
-
@typing.overload
|
|
156
|
-
def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
|
157
|
-
"""
|
|
158
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
|
159
|
-
the execution of a step.
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
Parameters
|
|
163
|
-
----------
|
|
164
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
|
165
|
-
List of secret specs, defining how the secrets are to be retrieved
|
|
166
|
-
role : str, optional, default: None
|
|
167
|
-
Role to use for fetching secrets
|
|
168
|
-
"""
|
|
169
|
-
...
|
|
170
|
-
|
|
171
|
-
@typing.overload
|
|
172
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
173
|
-
...
|
|
174
|
-
|
|
175
|
-
@typing.overload
|
|
176
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
177
|
-
...
|
|
178
|
-
|
|
179
|
-
def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None):
|
|
180
|
-
"""
|
|
181
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
|
182
|
-
the execution of a step.
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
Parameters
|
|
186
|
-
----------
|
|
187
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
|
188
|
-
List of secret specs, defining how the secrets are to be retrieved
|
|
189
|
-
role : str, optional, default: None
|
|
190
|
-
Role to use for fetching secrets
|
|
191
|
-
"""
|
|
192
|
-
...
|
|
193
|
-
|
|
194
155
|
@typing.overload
|
|
195
156
|
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]]]:
|
|
196
157
|
"""
|
|
@@ -251,230 +212,133 @@ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
|
251
212
|
...
|
|
252
213
|
|
|
253
214
|
@typing.overload
|
|
254
|
-
def
|
|
215
|
+
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]]]:
|
|
255
216
|
"""
|
|
256
|
-
Specifies
|
|
217
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
|
218
|
+
the execution of a step.
|
|
257
219
|
|
|
258
220
|
|
|
259
221
|
Parameters
|
|
260
222
|
----------
|
|
261
|
-
|
|
262
|
-
|
|
223
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
|
224
|
+
List of secret specs, defining how the secrets are to be retrieved
|
|
225
|
+
role : str, optional, default: None
|
|
226
|
+
Role to use for fetching secrets
|
|
263
227
|
"""
|
|
264
228
|
...
|
|
265
229
|
|
|
266
230
|
@typing.overload
|
|
267
|
-
def
|
|
231
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
268
232
|
...
|
|
269
233
|
|
|
270
234
|
@typing.overload
|
|
271
|
-
def
|
|
235
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
272
236
|
...
|
|
273
237
|
|
|
274
|
-
def
|
|
238
|
+
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):
|
|
275
239
|
"""
|
|
276
|
-
Specifies
|
|
240
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
|
241
|
+
the execution of a step.
|
|
277
242
|
|
|
278
243
|
|
|
279
244
|
Parameters
|
|
280
245
|
----------
|
|
281
|
-
|
|
282
|
-
|
|
246
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
|
247
|
+
List of secret specs, defining how the secrets are to be retrieved
|
|
248
|
+
role : str, optional, default: None
|
|
249
|
+
Role to use for fetching secrets
|
|
283
250
|
"""
|
|
284
251
|
...
|
|
285
252
|
|
|
286
253
|
@typing.overload
|
|
287
|
-
def
|
|
254
|
+
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]]]:
|
|
288
255
|
"""
|
|
289
|
-
Specifies
|
|
290
|
-
to a step needs to be retried.
|
|
291
|
-
|
|
292
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
|
293
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
|
294
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
|
295
|
-
|
|
296
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
|
297
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
|
298
|
-
ensuring that the flow execution can continue.
|
|
256
|
+
Specifies environment variables to be set prior to the execution of a step.
|
|
299
257
|
|
|
300
258
|
|
|
301
259
|
Parameters
|
|
302
260
|
----------
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
minutes_between_retries : int, default 2
|
|
306
|
-
Number of minutes between retries.
|
|
261
|
+
vars : Dict[str, str], default {}
|
|
262
|
+
Dictionary of environment variables to set.
|
|
307
263
|
"""
|
|
308
264
|
...
|
|
309
265
|
|
|
310
266
|
@typing.overload
|
|
311
|
-
def
|
|
267
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
312
268
|
...
|
|
313
269
|
|
|
314
270
|
@typing.overload
|
|
315
|
-
def
|
|
271
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
316
272
|
...
|
|
317
273
|
|
|
318
|
-
def
|
|
274
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
|
319
275
|
"""
|
|
320
|
-
Specifies
|
|
321
|
-
to a step needs to be retried.
|
|
322
|
-
|
|
323
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
|
324
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
|
325
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
|
326
|
-
|
|
327
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
|
328
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
|
329
|
-
ensuring that the flow execution can continue.
|
|
276
|
+
Specifies environment variables to be set prior to the execution of a step.
|
|
330
277
|
|
|
331
278
|
|
|
332
279
|
Parameters
|
|
333
280
|
----------
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
minutes_between_retries : int, default 2
|
|
337
|
-
Number of minutes between retries.
|
|
281
|
+
vars : Dict[str, str], default {}
|
|
282
|
+
Dictionary of environment variables to set.
|
|
338
283
|
"""
|
|
339
284
|
...
|
|
340
285
|
|
|
341
|
-
|
|
286
|
+
@typing.overload
|
|
287
|
+
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]]]:
|
|
342
288
|
"""
|
|
343
|
-
Specifies
|
|
344
|
-
|
|
289
|
+
Specifies a timeout for your step.
|
|
345
290
|
|
|
346
|
-
|
|
347
|
-
----------
|
|
348
|
-
cpu : int, default 1
|
|
349
|
-
Number of CPUs required for this step. If `@resources` is
|
|
350
|
-
also present, the maximum value from all decorators is used.
|
|
351
|
-
memory : int, default 4096
|
|
352
|
-
Memory size (in MB) required for this step. If
|
|
353
|
-
`@resources` is also present, the maximum value from all decorators is
|
|
354
|
-
used.
|
|
355
|
-
disk : int, default 10240
|
|
356
|
-
Disk size (in MB) required for this step. If
|
|
357
|
-
`@resources` is also present, the maximum value from all decorators is
|
|
358
|
-
used.
|
|
359
|
-
image : str, optional, default None
|
|
360
|
-
Docker image to use when launching on Kubernetes. If not specified, and
|
|
361
|
-
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
|
362
|
-
not, a default Docker image mapping to the current version of Python is used.
|
|
363
|
-
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
|
364
|
-
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
|
365
|
-
image_pull_secrets: List[str], default []
|
|
366
|
-
The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
|
|
367
|
-
Kubernetes image pull secrets to use when pulling container images
|
|
368
|
-
in Kubernetes.
|
|
369
|
-
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
|
370
|
-
Kubernetes service account to use when launching pod in Kubernetes.
|
|
371
|
-
secrets : List[str], optional, default None
|
|
372
|
-
Kubernetes secrets to use when launching pod in Kubernetes. These
|
|
373
|
-
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
|
374
|
-
in Metaflow configuration.
|
|
375
|
-
node_selector: Union[Dict[str,str], str], optional, default None
|
|
376
|
-
Kubernetes node selector(s) to apply to the pod running the task.
|
|
377
|
-
Can be passed in as a comma separated string of values e.g.
|
|
378
|
-
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
|
379
|
-
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
|
380
|
-
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
|
381
|
-
Kubernetes namespace to use when launching pod in Kubernetes.
|
|
382
|
-
gpu : int, optional, default None
|
|
383
|
-
Number of GPUs required for this step. A value of zero implies that
|
|
384
|
-
the scheduled node should not have GPUs.
|
|
385
|
-
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
|
386
|
-
The vendor of the GPUs to be used for this step.
|
|
387
|
-
tolerations : List[Dict[str,str]], default []
|
|
388
|
-
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
|
389
|
-
Kubernetes tolerations to use when launching pod in Kubernetes.
|
|
390
|
-
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
|
391
|
-
Kubernetes labels to use when launching pod in Kubernetes.
|
|
392
|
-
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
|
393
|
-
Kubernetes annotations to use when launching pod in Kubernetes.
|
|
394
|
-
use_tmpfs : bool, default False
|
|
395
|
-
This enables an explicit tmpfs mount for this step.
|
|
396
|
-
tmpfs_tempdir : bool, default True
|
|
397
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
|
398
|
-
tmpfs_size : int, optional, default: None
|
|
399
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
|
400
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
|
401
|
-
memory allocated for this step.
|
|
402
|
-
tmpfs_path : str, optional, default /metaflow_temp
|
|
403
|
-
Path to tmpfs mount for this step.
|
|
404
|
-
persistent_volume_claims : Dict[str, str], optional, default None
|
|
405
|
-
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
|
406
|
-
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
|
407
|
-
shared_memory: int, optional
|
|
408
|
-
Shared memory size (in MiB) required for this step
|
|
409
|
-
port: int, optional
|
|
410
|
-
Port number to specify in the Kubernetes job object
|
|
411
|
-
compute_pool : str, optional, default None
|
|
412
|
-
Compute pool to be used for for this step.
|
|
413
|
-
If not specified, any accessible compute pool within the perimeter is used.
|
|
414
|
-
hostname_resolution_timeout: int, default 10 * 60
|
|
415
|
-
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
|
416
|
-
Only applicable when @parallel is used.
|
|
417
|
-
qos: str, default: Burstable
|
|
418
|
-
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
|
291
|
+
This decorator is useful if this step may hang indefinitely.
|
|
419
292
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
- allow_privilege_escalation: bool, optional, default None
|
|
424
|
-
- run_as_user: int, optional, default None
|
|
425
|
-
- run_as_group: int, optional, default None
|
|
426
|
-
- run_as_non_root: bool, optional, default None
|
|
427
|
-
"""
|
|
428
|
-
...
|
|
429
|
-
|
|
430
|
-
@typing.overload
|
|
431
|
-
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]]]:
|
|
432
|
-
"""
|
|
433
|
-
Specifies the PyPI packages for the step.
|
|
293
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
|
294
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
|
295
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
|
434
296
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
you can use `@pypi_base` to set packages required by all
|
|
438
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
297
|
+
Note that all the values specified in parameters are added together so if you specify
|
|
298
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
|
439
299
|
|
|
440
300
|
|
|
441
301
|
Parameters
|
|
442
302
|
----------
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
303
|
+
seconds : int, default 0
|
|
304
|
+
Number of seconds to wait prior to timing out.
|
|
305
|
+
minutes : int, default 0
|
|
306
|
+
Number of minutes to wait prior to timing out.
|
|
307
|
+
hours : int, default 0
|
|
308
|
+
Number of hours to wait prior to timing out.
|
|
449
309
|
"""
|
|
450
310
|
...
|
|
451
311
|
|
|
452
312
|
@typing.overload
|
|
453
|
-
def
|
|
313
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
454
314
|
...
|
|
455
315
|
|
|
456
316
|
@typing.overload
|
|
457
|
-
def
|
|
317
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
458
318
|
...
|
|
459
319
|
|
|
460
|
-
def
|
|
320
|
+
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):
|
|
461
321
|
"""
|
|
462
|
-
Specifies
|
|
322
|
+
Specifies a timeout for your step.
|
|
463
323
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
324
|
+
This decorator is useful if this step may hang indefinitely.
|
|
325
|
+
|
|
326
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
|
327
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
|
328
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
|
329
|
+
|
|
330
|
+
Note that all the values specified in parameters are added together so if you specify
|
|
331
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
|
468
332
|
|
|
469
333
|
|
|
470
334
|
Parameters
|
|
471
335
|
----------
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
336
|
+
seconds : int, default 0
|
|
337
|
+
Number of seconds to wait prior to timing out.
|
|
338
|
+
minutes : int, default 0
|
|
339
|
+
Number of minutes to wait prior to timing out.
|
|
340
|
+
hours : int, default 0
|
|
341
|
+
Number of hours to wait prior to timing out.
|
|
478
342
|
"""
|
|
479
343
|
...
|
|
480
344
|
|
|
@@ -528,80 +392,108 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
|
|
|
528
392
|
...
|
|
529
393
|
|
|
530
394
|
@typing.overload
|
|
531
|
-
def
|
|
395
|
+
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]]]:
|
|
532
396
|
"""
|
|
533
|
-
|
|
534
|
-
|
|
397
|
+
Specifies that the step will success under all circumstances.
|
|
398
|
+
|
|
399
|
+
The decorator will create an optional artifact, specified by `var`, which
|
|
400
|
+
contains the exception raised. You can use it to detect the presence
|
|
401
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
|
402
|
+
are missing.
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
Parameters
|
|
406
|
+
----------
|
|
407
|
+
var : str, optional, default None
|
|
408
|
+
Name of the artifact in which to store the caught exception.
|
|
409
|
+
If not specified, the exception is not stored.
|
|
410
|
+
print_exception : bool, default True
|
|
411
|
+
Determines whether or not the exception is printed to
|
|
412
|
+
stdout when caught.
|
|
535
413
|
"""
|
|
536
414
|
...
|
|
537
415
|
|
|
538
416
|
@typing.overload
|
|
539
|
-
def
|
|
417
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
540
418
|
...
|
|
541
419
|
|
|
542
|
-
|
|
420
|
+
@typing.overload
|
|
421
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
422
|
+
...
|
|
423
|
+
|
|
424
|
+
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):
|
|
543
425
|
"""
|
|
544
|
-
|
|
545
|
-
|
|
426
|
+
Specifies that the step will success under all circumstances.
|
|
427
|
+
|
|
428
|
+
The decorator will create an optional artifact, specified by `var`, which
|
|
429
|
+
contains the exception raised. You can use it to detect the presence
|
|
430
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
|
431
|
+
are missing.
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
Parameters
|
|
435
|
+
----------
|
|
436
|
+
var : str, optional, default None
|
|
437
|
+
Name of the artifact in which to store the caught exception.
|
|
438
|
+
If not specified, the exception is not stored.
|
|
439
|
+
print_exception : bool, default True
|
|
440
|
+
Determines whether or not the exception is printed to
|
|
441
|
+
stdout when caught.
|
|
546
442
|
"""
|
|
547
443
|
...
|
|
548
444
|
|
|
549
445
|
@typing.overload
|
|
550
|
-
def
|
|
446
|
+
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]]]:
|
|
551
447
|
"""
|
|
552
|
-
Specifies
|
|
553
|
-
|
|
554
|
-
This decorator is useful if this step may hang indefinitely.
|
|
448
|
+
Specifies the number of times the task corresponding
|
|
449
|
+
to a step needs to be retried.
|
|
555
450
|
|
|
556
|
-
This
|
|
557
|
-
|
|
558
|
-
|
|
451
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
|
452
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
|
453
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
|
559
454
|
|
|
560
|
-
|
|
561
|
-
|
|
455
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
|
456
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
|
457
|
+
ensuring that the flow execution can continue.
|
|
562
458
|
|
|
563
459
|
|
|
564
460
|
Parameters
|
|
565
461
|
----------
|
|
566
|
-
|
|
567
|
-
Number of
|
|
568
|
-
|
|
569
|
-
Number of minutes
|
|
570
|
-
hours : int, default 0
|
|
571
|
-
Number of hours to wait prior to timing out.
|
|
462
|
+
times : int, default 3
|
|
463
|
+
Number of times to retry this task.
|
|
464
|
+
minutes_between_retries : int, default 2
|
|
465
|
+
Number of minutes between retries.
|
|
572
466
|
"""
|
|
573
467
|
...
|
|
574
468
|
|
|
575
469
|
@typing.overload
|
|
576
|
-
def
|
|
470
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
577
471
|
...
|
|
578
472
|
|
|
579
473
|
@typing.overload
|
|
580
|
-
def
|
|
474
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
581
475
|
...
|
|
582
476
|
|
|
583
|
-
def
|
|
477
|
+
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):
|
|
584
478
|
"""
|
|
585
|
-
Specifies
|
|
586
|
-
|
|
587
|
-
This decorator is useful if this step may hang indefinitely.
|
|
479
|
+
Specifies the number of times the task corresponding
|
|
480
|
+
to a step needs to be retried.
|
|
588
481
|
|
|
589
|
-
This
|
|
590
|
-
|
|
591
|
-
|
|
482
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
|
483
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
|
484
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
|
592
485
|
|
|
593
|
-
|
|
594
|
-
|
|
486
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
|
487
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
|
488
|
+
ensuring that the flow execution can continue.
|
|
595
489
|
|
|
596
490
|
|
|
597
491
|
Parameters
|
|
598
492
|
----------
|
|
599
|
-
|
|
600
|
-
Number of
|
|
601
|
-
|
|
602
|
-
Number of minutes
|
|
603
|
-
hours : int, default 0
|
|
604
|
-
Number of hours to wait prior to timing out.
|
|
493
|
+
times : int, default 3
|
|
494
|
+
Number of times to retry this task.
|
|
495
|
+
minutes_between_retries : int, default 2
|
|
496
|
+
Number of minutes between retries.
|
|
605
497
|
"""
|
|
606
498
|
...
|
|
607
499
|
|
|
@@ -684,54 +576,162 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
|
684
576
|
"""
|
|
685
577
|
...
|
|
686
578
|
|
|
579
|
+
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]]]:
|
|
580
|
+
"""
|
|
581
|
+
Specifies that this step should execute on Kubernetes.
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
Parameters
|
|
585
|
+
----------
|
|
586
|
+
cpu : int, default 1
|
|
587
|
+
Number of CPUs required for this step. If `@resources` is
|
|
588
|
+
also present, the maximum value from all decorators is used.
|
|
589
|
+
memory : int, default 4096
|
|
590
|
+
Memory size (in MB) required for this step. If
|
|
591
|
+
`@resources` is also present, the maximum value from all decorators is
|
|
592
|
+
used.
|
|
593
|
+
disk : int, default 10240
|
|
594
|
+
Disk size (in MB) required for this step. If
|
|
595
|
+
`@resources` is also present, the maximum value from all decorators is
|
|
596
|
+
used.
|
|
597
|
+
image : str, optional, default None
|
|
598
|
+
Docker image to use when launching on Kubernetes. If not specified, and
|
|
599
|
+
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
|
600
|
+
not, a default Docker image mapping to the current version of Python is used.
|
|
601
|
+
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
|
602
|
+
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
|
603
|
+
image_pull_secrets: List[str], default []
|
|
604
|
+
The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
|
|
605
|
+
Kubernetes image pull secrets to use when pulling container images
|
|
606
|
+
in Kubernetes.
|
|
607
|
+
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
|
608
|
+
Kubernetes service account to use when launching pod in Kubernetes.
|
|
609
|
+
secrets : List[str], optional, default None
|
|
610
|
+
Kubernetes secrets to use when launching pod in Kubernetes. These
|
|
611
|
+
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
|
612
|
+
in Metaflow configuration.
|
|
613
|
+
node_selector: Union[Dict[str,str], str], optional, default None
|
|
614
|
+
Kubernetes node selector(s) to apply to the pod running the task.
|
|
615
|
+
Can be passed in as a comma separated string of values e.g.
|
|
616
|
+
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
|
617
|
+
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
|
618
|
+
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
|
619
|
+
Kubernetes namespace to use when launching pod in Kubernetes.
|
|
620
|
+
gpu : int, optional, default None
|
|
621
|
+
Number of GPUs required for this step. A value of zero implies that
|
|
622
|
+
the scheduled node should not have GPUs.
|
|
623
|
+
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
|
624
|
+
The vendor of the GPUs to be used for this step.
|
|
625
|
+
tolerations : List[Dict[str,str]], default []
|
|
626
|
+
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
|
627
|
+
Kubernetes tolerations to use when launching pod in Kubernetes.
|
|
628
|
+
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
|
629
|
+
Kubernetes labels to use when launching pod in Kubernetes.
|
|
630
|
+
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
|
631
|
+
Kubernetes annotations to use when launching pod in Kubernetes.
|
|
632
|
+
use_tmpfs : bool, default False
|
|
633
|
+
This enables an explicit tmpfs mount for this step.
|
|
634
|
+
tmpfs_tempdir : bool, default True
|
|
635
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
|
636
|
+
tmpfs_size : int, optional, default: None
|
|
637
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
|
638
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
|
639
|
+
memory allocated for this step.
|
|
640
|
+
tmpfs_path : str, optional, default /metaflow_temp
|
|
641
|
+
Path to tmpfs mount for this step.
|
|
642
|
+
persistent_volume_claims : Dict[str, str], optional, default None
|
|
643
|
+
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
|
644
|
+
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
|
645
|
+
shared_memory: int, optional
|
|
646
|
+
Shared memory size (in MiB) required for this step
|
|
647
|
+
port: int, optional
|
|
648
|
+
Port number to specify in the Kubernetes job object
|
|
649
|
+
compute_pool : str, optional, default None
|
|
650
|
+
Compute pool to be used for for this step.
|
|
651
|
+
If not specified, any accessible compute pool within the perimeter is used.
|
|
652
|
+
hostname_resolution_timeout: int, default 10 * 60
|
|
653
|
+
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
|
654
|
+
Only applicable when @parallel is used.
|
|
655
|
+
qos: str, default: Burstable
|
|
656
|
+
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
|
657
|
+
|
|
658
|
+
security_context: Dict[str, Any], optional, default None
|
|
659
|
+
Container security context. Applies to the task container. Allows the following keys:
|
|
660
|
+
- privileged: bool, optional, default None
|
|
661
|
+
- allow_privilege_escalation: bool, optional, default None
|
|
662
|
+
- run_as_user: int, optional, default None
|
|
663
|
+
- run_as_group: int, optional, default None
|
|
664
|
+
- run_as_non_root: bool, optional, default None
|
|
665
|
+
"""
|
|
666
|
+
...
|
|
667
|
+
|
|
687
668
|
@typing.overload
|
|
688
|
-
def
|
|
669
|
+
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]]]:
|
|
689
670
|
"""
|
|
690
|
-
Specifies
|
|
671
|
+
Specifies the PyPI packages for the step.
|
|
691
672
|
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
673
|
+
Information in this decorator will augment any
|
|
674
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
|
675
|
+
you can use `@pypi_base` to set packages required by all
|
|
676
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
696
677
|
|
|
697
678
|
|
|
698
679
|
Parameters
|
|
699
680
|
----------
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
681
|
+
packages : Dict[str, str], default: {}
|
|
682
|
+
Packages to use for this step. The key is the name of the package
|
|
683
|
+
and the value is the version to use.
|
|
684
|
+
python : str, optional, default: None
|
|
685
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
686
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
706
687
|
"""
|
|
707
688
|
...
|
|
708
689
|
|
|
709
690
|
@typing.overload
|
|
710
|
-
def
|
|
691
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
711
692
|
...
|
|
712
693
|
|
|
713
694
|
@typing.overload
|
|
714
|
-
def
|
|
695
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
715
696
|
...
|
|
716
697
|
|
|
717
|
-
def
|
|
698
|
+
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):
|
|
718
699
|
"""
|
|
719
|
-
Specifies
|
|
700
|
+
Specifies the PyPI packages for the step.
|
|
720
701
|
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
702
|
+
Information in this decorator will augment any
|
|
703
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
|
704
|
+
you can use `@pypi_base` to set packages required by all
|
|
705
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
725
706
|
|
|
726
707
|
|
|
727
708
|
Parameters
|
|
728
709
|
----------
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
710
|
+
packages : Dict[str, str], default: {}
|
|
711
|
+
Packages to use for this step. The key is the name of the package
|
|
712
|
+
and the value is the version to use.
|
|
713
|
+
python : str, optional, default: None
|
|
714
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
715
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
716
|
+
"""
|
|
717
|
+
...
|
|
718
|
+
|
|
719
|
+
@typing.overload
|
|
720
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
721
|
+
"""
|
|
722
|
+
Decorator prototype for all step decorators. This function gets specialized
|
|
723
|
+
and imported for all decorators types by _import_plugin_decorators().
|
|
724
|
+
"""
|
|
725
|
+
...
|
|
726
|
+
|
|
727
|
+
@typing.overload
|
|
728
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
729
|
+
...
|
|
730
|
+
|
|
731
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
|
732
|
+
"""
|
|
733
|
+
Decorator prototype for all step decorators. This function gets specialized
|
|
734
|
+
and imported for all decorators types by _import_plugin_decorators().
|
|
735
735
|
"""
|
|
736
736
|
...
|
|
737
737
|
|
|
@@ -884,57 +884,6 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
|
884
884
|
"""
|
|
885
885
|
...
|
|
886
886
|
|
|
887
|
-
@typing.overload
|
|
888
|
-
def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
889
|
-
"""
|
|
890
|
-
Specifies the Conda environment for all steps of the flow.
|
|
891
|
-
|
|
892
|
-
Use `@conda_base` to set common libraries required by all
|
|
893
|
-
steps and use `@conda` to specify step-specific additions.
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
Parameters
|
|
897
|
-
----------
|
|
898
|
-
packages : Dict[str, str], default {}
|
|
899
|
-
Packages to use for this flow. The key is the name of the package
|
|
900
|
-
and the value is the version to use.
|
|
901
|
-
libraries : Dict[str, str], default {}
|
|
902
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
903
|
-
python : str, optional, default None
|
|
904
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
905
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
906
|
-
disabled : bool, default False
|
|
907
|
-
If set to True, disables Conda.
|
|
908
|
-
"""
|
|
909
|
-
...
|
|
910
|
-
|
|
911
|
-
@typing.overload
|
|
912
|
-
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
913
|
-
...
|
|
914
|
-
|
|
915
|
-
def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
|
916
|
-
"""
|
|
917
|
-
Specifies the Conda environment for all steps of the flow.
|
|
918
|
-
|
|
919
|
-
Use `@conda_base` to set common libraries required by all
|
|
920
|
-
steps and use `@conda` to specify step-specific additions.
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
Parameters
|
|
924
|
-
----------
|
|
925
|
-
packages : Dict[str, str], default {}
|
|
926
|
-
Packages to use for this flow. The key is the name of the package
|
|
927
|
-
and the value is the version to use.
|
|
928
|
-
libraries : Dict[str, str], default {}
|
|
929
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
930
|
-
python : str, optional, default None
|
|
931
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
932
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
933
|
-
disabled : bool, default False
|
|
934
|
-
If set to True, disables Conda.
|
|
935
|
-
"""
|
|
936
|
-
...
|
|
937
|
-
|
|
938
887
|
@typing.overload
|
|
939
888
|
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]]:
|
|
940
889
|
"""
|
|
@@ -1036,81 +985,44 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
|
1036
985
|
"""
|
|
1037
986
|
...
|
|
1038
987
|
|
|
1039
|
-
|
|
988
|
+
@typing.overload
|
|
989
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
1040
990
|
"""
|
|
1041
|
-
|
|
1042
|
-
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.
|
|
1043
|
-
|
|
991
|
+
Specifies the PyPI packages for all steps of the flow.
|
|
1044
992
|
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
the slot pool this task should run in,
|
|
1057
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
|
1058
|
-
soft_fail : bool
|
|
1059
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
|
1060
|
-
name : str
|
|
1061
|
-
Name of the sensor on Airflow
|
|
1062
|
-
description : str
|
|
1063
|
-
Description of sensor in the Airflow UI
|
|
1064
|
-
external_dag_id : str
|
|
1065
|
-
The dag_id that contains the task you want to wait for.
|
|
1066
|
-
external_task_ids : List[str]
|
|
1067
|
-
The list of task_ids that you want to wait for.
|
|
1068
|
-
If None (default value) the sensor waits for the DAG. (Default: None)
|
|
1069
|
-
allowed_states : List[str]
|
|
1070
|
-
Iterable of allowed states, (Default: ['success'])
|
|
1071
|
-
failed_states : List[str]
|
|
1072
|
-
Iterable of failed or dis-allowed states. (Default: None)
|
|
1073
|
-
execution_delta : datetime.timedelta
|
|
1074
|
-
time difference with the previous execution to look at,
|
|
1075
|
-
the default is the same logical date as the current task or DAG. (Default: None)
|
|
1076
|
-
check_existence: bool
|
|
1077
|
-
Set to True to check if the external task exists or check if
|
|
1078
|
-
the DAG to wait for exists. (Default: True)
|
|
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.
|
|
1079
1004
|
"""
|
|
1080
1005
|
...
|
|
1081
1006
|
|
|
1082
|
-
|
|
1007
|
+
@typing.overload
|
|
1008
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1009
|
+
...
|
|
1010
|
+
|
|
1011
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
|
1083
1012
|
"""
|
|
1084
|
-
Specifies
|
|
1085
|
-
|
|
1086
|
-
A project-specific namespace is created for all flows that
|
|
1087
|
-
use the same `@project(name)`.
|
|
1013
|
+
Specifies the PyPI packages for all steps of the flow.
|
|
1088
1014
|
|
|
1015
|
+
Use `@pypi_base` to set common packages required by all
|
|
1016
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
1089
1017
|
|
|
1090
1018
|
Parameters
|
|
1091
1019
|
----------
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
The branch to use. If not specified, the branch is set to
|
|
1099
|
-
`user.<username>` unless `production` is set to `True`. This can
|
|
1100
|
-
also be set on the command line using `--branch` as a top-level option.
|
|
1101
|
-
It is an error to specify `branch` in the decorator and on the command line.
|
|
1102
|
-
|
|
1103
|
-
production : bool, default False
|
|
1104
|
-
Whether or not the branch is the production branch. This can also be set on the
|
|
1105
|
-
command line using `--production` as a top-level option. It is an error to specify
|
|
1106
|
-
`production` in the decorator and on the command line.
|
|
1107
|
-
The project branch name will be:
|
|
1108
|
-
- if `branch` is specified:
|
|
1109
|
-
- if `production` is True: `prod.<branch>`
|
|
1110
|
-
- if `production` is False: `test.<branch>`
|
|
1111
|
-
- if `branch` is not specified:
|
|
1112
|
-
- if `production` is True: `prod`
|
|
1113
|
-
- if `production` is False: `user.<username>`
|
|
1020
|
+
packages : Dict[str, str], default: {}
|
|
1021
|
+
Packages to use for this flow. The key is the name of the package
|
|
1022
|
+
and the value is the version to use.
|
|
1023
|
+
python : str, optional, default: None
|
|
1024
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1025
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1114
1026
|
"""
|
|
1115
1027
|
...
|
|
1116
1028
|
|
|
@@ -1165,46 +1077,89 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
|
|
|
1165
1077
|
"""
|
|
1166
1078
|
...
|
|
1167
1079
|
|
|
1168
|
-
def
|
|
1080
|
+
def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
1169
1081
|
"""
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
starts only after all sensors finish.
|
|
1082
|
+
Specifies what flows belong to the same project.
|
|
1083
|
+
|
|
1084
|
+
A project-specific namespace is created for all flows that
|
|
1085
|
+
use the same `@project(name)`.
|
|
1175
1086
|
|
|
1176
1087
|
|
|
1177
1088
|
Parameters
|
|
1178
1089
|
----------
|
|
1179
|
-
timeout : int
|
|
1180
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
|
1181
|
-
poke_interval : int
|
|
1182
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
|
1183
|
-
mode : str
|
|
1184
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
|
1185
|
-
exponential_backoff : bool
|
|
1186
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
|
1187
|
-
pool : str
|
|
1188
|
-
the slot pool this task should run in,
|
|
1189
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
|
1190
|
-
soft_fail : bool
|
|
1191
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
|
1192
1090
|
name : str
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1091
|
+
Project name. Make sure that the name is unique amongst all
|
|
1092
|
+
projects that use the same production scheduler. The name may
|
|
1093
|
+
contain only lowercase alphanumeric characters and underscores.
|
|
1094
|
+
|
|
1095
|
+
branch : Optional[str], default None
|
|
1096
|
+
The branch to use. If not specified, the branch is set to
|
|
1097
|
+
`user.<username>` unless `production` is set to `True`. This can
|
|
1098
|
+
also be set on the command line using `--branch` as a top-level option.
|
|
1099
|
+
It is an error to specify `branch` in the decorator and on the command line.
|
|
1100
|
+
|
|
1101
|
+
production : bool, default False
|
|
1102
|
+
Whether or not the branch is the production branch. This can also be set on the
|
|
1103
|
+
command line using `--production` as a top-level option. It is an error to specify
|
|
1104
|
+
`production` in the decorator and on the command line.
|
|
1105
|
+
The project branch name will be:
|
|
1106
|
+
- if `branch` is specified:
|
|
1107
|
+
- if `production` is True: `prod.<branch>`
|
|
1108
|
+
- if `production` is False: `test.<branch>`
|
|
1109
|
+
- if `branch` is not specified:
|
|
1110
|
+
- if `production` is True: `prod`
|
|
1111
|
+
- if `production` is False: `user.<username>`
|
|
1112
|
+
"""
|
|
1113
|
+
...
|
|
1114
|
+
|
|
1115
|
+
@typing.overload
|
|
1116
|
+
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]]:
|
|
1117
|
+
"""
|
|
1118
|
+
Specifies the Conda environment for all steps of the flow.
|
|
1119
|
+
|
|
1120
|
+
Use `@conda_base` to set common libraries required by all
|
|
1121
|
+
steps and use `@conda` to specify step-specific additions.
|
|
1122
|
+
|
|
1123
|
+
|
|
1124
|
+
Parameters
|
|
1125
|
+
----------
|
|
1126
|
+
packages : Dict[str, str], default {}
|
|
1127
|
+
Packages to use for this flow. The key is the name of the package
|
|
1128
|
+
and the value is the version to use.
|
|
1129
|
+
libraries : Dict[str, str], default {}
|
|
1130
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
1131
|
+
python : str, optional, default None
|
|
1132
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1133
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1134
|
+
disabled : bool, default False
|
|
1135
|
+
If set to True, disables Conda.
|
|
1136
|
+
"""
|
|
1137
|
+
...
|
|
1138
|
+
|
|
1139
|
+
@typing.overload
|
|
1140
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1141
|
+
...
|
|
1142
|
+
|
|
1143
|
+
def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
|
1144
|
+
"""
|
|
1145
|
+
Specifies the Conda environment for all steps of the flow.
|
|
1146
|
+
|
|
1147
|
+
Use `@conda_base` to set common libraries required by all
|
|
1148
|
+
steps and use `@conda` to specify step-specific additions.
|
|
1149
|
+
|
|
1150
|
+
|
|
1151
|
+
Parameters
|
|
1152
|
+
----------
|
|
1153
|
+
packages : Dict[str, str], default {}
|
|
1154
|
+
Packages to use for this flow. The key is the name of the package
|
|
1155
|
+
and the value is the version to use.
|
|
1156
|
+
libraries : Dict[str, str], default {}
|
|
1157
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
1158
|
+
python : str, optional, default None
|
|
1159
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1160
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1161
|
+
disabled : bool, default False
|
|
1162
|
+
If set to True, disables Conda.
|
|
1208
1163
|
"""
|
|
1209
1164
|
...
|
|
1210
1165
|
|
|
@@ -1301,44 +1256,89 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
|
1301
1256
|
"""
|
|
1302
1257
|
...
|
|
1303
1258
|
|
|
1304
|
-
|
|
1305
|
-
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
1259
|
+
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]]:
|
|
1306
1260
|
"""
|
|
1307
|
-
|
|
1261
|
+
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.
|
|
1262
|
+
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.
|
|
1308
1263
|
|
|
1309
|
-
Use `@pypi_base` to set common packages required by all
|
|
1310
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
1311
1264
|
|
|
1312
1265
|
Parameters
|
|
1313
1266
|
----------
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1267
|
+
timeout : int
|
|
1268
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
|
1269
|
+
poke_interval : int
|
|
1270
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
|
1271
|
+
mode : str
|
|
1272
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
|
1273
|
+
exponential_backoff : bool
|
|
1274
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
|
1275
|
+
pool : str
|
|
1276
|
+
the slot pool this task should run in,
|
|
1277
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
|
1278
|
+
soft_fail : bool
|
|
1279
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
|
1280
|
+
name : str
|
|
1281
|
+
Name of the sensor on Airflow
|
|
1282
|
+
description : str
|
|
1283
|
+
Description of sensor in the Airflow UI
|
|
1284
|
+
external_dag_id : str
|
|
1285
|
+
The dag_id that contains the task you want to wait for.
|
|
1286
|
+
external_task_ids : List[str]
|
|
1287
|
+
The list of task_ids that you want to wait for.
|
|
1288
|
+
If None (default value) the sensor waits for the DAG. (Default: None)
|
|
1289
|
+
allowed_states : List[str]
|
|
1290
|
+
Iterable of allowed states, (Default: ['success'])
|
|
1291
|
+
failed_states : List[str]
|
|
1292
|
+
Iterable of failed or dis-allowed states. (Default: None)
|
|
1293
|
+
execution_delta : datetime.timedelta
|
|
1294
|
+
time difference with the previous execution to look at,
|
|
1295
|
+
the default is the same logical date as the current task or DAG. (Default: None)
|
|
1296
|
+
check_existence: bool
|
|
1297
|
+
Set to True to check if the external task exists or check if
|
|
1298
|
+
the DAG to wait for exists. (Default: True)
|
|
1320
1299
|
"""
|
|
1321
1300
|
...
|
|
1322
1301
|
|
|
1323
|
-
|
|
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):
|
|
1302
|
+
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]]:
|
|
1328
1303
|
"""
|
|
1329
|
-
|
|
1304
|
+
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)
|
|
1305
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
|
1306
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
|
1307
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
|
1308
|
+
starts only after all sensors finish.
|
|
1330
1309
|
|
|
1331
|
-
Use `@pypi_base` to set common packages required by all
|
|
1332
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
1333
1310
|
|
|
1334
1311
|
Parameters
|
|
1335
1312
|
----------
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1313
|
+
timeout : int
|
|
1314
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
|
1315
|
+
poke_interval : int
|
|
1316
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
|
1317
|
+
mode : str
|
|
1318
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
|
1319
|
+
exponential_backoff : bool
|
|
1320
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
|
1321
|
+
pool : str
|
|
1322
|
+
the slot pool this task should run in,
|
|
1323
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
|
1324
|
+
soft_fail : bool
|
|
1325
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
|
1326
|
+
name : str
|
|
1327
|
+
Name of the sensor on Airflow
|
|
1328
|
+
description : str
|
|
1329
|
+
Description of sensor in the Airflow UI
|
|
1330
|
+
bucket_key : Union[str, List[str]]
|
|
1331
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
|
1332
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
|
1333
|
+
bucket_name : str
|
|
1334
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
|
1335
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
|
1336
|
+
wildcard_match : bool
|
|
1337
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
|
1338
|
+
aws_conn_id : str
|
|
1339
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
|
1340
|
+
verify : bool
|
|
1341
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
|
1342
1342
|
"""
|
|
1343
1343
|
...
|
|
1344
1344
|
|