metaflow-stubs 2.18.11__py2.py3-none-any.whl → 2.18.12__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 +439 -439
- 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 +2 -2
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +5 -5
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +4 -4
- metaflow-stubs/meta_files.pyi +2 -2
- metaflow-stubs/metadata_provider/__init__.pyi +2 -2
- metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
- metaflow-stubs/metadata_provider/metadata.pyi +2 -2
- metaflow-stubs/metadata_provider/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -2
- metaflow-stubs/metaflow_current.pyi +23 -23
- metaflow-stubs/metaflow_git.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/packaging_sys/__init__.pyi +7 -7
- metaflow-stubs/packaging_sys/backend.pyi +2 -2
- metaflow-stubs/packaging_sys/distribution_support.pyi +4 -4
- metaflow-stubs/packaging_sys/tar_backend.pyi +4 -4
- metaflow-stubs/packaging_sys/utils.pyi +2 -2
- metaflow-stubs/packaging_sys/v1.pyi +2 -2
- metaflow-stubs/parameters.pyi +4 -4
- metaflow-stubs/plugins/__init__.pyi +13 -13
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
- metaflow-stubs/plugins/airflow/exception.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
- metaflow-stubs/plugins/argo/__init__.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +4 -4
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -3
- metaflow-stubs/plugins/argo/exit_hooks.pyi +2 -2
- metaflow-stubs/plugins/aws/__init__.pyi +3 -3
- metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +2 -2
- metaflow-stubs/plugins/azure/__init__.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
- metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/cards/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_client.pyi +2 -2
- metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
- metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +17 -5
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/json_viewer.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/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/parsers.pyi +2 -2
- metaflow-stubs/plugins/project_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +5 -5
- metaflow-stubs/plugins/pypi/parsers.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
- metaflow-stubs/plugins/pypi/utils.pyi +2 -2
- metaflow-stubs/plugins/resources_decorator.pyi +2 -2
- metaflow-stubs/plugins/retry_decorator.pyi +2 -2
- metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
- metaflow-stubs/plugins/secrets/secrets_func.pyi +2 -2
- metaflow-stubs/plugins/secrets/secrets_spec.pyi +2 -2
- metaflow-stubs/plugins/secrets/utils.pyi +2 -2
- metaflow-stubs/plugins/storage_executor.pyi +2 -2
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
- metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
- metaflow-stubs/plugins/uv/__init__.pyi +2 -2
- metaflow-stubs/plugins/uv/uv_environment.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +33 -33
- metaflow-stubs/runner/deployer_impl.pyi +3 -3
- 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 +4 -4
- metaflow-stubs/system/__init__.pyi +2 -2
- metaflow-stubs/system/system_logger.pyi +2 -2
- metaflow-stubs/system/system_monitor.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- metaflow-stubs/user_configs/__init__.pyi +2 -2
- metaflow-stubs/user_configs/config_options.pyi +3 -3
- metaflow-stubs/user_configs/config_parameters.pyi +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 +3 -3
- metaflow-stubs/user_decorators/user_step_decorator.pyi +6 -6
- metaflow-stubs/version.pyi +2 -2
- {metaflow_stubs-2.18.11.dist-info → metaflow_stubs-2.18.12.dist-info}/METADATA +2 -2
- metaflow_stubs-2.18.12.dist-info/RECORD +168 -0
- metaflow_stubs-2.18.11.dist-info/RECORD +0 -168
- {metaflow_stubs-2.18.11.dist-info → metaflow_stubs-2.18.12.dist-info}/WHEEL +0 -0
- {metaflow_stubs-2.18.11.dist-info → metaflow_stubs-2.18.12.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
######################################################################################################
|
|
2
2
|
# Auto-generated Metaflow stub file #
|
|
3
|
-
# MF version: 2.18.
|
|
4
|
-
# Generated on 2025-10-
|
|
3
|
+
# MF version: 2.18.12 #
|
|
4
|
+
# Generated on 2025-10-15T20:44:18.181602 #
|
|
5
5
|
######################################################################################################
|
|
6
6
|
|
|
7
7
|
from __future__ import annotations
|
|
8
8
|
|
|
9
9
|
import typing
|
|
10
10
|
if typing.TYPE_CHECKING:
|
|
11
|
-
import typing
|
|
12
11
|
import datetime
|
|
12
|
+
import typing
|
|
13
13
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
|
14
14
|
StepFlag = typing.NewType("StepFlag", bool)
|
|
15
15
|
|
|
@@ -39,18 +39,18 @@ from .user_decorators.user_step_decorator import UserStepDecorator as UserStepDe
|
|
|
39
39
|
from .user_decorators.user_step_decorator import StepMutator as StepMutator
|
|
40
40
|
from .user_decorators.user_step_decorator import user_step_decorator as user_step_decorator
|
|
41
41
|
from .user_decorators.user_flow_decorator import FlowMutator as FlowMutator
|
|
42
|
-
from . import events as events
|
|
43
42
|
from . import tuple_util as tuple_util
|
|
44
43
|
from . import metaflow_git as metaflow_git
|
|
44
|
+
from . import events as events
|
|
45
45
|
from . import runner as runner
|
|
46
46
|
from . import plugins as plugins
|
|
47
47
|
from .plugins.datatools.s3.s3 import S3 as S3
|
|
48
48
|
from . import includefile as includefile
|
|
49
49
|
from .includefile import IncludeFile as IncludeFile
|
|
50
|
-
from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
|
|
51
|
-
from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
|
|
52
|
-
from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
|
|
53
50
|
from .plugins.parsers import yaml_parser as yaml_parser
|
|
51
|
+
from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
|
|
52
|
+
from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
|
|
53
|
+
from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
|
|
54
54
|
from . import cards as cards
|
|
55
55
|
from . import client as client
|
|
56
56
|
from .client.core import namespace as namespace
|
|
@@ -154,21 +154,57 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
|
154
154
|
...
|
|
155
155
|
|
|
156
156
|
@typing.overload
|
|
157
|
-
def
|
|
157
|
+
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]]]:
|
|
158
158
|
"""
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
Specifies the number of times the task corresponding
|
|
160
|
+
to a step needs to be retried.
|
|
161
|
+
|
|
162
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
|
163
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
|
164
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
|
165
|
+
|
|
166
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
|
167
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
|
168
|
+
ensuring that the flow execution can continue.
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
Parameters
|
|
172
|
+
----------
|
|
173
|
+
times : int, default 3
|
|
174
|
+
Number of times to retry this task.
|
|
175
|
+
minutes_between_retries : int, default 2
|
|
176
|
+
Number of minutes between retries.
|
|
161
177
|
"""
|
|
162
178
|
...
|
|
163
179
|
|
|
164
180
|
@typing.overload
|
|
165
|
-
def
|
|
181
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
166
182
|
...
|
|
167
183
|
|
|
168
|
-
|
|
184
|
+
@typing.overload
|
|
185
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
186
|
+
...
|
|
187
|
+
|
|
188
|
+
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):
|
|
169
189
|
"""
|
|
170
|
-
|
|
171
|
-
|
|
190
|
+
Specifies the number of times the task corresponding
|
|
191
|
+
to a step needs to be retried.
|
|
192
|
+
|
|
193
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
|
194
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
|
195
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
|
196
|
+
|
|
197
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
|
198
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
|
199
|
+
ensuring that the flow execution can continue.
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
Parameters
|
|
203
|
+
----------
|
|
204
|
+
times : int, default 3
|
|
205
|
+
Number of times to retry this task.
|
|
206
|
+
minutes_between_retries : int, default 2
|
|
207
|
+
Number of minutes between retries.
|
|
172
208
|
"""
|
|
173
209
|
...
|
|
174
210
|
|
|
@@ -224,185 +260,84 @@ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
|
224
260
|
...
|
|
225
261
|
|
|
226
262
|
@typing.overload
|
|
227
|
-
def
|
|
263
|
+
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]]]:
|
|
228
264
|
"""
|
|
229
|
-
|
|
230
|
-
|
|
265
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
|
266
|
+
|
|
267
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
|
231
268
|
|
|
232
269
|
|
|
233
270
|
Parameters
|
|
234
271
|
----------
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
272
|
+
type : str, default 'default'
|
|
273
|
+
Card type.
|
|
274
|
+
id : str, optional, default None
|
|
275
|
+
If multiple cards are present, use this id to identify this card.
|
|
276
|
+
options : Dict[str, Any], default {}
|
|
277
|
+
Options passed to the card. The contents depend on the card type.
|
|
278
|
+
timeout : int, default 45
|
|
279
|
+
Interrupt reporting if it takes more than this many seconds.
|
|
239
280
|
"""
|
|
240
281
|
...
|
|
241
282
|
|
|
242
283
|
@typing.overload
|
|
243
|
-
def
|
|
284
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
244
285
|
...
|
|
245
286
|
|
|
246
287
|
@typing.overload
|
|
247
|
-
def
|
|
288
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
248
289
|
...
|
|
249
290
|
|
|
250
|
-
def
|
|
291
|
+
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):
|
|
251
292
|
"""
|
|
252
|
-
|
|
253
|
-
the execution of a step.
|
|
254
|
-
|
|
293
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
|
255
294
|
|
|
256
|
-
|
|
257
|
-
----------
|
|
258
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
|
259
|
-
List of secret specs, defining how the secrets are to be retrieved
|
|
260
|
-
role : str, optional, default: None
|
|
261
|
-
Role to use for fetching secrets
|
|
262
|
-
"""
|
|
263
|
-
...
|
|
264
|
-
|
|
265
|
-
def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', image_pull_secrets: typing.List[str] = [], service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[typing.Dict[str, str]] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable', security_context: typing.Optional[typing.Dict[str, typing.Any]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
|
266
|
-
"""
|
|
267
|
-
Specifies that this step should execute on Kubernetes.
|
|
295
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
|
268
296
|
|
|
269
297
|
|
|
270
298
|
Parameters
|
|
271
299
|
----------
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
Disk size (in MB) required for this step. If
|
|
281
|
-
`@resources` is also present, the maximum value from all decorators is
|
|
282
|
-
used.
|
|
283
|
-
image : str, optional, default None
|
|
284
|
-
Docker image to use when launching on Kubernetes. If not specified, and
|
|
285
|
-
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
|
286
|
-
not, a default Docker image mapping to the current version of Python is used.
|
|
287
|
-
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
|
288
|
-
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
|
289
|
-
image_pull_secrets: List[str], default []
|
|
290
|
-
The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
|
|
291
|
-
Kubernetes image pull secrets to use when pulling container images
|
|
292
|
-
in Kubernetes.
|
|
293
|
-
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
|
294
|
-
Kubernetes service account to use when launching pod in Kubernetes.
|
|
295
|
-
secrets : List[str], optional, default None
|
|
296
|
-
Kubernetes secrets to use when launching pod in Kubernetes. These
|
|
297
|
-
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
|
298
|
-
in Metaflow configuration.
|
|
299
|
-
node_selector: Union[Dict[str,str], str], optional, default None
|
|
300
|
-
Kubernetes node selector(s) to apply to the pod running the task.
|
|
301
|
-
Can be passed in as a comma separated string of values e.g.
|
|
302
|
-
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
|
303
|
-
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
|
304
|
-
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
|
305
|
-
Kubernetes namespace to use when launching pod in Kubernetes.
|
|
306
|
-
gpu : int, optional, default None
|
|
307
|
-
Number of GPUs required for this step. A value of zero implies that
|
|
308
|
-
the scheduled node should not have GPUs.
|
|
309
|
-
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
|
310
|
-
The vendor of the GPUs to be used for this step.
|
|
311
|
-
tolerations : List[Dict[str,str]], default []
|
|
312
|
-
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
|
313
|
-
Kubernetes tolerations to use when launching pod in Kubernetes.
|
|
314
|
-
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
|
315
|
-
Kubernetes labels to use when launching pod in Kubernetes.
|
|
316
|
-
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
|
317
|
-
Kubernetes annotations to use when launching pod in Kubernetes.
|
|
318
|
-
use_tmpfs : bool, default False
|
|
319
|
-
This enables an explicit tmpfs mount for this step.
|
|
320
|
-
tmpfs_tempdir : bool, default True
|
|
321
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
|
322
|
-
tmpfs_size : int, optional, default: None
|
|
323
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
|
324
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
|
325
|
-
memory allocated for this step.
|
|
326
|
-
tmpfs_path : str, optional, default /metaflow_temp
|
|
327
|
-
Path to tmpfs mount for this step.
|
|
328
|
-
persistent_volume_claims : Dict[str, str], optional, default None
|
|
329
|
-
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
|
330
|
-
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
|
331
|
-
shared_memory: int, optional
|
|
332
|
-
Shared memory size (in MiB) required for this step
|
|
333
|
-
port: int, optional
|
|
334
|
-
Port number to specify in the Kubernetes job object
|
|
335
|
-
compute_pool : str, optional, default None
|
|
336
|
-
Compute pool to be used for for this step.
|
|
337
|
-
If not specified, any accessible compute pool within the perimeter is used.
|
|
338
|
-
hostname_resolution_timeout: int, default 10 * 60
|
|
339
|
-
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
|
340
|
-
Only applicable when @parallel is used.
|
|
341
|
-
qos: str, default: Burstable
|
|
342
|
-
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
|
343
|
-
|
|
344
|
-
security_context: Dict[str, Any], optional, default None
|
|
345
|
-
Container security context. Applies to the task container. Allows the following keys:
|
|
346
|
-
- privileged: bool, optional, default None
|
|
347
|
-
- allow_privilege_escalation: bool, optional, default None
|
|
348
|
-
- run_as_user: int, optional, default None
|
|
349
|
-
- run_as_group: int, optional, default None
|
|
350
|
-
- run_as_non_root: bool, optional, default None
|
|
300
|
+
type : str, default 'default'
|
|
301
|
+
Card type.
|
|
302
|
+
id : str, optional, default None
|
|
303
|
+
If multiple cards are present, use this id to identify this card.
|
|
304
|
+
options : Dict[str, Any], default {}
|
|
305
|
+
Options passed to the card. The contents depend on the card type.
|
|
306
|
+
timeout : int, default 45
|
|
307
|
+
Interrupt reporting if it takes more than this many seconds.
|
|
351
308
|
"""
|
|
352
309
|
...
|
|
353
310
|
|
|
354
311
|
@typing.overload
|
|
355
|
-
def
|
|
312
|
+
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]]]:
|
|
356
313
|
"""
|
|
357
|
-
Specifies
|
|
358
|
-
to a step needs to be retried.
|
|
359
|
-
|
|
360
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
|
361
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
|
362
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
|
363
|
-
|
|
364
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
|
365
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
|
366
|
-
ensuring that the flow execution can continue.
|
|
314
|
+
Specifies environment variables to be set prior to the execution of a step.
|
|
367
315
|
|
|
368
316
|
|
|
369
317
|
Parameters
|
|
370
318
|
----------
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
minutes_between_retries : int, default 2
|
|
374
|
-
Number of minutes between retries.
|
|
319
|
+
vars : Dict[str, str], default {}
|
|
320
|
+
Dictionary of environment variables to set.
|
|
375
321
|
"""
|
|
376
322
|
...
|
|
377
323
|
|
|
378
324
|
@typing.overload
|
|
379
|
-
def
|
|
325
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
380
326
|
...
|
|
381
327
|
|
|
382
328
|
@typing.overload
|
|
383
|
-
def
|
|
329
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
384
330
|
...
|
|
385
331
|
|
|
386
|
-
def
|
|
332
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
|
387
333
|
"""
|
|
388
|
-
Specifies
|
|
389
|
-
to a step needs to be retried.
|
|
390
|
-
|
|
391
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
|
392
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
|
393
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
|
394
|
-
|
|
395
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
|
396
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
|
397
|
-
ensuring that the flow execution can continue.
|
|
334
|
+
Specifies environment variables to be set prior to the execution of a step.
|
|
398
335
|
|
|
399
336
|
|
|
400
337
|
Parameters
|
|
401
338
|
----------
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
minutes_between_retries : int, default 2
|
|
405
|
-
Number of minutes between retries.
|
|
339
|
+
vars : Dict[str, str], default {}
|
|
340
|
+
Dictionary of environment variables to set.
|
|
406
341
|
"""
|
|
407
342
|
...
|
|
408
343
|
|
|
@@ -562,35 +497,169 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
|
562
497
|
...
|
|
563
498
|
|
|
564
499
|
@typing.overload
|
|
565
|
-
def
|
|
500
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
566
501
|
"""
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
Parameters
|
|
571
|
-
----------
|
|
572
|
-
vars : Dict[str, str], default {}
|
|
573
|
-
Dictionary of environment variables to set.
|
|
502
|
+
Decorator prototype for all step decorators. This function gets specialized
|
|
503
|
+
and imported for all decorators types by _import_plugin_decorators().
|
|
574
504
|
"""
|
|
575
505
|
...
|
|
576
506
|
|
|
577
507
|
@typing.overload
|
|
578
|
-
def
|
|
508
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
579
509
|
...
|
|
580
510
|
|
|
581
|
-
|
|
582
|
-
|
|
511
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
|
512
|
+
"""
|
|
513
|
+
Decorator prototype for all step decorators. This function gets specialized
|
|
514
|
+
and imported for all decorators types by _import_plugin_decorators().
|
|
515
|
+
"""
|
|
583
516
|
...
|
|
584
517
|
|
|
585
|
-
|
|
518
|
+
@typing.overload
|
|
519
|
+
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]]]:
|
|
586
520
|
"""
|
|
587
|
-
Specifies
|
|
521
|
+
Specifies the Conda environment for the step.
|
|
522
|
+
|
|
523
|
+
Information in this decorator will augment any
|
|
524
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
|
525
|
+
you can use `@conda_base` to set packages required by all
|
|
526
|
+
steps and use `@conda` to specify step-specific overrides.
|
|
588
527
|
|
|
589
528
|
|
|
590
529
|
Parameters
|
|
591
530
|
----------
|
|
592
|
-
|
|
593
|
-
|
|
531
|
+
packages : Dict[str, str], default {}
|
|
532
|
+
Packages to use for this step. The key is the name of the package
|
|
533
|
+
and the value is the version to use.
|
|
534
|
+
libraries : Dict[str, str], default {}
|
|
535
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
536
|
+
python : str, optional, default None
|
|
537
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
538
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
539
|
+
disabled : bool, default False
|
|
540
|
+
If set to True, disables @conda.
|
|
541
|
+
"""
|
|
542
|
+
...
|
|
543
|
+
|
|
544
|
+
@typing.overload
|
|
545
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
546
|
+
...
|
|
547
|
+
|
|
548
|
+
@typing.overload
|
|
549
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
550
|
+
...
|
|
551
|
+
|
|
552
|
+
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):
|
|
553
|
+
"""
|
|
554
|
+
Specifies the Conda environment for the step.
|
|
555
|
+
|
|
556
|
+
Information in this decorator will augment any
|
|
557
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
|
558
|
+
you can use `@conda_base` to set packages required by all
|
|
559
|
+
steps and use `@conda` to specify step-specific overrides.
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
Parameters
|
|
563
|
+
----------
|
|
564
|
+
packages : Dict[str, str], default {}
|
|
565
|
+
Packages to use for this step. The key is the name of the package
|
|
566
|
+
and the value is the version to use.
|
|
567
|
+
libraries : Dict[str, str], default {}
|
|
568
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
569
|
+
python : str, optional, default None
|
|
570
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
571
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
572
|
+
disabled : bool, default False
|
|
573
|
+
If set to True, disables @conda.
|
|
574
|
+
"""
|
|
575
|
+
...
|
|
576
|
+
|
|
577
|
+
def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', image_pull_secrets: typing.List[str] = [], service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[typing.Dict[str, str]] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable', security_context: typing.Optional[typing.Dict[str, typing.Any]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
|
578
|
+
"""
|
|
579
|
+
Specifies that this step should execute on Kubernetes.
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
Parameters
|
|
583
|
+
----------
|
|
584
|
+
cpu : int, default 1
|
|
585
|
+
Number of CPUs required for this step. If `@resources` is
|
|
586
|
+
also present, the maximum value from all decorators is used.
|
|
587
|
+
memory : int, default 4096
|
|
588
|
+
Memory size (in MB) required for this step. If
|
|
589
|
+
`@resources` is also present, the maximum value from all decorators is
|
|
590
|
+
used.
|
|
591
|
+
disk : int, default 10240
|
|
592
|
+
Disk size (in MB) required for this step. If
|
|
593
|
+
`@resources` is also present, the maximum value from all decorators is
|
|
594
|
+
used.
|
|
595
|
+
image : str, optional, default None
|
|
596
|
+
Docker image to use when launching on Kubernetes. If not specified, and
|
|
597
|
+
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
|
598
|
+
not, a default Docker image mapping to the current version of Python is used.
|
|
599
|
+
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
|
600
|
+
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
|
601
|
+
image_pull_secrets: List[str], default []
|
|
602
|
+
The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
|
|
603
|
+
Kubernetes image pull secrets to use when pulling container images
|
|
604
|
+
in Kubernetes.
|
|
605
|
+
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
|
606
|
+
Kubernetes service account to use when launching pod in Kubernetes.
|
|
607
|
+
secrets : List[str], optional, default None
|
|
608
|
+
Kubernetes secrets to use when launching pod in Kubernetes. These
|
|
609
|
+
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
|
610
|
+
in Metaflow configuration.
|
|
611
|
+
node_selector: Union[Dict[str,str], str], optional, default None
|
|
612
|
+
Kubernetes node selector(s) to apply to the pod running the task.
|
|
613
|
+
Can be passed in as a comma separated string of values e.g.
|
|
614
|
+
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
|
615
|
+
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
|
616
|
+
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
|
617
|
+
Kubernetes namespace to use when launching pod in Kubernetes.
|
|
618
|
+
gpu : int, optional, default None
|
|
619
|
+
Number of GPUs required for this step. A value of zero implies that
|
|
620
|
+
the scheduled node should not have GPUs.
|
|
621
|
+
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
|
622
|
+
The vendor of the GPUs to be used for this step.
|
|
623
|
+
tolerations : List[Dict[str,str]], default []
|
|
624
|
+
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
|
625
|
+
Kubernetes tolerations to use when launching pod in Kubernetes.
|
|
626
|
+
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
|
627
|
+
Kubernetes labels to use when launching pod in Kubernetes.
|
|
628
|
+
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
|
629
|
+
Kubernetes annotations to use when launching pod in Kubernetes.
|
|
630
|
+
use_tmpfs : bool, default False
|
|
631
|
+
This enables an explicit tmpfs mount for this step.
|
|
632
|
+
tmpfs_tempdir : bool, default True
|
|
633
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
|
634
|
+
tmpfs_size : int, optional, default: None
|
|
635
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
|
636
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
|
637
|
+
memory allocated for this step.
|
|
638
|
+
tmpfs_path : str, optional, default /metaflow_temp
|
|
639
|
+
Path to tmpfs mount for this step.
|
|
640
|
+
persistent_volume_claims : Dict[str, str], optional, default None
|
|
641
|
+
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
|
642
|
+
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
|
643
|
+
shared_memory: int, optional
|
|
644
|
+
Shared memory size (in MiB) required for this step
|
|
645
|
+
port: int, optional
|
|
646
|
+
Port number to specify in the Kubernetes job object
|
|
647
|
+
compute_pool : str, optional, default None
|
|
648
|
+
Compute pool to be used for for this step.
|
|
649
|
+
If not specified, any accessible compute pool within the perimeter is used.
|
|
650
|
+
hostname_resolution_timeout: int, default 10 * 60
|
|
651
|
+
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
|
652
|
+
Only applicable when @parallel is used.
|
|
653
|
+
qos: str, default: Burstable
|
|
654
|
+
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
|
655
|
+
|
|
656
|
+
security_context: Dict[str, Any], optional, default None
|
|
657
|
+
Container security context. Applies to the task container. Allows the following keys:
|
|
658
|
+
- privileged: bool, optional, default None
|
|
659
|
+
- allow_privilege_escalation: bool, optional, default None
|
|
660
|
+
- run_as_user: int, optional, default None
|
|
661
|
+
- run_as_group: int, optional, default None
|
|
662
|
+
- run_as_non_root: bool, optional, default None
|
|
594
663
|
"""
|
|
595
664
|
...
|
|
596
665
|
|
|
@@ -733,168 +802,99 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
|
733
802
|
...
|
|
734
803
|
|
|
735
804
|
@typing.overload
|
|
736
|
-
def
|
|
805
|
+
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]]]:
|
|
737
806
|
"""
|
|
738
|
-
Specifies the
|
|
807
|
+
Specifies the PyPI packages for the step.
|
|
739
808
|
|
|
740
809
|
Information in this decorator will augment any
|
|
741
|
-
attributes set in the `@
|
|
742
|
-
you can use `@
|
|
743
|
-
steps and use `@
|
|
810
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
|
811
|
+
you can use `@pypi_base` to set packages required by all
|
|
812
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
744
813
|
|
|
745
814
|
|
|
746
815
|
Parameters
|
|
747
816
|
----------
|
|
748
|
-
packages : Dict[str, str], default {}
|
|
817
|
+
packages : Dict[str, str], default: {}
|
|
749
818
|
Packages to use for this step. The key is the name of the package
|
|
750
819
|
and the value is the version to use.
|
|
751
|
-
|
|
752
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
753
|
-
python : str, optional, default None
|
|
820
|
+
python : str, optional, default: None
|
|
754
821
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
755
822
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
756
|
-
disabled : bool, default False
|
|
757
|
-
If set to True, disables @conda.
|
|
758
823
|
"""
|
|
759
824
|
...
|
|
760
825
|
|
|
761
826
|
@typing.overload
|
|
762
|
-
def
|
|
827
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
763
828
|
...
|
|
764
829
|
|
|
765
830
|
@typing.overload
|
|
766
|
-
def
|
|
831
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
767
832
|
...
|
|
768
833
|
|
|
769
|
-
def
|
|
834
|
+
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):
|
|
770
835
|
"""
|
|
771
|
-
Specifies the
|
|
836
|
+
Specifies the PyPI packages for the step.
|
|
772
837
|
|
|
773
838
|
Information in this decorator will augment any
|
|
774
|
-
attributes set in the `@
|
|
775
|
-
you can use `@
|
|
776
|
-
steps and use `@
|
|
839
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
|
840
|
+
you can use `@pypi_base` to set packages required by all
|
|
841
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
777
842
|
|
|
778
843
|
|
|
779
844
|
Parameters
|
|
780
845
|
----------
|
|
781
|
-
packages : Dict[str, str], default {}
|
|
846
|
+
packages : Dict[str, str], default: {}
|
|
782
847
|
Packages to use for this step. The key is the name of the package
|
|
783
848
|
and the value is the version to use.
|
|
784
|
-
|
|
785
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
786
|
-
python : str, optional, default None
|
|
849
|
+
python : str, optional, default: None
|
|
787
850
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
788
851
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
789
|
-
disabled : bool, default False
|
|
790
|
-
If set to True, disables @conda.
|
|
791
852
|
"""
|
|
792
853
|
...
|
|
793
854
|
|
|
794
855
|
@typing.overload
|
|
795
|
-
def
|
|
856
|
+
def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
|
796
857
|
"""
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
|
858
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
|
859
|
+
the execution of a step.
|
|
800
860
|
|
|
801
861
|
|
|
802
862
|
Parameters
|
|
803
863
|
----------
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
options : Dict[str, Any], default {}
|
|
809
|
-
Options passed to the card. The contents depend on the card type.
|
|
810
|
-
timeout : int, default 45
|
|
811
|
-
Interrupt reporting if it takes more than this many seconds.
|
|
864
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
|
865
|
+
List of secret specs, defining how the secrets are to be retrieved
|
|
866
|
+
role : str, optional, default: None
|
|
867
|
+
Role to use for fetching secrets
|
|
812
868
|
"""
|
|
813
869
|
...
|
|
814
870
|
|
|
815
871
|
@typing.overload
|
|
816
|
-
def
|
|
872
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
817
873
|
...
|
|
818
874
|
|
|
819
875
|
@typing.overload
|
|
820
|
-
def
|
|
876
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
821
877
|
...
|
|
822
878
|
|
|
823
|
-
def
|
|
879
|
+
def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None):
|
|
824
880
|
"""
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
|
881
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
|
882
|
+
the execution of a step.
|
|
828
883
|
|
|
829
884
|
|
|
830
885
|
Parameters
|
|
831
886
|
----------
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
options : Dict[str, Any], default {}
|
|
837
|
-
Options passed to the card. The contents depend on the card type.
|
|
838
|
-
timeout : int, default 45
|
|
839
|
-
Interrupt reporting if it takes more than this many seconds.
|
|
887
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
|
888
|
+
List of secret specs, defining how the secrets are to be retrieved
|
|
889
|
+
role : str, optional, default: None
|
|
890
|
+
Role to use for fetching secrets
|
|
840
891
|
"""
|
|
841
892
|
...
|
|
842
893
|
|
|
843
|
-
|
|
844
|
-
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]]]:
|
|
894
|
+
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]]:
|
|
845
895
|
"""
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
Information in this decorator will augment any
|
|
849
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
|
850
|
-
you can use `@pypi_base` to set packages required by all
|
|
851
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
Parameters
|
|
855
|
-
----------
|
|
856
|
-
packages : Dict[str, str], default: {}
|
|
857
|
-
Packages to use for this step. The key is the name of the package
|
|
858
|
-
and the value is the version to use.
|
|
859
|
-
python : str, optional, default: None
|
|
860
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
861
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
862
|
-
"""
|
|
863
|
-
...
|
|
864
|
-
|
|
865
|
-
@typing.overload
|
|
866
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
867
|
-
...
|
|
868
|
-
|
|
869
|
-
@typing.overload
|
|
870
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
871
|
-
...
|
|
872
|
-
|
|
873
|
-
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):
|
|
874
|
-
"""
|
|
875
|
-
Specifies the PyPI packages for the step.
|
|
876
|
-
|
|
877
|
-
Information in this decorator will augment any
|
|
878
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
|
879
|
-
you can use `@pypi_base` to set packages required by all
|
|
880
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
Parameters
|
|
884
|
-
----------
|
|
885
|
-
packages : Dict[str, str], default: {}
|
|
886
|
-
Packages to use for this step. The key is the name of the package
|
|
887
|
-
and the value is the version to use.
|
|
888
|
-
python : str, optional, default: None
|
|
889
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
890
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
891
|
-
"""
|
|
892
|
-
...
|
|
893
|
-
|
|
894
|
-
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]]:
|
|
895
|
-
"""
|
|
896
|
-
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.
|
|
897
|
-
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.
|
|
896
|
+
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.
|
|
897
|
+
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.
|
|
898
898
|
|
|
899
899
|
|
|
900
900
|
Parameters
|
|
@@ -934,6 +934,47 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
|
|
|
934
934
|
"""
|
|
935
935
|
...
|
|
936
936
|
|
|
937
|
+
@typing.overload
|
|
938
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
939
|
+
"""
|
|
940
|
+
Specifies the PyPI packages for all steps of the flow.
|
|
941
|
+
|
|
942
|
+
Use `@pypi_base` to set common packages required by all
|
|
943
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
944
|
+
|
|
945
|
+
Parameters
|
|
946
|
+
----------
|
|
947
|
+
packages : Dict[str, str], default: {}
|
|
948
|
+
Packages to use for this flow. The key is the name of the package
|
|
949
|
+
and the value is the version to use.
|
|
950
|
+
python : str, optional, default: None
|
|
951
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
952
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
953
|
+
"""
|
|
954
|
+
...
|
|
955
|
+
|
|
956
|
+
@typing.overload
|
|
957
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
958
|
+
...
|
|
959
|
+
|
|
960
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
|
961
|
+
"""
|
|
962
|
+
Specifies the PyPI packages for all steps of the flow.
|
|
963
|
+
|
|
964
|
+
Use `@pypi_base` to set common packages required by all
|
|
965
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
966
|
+
|
|
967
|
+
Parameters
|
|
968
|
+
----------
|
|
969
|
+
packages : Dict[str, str], default: {}
|
|
970
|
+
Packages to use for this flow. The key is the name of the package
|
|
971
|
+
and the value is the version to use.
|
|
972
|
+
python : str, optional, default: None
|
|
973
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
974
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
975
|
+
"""
|
|
976
|
+
...
|
|
977
|
+
|
|
937
978
|
@typing.overload
|
|
938
979
|
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]]:
|
|
939
980
|
"""
|
|
@@ -1035,46 +1076,105 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
|
1035
1076
|
"""
|
|
1036
1077
|
...
|
|
1037
1078
|
|
|
1038
|
-
|
|
1079
|
+
@typing.overload
|
|
1080
|
+
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]]:
|
|
1039
1081
|
"""
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
|
1043
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
|
1044
|
-
starts only after all sensors finish.
|
|
1082
|
+
Specifies the times when the flow should be run when running on a
|
|
1083
|
+
production scheduler.
|
|
1045
1084
|
|
|
1046
1085
|
|
|
1047
1086
|
Parameters
|
|
1048
1087
|
----------
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1088
|
+
hourly : bool, default False
|
|
1089
|
+
Run the workflow hourly.
|
|
1090
|
+
daily : bool, default True
|
|
1091
|
+
Run the workflow daily.
|
|
1092
|
+
weekly : bool, default False
|
|
1093
|
+
Run the workflow weekly.
|
|
1094
|
+
cron : str, optional, default None
|
|
1095
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
|
1096
|
+
specified by this expression.
|
|
1097
|
+
timezone : str, optional, default None
|
|
1098
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
|
1099
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
|
1100
|
+
"""
|
|
1101
|
+
...
|
|
1102
|
+
|
|
1103
|
+
@typing.overload
|
|
1104
|
+
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1105
|
+
...
|
|
1106
|
+
|
|
1107
|
+
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):
|
|
1108
|
+
"""
|
|
1109
|
+
Specifies the times when the flow should be run when running on a
|
|
1110
|
+
production scheduler.
|
|
1111
|
+
|
|
1112
|
+
|
|
1113
|
+
Parameters
|
|
1114
|
+
----------
|
|
1115
|
+
hourly : bool, default False
|
|
1116
|
+
Run the workflow hourly.
|
|
1117
|
+
daily : bool, default True
|
|
1118
|
+
Run the workflow daily.
|
|
1119
|
+
weekly : bool, default False
|
|
1120
|
+
Run the workflow weekly.
|
|
1121
|
+
cron : str, optional, default None
|
|
1122
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
|
1123
|
+
specified by this expression.
|
|
1124
|
+
timezone : str, optional, default None
|
|
1125
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
|
1126
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
|
1127
|
+
"""
|
|
1128
|
+
...
|
|
1129
|
+
|
|
1130
|
+
@typing.overload
|
|
1131
|
+
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]]:
|
|
1132
|
+
"""
|
|
1133
|
+
Specifies the Conda environment for all steps of the flow.
|
|
1134
|
+
|
|
1135
|
+
Use `@conda_base` to set common libraries required by all
|
|
1136
|
+
steps and use `@conda` to specify step-specific additions.
|
|
1137
|
+
|
|
1138
|
+
|
|
1139
|
+
Parameters
|
|
1140
|
+
----------
|
|
1141
|
+
packages : Dict[str, str], default {}
|
|
1142
|
+
Packages to use for this flow. The key is the name of the package
|
|
1143
|
+
and the value is the version to use.
|
|
1144
|
+
libraries : Dict[str, str], default {}
|
|
1145
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
1146
|
+
python : str, optional, default None
|
|
1147
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1148
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1149
|
+
disabled : bool, default False
|
|
1150
|
+
If set to True, disables Conda.
|
|
1151
|
+
"""
|
|
1152
|
+
...
|
|
1153
|
+
|
|
1154
|
+
@typing.overload
|
|
1155
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1156
|
+
...
|
|
1157
|
+
|
|
1158
|
+
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):
|
|
1159
|
+
"""
|
|
1160
|
+
Specifies the Conda environment for all steps of the flow.
|
|
1161
|
+
|
|
1162
|
+
Use `@conda_base` to set common libraries required by all
|
|
1163
|
+
steps and use `@conda` to specify step-specific additions.
|
|
1164
|
+
|
|
1165
|
+
|
|
1166
|
+
Parameters
|
|
1167
|
+
----------
|
|
1168
|
+
packages : Dict[str, str], default {}
|
|
1169
|
+
Packages to use for this flow. The key is the name of the package
|
|
1170
|
+
and the value is the version to use.
|
|
1171
|
+
libraries : Dict[str, str], default {}
|
|
1172
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
1173
|
+
python : str, optional, default None
|
|
1174
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1175
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1176
|
+
disabled : bool, default False
|
|
1177
|
+
If set to True, disables Conda.
|
|
1078
1178
|
"""
|
|
1079
1179
|
...
|
|
1080
1180
|
|
|
@@ -1171,95 +1271,46 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
|
1171
1271
|
"""
|
|
1172
1272
|
...
|
|
1173
1273
|
|
|
1174
|
-
|
|
1175
|
-
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]]:
|
|
1176
|
-
"""
|
|
1177
|
-
Specifies the times when the flow should be run when running on a
|
|
1178
|
-
production scheduler.
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
Parameters
|
|
1182
|
-
----------
|
|
1183
|
-
hourly : bool, default False
|
|
1184
|
-
Run the workflow hourly.
|
|
1185
|
-
daily : bool, default True
|
|
1186
|
-
Run the workflow daily.
|
|
1187
|
-
weekly : bool, default False
|
|
1188
|
-
Run the workflow weekly.
|
|
1189
|
-
cron : str, optional, default None
|
|
1190
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
|
1191
|
-
specified by this expression.
|
|
1192
|
-
timezone : str, optional, default None
|
|
1193
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
|
1194
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
|
1195
|
-
"""
|
|
1196
|
-
...
|
|
1197
|
-
|
|
1198
|
-
@typing.overload
|
|
1199
|
-
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1200
|
-
...
|
|
1201
|
-
|
|
1202
|
-
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):
|
|
1203
|
-
"""
|
|
1204
|
-
Specifies the times when the flow should be run when running on a
|
|
1205
|
-
production scheduler.
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
Parameters
|
|
1209
|
-
----------
|
|
1210
|
-
hourly : bool, default False
|
|
1211
|
-
Run the workflow hourly.
|
|
1212
|
-
daily : bool, default True
|
|
1213
|
-
Run the workflow daily.
|
|
1214
|
-
weekly : bool, default False
|
|
1215
|
-
Run the workflow weekly.
|
|
1216
|
-
cron : str, optional, default None
|
|
1217
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
|
1218
|
-
specified by this expression.
|
|
1219
|
-
timezone : str, optional, default None
|
|
1220
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
|
1221
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
|
1222
|
-
"""
|
|
1223
|
-
...
|
|
1224
|
-
|
|
1225
|
-
@typing.overload
|
|
1226
|
-
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
1227
|
-
"""
|
|
1228
|
-
Specifies the PyPI packages for all steps of the flow.
|
|
1229
|
-
|
|
1230
|
-
Use `@pypi_base` to set common packages required by all
|
|
1231
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
1232
|
-
|
|
1233
|
-
Parameters
|
|
1234
|
-
----------
|
|
1235
|
-
packages : Dict[str, str], default: {}
|
|
1236
|
-
Packages to use for this flow. The key is the name of the package
|
|
1237
|
-
and the value is the version to use.
|
|
1238
|
-
python : str, optional, default: None
|
|
1239
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1240
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1241
|
-
"""
|
|
1242
|
-
...
|
|
1243
|
-
|
|
1244
|
-
@typing.overload
|
|
1245
|
-
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1246
|
-
...
|
|
1247
|
-
|
|
1248
|
-
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
|
1274
|
+
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]]:
|
|
1249
1275
|
"""
|
|
1250
|
-
|
|
1276
|
+
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)
|
|
1277
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
|
1278
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
|
1279
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
|
1280
|
+
starts only after all sensors finish.
|
|
1251
1281
|
|
|
1252
|
-
Use `@pypi_base` to set common packages required by all
|
|
1253
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
1254
1282
|
|
|
1255
1283
|
Parameters
|
|
1256
1284
|
----------
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1285
|
+
timeout : int
|
|
1286
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
|
1287
|
+
poke_interval : int
|
|
1288
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
|
1289
|
+
mode : str
|
|
1290
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
|
1291
|
+
exponential_backoff : bool
|
|
1292
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
|
1293
|
+
pool : str
|
|
1294
|
+
the slot pool this task should run in,
|
|
1295
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
|
1296
|
+
soft_fail : bool
|
|
1297
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
|
1298
|
+
name : str
|
|
1299
|
+
Name of the sensor on Airflow
|
|
1300
|
+
description : str
|
|
1301
|
+
Description of sensor in the Airflow UI
|
|
1302
|
+
bucket_key : Union[str, List[str]]
|
|
1303
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
|
1304
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
|
1305
|
+
bucket_name : str
|
|
1306
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
|
1307
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
|
1308
|
+
wildcard_match : bool
|
|
1309
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
|
1310
|
+
aws_conn_id : str
|
|
1311
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
|
1312
|
+
verify : bool
|
|
1313
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
|
1263
1314
|
"""
|
|
1264
1315
|
...
|
|
1265
1316
|
|
|
@@ -1298,54 +1349,3 @@ def project(*, name: str, branch: typing.Optional[str] = None, production: bool
|
|
|
1298
1349
|
"""
|
|
1299
1350
|
...
|
|
1300
1351
|
|
|
1301
|
-
@typing.overload
|
|
1302
|
-
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]]:
|
|
1303
|
-
"""
|
|
1304
|
-
Specifies the Conda environment for all steps of the flow.
|
|
1305
|
-
|
|
1306
|
-
Use `@conda_base` to set common libraries required by all
|
|
1307
|
-
steps and use `@conda` to specify step-specific additions.
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
Parameters
|
|
1311
|
-
----------
|
|
1312
|
-
packages : Dict[str, str], default {}
|
|
1313
|
-
Packages to use for this flow. The key is the name of the package
|
|
1314
|
-
and the value is the version to use.
|
|
1315
|
-
libraries : Dict[str, str], default {}
|
|
1316
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
1317
|
-
python : str, optional, default None
|
|
1318
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1319
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1320
|
-
disabled : bool, default False
|
|
1321
|
-
If set to True, disables Conda.
|
|
1322
|
-
"""
|
|
1323
|
-
...
|
|
1324
|
-
|
|
1325
|
-
@typing.overload
|
|
1326
|
-
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1327
|
-
...
|
|
1328
|
-
|
|
1329
|
-
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):
|
|
1330
|
-
"""
|
|
1331
|
-
Specifies the Conda environment for all steps of the flow.
|
|
1332
|
-
|
|
1333
|
-
Use `@conda_base` to set common libraries required by all
|
|
1334
|
-
steps and use `@conda` to specify step-specific additions.
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
Parameters
|
|
1338
|
-
----------
|
|
1339
|
-
packages : Dict[str, str], default {}
|
|
1340
|
-
Packages to use for this flow. The key is the name of the package
|
|
1341
|
-
and the value is the version to use.
|
|
1342
|
-
libraries : Dict[str, str], default {}
|
|
1343
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
1344
|
-
python : str, optional, default None
|
|
1345
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1346
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1347
|
-
disabled : bool, default False
|
|
1348
|
-
If set to True, disables Conda.
|
|
1349
|
-
"""
|
|
1350
|
-
...
|
|
1351
|
-
|