metaflow-stubs 2.16.2__py2.py3-none-any.whl → 2.16.3__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 +515 -515
- metaflow-stubs/cards.pyi +2 -2
- metaflow-stubs/cli.pyi +2 -2
- metaflow-stubs/cli_components/__init__.pyi +2 -2
- metaflow-stubs/cli_components/utils.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +2 -2
- metaflow-stubs/client/core.pyi +5 -5
- metaflow-stubs/client/filecache.pyi +2 -2
- metaflow-stubs/events.pyi +3 -3
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +5 -5
- 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 +35 -35
- metaflow-stubs/metaflow_git.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/packaging_sys/__init__.pyi +8 -8
- metaflow-stubs/packaging_sys/backend.pyi +3 -3
- metaflow-stubs/packaging_sys/distribution_support.pyi +5 -5
- metaflow-stubs/packaging_sys/tar_backend.pyi +5 -5
- metaflow-stubs/packaging_sys/utils.pyi +2 -2
- metaflow-stubs/packaging_sys/v1.pyi +2 -2
- metaflow-stubs/parameters.pyi +3 -3
- 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 +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
- 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 +3 -3
- metaflow-stubs/plugins/aws/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +3 -3
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +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 +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 +3 -3
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
- metaflow-stubs/plugins/pypi/parsers.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
- metaflow-stubs/plugins/pypi/utils.pyi +2 -2
- metaflow-stubs/plugins/resources_decorator.pyi +2 -2
- metaflow-stubs/plugins/retry_decorator.pyi +2 -2
- metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +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 +2 -2
- metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
- metaflow-stubs/plugins/uv/__init__.pyi +2 -2
- metaflow-stubs/plugins/uv/uv_environment.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +30 -30
- metaflow-stubs/runner/deployer_impl.pyi +3 -3
- 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 +4 -4
- metaflow-stubs/system/__init__.pyi +2 -2
- metaflow-stubs/system/system_logger.pyi +3 -3
- metaflow-stubs/system/system_monitor.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- metaflow-stubs/user_configs/__init__.pyi +2 -2
- metaflow-stubs/user_configs/config_options.pyi +2 -2
- metaflow-stubs/user_configs/config_parameters.pyi +6 -6
- metaflow-stubs/user_decorators/__init__.pyi +2 -2
- metaflow-stubs/user_decorators/common.pyi +2 -2
- metaflow-stubs/user_decorators/mutable_flow.pyi +6 -6
- metaflow-stubs/user_decorators/mutable_step.pyi +5 -5
- metaflow-stubs/user_decorators/user_flow_decorator.pyi +4 -4
- metaflow-stubs/user_decorators/user_step_decorator.pyi +6 -6
- metaflow-stubs/version.pyi +2 -2
- {metaflow_stubs-2.16.2.dist-info → metaflow_stubs-2.16.3.dist-info}/METADATA +2 -2
- metaflow_stubs-2.16.3.dist-info/RECORD +166 -0
- metaflow_stubs-2.16.2.dist-info/RECORD +0 -166
- {metaflow_stubs-2.16.2.dist-info → metaflow_stubs-2.16.3.dist-info}/WHEEL +0 -0
- {metaflow_stubs-2.16.2.dist-info → metaflow_stubs-2.16.3.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
######################################################################################################
|
|
2
2
|
# Auto-generated Metaflow stub file #
|
|
3
|
-
# MF version: 2.16.
|
|
4
|
-
# Generated on 2025-07-
|
|
3
|
+
# MF version: 2.16.3 #
|
|
4
|
+
# Generated on 2025-07-16T15:23:11.248549 #
|
|
5
5
|
######################################################################################################
|
|
6
6
|
|
|
7
7
|
from __future__ import annotations
|
|
@@ -39,16 +39,16 @@ from .user_decorators.user_step_decorator import UserStepDecorator as UserStepDe
|
|
|
39
39
|
from .user_decorators.user_step_decorator import StepMutator as StepMutator
|
|
40
40
|
from .user_decorators.user_step_decorator import user_step_decorator as user_step_decorator
|
|
41
41
|
from .user_decorators.user_flow_decorator import FlowMutator as FlowMutator
|
|
42
|
-
from . import metaflow_git as metaflow_git
|
|
43
42
|
from . import tuple_util as tuple_util
|
|
43
|
+
from . import metaflow_git as metaflow_git
|
|
44
44
|
from . import events as events
|
|
45
45
|
from . import runner as runner
|
|
46
46
|
from . import plugins as plugins
|
|
47
47
|
from .plugins.datatools.s3.s3 import S3 as S3
|
|
48
48
|
from . import includefile as includefile
|
|
49
49
|
from .includefile import IncludeFile as IncludeFile
|
|
50
|
-
from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
|
|
51
50
|
from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
|
|
51
|
+
from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
|
|
52
52
|
from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
|
|
53
53
|
from . import cards as cards
|
|
54
54
|
from . import client as client
|
|
@@ -153,100 +153,35 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
|
153
153
|
...
|
|
154
154
|
|
|
155
155
|
@typing.overload
|
|
156
|
-
def
|
|
156
|
+
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]]]:
|
|
157
157
|
"""
|
|
158
|
-
Specifies
|
|
159
|
-
|
|
160
|
-
Use `@resources` to specify the resource requirements
|
|
161
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
|
162
|
-
|
|
163
|
-
You can choose the compute layer on the command line by executing e.g.
|
|
164
|
-
```
|
|
165
|
-
python myflow.py run --with batch
|
|
166
|
-
```
|
|
167
|
-
or
|
|
168
|
-
```
|
|
169
|
-
python myflow.py run --with kubernetes
|
|
170
|
-
```
|
|
171
|
-
which executes the flow on the desired system using the
|
|
172
|
-
requirements specified in `@resources`.
|
|
158
|
+
Specifies environment variables to be set prior to the execution of a step.
|
|
173
159
|
|
|
174
160
|
|
|
175
161
|
Parameters
|
|
176
162
|
----------
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
gpu : int, optional, default None
|
|
180
|
-
Number of GPUs required for this step.
|
|
181
|
-
disk : int, optional, default None
|
|
182
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
|
183
|
-
memory : int, default 4096
|
|
184
|
-
Memory size (in MB) required for this step.
|
|
185
|
-
shared_memory : int, optional, default None
|
|
186
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
|
187
|
-
This parameter maps to the `--shm-size` option in Docker.
|
|
163
|
+
vars : Dict[str, str], default {}
|
|
164
|
+
Dictionary of environment variables to set.
|
|
188
165
|
"""
|
|
189
166
|
...
|
|
190
167
|
|
|
191
168
|
@typing.overload
|
|
192
|
-
def
|
|
169
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
193
170
|
...
|
|
194
171
|
|
|
195
172
|
@typing.overload
|
|
196
|
-
def
|
|
173
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
197
174
|
...
|
|
198
175
|
|
|
199
|
-
def
|
|
176
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
|
200
177
|
"""
|
|
201
|
-
Specifies
|
|
202
|
-
|
|
203
|
-
Use `@resources` to specify the resource requirements
|
|
204
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
|
205
|
-
|
|
206
|
-
You can choose the compute layer on the command line by executing e.g.
|
|
207
|
-
```
|
|
208
|
-
python myflow.py run --with batch
|
|
209
|
-
```
|
|
210
|
-
or
|
|
211
|
-
```
|
|
212
|
-
python myflow.py run --with kubernetes
|
|
213
|
-
```
|
|
214
|
-
which executes the flow on the desired system using the
|
|
215
|
-
requirements specified in `@resources`.
|
|
178
|
+
Specifies environment variables to be set prior to the execution of a step.
|
|
216
179
|
|
|
217
180
|
|
|
218
181
|
Parameters
|
|
219
182
|
----------
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
gpu : int, optional, default None
|
|
223
|
-
Number of GPUs required for this step.
|
|
224
|
-
disk : int, optional, default None
|
|
225
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
|
226
|
-
memory : int, default 4096
|
|
227
|
-
Memory size (in MB) required for this step.
|
|
228
|
-
shared_memory : int, optional, default None
|
|
229
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
|
230
|
-
This parameter maps to the `--shm-size` option in Docker.
|
|
231
|
-
"""
|
|
232
|
-
...
|
|
233
|
-
|
|
234
|
-
@typing.overload
|
|
235
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
236
|
-
"""
|
|
237
|
-
Decorator prototype for all step decorators. This function gets specialized
|
|
238
|
-
and imported for all decorators types by _import_plugin_decorators().
|
|
239
|
-
"""
|
|
240
|
-
...
|
|
241
|
-
|
|
242
|
-
@typing.overload
|
|
243
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
244
|
-
...
|
|
245
|
-
|
|
246
|
-
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
|
247
|
-
"""
|
|
248
|
-
Decorator prototype for all step decorators. This function gets specialized
|
|
249
|
-
and imported for all decorators types by _import_plugin_decorators().
|
|
183
|
+
vars : Dict[str, str], default {}
|
|
184
|
+
Dictionary of environment variables to set.
|
|
250
185
|
"""
|
|
251
186
|
...
|
|
252
187
|
|
|
@@ -299,57 +234,6 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
|
|
|
299
234
|
"""
|
|
300
235
|
...
|
|
301
236
|
|
|
302
|
-
@typing.overload
|
|
303
|
-
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]]]:
|
|
304
|
-
"""
|
|
305
|
-
Specifies the PyPI packages for the step.
|
|
306
|
-
|
|
307
|
-
Information in this decorator will augment any
|
|
308
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
|
309
|
-
you can use `@pypi_base` to set packages required by all
|
|
310
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
Parameters
|
|
314
|
-
----------
|
|
315
|
-
packages : Dict[str, str], default: {}
|
|
316
|
-
Packages to use for this step. The key is the name of the package
|
|
317
|
-
and the value is the version to use.
|
|
318
|
-
python : str, optional, default: None
|
|
319
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
320
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
321
|
-
"""
|
|
322
|
-
...
|
|
323
|
-
|
|
324
|
-
@typing.overload
|
|
325
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
326
|
-
...
|
|
327
|
-
|
|
328
|
-
@typing.overload
|
|
329
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
330
|
-
...
|
|
331
|
-
|
|
332
|
-
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):
|
|
333
|
-
"""
|
|
334
|
-
Specifies the PyPI packages for the step.
|
|
335
|
-
|
|
336
|
-
Information in this decorator will augment any
|
|
337
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
|
338
|
-
you can use `@pypi_base` to set packages required by all
|
|
339
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
Parameters
|
|
343
|
-
----------
|
|
344
|
-
packages : Dict[str, str], default: {}
|
|
345
|
-
Packages to use for this step. The key is the name of the package
|
|
346
|
-
and the value is the version to use.
|
|
347
|
-
python : str, optional, default: None
|
|
348
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
349
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
350
|
-
"""
|
|
351
|
-
...
|
|
352
|
-
|
|
353
237
|
@typing.overload
|
|
354
238
|
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]]]:
|
|
355
239
|
"""
|
|
@@ -555,101 +439,239 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
|
555
439
|
...
|
|
556
440
|
|
|
557
441
|
@typing.overload
|
|
558
|
-
def
|
|
442
|
+
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]]]:
|
|
559
443
|
"""
|
|
560
|
-
Specifies
|
|
444
|
+
Specifies the Conda environment for the step.
|
|
561
445
|
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
446
|
+
Information in this decorator will augment any
|
|
447
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
|
448
|
+
you can use `@conda_base` to set packages required by all
|
|
449
|
+
steps and use `@conda` to specify step-specific overrides.
|
|
566
450
|
|
|
567
451
|
|
|
568
452
|
Parameters
|
|
569
453
|
----------
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
454
|
+
packages : Dict[str, str], default {}
|
|
455
|
+
Packages to use for this step. The key is the name of the package
|
|
456
|
+
and the value is the version to use.
|
|
457
|
+
libraries : Dict[str, str], default {}
|
|
458
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
459
|
+
python : str, optional, default None
|
|
460
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
461
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
462
|
+
disabled : bool, default False
|
|
463
|
+
If set to True, disables @conda.
|
|
576
464
|
"""
|
|
577
465
|
...
|
|
578
466
|
|
|
579
467
|
@typing.overload
|
|
580
|
-
def
|
|
468
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
581
469
|
...
|
|
582
470
|
|
|
583
471
|
@typing.overload
|
|
584
|
-
def
|
|
472
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
585
473
|
...
|
|
586
474
|
|
|
587
|
-
def
|
|
475
|
+
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):
|
|
588
476
|
"""
|
|
589
|
-
Specifies
|
|
477
|
+
Specifies the Conda environment for the step.
|
|
590
478
|
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
479
|
+
Information in this decorator will augment any
|
|
480
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
|
481
|
+
you can use `@conda_base` to set packages required by all
|
|
482
|
+
steps and use `@conda` to specify step-specific overrides.
|
|
595
483
|
|
|
596
484
|
|
|
597
485
|
Parameters
|
|
598
486
|
----------
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
487
|
+
packages : Dict[str, str], default {}
|
|
488
|
+
Packages to use for this step. The key is the name of the package
|
|
489
|
+
and the value is the version to use.
|
|
490
|
+
libraries : Dict[str, str], default {}
|
|
491
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
492
|
+
python : str, optional, default None
|
|
493
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
494
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
495
|
+
disabled : bool, default False
|
|
496
|
+
If set to True, disables @conda.
|
|
605
497
|
"""
|
|
606
498
|
...
|
|
607
499
|
|
|
608
|
-
|
|
500
|
+
@typing.overload
|
|
501
|
+
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]]]:
|
|
609
502
|
"""
|
|
610
|
-
Specifies
|
|
503
|
+
Specifies the resources needed when executing this step.
|
|
504
|
+
|
|
505
|
+
Use `@resources` to specify the resource requirements
|
|
506
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
|
507
|
+
|
|
508
|
+
You can choose the compute layer on the command line by executing e.g.
|
|
509
|
+
```
|
|
510
|
+
python myflow.py run --with batch
|
|
511
|
+
```
|
|
512
|
+
or
|
|
513
|
+
```
|
|
514
|
+
python myflow.py run --with kubernetes
|
|
515
|
+
```
|
|
516
|
+
which executes the flow on the desired system using the
|
|
517
|
+
requirements specified in `@resources`.
|
|
611
518
|
|
|
612
519
|
|
|
613
520
|
Parameters
|
|
614
521
|
----------
|
|
615
522
|
cpu : int, default 1
|
|
616
|
-
Number of CPUs required for this step.
|
|
617
|
-
also present, the maximum value from all decorators is used.
|
|
618
|
-
memory : int, default 4096
|
|
619
|
-
Memory size (in MB) required for this step. If
|
|
620
|
-
`@resources` is also present, the maximum value from all decorators is
|
|
621
|
-
used.
|
|
622
|
-
disk : int, default 10240
|
|
623
|
-
Disk size (in MB) required for this step. If
|
|
624
|
-
`@resources` is also present, the maximum value from all decorators is
|
|
625
|
-
used.
|
|
626
|
-
image : str, optional, default None
|
|
627
|
-
Docker image to use when launching on Kubernetes. If not specified, and
|
|
628
|
-
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
|
629
|
-
not, a default Docker image mapping to the current version of Python is used.
|
|
630
|
-
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
|
631
|
-
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
|
632
|
-
image_pull_secrets: List[str], default []
|
|
633
|
-
The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
|
|
634
|
-
Kubernetes image pull secrets to use when pulling container images
|
|
635
|
-
in Kubernetes.
|
|
636
|
-
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
|
637
|
-
Kubernetes service account to use when launching pod in Kubernetes.
|
|
638
|
-
secrets : List[str], optional, default None
|
|
639
|
-
Kubernetes secrets to use when launching pod in Kubernetes. These
|
|
640
|
-
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
|
641
|
-
in Metaflow configuration.
|
|
642
|
-
node_selector: Union[Dict[str,str], str], optional, default None
|
|
643
|
-
Kubernetes node selector(s) to apply to the pod running the task.
|
|
644
|
-
Can be passed in as a comma separated string of values e.g.
|
|
645
|
-
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
|
646
|
-
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
|
647
|
-
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
|
648
|
-
Kubernetes namespace to use when launching pod in Kubernetes.
|
|
523
|
+
Number of CPUs required for this step.
|
|
649
524
|
gpu : int, optional, default None
|
|
650
|
-
Number of GPUs required for this step.
|
|
651
|
-
|
|
652
|
-
|
|
525
|
+
Number of GPUs required for this step.
|
|
526
|
+
disk : int, optional, default None
|
|
527
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
|
528
|
+
memory : int, default 4096
|
|
529
|
+
Memory size (in MB) required for this step.
|
|
530
|
+
shared_memory : int, optional, default None
|
|
531
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
|
532
|
+
This parameter maps to the `--shm-size` option in Docker.
|
|
533
|
+
"""
|
|
534
|
+
...
|
|
535
|
+
|
|
536
|
+
@typing.overload
|
|
537
|
+
def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
538
|
+
...
|
|
539
|
+
|
|
540
|
+
@typing.overload
|
|
541
|
+
def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
542
|
+
...
|
|
543
|
+
|
|
544
|
+
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):
|
|
545
|
+
"""
|
|
546
|
+
Specifies the resources needed when executing this step.
|
|
547
|
+
|
|
548
|
+
Use `@resources` to specify the resource requirements
|
|
549
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
|
550
|
+
|
|
551
|
+
You can choose the compute layer on the command line by executing e.g.
|
|
552
|
+
```
|
|
553
|
+
python myflow.py run --with batch
|
|
554
|
+
```
|
|
555
|
+
or
|
|
556
|
+
```
|
|
557
|
+
python myflow.py run --with kubernetes
|
|
558
|
+
```
|
|
559
|
+
which executes the flow on the desired system using the
|
|
560
|
+
requirements specified in `@resources`.
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
Parameters
|
|
564
|
+
----------
|
|
565
|
+
cpu : int, default 1
|
|
566
|
+
Number of CPUs required for this step.
|
|
567
|
+
gpu : int, optional, default None
|
|
568
|
+
Number of GPUs required for this step.
|
|
569
|
+
disk : int, optional, default None
|
|
570
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
|
571
|
+
memory : int, default 4096
|
|
572
|
+
Memory size (in MB) required for this step.
|
|
573
|
+
shared_memory : int, optional, default None
|
|
574
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
|
575
|
+
This parameter maps to the `--shm-size` option in Docker.
|
|
576
|
+
"""
|
|
577
|
+
...
|
|
578
|
+
|
|
579
|
+
@typing.overload
|
|
580
|
+
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]]]:
|
|
581
|
+
"""
|
|
582
|
+
Specifies that the step will success under all circumstances.
|
|
583
|
+
|
|
584
|
+
The decorator will create an optional artifact, specified by `var`, which
|
|
585
|
+
contains the exception raised. You can use it to detect the presence
|
|
586
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
|
587
|
+
are missing.
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
Parameters
|
|
591
|
+
----------
|
|
592
|
+
var : str, optional, default None
|
|
593
|
+
Name of the artifact in which to store the caught exception.
|
|
594
|
+
If not specified, the exception is not stored.
|
|
595
|
+
print_exception : bool, default True
|
|
596
|
+
Determines whether or not the exception is printed to
|
|
597
|
+
stdout when caught.
|
|
598
|
+
"""
|
|
599
|
+
...
|
|
600
|
+
|
|
601
|
+
@typing.overload
|
|
602
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
603
|
+
...
|
|
604
|
+
|
|
605
|
+
@typing.overload
|
|
606
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
607
|
+
...
|
|
608
|
+
|
|
609
|
+
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):
|
|
610
|
+
"""
|
|
611
|
+
Specifies that the step will success under all circumstances.
|
|
612
|
+
|
|
613
|
+
The decorator will create an optional artifact, specified by `var`, which
|
|
614
|
+
contains the exception raised. You can use it to detect the presence
|
|
615
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
|
616
|
+
are missing.
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
Parameters
|
|
620
|
+
----------
|
|
621
|
+
var : str, optional, default None
|
|
622
|
+
Name of the artifact in which to store the caught exception.
|
|
623
|
+
If not specified, the exception is not stored.
|
|
624
|
+
print_exception : bool, default True
|
|
625
|
+
Determines whether or not the exception is printed to
|
|
626
|
+
stdout when caught.
|
|
627
|
+
"""
|
|
628
|
+
...
|
|
629
|
+
|
|
630
|
+
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[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]]]:
|
|
631
|
+
"""
|
|
632
|
+
Specifies that this step should execute on Kubernetes.
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
Parameters
|
|
636
|
+
----------
|
|
637
|
+
cpu : int, default 1
|
|
638
|
+
Number of CPUs required for this step. If `@resources` is
|
|
639
|
+
also present, the maximum value from all decorators is used.
|
|
640
|
+
memory : int, default 4096
|
|
641
|
+
Memory size (in MB) required for this step. If
|
|
642
|
+
`@resources` is also present, the maximum value from all decorators is
|
|
643
|
+
used.
|
|
644
|
+
disk : int, default 10240
|
|
645
|
+
Disk size (in MB) required for this step. If
|
|
646
|
+
`@resources` is also present, the maximum value from all decorators is
|
|
647
|
+
used.
|
|
648
|
+
image : str, optional, default None
|
|
649
|
+
Docker image to use when launching on Kubernetes. If not specified, and
|
|
650
|
+
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
|
651
|
+
not, a default Docker image mapping to the current version of Python is used.
|
|
652
|
+
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
|
653
|
+
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
|
654
|
+
image_pull_secrets: List[str], default []
|
|
655
|
+
The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
|
|
656
|
+
Kubernetes image pull secrets to use when pulling container images
|
|
657
|
+
in Kubernetes.
|
|
658
|
+
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
|
659
|
+
Kubernetes service account to use when launching pod in Kubernetes.
|
|
660
|
+
secrets : List[str], optional, default None
|
|
661
|
+
Kubernetes secrets to use when launching pod in Kubernetes. These
|
|
662
|
+
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
|
663
|
+
in Metaflow configuration.
|
|
664
|
+
node_selector: Union[Dict[str,str], str], optional, default None
|
|
665
|
+
Kubernetes node selector(s) to apply to the pod running the task.
|
|
666
|
+
Can be passed in as a comma separated string of values e.g.
|
|
667
|
+
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
|
668
|
+
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
|
669
|
+
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
|
670
|
+
Kubernetes namespace to use when launching pod in Kubernetes.
|
|
671
|
+
gpu : int, optional, default None
|
|
672
|
+
Number of GPUs required for this step. A value of zero implies that
|
|
673
|
+
the scheduled node should not have GPUs.
|
|
674
|
+
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
|
653
675
|
The vendor of the GPUs to be used for this step.
|
|
654
676
|
tolerations : List[str], default []
|
|
655
677
|
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
|
@@ -734,61 +756,21 @@ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
|
734
756
|
...
|
|
735
757
|
|
|
736
758
|
@typing.overload
|
|
737
|
-
def
|
|
759
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
738
760
|
"""
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
Information in this decorator will augment any
|
|
742
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
|
743
|
-
you can use `@conda_base` to set packages required by all
|
|
744
|
-
steps and use `@conda` to specify step-specific overrides.
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
Parameters
|
|
748
|
-
----------
|
|
749
|
-
packages : Dict[str, str], default {}
|
|
750
|
-
Packages to use for this step. The key is the name of the package
|
|
751
|
-
and the value is the version to use.
|
|
752
|
-
libraries : Dict[str, str], default {}
|
|
753
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
754
|
-
python : str, optional, default None
|
|
755
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
756
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
757
|
-
disabled : bool, default False
|
|
758
|
-
If set to True, disables @conda.
|
|
761
|
+
Decorator prototype for all step decorators. This function gets specialized
|
|
762
|
+
and imported for all decorators types by _import_plugin_decorators().
|
|
759
763
|
"""
|
|
760
764
|
...
|
|
761
765
|
|
|
762
766
|
@typing.overload
|
|
763
|
-
def
|
|
764
|
-
...
|
|
765
|
-
|
|
766
|
-
@typing.overload
|
|
767
|
-
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
767
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
768
768
|
...
|
|
769
769
|
|
|
770
|
-
def
|
|
770
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
|
771
771
|
"""
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
Information in this decorator will augment any
|
|
775
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
|
776
|
-
you can use `@conda_base` to set packages required by all
|
|
777
|
-
steps and use `@conda` to specify step-specific overrides.
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
Parameters
|
|
781
|
-
----------
|
|
782
|
-
packages : Dict[str, str], default {}
|
|
783
|
-
Packages to use for this step. The key is the name of the package
|
|
784
|
-
and the value is the version to use.
|
|
785
|
-
libraries : Dict[str, str], default {}
|
|
786
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
787
|
-
python : str, optional, default None
|
|
788
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
789
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
790
|
-
disabled : bool, default False
|
|
791
|
-
If set to True, disables @conda.
|
|
772
|
+
Decorator prototype for all step decorators. This function gets specialized
|
|
773
|
+
and imported for all decorators types by _import_plugin_decorators().
|
|
792
774
|
"""
|
|
793
775
|
...
|
|
794
776
|
|
|
@@ -852,265 +834,180 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
|
852
834
|
...
|
|
853
835
|
|
|
854
836
|
@typing.overload
|
|
855
|
-
def
|
|
837
|
+
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]]]:
|
|
856
838
|
"""
|
|
857
|
-
Specifies
|
|
839
|
+
Specifies the PyPI packages for the step.
|
|
840
|
+
|
|
841
|
+
Information in this decorator will augment any
|
|
842
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
|
843
|
+
you can use `@pypi_base` to set packages required by all
|
|
844
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
858
845
|
|
|
859
846
|
|
|
860
847
|
Parameters
|
|
861
848
|
----------
|
|
862
|
-
|
|
863
|
-
|
|
849
|
+
packages : Dict[str, str], default: {}
|
|
850
|
+
Packages to use for this step. The key is the name of the package
|
|
851
|
+
and the value is the version to use.
|
|
852
|
+
python : str, optional, default: None
|
|
853
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
854
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
864
855
|
"""
|
|
865
856
|
...
|
|
866
857
|
|
|
867
858
|
@typing.overload
|
|
868
|
-
def
|
|
859
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
869
860
|
...
|
|
870
861
|
|
|
871
862
|
@typing.overload
|
|
872
|
-
def
|
|
863
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
873
864
|
...
|
|
874
865
|
|
|
875
|
-
def
|
|
866
|
+
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):
|
|
876
867
|
"""
|
|
877
|
-
Specifies
|
|
868
|
+
Specifies the PyPI packages for the step.
|
|
869
|
+
|
|
870
|
+
Information in this decorator will augment any
|
|
871
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
|
872
|
+
you can use `@pypi_base` to set packages required by all
|
|
873
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
878
874
|
|
|
879
875
|
|
|
880
876
|
Parameters
|
|
881
877
|
----------
|
|
882
|
-
|
|
883
|
-
|
|
878
|
+
packages : Dict[str, str], default: {}
|
|
879
|
+
Packages to use for this step. The key is the name of the package
|
|
880
|
+
and the value is the version to use.
|
|
881
|
+
python : str, optional, default: None
|
|
882
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
883
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
884
884
|
"""
|
|
885
885
|
...
|
|
886
886
|
|
|
887
|
-
def
|
|
887
|
+
def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
888
888
|
"""
|
|
889
|
-
|
|
890
|
-
|
|
889
|
+
Specifies what flows belong to the same project.
|
|
890
|
+
|
|
891
|
+
A project-specific namespace is created for all flows that
|
|
892
|
+
use the same `@project(name)`.
|
|
891
893
|
|
|
892
894
|
|
|
893
895
|
Parameters
|
|
894
896
|
----------
|
|
895
|
-
timeout : int
|
|
896
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
|
897
|
-
poke_interval : int
|
|
898
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
|
899
|
-
mode : str
|
|
900
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
|
901
|
-
exponential_backoff : bool
|
|
902
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
|
903
|
-
pool : str
|
|
904
|
-
the slot pool this task should run in,
|
|
905
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
|
906
|
-
soft_fail : bool
|
|
907
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
|
908
897
|
name : str
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
898
|
+
Project name. Make sure that the name is unique amongst all
|
|
899
|
+
projects that use the same production scheduler. The name may
|
|
900
|
+
contain only lowercase alphanumeric characters and underscores.
|
|
901
|
+
|
|
902
|
+
branch : Optional[str], default None
|
|
903
|
+
The branch to use. If not specified, the branch is set to
|
|
904
|
+
`user.<username>` unless `production` is set to `True`. This can
|
|
905
|
+
also be set on the command line using `--branch` as a top-level option.
|
|
906
|
+
It is an error to specify `branch` in the decorator and on the command line.
|
|
907
|
+
|
|
908
|
+
production : bool, default False
|
|
909
|
+
Whether or not the branch is the production branch. This can also be set on the
|
|
910
|
+
command line using `--production` as a top-level option. It is an error to specify
|
|
911
|
+
`production` in the decorator and on the command line.
|
|
912
|
+
The project branch name will be:
|
|
913
|
+
- if `branch` is specified:
|
|
914
|
+
- if `production` is True: `prod.<branch>`
|
|
915
|
+
- if `production` is False: `test.<branch>`
|
|
916
|
+
- if `branch` is not specified:
|
|
917
|
+
- if `production` is True: `prod`
|
|
918
|
+
- if `production` is False: `user.<username>`
|
|
927
919
|
"""
|
|
928
920
|
...
|
|
929
921
|
|
|
930
922
|
@typing.overload
|
|
931
|
-
def
|
|
923
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
932
924
|
"""
|
|
933
|
-
Specifies the
|
|
934
|
-
|
|
935
|
-
```
|
|
936
|
-
@trigger_on_finish(flow='FooFlow')
|
|
937
|
-
```
|
|
938
|
-
or
|
|
939
|
-
```
|
|
940
|
-
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
|
941
|
-
```
|
|
942
|
-
This decorator respects the @project decorator and triggers the flow
|
|
943
|
-
when upstream runs within the same namespace complete successfully
|
|
944
|
-
|
|
945
|
-
Additionally, you can specify project aware upstream flow dependencies
|
|
946
|
-
by specifying the fully qualified project_flow_name.
|
|
947
|
-
```
|
|
948
|
-
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
|
949
|
-
```
|
|
950
|
-
or
|
|
951
|
-
```
|
|
952
|
-
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
|
953
|
-
```
|
|
954
|
-
|
|
955
|
-
You can also specify just the project or project branch (other values will be
|
|
956
|
-
inferred from the current project or project branch):
|
|
957
|
-
```
|
|
958
|
-
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
|
959
|
-
```
|
|
960
|
-
|
|
961
|
-
Note that `branch` is typically one of:
|
|
962
|
-
- `prod`
|
|
963
|
-
- `user.bob`
|
|
964
|
-
- `test.my_experiment`
|
|
965
|
-
- `prod.staging`
|
|
925
|
+
Specifies the PyPI packages for all steps of the flow.
|
|
966
926
|
|
|
927
|
+
Use `@pypi_base` to set common packages required by all
|
|
928
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
967
929
|
|
|
968
930
|
Parameters
|
|
969
931
|
----------
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
932
|
+
packages : Dict[str, str], default: {}
|
|
933
|
+
Packages to use for this flow. The key is the name of the package
|
|
934
|
+
and the value is the version to use.
|
|
935
|
+
python : str, optional, default: None
|
|
936
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
937
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
976
938
|
"""
|
|
977
939
|
...
|
|
978
940
|
|
|
979
941
|
@typing.overload
|
|
980
|
-
def
|
|
942
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
981
943
|
...
|
|
982
944
|
|
|
983
|
-
def
|
|
945
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
|
984
946
|
"""
|
|
985
|
-
Specifies the
|
|
986
|
-
|
|
987
|
-
```
|
|
988
|
-
@trigger_on_finish(flow='FooFlow')
|
|
989
|
-
```
|
|
990
|
-
or
|
|
991
|
-
```
|
|
992
|
-
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
|
993
|
-
```
|
|
994
|
-
This decorator respects the @project decorator and triggers the flow
|
|
995
|
-
when upstream runs within the same namespace complete successfully
|
|
996
|
-
|
|
997
|
-
Additionally, you can specify project aware upstream flow dependencies
|
|
998
|
-
by specifying the fully qualified project_flow_name.
|
|
999
|
-
```
|
|
1000
|
-
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
|
1001
|
-
```
|
|
1002
|
-
or
|
|
1003
|
-
```
|
|
1004
|
-
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
|
1005
|
-
```
|
|
1006
|
-
|
|
1007
|
-
You can also specify just the project or project branch (other values will be
|
|
1008
|
-
inferred from the current project or project branch):
|
|
1009
|
-
```
|
|
1010
|
-
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
|
1011
|
-
```
|
|
1012
|
-
|
|
1013
|
-
Note that `branch` is typically one of:
|
|
1014
|
-
- `prod`
|
|
1015
|
-
- `user.bob`
|
|
1016
|
-
- `test.my_experiment`
|
|
1017
|
-
- `prod.staging`
|
|
947
|
+
Specifies the PyPI packages for all steps of the flow.
|
|
1018
948
|
|
|
949
|
+
Use `@pypi_base` to set common packages required by all
|
|
950
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
1019
951
|
|
|
1020
952
|
Parameters
|
|
1021
953
|
----------
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
954
|
+
packages : Dict[str, str], default: {}
|
|
955
|
+
Packages to use for this flow. The key is the name of the package
|
|
956
|
+
and the value is the version to use.
|
|
957
|
+
python : str, optional, default: None
|
|
958
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
959
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1028
960
|
"""
|
|
1029
961
|
...
|
|
1030
962
|
|
|
1031
963
|
@typing.overload
|
|
1032
|
-
def
|
|
964
|
+
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]]:
|
|
1033
965
|
"""
|
|
1034
|
-
Specifies the
|
|
1035
|
-
|
|
966
|
+
Specifies the Conda environment for all steps of the flow.
|
|
967
|
+
|
|
968
|
+
Use `@conda_base` to set common libraries required by all
|
|
969
|
+
steps and use `@conda` to specify step-specific additions.
|
|
1036
970
|
|
|
1037
971
|
|
|
1038
972
|
Parameters
|
|
1039
973
|
----------
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
|
1051
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
|
974
|
+
packages : Dict[str, str], default {}
|
|
975
|
+
Packages to use for this flow. The key is the name of the package
|
|
976
|
+
and the value is the version to use.
|
|
977
|
+
libraries : Dict[str, str], default {}
|
|
978
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
979
|
+
python : str, optional, default None
|
|
980
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
981
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
982
|
+
disabled : bool, default False
|
|
983
|
+
If set to True, disables Conda.
|
|
1052
984
|
"""
|
|
1053
985
|
...
|
|
1054
986
|
|
|
1055
987
|
@typing.overload
|
|
1056
|
-
def
|
|
1057
|
-
...
|
|
1058
|
-
|
|
1059
|
-
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):
|
|
1060
|
-
"""
|
|
1061
|
-
Specifies the times when the flow should be run when running on a
|
|
1062
|
-
production scheduler.
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
Parameters
|
|
1066
|
-
----------
|
|
1067
|
-
hourly : bool, default False
|
|
1068
|
-
Run the workflow hourly.
|
|
1069
|
-
daily : bool, default True
|
|
1070
|
-
Run the workflow daily.
|
|
1071
|
-
weekly : bool, default False
|
|
1072
|
-
Run the workflow weekly.
|
|
1073
|
-
cron : str, optional, default None
|
|
1074
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
|
1075
|
-
specified by this expression.
|
|
1076
|
-
timezone : str, optional, default None
|
|
1077
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
|
1078
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
|
1079
|
-
"""
|
|
988
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1080
989
|
...
|
|
1081
990
|
|
|
1082
|
-
def
|
|
991
|
+
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):
|
|
1083
992
|
"""
|
|
1084
|
-
Specifies
|
|
993
|
+
Specifies the Conda environment for all steps of the flow.
|
|
1085
994
|
|
|
1086
|
-
|
|
1087
|
-
use
|
|
995
|
+
Use `@conda_base` to set common libraries required by all
|
|
996
|
+
steps and use `@conda` to specify step-specific additions.
|
|
1088
997
|
|
|
1089
998
|
|
|
1090
999
|
Parameters
|
|
1091
1000
|
----------
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
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>`
|
|
1001
|
+
packages : Dict[str, str], default {}
|
|
1002
|
+
Packages to use for this flow. The key is the name of the package
|
|
1003
|
+
and the value is the version to use.
|
|
1004
|
+
libraries : Dict[str, str], default {}
|
|
1005
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
1006
|
+
python : str, optional, default None
|
|
1007
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1008
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1009
|
+
disabled : bool, default False
|
|
1010
|
+
If set to True, disables Conda.
|
|
1114
1011
|
"""
|
|
1115
1012
|
...
|
|
1116
1013
|
|
|
@@ -1207,95 +1104,46 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
|
1207
1104
|
"""
|
|
1208
1105
|
...
|
|
1209
1106
|
|
|
1210
|
-
|
|
1211
|
-
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
1107
|
+
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]]:
|
|
1212
1108
|
"""
|
|
1213
|
-
|
|
1109
|
+
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.
|
|
1110
|
+
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.
|
|
1214
1111
|
|
|
1215
|
-
Use `@pypi_base` to set common packages required by all
|
|
1216
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
1217
1112
|
|
|
1218
1113
|
Parameters
|
|
1219
1114
|
----------
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
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]]:
|
|
1253
|
-
"""
|
|
1254
|
-
Specifies the Conda environment for all steps of the flow.
|
|
1255
|
-
|
|
1256
|
-
Use `@conda_base` to set common libraries required by all
|
|
1257
|
-
steps and use `@conda` to specify step-specific additions.
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
Parameters
|
|
1261
|
-
----------
|
|
1262
|
-
packages : Dict[str, str], default {}
|
|
1263
|
-
Packages to use for this flow. The key is the name of the package
|
|
1264
|
-
and the value is the version to use.
|
|
1265
|
-
libraries : Dict[str, str], default {}
|
|
1266
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
1267
|
-
python : str, optional, default None
|
|
1268
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1269
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1270
|
-
disabled : bool, default False
|
|
1271
|
-
If set to True, disables Conda.
|
|
1272
|
-
"""
|
|
1273
|
-
...
|
|
1274
|
-
|
|
1275
|
-
@typing.overload
|
|
1276
|
-
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1277
|
-
...
|
|
1278
|
-
|
|
1279
|
-
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):
|
|
1280
|
-
"""
|
|
1281
|
-
Specifies the Conda environment for all steps of the flow.
|
|
1282
|
-
|
|
1283
|
-
Use `@conda_base` to set common libraries required by all
|
|
1284
|
-
steps and use `@conda` to specify step-specific additions.
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
Parameters
|
|
1288
|
-
----------
|
|
1289
|
-
packages : Dict[str, str], default {}
|
|
1290
|
-
Packages to use for this flow. The key is the name of the package
|
|
1291
|
-
and the value is the version to use.
|
|
1292
|
-
libraries : Dict[str, str], default {}
|
|
1293
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
1294
|
-
python : str, optional, default None
|
|
1295
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1296
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1297
|
-
disabled : bool, default False
|
|
1298
|
-
If set to True, disables Conda.
|
|
1115
|
+
timeout : int
|
|
1116
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
|
1117
|
+
poke_interval : int
|
|
1118
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
|
1119
|
+
mode : str
|
|
1120
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
|
1121
|
+
exponential_backoff : bool
|
|
1122
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
|
1123
|
+
pool : str
|
|
1124
|
+
the slot pool this task should run in,
|
|
1125
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
|
1126
|
+
soft_fail : bool
|
|
1127
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
|
1128
|
+
name : str
|
|
1129
|
+
Name of the sensor on Airflow
|
|
1130
|
+
description : str
|
|
1131
|
+
Description of sensor in the Airflow UI
|
|
1132
|
+
external_dag_id : str
|
|
1133
|
+
The dag_id that contains the task you want to wait for.
|
|
1134
|
+
external_task_ids : List[str]
|
|
1135
|
+
The list of task_ids that you want to wait for.
|
|
1136
|
+
If None (default value) the sensor waits for the DAG. (Default: None)
|
|
1137
|
+
allowed_states : List[str]
|
|
1138
|
+
Iterable of allowed states, (Default: ['success'])
|
|
1139
|
+
failed_states : List[str]
|
|
1140
|
+
Iterable of failed or dis-allowed states. (Default: None)
|
|
1141
|
+
execution_delta : datetime.timedelta
|
|
1142
|
+
time difference with the previous execution to look at,
|
|
1143
|
+
the default is the same logical date as the current task or DAG. (Default: None)
|
|
1144
|
+
check_existence: bool
|
|
1145
|
+
Set to True to check if the external task exists or check if
|
|
1146
|
+
the DAG to wait for exists. (Default: True)
|
|
1299
1147
|
"""
|
|
1300
1148
|
...
|
|
1301
1149
|
|
|
@@ -1342,3 +1190,155 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
|
|
|
1342
1190
|
"""
|
|
1343
1191
|
...
|
|
1344
1192
|
|
|
1193
|
+
@typing.overload
|
|
1194
|
+
def schedule(*, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
1195
|
+
"""
|
|
1196
|
+
Specifies the times when the flow should be run when running on a
|
|
1197
|
+
production scheduler.
|
|
1198
|
+
|
|
1199
|
+
|
|
1200
|
+
Parameters
|
|
1201
|
+
----------
|
|
1202
|
+
hourly : bool, default False
|
|
1203
|
+
Run the workflow hourly.
|
|
1204
|
+
daily : bool, default True
|
|
1205
|
+
Run the workflow daily.
|
|
1206
|
+
weekly : bool, default False
|
|
1207
|
+
Run the workflow weekly.
|
|
1208
|
+
cron : str, optional, default None
|
|
1209
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
|
1210
|
+
specified by this expression.
|
|
1211
|
+
timezone : str, optional, default None
|
|
1212
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
|
1213
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
|
1214
|
+
"""
|
|
1215
|
+
...
|
|
1216
|
+
|
|
1217
|
+
@typing.overload
|
|
1218
|
+
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1219
|
+
...
|
|
1220
|
+
|
|
1221
|
+
def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
|
|
1222
|
+
"""
|
|
1223
|
+
Specifies the times when the flow should be run when running on a
|
|
1224
|
+
production scheduler.
|
|
1225
|
+
|
|
1226
|
+
|
|
1227
|
+
Parameters
|
|
1228
|
+
----------
|
|
1229
|
+
hourly : bool, default False
|
|
1230
|
+
Run the workflow hourly.
|
|
1231
|
+
daily : bool, default True
|
|
1232
|
+
Run the workflow daily.
|
|
1233
|
+
weekly : bool, default False
|
|
1234
|
+
Run the workflow weekly.
|
|
1235
|
+
cron : str, optional, default None
|
|
1236
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
|
1237
|
+
specified by this expression.
|
|
1238
|
+
timezone : str, optional, default None
|
|
1239
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
|
1240
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
|
1241
|
+
"""
|
|
1242
|
+
...
|
|
1243
|
+
|
|
1244
|
+
@typing.overload
|
|
1245
|
+
def trigger_on_finish(*, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
1246
|
+
"""
|
|
1247
|
+
Specifies the flow(s) that this flow depends on.
|
|
1248
|
+
|
|
1249
|
+
```
|
|
1250
|
+
@trigger_on_finish(flow='FooFlow')
|
|
1251
|
+
```
|
|
1252
|
+
or
|
|
1253
|
+
```
|
|
1254
|
+
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
|
1255
|
+
```
|
|
1256
|
+
This decorator respects the @project decorator and triggers the flow
|
|
1257
|
+
when upstream runs within the same namespace complete successfully
|
|
1258
|
+
|
|
1259
|
+
Additionally, you can specify project aware upstream flow dependencies
|
|
1260
|
+
by specifying the fully qualified project_flow_name.
|
|
1261
|
+
```
|
|
1262
|
+
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
|
1263
|
+
```
|
|
1264
|
+
or
|
|
1265
|
+
```
|
|
1266
|
+
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
|
1267
|
+
```
|
|
1268
|
+
|
|
1269
|
+
You can also specify just the project or project branch (other values will be
|
|
1270
|
+
inferred from the current project or project branch):
|
|
1271
|
+
```
|
|
1272
|
+
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
|
1273
|
+
```
|
|
1274
|
+
|
|
1275
|
+
Note that `branch` is typically one of:
|
|
1276
|
+
- `prod`
|
|
1277
|
+
- `user.bob`
|
|
1278
|
+
- `test.my_experiment`
|
|
1279
|
+
- `prod.staging`
|
|
1280
|
+
|
|
1281
|
+
|
|
1282
|
+
Parameters
|
|
1283
|
+
----------
|
|
1284
|
+
flow : Union[str, Dict[str, str]], optional, default None
|
|
1285
|
+
Upstream flow dependency for this flow.
|
|
1286
|
+
flows : List[Union[str, Dict[str, str]]], default []
|
|
1287
|
+
Upstream flow dependencies for this flow.
|
|
1288
|
+
options : Dict[str, Any], default {}
|
|
1289
|
+
Backend-specific configuration for tuning eventing behavior.
|
|
1290
|
+
"""
|
|
1291
|
+
...
|
|
1292
|
+
|
|
1293
|
+
@typing.overload
|
|
1294
|
+
def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1295
|
+
...
|
|
1296
|
+
|
|
1297
|
+
def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, 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] = {}):
|
|
1298
|
+
"""
|
|
1299
|
+
Specifies the flow(s) that this flow depends on.
|
|
1300
|
+
|
|
1301
|
+
```
|
|
1302
|
+
@trigger_on_finish(flow='FooFlow')
|
|
1303
|
+
```
|
|
1304
|
+
or
|
|
1305
|
+
```
|
|
1306
|
+
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
|
1307
|
+
```
|
|
1308
|
+
This decorator respects the @project decorator and triggers the flow
|
|
1309
|
+
when upstream runs within the same namespace complete successfully
|
|
1310
|
+
|
|
1311
|
+
Additionally, you can specify project aware upstream flow dependencies
|
|
1312
|
+
by specifying the fully qualified project_flow_name.
|
|
1313
|
+
```
|
|
1314
|
+
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
|
1315
|
+
```
|
|
1316
|
+
or
|
|
1317
|
+
```
|
|
1318
|
+
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
|
1319
|
+
```
|
|
1320
|
+
|
|
1321
|
+
You can also specify just the project or project branch (other values will be
|
|
1322
|
+
inferred from the current project or project branch):
|
|
1323
|
+
```
|
|
1324
|
+
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
|
1325
|
+
```
|
|
1326
|
+
|
|
1327
|
+
Note that `branch` is typically one of:
|
|
1328
|
+
- `prod`
|
|
1329
|
+
- `user.bob`
|
|
1330
|
+
- `test.my_experiment`
|
|
1331
|
+
- `prod.staging`
|
|
1332
|
+
|
|
1333
|
+
|
|
1334
|
+
Parameters
|
|
1335
|
+
----------
|
|
1336
|
+
flow : Union[str, Dict[str, str]], optional, default None
|
|
1337
|
+
Upstream flow dependency for this flow.
|
|
1338
|
+
flows : List[Union[str, Dict[str, str]]], default []
|
|
1339
|
+
Upstream flow dependencies for this flow.
|
|
1340
|
+
options : Dict[str, Any], default {}
|
|
1341
|
+
Backend-specific configuration for tuning eventing behavior.
|
|
1342
|
+
"""
|
|
1343
|
+
...
|
|
1344
|
+
|