metaflow-stubs 2.13.10__py2.py3-none-any.whl → 2.14.0__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 +487 -487
- metaflow-stubs/cards.pyi +2 -2
- metaflow-stubs/cli.pyi +2 -2
- metaflow-stubs/cli_components/__init__.pyi +2 -2
- metaflow-stubs/cli_components/utils.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +2 -2
- metaflow-stubs/client/core.pyi +5 -5
- metaflow-stubs/client/filecache.pyi +3 -3
- metaflow-stubs/events.pyi +3 -3
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +3 -3
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +3 -3
- metaflow-stubs/info_file.pyi +2 -2
- metaflow-stubs/metadata_provider/__init__.pyi +2 -2
- metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
- metaflow-stubs/metadata_provider/metadata.pyi +2 -2
- metaflow-stubs/metadata_provider/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -2
- metaflow-stubs/metaflow_current.pyi +5 -5
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/parameters.pyi +3 -3
- 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 +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +4 -4
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -3
- metaflow-stubs/plugins/aws/__init__.pyi +4 -4
- metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +3 -3
- 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 +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 +2 -2
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +3 -3
- metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3.pyi +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 +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
- metaflow-stubs/plugins/project_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/__init__.pyi +3 -3
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +5 -5
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
- metaflow-stubs/plugins/pypi/utils.pyi +2 -2
- metaflow-stubs/plugins/resources_decorator.pyi +2 -2
- metaflow-stubs/plugins/retry_decorator.pyi +2 -2
- metaflow-stubs/plugins/secrets/__init__.pyi +3 -3
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
- metaflow-stubs/plugins/storage_executor.pyi +2 -2
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
- metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +28 -28
- metaflow-stubs/runner/deployer_impl.pyi +2 -2
- metaflow-stubs/runner/metaflow_runner.pyi +2 -2
- metaflow-stubs/runner/nbdeploy.pyi +2 -2
- metaflow-stubs/runner/nbrun.pyi +2 -2
- metaflow-stubs/runner/subprocess_manager.pyi +2 -2
- metaflow-stubs/runner/utils.pyi +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_decorators.pyi +6 -6
- metaflow-stubs/user_configs/config_options.pyi +2 -2
- metaflow-stubs/user_configs/config_parameters.pyi +7 -7
- metaflow-stubs/version.pyi +2 -2
- {metaflow_stubs-2.13.10.dist-info → metaflow_stubs-2.14.0.dist-info}/METADATA +2 -2
- metaflow_stubs-2.14.0.dist-info/RECORD +145 -0
- metaflow_stubs-2.13.10.dist-info/RECORD +0 -145
- {metaflow_stubs-2.13.10.dist-info → metaflow_stubs-2.14.0.dist-info}/WHEEL +0 -0
- {metaflow_stubs-2.13.10.dist-info → metaflow_stubs-2.14.0.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.
|
4
|
-
# Generated on 2025-02-
|
3
|
+
# MF version: 2.14.0 #
|
4
|
+
# Generated on 2025-02-11T19:31:25.349322 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -143,81 +143,116 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
143
143
|
...
|
144
144
|
|
145
145
|
@typing.overload
|
146
|
-
def
|
146
|
+
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]]]:
|
147
147
|
"""
|
148
|
-
Specifies the
|
148
|
+
Specifies the number of times the task corresponding
|
149
|
+
to a step needs to be retried.
|
149
150
|
|
150
|
-
|
151
|
-
|
151
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
152
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
153
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
152
154
|
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
```
|
157
|
-
or
|
158
|
-
```
|
159
|
-
python myflow.py run --with kubernetes
|
160
|
-
```
|
161
|
-
which executes the flow on the desired system using the
|
162
|
-
requirements specified in `@resources`.
|
155
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
156
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
157
|
+
ensuring that the flow execution can continue.
|
163
158
|
|
164
159
|
|
165
160
|
Parameters
|
166
161
|
----------
|
167
|
-
|
168
|
-
Number of
|
169
|
-
|
170
|
-
Number of
|
171
|
-
disk : int, optional, default None
|
172
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
173
|
-
memory : int, default 4096
|
174
|
-
Memory size (in MB) required for this step.
|
175
|
-
shared_memory : int, optional, default None
|
176
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
177
|
-
This parameter maps to the `--shm-size` option in Docker.
|
162
|
+
times : int, default 3
|
163
|
+
Number of times to retry this task.
|
164
|
+
minutes_between_retries : int, default 2
|
165
|
+
Number of minutes between retries.
|
178
166
|
"""
|
179
167
|
...
|
180
168
|
|
181
169
|
@typing.overload
|
182
|
-
def
|
170
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
183
171
|
...
|
184
172
|
|
185
173
|
@typing.overload
|
186
|
-
def
|
174
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
187
175
|
...
|
188
176
|
|
189
|
-
def
|
177
|
+
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):
|
190
178
|
"""
|
191
|
-
Specifies the
|
179
|
+
Specifies the number of times the task corresponding
|
180
|
+
to a step needs to be retried.
|
192
181
|
|
193
|
-
|
194
|
-
|
182
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
183
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
184
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
195
185
|
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
```
|
200
|
-
or
|
201
|
-
```
|
202
|
-
python myflow.py run --with kubernetes
|
203
|
-
```
|
204
|
-
which executes the flow on the desired system using the
|
205
|
-
requirements specified in `@resources`.
|
186
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
187
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
188
|
+
ensuring that the flow execution can continue.
|
206
189
|
|
207
190
|
|
208
191
|
Parameters
|
209
192
|
----------
|
210
|
-
|
211
|
-
Number of
|
212
|
-
|
213
|
-
Number of
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
193
|
+
times : int, default 3
|
194
|
+
Number of times to retry this task.
|
195
|
+
minutes_between_retries : int, default 2
|
196
|
+
Number of minutes between retries.
|
197
|
+
"""
|
198
|
+
...
|
199
|
+
|
200
|
+
@typing.overload
|
201
|
+
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]]]:
|
202
|
+
"""
|
203
|
+
Specifies the Conda environment for the step.
|
204
|
+
|
205
|
+
Information in this decorator will augment any
|
206
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
207
|
+
you can use `@conda_base` to set packages required by all
|
208
|
+
steps and use `@conda` to specify step-specific overrides.
|
209
|
+
|
210
|
+
|
211
|
+
Parameters
|
212
|
+
----------
|
213
|
+
packages : Dict[str, str], default {}
|
214
|
+
Packages to use for this step. The key is the name of the package
|
215
|
+
and the value is the version to use.
|
216
|
+
libraries : Dict[str, str], default {}
|
217
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
218
|
+
python : str, optional, default None
|
219
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
220
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
221
|
+
disabled : bool, default False
|
222
|
+
If set to True, disables @conda.
|
223
|
+
"""
|
224
|
+
...
|
225
|
+
|
226
|
+
@typing.overload
|
227
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
228
|
+
...
|
229
|
+
|
230
|
+
@typing.overload
|
231
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
232
|
+
...
|
233
|
+
|
234
|
+
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):
|
235
|
+
"""
|
236
|
+
Specifies the Conda environment for the step.
|
237
|
+
|
238
|
+
Information in this decorator will augment any
|
239
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
240
|
+
you can use `@conda_base` to set packages required by all
|
241
|
+
steps and use `@conda` to specify step-specific overrides.
|
242
|
+
|
243
|
+
|
244
|
+
Parameters
|
245
|
+
----------
|
246
|
+
packages : Dict[str, str], default {}
|
247
|
+
Packages to use for this step. The key is the name of the package
|
248
|
+
and the value is the version to use.
|
249
|
+
libraries : Dict[str, str], default {}
|
250
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
251
|
+
python : str, optional, default None
|
252
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
253
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
254
|
+
disabled : bool, default False
|
255
|
+
If set to True, disables @conda.
|
221
256
|
"""
|
222
257
|
...
|
223
258
|
|
@@ -241,37 +276,53 @@ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
241
276
|
...
|
242
277
|
|
243
278
|
@typing.overload
|
244
|
-
def
|
279
|
+
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]]]:
|
245
280
|
"""
|
246
|
-
Specifies
|
247
|
-
|
281
|
+
Specifies the PyPI packages for the step.
|
282
|
+
|
283
|
+
Information in this decorator will augment any
|
284
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
285
|
+
you can use `@pypi_base` to set packages required by all
|
286
|
+
steps and use `@pypi` to specify step-specific overrides.
|
248
287
|
|
249
288
|
|
250
289
|
Parameters
|
251
290
|
----------
|
252
|
-
|
253
|
-
|
291
|
+
packages : Dict[str, str], default: {}
|
292
|
+
Packages to use for this step. The key is the name of the package
|
293
|
+
and the value is the version to use.
|
294
|
+
python : str, optional, default: None
|
295
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
296
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
254
297
|
"""
|
255
298
|
...
|
256
299
|
|
257
300
|
@typing.overload
|
258
|
-
def
|
301
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
259
302
|
...
|
260
303
|
|
261
304
|
@typing.overload
|
262
|
-
def
|
305
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
263
306
|
...
|
264
307
|
|
265
|
-
def
|
308
|
+
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):
|
266
309
|
"""
|
267
|
-
Specifies
|
268
|
-
|
310
|
+
Specifies the PyPI packages for the step.
|
311
|
+
|
312
|
+
Information in this decorator will augment any
|
313
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
314
|
+
you can use `@pypi_base` to set packages required by all
|
315
|
+
steps and use `@pypi` to specify step-specific overrides.
|
269
316
|
|
270
317
|
|
271
318
|
Parameters
|
272
319
|
----------
|
273
|
-
|
274
|
-
|
320
|
+
packages : Dict[str, str], default: {}
|
321
|
+
Packages to use for this step. The key is the name of the package
|
322
|
+
and the value is the version to use.
|
323
|
+
python : str, optional, default: None
|
324
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
325
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
275
326
|
"""
|
276
327
|
...
|
277
328
|
|
@@ -334,57 +385,6 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
334
385
|
"""
|
335
386
|
...
|
336
387
|
|
337
|
-
@typing.overload
|
338
|
-
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]]]:
|
339
|
-
"""
|
340
|
-
Specifies the PyPI packages for the step.
|
341
|
-
|
342
|
-
Information in this decorator will augment any
|
343
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
344
|
-
you can use `@pypi_base` to set packages required by all
|
345
|
-
steps and use `@pypi` to specify step-specific overrides.
|
346
|
-
|
347
|
-
|
348
|
-
Parameters
|
349
|
-
----------
|
350
|
-
packages : Dict[str, str], default: {}
|
351
|
-
Packages to use for this step. The key is the name of the package
|
352
|
-
and the value is the version to use.
|
353
|
-
python : str, optional, default: None
|
354
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
355
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
356
|
-
"""
|
357
|
-
...
|
358
|
-
|
359
|
-
@typing.overload
|
360
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
361
|
-
...
|
362
|
-
|
363
|
-
@typing.overload
|
364
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
365
|
-
...
|
366
|
-
|
367
|
-
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
|
-
"""
|
369
|
-
Specifies the PyPI packages for the step.
|
370
|
-
|
371
|
-
Information in this decorator will augment any
|
372
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
373
|
-
you can use `@pypi_base` to set packages required by all
|
374
|
-
steps and use `@pypi` to specify step-specific overrides.
|
375
|
-
|
376
|
-
|
377
|
-
Parameters
|
378
|
-
----------
|
379
|
-
packages : Dict[str, str], default: {}
|
380
|
-
Packages to use for this step. The key is the name of the package
|
381
|
-
and the value is the version to use.
|
382
|
-
python : str, optional, default: None
|
383
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
384
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
385
|
-
"""
|
386
|
-
...
|
387
|
-
|
388
388
|
@typing.overload
|
389
389
|
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]]]:
|
390
390
|
"""
|
@@ -437,51 +437,81 @@ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
437
437
|
...
|
438
438
|
|
439
439
|
@typing.overload
|
440
|
-
def
|
440
|
+
def resources(*, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
441
441
|
"""
|
442
|
-
|
442
|
+
Specifies the resources needed when executing this step.
|
443
443
|
|
444
|
-
|
444
|
+
Use `@resources` to specify the resource requirements
|
445
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
446
|
+
|
447
|
+
You can choose the compute layer on the command line by executing e.g.
|
448
|
+
```
|
449
|
+
python myflow.py run --with batch
|
450
|
+
```
|
451
|
+
or
|
452
|
+
```
|
453
|
+
python myflow.py run --with kubernetes
|
454
|
+
```
|
455
|
+
which executes the flow on the desired system using the
|
456
|
+
requirements specified in `@resources`.
|
445
457
|
|
446
458
|
|
447
459
|
Parameters
|
448
460
|
----------
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
461
|
+
cpu : int, default 1
|
462
|
+
Number of CPUs required for this step.
|
463
|
+
gpu : int, optional, default None
|
464
|
+
Number of GPUs required for this step.
|
465
|
+
disk : int, optional, default None
|
466
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
467
|
+
memory : int, default 4096
|
468
|
+
Memory size (in MB) required for this step.
|
469
|
+
shared_memory : int, optional, default None
|
470
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
471
|
+
This parameter maps to the `--shm-size` option in Docker.
|
457
472
|
"""
|
458
473
|
...
|
459
474
|
|
460
475
|
@typing.overload
|
461
|
-
def
|
476
|
+
def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
462
477
|
...
|
463
478
|
|
464
479
|
@typing.overload
|
465
|
-
def
|
480
|
+
def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
466
481
|
...
|
467
482
|
|
468
|
-
def
|
483
|
+
def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
|
469
484
|
"""
|
470
|
-
|
485
|
+
Specifies the resources needed when executing this step.
|
471
486
|
|
472
|
-
|
487
|
+
Use `@resources` to specify the resource requirements
|
488
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
489
|
+
|
490
|
+
You can choose the compute layer on the command line by executing e.g.
|
491
|
+
```
|
492
|
+
python myflow.py run --with batch
|
493
|
+
```
|
494
|
+
or
|
495
|
+
```
|
496
|
+
python myflow.py run --with kubernetes
|
497
|
+
```
|
498
|
+
which executes the flow on the desired system using the
|
499
|
+
requirements specified in `@resources`.
|
473
500
|
|
474
501
|
|
475
502
|
Parameters
|
476
503
|
----------
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
504
|
+
cpu : int, default 1
|
505
|
+
Number of CPUs required for this step.
|
506
|
+
gpu : int, optional, default None
|
507
|
+
Number of GPUs required for this step.
|
508
|
+
disk : int, optional, default None
|
509
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
510
|
+
memory : int, default 4096
|
511
|
+
Memory size (in MB) required for this step.
|
512
|
+
shared_memory : int, optional, default None
|
513
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
514
|
+
This parameter maps to the `--shm-size` option in Docker.
|
485
515
|
"""
|
486
516
|
...
|
487
517
|
|
@@ -518,6 +548,118 @@ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], Non
|
|
518
548
|
"""
|
519
549
|
...
|
520
550
|
|
551
|
+
@typing.overload
|
552
|
+
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]]]:
|
553
|
+
"""
|
554
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
555
|
+
the execution of a step.
|
556
|
+
|
557
|
+
|
558
|
+
Parameters
|
559
|
+
----------
|
560
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
561
|
+
List of secret specs, defining how the secrets are to be retrieved
|
562
|
+
"""
|
563
|
+
...
|
564
|
+
|
565
|
+
@typing.overload
|
566
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
567
|
+
...
|
568
|
+
|
569
|
+
@typing.overload
|
570
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
571
|
+
...
|
572
|
+
|
573
|
+
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]]] = []):
|
574
|
+
"""
|
575
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
576
|
+
the execution of a step.
|
577
|
+
|
578
|
+
|
579
|
+
Parameters
|
580
|
+
----------
|
581
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
582
|
+
List of secret specs, defining how the secrets are to be retrieved
|
583
|
+
"""
|
584
|
+
...
|
585
|
+
|
586
|
+
def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[str] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable') -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
587
|
+
"""
|
588
|
+
Specifies that this step should execute on Kubernetes.
|
589
|
+
|
590
|
+
|
591
|
+
Parameters
|
592
|
+
----------
|
593
|
+
cpu : int, default 1
|
594
|
+
Number of CPUs required for this step. If `@resources` is
|
595
|
+
also present, the maximum value from all decorators is used.
|
596
|
+
memory : int, default 4096
|
597
|
+
Memory size (in MB) required for this step. If
|
598
|
+
`@resources` is also present, the maximum value from all decorators is
|
599
|
+
used.
|
600
|
+
disk : int, default 10240
|
601
|
+
Disk size (in MB) required for this step. If
|
602
|
+
`@resources` is also present, the maximum value from all decorators is
|
603
|
+
used.
|
604
|
+
image : str, optional, default None
|
605
|
+
Docker image to use when launching on Kubernetes. If not specified, and
|
606
|
+
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
607
|
+
not, a default Docker image mapping to the current version of Python is used.
|
608
|
+
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
609
|
+
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
610
|
+
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
611
|
+
Kubernetes service account to use when launching pod in Kubernetes.
|
612
|
+
secrets : List[str], optional, default None
|
613
|
+
Kubernetes secrets to use when launching pod in Kubernetes. These
|
614
|
+
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
615
|
+
in Metaflow configuration.
|
616
|
+
node_selector: Union[Dict[str,str], str], optional, default None
|
617
|
+
Kubernetes node selector(s) to apply to the pod running the task.
|
618
|
+
Can be passed in as a comma separated string of values e.g.
|
619
|
+
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
620
|
+
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
621
|
+
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
622
|
+
Kubernetes namespace to use when launching pod in Kubernetes.
|
623
|
+
gpu : int, optional, default None
|
624
|
+
Number of GPUs required for this step. A value of zero implies that
|
625
|
+
the scheduled node should not have GPUs.
|
626
|
+
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
627
|
+
The vendor of the GPUs to be used for this step.
|
628
|
+
tolerations : List[str], default []
|
629
|
+
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
630
|
+
Kubernetes tolerations to use when launching pod in Kubernetes.
|
631
|
+
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
632
|
+
Kubernetes labels to use when launching pod in Kubernetes.
|
633
|
+
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
634
|
+
Kubernetes annotations to use when launching pod in Kubernetes.
|
635
|
+
use_tmpfs : bool, default False
|
636
|
+
This enables an explicit tmpfs mount for this step.
|
637
|
+
tmpfs_tempdir : bool, default True
|
638
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
639
|
+
tmpfs_size : int, optional, default: None
|
640
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
641
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
642
|
+
memory allocated for this step.
|
643
|
+
tmpfs_path : str, optional, default /metaflow_temp
|
644
|
+
Path to tmpfs mount for this step.
|
645
|
+
persistent_volume_claims : Dict[str, str], optional, default None
|
646
|
+
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
647
|
+
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
648
|
+
shared_memory: int, optional
|
649
|
+
Shared memory size (in MiB) required for this step
|
650
|
+
port: int, optional
|
651
|
+
Port number to specify in the Kubernetes job object
|
652
|
+
compute_pool : str, optional, default None
|
653
|
+
Compute pool to be used for for this step.
|
654
|
+
If not specified, any accessible compute pool within the perimeter is used.
|
655
|
+
hostname_resolution_timeout: int, default 10 * 60
|
656
|
+
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
657
|
+
Only applicable when @parallel is used.
|
658
|
+
qos: str, default: Burstable
|
659
|
+
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
660
|
+
"""
|
661
|
+
...
|
662
|
+
|
521
663
|
@typing.overload
|
522
664
|
def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = 'METAFLOW_BATCH_JOB_QUEUE', iam_role: str = 'METAFLOW_ECS_S3_ACCESS_IAM_ROLE', execution_role: str = 'METAFLOW_ECS_FARGATE_EXECUTION_ROLE', shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[str]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
523
665
|
"""
|
@@ -668,193 +810,143 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
668
810
|
...
|
669
811
|
|
670
812
|
@typing.overload
|
671
|
-
def
|
813
|
+
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]]]:
|
672
814
|
"""
|
673
|
-
|
674
|
-
to a step needs to be retried.
|
675
|
-
|
676
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
677
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
678
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
815
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
679
816
|
|
680
|
-
|
681
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
682
|
-
ensuring that the flow execution can continue.
|
817
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
683
818
|
|
684
819
|
|
685
820
|
Parameters
|
686
821
|
----------
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
822
|
+
type : str, default 'default'
|
823
|
+
Card type.
|
824
|
+
id : str, optional, default None
|
825
|
+
If multiple cards are present, use this id to identify this card.
|
826
|
+
options : Dict[str, Any], default {}
|
827
|
+
Options passed to the card. The contents depend on the card type.
|
828
|
+
timeout : int, default 45
|
829
|
+
Interrupt reporting if it takes more than this many seconds.
|
691
830
|
"""
|
692
831
|
...
|
693
832
|
|
694
833
|
@typing.overload
|
695
|
-
def
|
834
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
696
835
|
...
|
697
836
|
|
698
837
|
@typing.overload
|
699
|
-
def
|
838
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
700
839
|
...
|
701
840
|
|
702
|
-
def
|
841
|
+
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):
|
703
842
|
"""
|
704
|
-
|
705
|
-
to a step needs to be retried.
|
706
|
-
|
707
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
708
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
709
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
843
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
710
844
|
|
711
|
-
|
712
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
713
|
-
ensuring that the flow execution can continue.
|
845
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
714
846
|
|
715
847
|
|
716
848
|
Parameters
|
717
849
|
----------
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
850
|
+
type : str, default 'default'
|
851
|
+
Card type.
|
852
|
+
id : str, optional, default None
|
853
|
+
If multiple cards are present, use this id to identify this card.
|
854
|
+
options : Dict[str, Any], default {}
|
855
|
+
Options passed to the card. The contents depend on the card type.
|
856
|
+
timeout : int, default 45
|
857
|
+
Interrupt reporting if it takes more than this many seconds.
|
722
858
|
"""
|
723
859
|
...
|
724
860
|
|
725
861
|
@typing.overload
|
726
|
-
def
|
862
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
727
863
|
"""
|
728
|
-
Specifies the
|
729
|
-
|
730
|
-
Information in this decorator will augment any
|
731
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
732
|
-
you can use `@conda_base` to set packages required by all
|
733
|
-
steps and use `@conda` to specify step-specific overrides.
|
864
|
+
Specifies the PyPI packages for all steps of the flow.
|
734
865
|
|
866
|
+
Use `@pypi_base` to set common packages required by all
|
867
|
+
steps and use `@pypi` to specify step-specific overrides.
|
735
868
|
|
736
869
|
Parameters
|
737
870
|
----------
|
738
|
-
packages : Dict[str, str], default {}
|
739
|
-
Packages to use for this
|
871
|
+
packages : Dict[str, str], default: {}
|
872
|
+
Packages to use for this flow. The key is the name of the package
|
740
873
|
and the value is the version to use.
|
741
|
-
|
742
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
743
|
-
python : str, optional, default None
|
874
|
+
python : str, optional, default: None
|
744
875
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
745
876
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
746
|
-
disabled : bool, default False
|
747
|
-
If set to True, disables @conda.
|
748
877
|
"""
|
749
878
|
...
|
750
879
|
|
751
880
|
@typing.overload
|
752
|
-
def
|
753
|
-
...
|
754
|
-
|
755
|
-
@typing.overload
|
756
|
-
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
881
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
757
882
|
...
|
758
883
|
|
759
|
-
def
|
884
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
760
885
|
"""
|
761
|
-
Specifies the
|
762
|
-
|
763
|
-
Information in this decorator will augment any
|
764
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
765
|
-
you can use `@conda_base` to set packages required by all
|
766
|
-
steps and use `@conda` to specify step-specific overrides.
|
886
|
+
Specifies the PyPI packages for all steps of the flow.
|
767
887
|
|
888
|
+
Use `@pypi_base` to set common packages required by all
|
889
|
+
steps and use `@pypi` to specify step-specific overrides.
|
768
890
|
|
769
891
|
Parameters
|
770
892
|
----------
|
771
|
-
packages : Dict[str, str], default {}
|
772
|
-
Packages to use for this
|
893
|
+
packages : Dict[str, str], default: {}
|
894
|
+
Packages to use for this flow. The key is the name of the package
|
773
895
|
and the value is the version to use.
|
774
|
-
|
775
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
776
|
-
python : str, optional, default None
|
896
|
+
python : str, optional, default: None
|
777
897
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
778
898
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
779
|
-
disabled : bool, default False
|
780
|
-
If set to True, disables @conda.
|
781
899
|
"""
|
782
900
|
...
|
783
901
|
|
784
|
-
|
902
|
+
@typing.overload
|
903
|
+
def schedule(*, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
785
904
|
"""
|
786
|
-
Specifies
|
905
|
+
Specifies the times when the flow should be run when running on a
|
906
|
+
production scheduler.
|
787
907
|
|
788
908
|
|
789
909
|
Parameters
|
790
910
|
----------
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
the
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
Kubernetes labels to use when launching pod in Kubernetes.
|
831
|
-
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
832
|
-
Kubernetes annotations to use when launching pod in Kubernetes.
|
833
|
-
use_tmpfs : bool, default False
|
834
|
-
This enables an explicit tmpfs mount for this step.
|
835
|
-
tmpfs_tempdir : bool, default True
|
836
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
837
|
-
tmpfs_size : int, optional, default: None
|
838
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
839
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
840
|
-
memory allocated for this step.
|
841
|
-
tmpfs_path : str, optional, default /metaflow_temp
|
842
|
-
Path to tmpfs mount for this step.
|
843
|
-
persistent_volume_claims : Dict[str, str], optional, default None
|
844
|
-
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
845
|
-
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
846
|
-
shared_memory: int, optional
|
847
|
-
Shared memory size (in MiB) required for this step
|
848
|
-
port: int, optional
|
849
|
-
Port number to specify in the Kubernetes job object
|
850
|
-
compute_pool : str, optional, default None
|
851
|
-
Compute pool to be used for for this step.
|
852
|
-
If not specified, any accessible compute pool within the perimeter is used.
|
853
|
-
hostname_resolution_timeout: int, default 10 * 60
|
854
|
-
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
855
|
-
Only applicable when @parallel is used.
|
856
|
-
qos: str, default: Burstable
|
857
|
-
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
911
|
+
hourly : bool, default False
|
912
|
+
Run the workflow hourly.
|
913
|
+
daily : bool, default True
|
914
|
+
Run the workflow daily.
|
915
|
+
weekly : bool, default False
|
916
|
+
Run the workflow weekly.
|
917
|
+
cron : str, optional, default None
|
918
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
919
|
+
specified by this expression.
|
920
|
+
timezone : str, optional, default None
|
921
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
922
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
923
|
+
"""
|
924
|
+
...
|
925
|
+
|
926
|
+
@typing.overload
|
927
|
+
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
928
|
+
...
|
929
|
+
|
930
|
+
def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
|
931
|
+
"""
|
932
|
+
Specifies the times when the flow should be run when running on a
|
933
|
+
production scheduler.
|
934
|
+
|
935
|
+
|
936
|
+
Parameters
|
937
|
+
----------
|
938
|
+
hourly : bool, default False
|
939
|
+
Run the workflow hourly.
|
940
|
+
daily : bool, default True
|
941
|
+
Run the workflow daily.
|
942
|
+
weekly : bool, default False
|
943
|
+
Run the workflow weekly.
|
944
|
+
cron : str, optional, default None
|
945
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
946
|
+
specified by this expression.
|
947
|
+
timezone : str, optional, default None
|
948
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
949
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
858
950
|
"""
|
859
951
|
...
|
860
952
|
|
@@ -877,113 +969,62 @@ def project(*, name: str, branch: typing.Optional[str] = None, production: bool
|
|
877
969
|
The branch to use. If not specified, the branch is set to
|
878
970
|
`user.<username>` unless `production` is set to `True`. This can
|
879
971
|
also be set on the command line using `--branch` as a top-level option.
|
880
|
-
It is an error to specify `branch` in the decorator and on the command line.
|
881
|
-
|
882
|
-
production : bool, default False
|
883
|
-
Whether or not the branch is the production branch. This can also be set on the
|
884
|
-
command line using `--production` as a top-level option. It is an error to specify
|
885
|
-
`production` in the decorator and on the command line.
|
886
|
-
The project branch name will be:
|
887
|
-
- if `branch` is specified:
|
888
|
-
- if `production` is True: `prod.<branch>`
|
889
|
-
- if `production` is False: `test.<branch>`
|
890
|
-
- if `branch` is not specified:
|
891
|
-
- if `production` is True: `prod`
|
892
|
-
- if `production` is False: `user.<username>`
|
893
|
-
"""
|
894
|
-
...
|
895
|
-
|
896
|
-
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]]:
|
897
|
-
"""
|
898
|
-
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.
|
899
|
-
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.
|
900
|
-
|
901
|
-
|
902
|
-
Parameters
|
903
|
-
----------
|
904
|
-
timeout : int
|
905
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
906
|
-
poke_interval : int
|
907
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
908
|
-
mode : str
|
909
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
910
|
-
exponential_backoff : bool
|
911
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
912
|
-
pool : str
|
913
|
-
the slot pool this task should run in,
|
914
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
915
|
-
soft_fail : bool
|
916
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
917
|
-
name : str
|
918
|
-
Name of the sensor on Airflow
|
919
|
-
description : str
|
920
|
-
Description of sensor in the Airflow UI
|
921
|
-
external_dag_id : str
|
922
|
-
The dag_id that contains the task you want to wait for.
|
923
|
-
external_task_ids : List[str]
|
924
|
-
The list of task_ids that you want to wait for.
|
925
|
-
If None (default value) the sensor waits for the DAG. (Default: None)
|
926
|
-
allowed_states : List[str]
|
927
|
-
Iterable of allowed states, (Default: ['success'])
|
928
|
-
failed_states : List[str]
|
929
|
-
Iterable of failed or dis-allowed states. (Default: None)
|
930
|
-
execution_delta : datetime.timedelta
|
931
|
-
time difference with the previous execution to look at,
|
932
|
-
the default is the same logical date as the current task or DAG. (Default: None)
|
933
|
-
check_existence: bool
|
934
|
-
Set to True to check if the external task exists or check if
|
935
|
-
the DAG to wait for exists. (Default: True)
|
936
|
-
"""
|
937
|
-
...
|
938
|
-
|
939
|
-
@typing.overload
|
940
|
-
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]]:
|
941
|
-
"""
|
942
|
-
Specifies the Conda environment for all steps of the flow.
|
943
|
-
|
944
|
-
Use `@conda_base` to set common libraries required by all
|
945
|
-
steps and use `@conda` to specify step-specific additions.
|
946
|
-
|
947
|
-
|
948
|
-
Parameters
|
949
|
-
----------
|
950
|
-
packages : Dict[str, str], default {}
|
951
|
-
Packages to use for this flow. The key is the name of the package
|
952
|
-
and the value is the version to use.
|
953
|
-
libraries : Dict[str, str], default {}
|
954
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
955
|
-
python : str, optional, default None
|
956
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
957
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
958
|
-
disabled : bool, default False
|
959
|
-
If set to True, disables Conda.
|
972
|
+
It is an error to specify `branch` in the decorator and on the command line.
|
973
|
+
|
974
|
+
production : bool, default False
|
975
|
+
Whether or not the branch is the production branch. This can also be set on the
|
976
|
+
command line using `--production` as a top-level option. It is an error to specify
|
977
|
+
`production` in the decorator and on the command line.
|
978
|
+
The project branch name will be:
|
979
|
+
- if `branch` is specified:
|
980
|
+
- if `production` is True: `prod.<branch>`
|
981
|
+
- if `production` is False: `test.<branch>`
|
982
|
+
- if `branch` is not specified:
|
983
|
+
- if `production` is True: `prod`
|
984
|
+
- if `production` is False: `user.<username>`
|
960
985
|
"""
|
961
986
|
...
|
962
987
|
|
963
|
-
|
964
|
-
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
965
|
-
...
|
966
|
-
|
967
|
-
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):
|
988
|
+
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]]:
|
968
989
|
"""
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
990
|
+
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)
|
991
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
992
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
993
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
994
|
+
starts only after all sensors finish.
|
973
995
|
|
974
996
|
|
975
997
|
Parameters
|
976
998
|
----------
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
999
|
+
timeout : int
|
1000
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1001
|
+
poke_interval : int
|
1002
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1003
|
+
mode : str
|
1004
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1005
|
+
exponential_backoff : bool
|
1006
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1007
|
+
pool : str
|
1008
|
+
the slot pool this task should run in,
|
1009
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1010
|
+
soft_fail : bool
|
1011
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1012
|
+
name : str
|
1013
|
+
Name of the sensor on Airflow
|
1014
|
+
description : str
|
1015
|
+
Description of sensor in the Airflow UI
|
1016
|
+
bucket_key : Union[str, List[str]]
|
1017
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1018
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1019
|
+
bucket_name : str
|
1020
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1021
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1022
|
+
wildcard_match : bool
|
1023
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1024
|
+
aws_conn_id : str
|
1025
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1026
|
+
verify : bool
|
1027
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
987
1028
|
"""
|
988
1029
|
...
|
989
1030
|
|
@@ -1089,53 +1130,96 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
1089
1130
|
...
|
1090
1131
|
|
1091
1132
|
@typing.overload
|
1092
|
-
def
|
1133
|
+
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]]:
|
1093
1134
|
"""
|
1094
|
-
Specifies the
|
1095
|
-
|
1135
|
+
Specifies the Conda environment for all steps of the flow.
|
1136
|
+
|
1137
|
+
Use `@conda_base` to set common libraries required by all
|
1138
|
+
steps and use `@conda` to specify step-specific additions.
|
1096
1139
|
|
1097
1140
|
|
1098
1141
|
Parameters
|
1099
1142
|
----------
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1111
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1143
|
+
packages : Dict[str, str], default {}
|
1144
|
+
Packages to use for this flow. The key is the name of the package
|
1145
|
+
and the value is the version to use.
|
1146
|
+
libraries : Dict[str, str], default {}
|
1147
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1148
|
+
python : str, optional, default None
|
1149
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1150
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1151
|
+
disabled : bool, default False
|
1152
|
+
If set to True, disables Conda.
|
1112
1153
|
"""
|
1113
1154
|
...
|
1114
1155
|
|
1115
1156
|
@typing.overload
|
1116
|
-
def
|
1157
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1117
1158
|
...
|
1118
1159
|
|
1119
|
-
def
|
1160
|
+
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):
|
1120
1161
|
"""
|
1121
|
-
Specifies the
|
1122
|
-
|
1162
|
+
Specifies the Conda environment for all steps of the flow.
|
1163
|
+
|
1164
|
+
Use `@conda_base` to set common libraries required by all
|
1165
|
+
steps and use `@conda` to specify step-specific additions.
|
1123
1166
|
|
1124
1167
|
|
1125
1168
|
Parameters
|
1126
1169
|
----------
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1170
|
+
packages : Dict[str, str], default {}
|
1171
|
+
Packages to use for this flow. The key is the name of the package
|
1172
|
+
and the value is the version to use.
|
1173
|
+
libraries : Dict[str, str], default {}
|
1174
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1175
|
+
python : str, optional, default None
|
1176
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1177
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1178
|
+
disabled : bool, default False
|
1179
|
+
If set to True, disables Conda.
|
1180
|
+
"""
|
1181
|
+
...
|
1182
|
+
|
1183
|
+
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]]:
|
1184
|
+
"""
|
1185
|
+
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.
|
1186
|
+
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.
|
1187
|
+
|
1188
|
+
|
1189
|
+
Parameters
|
1190
|
+
----------
|
1191
|
+
timeout : int
|
1192
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1193
|
+
poke_interval : int
|
1194
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1195
|
+
mode : str
|
1196
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1197
|
+
exponential_backoff : bool
|
1198
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1199
|
+
pool : str
|
1200
|
+
the slot pool this task should run in,
|
1201
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1202
|
+
soft_fail : bool
|
1203
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1204
|
+
name : str
|
1205
|
+
Name of the sensor on Airflow
|
1206
|
+
description : str
|
1207
|
+
Description of sensor in the Airflow UI
|
1208
|
+
external_dag_id : str
|
1209
|
+
The dag_id that contains the task you want to wait for.
|
1210
|
+
external_task_ids : List[str]
|
1211
|
+
The list of task_ids that you want to wait for.
|
1212
|
+
If None (default value) the sensor waits for the DAG. (Default: None)
|
1213
|
+
allowed_states : List[str]
|
1214
|
+
Iterable of allowed states, (Default: ['success'])
|
1215
|
+
failed_states : List[str]
|
1216
|
+
Iterable of failed or dis-allowed states. (Default: None)
|
1217
|
+
execution_delta : datetime.timedelta
|
1218
|
+
time difference with the previous execution to look at,
|
1219
|
+
the default is the same logical date as the current task or DAG. (Default: None)
|
1220
|
+
check_existence: bool
|
1221
|
+
Set to True to check if the external task exists or check if
|
1222
|
+
the DAG to wait for exists. (Default: True)
|
1139
1223
|
"""
|
1140
1224
|
...
|
1141
1225
|
|
@@ -1232,87 +1316,3 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
1232
1316
|
"""
|
1233
1317
|
...
|
1234
1318
|
|
1235
|
-
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]]:
|
1236
|
-
"""
|
1237
|
-
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)
|
1238
|
-
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1239
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1240
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1241
|
-
starts only after all sensors finish.
|
1242
|
-
|
1243
|
-
|
1244
|
-
Parameters
|
1245
|
-
----------
|
1246
|
-
timeout : int
|
1247
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
1248
|
-
poke_interval : int
|
1249
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
1250
|
-
mode : str
|
1251
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1252
|
-
exponential_backoff : bool
|
1253
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1254
|
-
pool : str
|
1255
|
-
the slot pool this task should run in,
|
1256
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1257
|
-
soft_fail : bool
|
1258
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1259
|
-
name : str
|
1260
|
-
Name of the sensor on Airflow
|
1261
|
-
description : str
|
1262
|
-
Description of sensor in the Airflow UI
|
1263
|
-
bucket_key : Union[str, List[str]]
|
1264
|
-
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1265
|
-
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1266
|
-
bucket_name : str
|
1267
|
-
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1268
|
-
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1269
|
-
wildcard_match : bool
|
1270
|
-
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1271
|
-
aws_conn_id : str
|
1272
|
-
a reference to the s3 connection on Airflow. (Default: None)
|
1273
|
-
verify : bool
|
1274
|
-
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1275
|
-
"""
|
1276
|
-
...
|
1277
|
-
|
1278
|
-
@typing.overload
|
1279
|
-
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1280
|
-
"""
|
1281
|
-
Specifies the PyPI packages for all steps of the flow.
|
1282
|
-
|
1283
|
-
Use `@pypi_base` to set common packages required by all
|
1284
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1285
|
-
|
1286
|
-
Parameters
|
1287
|
-
----------
|
1288
|
-
packages : Dict[str, str], default: {}
|
1289
|
-
Packages to use for this flow. The key is the name of the package
|
1290
|
-
and the value is the version to use.
|
1291
|
-
python : str, optional, default: None
|
1292
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1293
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1294
|
-
"""
|
1295
|
-
...
|
1296
|
-
|
1297
|
-
@typing.overload
|
1298
|
-
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1299
|
-
...
|
1300
|
-
|
1301
|
-
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1302
|
-
"""
|
1303
|
-
Specifies the PyPI packages for all steps of the flow.
|
1304
|
-
|
1305
|
-
Use `@pypi_base` to set common packages required by all
|
1306
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1307
|
-
|
1308
|
-
Parameters
|
1309
|
-
----------
|
1310
|
-
packages : Dict[str, str], default: {}
|
1311
|
-
Packages to use for this flow. The key is the name of the package
|
1312
|
-
and the value is the version to use.
|
1313
|
-
python : str, optional, default: None
|
1314
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1315
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1316
|
-
"""
|
1317
|
-
...
|
1318
|
-
|